From 186ec72fb9839ccf61c32f7edb0e1a844afcc1f6 Mon Sep 17 00:00:00 2001 From: Gael Le Bihan Date: Thu, 18 Feb 2016 12:33:41 +0100 Subject: [PATCH] version 1.18.1 --- Cesium.js | 204 +++++++++++------- Widgets/Animation/Animation.css | 2 +- Widgets/Animation/lighter.css | 2 +- Widgets/BaseLayerPicker/BaseLayerPicker.css | 2 +- Widgets/BaseLayerPicker/lighter.css | 2 +- Widgets/CesiumInspector/CesiumInspector.css | 2 +- Widgets/CesiumWidget/CesiumWidget.css | 2 +- Widgets/CesiumWidget/lighter.css | 2 +- Widgets/FullscreenButton/FullscreenButton.css | 2 +- Widgets/Geocoder/Geocoder.css | 2 +- Widgets/Geocoder/lighter.css | 2 +- Widgets/InfoBox/InfoBox.css | 2 +- .../NavigationHelpButton.css | 2 +- Widgets/NavigationHelpButton/lighter.css | 2 +- .../PerformanceWatchdog.css | 2 +- Widgets/SceneModePicker/SceneModePicker.css | 2 +- .../SelectionIndicator/SelectionIndicator.css | 2 +- Widgets/Timeline/Timeline.css | 2 +- Widgets/Timeline/lighter.css | 2 +- Widgets/Viewer/Viewer.css | 2 +- Widgets/lighter.css | 2 +- Widgets/lighterShared.css | 2 +- Widgets/shared.css | 2 +- Widgets/widgets.css | 2 +- Workers/cesiumWorkerBootstrapper.js | 6 +- Workers/combineGeometry.js | 11 +- Workers/createBoxGeometry.js | 7 +- Workers/createBoxOutlineGeometry.js | 7 +- Workers/createCircleGeometry.js | 11 +- Workers/createCircleOutlineGeometry.js | 8 +- Workers/createCorridorGeometry.js | 13 +- Workers/createCorridorOutlineGeometry.js | 12 +- Workers/createCylinderGeometry.js | 8 +- Workers/createCylinderOutlineGeometry.js | 7 +- Workers/createEllipseGeometry.js | 11 +- Workers/createEllipseOutlineGeometry.js | 8 +- Workers/createEllipsoidGeometry.js | 7 +- Workers/createEllipsoidOutlineGeometry.js | 7 +- Workers/createGeometry.js | 26 ++- Workers/createPolygonGeometry.js | 14 +- Workers/createPolygonOutlineGeometry.js | 13 +- Workers/createPolylineGeometry.js | 9 +- Workers/createPolylineVolumeGeometry.js | 14 +- .../createPolylineVolumeOutlineGeometry.js | 13 +- Workers/createRectangleGeometry.js | 15 +- Workers/createRectangleOutlineGeometry.js | 12 +- Workers/createSimplePolylineGeometry.js | 9 +- Workers/createSphereGeometry.js | 7 +- Workers/createSphereOutlineGeometry.js | 7 +- Workers/createVerticesFromHeightmap.js | 176 ++++++++++++++- .../createVerticesFromQuantizedTerrainMesh.js | 175 ++++++++++++++- Workers/createWallGeometry.js | 13 +- Workers/createWallOutlineGeometry.js | 12 +- Workers/sanitizeHtml.js | 23 -- Workers/transferTypedArrayTest.js | 2 +- Workers/upsampleQuantizedTerrainMesh.js | 177 ++++++++++++++- 56 files changed, 835 insertions(+), 255 deletions(-) delete mode 100644 Workers/sanitizeHtml.js diff --git a/Cesium.js b/Cesium.js index 664fd16..7d9f015 100644 --- a/Cesium.js +++ b/Cesium.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ * See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details. */ /** - * almond 0.2.6 Copyright (c) 2011-2012, The Dojo Foundation All Rights Reserved. + * @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/almond for details */ @@ -76,33 +76,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/** - * @license - * - * Grauw URI utilities - * - * See: http://hg.grauw.nl/grauw-lib/file/tip/src/uri.js - * - * @author Laurens Holst (http://www.grauw.nl/) - * - * Copyright 2012 Laurens Holst - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// Copyright 2012 Google Inc., Apache 2.0 license. - /** @license sprintf.js from the php.js project - https://github.com/kvz/phpjs @@ -230,6 +203,33 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/** + * @license + * + * Grauw URI utilities + * + * See: http://hg.grauw.nl/grauw-lib/file/tip/src/uri.js + * + * @author Laurens Holst (http://www.grauw.nl/) + * + * Copyright 2012 Laurens Holst + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Copyright 2012 Google Inc., Apache 2.0 license. + /** @license tween.js - https://github.com/sole/tween.js @@ -314,6 +314,45 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/*! + * Autolinker.js + * 0.17.1 + * + * Copyright(c) 2015 Gregory Jacobs + * MIT Licensed. http://www.opensource.org/licenses/mit-license.php + * + * https://github.com/gregjacobs/Autolinker.js + */ + +/** +@license + Copyright (c) 2013 Gildas Lormeau. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, + INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**/ + /** * @license * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. @@ -375,48 +414,65 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * MIT license */ -!function(){var e,t,r;!function(i){function n(e,t){return C.call(e,t)}function o(e,t){var r,i,n,o,a,s,l,u,c,h,d=t&&t.split("/"),m=_.map,p=m&&m["*"]||{};if(e&&"."===e.charAt(0))if(t){for(d=d.slice(0,d.length-1),e=d.concat(e.split("/")),u=0;u0&&(e.splice(u-1,2),u-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((d||p)&&m){for(r=e.split("/"),u=r.length;u>0;u-=1){if(i=r.slice(0,u).join("/"),d)for(c=d.length;c>0;c-=1)if(n=m[d.slice(0,c).join("/")],n&&(n=n[i])){o=n,a=u;break}if(o)break;!s&&p&&p[i]&&(s=p[i],l=u)}!o&&s&&(o=s,a=l),o&&(r.splice(0,a,o),e=r.join("/"))}return e}function a(e,t){return function(){return m.apply(i,w.call(arguments,0).concat([e,t]))}}function s(e){return function(t){return o(t,e)}}function l(e){return function(t){v[e]=t}}function u(e){if(n(g,e)){var t=g[e];delete g[e],y[e]=!0,d.apply(i,t)}if(!n(v,e)&&!n(y,e))throw new Error("No "+e);return v[e]}function c(e){var t,r=e?e.indexOf("!"):-1;return r>-1&&(t=e.substring(0,r),e=e.substring(r+1,e.length)),[t,e]}function h(e){return function(){return _&&_.config&&_.config[e]||{}}}var d,m,p,f,v={},g={},_={},y={},C=Object.prototype.hasOwnProperty,w=[].slice;p=function(e,t){var r,i=c(e),n=i[0];return e=i[1],n&&(n=o(n,t),r=u(n)),n?e=r&&r.normalize?r.normalize(e,s(t)):o(e,t):(e=o(e,t),i=c(e),n=i[0],e=i[1],n&&(r=u(n))),{f:n?n+"!"+e:e,n:e,pr:n,p:r}},f={require:function(e){return a(e)},exports:function(e){var t=v[e];return"undefined"!=typeof t?t:v[e]={}},module:function(e){return{id:e,uri:"",exports:v[e],config:h(e)}}},d=function(e,t,r,o){var s,c,h,d,m,_,C=[];if(o=o||e,"function"==typeof r){for(t=!t.length&&r.length?["require","exports","module"]:t,m=0;m>>0,u=Math.max(0,Math.min(r,_)),h=[],c=_-u+1,d=[],m=a(),u)for(v=m.progress,f=function(e){d.push(e),--c||(p=f=g,m.reject(d))},p=function(e){h.push(e),--u||(p=f=g,m.resolve(h))},y=0;_>y;++y)y in t&&e(t[y],l,s,v);else m.resolve(h);return m.then(i,n,o)})}function u(e,t,r,i){function n(e){return t?t(e[0]):e[0]}return l(e,1,n,r,i)}function c(e,t,r,i){return v(1,arguments),d(e,_).then(t,r,i)}function h(){return d(arguments,_)}function d(t,r){return e(t,function(t){var i,n,o,s,l,u;if(o=n=t.length>>>0,i=[],u=a(),o)for(s=function(t,n){e(t,r).then(function(e){i[n]=e,--o||u.resolve(i)},u.reject)},l=0;n>l;l++)l in t?s(t[l],l):--o;else u.resolve(i);return u.promise})}function m(t,r){var i=C.call(arguments,1);return e(t,function(t){var n;return n=t.length,i[0]=function(t,i,o){return e(t,function(t){return e(i,function(e){return r(t,e,o,n)})})},y.apply(t,i)})}function p(t,r,i){var n=arguments.length>2;return e(t,function(e){return e=n?i:e,r.resolve(e),e},function(e){return r.reject(e),o(e)},r.progress)}function f(e,t){for(var r,i=0;r=e[i++];)r(t)}function v(e,t){for(var r,i=t.length;i>e;)if(r=t[--i],null!=r&&"function"!=typeof r)throw new Error("arg "+i+" must be a function")}function g(){}function _(e){return e}var y,C,w;return e.defer=a,e.resolve=t,e.reject=r,e.join=h,e.all=c,e.map=d,e.reduce=m,e.any=u,e.some=l,e.chain=p,e.isPromise=s,i.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,r,i,n,o;if(o=0,t=Object(this),n=t.length>>>0,r=arguments,r.length<=1)for(;;){if(o in t){i=t[o++];break}if(++o>=n)throw new TypeError}else i=r[1];for(;n>o;++o)o in t&&(i=e(i,t[o],o,t));return i},e})}("function"==typeof r&&r.amd?r:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),r("Core/defined",[],function(){"use strict";var e=function(e){return void 0!==e};return e}),r("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}),r("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),r("Core/Credit",["./defined","./defineProperties","./DeveloperError"],function(e,t){"use strict";var r=function(t,r,i){var n=e(i),o=e(r),a=e(t);a||o||(t=i),this._text=t,this._imageUrl=r,this._link=i,this._hasLink=n,this._hasImage=o};return t(r.prototype,{text:{get:function(){return this._text}},imageUrl:{get:function(){return this._imageUrl}},link:{get:function(){return this._link}}}),r.prototype.hasImage=function(){return this._hasImage},r.prototype.hasLink=function(){return this._hasLink},r.equals=function(t,r){var i=!e(t),n=!e(r);return t===r||(i&&n||!i&&!n)&&t._text===r._text&&t._imageUrl===r._imageUrl&&t._link===r._link},r.prototype.equals=function(e){return r.equals(this,e)},r}),r("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),r("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),r("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>>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>>1^t[1&e];for(;r>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),r("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};r.EPSILON1=.1,r.EPSILON2=.01,r.EPSILON3=.001,r.EPSILON4=1e-4,r.EPSILON5=1e-5,r.EPSILON6=1e-6,r.EPSILON7=1e-7,r.EPSILON8=1e-8,r.EPSILON9=1e-9,r.EPSILON10=1e-10,r.EPSILON11=1e-11,r.EPSILON12=1e-12,r.EPSILON13=1e-13,r.EPSILON14=1e-14,r.EPSILON15=1e-15,r.EPSILON16=1e-16,r.EPSILON17=1e-17,r.EPSILON18=1e-18,r.EPSILON19=1e-19,r.EPSILON20=1e-20,r.GRAVITATIONALPARAMETER=3986004418e5,r.SOLAR_RADIUS=6955e5,r.LUNAR_RADIUS=1737400,r.SIXTY_FOUR_KILOBYTES=65536,r.sign=function(e){return e>0?1:0>e?-1:0},r.signNotZero=function(e){return 0>e?-1:1},r.toSNorm=function(e){return Math.round(255*(.5*r.clamp(e,-1,1)+.5))},r.fromSNorm=function(e){return 2*(r.clamp(e,0,255)/255)-1},r.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},r.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},r.lerp=function(e,t,r){return(1-r)*e+r*t},r.PI=Math.PI,r.ONE_OVER_PI=1/Math.PI,r.PI_OVER_TWO=.5*Math.PI,r.PI_OVER_THREE=Math.PI/3,r.PI_OVER_FOUR=Math.PI/4,r.PI_OVER_SIX=Math.PI/6,r.THREE_PI_OVER_TWO=.5*3*Math.PI,r.TWO_PI=2*Math.PI,r.ONE_OVER_TWO_PI=1/(2*Math.PI),r.RADIANS_PER_DEGREE=Math.PI/180,r.DEGREES_PER_RADIAN=180/Math.PI,r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600,r.toRadians=function(e){return e*r.RADIANS_PER_DEGREE},r.toDegrees=function(e){return e*r.DEGREES_PER_RADIAN},r.convertLongitudeRange=function(e){var t=r.TWO_PI,i=e-Math.floor(e/t)*t;return i<-Math.PI?i+t:i>=Math.PI?i-t:i},r.negativePiToPi=function(e){for(var t=r.EPSILON10,i=r.PI,n=r.TWO_PI;-(i+t)>e;)e+=n;if(-i>e)return-i;for(;e>i+t;)e-=n;return e>i?i:e},r.zeroToTwoPi=function(e){var t=e%r.TWO_PI;return 0>t?(t+r.TWO_PI)%r.TWO_PI:t},r.equalsEpsilon=function(e,r,i){return i=t(i,0),Math.abs(e-r)<=i};var i=[1];r.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;e>=n;n++)i.push(r*n);return i[e]},r.incrementWrap=function(e,r,i){return i=t(i,0),++e,e>r&&(e=i),e},r.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},r.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},r.clamp=function(e,t,r){return t>e?t:e>r?r:e};var n=new e;return r.setRandomNumberSeed=function(t){n=new e(t)},r.nextRandomNumber=function(){return n.random()},r.acosClamped=function(e){return Math.acos(r.clamp(e,-1,1))},r.asinClamped=function(e){return Math.asin(r.clamp(e,-1,1))},r}),r("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n){"use strict";var o=function(t,r,i){this.x=e(t,0),this.y=e(r,0),this.z=e(i,0)};o.fromSpherical=function(r,i){t(i)||(i=new o);var n=r.clock,a=r.cone,s=e(r.magnitude,1),l=s*Math.sin(a);return i.x=l*Math.cos(n),i.y=l*Math.sin(n),i.z=s*Math.cos(a),i},o.fromElements=function(e,r,i,n){return t(n)?(n.x=e,n.y=r,n.z=i,n):new o(e,r,i)},o.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new o(e.x,e.y,e.z):void 0},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,r,i){i=e(i,0),r[i++]=t.x,r[i++]=t.y,r[i]=t.z},o.unpack=function(r,i,n){return i=e(i,0),t(n)||(n=new o),n.x=r[i++],n.y=r[i++],n.z=r[i],n},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 a=new o;o.distance=function(e,t){return o.subtract(e,t,a),o.magnitude(a)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},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.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,i){return o.multiplyByScalar(t,r,s),i=o.multiplyByScalar(e,1-r,i),o.add(s,i,i)};var l=new o,u=new o;o.angleBetween=function(e,t){o.normalize(e,l),o.normalize(t,u);var r=o.dot(l,u),i=o.magnitude(o.cross(l,u,l));return Math.atan2(i,r)};var c=new o;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?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,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z},o.equalsEpsilon=function(e,r,i){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=i&&Math.abs(e.y-r.y)<=i&&Math.abs(e.z-r.z)<=i},o.cross=function(e,t,r){var i=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-i*l,h=i*s-n*a;return r.x=u,r.y=c,r.z=h,r},o.fromDegrees=function(e,t,r,i,a){var s=n.toRadians(e),l=n.toRadians(t);return o.fromRadians(s,l,r,i,a)};var h=new o,d=new o,m=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(r,i,n,a,s){n=e(n,0);var l=t(a)?a.radiiSquared:m,u=Math.cos(i);h.x=u*Math.cos(r),h.y=u*Math.sin(r),h.z=Math.sin(i),h=o.normalize(h,h),o.multiplyComponents(l,h,d);var c=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,c,d),h=o.multiplyByScalar(h,n,h),t(s)||(s=new o),o.add(d,h,s)},o.fromDegreesArray=function(e,t,r){for(var i=new Array(e.length),a=0;aa;a+=2){var s=e[a],l=e[a+1];i[a/2]=o.fromRadians(s,l,0,r,i[a/2])}return i},o.fromDegreesArrayHeights=function(e,t,r){for(var i=new Array(e.length),a=0;aa;a+=3){var s=e[a],l=e[a+1],u=e[a+2];i[a/3]=o.fromRadians(s,l,u,r,i[a/3])}return i},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){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),r("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n){"use strict";var o=function(t,r,i){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(i,0)};return o.fromRadians=function(r,i,n,a){return n=e(n,0),t(a)?(a.longitude=r,a.latitude=i,a.height=n,a):new o(r,i,n)},o.fromDegrees=function(e,t,r,i){return e=n.toRadians(e),t=n.toRadians(t),o.fromRadians(e,t,r,i)},o.clone=function(e,r){return t(e)?t(r)?(r.longitude=e.longitude,r.latitude=e.latitude,r.height=e.height,r):new o(e.longitude,e.latitude,e.height):void 0},o.equals=function(e,r){return e===r||t(e)&&t(r)&&e.longitude===r.longitude&&e.latitude===r.latitude&&e.height===r.height},o.equalsEpsilon=function(e,r,i){return e===r||t(e)&&t(r)&&Math.abs(e.longitude-r.longitude)<=i&&Math.abs(e.latitude-r.latitude)<=i&&Math.abs(e.height-r.height)<=i},o.ZERO=i(new o(0,0,0)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},o}),r("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(t,i,n,o){i=r(i,0),n=r(n,0),o=r(o,0),t._radii=new e(i,n,o),t._radiiSquared=new e(i*i,n*n,o*o),t._radiiToTheFourth=new e(i*i*i*i,n*n*n*n,o*o*o*o),t._oneOverRadii=new e(0===i?0:1/i,0===n?0:1/n,0===o?0:1/o),t._oneOverRadiiSquared=new e(0===i?0:1/(i*i),0===n?0:1/(n*n),0===o?0:1/(o*o)),t._minimumRadius=Math.min(i,n,o),t._maximumRadius=Math.max(i,n,o),t._centerToleranceSquared=s.EPSILON1}var u=function(e,t,r){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,l(this,e,t,r)};n(u.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}}}),u.clone=function(t,r){if(!i(t))return void 0;var n=t._radii;return i(r)?(e.clone(n,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 u(n.x,n.y,n.z)},u.fromCartesian3=function(e,t){return i(t)||(t=new u),i(e)?(l(t,e.x,e.y,e.z),t):t},u.WGS84=a(new u(6378137,6378137,6356752.314245179)),u.UNIT_SPHERE=a(new u(1,1,1)),u.MOON=a(new u(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.geocentricSurfaceNormal=e.normalize,u.prototype.geodeticSurfaceNormalCartographic=function(t,r){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 i(r)||(r=new e),r.x=s,r.y=l,r.z=u,e.normalize(r,r)},u.prototype.geodeticSurfaceNormal=function(t,r){return i(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var c=new e,h=new e;u.prototype.cartographicToCartesian=function(t,r){var n=c,o=h;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),i(r)||(r=new e),e.add(o,n,r)},u.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var n=0;r>n;n++)t[n]=this.cartographicToCartesian(e[n],t[n]);return t};var d=new e,m=new e,p=new e;u.prototype.cartesianToCartographic=function(r,n){var o=this.scaleToGeodeticSurface(r,m);if(!i(o))return void 0;var a=this.geodeticSurfaceNormal(o,d),l=e.subtract(r,o,p),u=Math.atan2(a.y,a.x),c=Math.asin(a.z),h=s.sign(e.dot(l,r))*e.magnitude(l);return i(n)?(n.longitude=u,n.latitude=c,n.height=h,n):new t(u,c,h)},u.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var n=0;r>n;++n)t[n]=this.cartesianToCartographic(e[n],t[n]);return t};var f=new e,v=new e;return u.prototype.scaleToGeodeticSurface=function(t,r){var n=t.x,o=t.y,a=t.z,l=this._oneOverRadii,u=l.x,c=l.y,h=l.z,d=n*n*u*u,m=o*o*c*c,p=a*a*h*h,g=d+m+p,_=Math.sqrt(1/g),y=e.multiplyByScalar(t,_,f);if(gs.EPSILON12);return i(r)?(r.x=n*P,r.y=o*A,r.z=a*M,r):new e(n*P,o*A,a*M)},u.prototype.scaleToGeocentricSurface=function(t,r){i(r)||(r=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,r)},u.prototype.transformPositionToScaledSpace=function(t,r){return i(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},u.prototype.transformPositionFromScaledSpace=function(t,r){return i(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},u.prototype.equals=function(t){return this===t||i(t)&&e.equals(this._radii,t._radii)},u.prototype.toString=function(){return this._radii.toString()},u}),r("Core/Event",["./defined","./defineProperties","./DeveloperError"],function(e,t){"use strict";var r=function(){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 r=this;return function(){r.removeEventListener(e,t)}},r.prototype.removeEventListener=function(e,t){for(var r=this._listeners,i=this._scopes,n=-1,o=0;ot;t++){var o=r[t];e(o)&&r[t].apply(i[t],arguments)}var a=this._toRemove;for(n=a.length,t=0;n>t;t++){var s=a[t];r.splice(s,1),i.splice(s,1)}a.length=0,this._insideRaiseEvent=!1},r}),r("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n){"use strict";var o=function(t,r){this.x=e(t,0),this.y=e(r,0)};o.fromElements=function(e,r,i){return t(i)?(i.x=e,i.y=r,i):new o(e,r)},o.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new o(e.x,e.y):void 0},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(t,r,i){i=e(i,0),r[i++]=t.x,r[i]=t.y},o.unpack=function(r,i,n){return i=e(i,0),t(n)||(n=new o),n.x=r[i++],n.y=r[i],n},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 a=new o;o.distance=function(e,t){return o.subtract(e,t,a),o.magnitude(a)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},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.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,i){return o.multiplyByScalar(t,r,s),i=o.multiplyByScalar(e,1-r,i),o.add(s,i,i)};var l=new o,u=new o;o.angleBetween=function(e,t){return o.normalize(e,l),o.normalize(t,u),n.acosClamped(o.dot(l,u))};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?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y},o.equalsEpsilon=function(e,r,i){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=i&&Math.abs(e.y-r.y)<=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){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),r("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,i,n,o,a){"use strict";var s=function(e){this._ellipsoid=r(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,r){var n=this._semimajorAxis,o=t.longitude*n,a=t.latitude*n,s=t.height;return i(r)?(r.x=o,r.y=a,r.z=s,r):new e(o,a,s)},s.prototype.unproject=function(e,r){var n=this._oneOverSemimajorAxis,o=e.x*n,a=e.y*n,s=e.z;return i(r)?(r.longitude=o,r.latitude=a,r.height=s,r):new t(o,a,s)},s}),r("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,i,n,o,a){"use strict";var s=function(e,r,i,n){this.west=t(e,0),this.south=t(r,0),this.east=t(i,0),this.north=t(n,0)};s.fromDegrees=function(e,i,n,o,l){return e=a.toRadians(t(e,0)),i=a.toRadians(t(i,0)),n=a.toRadians(t(n,0)),o=a.toRadians(t(o,0)),r(l)?(l.west=e,l.south=i,l.east=n,l.north=o,l):new s(e,i,n,o)},s.fromCartographicArray=function(e,t){for(var i=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,l=0,u=e.length;u>l;l++){var c=e[l];i=Math.min(i,c.longitude),n=Math.max(n,c.longitude),o=Math.min(o,c.latitude),a=Math.max(a,c.latitude)}return r(t)?(t.west=i,t.south=o,t.east=n,t.north=a,t):new s(i,o,n,a)},s.packedLength=4,s.pack=function(e,r,i){i=t(i,0),r[i++]=e.west,r[i++]=e.south,r[i++]=e.east,r[i]=e.north},s.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new s),n.west=e[i++],n.south=e[i++],n.east=e[i++],n.north=e[i],n},s.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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(){},s.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)},s.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)},s.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)},s.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)},s.center=function(t,i){var n=t.east,o=t.west,s=.5*(o+n);return o>n&&(s=a.negativePiToPi(s+a.PI)),r(i)?(i.longitude=s,i.latitude=.5*(t.south+t.north),i.height=0,i):new e(s,.5*(t.south+t.north))},s.intersectWith=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),l=Math.min(e.north,t.north);return r(i)?(i.west=n,i.south=o,i.east=a,i.north=l,i):new s(n,o,a,l)},s.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},s.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var l=new e;return s.subsample=function(e,i,o,s){i=t(i,n.WGS84),o=t(o,0),r(s)||(s=[]);var u=0,c=e.north,h=e.south,d=e.east,m=e.west,p=l;p.height=o,p.longitude=m,p.latitude=c,s[u]=i.cartographicToCartesian(p,s[u]),u++,p.longitude=d,s[u]=i.cartographicToCartesian(p,s[u]),u++,p.latitude=h,s[u]=i.cartographicToCartesian(p,s[u]),u++,p.longitude=m,s[u]=i.cartographicToCartesian(p,s[u]),u++,p.latitude=0>c?c:h>0?h:0;for(var f=1;8>f;++f){var v=-Math.PI+f*a.PI_OVER_TWO;v>m&&d>v&&(p.longitude=v,s[u]=i.cartographicToCartesian(p,s[u]),u++)}return 0===p.latitude&&(p.longitude=m,s[u]=i.cartographicToCartesian(p,s[u]),u++,p.longitude=d,s[u]=i.cartographicToCartesian(p,s[u]),u++),s.length=u,s},s.MAX_VALUE=o(new s(-Math.PI,-a.PI_OVER_TWO,Math.PI,a.PI_OVER_TWO)),s}),r("Core/GeographicTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./GeographicProjection","./Math","./Rectangle"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(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 i(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<o.north||t.latitudeo.east)return void 0;var a=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),l=(o.east-o.west)/a,u=(o.north-o.south)/s,c=0|(t.longitude-o.west)/l;c>=a&&(c=a-1);var h=0|(o.north-t.latitude)/u;return h>=s&&(h=s-1),r(n)?(n.x=c,n.y=h,n):new e(c,h)},u}),r("Core/getImagePixels",["./defined"],function(e){"use strict";var t={},r=function(r,i,n){e(i)||(i=r.width),e(n)||(n=r.height);var o=t[i];e(o)||(o={},t[i]=o);var a=o[n];if(!e(a)){var s=document.createElement("canvas");s.width=i,s.height=n,a=s.getContext("2d"),a.globalCompositeOperation="copy",o[n]=a}return a.drawImage(r,0,0,i,n),a.getImageData(0,0,i,n).data};return r}),r("Core/HeightmapTessellator",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,i,n,o,a){"use strict";var s={};return s.DEFAULT_STRUCTURE=o({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1}),s.computeVertices=function(i){var o,l,u,c,h=Math.cos,d=Math.sin,m=Math.sqrt,p=Math.atan,f=Math.exp,v=a.PI_OVER_TWO,g=a.toRadians,_=i.vertices,y=i.heightmap,C=i.width,w=i.height,S=i.skirtHeight,E=t(i.isGeographic,!0),b=t(i.ellipsoid,n.WGS84),T=1/b.maximumRadius,x=i.nativeRectangle,P=i.rectangle;r(P)?(o=P.west,l=P.south,u=P.east,c=P.north):E?(o=g(x.west),l=g(x.south),u=g(x.east),c=g(x.north)):(o=x.west*T,l=v-2*p(f(-x.south*T)),u=x.east*T,c=v-2*p(f(-x.north*T))); -var A=t(i.relativeToCenter,e.ZERO),M=t(i.structure,s.DEFAULT_STRUCTURE),D=t(M.heightScale,s.DEFAULT_STRUCTURE.heightScale),I=t(M.heightOffset,s.DEFAULT_STRUCTURE.heightOffset),O=t(M.elementsPerHeight,s.DEFAULT_STRUCTURE.elementsPerHeight),R=t(M.stride,s.DEFAULT_STRUCTURE.stride),L=t(M.elementMultiplier,s.DEFAULT_STRUCTURE.elementMultiplier),N=t(M.isBigEndian,s.DEFAULT_STRUCTURE.isBigEndian),F=(x.east-x.west)/(C-1),B=(x.north-x.south)/(w-1),z=b.radiiSquared,V=z.x,k=z.y,U=z.z,W=0,G=65536,H=-65536,q=0,j=w,Y=0,X=C;S>0&&(--q,++j,--Y,++X);for(var Z=q;j>Z;++Z){var Q=Z;0>Q&&(Q=0),Q>=w&&(Q=w-1);var J=x.north-B*Q;J=E?g(J):v-2*p(f(-J*T));for(var K=h(J),$=d(J),et=U*$,tt=(J-l)/(c-l),rt=Y;X>rt;++rt){var it=rt;0>it&&(it=0),it>=C&&(it=C-1);var nt=x.west+F*it;E?nt=g(nt):nt*=T;var ot,at=Q*C*R+it*R;if(1===O)ot=y[at];else{ot=0;var st;if(N)for(st=0;O>st;++st)ot=ot*L+y[at+st];else for(st=O-1;st>=0;--st)ot=ot*L+y[at+st]}ot=ot*D+I,H=Math.max(H,ot),G=Math.min(G,ot),(rt!==it||Z!==Q)&&(ot-=S);var lt=K*h(nt),ut=K*d(nt),ct=V*lt,ht=k*ut,dt=m(ct*lt+ht*ut+et*$),mt=1/dt,pt=ct*mt,ft=ht*mt,vt=et*mt;_[W++]=pt+lt*ot-A.x,_[W++]=ft+ut*ot-A.y,_[W++]=vt+$*ot-A.z,_[W++]=ot;var gt=(nt-o)/(u-o);_[W++]=gt,_[W++]=tt}}return{maximumHeight:H,minimumHeight:G}},s}),r("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=i.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 o.test(t)?t:e.toUpperCase()}function r(e,t,r,i){return(t||"")+r.toLowerCase()+(i||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var i=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,r).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 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()):(r.path=t.authority&&""==t.path?"/"+this.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=[],i=""==t[0];for(i&&t.shift(),""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);("."==e||".."==e)&&r.push(""),i&&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}),r("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","require"],function(e,t,r,i){"use strict";function n(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;r>t;++t){var i=e[t].getAttribute("src"),n=h.exec(i);if(null!==n)return n[1]}return void 0}function o(){if(t(l))return l;var i;if(i="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:n(),!t(i))throw new r("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new e(i).resolve(new e(document.location.href))}function a(e){return i.toUrl("../"+e)}function s(t){return new e(t).resolve(o()).toString()}var l,u,c,h=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i,d=function(e){t(u)||(u=t(i.toUrl)?a:s),t(c)||(c=document.createElement("a"));var r=u(e);return c.href=r,c.href=c.href,c.href};return d._cesiumScriptRegex=h,d}),r("Core/destroyObject",["./defaultValue","./DeveloperError"],function(e,t){"use strict";function r(){return!0}var i=function(i,n){function o(){throw new t(n)}n=e(n,"This object was destroyed, i.e., destroy() was called.");for(var a in i)"function"==typeof i[a]&&(i[a]=o);return i.isDestroyed=r,void 0};return i}),r("Core/isCrossOriginUrl",["./defined"],function(e){"use strict";var t,r=function(r){e(t)||(t=document.createElement("a")),t.href=window.location.href;var i=t.host,n=t.protocol;return t.href=r,t.href=t.href,n!==t.protocol||i!==t.host};return r}),r("Core/TaskProcessor",["../ThirdParty/Uri","../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./destroyObject","./isCrossOriginUrl","require"],function(e,t,r,i,n,o,a,s){"use strict";function l(){if(!n(p._canTransferArrayBuffer)){var e=new Worker(c("Workers/transferTypedArrayTest.js"));e.postMessage=i(e.webkitPostMessage,e.postMessage);var r=99,o=new Int8Array([r]);try{e.postMessage({array:o},[o.buffer])}catch(a){return p._canTransferArrayBuffer=!1,p._canTransferArrayBuffer}var s=t.defer();e.onmessage=function(t){var i=t.data.array,o=n(i)&&i[0]===r;s.resolve(o),e.terminate(),p._canTransferArrayBuffer=o},p._canTransferArrayBuffer=s.promise}return p._canTransferArrayBuffer}function u(e,t){--e._activeTasks;var r=t.id;if(n(r)){var i=e._deferreds,o=i[r];n(t.error)?o.reject(t.error):o.resolve(t.result),delete i[r]}}function c(e){var t=r(e);if(a(t)){var i,n='importScripts("'+t+'");';try{i=new Blob([n],{type:"application/javascript"})}catch(o){var s=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,l=new s;l.append(n),i=l.getBlob("application/javascript")}var u=window.URL||window.webkitURL;t=u.createObjectURL(i)}return t}function h(){return n(m)||(m=c("Workers/cesiumWorkerBootstrapper.js")),m}function d(t){var o=new Worker(h());o.postMessage=i(o.webkitPostMessage,o.postMessage);var a={loaderConfig:{},workerModule:p._workerModulePrefix+t._workerName};if(n(p._loaderConfig))a.loaderConfig=p._loaderConfig;else if(n(s.toUrl)){var l=new e("..").resolve(new e(r("Workers/cesiumWorkerBootstrapper.js"))).toString();a.loaderConfig.baseUrl=l}else a.loaderConfig.paths={Workers:r("Workers")};return o.postMessage(a),o.onmessage=function(e){u(t,e.data)},o}var m,p=function(e,t){this._workerName=e,this._maximumActiveTasks=i(t,5),this._activeTasks=0,this._deferreds={},this._nextID=0},f=[];return p.prototype.scheduleTask=function(e,r){if(n(this._worker)||(this._worker=d(this)),this._activeTasks>=this._maximumActiveTasks)return void 0;++this._activeTasks;var i=this;return t(l(),function(o){n(r)?o||(r.length=0):r=f;var a=i._nextID++,s=t.defer();return i._deferreds[a]=s,i._worker.postMessage({id:a,parameters:e,canTransferArrayBuffer:o},r),s.promise})},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){return n(this._worker)&&this._worker.terminate(),o(this)},p._defaultWorkerModulePrefix="Workers/",p._workerModulePrefix=p._defaultWorkerModulePrefix,p._loaderConfig=void 0,p._canTransferArrayBuffer=void 0,p}),r("Core/TerrainMesh",["../Core/defaultValue"],function(e){"use strict";var t=function(t,r,i,n,o,a,s,l){this.center=t,this.vertices=r,this.stride=e(l,6),this.indices=i,this.minimumHeight=n,this.maximumHeight=o,this.boundingSphere3D=a,this.occludeePointInScaledSpace=s};return t}),r("Core/TerrainProvider",["./defined","./defineProperties","./DeveloperError"],function(e,t,r){"use strict";var i=function(){r.throwInstantiationError()};t(i.prototype,{errorEvent:{get:r.throwInstantiationError},credit:{get:r.throwInstantiationError},tilingScheme:{get:r.throwInstantiationError},ready:{get:r.throwInstantiationError},hasWaterMask:{get:r.throwInstantiationError},hasVertexNormals:{get:r.throwInstantiationError}});var n=[];return i.getRegularGridIndices=function(t,r){var i=n[t];e(i)||(n[t]=i=[]);var o=i[r];if(!e(o)){o=i[r]=new Uint16Array(6*(t-1)*(r-1));for(var a=0,s=0,l=0;r-1>l;++l){for(var u=0;t-1>u;++u){var c=a,h=c+t,d=h+1,m=c+1;o[s++]=c,o[s++]=h,o[s++]=m,o[s++]=m,o[s++]=h,o[s++]=d,++a}++a}}return o},i.heightmapTerrainQuality=.25,i.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*i.heightmapTerrainQuality/(t*r)},i.prototype.requestTileGeometry=r.throwInstantiationError,i.prototype.getLevelMaximumGeometricError=r.throwInstantiationError,i.prototype.getTileDataAvailable=r.throwInstantiationError,i}),r("Core/HeightmapTerrainData",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./DeveloperError","./GeographicTilingScheme","./HeightmapTessellator","./Math","./Rectangle","./TaskProcessor","./TerrainMesh","./TerrainProvider"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,t,r,i,n,o,a){var s=1,l=e._width,u=e._height,c=o*(l-1),h=c+l-1,d=a*(u-1),m=d+u-1,p=1<1)for(_=S;E>=_;++_)for(g=C;w>=g;++g)for(var R=(_*l+g)*O,L=0;O>L;++L)D[I++]=x[R+L];else for(_=S;E>=_;++_)for(g=C;w>=g;++g)D[I++]=x[_*l+g];return new y({buffer:D,width:b,height:T,childTileMask:0,structure:e._structure,createdByUpsampling:!0})}function m(e,t,r,i,n,o,a,l){var u,c,h,d,m=e._width,v=e._height,g=e._structure,C=g.stride,w=e._buffer,S=new w.constructor(m*v*C),E=t.tileXYToRectangle(r,i,n),b=t.tileXYToRectangle(o,a,l);if(C>1){var T=g.elementsPerHeight,x=g.elementMultiplier,P=g.isBigEndian,A=Math.pow(x,T-1);for(c=0;v>c;++c)for(h=s.lerp(b.north,b.south,c/(v-1)),u=0;m>u;++u){d=s.lerp(b.west,b.east,u/(m-1));var M=f(w,T,x,C,P,E,m,v,d,h);_(S,T,x,A,C,P,c*m+u,M)}}else for(c=0;v>c;++c)for(h=s.lerp(b.north,b.south,c/(v-1)),u=0;m>u;++u)d=s.lerp(b.west,b.east,u/(m-1)),S[c*m+u]=p(w,E,m,v,d,h);return new y({buffer:S,width:m,height:v,childTileMask:0,structure:e._structure,createdByUpsampling:!0})}function p(e,t,r,i,n,o){var a=(n-t.west)*(r-1)/(t.east-t.west),s=(o-t.south)*(i-1)/(t.north-t.south),l=0|a,u=l+1;u>=r&&(u=r-1,l=r-2);var c=0|s,h=c+1;h>=i&&(h=i-1,c=i-2);var d=a-l,m=s-c;c=i-1-c,h=i-1-h;var p=e[c*r+l],f=e[c*r+u],g=e[h*r+l],_=e[h*r+u];return v(d,m,p,f,g,_)}function f(e,t,r,i,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,m=d+1;m>=a&&(m=a-1,d=a-2);var p=0|h,f=p+1;f>=s&&(f=s-1,p=s-2);var _=c-d,y=h-p;p=s-1-p,f=s-1-f;var C=g(e,t,r,i,n,p*a+d),w=g(e,t,r,i,n,p*a+m),S=g(e,t,r,i,n,f*a+d),E=g(e,t,r,i,n,f*a+m);return v(_,y,C,w,S,E)}function v(e,t,r,i,n,o){return e>t?r+e*(i-r)+t*(o-i):r+e*(o-n)+t*(n-r)}function g(e,t,r,i,n,o){o*=i;var a,s=0;if(n)for(a=0;t>a;++a)s=s*r+e[o+a];else for(a=t-1;a>=0;--a)s=s*r+e[o+a];return s}function _(e,t,r,i,n,o,a,s){a*=n;var l;if(o)for(l=0;t>l;++l)e[a+l]=0|s/i,s-=e[a+l]*i,i/=r;else for(l=t-1;l>=0;--l)e[a+l]=0|s/i,s-=e[a+l]*i,i/=r}var y=function(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=t(e.childTileMask,15);var i=a.DEFAULT_STRUCTURE,n=e.structure;r(n)?n!==i&&(n.heightScale=t(n.heightScale,i.heightScale),n.heightOffset=t(n.heightOffset,i.heightOffset),n.elementsPerHeight=t(n.elementsPerHeight,i.elementsPerHeight),n.stride=t(n.stride,i.stride),n.elementMultiplier=t(n.elementMultiplier,i.elementMultiplier),n.isBigEndian=t(n.isBigEndian,i.isBigEndian)):n=i,this._structure=n,this._createdByUpsampling=t(e.createdByUpsampling,!1),this._waterMask=e.waterMask};i(y.prototype,{waterMask:{get:function(){return this._waterMask}}});var C=new u("createVerticesFromHeightmap");return y.prototype.createMesh=function(t,i,n,a){var s=t.ellipsoid,u=t.tileXYToNativeRectangle(i,n,a),d=t.tileXYToRectangle(i,n,a),m=s.cartographicToCartesian(l.center(d)),p=this._structure,f=h.getEstimatedLevelZeroGeometricErrorForAHeightmap(s,this._width,t.getNumberOfXTilesAtLevel(0)),v=f/(1<1){var l=a.elementsPerHeight,u=a.elementMultiplier,c=a.isBigEndian;i=f(this._buffer,l,u,s,c,e,n,o,t,r)}else i=p(this._buffer,e,n,o,t,r);return i*a.heightScale+a.heightOffset},y.prototype.upsample=function(e,t,r,i,n,o,a){var s;return s=1===this._width%2&&1===this._height%2?d(this,e,t,r,i,n,o,a):m(this,e,t,r,i,n,o,a)},y.prototype.isChildAvailable=function(e,t,r,i){var n=2;return r!==2*e&&++n,i!==2*t&&(n-=2),0!==(this._childTileMask&1<=n?void 0:(o[l]=u+1,t(e(a,s),function(e){return o[l]--,e}).otherwise(function(e){return o[l]--,t.reject(e)}))};return s}),r("Core/ArcGisImageServerTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./Math","./TerrainProvider","./throttleRequestByServer"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";var f=function(e){this._url=e.url,this._token=e.token,this._tilingScheme=e.tilingScheme,i(this._tilingScheme)||(this._tilingScheme=new l({ellipsoid:r(e.ellipsoid,a.WGS84)})),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=m.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._proxy=e.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0},this._errorEvent=new s;var n=e.credit;"string"==typeof n&&(n=new t(n)),this._credit=n};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}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),f.prototype.requestTileGeometry=function(t,r,n){var o=this._tilingScheme.tileXYToRectangle(t,r,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),m=this._url+"/exportImage?interpolation=RSP_BilinearInterpolation&format=tiff&f=image&size="+this._heightmapWidth+"%2C"+this._heightmapWidth+"&bboxSR=4326&imageSR=4326&bbox="+l;this._token&&(m+="&token="+this._token);var f=this._proxy;i(f)&&(m=f.getURL(m));var v=p(h,m);if(!i(v))return void 0;var g=this;return e(v,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<d;d++){var m=t[d],p=m.x,f=m.y,v=m.z;n=Math.min(p,n),l=Math.max(p,l),a=Math.min(f,a),u=Math.max(f,u),s=Math.min(v,s),c=Math.max(v,c)}var g=i.minimum;g.x=n,g.y=a,g.z=s;var _=i.maximum;_.x=l,_.y=u,_.z=c;var y=e.add(g,_,i.center);return e.multiplyByScalar(y,.5,y),i},o.clone=function(t,i){return r(t)?r(i)?(i.minimum=e.clone(t.minimum,i.minimum),i.maximum=e.clone(t.maximum,i.maximum),i.center=e.clone(t.center,i.center),i):new o(t.minimum,t.maximum):void 0},o.equals=function(t,i){return t===i||r(t)&&r(i)&&e.equals(t.center,i.center)&&e.equals(t.minimum,i.minimum)&&e.equals(t.maximum,i.maximum)};var a=new e;return o.intersect=function(t,r){a=e.subtract(t.maximum,t.minimum,a);var i=e.multiplyByScalar(a,.5,a),o=i.x*Math.abs(r.x)+i.y*Math.abs(r.y)+i.z*Math.abs(r.z),s=e.dot(t.center,r)+r.w;return s-o>0?n.INSIDE:0>s+o?n.OUTSIDE:n.INTERSECTING},o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.intersect=function(e){return o.intersect(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o}),r("Core/BingMapsApi",["./defined"],function(e){"use strict";var t={};t.defaultKey=void 0;var r=!1;return t.getKey=function(i){return e(i)?i:e(t.defaultKey)?t.defaultKey:(r||(console.log("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."),r=!0),"Aj1ony_-Typ-KjG9SJWiKSHY23U1KmK7yAmZa9lDmuF2osXWkcZ22VPsqmCt0TCt")},t}),r("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./defaultValue","./defined","./DeveloperError","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(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.fromPoints=function(e,t){if(i(t)||(t=new l),!i(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var r=e.length,n=e[0].x,o=e[0].y,a=e[0].x,s=e[0].y,u=1;r>u;u++){var c=e[u],h=c.x,d=c.y;n=Math.min(h,n),a=Math.max(h,a),o=Math.min(d,o),s=Math.max(d,s)}return t.x=n,t.y=o,t.width=a-n,t.height=s-o,t};var u=new o,c=new t,h=new t;return l.fromRectangle=function(t,n,o){if(i(o)||(o=new l),!i(t))return o.x=0,o.y=0,o.width=0,o.height=0,o;n=r(n,u);var a=n.project(s.southwest(t,c)),d=n.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){return i(e)?i(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):void 0},l.union=function(e,t,r){i(r)||(r=new l);var n=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 r.x=n,r.y=o,r.width=a-n,r.height=s-o,r},l.expand=function(e,t,r){r=l.clone(e,r);var i=t.x-r.x,n=t.y-r.y;return i>r.width?r.width=i:0>i&&(r.width-=i,r.x=t.x),n>r.height?r.height=n:0>n&&(r.height-=n,r.y=t.y),r},l.intersect=function(e,t){var r=e.x,i=e.y,n=t.x,o=t.y;return r>n+t.width||r+e.widtho+t.height?a.OUTSIDE:a.INTERSECTING},l.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},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}),r("Core/Interval",["./defaultValue"],function(e){"use strict";var t=function(t,r){this.start=e(t,0),this.stop=e(r,0)};return t}),r("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,i){"use strict";var n=function(t,r,i,n){this.x=e(t,0),this.y=e(r,0),this.z=e(i,0),this.w=e(n,0)};n.fromElements=function(e,r,i,o,a){return t(a)?(a.x=e,a.y=r,a.z=i,a.w=o,a):new n(e,r,i,o)},n.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 n(e.red,e.green,e.blue,e.alpha)},n.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r):new n(e.x,e.y,e.z,e.w):void 0},n.packedLength=4,n.pack=function(t,r,i){i=e(i,0),r[i++]=t.x,r[i++]=t.y,r[i++]=t.z,r[i]=t.w},n.unpack=function(r,i,o){return i=e(i,0),t(o)||(o=new n),o.x=r[i++],o.y=r[i++],o.z=r[i++],o.w=r[i],o},n.fromArray=n.unpack,n.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},n.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},n.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},n.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},n.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},n.magnitude=function(e){return Math.sqrt(n.magnitudeSquared(e))};var o=new n;n.distance=function(e,t){return n.subtract(e,t,o),n.magnitude(o)},n.normalize=function(e,t){var r=n.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},n.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},n.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},n.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},n.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},n.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},n.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},n.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},n.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 a=new n;n.lerp=function(e,t,r,i){return n.multiplyByScalar(t,r,a),i=n.multiplyByScalar(e,1-r,i),n.add(a,i,i)};var s=new n;return n.mostOrthogonalAxis=function(e,t){var r=n.normalize(e,s);return n.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?n.clone(n.UNIT_X,t):n.clone(n.UNIT_W,t):r.z<=r.w?n.clone(n.UNIT_Z,t):n.clone(n.UNIT_W,t):r.y<=r.z?r.y<=r.w?n.clone(n.UNIT_Y,t):n.clone(n.UNIT_W,t):r.z<=r.w?n.clone(n.UNIT_Z,t):n.clone(n.UNIT_W,t)},n.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},n.equalsEpsilon=function(e,r,i){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=i&&Math.abs(e.y-r.y)<=i&&Math.abs(e.z-r.z)<=i&&Math.abs(e.w-r.w)<=i},n.ZERO=i(new n(0,0,0,0)),n.UNIT_X=i(new n(1,0,0,0)),n.UNIT_Y=i(new n(0,1,0,0)),n.UNIT_Z=i(new n(0,0,1,0)),n.UNIT_W=i(new n(0,0,0,1)),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){return n.equalsEpsilon(this,e,t)},n.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},n}),r("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e){for(var t=0,r=0;9>r;++r){var i=e[r];t+=i*i}return Math.sqrt(t)}function s(e){for(var t=0,r=0;3>r;++r){var i=e[u.getElementIndex(m[r],d[r])];t+=2*i*i}return Math.sqrt(t)}function l(e,t){for(var r=o.EPSILON15,i=0,n=1,a=0;3>a;++a){var s=Math.abs(e[u.getElementIndex(m[a],d[a])]);s>i&&(n=a,i=s)}var l=1,c=0,h=d[n],p=m[n];if(Math.abs(e[u.getElementIndex(p,h)])>r){var f,v=e[u.getElementIndex(p,p)],g=e[u.getElementIndex(h,h)],_=e[u.getElementIndex(p,h)],y=(v-g)/2/_;f=0>y?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),l=1/Math.sqrt(1+f*f),c=f*l}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(h,h)]=t[u.getElementIndex(p,p)]=l,t[u.getElementIndex(p,h)]=c,t[u.getElementIndex(h,p)]=-c,t}var u=function(e,r,i,n,o,a,s,l,u){this[0]=t(e,0),this[1]=t(n,0),this[2]=t(s,0),this[3]=t(r,0),this[4]=t(o,0),this[5]=t(l,0),this[6]=t(i,0),this[7]=t(a,0),this[8]=t(u,0)};u.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},u.fromArray=function(e,i,n){return i=t(i,0),r(n)||(n=new u),n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],n[3]=e[i+3],n[4]=e[i+4],n[5]=e[i+5],n[6]=e[i+6],n[7]=e[i+7],n[8]=e[i+8],n},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 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,l=e.y*e.z,c=e.y*e.w,h=e.z*e.z,d=e.z*e.w,m=e.w*e.w,p=i-s-h+m,f=2*(n-d),v=2*(o+c),g=2*(n+d),_=-i+s-h+m,y=2*(l-a),C=2*(o-c),w=2*(l+a),S=-i-s+h+m;return r(t)?(t[0]=p,t[1]=g,t[2]=C,t[3]=f,t[4]=_,t[5]=w,t[6]=v,t[7]=y,t[8]=S,t):new u(p,f,v,g,_,y,C,w,S)},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 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 u(1,0,0,0,i,-n,0,n,i)},u.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 u(i,0,n,0,1,0,-n,0,i)},u.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 u(i,-n,0,n,i,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 i=3*t,n=e[i],o=e[i+1],a=e[i+2];return r.x=n,r.y=o,r.z=a,r},u.setColumn=function(e,t,r,i){i=u.clone(e,i);var n=3*t;return i[n]=r.x,i[n+1]=r.y,i[n+2]=r.z,i},u.getRow=function(e,t,r){var i=e[t],n=e[t+3],o=e[t+6];return r.x=i,r.y=n,r.z=o,r},u.setRow=function(e,t,r,i){return i=u.clone(e,i),i[t]=r.x,i[t+3]=r.y,i[t+6]=r.z,i};var c=new e;u.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],c)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],c)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],c)),r};var h=new e;u.getMaximumScale=function(t){return u.getScale(t,h),e.maximumComponent(h)},u.multiply=function(e,t,r){var i=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 r[0]=i,r[1]=n,r[2]=o,r[3]=a,r[4]=s,r[5]=l,r[6]=u,r[7]=c,r[8]=h,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 i=t.x,n=t.y,o=t.z,a=e[0]*i+e[3]*n+e[6]*o,s=e[1]*i+e[4]*n+e[7]*o,l=e[2]*i+e[5]*n+e[8]*o;return r.x=a,r.y=s,r.z=l,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.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],i=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]=r,t[1]=i,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t[6]=l,t[7]=u,t[8]=c,t};var d=[1,0,0],m=[2,2,1],p=new u,f=new u;return u.computeEigenDecomposition=function(e,t){var i=o.EPSILON20,n=10,c=0,h=0;r(t)||(t={});for(var d=t.unitary=u.clone(u.IDENTITY,t.unitary),m=t.diagonal=u.clone(e,t.diagonal),v=i*a(m);n>h&&s(m)>v;)l(m,p),u.transpose(p,f),u.multiply(m,p,m),u.multiply(f,m,m),u.multiply(d,p,d),++c>2&&(++h,c=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],i=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*i-r*u)+s*(r*a-o*i)},u.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],s=e[3],l=e[4],c=e[5],h=e[6],d=e[7],m=e[8],p=u.determinant(e);if(Math.abs(p)<=o.EPSILON15)throw new i("matrix is not invertible");t[0]=l*m-d*c,t[1]=d*a-n*m,t[2]=n*c-l*a,t[3]=h*c-s*m,t[4]=r*m-h*a,t[5]=s*a-r*c,t[6]=s*d-h*l,t[7]=h*n-r*d,t[8]=r*l-s*n;var f=1/p;return u.multiplyByScalar(t,f,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,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},u.IDENTITY=n(new u(1,0,0,0,1,0,0,0,1)),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,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[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},u}),r("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),r("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(e,t,i,n,o,a,s,l,u,c,h,d,m,p,f,v){this[0]=r(e,0),this[1]=r(o,0),this[2]=r(u,0),this[3]=r(m,0),this[4]=r(t,0),this[5]=r(a,0),this[6]=r(c,0),this[7]=r(p,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(v,0)};u.packedLength=16,u.pack=function(e,t,i){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]},u.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new u),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},u.clone=function(e,t){return i(e)?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 u(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]):void 0},u.fromArray=u.unpack,u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.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 u(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])},u.fromRotationTranslation=function(t,n,o){return n=r(n,e.ZERO),i(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]=n.x,o[13]=n.y,o[14]=n.z,o[15]=1,o):new u(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)},u.fromTranslationQuaternionRotationScale=function(e,t,r,n){i(n)||(n=new u);var o=r.x,a=r.y,s=r.z,l=t.x*t.x,c=t.x*t.y,h=t.x*t.z,d=t.x*t.w,m=t.y*t.y,p=t.y*t.z,f=t.y*t.w,v=t.z*t.z,g=t.z*t.w,_=t.w*t.w,y=l-m-v+_,C=2*(c-g),w=2*(h+f),S=2*(c+g),E=-l+m-v+_,b=2*(p-d),T=2*(h-f),x=2*(p+d),P=-l-m+v+_;return n[0]=y*o,n[1]=S*o,n[2]=T*o,n[3]=0,n[4]=C*a,n[5]=E*a,n[6]=x*a,n[7]=0,n[8]=w*s,n[9]=b*s,n[10]=P*s,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},u.fromTranslation=function(e,t){return u.fromRotationTranslation(s.IDENTITY,e,t)},u.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 u(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},u.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 u(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var c=new e,h=new e,d=new e;u.fromCamera=function(t,r){var n=t.eye,o=t.target,a=t.up;e.normalize(e.subtract(o,n,c),c),e.normalize(e.cross(c,a,h),h),e.normalize(e.cross(h,c,d),d);var s=h.x,l=h.y,m=h.z,p=c.x,f=c.y,v=c.z,g=d.x,_=d.y,y=d.z,C=n.x,w=n.y,S=n.z,E=s*-C+l*-w+m*-S,b=g*-C+_*-w+y*-S,T=p*C+f*w+v*S;return i(r)?(r[0]=s,r[1]=g,r[2]=-p,r[3]=0,r[4]=l,r[5]=_,r[6]=-f,r[7]=0,r[8]=m,r[9]=y,r[10]=-v,r[11]=0,r[12]=E,r[13]=b,r[14]=T,r[15]=1,r):new u(s,l,m,E,g,_,y,b,-p,-f,-v,T,0,0,0,1)},u.computePerspectiveFieldOfView=function(e,t,r,i,n){var o=Math.tan(.5*e),a=1/o,s=a/t,l=(i+r)/(r-i),u=2*i*r/(r-i);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},u.computeOrthographicOffCenter=function(e,t,r,i,n,o,a){var s=1/(t-e),l=1/(i-r),u=1/(o-n),c=-(t+e)*s,h=-(i+r)*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},u.computePerspectiveOffCenter=function(e,t,r,i,n,o,a){var s=2*n/(t-e),l=2*n/(i-r),u=(t+e)/(t-e),c=(i+r)/(i-r),h=-(o+n)/(o-n),d=-1,m=-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]=m,a[15]=0,a},u.computeInfinitePerspectiveOffCenter=function(e,t,r,i,n,o){var a=2*n/(t-e),s=2*n/(i-r),l=(t+e)/(t-e),u=(i+r)/(i-r),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},u.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,m=c,p=h,f=o+u,v=a+c,g=t+h,_=1;return n[0]=d,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=m,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=p,n[11]=0,n[12]=f,n[13]=v,n[14]=g,n[15]=_,n},u.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]]},u.getElementIndex=function(e,t){return 4*e+t},u.getColumn=function(e,t,r){var i=4*t,n=e[i],o=e[i+1],a=e[i+2],s=e[i+3];return r.x=n,r.y=o,r.z=a,r.w=s,r},u.setColumn=function(e,t,r,i){i=u.clone(e,i);var n=4*t;return i[n]=r.x,i[n+1]=r.y,i[n+2]=r.z,i[n+3]=r.w,i},u.getRow=function(e,t,r){var i=e[t],n=e[t+4],o=e[t+8],a=e[t+12];return r.x=i,r.y=n,r.z=o,r.w=a,r},u.setRow=function(e,t,r,i){return i=u.clone(e,i),i[t]=r.x,i[t+4]=r.y,i[t+8]=r.z,i[t+12]=r.w,i};var m=new e;u.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;u.getMaximumScale=function(t){return u.getScale(t,p),e.maximumComponent(p)},u.multiply=function(e,t,r){var i=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],m=e[10],p=e[11],f=e[12],v=e[13],g=e[14],_=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],P=t[8],A=t[9],M=t[10],D=t[11],I=t[12],O=t[13],R=t[14],L=t[15],N=i*y+s*C+h*w+f*S,F=n*y+l*C+d*w+v*S,B=o*y+u*C+m*w+g*S,z=a*y+c*C+p*w+_*S,V=i*E+s*b+h*T+f*x,k=n*E+l*b+d*T+v*x,U=o*E+u*b+m*T+g*x,W=a*E+c*b+p*T+_*x,G=i*P+s*A+h*M+f*D,H=n*P+l*A+d*M+v*D,q=o*P+u*A+m*M+g*D,j=a*P+c*A+p*M+_*D,Y=i*I+s*O+h*R+f*L,X=n*I+l*O+d*R+v*L,Z=o*I+u*O+m*R+g*L,Q=a*I+c*O+p*R+_*L;return r[0]=N,r[1]=F,r[2]=B,r[3]=z,r[4]=V,r[5]=k,r[6]=U,r[7]=W,r[8]=G,r[9]=H,r[10]=q,r[11]=j,r[12]=Y,r[13]=X,r[14]=Z,r[15]=Q,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[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},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[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},u.multiplyTransformation=function(e,t,r){var i=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],m=e[13],p=e[14],f=t[0],v=t[1],g=t[2],_=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],P=i*f+a*v+u*g,A=n*f+s*v+c*g,M=o*f+l*v+h*g,D=i*_+a*y+u*C,I=n*_+s*y+c*C,O=o*_+l*y+h*C,R=i*w+a*S+u*E,L=n*w+s*S+c*E,N=o*w+l*S+h*E,F=i*b+a*T+u*x+d,B=n*b+s*T+c*x+m,z=o*b+l*T+h*x+p;return r[0]=P,r[1]=A,r[2]=M,r[3]=0,r[4]=D,r[5]=I,r[6]=O,r[7]=0,r[8]=R,r[9]=L,r[10]=N,r[11]=0,r[12]=F,r[13]=B,r[14]=z,r[15]=1,r},u.multiplyByTranslation=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=i*e[0]+n*e[4]+o*e[8]+e[12],s=i*e[1]+n*e[5]+o*e[9]+e[13],l=i*e[2]+n*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]=a,r[13]=s,r[14]=l,r[15]=e[15],r};var f=new e;u.multiplyByUniformScale=function(e,t,r){return f.x=t,f.y=t,f.z=t,u.multiplyByScale(e,f,r)},u.multiplyByScale=function(e,t,r){var i=t.x,n=t.y,o=t.z;return 1===i&&1===n&&1===o?u.clone(e,r):(r[0]=i*e[0],r[1]=i*e[1],r[2]=i*e[2],r[3]=0,r[4]=n*e[4],r[5]=n*e[5],r[6]=n*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)},u.multiplyByVector=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=t.w,s=e[0]*i+e[4]*n+e[8]*o+e[12]*a,l=e[1]*i+e[5]*n+e[9]*o+e[13]*a,u=e[2]*i+e[6]*n+e[10]*o+e[14]*a,c=e[3]*i+e[7]*n+e[11]*o+e[15]*a;return r.x=s,r.y=l,r.z=u,r.w=c,r},u.multiplyByPointAsVector=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=e[0]*i+e[4]*n+e[8]*o,s=e[1]*i+e[5]*n+e[9]*o,l=e[2]*i+e[6]*n+e[10]*o;return r.x=a,r.y=s,r.z=l,r},u.multiplyByPoint=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=e[0]*i+e[4]*n+e[8]*o+e[12],s=e[1]*i+e[5]*n+e[9]*o+e[13],l=e[2]*i+e[6]*n+e[10]*o+e[14];return r.x=a,r.y=s,r.z=l,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[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},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[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},u.transpose=function(e,t){var r=e[1],i=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]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,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},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[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},u.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]&&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]},u.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&&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},u.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},u.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 s,g=new s,_=new t,y=new t(0,0,0,1);return u.inverse=function(e,r){if(s.equalsEpsilon(u.getRotation(e,v),g,a.EPSILON7)&&t.equals(u.getRow(e,3,_),y))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 i=e[0],n=e[4],o=e[8],c=e[12],h=e[1],d=e[5],m=e[9],p=e[13],f=e[2],C=e[6],w=e[10],S=e[14],E=e[3],b=e[7],T=e[11],x=e[15],P=w*x,A=S*T,M=C*x,D=S*b,I=C*T,O=w*b,R=f*x,L=S*E,N=f*T,F=w*E,B=f*b,z=C*E,V=P*d+D*m+I*p-(A*d+M*m+O*p),k=A*h+R*m+F*p-(P*h+L*m+N*p),U=M*h+L*d+B*p-(D*h+R*d+z*p),W=O*h+N*d+z*m-(I*h+F*d+B*m),G=A*n+M*o+O*c-(P*n+D*o+I*c),H=P*i+L*o+N*c-(A*i+R*o+F*c),q=D*i+R*n+z*c-(M*i+L*n+B*c),j=I*i+F*n+B*o-(O*i+N*n+z*o);P=o*p,A=c*m,M=n*p,D=c*d,I=n*m,O=o*d,R=i*p,L=c*h,N=i*m,F=o*h,B=i*d,z=n*h;var Y=P*b+D*T+I*x-(A*b+M*T+O*x),X=A*E+R*T+F*x-(P*E+L*T+N*x),Z=M*E+L*b+B*x-(D*E+R*b+z*x),Q=O*E+N*b+z*T-(I*E+F*b+B*T),J=M*w+O*S+A*C-(I*S+P*C+D*w),K=N*S+P*f+L*w-(R*w+F*S+A*f),$=R*C+z*S+D*f-(B*S+M*f+L*C),et=B*w+I*f+F*C-(N*C+z*w+O*f),tt=i*V+n*k+o*U+c*W;if(Math.abs(tt)T;T++){e.clone(t[T],n);var x=n.x,P=n.y,A=n.z;xl.x&&e.clone(n,l),Pu.y&&e.clone(n,u),Ac.z&&e.clone(n,c)}var M=e.magnitudeSquared(e.subtract(l,o,y)),D=e.magnitudeSquared(e.subtract(u,a,y)),I=e.magnitudeSquared(e.subtract(c,s,y)),O=o,R=l,L=M;D>L&&(L=D,O=a,R=u),I>L&&(L=I,O=s,R=c);var N=C;N.x=.5*(O.x+R.x),N.y=.5*(O.y+R.y),N.z=.5*(O.z+R.z);var F=e.magnitudeSquared(e.subtract(R,N,y)),B=Math.sqrt(F),z=w;z.x=o.x,z.y=a.y,z.z=s.z;var V=S;V.x=l.x,V.y=u.y,V.z=c.z;var k=e.multiplyByScalar(e.add(z,V,y),.5,E),U=0;for(T=0;b>T;T++){e.clone(t[T],n);var W=e.magnitude(e.subtract(n,k,y));W>U&&(U=W);var G=e.magnitudeSquared(e.subtract(n,N,y));if(G>F){var H=Math.sqrt(G);B=.5*(B+H),F=B*B;var q=H-B;N.x=(B*N.x+q*n.x)/H,N.y=(B*N.y+q*n.y)/H,N.z=(B*N.z+q*n.z)/H}}return U>B?(e.clone(N,r.center),r.radius=B):(e.clone(k,r.center),r.radius=U),r};var b=new a,T=new e,x=new e,P=new t,A=new t;h.fromRectangle2D=function(e,t,r){return h.fromRectangleWithHeights2D(e,t,0,0,r)},h.fromRectangleWithHeights2D=function(t,n,o,a,s){if(i(s)||(s=new h),!i(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;n=r(n,b),c.southwest(t,P),P.height=o,c.northeast(t,A),A.height=a;var l=n.project(P,T),u=n.project(A,x),d=u.x-l.x,m=u.y-l.y,p=u.z-l.z;s.radius=.5*Math.sqrt(d*d+m*m+p*p);var f=s.center;return f.x=l.x+.5*d,f.y=l.y+.5*m,f.z=l.z+.5*p,s};var M=[];h.fromRectangle3D=function(e,t,n,a){t=r(t,o.WGS84),n=r(n,0);var s;return i(e)&&(s=c.subsample(e,t,n,M)),h.fromPoints(s,a)},h.fromVertices=function(t,n,o,a){if(i(a)||(a=new h),!i(t)||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;n=r(n,e.ZERO),o=r(o,3);var s=_;s.x=t[0]+n.x,s.y=t[1]+n.y,s.z=t[2]+n.z;for(var l=e.clone(s,d),u=e.clone(s,m),c=e.clone(s,p),b=e.clone(s,f),T=e.clone(s,v),x=e.clone(s,g),P=t.length,A=0;P>A;A+=o){var M=t[A]+n.x,D=t[A+1]+n.y,I=t[A+2]+n.z;s.x=M,s.y=D,s.z=I,Mb.x&&e.clone(s,b),DT.y&&e.clone(s,T),Ix.z&&e.clone(s,x)}var O=e.magnitudeSquared(e.subtract(b,l,y)),R=e.magnitudeSquared(e.subtract(T,u,y)),L=e.magnitudeSquared(e.subtract(x,c,y)),N=l,F=b,B=O;R>B&&(B=R,N=u,F=T),L>B&&(B=L,N=c,F=x);var z=C;z.x=.5*(N.x+F.x),z.y=.5*(N.y+F.y),z.z=.5*(N.z+F.z);var V=e.magnitudeSquared(e.subtract(F,z,y)),k=Math.sqrt(V),U=w;U.x=l.x,U.y=u.y,U.z=c.z;var W=S;W.x=b.x,W.y=T.y,W.z=x.z;var G=e.multiplyByScalar(e.add(U,W,y),.5,E),H=0;for(A=0;P>A;A+=o){s.x=t[A]+n.x,s.y=t[A+1]+n.y,s.z=t[A+2]+n.z;var q=e.magnitude(e.subtract(s,G,y));q>H&&(H=q);var j=e.magnitudeSquared(e.subtract(s,z,y));if(j>V){var Y=Math.sqrt(j);k=.5*(k+Y),V=k*k;var X=Y-k;z.x=(k*z.x+X*s.x)/Y,z.y=(k*z.y+X*s.y)/Y,z.z=(k*z.z+X*s.z)/Y}}return H>k?(e.clone(z,a.center),a.radius=k):(e.clone(G,a.center),a.radius=H),a},h.fromCornerPoints=function(t,r,n){i(n)||(n=new h);var o=n.center;return e.add(t,r,o),e.multiplyByScalar(o,.5,o),n.radius=e.distance(o,r),n},h.fromEllipsoid=function(t,r){return i(r)||(r=new h),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r},h.clone=function(t,r){return i(t)?i(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new h(t.center,t.radius):void 0},h.packedLength=4,h.pack=function(e,t,i){i=r(i,0);var n=e.center;t[i++]=n.x,t[i++]=n.y,t[i++]=n.z,t[i]=e.radius},h.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new h);var o=n.center;return o.x=e[t++],o.y=e[t++],o.z=e[t++],n.radius=e[t],n};var D=new e,I=new e;h.union=function(t,r,n){i(n)||(n=new h);var o=t.center,a=r.center;e.add(o,a,I);var s=e.multiplyByScalar(I,.5,I),l=e.magnitude(e.subtract(o,s,D))+t.radius,u=e.magnitude(e.subtract(a,s,D))+r.radius;return n.radius=Math.max(l,u),e.clone(s,n.center),n};var O=new e;h.expand=function(t,r,i){i=h.clone(t,i);var n=e.magnitude(e.subtract(r,i.center,O));return n>i.radius&&(i.radius=n),i},h.intersect=function(t,r){var i=t.center,n=t.radius,o=e.dot(r,i)+r.w;return-n>o?s.OUTSIDE:n>o?s.INTERSECTING:s.INSIDE},h.transform=function(e,t,r){return i(r)||(r=new h),r.center=u.multiplyByPoint(t,e.center,r.center),r.radius=u.getMaximumScale(t)*e.radius,r};var R=new e;h.distanceSquaredTo=function(t,r){var i=e.subtract(t.center,r,R);return e.magnitudeSquared(i)-t.radius*t.radius},h.transformWithoutScale=function(e,t,r){return i(r)||(r=new h),r.center=u.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var L=new e;h.computePlaneDistances=function(t,r,n,o){i(o)||(o=new l);var a=e.subtract(t.center,r,L),s=e.multiplyByScalar(n,e.dot(n,a),L),u=e.magnitude(s);return o.start=u-t.radius,o.stop=u+t.radius,o};for(var N=new e,F=new e,B=new e,z=new e,V=new e,k=new t,U=new Array(8),W=0;8>W;++W)U[W]=new e;var G=new a;return h.projectTo2D=function(t,i,n){i=r(i,G);var o=i.ellipsoid,a=t.center,s=t.radius,l=o.geodeticSurfaceNormal(a,N),u=e.cross(e.UNIT_Z,l,F);e.normalize(u,u);var c=e.cross(l,u,B);e.normalize(c,c),e.multiplyByScalar(l,s,l),e.multiplyByScalar(c,s,c),e.multiplyByScalar(u,s,u);var d=e.negate(c,V),m=e.negate(u,z),p=U,f=p[0];e.add(l,c,f),e.add(f,u,f),f=p[1],e.add(l,c,f),e.add(f,m,f),f=p[2],e.add(l,d,f),e.add(f,m,f),f=p[3],e.add(l,d,f),e.add(f,u,f),e.negate(l,l),f=p[4],e.add(l,c,f),e.add(f,u,f),f=p[5],e.add(l,c,f),e.add(f,m,f),f=p[6],e.add(l,d,f),e.add(f,m,f),f=p[7],e.add(l,d,f),e.add(f,u,f);for(var v=p.length,g=0;v>g;++g){var _=p[g];e.add(a,_,_);var y=o.cartesianToCartographic(_,k);i.project(y,_)}n=h.fromPoints(p,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},h.equals=function(t,r){return t===r||i(t)&&i(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},h.prototype.intersect=function(e){return h.intersect(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),r("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,i={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(){return n.supportsFullscreen()?document[i.fullscreenElement]:void 0}},changeEventName:{get:function(){return n.supportsFullscreen()?i.fullscreenchange:void 0}},errorEventName:{get:function(){return n.supportsFullscreen()?i.fullscreenerror:void 0}},enabled:{get:function(){return n.supportsFullscreen()?document[i.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return n.supportsFullscreen()?null!==n.element:void 0}}}),n.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return i.requestFullscreen="requestFullscreen",i.exitFullscreen="exitFullscreen",i.fullscreenEnabled="fullscreenEnabled",i.fullscreenElement="fullscreenElement",i.fullscreenchange="fullscreenchange",i.fullscreenerror="fullscreenerror",r=!0;for(var n,o=["webkit","moz","o","ms","khtml"],a=0,s=o.length;s>a;++a){var l=o[a];n=l+"RequestFullscreen","function"==typeof t[n]?(i.requestFullscreen=n,r=!0):(n=l+"RequestFullScreen","function"==typeof t[n]&&(i.requestFullscreen=n,r=!0)),n=l+"ExitFullscreen","function"==typeof document[n]?i.exitFullscreen=n:(n=l+"CancelFullScreen","function"==typeof document[n]&&(i.exitFullscreen=n)),n=l+"FullscreenEnabled",e(document[n])?i.fullscreenEnabled=n:(n=l+"FullScreenEnabled",e(document[n])&&(i.fullscreenEnabled=n)),n=l+"FullscreenElement",e(document[n])?i.fullscreenElement=n:(n=l+"FullScreenElement",e(document[n])&&(i.fullscreenElement=n)),n=l+"fullscreenchange",e(document["on"+n])&&("ms"===l&&(n="MSFullscreenChange"),i.fullscreenchange=n),n=l+"fullscreenerror",e(document["on"+n])&&("ms"===l&&(n="MSFullscreenError"),i.fullscreenerror=n)}return r},n.requestFullscreen=function(e){n.supportsFullscreen()&&e[i.requestFullscreen]()},n.exitFullscreen=function(){n.supportsFullscreen()&&document[i.exitFullscreen]()},n}),r("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function i(e){for(var t=e.split("."),r=0,i=t.length;i>r;++r)t[r]=parseInt(t[r],10);return t}function n(){if(!t(p)){p=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(p=!0,f=i(e[1]))}return p}function o(){return n()&&f}function a(){if(!t(v)&&(v=!1,!n()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(v=!0,g=i(e[1]))}return v}function s(){return a()&&g}function l(){if(!t(_)){_=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(_=!0,y=i(e[1]),y.isNightly=!!e[2])}return _}function u(){return l()&&y}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(C=!0,w=i(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(C=!0,w=i(e[1])))}return C}function h(){return c()&&w}function d(){if(!t(S)){S=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(S=!0,E=i(e[1]))}return S}function m(){return d()&&E}var p,f,v,g,_,y,C,w,S,E,b={isChrome:n,chromeVersion:o,isSafari:a,safariVersion:s,isWebkit:l,webkitVersion:u,isInternetExplorer:c,internetExplorerVersion:h,isFirefox:d,firefoxVersion:m,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};return b.supportsFullscreen=function(){return r.supportsFullscreen()},b.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},b.supportsWebWorkers=function(){return"undefined"!=typeof Worker},b}),r("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,r,i,n){"use strict";if(!i.supportsTypedArrays())return{};var o={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(t,i,n,a){switch(n=e(n,0),a=e(a,(i.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(i,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(i,n,a);case o.SHORT:return new Int16Array(i,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(i,n,a);case o.FLOAT:return new Float32Array(i,n,a);case o.DOUBLE:return new Float64Array(i,n,a);default:throw new r("componentDatatype is not a valid value.")}},n(o)}),r("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),r("Core/PrimitiveType",["./freezeObject"],function(e){"use strict";var t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===t.POINTS||e===t.LINES||e===t.LINE_LOOP||e===t.LINE_STRIP||e===t.TRIANGLES||e===t.TRIANGLE_STRIP||e===t.TRIANGLE_FAN}};return e(t)}),r("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,i,n){"use strict";var o=function(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,i.NONE)};return o.computeNumberOfVertices=function(e){var i=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var o=e.attributes[n],a=o.values.length/o.componentsPerAttribute;if(i!==a&&-1!==i)throw new r("All attribute lists must have the same number of attributes.");i=a}return i},o}),r("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),r("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(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}),r("Core/VertexFormat",["./defaultValue","./freezeObject"],function(e,t){"use strict";var r=function(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 r.POSITION_ONLY=t(new r({position:!0})),r.POSITION_AND_NORMAL=t(new r({position:!0,normal:!0})),r.POSITION_NORMAL_AND_ST=t(new r({position:!0,normal:!0,st:!0})),r.POSITION_AND_ST=t(new r({position:!0,st:!0})),r.POSITION_AND_COLOR=t(new r({position:!0,color:!0})),r.ALL=t(new r({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),r.DEFAULT=r.POSITION_NORMAL_AND_ST,r}),r("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";var h=new t,d=function(e){e=i(e,i.EMPTY_OBJECT);var r=e.minimumCorner,n=e.maximumCorner,o=i(e.vertexFormat,c.DEFAULT);this._minimumCorner=t.clone(r),this._maximumCorner=t.clone(n),this._vertexFormat=o,this._workerName="createBoxGeometry"};return d.fromDimensions=function(e){e=i(e,i.EMPTY_OBJECT);var r=e.dimensions,n=t.multiplyByScalar(r,.5,new t),o=t.negate(n,new t),a=n,s={minimumCorner:o,maximumCorner:a,vertexFormat:e.vertexFormat};return new d(s)},d.createGeometry=function(i){var n,o,c=i._minimumCorner,d=i._maximumCorner,m=i._vertexFormat,p=new l;if(m.position&&(m.st||m.normal||m.binormal||m.tangent)){if(m.position&&(o=new Float64Array(72),o[0]=c.x,o[1]=c.y,o[2]=d.z,o[3]=d.x,o[4]=c.y,o[5]=d.z,o[6]=d.x,o[7]=d.y,o[8]=d.z,o[9]=c.x,o[10]=d.y,o[11]=d.z,o[12]=c.x,o[13]=c.y,o[14]=c.z,o[15]=d.x,o[16]=c.y,o[17]=c.z,o[18]=d.x,o[19]=d.y,o[20]=c.z,o[21]=c.x,o[22]=d.y,o[23]=c.z,o[24]=d.x,o[25]=c.y,o[26]=c.z,o[27]=d.x,o[28]=d.y,o[29]=c.z,o[30]=d.x,o[31]=d.y,o[32]=d.z,o[33]=d.x,o[34]=c.y,o[35]=d.z,o[36]=c.x,o[37]=c.y,o[38]=c.z,o[39]=c.x,o[40]=d.y,o[41]=c.z,o[42]=c.x,o[43]=d.y,o[44]=d.z,o[45]=c.x,o[46]=c.y,o[47]=d.z,o[48]=c.x,o[49]=d.y,o[50]=c.z,o[51]=d.x,o[52]=d.y,o[53]=c.z,o[54]=d.x,o[55]=d.y,o[56]=d.z,o[57]=c.x,o[58]=d.y,o[59]=d.z,o[60]=c.x,o[61]=c.y,o[62]=c.z,o[63]=d.x,o[64]=c.y,o[65]=c.z,o[66]=d.x,o[67]=c.y,o[68]=d.z,o[69]=c.x,o[70]=c.y,o[71]=d.z,p.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:o})),m.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,p.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:f})}if(m.st){var v=new Float32Array(48);v[0]=0,v[1]=0,v[2]=1,v[3]=0,v[4]=1,v[5]=1,v[6]=0,v[7]=1,v[8]=1,v[9]=0,v[10]=0,v[11]=0,v[12]=0,v[13]=1,v[14]=1,v[15]=1,v[16]=0,v[17]=0,v[18]=1,v[19]=0,v[20]=1,v[21]=1,v[22]=0,v[23]=1,v[24]=1,v[25]=0,v[26]=0,v[27]=0,v[28]=0,v[29]=1,v[30]=1,v[31]=1,v[32]=1,v[33]=0,v[34]=0,v[35]=0,v[36]=0,v[37]=1,v[38]=1,v[39]=1,v[40]=0,v[41]=0,v[42]=1,v[43]=0,v[44]=1,v[45]=1,v[46]=0,v[47]=1,p.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:v}) -}if(m.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,p.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:g})}if(m.binormal){var _=new Float32Array(72);_[0]=0,_[1]=1,_[2]=0,_[3]=0,_[4]=1,_[5]=0,_[6]=0,_[7]=1,_[8]=0,_[9]=0,_[10]=1,_[11]=0,_[12]=0,_[13]=1,_[14]=0,_[15]=0,_[16]=1,_[17]=0,_[18]=0,_[19]=1,_[20]=0,_[21]=0,_[22]=1,_[23]=0,_[24]=0,_[25]=0,_[26]=1,_[27]=0,_[28]=0,_[29]=1,_[30]=0,_[31]=0,_[32]=1,_[33]=0,_[34]=0,_[35]=1,_[36]=0,_[37]=0,_[38]=1,_[39]=0,_[40]=0,_[41]=1,_[42]=0,_[43]=0,_[44]=1,_[45]=0,_[46]=0,_[47]=1,_[48]=0,_[49]=0,_[50]=1,_[51]=0,_[52]=0,_[53]=1,_[54]=0,_[55]=0,_[56]=1,_[57]=0,_[58]=0,_[59]=1,_[60]=0,_[61]=0,_[62]=1,_[63]=0,_[64]=0,_[65]=1,_[66]=0,_[67]=0,_[68]=1,_[69]=0,_[70]=0,_[71]=1,p.binormal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:_})}n=new Uint16Array(36),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else o=new Float64Array(24),o[0]=c.x,o[1]=c.y,o[2]=c.z,o[3]=d.x,o[4]=c.y,o[5]=c.z,o[6]=d.x,o[7]=d.y,o[8]=c.z,o[9]=c.x,o[10]=d.y,o[11]=c.z,o[12]=c.x,o[13]=c.y,o[14]=d.z,o[15]=d.x,o[16]=c.y,o[17]=d.z,o[18]=d.x,o[19]=d.y,o[20]=d.z,o[21]=c.x,o[22]=d.y,o[23]=d.z,p.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:o}),n=new Uint16Array(36),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;var y=t.subtract(d,c,h),C=.5*t.magnitude(y);return new a({attributes:p,indices:n,primitiveType:u.TRIANGLES,boundingSphere:new e(t.ZERO,C)})},d}),r("Core/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=new t,h=function(e){e=i(e,i.EMPTY_OBJECT);var r=e.minimumCorner,n=e.maximumCorner;this._min=t.clone(r),this._max=t.clone(n),this._workerName="createBoxOutlineGeometry"};return h.fromDimensions=function(e){e=i(e,i.EMPTY_OBJECT);var r=e.dimensions,n=t.multiplyByScalar(r,.5,new t),o=t.negate(n,new t),a=n,s={minimumCorner:o,maximumCorner:a};return new h(s)},h.createGeometry=function(i){var n=i._min,o=i._max,h=new l,d=new Uint16Array(24),m=new Float64Array(24);m[0]=n.x,m[1]=n.y,m[2]=n.z,m[3]=o.x,m[4]=n.y,m[5]=n.z,m[6]=o.x,m[7]=o.y,m[8]=n.z,m[9]=n.x,m[10]=o.y,m[11]=n.z,m[12]=n.x,m[13]=n.y,m[14]=o.z,m[15]=o.x,m[16]=n.y,m[17]=o.z,m[18]=o.x,m[19]=o.y,m[20]=o.z,m[21]=n.x,m[22]=o.y,m[23]=o.z,h.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:m}),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 p=t.subtract(o,n,c),f=.5*t.magnitude(p);return new a({attributes:h,indices:d,primitiveType:u.LINES,boundingSphere:new e(t.ZERO,f)})},h}),r("Core/Spline",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var i=function(){this.times=void 0,this.points=void 0,r.throwInstantiationError()};return i.prototype.evaluate=r.throwInstantiationError,i.prototype.findTimeInterval=function(t,r){var i=this.times,n=i.length;if(r=e(r,0),t>=i[r]){if(n>r+1&&tr+2&&t=0&&t>=i[r-1])return r-1;var o;if(t>i[r])for(o=r;n-1>o&&!(t>=i[o]&&t=0&&!(t>=i[o]&&t=0;--o)l[o]=e.subtract(s[o],e.multiplyByScalar(l[o+1],a[o],l[o]),l[o]);return l},t}),r("Core/HermiteSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./LinearSpline","./Matrix4","./Spline","./TridiagonalSystemSolver"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t,r,n){var o=d,a=p,s=m,l=f;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(i(h)||(h=l[0]=new e),e.clone(r,h),c=1;c2&&(i(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)),!i(s))){var l=n.length-1;s=p,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};return n(f.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}}}),f.catmullRomCoefficientMatrix=new s(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),f.prototype.findTimeInterval=l.prototype.findTimeInterval,f.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},f}),r("Core/appendForwardSlash",[],function(){"use strict";var e=function(e){return(0===e.length||"/"!==e[e.length-1])&&(e+="/"),e};return e}),r("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i){"use strict";var n={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};return n.getSizeInBytes=function(e){switch(e){case n.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case n.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case n.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},n.validate=function(t){return e(t)&&(t===n.UNSIGNED_BYTE||t===n.UNSIGNED_SHORT||t===n.UNSIGNED_INT)},n.createTypedArray=function(e,t){return e>i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},n.createTypedArrayFromArrayBuffer=function(e,t,r,n){return e>i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,n):new Uint16Array(t,r,n)},r(n)}),r("Core/parseResponseHeaders",[],function(){"use strict";var e=function(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),i=0;i0){var a=n.substring(0,o),s=n.substring(o+2);t[a]=s}}return t};return e}),r("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";var r=function(e,r,i){this.statusCode=e,this.response=r,this.responseHeaders=i,"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}),r("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,r,i,n,o){"use strict";function a(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function s(e,t){for(var r=a(e,t),i=new ArrayBuffer(r.length),n=new Uint8Array(i),o=0;oi,l=e>n,u=e>o):(s=i>e,l=n>e,u=o>e);var c,h,d,m,p,f,v=s+l+u;return 1===v?s?(c=(e-i)/(n-i),h=(e-i)/(o-i),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),m=(e-n)/(i-n),a.push(2),a.push(0),1!==m&&(a.push(-1),a.push(1),a.push(0),a.push(m)),1!==d&&(a.push(-1),a.push(1),a.push(2),a.push(d))):u&&(p=(e-o)/(i-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!==p&&(a.push(-1),a.push(2),a.push(0),a.push(p))):2===v?s||i===e?l||n===e?u||o===e||(h=(e-i)/(o-i),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-i)/(n-i),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)):(m=(e-n)/(i-n),p=(e-o)/(i-o),a.push(0),a.push(-1),a.push(1),a.push(0),a.push(m),a.push(-1),a.push(2),a.push(0),a.push(p)):3===v||(a.push(0),a.push(1),a.push(2)),a},r.computeBarycentricCoordinates=function(r,i,n,o,a,s,l,u,c){var h=n-l,d=l-a,m=s-u,p=o-u,f=1/(m*h+d*p),v=i-u,g=r-l,_=(m*g+d*v)*f,y=(-p*g+h*v)*f,C=1-_-y;return t(c)?(c.x=_,c.y=y,c.z=C,c):new e(_,y,C)},r}),r("Core/QuantizedMeshTerrainData",["../ThirdParty/when","./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./IndexDatatype","./Intersections2D","./Math","./TaskProcessor","./TerrainMesh"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,t,r){p.length=e.length;for(var i=!1,n=0,o=e.length;o>n;++n)p[n]=e[n],i=i||n>0&&t(e[n-1],e[n])>0;return i?(p.sort(t),s.createTypedArray(r,p)):e}var m=function(e){function t(e,t){return a[e]-a[t]}function r(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._horizonOcclusionPoint=e.horizonOcclusionPoint;var n=this._quantizedVertices.length/3,o=this._uValues=this._quantizedVertices.subarray(0,n),a=this._vValues=this._quantizedVertices.subarray(n,2*n);this._heightValues=this._quantizedVertices.subarray(2*n,3*n),this._westIndices=d(e.westIndices,t,n),this._southIndices=d(e.southIndices,r,n),this._eastIndices=d(e.eastIndices,t,n),this._northIndices=d(e.northIndices,r,n),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=i(e.childTileMask,15),this._createdByUpsampling=i(e.createdByUpsampling,!1),this._waterMask=e.waterMask};o(m.prototype,{waterMask:{get:function(){return this._waterMask}}});var p=[],f=new c("createVerticesFromQuantizedTerrainMesh");m.prototype.createMesh=function(t,r,i,o){var a=t.ellipsoid,l=t.tileXYToRectangle(r,i,o),u=f.scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,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:l,relativeToCenter:this._boundingSphere.center,ellipsoid:a});if(!n(u))return void 0;var c=this;return e(u,function(e){var t=c._quantizedVertices.length/3;t+=c._westIndices.length+c._southIndices.length+c._eastIndices.length+c._northIndices.length;var r=s.createTypedArray(t,e.indices);return new h(c._boundingSphere.center,new Float32Array(e.vertices),r,c._minimumHeight,c._maximumHeight,c._boundingSphere,c._horizonOcclusionPoint,n(c._encodedNormals)?7:6)})};var v=new c("upsampleQuantizedTerrainMesh");m.prototype.upsample=function(i,o,a,l,u,c,h){var d=2*o!==u,p=2*a===c,f=i.ellipsoid,g=i.tileXYToRectangle(u,c,h),_=v.scheduleTask({vertices:this._quantizedVertices,indices:this._indices,encodedNormals:this._encodedNormals,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:d,isNorthChild:p,childRectangle:g,ellipsoid:f});if(!n(_))return void 0;var y=Math.min(this._westSkirtHeight,this._eastSkirtHeight);y=Math.min(y,this._southSkirtHeight),y=Math.min(y,this._northSkirtHeight);var C=d?.5*y:this._westSkirtHeight,w=p?.5*y:this._southSkirtHeight,S=d?this._eastSkirtHeight:.5*y,E=p?this._northSkirtHeight:.5*y;return e(_,function(e){var i,o=s.createTypedArray(e.vertices.length/3,e.indices);return n(e.encodedNormals)&&(i=new Uint8Array(e.encodedNormals)),new m({quantizedVertices:new Uint16Array(e.vertices),indices:o,encodedNormals:i,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:t.clone(e.boundingSphere),horizonOcclusionPoint:r.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:C,southSkirtHeight:w,eastSkirtHeight:S,northSkirtHeight:E,childTileMask:0,createdByUpsampling:!0})})};var g=32767,_=new r;return m.prototype.interpolateHeight=function(e,t,r){var i=u.clamp((t-e.west)/(e.east-e.west),0,1);i*=g;var n=u.clamp((r-e.south)/(e.north-e.south),0,1);n*=g;for(var o=this._uValues,a=this._vValues,s=this._heightValues,c=this._indices,h=0,d=c.length;d>h;h+=3){var m=c[h],p=c[h+1],f=c[h+2],v=o[m],y=o[p],C=o[f],w=a[m],S=a[p],E=a[f],b=l.computeBarycentricCoordinates(i,n,v,w,y,S,C,E,_);if(b.x>=-1e-15&&b.y>=-1e-15&&b.z>=-1e-15){var T=b.x*s[m]+b.y*s[p]+b.z*s[f];return u.lerp(this._minimumHeight,this._maximumHeight,T/g)}}return void 0},m.prototype.isChildAvailable=function(e,t,r,i){var n=2;return r!==2*e&&++n,i!==2*t&&(n-=2),0!==(this._childTileMask&1<0?o.raiseEvent(h):console.log('An error occurred in "'+n.constructor.name+'": '+r(a)),h.retry&&t(c)&&c(),h},i.handleSuccess=function(e){t(e)&&(e.timesRetried=-1)},i}),r("Core/CesiumTerrainProvider",["../ThirdParty/Uri","../ThirdParty/when","./appendForwardSlash","./BoundingSphere","./Cartesian3","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./IndexDatatype","./loadArrayBuffer","./loadJson","./QuantizedMeshTerrainData","./RuntimeError","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C){"use strict";function w(e,t){return s(t)||(t={}),P.headers=D,p(e,t)}function S(e,t){return s(t)||(t={}),t.headers=I,p(e,t)}function E(e,t){var r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new d({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure})}function b(e,t,r,o,a,s){function l(e){return e>>1^-(1&e)}var u=0,c=3,h=c+1,d=Float64Array.BYTES_PER_ELEMENT*c,p=Float64Array.BYTES_PER_ELEMENT*h,f=3,g=Uint16Array.BYTES_PER_ELEMENT*f,_=3,y=Uint16Array.BYTES_PER_ELEMENT,C=y*_,w=new DataView(t),S=new n(w.getFloat64(u,!0),w.getFloat64(u+8,!0),w.getFloat64(u+16,!0));u+=d;var E=w.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var b=w.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var x=new i(new n(w.getFloat64(u,!0),w.getFloat64(u+8,!0),w.getFloat64(u+16,!0)),w.getFloat64(u+d,!0));u+=p;var P=new n(w.getFloat64(u,!0),w.getFloat64(u+8,!0),w.getFloat64(u+16,!0));u+=d;var A=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var D=new Uint16Array(t,u,3*A);u+=A*g,A>65536&&(y=Uint32Array.BYTES_PER_ELEMENT,C=y*_);var I,O=D.subarray(0,A),R=D.subarray(A,2*A),L=D.subarray(2*A,3*A),N=0,F=0,B=0;for(I=0;A>I;++I)N+=l(O[I]),F+=l(R[I]),B+=l(L[I]),O[I]=N,R[I]=F,L[I]=B;0!==u%y&&(u+=y-u%y);var z=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var V=m.createTypedArrayFromArrayBuffer(A,t,u,z*_);u+=z*C;var k=0;for(I=0;I=n.length)return 0;var a=n[o],s=0;return s|=x(a,2*r,2*i)?1:0,s|=x(a,2*r+1,2*i)?2:0,s|=x(a,2*r,2*i+1)?4:0,s|=x(a,2*r+1,2*i+1)?8:0}function x(e,t,r){for(var i=0,n=e.length;n>i;++i){var o=e[i];if(t>=o.startX&&t<=o.endX&&r>=o.startY&&r<=o.endY)return!0}return!1}var P={},A=function(i){function n(t){var r;if(!t.format)return r="The tile format is not specified in the layer.json file.",p=C.handleError(p,v,v._errorEvent,r,void 0,void 0,void 0,u),void 0;if(!t.tiles||0===t.tiles.length)return r="The layer.json file does not specify any tile URL templates.",p=C.handleError(p,v,v._errorEvent,r,void 0,void 0,void 0,u),void 0;if("heightmap-1.0"===t.format)v._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1},v._hasWaterMask=!0;else{if(0!==t.format.indexOf("quantized-mesh-1."))return r='The tile format "'+t.format+'" is invalid or not supported.',p=C.handleError(p,v,v._errorEvent,r,void 0,void 0,void 0,u),void 0;v._hasWaterMask=!1}var i=new e(m);v._tileUrlTemplates=t.tiles;for(var n=0;n=i.length)return!1;var n=i[r],o=this._tilingScheme.getNumberOfYTilesAtLevel(r),a=o-t-1;return x(n,e,a)}return void 0},A}),r("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(e,r,i,n){this.x=t(e,0),this.y=t(r,0),this.z=t(i,0),this.w=t(n,0)},u=new e;l.fromAxisAngle=function(t,i,n){var o=i/2,a=Math.sin(o);u=e.normalize(t,u);var s=u.x*a,c=u.y*a,h=u.z*a,d=Math.cos(o);return r(n)?(n.x=s,n.y=c,n.z=h,n.w=d,n):new l(s,c,h,d)};var c=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var i,n,o,a,u,d=e[s.COLUMN0ROW0],m=e[s.COLUMN1ROW1],p=e[s.COLUMN2ROW2],f=d+m+p;if(f>0)i=Math.sqrt(f+1),u=.5*i,i=.5/i,n=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*i,o=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*i,a=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*i;else{var v=c,g=0;m>d&&(g=1),p>d&&p>m&&(g=2);var _=v[g],y=v[_];i=Math.sqrt(e[s.getElementIndex(g,g)]-e[s.getElementIndex(_,_)]-e[s.getElementIndex(y,y)]+1);var C=h;C[g]=.5*i,i=.5/i,u=(e[s.getElementIndex(y,_)]-e[s.getElementIndex(_,y)])*i,C[_]=(e[s.getElementIndex(_,g)]+e[s.getElementIndex(g,_)])*i,C[y]=(e[s.getElementIndex(y,g)]+e[s.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=u,t):new l(n,o,a,u)};var d=new e,m=new e,p=new l,f=new l,v=new l;l.packedLength=4,l.pack=function(e,r,i){i=t(i,0),r[i++]=e.x,r[i++]=e.y,r[i++]=e.z,r[i]=e.w},l.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new l),n.x=e[i],n.y=e[i+1],n.z=e[i+2],n.w=e[i+3],n},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,r,i){l.unpack(e,4*r,v),l.conjugate(v,v);for(var n=0,o=r-t+1;o>n;n++){var a=3*n;l.unpack(e,4*(t+n),p),l.multiply(p,v,p),p.w<0&&l.negate(p,p),l.computeAxis(p,d);var s=l.computeAngle(p);i[a]=d.x*s,i[a+1]=d.y*s,i[a+2]=d.z*s}},l.unpackInterpolationResult=function(t,i,n,o,a){r(a)||(a=new l),e.fromArray(t,0,m);var s=e.magnitude(m);return l.unpack(i,4*o,f),0===s?l.clone(l.IDENTITY,p):l.fromAxisAngle(m,s,p),l.multiply(p,f,a)},l.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w):void 0},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var r=1/l.magnitude(e),i=e.x*r,n=e.y*r,o=e.z*r,a=e.w*r;return t.x=i,t.y=n,t.z=o,t.w=a,t},l.inverse=function(e,t){var r=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/r,t)},l.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},l.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},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,r){var i=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+i*c+n*u-o*l,d=a*l-i*u+n*c+o*s,m=a*u+i*l-n*s+o*c,p=a*c-i*s-n*l-o*u;return r.x=h,r.y=d,r.z=m,r.w=p,r},l.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 -},l.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},l.computeAxis=function(e,t){var r=e.w;if(Math.abs(r-1)n&&(n=-n,o=_=l.negate(t,_)),1-nI;++I){var O=I+1,R=2*O+1;P[I]=1/(O*R),A[I]=O/R}return P[7]=x/136,A[7]=8*x/17,l.fastSlerp=function(e,t,r,i){var n,o=l.dot(e,t);o>=0?n=1:(n=-1,o=-o);for(var a=o-1,s=1-r,u=r*r,c=s*s,h=7;h>=0;--h)M[h]=(P[h]*u-A[h])*a,D[h]=(P[h]*c-A[h])*a;var d=n*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])))))))),m=s*(1+D[0]*(1+D[1]*(1+D[2]*(1+D[3]*(1+D[4]*(1+D[5]*(1+D[6]*(1+D[7])))))))),p=l.multiplyByScalar(e,m,T);return l.multiplyByScalar(t,d,i),l.add(p,i,i)},l.fastSquad=function(e,t,r,i,n,o){var a=l.fastSlerp(e,t,n,E),s=l.fastSlerp(r,i,n,b);return l.fastSlerp(a,s,2*n*(1-n),o)},l.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},l.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},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}),r("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,i){"use strict";function n(t,n,o,c,h,d,m,p,f,v){var g=t+n;e.multiplyByScalar(c,Math.cos(g),a),e.multiplyByScalar(o,Math.sin(g),s),e.add(a,s,a);var _=Math.cos(t);_*=_;var y=Math.sin(t);y*=y;var C=d/Math.sqrt(m*_+h*y),w=C/p;return i.fromAxisAngle(a,w,l),r.fromQuaternion(l,u),r.multiplyByVector(u,f,v),e.normalize(v,v),e.multiplyByScalar(v,p,v),v}var o={},a=new e,s=new e,l=new i,u=new r,c=new e,h=new e,d=new e,m=new e;o.raisePositionsToHeight=function(t,r,i){for(var n=r.ellipsoid,o=r.height,a=r.extrudedHeight,s=i?2*(t.length/3):t.length/3,l=new Float64Array(3*s),u=m,p=t.length,f=i?p:0,v=0;p>v;v+=3){var g,_=v+1,y=v+2,C=e.fromArray(t,v,c);C=n.scaleToGeodeticSurface(C,C),g=e.clone(C,h),u=n.geodeticSurfaceNormal(C,u);var w=e.multiplyByScalar(u,o,d);C=e.add(C,w,C),i&&(w=e.multiplyByScalar(u,a,w),g=e.add(g,w,g),l[v+f]=g.x,l[_+f]=g.y,l[y+f]=g.z),l[v]=C.x,l[_]=C.y,l[y]=C.z}return l};var p=new e,f=new e,v=new e;return o.computeEllipsePositions=function(r,i,o){var a=r.semiMinorAxis,s=r.semiMajorAxis,l=r.rotation,u=r.center,m=r.granularity,g=2.31,_=a*a,y=s*s,C=s*a,w=e.magnitude(u),S=e.normalize(u,p),E=e.cross(e.UNIT_Z,u,f);E=e.normalize(E,E);var b,T,x,P,A,M=e.cross(S,E,v),D=1+Math.ceil(t.PI_OVER_TWO/m),I=g/(D-1),O=2*D*(D+1),R=i?new Array(3*O):void 0,L=0,N=c,F=h,B=o?[]:void 0,z=o?[]:void 0,V=t.PI_OVER_TWO;for(b=0;D>b&&V>0;++b){if(N=n(V,l,M,E,_,C,y,w,S,N),F=n(Math.PI-V,l,M,E,_,C,y,w,S,F),i){for(R[L++]=N.x,R[L++]=N.y,R[L++]=N.z,x=2*b+2,T=1;x-1>T;++T)P=T/(x-1),A=e.lerp(N,F,P,d),R[L++]=A.x,R[L++]=A.y,R[L++]=A.z;R[L++]=F.x,R[L++]=F.y,R[L++]=F.z}o&&(z.unshift(N.x,N.y,N.z),0!==b&&B.push(F.x,F.y,F.z)),V=t.PI_OVER_TWO-(b+1)*I}for(D=b,b=D;b>0;--b){if(V=t.PI_OVER_TWO-(b-1)*I,N=n(-V,l,M,E,_,C,y,w,S,N),F=n(V+Math.PI,l,M,E,_,C,y,w,S,F),i){for(R[L++]=N.x,R[L++]=N.y,R[L++]=N.z,x=2*(b-1)+2,T=1;x-1>T;++T)P=T/(x-1),A=e.lerp(N,F,P,d),R[L++]=A.x,R[L++]=A.y,R[L++]=A.z;R[L++]=F.x,R[L++]=F.y,R[L++]=F.z}o&&(z.unshift(N.x,N.y,N.z),1!==b&&B.push(F.x,F.y,F.z))}var k={};return i&&(R.length!==L&&(O=L/3,R.length=L),k.positions=R,k.numPts=D),o&&(k.outerPositions=z.concat(B)),k},o}),r("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,i){"use strict";var n=function(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=i.clone(e(t.modelMatrix,i.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{})};return n}),r("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var i=new t,n=new t,o=new t,a=function(a,s,l,u,c){r(c)||(c=new t);var h,d,m,p,f,v,g,_;r(s.z)?(h=t.subtract(l,s,i),d=t.subtract(u,s,n),m=t.subtract(a,s,o),p=t.dot(h,h),f=t.dot(h,d),v=t.dot(h,m),g=t.dot(d,d),_=t.dot(d,m)):(h=e.subtract(l,s,i),d=e.subtract(u,s,n),m=e.subtract(a,s,o),p=e.dot(h,h),f=e.dot(h,d),v=e.dot(h,m),g=e.dot(d,d),_=e.dot(d,m));var y=1/(p*g-f*f);return c.y=(g*v-f*_)*y,c.z=(p*_-f*v)*y,c.x=1-c.y-c.z,c};return a}),r("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)};r.encode=function(e,r){t(r)||(r={high:0,low:0});var i;return e>=0?(i=65536*Math.floor(e/65536),r.high=i,r.low=e-i):(i=65536*Math.floor(-e/65536),r.high=-i,r.low=e+i),r};var i={high:0,low:0};r.fromCartesian=function(e,n){t(n)||(n=new r);var o=n.high,a=n.low;return r.encode(e.x,i),o.x=i.high,a.x=i.low,r.encode(e.y,i),o.y=i.high,a.y=i.low,r.encode(e.z,i),o.z=i.high,a.z=i.low,n};var n=new r;return r.writeElements=function(e,t,i){r.fromCartesian(e,n);var o=n.high,a=n.low;t[i]=o.x,t[i+1]=o.y,t[i+2]=o.z,t[i+3]=a.x,t[i+4]=a.y,t[i+5]=a.z},r}),r("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,i){var n=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(r)))a&&a/ss&&s/ao)return[];var l=Math.sqrt(o);return[-l,l]}if(0===n)return o=-i/e,0>o?[o,0]:[0,o];var u=i*i,c=4*e*n,h=r(u,-c,t.EPSILON14);if(0>h)return[];var d=-.5*r(i,t.sign(i)*Math.sqrt(h),t.EPSILON14);return i>0?[d/e,n/d]:[n/d,d/e]},i}),r("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,i){var n,o,a=e,s=t/3,l=r/3,u=i,c=a*l,h=s*u,d=s*s,m=l*l,p=a*l-d,f=a*u-s*l,v=s*u-m,g=4*p*v-f*f;if(0>g){var _,y,C;d*h>=c*m?(_=a,y=p,C=-2*s*p+a*f):(_=u,y=v,C=-u*f+2*l*v);var w=0>C?-1:1,S=-w*Math.abs(_)*Math.sqrt(-g);o=-C+S;var E=o/2,b=0>E?-Math.pow(-E,1/3):Math.pow(E,1/3),T=o===S?-b:-y/b;return n=0>=y?b+T:-C/(b*b+T*T+y),d*h>=c*m?[(n-s)/a]:[-u/(n+l)]}var x=p,P=-2*s*p+a*f,A=v,M=-u*f+2*l*v,D=Math.sqrt(g),I=Math.sqrt(3)/2,O=Math.abs(Math.atan2(a*D,-P)/3);n=2*Math.sqrt(-x);var R=Math.cos(O);o=n*R;var L=n*(-R/2-I*Math.sin(O)),N=o+L>2*s?o-s:L-s,F=a,B=N/F;O=Math.abs(Math.atan2(u*D,-M)/3),n=2*Math.sqrt(-A),R=Math.cos(O),o=n*R,L=n*(-R/2-I*Math.sin(O));var z=-u,V=2*l>o+L?o+l:L+l,k=z/V,U=F*V,W=-N*V-F*z,G=N*z,H=(l*W-s*G)/(-s*W+l*U);return H>=B?k>=B?k>=H?[B,H,k]:[B,k,H]:[k,B,H]:k>=B?[H,B,k]:k>=H?[H,k,B]:[k,H,B]}var i={};return i.computeDiscriminant=function(e,t,r,i){var n=e*e,o=t*t,a=r*r,s=i*i,l=18*e*t*r*i+o*a-27*n*s-4*(e*a*r+o*t*i);return l},i.computeRealRoots=function(e,i,n,o){var a,s;if(0===e)return t.computeRealRoots(i,n,o);if(0===i){if(0===n){if(0===o)return[0,0,0];s=-o/e;var l=0>s?-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]]):r(e,0,n,o)}return 0===n?0===o?(s=-i/e,0>s?[s,0,0]:[0,0,s]):r(e,i,0,o):0===o?(a=t.computeRealRoots(e,i,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]]):r(e,i,n,o)},i}),r("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,i){"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,m=h[h.length-1];if(Math.abs(m)=0&&g>=0){var _=Math.sqrt(v),y=Math.sqrt(g);return[d-y,d-_,d+_,d+y]}if(v>=0&&0>g)return f=Math.sqrt(v),[d-f,d+f];if(0>v&&g>=0)return f=Math.sqrt(g),[d-f,d+f]}return[]}if(m>0){var C=Math.sqrt(m),w=(l+m-u/C)/2,S=(l+m+u/C)/2,E=i.computeRealRoots(1,C,w),b=i.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 p,f,v=m[0],g=n-v,_=g*g,y=t/2,C=g/2,w=_-4*a,S=_+4*Math.abs(a),E=u-4*v,b=u+4*Math.abs(v);if(0>v||E*S>w*b){var T=Math.sqrt(E);p=T/2,f=0===T?0:(t*C-o)/T}else{var x=Math.sqrt(w);p=0===x?0:(t*C-o)/x,f=x/2}var P,A;0===y&&0===p?(P=0,A=0):r.sign(y)===r.sign(p)?(P=y+p,A=v/P):(A=y-p,P=v/A);var M,D;0===C&&0===f?(M=0,D=0):r.sign(C)===r.sign(f)?(M=C+f,D=a/M):(D=C-f,M=a/D);var I=i.computeRealRoots(1,P,M),O=i.computeRealRoots(1,A,D);if(0!==I.length)return 0!==O.length?I[1]<=O[0]?[I[0],I[1],O[0],O[1]]:O[1]<=I[0]?[O[0],O[1],I[0],I[1]]:I[0]>=O[0]&&I[1]<=O[1]?[O[0],I[0],I[1],O[1]]:O[0]>=I[0]&&O[1]<=I[1]?[I[0],O[0],O[1],I[1]]:I[0]>O[0]&&I[0]u?1:0;switch(m+=0>c?m+1:m,m+=0>h?m+1:m,m+=0>d?m+1:m){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 void 0}},a}),r("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var i=function(r,i){i=e.clone(t(i,e.ZERO)),e.equals(i,e.ZERO)||e.normalize(i,i),this.origin=e.clone(t(r,e.ZERO)),this.direction=i};return i.getPoint=function(t,i,n){return r(n)||(n=new e),n=e.multiplyByScalar(t.direction,i,n),e.add(t.origin,n,n)},i}),r("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t,i,n,a,s){s=r(s,!1);var l,u,c,h,d,m=t.origin,p=t.direction,f=e.subtract(n,i,v),w=e.subtract(a,i,g),S=e.cross(p,w,_),E=e.dot(f,S);if(s){if(Ec||c>E)return void 0;if(u=e.cross(l,f,C),h=e.dot(p,u),0>h||c+h>E)return void 0;d=e.dot(w,u)/E}else{if(Math.abs(E)c||c>1)return void 0;if(u=e.cross(l,f,C),h=e.dot(p,u)*b,0>h||c+h>1)return void 0;d=e.dot(w,u)*b}return d}function h(e,t,r,i){var n=t*t-4*e*r;if(0>n)return void 0;if(n>0){var o=1/(2*e),a=Math.sqrt(n),s=(-t+a)*o,l=(-t-a)*o;return l>s?(i.root0=s,i.root1=l):(i.root0=l,i.root1=s),i}var u=-t/(2*e);return 0===u?void 0:(i.root0=i.root1=u,i)}function d(t,r,n){i(n)||(n={});var o=t.origin,a=t.direction,s=r.center,l=r.radius*r.radius,u=e.subtract(o,s,_),c=e.dot(a,a),d=2*e.dot(a,u),m=e.magnitudeSquared(u)-l,p=h(c,d,m,S);return i(p)?(n.start=p.root0,n.stop=p.root1,n):void 0}function m(e,t,r){var i=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))L;++L){var N,F=c[L],B=F*F,z=Math.max(1-B,0),V=Math.sqrt(z);N=o.sign(p)===o.sign(v)?m(p*B+v,f*F,o.EPSILON12):o.sign(v)===o.sign(f*F)?m(p*B,f*F+v,o.EPSILON12):m(p*B+f*F,v,o.EPSILON12);var k=m(g*F,_,o.EPSILON15),U=N*k;0>U?y.push(new e(n,u*F,u*V)):U>0?y.push(new e(n,u*F,u*-V)):0!==V?(y.push(new e(n,u*F,u*-V)),y.push(new e(n,u*F,u*V)),++L):y.push(new e(n,u*F,u*V))}return y}var f={};f.rayPlane=function(t,r,n){i(n)||(n=new e);var a=t.origin,s=t.direction,l=r.normal,u=e.dot(l,s);if(Math.abs(u)c?void 0:(n=e.multiplyByScalar(s,c,n),e.add(a,n,n))};var v=new e,g=new e,_=new e,y=new e,C=new e;f.rayTriangle=function(t,r,n,o,a,s){var l=c(t,r,n,o,a);return!i(l)||0>l?void 0:(i(s)||(s=new e),e.multiplyByScalar(t.direction,l,s),e.add(t.origin,s,s))};var w=new u;f.lineSegmentTriangle=function(t,r,n,o,a,s,l){var u=w;e.clone(t,u.origin),e.subtract(r,t,u.direction),e.normalize(u.direction,u.direction);var h=c(u,n,o,a,s);return!i(h)||0>h||h>e.distance(t,r)?void 0:(i(l)||(l=new e),e.multiplyByScalar(u.direction,h,l),e.add(u.origin,l,l))};var S={root0:0,root1:0};f.raySphere=function(e,t,r){return r=d(e,t,r),!i(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var E=new u;f.lineSegmentSphere=function(t,r,n,o){var a=E;e.clone(t,a.origin);var s=e.subtract(r,t,a.direction),l=e.magnitude(s);return e.normalize(s,s),o=d(a,n,o),!i(o)||o.stop<0||o.start>l?void 0:(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,r){var i,n,o,a,s,l=r.oneOverRadii,u=e.multiplyComponents(l,t.origin,b),c=e.multiplyComponents(l,t.direction,T),h=e.magnitudeSquared(u),d=e.dot(u,c);if(h>1){if(d>=0)return void 0;var m=d*d;if(i=h-1,n=e.magnitudeSquared(c),o=n*i,o>m)return void 0;if(m>o){a=d*d-o,s=-d+Math.sqrt(a);var p=s/n,f=i/s;return f>p?{start:p,stop:f}:{start:f,stop:p}}var v=Math.sqrt(i/n);return{start:v,stop:v}}return 1>h?(i=h-1,n=e.magnitudeSquared(c),o=n*i,a=d*d-o,s=-d+Math.sqrt(a),{start:0,stop:s/n}):0>d?(n=e.magnitudeSquared(c),{start:0,stop:-d/n}):void 0};var x=new e,P=new e,A=new e,M=new e,D=new e,I=new a,O=new a,R=new a,L=new a,N=new a,F=new a,B=new a,z=new e,V=new e,k=new t;f.grazingAltitudeLocation=function(t,r){var n=t.origin,s=t.direction,l=r.geodeticSurfaceNormal(n);if(e.dot(s,l)>=0)return n;var u=i(this.rayEllipsoid(t,r)),c=r.transformPositionToScaledSpace(s),h=e.normalize(c,x),d=e.mostOrthogonalAxis(c,M),m=e.normalize(e.cross(d,h,P),P),f=e.normalize(e.cross(h,m,A),A),v=I;v[0]=h.x,v[1]=h.y,v[2]=h.z,v[3]=m.x,v[4]=m.y,v[5]=m.z,v[6]=f.x,v[7]=f.y,v[8]=f.z;var g=a.transpose(v,O),_=a.fromScale(r.radii,R),y=a.fromScale(r.oneOverRadii,L),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,F),C,F),b=a.multiply(a.multiply(E,_,B),v,B),T=a.multiplyByVector(E,n,D),U=p(b,e.negate(T,x),0,0,1),W=U.length;if(W>0){for(var G=e.clone(e.ZERO,V),H=Number.NEGATIVE_INFINITY,q=0;W>q;++q){w=a.multiplyByVector(_,a.multiplyByVector(v,U[q],z),z);var j=e.normalize(e.subtract(w,n,M),M),Y=e.dot(j,s);Y>H&&(H=Y,G=e.clone(w,G))}var X=r.cartesianToCartographic(G,k);return H=o.clamp(H,0,1),S=e.magnitude(e.subtract(G,n,M))*Math.sqrt(1-H*H),S=u?-S:S,X.height=S,r.cartographicToCartesian(X)}return void 0};var U=new e;return f.lineSegmentPlane=function(t,r,n,a){i(a)||(a=new e);var s=e.subtract(r,t,U),l=n.normal,u=e.dot(l,s);if(Math.abs(u)h||h>1?void 0:(e.multiplyByScalar(s,h,a),e.add(t,a,a),a)},f.trianglePlaneIntersection=function(t,r,i,n){var o=n.normal,a=n.distance,s=e.dot(o,t)+a<0,l=e.dot(o,r)+a<0,u=e.dot(o,i)+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,r,n,h),f.lineSegmentPlane(t,i,n,d),{positions:[t,r,i,h,d],indices:[0,3,4,1,2,4,1,4,3]};if(l)return f.lineSegmentPlane(r,i,n,h),f.lineSegmentPlane(r,t,n,d),{positions:[t,r,i,h,d],indices:[1,3,4,2,0,4,2,4,3]};if(u)return f.lineSegmentPlane(i,t,n,h),f.lineSegmentPlane(i,r,n,d),{positions:[t,r,i,h,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!s)return f.lineSegmentPlane(r,t,n,h),f.lineSegmentPlane(i,t,n,d),{positions:[t,r,i,h,d],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return f.lineSegmentPlane(i,r,n,h),f.lineSegmentPlane(t,r,n,d),{positions:[t,r,i,h,d],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return f.lineSegmentPlane(t,i,n,h),f.lineSegmentPlane(r,i,n,d),{positions:[t,r,i,h,d],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},f}),r("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(t,r){this.normal=e.clone(t),this.distance=r};return r.fromPointNormal=function(i,n,o){var a=-e.dot(n,i);return t(o)?(e.clone(n,o.normal),o.distance=a,o):new r(n,a)},r.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},r}),r("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};return r.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var i=r.indices,n=r.maximumIndex,o=e(r.cacheSize,24),a=i.length;if(!t(n)){n=0;for(var s=0,l=i[s];a>s;)l>n&&(n=l),++s,l=i[s]}for(var u=[],c=0;n+1>c;c++)u[c]=0;for(var h=o+1,d=0;a>d;++d)h-u[i[d]]>o&&(u[i[d]]=h,++h);return(h-o+1)/(a/3)},r.tipsify=function(r){function i(e,t,r,i){for(;t.length>=1;){var n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;i>o;){if(e[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function n(e,t,r,n,o,a,s){for(var l,u=-1,c=-1,h=0;hc||-1===c)&&(c=l,u=d)),++h}return-1===u?i(n,a,e,s):u}r=e(r,e.EMPTY_OBJECT);var o,a=r.indices,s=r.maximumIndex,l=e(r.cacheSize,24),u=a.length,c=0,h=0,d=a[h],m=u;if(t(s))c=s+1;else{for(;m>h;)d>c&&(c=d),++h,d=a[h];if(-1===c)return 0;++c}for(var p=[],f=0;c>f;f++)p[f]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};h=0;for(var v=0;m>h;)p[a[h]].vertexTriangles.push(v),++p[a[h]].numLiveTriangles,p[a[h+1]].vertexTriangles.push(v),++p[a[h+1]].numLiveTriangles,p[a[h+2]].vertexTriangles.push(v),++p[a[h+2]].numLiveTriangles,++v,h+=3;var g=0,_=l+1;o=1;var y,C,w=[],S=[],E=0,b=[],T=u/3,x=[];for(f=0;T>f;f++)x[f]=!1;for(var P,A;-1!==g;){w=[],C=p[g],A=C.vertexTriangles.length;for(var M=0;A>M;++M)if(v=C.vertexTriangles[M],!x[v]){x[v]=!0,h=v+v+v;for(var D=0;3>D;++D)P=a[h],w.push(P),S.push(P),b[E]=P,++E,y=p[P],--y.numLiveTriangles,_-y.timeStamp>l&&(y.timeStamp=_,++_),++h}g=n(a,l,w,p,_,S,c)}return b},r}),r("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,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S,E,b){"use strict";function T(e,t,r,i,n){e[t++]=r,e[t++]=i,e[t++]=i,e[t++]=n,e[t++]=n,e[t]=r}function x(e){for(var t=e.length,r=6*(t/3),i=v.createTypedArray(t,r),n=0,o=0;t>o;o+=3,n+=6)T(i,n,e[o],e[o+1],e[o+2]);return i}function P(e){var t=e.length;if(t>=3){var r=6*(t-2),i=v.createTypedArray(t,r);T(i,0,e[0],e[1],e[2]);for(var n=6,o=3;t>o;++o,n+=6)T(i,n,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function A(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),i=v.createTypedArray(t,r),n=e[0],o=0,a=1;t>a;++a,o+=6)T(i,o,n,e[a],e[a+1]);return i}return new Uint16Array}function M(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&u(e[r])&&u(e[r].values)){var i=e[r];t[r]=new p({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function D(e,t,r){for(var i in t)if(t.hasOwnProperty(i)&&u(t[i])&&u(t[i].values))for(var n=t[i],o=0;oo;o+=3)n.unpack(r,o,K),w.multiplyByPoint(e,K,K),n.pack(K,r,o)}function O(e,t){if(u(t))for(var r=t.values,i=r.length,o=0;i>o;o+=3)n.unpack(r,o,K),C.multiplyByVector(e,K,K),K=n.normalize(K,K),n.pack(K,r,o)}function R(e){var t,r=e.length,i={},n=e[0].geometry.attributes;for(t in n)if(n.hasOwnProperty(t)&&u(n[t])&&u(n[t].values)){for(var o=n[t],a=o.values.length,l=!0,c=1;r>c;++c){var h=e[c].geometry.attributes[t];if(!u(h)||o.componentDatatype!==h.componentDatatype||o.componentsPerAttribute!==h.componentsPerAttribute||o.normalize!==h.normalize){l=!1;break}a+=h.values.length}l&&(i[t]=new p({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:s.createTypedArray(o.componentDatatype,a)}))}return i}function L(e){if(u(e.indices))return e;for(var t=m.computeNumberOfVertices(e),r=v.createTypedArray(t,t),i=0;t>i;++i)r[i]=i;return e.indices=r,e}function N(e){var t=m.computeNumberOfVertices(e),r=v.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var i=3,n=3;t>n;++n)r[i++]=n-1,r[i++]=0,r[i++]=n;return e.indices=r,e.primitiveType=E.TRIANGLES,e}function F(e){var t=m.computeNumberOfVertices(e),r=v.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 i=6,n=3;t-1>n;n+=2)r[i++]=n,r[i++]=n-1,r[i++]=n+1,t>n+2&&(r[i++]=n,r[i++]=n+1,r[i++]=n+2);return e.indices=r,e.primitiveType=E.TRIANGLES,e}function B(e){if(u(e.indices))return e;for(var t=m.computeNumberOfVertices(e),r=v.createTypedArray(t,t),i=0;t>i;++i)r[i]=i;return e.indices=r,e}function z(e){var t=m.computeNumberOfVertices(e),r=v.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var i=2,n=2;t>n;++n)r[i++]=n-1,r[i++]=n;return e.indices=r,e.primitiveType=E.LINES,e}function V(e){var t=m.computeNumberOfVertices(e),r=v.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var i=2,n=2;t>n;++n)r[i++]=n-1,r[i++]=n;return r[i++]=t-1,r[i]=0,e.indices=r,e.primitiveType=E.LINES,e}function k(e){switch(e.primitiveType){case E.TRIANGLE_FAN:return N(e);case E.TRIANGLE_STRIP:return F(e);case E.TRIANGLES:return L(e);case E.LINE_STRIP:return z(e);case E.LINE_LOOP:return V(e);case E.LINES:return B(e)}return e}function U(e,t){Math.abs(e.y)=0||t.x>=0||r.x>=0)return void 0;var i=e.y<0,n=t.y<0,o=r.y<0;U(e,i),U(t,n),U(r,o);var a=0;a+=i?1:0,a+=n?1:0,a+=o?1:0;var s=_t.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,i?(W(e,t,pt,vt),W(e,r,ft,gt),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(W(t,r,pt,vt),W(t,e,ft,gt),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(W(r,e,pt,vt),W(r,t,ft,gt),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,i?n?o||(W(r,e,pt,vt),W(r,t,ft,gt),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(W(t,r,pt,vt),W(t,e,ft,gt),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(W(e,t,pt,vt),W(e,r,ft,gt),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=_t.positions;return l[0]=e,l[1]=t,l[2]=r,_t.length=3,(1===a||2===a)&&(l[3]=pt,l[4]=ft,l[5]=vt,l[6]=gt,_t.length=7),_t}function H(e,r,o,a,s,l,c,h){if(u(s)||u(l)||u(c)||u(h)){var d,m,p,f,v,g,_,y,C,w,S,E,b=a.positions,T=b[0],x=b[1],P=b[2],A=yt,M=Ct,D=wt,I=St,O=Et,R=bt;u(s)&&(d=n.fromArray(s,3*e),m=n.fromArray(s,3*r),p=n.fromArray(s,3*o)),u(l)&&(f=n.fromArray(l,3*e),v=n.fromArray(l,3*r),g=n.fromArray(l,3*o)),u(c)&&(_=n.fromArray(c,3*e),y=n.fromArray(c,3*r),C=n.fromArray(c,3*o)),u(h)&&(w=i.fromArray(h,2*e),S=i.fromArray(h,2*r),E=i.fromArray(h,2*o));for(var L=3;LC;C+=3){var w=c[C],S=c[C+1],E=c[C+2],b=n.fromArray(r,3*w),T=n.fromArray(r,3*S),x=n.fromArray(r,3*E),P=G(b,T,x);if(u(P))if(h[3*w+1]=P.positions[0].y,h[3*S+1]=P.positions[1].y,h[3*E+1]=P.positions[2].y,P.length>3){for(var A=h.length/3,M=0;MD?_.push(c[C+D]):_.push(D-3+A)}for(var I=3;Il;l+=2){var c=i[l],h=i[l+1],d=n.fromArray(r,3*c),p=n.fromArray(r,3*h);if(Math.abs(d.y)T;T+=4){var x=T,P=T+1,A=T+2,M=n.fromArray(p,3*x,It),D=n.fromArray(p,3*P,Ot),I=n.fromArray(p,3*A,Rt),O=n.equals(M,D);Math.abs(M.y)d;d+=3)c[h++]=n[d],c[h++]=n[d+1],c[h++]=n[d+2],c[h++]=n[d]+o[d]*i,c[h++]=n[d+1]+o[d+1]*i,c[h++]=n[d+2]+o[d+2]*i;var f,v=e.boundingSphere;return u(v)&&(f=new r(v.center,v.radius+i)),new m({attributes:{position:new p({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:c})},primitiveType:E.LINES,boundingSphere:f})},X.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],i=e.attributes,n={},o=0,a=r.length;for(t=0;a>t;++t){var s=r[t];u(i[s])&&(n[s]=o++)}for(var l in i)i.hasOwnProperty(l)&&!u(n[l])&&(n[l]=o++);return n},X.reorderForPreVertexCache=function(e){var t=m.computeNumberOfVertices(e),r=e.indices;if(u(r)){for(var i=new Int32Array(t),n=0;t>n;n++)i[n]=-1; -for(var o,a=r,l=a.length,c=v.createTypedArray(t,l),h=0,d=0,p=0;l>h;)o=i[a[h]],-1!==o?c[d]=o:(o=a[h],i[o]=p,c[d]=p,++p),++h,++d;e.indices=c;var f=e.attributes;for(var g in f)if(f.hasOwnProperty(g)&&u(f[g])&&u(f[g].values)){for(var _=f[g],y=_.values,C=0,w=_.componentsPerAttribute,S=s.createTypedArray(_.componentDatatype,p*w);t>C;){var E=i[C];if(-1!==E)for(n=0;w>n;n++)S[w*E+n]=y[w*C+n];++C}_.values=S}}return e},X.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===E.TRIANGLES&&u(r)){for(var i=r.length,n=0,o=0;i>o;o++)r[o]>n&&(n=r[o]);e.indices=b.tipsify({indices:r,maximumIndex:n,cacheSize:t})}return e},X.fitToUnsignedShortIndices=function(e){var t=[],r=m.computeNumberOfVertices(e);if(u(e.indices)&&r>y.SIXTY_FOUR_KILOBYTES){var i,n=[],o=[],a=0,s=M(e.attributes),l=e.indices,c=l.length;e.primitiveType===E.TRIANGLES?i=3:e.primitiveType===E.LINES?i=2:e.primitiveType===E.POINTS&&(i=1);for(var h=0;c>h;h+=i){for(var d=0;i>d;++d){var p=l[h+d],f=n[p];u(f)||(f=a++,n[p]=f,D(s,e.attributes,p)),o.push(f)}a+i>y.SIXTY_FOUR_KILOBYTES&&(t.push(new m({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere})),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}))}else t.push(e);return t};var Z=new n,Q=new a;X.projectTo2D=function(e,t,r,i,o){var a=e.attributes[t];o=u(o)?o:new d;for(var l=o.ellipsoid,h=a.values,m=new Float64Array(h.length),f=0,v=0;vc;++c)h.encode(o[c],J),l[c]=J.high,u[c]=J.low;var d=n.componentsPerAttribute;return e.attributes[r]=new p({componentDatatype:s.FLOAT,componentsPerAttribute:d,values:l}),e.attributes[i]=new p({componentDatatype:s.FLOAT,componentsPerAttribute:d,values:u}),delete e.attributes[t],e};var K=new n,$=new w,et=new C;X.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(w.equals(t,w.IDENTITY))return e;var i=e.geometry.attributes;I(t,i.position),I(t,i.prevPosition),I(t,i.nextPosition),(u(i.normal)||u(i.binormal)||u(i.tangent))&&(w.inverse(t,$),w.transpose($,$),w.getRotation($,et),O(et,i.normal),O(et,i.binormal),O(et,i.tangent));var n=e.geometry.boundingSphere;return u(n)&&(e.geometry.boundingSphere=r.transform(n,t,n)),e.modelMatrix=w.clone(w.IDENTITY),e};var tt=new n;X.combine=function(e){var t,i,o,a,s=e.length;e[0].modelMatrix;var l,c,h,d=u(e[0].geometry.indices),p=e[0].geometry.primitiveType,f=R(e);for(t in f)if(f.hasOwnProperty(t))for(l=f[t].values,a=0,i=0;s>i;++i)for(c=e[i].geometry.attributes[t].values,h=c.length,o=0;h>o;++o)l[a++]=c[o];var g;if(d){var _=0;for(i=0;s>i;++i)_+=e[i].geometry.indices.length;var y=m.computeNumberOfVertices(new m({attributes:f,primitiveType:E.POINTS})),C=v.createTypedArray(y,_),w=0,S=0;for(i=0;s>i;++i){var b=e[i].geometry.indices,T=b.length;for(a=0;T>a;++a)C[w++]=S+b[a];S+=m.computeNumberOfVertices(e[i].geometry)}g=C}var x,P=new n,A=0;for(i=0;s>i;++i){if(x=e[i].geometry.boundingSphere,!u(x)){P=void 0;break}n.add(x.center,P,P)}if(u(P))for(n.divideByScalar(P,s,P),i=0;s>i;++i){x=e[i].geometry.boundingSphere;var M=n.magnitude(n.subtract(x.center,P,tt))+x.radius;M>A&&(A=M)}return new m({attributes:f,indices:g,primitiveType:p,boundingSphere:u(P)?new r(P,A):void 0})};var rt=new n,it=new n,nt=new n,ot=new n;X.computeNormal=function(e){for(var t=e.indices,r=e.attributes,i=r.position.values,o=r.position.values.length/3,a=t.length,l=new Array(o),u=new Array(a/3),c=new Array(a),h=0;o>h;h++)l[h]={indexOffset:0,count:0,currentCount:0};var d=0;for(h=0;a>h;h+=3){var m=t[h],f=t[h+1],v=t[h+2],g=3*m,_=3*f,y=3*v;it.x=i[g],it.y=i[g+1],it.z=i[g+2],nt.x=i[_],nt.y=i[_+1],nt.z=i[_+2],ot.x=i[y],ot.y=i[y+1],ot.z=i[y+2],l[m].count++,l[f].count++,l[v].count++,n.subtract(nt,it,nt),n.subtract(ot,it,ot),u[d]=n.cross(nt,ot,new n),d++}var C=0;for(h=0;o>h;h++)l[h].indexOffset+=C,C+=l[h].count;d=0;var w;for(h=0;a>h;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;o>h;h++){var b=3*h;if(w=l[h],w.count>0){for(n.clone(n.ZERO,rt),d=0;dc;c+=3){var f=t[c],v=t[c+1],g=t[c+2];h=3*f,d=3*v,m=3*g;var _=2*f,y=2*v,C=2*g,w=r[h],S=r[h+1],E=r[h+2],b=o[_],T=o[_+1],x=o[y+1]-T,P=o[C+1]-T,A=1/((o[y]-b)*P-(o[C]-b)*x),M=(P*(r[d]-w)-x*(r[m]-w))*A,D=(P*(r[d+1]-S)-x*(r[m+1]-S))*A,I=(P*(r[d+2]-E)-x*(r[m+2]-E))*A;u[h]+=M,u[h+1]+=D,u[h+2]+=I,u[d]+=M,u[d+1]+=D,u[d+2]+=I,u[m]+=M,u[m+1]+=D,u[m+2]+=I}var O=new Float32Array(3*a),R=new Float32Array(3*a);for(c=0;a>c;c++){h=3*c,d=h+1,m=h+2;var L=n.fromArray(i,h,at),N=n.fromArray(u,h,lt),F=n.dot(L,N);n.multiplyByScalar(L,F,st),n.normalize(n.subtract(N,st,N),N),R[h]=N.x,R[d]=N.y,R[m]=N.z,n.normalize(n.cross(L,N,N),N),O[h]=N.x,O[d]=N.y,O[m]=N.z}return e.attributes.tangent=new p({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:R}),e.attributes.binormal=new p({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:O}),e};var ut=new i,ct=new n,ht=new n,dt=new n;X.compressVertices=function(t){var r=t.attributes.normal,o=t.attributes.st;if(!u(r)&&!u(o))return t;var a,l,c,h,d=t.attributes.tangent,m=t.attributes.binormal;u(r)&&(a=r.values),u(o)&&(l=o.values),u(d)&&(c=d.values),m&&(h=m.values);var f=u(a)?a.length:l.length,v=u(a)?3:2,g=f/v,_=g,y=u(l)&&u(a)?2:1;y+=u(c)||u(h)?1:0,_*=y;for(var C=new Float32Array(_),w=0,S=0;g>S;++S){u(l)&&(i.fromArray(l,2*S,ut),C[w++]=e.compressTextureCoordinates(ut));var E=3*S;u(a)&&u(c)&&u(h)?(n.fromArray(a,E,ct),n.fromArray(c,E,ht),n.fromArray(h,E,dt),e.octPack(ct,ht,dt,ut),C[w++]=ut.x,C[w++]=ut.y):(u(a)&&(n.fromArray(a,E,ct),C[w++]=e.octEncodeFloat(ct)),u(c)&&(n.fromArray(c,E,ct),C[w++]=e.octEncodeFloat(ct)),u(h)&&(n.fromArray(h,E,ct),C[w++]=e.octEncodeFloat(ct)))}return t.attributes.compressedAttributes=new p({componentDatatype:s.FLOAT,componentsPerAttribute:y,values:C}),u(a)&&delete t.attributes.normal,u(l)&&delete t.attributes.st,u(c)&&delete t.attributes.tangent,u(h)&&delete t.attributes.binormal,t};var mt=new n,pt=new n,ft=new n,vt=new n,gt=new n,_t={positions:new Array(7),indices:new Array(9)},yt=new n,Ct=new n,wt=new n,St=new i,Et=new i,bt=new i,Tt=new n,xt=S.fromPointNormal(n.ZERO,n.UNIT_Y),Pt=new n,At=new n,Mt=new i,Dt=new i,It=new n,Ot=new n,Rt=new n,Lt=new n,Nt=new n,Ft=new o;return new o,X.wrapLongitude=function(e){var t=e.boundingSphere;if(u(t)){var i=t.center.x-t.radius;if(i>0||r.intersect(t,o.UNIT_Y)!==g.INTERSECTING)return e}if(e.geometryType!==f.NONE)switch(e.geometryType){case f.POLYLINES:Y(e);break;case f.TRIANGLES:q(e);break;case f.LINES:j(e)}else k(e),e.primitiveType===E.TRIANGLES?q(e):e.primitiveType===E.LINES&&j(e);return e},X}),r("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w){"use strict";function S(e,t,i){var o=t.vertexFormat,a=t.center,s=t.semiMajorAxis,u=t.ellipsoid,h=t.stRotation,p=i?2*(e.length/3):e.length/3,f=o.st?new Float32Array(2*p):void 0,v=o.normal?new Float32Array(3*p):void 0,g=o.tangent?new Float32Array(3*p):void 0,y=o.binormal?new Float32Array(3*p):void 0,w=0,S=N,E=F,b=B,T=new c(u),x=T.project(u.cartesianToCartographic(a,z),V),P=u.scaleToGeodeticSurface(a,A);u.geodeticSurfaceNormal(P,P);for(var I=C.fromAxisAngle(P,h,L),k=_.fromQuaternion(I,R),U=e.length,W=i?U:0,G=2*(W/3),H=0;U>H;H+=3){var q=H+1,j=H+2,Y=r.fromArray(e,H,A);if(o.st){var X=_.multiplyByVector(k,Y,M),Z=T.project(u.cartesianToCartographic(X,z),D);r.subtract(Z,x,Z),O.x=(Z.x+s)/(2*s),O.y=(Z.y+s)/(2*s),i&&(f[w+G]=O.x,f[w+1+G]=O.y),f[w++]=O.x,f[w++]=O.y}S=u.geodeticSurfaceNormal(Y,S),(o.normal||o.tangent||o.binormal)&&((o.tangent||o.binormal)&&(E=r.cross(r.UNIT_Z,S,E),_.multiplyByVector(k,E,E)),o.normal&&(v[H]=S.x,v[q]=S.y,v[j]=S.z,i&&(v[H+W]=-S.x,v[q+W]=-S.y,v[j+W]=-S.z)),o.tangent&&(g[H]=E.x,g[q]=E.y,g[j]=E.z,i&&(g[H+W]=-E.x,g[q+W]=-E.y,g[j+W]=-E.z)),o.binormal&&(b=r.cross(S,E,b),y[H]=b.x,y[q]=b.y,y[j]=b.z,i&&(y[H+W]=b.x,y[q+W]=b.y,y[j+W]=b.z)))}var Q=new m;if(o.position){var J=l.raisePositionsToHeight(e,t,i);Q.position=new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:J})}return o.st&&(Q.st=new d({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:f})),o.normal&&(Q.normal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:v})),o.tangent&&(Q.tangent=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:g})),o.binormal&&(Q.binormal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:y})),Q}function E(e){var t,r,i,n,o,a=new Array(2*e*(e+1)),s=0;for(n=1;e>n;++n){for(i=n*(n+1),t=(n-1)*n,a[s++]=i++,a[s++]=t,a[s++]=i,r=2*n,o=0;r-1>o;++o)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;a[s++]=i++,a[s++]=t,a[s++]=i}for(r=2*e,++i,++t,n=0;r-1>n;++n)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;for(++t,++i,n=e-1;n>0;--n){for(a[s++]=t++,a[s++]=t,a[s++]=i,r=2*n,o=0;r-1>o;++o)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;a[s++]=t++,a[s++]=t++,a[s++]=i++}return a}function b(t){var i=t.center;k=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(i,k),t.height,k),k=r.add(i,k,k);var n=new e(k,t.semiMajorAxis),o=l.computeEllipsePositions(t,!0,!1),a=o.positions,s=o.numPts,u=S(a,t,!1),c=E(s);return c=v.createTypedArray(a.length/3,c),{boundingSphere:n,attributes:u,indices:c}}function T(e,t){var i=t.vertexFormat,o=t.center,a=t.semiMajorAxis,s=t.ellipsoid,l=t.height,u=t.extrudedHeight,h=t.stRotation,p=2*(e.length/3),f=new Float64Array(3*p),v=i.st?new Float32Array(2*p):void 0,g=i.normal?new Float32Array(3*p):void 0,y=i.tangent?new Float32Array(3*p):void 0,w=i.binormal?new Float32Array(3*p):void 0,S=0,E=N,b=F,T=B,x=new c(s),P=x.project(s.cartesianToCartographic(o,z),V),k=s.scaleToGeodeticSurface(o,A);s.geodeticSurfaceNormal(k,k);for(var U=C.fromAxisAngle(k,h,L),W=_.fromQuaternion(U,R),G=e.length,H=2*(G/3),q=0;G>q;q+=3){var j,Y=q+1,X=q+2,Z=r.fromArray(e,q,A);if(i.st){var Q=_.multiplyByVector(W,Z,M),J=x.project(s.cartesianToCartographic(Q,z),D);r.subtract(J,P,J),O.x=(J.x+a)/(2*a),O.y=(J.y+a)/(2*a),v[S+H]=O.x,v[S+1+H]=O.y,v[S++]=O.x,v[S++]=O.y}Z=s.scaleToGeodeticSurface(Z,Z),j=r.clone(Z,M),E=s.geodeticSurfaceNormal(Z,E);var K=r.multiplyByScalar(E,l,I);if(Z=r.add(Z,K,Z),K=r.multiplyByScalar(E,u,K),j=r.add(j,K,j),i.position&&(f[q+G]=j.x,f[Y+G]=j.y,f[X+G]=j.z,f[q]=Z.x,f[Y]=Z.y,f[X]=Z.z),i.normal||i.tangent||i.binormal){T=r.clone(E,T);var $=r.fromArray(e,(q+3)%G,I);r.subtract($,Z,$);var et=r.subtract(j,Z,D);E=r.normalize(r.cross(et,$,E),E),i.normal&&(g[q]=E.x,g[Y]=E.y,g[X]=E.z,g[q+G]=E.x,g[Y+G]=E.y,g[X+G]=E.z),i.tangent&&(b=r.normalize(r.cross(T,E,b),b),y[q]=b.x,y[Y]=b.y,y[X]=b.z,y[q+G]=b.x,y[q+1+G]=b.y,y[q+2+G]=b.z),i.binormal&&(w[q]=T.x,w[Y]=T.y,w[X]=T.z,w[q+G]=T.x,w[Y+G]=T.y,w[X+G]=T.z)}}var tt=new m;return i.position&&(tt.position=new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:f})),i.st&&(tt.st=new d({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:v})),i.normal&&(tt.normal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:g})),i.tangent&&(tt.tangent=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:y})),i.binormal&&(tt.binormal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:w})),tt}function x(e){for(var t,r,i,n,o=e.length/3,a=v.createTypedArray(o,6*o),s=0,l=0;o-1>l;l++)t=l,i=l+o,r=t+1,n=r+o,a[s++]=t,a[s++]=i,a[s++]=r,a[s++]=r,a[s++]=i,a[s++]=n;return t=o-1,i=l+o,r=0,n=r+o,a[s++]=t,a[s++]=i,a[s++]=r,a[s++]=r,a[s++]=i,a[s++]=n,a}function P(t){var i=t.center,n=t.ellipsoid,o=t.semiMajorAxis,a=r.multiplyByScalar(n.geodeticSurfaceNormal(i,A),t.height,A);U.center=r.add(i,a,U.center),U.radius=o,a=r.multiplyByScalar(n.geodeticSurfaceNormal(i,a),t.extrudedHeight,a),W.center=r.add(i,a,W.center),W.radius=o;var s=l.computeEllipsePositions(t,!0,!0),u=s.positions,c=s.numPts,d=s.outerPositions,m=e.union(U,W),g=S(u,t,!0),_=E(c),C=_.length;_.length=2*C;for(var w=u.length/3,b=0;C>b;b+=3)_[b+C]=_[b+2]+w,_[b+1+C]=_[b+1]+w,_[b+2+C]=_[b]+w;var P=v.createTypedArray(2*w/3,_),M=new h({attributes:g,indices:P,primitiveType:y.TRIANGLES}),D=T(d,t);_=x(d);var I=v.createTypedArray(2*d.length/3,_),O=new h({attributes:D,indices:I,primitiveType:y.TRIANGLES}),R=f.combine([new p({geometry:M}),new p({geometry:O})]);return{boundingSphere:m,attributes:R.attributes,indices:R.indices}}var A=new r,M=new r,D=new r,I=new r,O=new t,R=new _,L=new C,N=new r,F=new r,B=new r,z=new i,V=new r,k=new r,U=new e,W=new e,G=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.center,i=e.semiMajorAxis,n=e.semiMinorAxis,s=o(e.granularity,g.RADIANS_PER_DEGREE),l=o(e.height,0),c=e.extrudedHeight,h=a(c)&&!g.equalsEpsilon(l,c,1);this._center=r.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=n,this._ellipsoid=o(e.ellipsoid,u.WGS84),this._rotation=o(e.rotation,0),this._stRotation=o(e.stRotation,0),this._height=l,this._granularity=s,this._vertexFormat=o(e.vertexFormat,w.DEFAULT),this._extrudedHeight=c,this._extrude=h,this._workerName="createEllipseGeometry"};return G.createGeometry=function(e){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=b(r),new h({attributes:t.attributes,indices:t.indices,primitiveType:y.TRIANGLES,boundingSphere:t.boundingSphere})},G}),r("Core/CircleGeometry",["./defaultValue","./defined","./DeveloperError","./EllipseGeometry"],function(e,t,r,i){"use strict";var n=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.radius,n={center:t.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:t.ellipsoid,height:t.height,extrudedHeight:t.extrudedHeight,granularity:t.granularity,vertexFormat:t.vertexFormat,stRotation:t.stRotation};this._ellipseGeometry=new i(n),this._workerName="createCircleGeometry"};return n.createGeometry=function(e){return i.createGeometry(e._ellipseGeometry)},n}),r("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";function p(i){var n=i.center;g=t.multiplyByScalar(i.ellipsoid.geodeticSurfaceNormal(n,g),i.height,g),g=t.add(n,g,g);for(var o=new e(g,i.semiMajorAxis),s=a.computeEllipsePositions(i,!1,!0).outerPositions,l=new c({position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(s,i,!1)})}),d=s.length/3,m=h.createTypedArray(d,2*d),p=0,f=0;d-1>f;f++)m[p++]=f,m[p++]=f+1;return m[p++]=d-1,m[p++]=0,{boundingSphere:o,attributes:l,indices:m}}function f(n){var o=i(n.numberOfVerticalLines,16);o=Math.max(o,0);var s=n.center,l=n.ellipsoid,d=n.semiMajorAxis,m=t.multiplyByScalar(l.geodeticSurfaceNormal(s,v),n.height,v);_.center=t.add(s,m,_.center),_.radius=d,m=t.multiplyByScalar(l.geodeticSurfaceNormal(s,m),n.extrudedHeight,m),y.center=t.add(s,m,y.center),y.radius=d;var p=a.computeEllipsePositions(n,!1,!0).outerPositions,f=new c({position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(p,n,!0)})});p=f.position.values;var g=e.union(_,y),C=p.length/3,w=h.createTypedArray(C,2*C+2*o);C/=2;for(var S=0,E=0;C-1>E;E++)w[S++]=E,w[S++]=E+1,w[S++]=E+C,w[S++]=E+C+1;w[S++]=C-1,w[S++]=0,w[S++]=C+C-1,w[S++]=C;var b;if(o>0){var T=Math.min(o,C);b=Math.round(C/T)}var x=Math.min(b*o,C);if(o>0)for(E=0;x>E;E+=b)w[S++]=E,w[S++]=E+C;return{boundingSphere:g,attributes:f,indices:w}}var v=new t,g=new t,_=new e,y=new e,C=function(e){e=i(e,i.EMPTY_OBJECT);var r=e.center,o=e.semiMajorAxis,a=e.semiMinorAxis,l=i(e.granularity,d.RADIANS_PER_DEGREE),u=i(e.height,0),c=e.extrudedHeight,h=n(c)&&!d.equalsEpsilon(u,c,1);this._center=t.clone(r),this._semiMajorAxis=o,this._semiMinorAxis=a,this._ellipsoid=i(e.ellipsoid,s.WGS84),this._rotation=i(e.rotation,0),this._height=u,this._granularity=l,this._extrudedHeight=c,this._extrude=h,this._numberOfVerticalLines=Math.max(i(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"};return C.createGeometry=function(e){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,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),t=f(r)):t=p(r),new l({attributes:t.attributes,indices:t.indices,primitiveType:m.LINES,boundingSphere:t.boundingSphere})},C}),r("Core/CircleOutlineGeometry",["./defaultValue","./defined","./DeveloperError","./EllipseOutlineGeometry"],function(e,t,r,i){"use strict";var n=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.radius,n={center:t.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:t.ellipsoid,height:t.height,extrudedHeight:t.extrudedHeight,granularity:t.granularity,numberOfVerticalLines:t.numberOfVerticalLines};this._ellipseGeometry=new i(n),this._workerName="createCircleOutlineGeometry"};return n.createGeometry=function(e){return i.createGeometry(e._ellipseGeometry)},n}),r("Core/ClockRange",["./freezeObject"],function(e){"use strict";var t={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};return e(t)}),r("Core/ClockStep",["./freezeObject"],function(e){"use strict";var t={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};return e(t)}),r("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()}}),r("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,i=t[r++],n=function(e,t,r,i){r||(r=" ");var n=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return i?e+n:n+e},o=function(e,t,r,i,o,a){var s=i-e.length;return s>0&&(e=r||!o?n(e,i,a,r):e.slice(0,t.length)+n("",s,"0",!0)+e.slice(t.length)),e},a=function(e,t,r,i,a,s,l){var u=e>>>0;return r=r&&u&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+n(u.toString(t),s||0,"0",!1),o(e,r,i,a,l)},s=function(e,t,r,i,n,a){return null!=i&&(e=e.slice(0,i)),o(e,"",t,r,n,a)},l=function(e,i,l,u,c,h,d){var m,p,f,v,g;if("%%"==e)return"%";for(var _=!1,y="",C=!1,w=!1,S=" ",E=l.length,b=0;l&&E>b;b++)switch(l.charAt(b)){case" ":y=" ";break;case"+":y="+";break;case"-":_=!0;break;case"'":S=l.charAt(b+1);break;case"0":C=!0;break;case"#":w=!0}if(u=u?"*"==u?+t[r++]:"*"==u.charAt(0)?+t[u.slice(1,-1)]:+u:0,0>u&&(u=-u,_=!0),!isFinite(u))throw new Error("sprintf: (minimum-)width must be finite");switch(h=h?"*"==h?+t[r++]:"*"==h.charAt(0)?+t[h.slice(1,-1)]:+h:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,g=i?t[i.slice(0,-1)]:t[r++],d){case"s":return s(String(g),_,u,h,C,S);case"c":return s(String.fromCharCode(+g),_,u,h,C);case"b":return a(g,2,w,_,u,h,C);case"o":return a(g,8,w,_,u,h,C);case"x":return a(g,16,w,_,u,h,C);case"X":return a(g,16,w,_,u,h,C).toUpperCase();case"u":return a(g,10,w,_,u,h,C);case"i":case"d":return m=+g||0,m=Math.round(m-m%1),p=0>m?"-":y,g=p+n(String(Math.abs(m)),h,"0",!1),o(g,p,_,u,C);case"e":case"E":case"f":case"F":case"g":case"G":return m=+g,p=0>m?"-":y,f=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],v=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],g=p+Math.abs(m)[f](h),o(g,p,_,u,C)[v]();default:return e}};return i.replace(e,l)}return e}),r("Core/binarySearch",["./defined","./DeveloperError"],function(){"use strict";var e=function(e,t,r){for(var i,n,o=0,a=e.length-1;a>=o;)if(i=~~((o+a)/2),n=r(e[i],t),0>n)o=i+1;else{if(!(n>0))return i;a=i-1}return~(a+1)};return e}),r("Core/GregorianDate",[],function(){"use strict";var e=function(e,t,r,i,n,o,a,s){this.year=e,this.month=t,this.day=r,this.hour=i,this.minute=n,this.second=o,this.millisecond=a,this.isLeapSecond=s};return e}),r("Core/isLeapYear",["./DeveloperError"],function(){"use strict";function e(e){return 0===e%4&&0!==e%100||0===e%400}return e}),r("Core/LeapSecond",[],function(){"use strict";var e=function(e,t){this.julianDate=e,this.offset=t};return e}),r("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)}),r("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),r("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t){return M.compare(e.julianDate,t.julianDate)}function h(e){_.julianDate=e;var r=M.leapSeconds,i=t(r,_,c);0>i&&(i=~i),i>=r.length&&(i=r.length-1);var n=r[i].offset;if(i>0){var o=M.secondsDifference(r[i].julianDate,e);o>n&&(i--,n=r[i].offset)}M.addSeconds(e,n,e)}function d(e,r){_.julianDate=e;var i=M.leapSeconds,n=t(i,_,c);if(0>n&&(n=~n),0===n)return M.addSeconds(e,-i[0].offset,r);if(n>=i.length)return M.addSeconds(e,-i[n-1].offset,r);var o=M.secondsDifference(i[n].julianDate,e);return 0===o?M.addSeconds(e,-i[n].offset,r):1>=o?void 0:M.addSeconds(e,-i[--n].offset,r)}function m(e,t,r){var i=0|t/l.SECONDS_PER_DAY;return e+=i,t-=l.SECONDS_PER_DAY*i,0>t&&(e--,t+=l.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function p(e,t,r,i,n,o,a){var s=0|(t-14)/12,u=e+4800+s,c=(0|1461*u/4)+(0|367*(t-2-12*s)/12)-(0|3*((u+100)/100)/4)+r-32075;i-=12,0>i&&(i+=24);var h=o+(i*l.SECONDS_PER_HOUR+n*l.SECONDS_PER_MINUTE+a*l.SECONDS_PER_MILLISECOND);return h>=43200&&(c-=1),[c,h]}var f=new o,v=[31,28,31,30,31,30,31,31,30,31,30,31],g=29,_=new s,y=/^(\d{4})$/,C=/^(\d{4})-(\d{2})$/,w=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,E=/^(\d{4})-?(\d{2})-?(\d{2})$/,b=/([Z+\-])?(\d{2})?:?(\d{2})?$/,T=/^(\d{2})(\.\d+)?/.source+b.source,x=/^(\d{2}):?(\d{2})(\.\d+)?/.source+b.source,P=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+b.source,A="Invalid ISO 8601 date.",M=function(e,t,i){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r(e,0),t=r(t,0),i=r(i,u.UTC);var n=0|e;t+=(e-n)*l.SECONDS_PER_DAY,m(n,t,this),i===u.UTC&&h(this)};M.fromDate=function(e,t){var r=p(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return i(t)?(m(r[0],r[1],t),h(t),t):new M(r[0],r[1],u.UTC)},M.fromIso8601=function(e,t){e=e.replace(",",".");var r,o,s,l=e.split("T"),c=1,d=1,f=0,_=0,b=0,D=0,I=l[0],O=l[1];if(!i(I))throw new n(A);var R;if(l=I.match(E),null!==l){if(R=I.split("-").length-1,R>0&&2!==R)throw new n(A);r=+l[1],c=+l[2],d=+l[3]}else if(l=I.match(C),null!==l)r=+l[1],c=+l[2];else if(l=I.match(y),null!==l)r=+l[1];else{var L;if(l=I.match(w),null!==l){if(r=+l[1],L=+l[2],s=a(r),1>L||s&&L>366||!s&&L>365)throw new n(A)}else{if(l=I.match(S),null===l)throw new n(A);r=+l[1];var N=+l[2],F=+l[3]||0;if(R=I.split("-").length-1,R>0&&(!i(l[3])&&1!==R||i(l[3])&&2!==R))throw new n(A);var B=new Date(Date.UTC(r,0,4));L=7*N+F-B.getUTCDay()-3}o=new Date(Date.UTC(r,0,1)),o.setUTCDate(L),c=o.getUTCMonth()+1,d=o.getUTCDate()}if(s=a(r),1>c||c>12||1>d||(2!==c||!s)&&d>v[c-1]||s&&2===c&&d>g)throw new n(A);var z;if(i(O)){if(l=O.match(P),null!==l){if(R=O.split(":").length-1,R>0&&2!==R&&3!==R)throw new n(A);f=+l[1],_=+l[2],b=+l[3],D=1e3*+(l[4]||0),z=5}else if(l=O.match(x),null!==l){if(R=O.split(":").length-1,R>0&&1!==R)throw new n(A);f=+l[1],_=+l[2],b=60*+(l[3]||0),z=4}else{if(l=O.match(T),null===l)throw new n(A);f=+l[1],_=60*+(l[2]||0),z=3}if(_>=60||b>=61||f>24||24===f&&(_>0||b>0||D>0))throw new n(A);var V=l[z],k=+l[z+1],U=+(l[z+2]||0);switch(V){case"+":f-=k,_-=U;break;case"-":f+=k,_+=U;break;case"Z":break;default:_+=new Date(Date.UTC(r,c-1,d,f,_)).getTimezoneOffset()}}else _+=new Date(Date.UTC(r,c-1,d)).getTimezoneOffset();var W=60===b;for(W&&b--;_>=60;)_-=60,f++;for(;f>=24;)f-=24,d++;for(o=s&&2===c?g:v[c-1];d>o;)d-=o,c++,c>12&&(c-=12,r++),o=s&&2===c?g:v[c-1];for(;0>_;)_+=60,f--;for(;0>f;)f+=24,d--;for(;1>d;)c--,1>c&&(c+=12,r--),o=s&&2===c?g:v[c-1],d+=o;var G=p(r,c,d,f,_,b,D);return i(t)?(m(G[0],G[1],t),h(t)):t=new M(G[0],G[1],u.UTC),W&&M.addSeconds(t,1,t),t},M.now=function(e){return M.fromDate(new Date,e)};var D=new M(0,0,u.TAI);return M.toGregorianDate=function(e,t){var r=!1,n=d(e,D);i(n)||(M.addSeconds(e,-1,D),n=d(D,D),r=!0);var a=n.dayNumber,s=n.secondsOfDay;s>=43200&&(a+=1);var u=0|a+68569,c=0|4*u/146097;u=0|u-(0|(146097*c+3)/4);var h=0|4e3*(u+1)/1461001;u=0|u-(0|1461*h/4)+31;var m=0|80*u/2447,p=0|u-(0|2447*m/80);u=0|m/11;var f=0|m+2-12*u,v=0|100*(c-49)+h+u,g=0|s/l.SECONDS_PER_HOUR,_=s-g*l.SECONDS_PER_HOUR,y=0|_/l.SECONDS_PER_MINUTE;_-=y*l.SECONDS_PER_MINUTE;var C=0|_,w=(_-C)/l.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),r&&(C+=1),i(t)?(t.year=v,t.month=f,t.day=p,t.hour=g,t.minute=y,t.second=C,t.millisecond=w,t.isLeapSecond=r,t):new o(v,f,p,g,y,C,w,r)},M.toDate=function(e){var t=M.toGregorianDate(e,f),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 n,o=M.toGregorianDate(t,o);return i(r)||0===o.millisecond?i(r)&&0!==r?(n=(.01*o.millisecond).toFixed(r).replace(".","").slice(0,r),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))},M.clone=function(e,t){return i(e)?i(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new M(e.dayNumber,e.secondsOfDay,u.TAI):void 0},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||i(e)&&i(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},M.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(M.secondsDifference(e,t))<=r},M.totalDays=function(e){return e.dayNumber+e.secondsOfDay/l.SECONDS_PER_DAY},M.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*l.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},M.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/l.SECONDS_PER_DAY;return r+i},M.computeTaiMinusUtc=function(e){_.julianDate=e;var r=M.leapSeconds,i=t(r,_,c);return 0>i&&(i=~i,--i,0>i&&(i=0)),r[i].offset},M.addSeconds=function(e,t,r){return m(e.dayNumber,e.secondsOfDay+t,r)},M.addMinutes=function(e,t,r){var i=e.secondsOfDay+t*l.SECONDS_PER_MINUTE;return m(e.dayNumber,i,r)},M.addHours=function(e,t,r){var i=e.secondsOfDay+t*l.SECONDS_PER_HOUR;return m(e.dayNumber,i,r)},M.addDays=function(e,t,r){var i=e.dayNumber+t;return m(i,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 s(new M(2441317,43210,u.TAI),10),new s(new M(2441499,43211,u.TAI),11),new s(new M(2441683,43212,u.TAI),12),new s(new M(2442048,43213,u.TAI),13),new s(new M(2442413,43214,u.TAI),14),new s(new M(2442778,43215,u.TAI),15),new s(new M(2443144,43216,u.TAI),16),new s(new M(2443509,43217,u.TAI),17),new s(new M(2443874,43218,u.TAI),18),new s(new M(2444239,43219,u.TAI),19),new s(new M(2444786,43220,u.TAI),20),new s(new M(2445151,43221,u.TAI),21),new s(new M(2445516,43222,u.TAI),22),new s(new M(2446247,43223,u.TAI),23),new s(new M(2447161,43224,u.TAI),24),new s(new M(2447892,43225,u.TAI),25),new s(new M(2448257,43226,u.TAI),26),new s(new M(2448804,43227,u.TAI),27),new s(new M(2449169,43228,u.TAI),28),new s(new M(2449534,43229,u.TAI),29),new s(new M(2450083,43230,u.TAI),30),new s(new M(2450630,43231,u.TAI),31),new s(new M(2451179,43232,u.TAI),32),new s(new M(2453736,43233,u.TAI),33),new s(new M(2454832,43234,u.TAI),34),new s(new M(2456109,43235,u.TAI),35)],M}),r("Core/Clock",["./ClockRange","./ClockStep","./defaultValue","./defined","./DeveloperError","./Event","./getTimestamp","./JulianDate"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(n){n=r(n,r.EMPTY_OBJECT);var l=n.startTime,u=!i(l),c=n.stopTime,h=!i(c),d=n.currentTime,m=!i(d);u&&h&&m?(d=s.now(),l=s.clone(d),c=s.addDays(d,1,new s)):u&&h?(l=s.clone(d),c=s.addDays(d,1,new s)):u&&m?(l=s.addDays(c,-1,new s),d=s.clone(l)):m&&h?(d=s.clone(l),c=s.addDays(l,1,new s)):m?d=s.clone(l):h?c=s.addDays(d,1,new s):u&&(l=s.clone(d)),this.startTime=l,this.stopTime=c,this.currentTime=d,this.multiplier=r(n.multiplier,1),this.clockStep=r(n.clockStep,t.SYSTEM_CLOCK_MULTIPLIER),this.clockRange=r(n.clockRange,e.UNBOUNDED),this.canAnimate=r(n.canAnimate,!0),this.shouldAnimate=r(n.shouldAnimate,!0),this.onTick=new o,this._lastSystemTime=a()};return l.prototype.tick=function(){var r=a(),i=s.clone(this.currentTime),n=this.startTime,o=this.stopTime,l=this.multiplier;if(this.canAnimate&&this.shouldAnimate)if(this.clockStep===t.SYSTEM_CLOCK)i=s.now(i);else{if(this.clockStep===t.TICK_DEPENDENT)i=s.addSeconds(i,l,i);else{var u=r-this._lastSystemTime;i=s.addSeconds(i,l*(u/1e3),i)}if(this.clockRange===e.CLAMPED)s.lessThan(i,n)?i=s.clone(n,i):s.greaterThan(i,o)&&(i=s.clone(o,i));else if(this.clockRange===e.LOOP_STOP)for(s.lessThan(i,n)&&(i=s.clone(n,i));s.greaterThan(i,o);)i=s.addSeconds(n,s.secondsDifference(i,o),i)}return this.currentTime=i,this._lastSystemTime=r,this.onTick.raiseEvent(this),i},l}),r("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e,t,r){return 0>r&&(r+=1),r>1&&(r-=1),1>6*r?e+6*(t-e)*r:1>2*r?t:2>3*r?e+6*(t-e)*(2/3-r):e}var s=function(t,r,i,n){this.red=e(t,1),this.green=e(r,1),this.blue=e(i,1),this.alpha=e(n,1)};s.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 s(e.x,e.y,e.z,e.w)},s.fromBytes=function(t,r,i,n){return t=s.byteToFloat(e(t,255)),r=s.byteToFloat(e(r,255)),i=s.byteToFloat(e(i,255)),n=s.byteToFloat(e(n,255)),new s(t,r,i,n) -};var l,u,c;i.supportsTypedArrays()&&(l=new ArrayBuffer(4),u=new Uint32Array(l),c=new Uint8Array(l)),s.fromRgba=function(e){return u[0]=e,s.fromBytes(c[0],c[1],c[2],c[3])},s.fromHsl=function(t,r,i,n){t=e(t,0)%1,r=e(r,0),i=e(i,0),n=e(n,1);var o=i,l=i,u=i;if(0!==r){var c;c=.5>i?i*(1+r):i+r-i*r;var h=2*i-c;o=a(h,c,t+1/3),l=a(h,c,t),u=a(h,c,t-1/3)}return new s(o,l,u,n)},s.fromRandom=function(r,i){r=e(r,e.EMPTY_OBJECT);var n=r.red;if(!t(n)){var a=e(r.minimumRed,0),l=e(r.maximumRed,1);n=a+o.nextRandomNumber()*(l-a)}var u=r.green;if(!t(u)){var c=e(r.minimumGreen,0),h=e(r.maximumGreen,1);u=c+o.nextRandomNumber()*(h-c)}var d=r.blue;if(!t(d)){var m=e(r.minimumBlue,0),p=e(r.maximumBlue,1);d=m+o.nextRandomNumber()*(p-m)}var f=r.alpha;if(!t(f)){var v=e(r.minimumAlpha,0),g=e(r.maximumAlpha,1);f=v+o.nextRandomNumber()*(g-v)}return t(i)?(i.red=n,i.green=u,i.blue=d,i.alpha=f,i):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,m=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,p=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(r){var i=s[r.toUpperCase()];if(t(i))return s.clone(i);var n=h.exec(r);return null!==n?new s(parseInt(n[1],16)/15,parseInt(n[2],16)/15,parseInt(n[3],16)/15):(n=d.exec(r),null!==n?new s(parseInt(n[1],16)/255,parseInt(n[2],16)/255,parseInt(n[3],16)/255):(n=m.exec(r),null!==n?new s(parseFloat(n[1])/("%"===n[1].substr(-1)?100:255),parseFloat(n[2])/("%"===n[2].substr(-1)?100:255),parseFloat(n[3])/("%"===n[3].substr(-1)?100:255),parseFloat(e(n[4],"1.0"))):(n=p.exec(r),null!==n?s.fromHsl(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,parseFloat(e(n[4],"1.0"))):void 0)))},s.packedLength=4,s.pack=function(t,r,i){i=e(i,0),r[i++]=t.red,r[i++]=t.green,r[i++]=t.blue,r[i]=t.alpha},s.unpack=function(r,i,n){return i=e(i,0),t(n)||(n=new s),n.red=r[i++],n.green=r[i++],n.blue=r[i++],n.alpha=r[i],n},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:0|256*e},s.clone=function(e,r){return t(e)?t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=e.alpha,r):new s(e.red,e.green,e.blue,e.alpha):void 0},s.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},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,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},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),r=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+r+")":"rgba("+e+","+t+","+r+","+this.alpha+")"},s.prototype.toBytes=function(e){var r=s.floatToByte(this.red),i=s.floatToByte(this.green),n=s.floatToByte(this.blue),o=s.floatToByte(this.alpha);return t(e)?(e[0]=r,e[1]=i,e[2]=n,e[3]=o,e):[r,i,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.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}),r("Core/ColorGeometryInstanceAttribute",["./Color","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,r,i,n){"use strict";var o=function(t,i,n,o){t=r(t,1),i=r(i,1),n=r(n,1),o=r(o,1),this.value=new Uint8Array([e.floatToByte(t),e.floatToByte(i),e.floatToByte(n),e.floatToByte(o)])};return n(o.prototype,{componentDatatype:{get:function(){return t.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),o.fromColor=function(e){return new o(e.red,e.green,e.blue,e.alpha)},o.toValue=function(e,t){return i(t)?e.toBytes(t):new Uint8Array(e.toBytes())},o}),r("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),r("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}),r("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){var t=e._uSquared,r=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,n=(r-i)/r,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,m=1-d,p=Math.sqrt(m),f=t/4,v=f*f,g=v*f,_=v*v,y=1+f-3*v/4+5*g/4-175*_/64,C=1-f+15*v/8-35*g/8,w=1-3*f+35*v/4,S=1-5*f,E=y*c-C*Math.sin(2*c)*f/2-w*Math.sin(4*c)*v/16-S*Math.sin(6*c)*g/48-5*Math.sin(8*c)*_/512,b=e._constants;b.a=r,b.b=i,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=m,b.cosineAlpha=p,b.u2Over4=f,b.u4Over16=v,b.u6Over64=g,b.u8Over256=_,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,r,i,n,o,a){var s=u(e,r);return(1-s)*e*t*(i+s*n*(a+s*o*(2*a*a-1)))}function h(e,t,r,i,n,o,a){var l,u,h,d,m,p=(t-r)/t,f=o-i,v=Math.atan((1-p)*Math.tan(n)),g=Math.atan((1-p)*Math.tan(a)),_=Math.cos(v),y=Math.sin(v),C=Math.cos(g),w=Math.sin(g),S=_*C,E=_*w,b=y*w,T=y*C,x=f,P=s.TWO_PI,A=Math.cos(x),M=Math.sin(x);do{A=Math.cos(x),M=Math.sin(x);var D=E-T*A;h=Math.sqrt(C*C*M*M+D*D),u=b+S*A,l=Math.atan2(h,u);var I;0===h?(I=0,d=1):(I=S*M/h,d=1-I*I),P=x,m=u-2*b/d,isNaN(m)&&(m=0),x=f+c(p,I,d,l,h,u,m)}while(Math.abs(x-P)>s.EPSILON12);var O=d*(t*t-r*r)/(r*r),R=1+O*(4096+O*(O*(320-175*O)-768))/16384,L=O*(256+O*(O*(74-47*O)-128))/1024,N=m*m,F=L*h*(m+L*(u*(2*N-1)-L*m*(4*h*h-3)*(4*N-3)/6)/4),B=r*R*(l-F),z=Math.atan2(C*M,E-T*A),V=Math.atan2(_*M,E*A-T);e._distance=B,e._startHeading=z,e._endHeading=V,e._uSquared=O}function d(r,i,n,o){e.normalize(o.cartographicToCartesian(i,p),m),e.normalize(o.cartographicToCartesian(n,p),p),h(r,o.maximumRadius,o.minimumRadius,i.longitude,i.latitude,n.longitude,n.latitude),i.height=0,n.height=0,r._start=t.clone(i,r._start),r._end=t.clone(n,r._end),l(r)}var m=new e,p=new e,f=function(e,n,o){var s=r(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,i(e)&&i(n)&&d(this,e,n,s)};return n(f.prototype,{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}}}),f.prototype.setEndPoints=function(e,t){d(this,e,t,this._ellipsoid)},f.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},f.prototype.interpolateUsingSurfaceDistance=function(e,r){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),m=Math.sin(8*o),p=o*o,f=o*p,v=n.u8Over256,g=n.u2Over4,_=n.u6Over64,y=n.u4Over16,C=2*f*v*a/3+o*(1-g+7*y/4-15*_/4+579*v/64-(y-15*_/4+187*v/16)*a-(5*_/4-115*v/16)*s-29*v*l/16)+(g/2-y+71*_/32-85*v/16)*u+(5*y/16-5*_/4+383*v/96)*h-p*((_-11*v/2)*u+5*v*h/2)+(29*_/96-29*v/16)*d+539*v*m/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,P=n.sineU*b,A=Math.atan2(b*n.sineHeading,x-P*n.cosineHeading),M=A-c(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,b,T,E);return i(r)?(r.longitude=this._start.longitude+M,r.latitude=S,r.height=0,r):new t(this._start.longitude+M,S,0)},f}),r("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,t,r){var i,n=new Array(e);if(t===r){for(i=0;e>i;i++)n[i]=t;return n}var o=r-t,a=o/e;for(i=1;e>i;i++){var s=t+i*a;n[i]=s}return n[0]=t,n}function m(t,r,i,n,o,a,s,l){var u=n.scaleToGeodeticSurface(t,P),c=n.scaleToGeodeticSurface(r,A),h=p.numberOfPoints(t,r,i),m=n.cartesianToCartographic(u,b),f=n.cartesianToCartographic(c,T),v=d(h,o,a);M.setEndPoints(m,f);var g=M.surfaceDistance/h,_=l;m.height=o;var y=n.cartographicToCartesian(m,x);e.pack(y,s,_),_+=3;for(var C=1;h>C;C++){var w=M.interpolateUsingSurfaceDistance(C*g,T);w.height=v[C],y=n.cartographicToCartesian(w,x),e.pack(y,s,_),_+=3}return _}var p={};p.numberOfPoints=function(t,r,i){var n=e.angleBetween(t,r);return Math.ceil(n/i)};var f=new t;p.extractHeights=function(e,t){for(var r=e.length,i=new Array(r),n=0;r>n;n++){var o=e[n];i[n]=t.cartesianToCartographic(o,f).height}return i};var v=new c,g=new e,_=new e,y=new h(e.ZERO,0),C=new e,w=new h(e.ZERO,0),S=new e,E=new e,b=new t,T=new t,x=new e,P=new e,A=new e,M=new a;return p.wrapLongitude=function(t,n){var o=[],a=[];if(i(t)&&t.length>0){n=r(n,c.IDENTITY);var l=c.inverseTransformation(n,v),u=c.multiplyByPoint(l,e.ZERO,g),d=c.multiplyByPointAsVector(l,e.UNIT_Y,_),m=h.fromPointNormal(u,d,y),p=c.multiplyByPointAsVector(l,e.UNIT_X,C),f=h.fromPointNormal(u,p,w),b=1;o.push(e.clone(t[0]));for(var T=o[0],x=t.length,P=1;x>P;++P){var A=t[P];if(h.getPointDistance(f,T)<0||h.getPointDistance(f,A)<0){var M=s.lineSegmentPlane(T,A,m,S);if(i(M)){var D=e.multiplyByScalar(d,5e-9,E);h.getPointDistance(m,T)<0&&e.negate(D,D),o.push(e.add(M,D,new e)),a.push(b+1),e.negate(D,D),o.push(e.add(M,D,new e)),b=1}}o.push(e.clone(t[P])),b++,T=A}a.push(b)}return{positions:o,lengths:a}},p.removeDuplicates=function(t){var r=t.length;if(2>r)return void 0;var i,n,o;for(i=1;r>i&&(n=t[i-1],o=t[i],!e.equals(n,o));++i);if(i===r)return void 0;var a=[];for(a.push(t[0]);r>i;++i)n=t[i-1],o=t[i],e.equals(n,o)||a.push(e.clone(o));return a},p.generateArc=function(t){i(t)||(t={});var n,a,s,c=t.positions,h=r(t.ellipsoid,o.WGS84),d=r(t.height,0),f=r(t.granularity,u.RADIANS_PER_DEGREE),v=c.length,g=0;for(n=0;v-1>n;n++)a=c[n],s=c[n+1],g+=p.numberOfPoints(a,s,f);g++;var _=3*g,y=new Array(_),C=0;for(n=0;v-1>n;n++){a=c[n],s=c[n+1];var w,S;l(d)?(w=d[n],S=d[n+1]):(w=d,S=d),C=m(a,s,f,h,w,S,y,C)}var E=c[v-1],T=h.cartesianToCartographic(E,b);T.height=l(d)?d[v-1]:d;var P=h.cartographicToCartesian(T,x);return e.pack(P,y,_-3),y},p.generateCartesianArc=function(t){for(var r=p.generateArc(t),i=r.length/3,n=new Array(i),o=0;i>o;o++)n[o]=e.unpack(r,3*o);return n},p}),r("Core/EarthOrientationParametersSample",[],function(){"use strict";var e=function(e,t,r,i,n){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=i,this.ut1MinusUtc=n};return e}),r("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,t){return a.compare(e.julianDate,t)}function m(e,r){if(!i(r.columnNames))return e._dataError="Error in loaded EOP data: The columnNames property is required.",void 0;if(!i(r.samples))return e._dataError="Error in loaded EOP data: The samples property is required.",void 0;var n=r.columnNames.indexOf("modifiedJulianDateUtc"),o=r.columnNames.indexOf("xPoleWanderRadians"),l=r.columnNames.indexOf("yPoleWanderRadians"),u=r.columnNames.indexOf("ut1MinusUtcSeconds"),m=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),p=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),f=r.columnNames.indexOf("taiMinusUtcSeconds");if(0>n||0>o||0>l||0>u||0>m||0>p||0>f)return e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns",void 0;var v=e._samples=r.samples,g=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=l,e._ut1MinusUtcSecondsColumn=u,e._xCelestialPoleOffsetRadiansColumn=m,e._yCelestialPoleOffsetRadiansColumn=p,e._taiMinusUtcSecondsColumn=f,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var _,y=e._addNewLeapSeconds,C=0,w=v.length;w>C;C+=e._columnCount){var S=v[C+n],E=v[C+f],b=S+c.MODIFIED_JULIAN_DATE_DIFFERENCE,T=new a(b,E,h.TAI);if(g.push(T),y){if(E!==_&&i(_)){var x=a.leapSeconds,P=t(x,T,d);if(0>P){var A=new s(T,E);x.splice(~P,0,A)}}_=E}}}function p(e,t,r,i,n){var o=r*i;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 f(e,t,r){return t+e*(r-t)}function v(e,t,r,i,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)||i.equals(u))return p(e,r,n,l,s),s;if(i.equals(c))return p(e,r,o,l,s),s;var h=a.secondsDifference(i,u)/a.secondsDifference(c,u),d=n*l,m=o*l,v=r[d+e._ut1MinusUtcSecondsColumn],g=r[m+e._ut1MinusUtcSecondsColumn],_=g-v;if(_>.5||-.5>_){var y=r[d+e._taiMinusUtcSecondsColumn],C=r[m+e._taiMinusUtcSecondsColumn];y!==C&&(c.equals(i)?v=g:g-=C-y)}return s.xPoleWander=f(h,r[d+e._xPoleWanderRadiansColumn],r[m+e._xPoleWanderRadiansColumn]),s.yPoleWander=f(h,r[d+e._yPoleWanderRadiansColumn],r[m+e._yPoleWanderRadiansColumn]),s.xPoleOffset=f(h,r[d+e._xCelestialPoleOffsetRadiansColumn],r[m+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=f(h,r[d+e._yCelestialPoleOffsetRadiansColumn],r[m+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=f(h,v,g),s}var g=function(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),i(t.data))m(this,t.data);else if(i(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:[]})};return g.NONE=o({getPromiseToLoad:function(){return e()},compute:function(e,t){return i(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}}),g.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},g.prototype.compute=function(e,r){if(!i(this._samples)){if(i(this._dataError))throw new u(this._dataError);return void 0}if(i(r)||(r=new n(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 o=this._dates,s=this._lastIndex,l=0,c=0;if(i(s)){var h=o[s],d=o[s+1],m=a.lessThanOrEquals(h,e),p=!i(d),f=p||a.greaterThanOrEquals(d,e);if(m&&f)return l=s,!p&&d.equals(e)&&++l,c=l+1,v(this,o,this._samples,e,l,c,r),r}var g=t(o,e,a.compare,this._dateColumn);return g>=0?(gl&&(l=0)),this._lastIndex=l,v(this,o,this._samples,e,l,c,r),r},g}),r("Core/Iau2006XysSample",[],function(){"use strict";var e=function(e,t,r){this.x=e,this.y=t,this.s=r};return e}),r("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r){var i=h;return i.dayNumber=t,i.secondsOfDay=r,o.daysDifference(i,e._sampleZeroDateTT)}function u(r,n){if(r._chunkDownloadsInProgress[n])return r._chunkDownloadsInProgress[n];var o=e.defer();r._chunkDownloadsInProgress[n]=o;var s,l=r._xysFileUrlTemplate;return s=i(l)?l.replace("{0}",n):t("Assets/IAU2006_XYS/IAU2006_XYS_"+n+".json"),e(a(s),function(e){r._chunkDownloadsInProgress[n]=!1;for(var t=r._samples,i=e.samples,a=3*n*r._samplesPerXysFile,s=0,l=i.length;l>s;++s)t[a+s]=i[s];o.resolve()}),o.promise}var c=function(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 o(this._sampleZeroJulianEphemerisDate,0,s.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,i=this._denominators=new Array(t+1),n=this._xTable=new Array(t+1),a=Math.pow(this._stepSizeDays,t),l=0;t>=l;++l){i[l]=a,n[l]=l*this._stepSizeDays;for(var u=0;t>=u;++u)u!==l&&(i[l]*=l-u);i[l]=1/i[l]}this._work=new Array(t+1),this._coef=new Array(t+1)},h=new o(0,0,s.TAI);return c.prototype.preload=function(t,r,i,n){var o=l(this,t,r),a=l(this,i,n),s=0|o/this._stepSizeDays-this._interpolationOrder/2;0>s&&(s=0);var c=a/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;c>=this._totalSamples&&(c=this._totalSamples-1);for(var h=0|s/this._samplesPerXysFile,d=0|c/this._samplesPerXysFile,m=[],p=h;d>=p;++p)m.push(u(this,p));return e.all(m)},c.prototype.computeXysRadians=function(e,t,r){var o=l(this,e,t);if(0>o)return void 0;var a=0|o/this._stepSizeDays;if(a>=this._totalSamples)return void 0;var s=this._interpolationOrder,c=a-(0|s/2);0>c&&(c=0);var h=c+s;h>=this._totalSamples&&(h=this._totalSamples-1,c=h-s,0>c&&(c=0));var d=!1,m=this._samples;if(i(m[3*c])||(u(this,0|c/this._samplesPerXysFile),d=!0),i(m[3*h])||(u(this,0|h/this._samplesPerXysFile),d=!0),d)return void 0;i(r)?(r.x=0,r.y=0,r.s=0):r=new n(0,0,0);var p,f,v=o-c*this._stepSizeDays,g=this._work,_=this._denominators,y=this._coef,C=this._xTable;for(p=0;s>=p;++p)g[p]=v-C[p];for(p=0;s>=p;++p){for(y[p]=1,f=0;s>=f;++f)f!==p&&(y[p]*=g[f]);y[p]*=_[p];var w=3*(c+p);r.x+=y[p]*m[w++],r.y+=y[p]*m[w++],r.s+=y[p]*m[w]}return r},c}),r("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./TimeConstants"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";var g={},_=new r,y=new r,C=new r;g.eastNorthUpToFixedFrame=function(e,t,i){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return o(i)?(i[0]=0,i[1]=1,i[2]=0,i[3]=0,i[4]=-a,i[5]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=a,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i):new f(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var s=_,l=y,c=C;return t=n(t,u.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,r.normalize(l,l),r.cross(s,l,c),o(i)?(i[0]=l.x,i[1]=l.y,i[2]=l.z,i[3]=0,i[4]=c.x,i[5]=c.y,i[6]=c.z,i[7]=0,i[8]=s.x,i[9]=s.y,i[10]=s.z,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i):new f(l.x,c.x,s.x,e.x,l.y,c.y,s.y,e.y,l.z,c.z,s.z,e.z,0,0,0,1)};var w=new r,S=new r,E=new r;g.northEastDownToFixedFrame=function(e,t,i){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return o(i)?(i[0]=-a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=-a,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i):new f(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var s=w,l=S,c=E;return t=n(t,u.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,r.normalize(l,l),r.cross(s,l,c),o(i)?(i[0]=c.x,i[1]=c.y,i[2]=c.z,i[3]=0,i[4]=l.x,i[5]=l.y,i[6]=l.z,i[7]=0,i[8]=-s.x,i[9]=-s.y,i[10]=-s.z,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i):new f(c.x,l.x,-s.x,e.x,c.y,l.y,-s.y,e.y,c.z,l.z,-s.z,e.z,0,0,0,1)},g.northUpEastToFixedFrame=function(e,t,i){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return o(i)?(i[0]=-a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=0,i[6]=a,i[7]=0,i[8]=0,i[9]=1,i[10]=0,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i):new f(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var s=_,l=y,c=C;return t=n(t,u.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,r.normalize(l,l),r.cross(s,l,c),o(i)?(i[0]=c.x,i[1]=c.y,i[2]=c.z,i[3]=0,i[4]=s.x,i[5]=s.y,i[6]=s.z,i[7]=0,i[8]=l.x,i[9]=l.y,i[10]=l.z,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i):new f(c.x,s.x,l.x,e.x,c.y,s.y,l.y,e.y,c.z,s.z,l.z,e.z,0,0,0,1)};var b=24110.54841,T=8640184.812866,x=.093104,P=-62e-7,A=1.1772758384668e-19,M=72921158553e-15,D=m.TWO_PI/86400,I=new d;g.computeTemeToPseudoFixedMatrix=function(e,t){I=d.addSeconds(e,-d.computeTaiMinusUtc(e),I);var r,i=I.dayNumber,n=I.secondsOfDay,a=i-2451545;r=n>=43200?(a+.5)/v.DAYS_PER_JULIAN_CENTURY:(a-.5)/v.DAYS_PER_JULIAN_CENTURY;var s=b+r*(T+r*(x+r*P)),l=s*D%m.TWO_PI,u=M+A*(i-2451545.5),c=(n+.5*v.SECONDS_PER_DAY)%v.SECONDS_PER_DAY,h=l+u*c,f=Math.cos(h),g=Math.sin(h);return o(t)?(t[0]=f,t[1]=-g,t[2]=0,t[3]=g,t[4]=f,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p(f,g,0,-g,f,0,0,0,1)},g.iau2006XysData=new c,g.earthOrientationParameters=s.NONE;var O=32.184,R=2451545;g.preloadIcrfFixed=function(t){var r=t.start.dayNumber,i=t.start.secondsOfDay+O,n=t.stop.dayNumber,o=t.stop.secondsOfDay+O,a=g.iau2006XysData.preload(r,i,n,o),s=g.earthOrientationParameters.getPromiseToLoad();return e.all([a,s])},g.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new p);var r=g.computeFixedToIcrfMatrix(e,t);return o(r)?p.transpose(r,t):void 0};var L=new h(0,0,0),N=new l(0,0,0,0,0,0),F=new p,B=new p;g.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new p);var r=g.earthOrientationParameters.compute(e,N);if(!o(r))return void 0;var i=e.dayNumber,n=e.secondsOfDay+O,a=g.iau2006XysData.computeXysRadians(i,n,L);if(!o(a))return void 0;var s=a.x+r.xPoleOffset,l=a.y+r.yPoleOffset,u=1/(1+Math.sqrt(1-s*s-l*l)),c=F;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=p.fromRotationZ(-a.s,B),f=p.multiply(c,h,F),_=e.dayNumber,y=e.secondsOfDay-d.computeTaiMinusUtc(e)+r.ut1MinusUtc,C=_-2451545,w=y/v.SECONDS_PER_DAY,S=.779057273264+w+.00273781191135448*(C+w);S=S%1*m.TWO_PI;var E=p.fromRotationZ(S,B),b=p.multiply(f,E,F),T=Math.cos(r.xPoleWander),x=Math.cos(r.yPoleWander),P=Math.sin(r.xPoleWander),A=Math.sin(r.yPoleWander),M=i-R+n/v.SECONDS_PER_DAY;M/=36525;var D=-47e-6*M*m.RADIANS_PER_DEGREE/3600,I=Math.cos(D),z=Math.sin(D),V=B;return V[0]=T*I,V[1]=T*z,V[2]=P,V[3]=-x*z+A*P*I,V[4]=x*I+A*P*z,V[5]=-A*T,V[6]=-A*z-x*P*I,V[7]=A*I-x*P*z,V[8]=x*T,p.multiply(b,V,t)};var z=new i;return g.pointToWindowCoordinates=function(e,t,r,i){return i=g.pointToGLWindowCoordinates(e,t,r,i),i.y=2*t[5]-i.y,i},g.pointToGLWindowCoordinates=function(e,r,n,a){o(a)||(a=new t);var s=z;return f.multiplyByVector(e,i.fromElements(n.x,n.y,n.z,1,s),s),i.multiplyByScalar(s,1/s.w,s),f.multiplyByVector(r,s,s),t.fromCartesian4(s,a)},g}),r("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";var p=new i,f=function(e,t){t=n(t,l.WGS84),e=t.scaleToGeodeticSurface(e);var i=m.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=r.fromCartesian4(c.getColumn(i,0,p)),this._yAxis=r.fromCartesian4(c.getColumn(i,1,p));var o=r.fromCartesian4(c.getColumn(i,2,p));this._plane=h.fromPointNormal(e,o)};a(f.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}}});var v=new e;f.fromPoints=function(t,r){var i=e.fromPoints(t,v);return new f(i.center,r)};var g=new d,_=new r;f.prototype.projectPointOntoPlane=function(e,i){var n=g;n.origin=e,r.normalize(e,n.direction);var a=u.rayPlane(n,this._plane,_);if(o(a)||(r.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,_)),o(a)){var s=r.subtract(a,this._origin,a),l=r.dot(this._xAxis,s),c=r.dot(this._yAxis,s);return o(i)?(i.x=l,i.y=c,i):new t(l,c)}return void 0},f.prototype.projectPointsOntoPlane=function(e,t){o(t)||(t=[]);for(var r=0,i=e.length,n=0;i>n;n++){var a=this.projectPointOntoPlane(e[n],t[r]);o(a)&&(t[r]=a,r++)}return t.length=r,t};var y=new r;return f.prototype.projectPointsOntoEllipsoid=function(e,t){var i=e.length;o(t)?t.length=i:t=new Array(i);for(var n=this._ellipsoid,a=this._origin,s=this._xAxis,l=this._yAxis,u=y,c=0;i>c;++c){var h=e[c]; -r.multiplyByScalar(s,h.x,u),o(t[c])||(t[c]=new r);var d=r.add(a,u,t[c]);r.multiplyByScalar(l,h.y,u),r.add(d,u,d),n.scaleToGeocentricSurface(d,d)}return t},f}),r("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,t){for(var r=new Array(e.length),i=0;io;o++)c[o]=r;return c.push(i),c}var h=i-r,d=h/u;for(o=1;u>o;o++){var m=r+o*d;c[o]=m}return c[0]=r,c.push(i),c}function p(r,i,n,a){var s=new o(n,a),l=s.projectPointOntoPlane(t.add(n,r,Y),Y),u=s.projectPointOntoPlane(t.add(n,i,X),X),c=e.angleBetween(l,u);return u.x*l.y-u.y*l.x>=0?-c:c}function f(e,r,i,n,o,a,u,c){var d=k,m=U;F=h.eastNorthUpToFixedFrame(e,o,F),d=l.multiplyByPointAsVector(F,N,d),d=t.normalize(d,d);var f=p(d,r,e,o);z=s.fromRotationZ(f,z),W.z=a,F=l.multiplyTransformation(F,l.fromRotationTranslation(z,W,B),F);var v=V;v[0]=u;for(var g=0;c>g;g++)for(var _=0;_l;l++){s=e[l];var u=s.x-o,c=s.y-a;i[n++]=u,i[n++]=0,i[n++]=c,i[n++]=u,i[n++]=0,i[n++]=c}return s=e[0],i[n++]=s.x-o,i[n++]=0,i[n++]=s.y-a,i}function _(e,t){for(var r=e.length,i=new Array(3*r),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=0;r>s;s++)i[n++]=e[s].x-o,i[n++]=0,i[n++]=e[s].y-a;return i}function y(e,r,i,o,l,u,h,d,m,p){var v,g=t.angleBetween(t.subtract(r,e,I),t.subtract(i,e,O)),_=o===n.BEVELED?0:Math.ceil(g/a.toRadians(5));v=l?s.fromQuaternion(c.fromAxisAngle(t.negate(e,I),g/(_+1),H),j):s.fromQuaternion(c.fromAxisAngle(e,g/(_+1),H),j);var y,C;if(r=t.clone(r,q),_>0)for(var w=p?2:1,S=0;_>S;S++)r=s.multiplyByVector(v,r,r),y=t.subtract(r,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(r,O),h=f(C,y,d,h,u,m,1,w);else y=t.subtract(r,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(r,O),h=f(C,y,d,h,u,m,1,1),i=t.clone(i,q),y=t.subtract(i,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,O),h=f(C,y,d,h,u,m,1,1);return h}function C(e,t){return a.equalsEpsilon(e.latitude,t.latitude,a.EPSILON6)&&a.equalsEpsilon(e.longitude,t.longitude,a.EPSILON6)}var w=[new t,new t],S=new t,E=new t,b=new t,T=new t,x=new t,P=new t,A=new t,M=new t,D=new t,I=new t,O=new t,R={},L=new i,N=new t(-1,0,0),F=new l,B=new l,z=new s,V=s.IDENTITY.clone(),k=new t,U=new r,W=new t,G=new t,H=new c,q=new t,j=new s;R.removeDuplicatesFromShape=function(t){for(var r=t.length,i=[],n=r-1,o=0;r>o;n=o++){var a=t[n],s=t[o];e.equals(a,s)||i.push(s)}return i};var Y=new t,X=new t;R.angleIsGreaterThanPi=function(e,r,i,n){var a=new o(i,n),s=a.projectPointOntoPlane(t.add(i,e,Y),Y),l=a.projectPointOntoPlane(t.add(i,r,X),X);return l.x*s.y-l.y*s.x>=0};var Z=new i,Q=new i;return R.removeDuplicatesFromPositions=function(e,t){var r=e.length;if(2>r)return e.slice(0);var i=[];i.push(e[0]);for(var n=1;r>n;++n){var o=e[n-1],a=e[n],s=t.cartesianToCartographic(o,Z),l=t.cartesianToCartographic(a,Q);C(s,l)||i.push(a)}return i},R.computePositions=function(e,r,i,o,s){var l=o._ellipsoid,c=d(e,l),h=o._granularity,p=o._cornerType,C=s?g(r,i):_(r,i),O=s?_(r,i):void 0,L=i.height/2,N=i.width/2,F=e.length,B=[],z=s?[]:void 0,V=S,k=E,U=b,W=T,G=x,H=P,q=A,j=M,Y=D,X=e[0],Z=e[1];W=l.geodeticSurfaceNormal(X,W),V=t.subtract(Z,X,V),V=t.normalize(V,V),j=t.cross(W,V,j),j=t.normalize(j,j);var Q=c[0],J=c[1];s&&(z=f(X,j,O,z,l,Q+L,1,1)),Y=t.clone(X,Y),X=Z,k=t.negate(V,k);for(var K,$,et=1;F-1>et;et++){var tt=s?2:1;Z=e[et+1],V=t.subtract(Z,X,V),V=t.normalize(V,V),U=t.add(V,k,U),U=t.normalize(U,U),W=l.geodeticSurfaceNormal(X,W);var rt=!t.equalsEpsilon(t.negate(U,I),W,a.EPSILON2);if(rt){U=t.cross(U,W,U),U=t.cross(W,U,U),U=t.normalize(U,U);var it=1/Math.max(.25,t.magnitude(t.cross(U,k,I))),nt=R.angleIsGreaterThanPi(V,k,X,l);nt?(G=t.add(X,t.multiplyByScalar(U,it*N,U),G),H=t.add(G,t.multiplyByScalar(j,N,H),H),w[0]=t.clone(Y,w[0]),w[1]=t.clone(H,w[1]),K=m(w,Q+L,J+L,h),$=u.generateArc({positions:w,granularity:h,ellipsoid:l}),B=v($,j,C,B,l,K,1),j=t.cross(W,V,j),j=t.normalize(j,j),q=t.add(G,t.multiplyByScalar(j,N,q),q),p===n.ROUNDED||p===n.BEVELED?y(G,H,q,p,nt,l,B,C,J+L,s):(U=t.negate(U,U),B=f(X,U,C,B,l,J+L,it,tt)),Y=t.clone(q,Y)):(G=t.add(X,t.multiplyByScalar(U,it*N,U),G),H=t.add(G,t.multiplyByScalar(j,-N,H),H),w[0]=t.clone(Y,w[0]),w[1]=t.clone(H,w[1]),K=m(w,Q+L,J+L,h),$=u.generateArc({positions:w,granularity:h,ellipsoid:l}),B=v($,j,C,B,l,K,1),j=t.cross(W,V,j),j=t.normalize(j,j),q=t.add(G,t.multiplyByScalar(j,-N,q),q),p===n.ROUNDED||p===n.BEVELED?y(G,H,q,p,nt,l,B,C,J+L,s):B=f(X,U,C,B,l,J+L,it,tt),Y=t.clone(q,Y)),k=t.negate(V,k)}else B=f(Y,j,C,B,l,Q+L,1,1),Y=X;Q=J,J=c[et+1],X=Z}w[0]=t.clone(Y,w[0]),w[1]=t.clone(X,w[1]),K=m(w,Q+L,J+L,h),$=u.generateArc({positions:w,granularity:h,ellipsoid:l}),B=v($,j,C,B,l,K,1),s&&(z=f(X,j,O,z,l,J+L,1,1)),F=B.length;var ot=s?F+z.length:F,at=new Float64Array(ot);return at.set(B),s&&at.set(z,F),at},R}),r("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./isArray","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(r,i,a,s,u){var c=e.angleBetween(e.subtract(i,r,f),e.subtract(a,r,v)),h=s===t.BEVELED?1:Math.ceil(c/n.toRadians(5))+1,d=3*h,m=new Array(d);m[d-3]=a.x,m[d-2]=a.y,m[d-1]=a.z;var p;p=u?o.fromQuaternion(l.fromAxisAngle(e.negate(r,f),c/h,D),I):o.fromQuaternion(l.fromAxisAngle(r,c/h,D),I);var g=0;i=e.clone(i,f);for(var _=0;h>_;_++)i=o.multiplyByVector(p,i,i),m[g++]=i.x,m[g++]=i.y,m[g++]=i.z;return m}function c(r){var i=C,n=w,o=S,a=r[1];n=e.fromArray(r[1],a.length-3,n),o=e.fromArray(r[0],0,o),i=e.multiplyByScalar(e.add(n,o,i),.5,i);var s=u(i,n,o,t.ROUNDED,!1),l=r.length-1,c=r[l-1];a=r[l],n=e.fromArray(c,c.length-3,n),o=e.fromArray(a,0,o),i=e.multiplyByScalar(e.add(n,o,i),.5,i);var h=u(i,n,o,t.ROUNDED,!1);return[s,h]}function h(t,r,i,n){var o=f;return n?o=e.add(t,r,o):(r=e.negate(r,r),o=e.add(t,r,o)),[o.x,o.y,o.z,i.x,i.y,i.z]}function d(t,r,i,n){for(var o=new Array(t.length),a=new Array(t.length),s=e.multiplyByScalar(r,i,f),l=e.negate(s,v),u=0,c=t.length-1,h=0;hq;q++){_=l.geodeticSurfaceNormal(W,_),G=o[q+1],D=e.normalize(e.subtract(G,W,D),D),R=e.normalize(e.add(D,I,R),R);var X=!e.equalsEpsilon(e.negate(R,f),_,n.EPSILON2);if(X){R=e.cross(R,_,R),R=e.cross(_,R,R);var Z=p/Math.max(.25,e.magnitude(e.cross(R,I,f))),Q=s.angleIsGreaterThanPi(D,I,W,l);R=e.multiplyByScalar(R,Z,R),Q?(F=e.add(W,R,F),z=e.add(F,e.multiplyByScalar(O,p,z),z),B=e.add(F,e.multiplyByScalar(O,2*p,B),B),y[0]=e.clone(N,y[0]),y[1]=e.clone(z,y[1]),H=a.generateArc({positions:y,granularity:i,ellipsoid:l}),V=d(H,O,p,V),g&&(k.push(O.x,O.y,O.z),U.push(_.x,_.y,_.z)),L=e.clone(B,L),O=e.normalize(e.cross(_,D,O),O),B=e.add(F,e.multiplyByScalar(O,2*p,B),B),N=e.add(F,e.multiplyByScalar(O,p,N),N),v===t.ROUNDED||v===t.BEVELED?j.push({leftPositions:u(F,L,B,v,Q)}):j.push({leftPositions:h(W,e.negate(R,R),B,Q)})):(B=e.add(W,R,B),z=e.add(B,e.negate(e.multiplyByScalar(O,p,z),z),z),F=e.add(B,e.negate(e.multiplyByScalar(O,2*p,F),F),F),y[0]=e.clone(N,y[0]),y[1]=e.clone(z,y[1]),H=a.generateArc({positions:y,granularity:i,ellipsoid:l}),V=d(H,O,p,V),g&&(k.push(O.x,O.y,O.z),U.push(_.x,_.y,_.z)),L=e.clone(F,L),O=e.normalize(e.cross(_,D,O),O),F=e.add(B,e.negate(e.multiplyByScalar(O,2*p,F),F),F),N=e.add(B,e.negate(e.multiplyByScalar(O,p,N),N),N),v===t.ROUNDED||v===t.BEVELED?j.push({rightPositions:u(B,L,F,v,Q)}):j.push({rightPositions:h(W,R,F,Q)})),I=e.negate(D,I)}W=G}_=l.geodeticSurfaceNormal(W,_),y[0]=e.clone(N,y[0]),y[1]=e.clone(W,y[1]),H=a.generateArc({positions:y,granularity:i,ellipsoid:l}),V=d(H,O,p,V),g&&(k.push(O.x,O.y,O.z),U.push(_.x,_.y,_.z));var J;return v===t.ROUNDED&&(J=c(V)),{positions:V,corners:j,lefts:k,normals:U,endPositions:J}};var O=new e,R=new e;return p.scaleToGeodeticHeight=function(t,r,n,o){var a=t.length,s=i(o)?o:new Array(t.length);s.length=t.length;for(var l=r,u=0;a>u;u+=3){var c=n.scaleToGeodeticSurface(e.fromArray(t,u,R),R),h=O;0!==r&&(h=n.geodeticSurfaceNormal(c,h),h=e.multiplyByScalar(h,l,h),c=e.add(c,h,c)),s[u]=c.x,s[u+1]=c.y,s[u+2]=c.z}return s},p}),r("Core/CorridorGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";function g(e,r,i,o,a,s){var l=e.normals,u=e.tangents,c=e.binormals,h=t.normalize(t.cross(i,r,A),A);s.normal&&n.addAttribute(l,r,o,a),s.binormal&&n.addAttribute(c,i,o,a),s.tangent&&n.addAttribute(u,h,o,a)}function _(e,i,o){var s,l,u,p=e.positions,f=e.corners,v=e.endPositions,_=e.lefts,y=e.normals,C=new h,w=0,x=0,D=0;for(l=0;ll;l++)V=t.fromArray($,3*(Q-1-l),V),z=t.fromArray($,3*(Q+l),z),n.addAttribute(U,z,j),n.addAttribute(U,V,void 0,Y),g(q,X,Z,j,Y,i),N=j/3,B=N+1,L=(Y-2)/3,F=L-1,J[K++]=L,J[K++]=N,J[K++]=F,J[K++]=F,J[K++]=N,J[K++]=B,j+=3,Y-=3}var et=0,tt=0,rt=p[et++],it=p[et++];U.set(rt,j),U.set(it,Y-it.length+1),Z=t.fromArray(_,tt,Z);var nt,ot;for(u=it.length-3,l=0;u>l;l+=3)nt=o.geodeticSurfaceNormal(t.fromArray(rt,l,A),A),ot=o.geodeticSurfaceNormal(t.fromArray(it,u-l,M),M),X=t.normalize(t.add(nt,ot,X),X),g(q,X,Z,j,Y,i),N=j/3,B=N+1,L=(Y-2)/3,F=L-1,J[K++]=L,J[K++]=N,J[K++]=F,J[K++]=F,J[K++]=N,J[K++]=B,j+=3,Y-=3;for(nt=o.geodeticSurfaceNormal(t.fromArray(rt,u,A),A),ot=o.geodeticSurfaceNormal(t.fromArray(it,u,M),M),X=t.normalize(t.add(nt,ot,X),X),tt+=3,l=0;ll;l++)V=t.fromArray(pt,3*(O-l-1),V),z=t.fromArray(pt,3*l,z),n.addAttribute(U,V,void 0,Y),n.addAttribute(U,z,j),g(q,X,Z,j,Y,i),B=j/3,N=B-1,F=(Y-2)/3,L=F+1,J[K++]=L,J[K++]=N,J[K++]=F,J[K++]=F,J[K++]=N,J[K++]=B,j+=3,Y-=3}if(C.position=new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:U}),i.st){var ft,vt,gt=new Float32Array(2*(k/3)),_t=0;if(R){w/=3,x/=3;var yt=Math.PI/(O+1);vt=1/(w-O+1),ft=1/(x-O+1);var Ct,wt=O/2;for(l=wt+1;O+1>l;l++)Ct=m.PI_OVER_TWO+yt*l,gt[_t++]=ft*(1+Math.cos(Ct)),gt[_t++]=.5*(1+Math.sin(Ct));for(l=1;x-O+1>l;l++)gt[_t++]=l*ft,gt[_t++]=0;for(l=O;l>wt;l--)Ct=m.PI_OVER_TWO-l*yt,gt[_t++]=1-ft*(1+Math.cos(Ct)),gt[_t++]=.5*(1+Math.sin(Ct));for(l=wt;l>0;l--)Ct=m.PI_OVER_TWO-yt*l,gt[_t++]=1-vt*(1+Math.cos(Ct)),gt[_t++]=.5*(1+Math.sin(Ct));for(l=w-O;l>0;l--)gt[_t++]=l*vt,gt[_t++]=1;for(l=1;wt+1>l;l++)Ct=m.PI_OVER_TWO+yt*l,gt[_t++]=vt*(1+Math.cos(Ct)),gt[_t++]=.5*(1+Math.sin(Ct))}else{for(w/=3,x/=3,vt=1/(w-1),ft=1/(x-1),l=0;x>l;l++)gt[_t++]=l*ft,gt[_t++]=0;for(l=w;l>0;l--)gt[_t++]=(l-1)*vt,gt[_t++]=1}C.st=new c({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:gt})}return i.normal&&(C.normal=new c({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:q.normals})),i.tangent&&(C.tangent=new c({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:q.tangents})),i.binormal&&(C.binormal=new c({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:q.binormals})),{attributes:C,indices:J}}function y(e,r){if(!(r.normal||r.binormal||r.tangent||r.st))return e;var i,o,a=e.position.values;(r.normal||r.binormal)&&(i=e.normal.values,o=e.binormal.values);var s,l=e.position.values.length/18,u=3*l,c=2*l,h=2*u;if(r.normal||r.binormal||r.tangent){var d=r.normal?new Float32Array(6*u):void 0,m=r.binormal?new Float32Array(6*u):void 0,p=r.tangent?new Float32Array(6*u):void 0,f=S,v=E,g=b,_=T,y=x,C=P,w=h;for(s=0;u>s;s+=3){var A=w+h;f=t.fromArray(a,s,f),v=t.fromArray(a,s+u,v),g=t.fromArray(a,(s+3)%u,g),v=t.subtract(v,f,v),g=t.subtract(g,f,g),_=t.normalize(t.cross(v,g,_),_),r.normal&&(n.addAttribute(d,_,A),n.addAttribute(d,_,A+3),n.addAttribute(d,_,w),n.addAttribute(d,_,w+3)),(r.tangent||r.binormal)&&(C=t.fromArray(i,s,C),r.binormal&&(n.addAttribute(m,C,A),n.addAttribute(m,C,A+3),n.addAttribute(m,C,w),n.addAttribute(m,C,w+3)),r.tangent&&(y=t.normalize(t.cross(C,_,y),y),n.addAttribute(p,y,A),n.addAttribute(p,y,A+3),n.addAttribute(p,y,w),n.addAttribute(p,y,w+3))),w+=6}if(r.normal){for(d.set(i),s=0;u>s;s+=3)d[s+u]=-i[s],d[s+u+1]=-i[s+1],d[s+u+2]=-i[s+2];e.normal.values=d}else e.normal=void 0;if(r.binormal?(m.set(o),m.set(o,u),e.binormal.values=m):e.binormal=void 0,r.tangent){var M=e.tangent.values;p.set(M),p.set(M,u),e.tangent.values=p}}if(r.st){var D=e.st.values,I=new Float32Array(6*c);I.set(D),I.set(D,c);for(var O=2*c,R=0;2>R;R++){for(I[O++]=D[0],I[O++]=D[1],s=2;c>s;s+=2){var L=D[s],N=D[s+1];I[O++]=L,I[O++]=N,I[O++]=L,I[O++]=N}I[O++]=D[0],I[O++]=D[1]}e.st.values=I}return e}function C(e,t,r){r[t++]=e[0],r[t++]=e[1],r[t++]=e[2];for(var i=3;iw;w+=3){var x=c[w],P=c[w+1],A=c[w+2];b[T++]=A+m,b[T++]=P+m,b[T++]=x+m}u=y(u,t);var M,D,I,O;for(w=0;E>w;w+=2)M=w+E,D=M+E,I=M+1,O=D+1,b[T++]=M,b[T++]=D,b[T++]=I,b[T++]=I,b[T++]=D,b[T++]=O;return{attributes:u,indices:b}}var S=new t,E=new t,b=new t,T=new t,x=new t,P=new t,A=new t,M=new t,D=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.positions,r=e.width;this._positions=t,this._width=r,this._ellipsoid=o(e.ellipsoid,l.WGS84),this._height=o(e.height,0),this._extrudedHeight=o(e.extrudedHeight,this._height),this._cornerType=o(e.cornerType,i.ROUNDED),this._vertexFormat=o(e.vertexFormat,v.DEFAULT),this._granularity=o(e.granularity,m.RADIANS_PER_DEGREE),this._workerName="createCorridorGeometry"};return D.createGeometry=function(t){var r=t._positions,i=t._height,o=t._extrudedHeight,s=i!==o,l=p.removeDuplicates(r);a(l)||(l=r);var c,h=t._ellipsoid,d=t._vertexFormat,m={ellipsoid:h,positions:l,width:t._width,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!0};if(s){var v=Math.max(i,o);o=Math.min(i,o),i=v,m.height=i,m.extrudedHeight=o,c=w(m,d)}else{var g=n.computePositions(m);c=_(g,d,h),c.attributes.position.values=n.scaleToGeodeticHeight(c.attributes.position.values,i,h,c.attributes.position.values)}var y=c.attributes,C=e.fromVertices(y.position.values,void 0,3);return d.position||(c.attributes.position.values=void 0),new u({attributes:y,indices:c.indices,primitiveType:f.TRIANGLES,boundingSphere:C})},D}),r("Core/CorridorOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";function v(e,o){var s,l,u,m=[],p=e.positions,f=e.corners,v=e.endPositions,g=new h,w=0,S=0,E=0;for(l=0;ll;l++)O=t.fromArray(k,3*(B-1-l),O),I=t.fromArray(k,3*(B+l),I),n.addAttribute(L,I,N),n.addAttribute(L,O,void 0,F),A=N/3,D=A+1,P=(F-2)/3,M=P-1,z[V++]=P,z[V++]=M,z[V++]=A,z[V++]=D,N+=3,F-=3}var U=0,W=p[U++],G=p[U++];for(L.set(W,N),L.set(G,F-G.length+1),u=G.length-3,m.push(N/3,(F-2)/3),l=0;u>l;l+=3)A=N/3,D=A+1,P=(F-2)/3,M=P-1,z[V++]=P,z[V++]=M,z[V++]=A,z[V++]=D,N+=3,F-=3;for(l=0;ll;l++)O=t.fromArray(Z,3*(T-l-1),O),I=t.fromArray(Z,3*l,I),n.addAttribute(L,O,void 0,F),n.addAttribute(L,I,N),D=N/3,A=D-1,M=(F-2)/3,P=M+1,z[V++]=P,z[V++]=M,z[V++]=A,z[V++]=D,N+=3,F-=3;m.push(N/3)}else m.push(N/3,(F-2)/3);return z[V++]=N/3,z[V++]=(F-2)/3,g.position=new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:L}),{attributes:g,indices:z,wallIndices:m}}function g(e){var t=e.ellipsoid,r=n.computePositions(e),i=v(r,e.cornerType),o=i.wallIndices,a=e.height,s=e.extrudedHeight,l=i.attributes,u=i.indices,c=l.position.values,h=c.length,m=new Float64Array(h);m.set(c);var p=new Float64Array(2*h);c=n.scaleToGeodeticHeight(c,a,t,c),m=n.scaleToGeodeticHeight(m,s,t,m),p.set(c),p.set(m,h),l.position.values=p,h/=3;var f,g=u.length,_=d.createTypedArray(p.length/3,2*(g+o.length));_.set(u);var y=g;for(f=0;g>f;f+=2){var C=u[f],w=u[f+1];_[y++]=C+h,_[y++]=w+h}var S,E;for(f=0;fa;a++){var v=a/n*e.TWO_PI,g=Math.cos(v),_=Math.sin(v),y=g*i,C=_*i,w=g*r,S=_*r;h[m+p]=y,h[m+p+1]=C,h[m+p+2]=l,h[m+f]=w,h[m+f+1]=S,h[m+f+2]=s,m+=3,o&&(h[d++]=y,h[d++]=C,h[d++]=l,h[d++]=w,h[d++]=S,h[d++]=s)}return h},t}),r("Core/CylinderGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";var f=new t,v=new r,g=new r,_=new r,y=new r,C=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,r=e.topRadius,i=e.bottomRadius,n=o(e.vertexFormat,p.DEFAULT),a=o(e.slices,128);this._length=t,this._topRadius=r,this._bottomRadius=i,this._vertexFormat=n,this._slices=a,this._workerName="createCylinderGeometry"};return C.createGeometry=function(o){var a,s=o._length,p=o._topRadius,C=o._bottomRadius,w=o._vertexFormat,S=o._slices,E=S+S,b=S+E,T=E+E,x=n.computePositions(s,p,C,S,!0),P=w.st?new Float32Array(2*T):void 0,A=w.normal?new Float32Array(3*T):void 0,M=w.tangent?new Float32Array(3*T):void 0,D=w.binormal?new Float32Array(3*T):void 0,I=w.normal||w.tangent||w.binormal;if(I){var O=w.tangent||w.binormal,R=0,L=0,N=0,F=v;F.z=0;var B=_,z=g;for(a=0;S>a;a++){var V=a/S*d.TWO_PI,k=Math.cos(V),U=Math.sin(V);I&&(F.x=k,F.y=U,O&&(B=r.normalize(r.cross(r.UNIT_Z,F,B),B)),w.normal&&(A[R++]=k,A[R++]=U,A[R++]=0,A[R++]=k,A[R++]=U,A[R++]=0),w.tangent&&(M[L++]=B.x,M[L++]=B.y,M[L++]=B.z,M[L++]=B.x,M[L++]=B.y,M[L++]=B.z),w.binormal&&(z=r.normalize(r.cross(F,B,z),z),D[N++]=z.x,D[N++]=z.y,D[N++]=z.z,D[N++]=z.x,D[N++]=z.y,D[N++]=z.z))}for(a=0;S>a;a++)w.normal&&(A[R++]=0,A[R++]=0,A[R++]=-1),w.tangent&&(M[L++]=1,M[L++]=0,M[L++]=0),w.binormal&&(D[N++]=0,D[N++]=-1,D[N++]=0);for(a=0;S>a;a++)w.normal&&(A[R++]=0,A[R++]=0,A[R++]=1),w.tangent&&(M[L++]=1,M[L++]=0,M[L++]=0),w.binormal&&(D[N++]=0,D[N++]=1,D[N++]=0)}var W=12*S-12,G=h.createTypedArray(T,W),H=0,q=0;for(a=0;S-1>a;a++)G[H++]=q,G[H++]=q+2,G[H++]=q+3,G[H++]=q,G[H++]=q+3,G[H++]=q+1,q+=2;for(G[H++]=E-2,G[H++]=0,G[H++]=1,G[H++]=E-2,G[H++]=1,G[H++]=E-1,a=1;S-1>a;a++)G[H++]=E+a+1,G[H++]=E+a,G[H++]=E;for(a=1;S-1>a;a++)G[H++]=b,G[H++]=b+a,G[H++]=b+a+1;var j=0;if(w.st){var Y=Math.max(p,C);for(a=0;T>a;a++){var X=r.fromArray(x,3*a,y);P[j++]=(X.x+Y)/(2*Y),P[j++]=(X.y+Y)/(2*Y)}}var Z=new c;w.position&&(Z.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:x})),w.normal&&(Z.normal=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:A})),w.tangent&&(Z.tangent=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:M})),w.binormal&&(Z.binormal=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:D})),w.st&&(Z.st=new u({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:P})),f.x=.5*s,f.y=Math.max(C,p);var Q=new e(r.ZERO,t.magnitude(f));return new l({attributes:Z,indices:G,primitiveType:m.TRIANGLES,boundingSphere:Q})},C}),r("Core/CylinderOutlineGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";var m=new t,p=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,r=e.topRadius,i=e.bottomRadius,n=o(e.slices,128),a=Math.max(o(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=r,this._bottomRadius=i,this._slices=n,this._numberOfVerticalLines=a,this._workerName="createCylinderOutlineGeometry"};return p.createGeometry=function(o){var a,s=o._length,p=o._topRadius,f=o._bottomRadius,v=o._slices,g=o._numberOfVerticalLines,_=2*v,y=n.computePositions(s,p,f,v,!1),C=2*v;if(g>0){var w=Math.min(g,v);a=Math.round(v/w),C+=w}for(var S=h.createTypedArray(_,2*C),E=0,b=0;v-1>b;b++)S[E++]=b,S[E++]=b+1,S[E++]=b+v,S[E++]=b+1+v;if(S[E++]=v-1,S[E++]=0,S[E++]=v+v-1,S[E++]=v,g>0)for(b=0;v>b;b+=a)S[E++]=b,S[E++]=b+v;var T=new c;T.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:y}),m.x=.5*s,m.y=Math.max(f,p);var x=new e(r.ZERO,t.magnitude(m));return new l({attributes:T,indices:S,primitiveType:d.LINES,boundingSphere:x})},p}),r("Core/DefaultProxy",[],function(){"use strict";var e=function(e){this.proxy=e};return e.prototype.getURL=function(e){return this.proxy+"?"+encodeURIComponent(e)},e}),r("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 r=e.indexOf(t);-1!==r&&e.splice(r,1)},update:function(t){if(0===e.length)return!1;var r=0;for(t=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now();re;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 m=e,this},this.interpolation=function(e){return p=e,this},this.chain=function(){return f=arguments,this},this.onStart=function(e){return v=e,this},this.onUpdate=function(e){return _=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(d>e)return!0;g===!1&&(null!==v&&v.call(r),g=!0);var u=(e-d)/a;u=u>1?1:u;var C=m(u);for(t in n){var w=i[t]||0,S=n[t];S instanceof Array?r[t]=p(S,C):("string"==typeof S&&(S=w+parseFloat(S,10)),"number"==typeof S&&(r[t]=w+(S-w)*C))}if(null!==_&&_.call(r,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}i[t]=o[t]}return l&&(c=!c),d=e+h,!0}null!==y&&y.call(r);for(var b=0,T=f.length;T>b;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,r=.1,i=.4;return 0===e?0:1===e?1:(!r||1>r?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/i)))},Out:function(e){var t,r=.1,i=.4;return 0===e?0:1===e?1:(!r||1>r?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-t)*2*Math.PI/i)+1)},InOut:function(e){var t,r=.1,i=.4;return 0===e?0:1===e?1:(!r||1>r?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?-.5*r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/i):.5*r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*2*Math.PI/i)+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 1/2.75>e?7.5625*e*e:2/2.75>e?7.5625*(e-=1.5/2.75)*e+.75:2.5/2.75>e?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(t){return.5>t?.5*e.Easing.Bounce.In(2*t):.5*e.Easing.Bounce.Out(2*t-1)+.5}}},e.Interpolation={Linear:function(t,r){var i=t.length-1,n=i*r,o=Math.floor(n),a=e.Interpolation.Utils.Linear;return 0>r?a(t[0],t[1],n):r>1?a(t[i],t[i-1],i-n):a(t[o],t[o+1>i?i:o+1],n-o)},Bezier:function(t,r){var i,n=0,o=t.length-1,a=Math.pow,s=e.Interpolation.Utils.Bernstein; -for(i=0;o>=i;i++)n+=a(1-r,o-i)*a(r,i)*t[i]*s(o,i);return n},CatmullRom:function(t,r){var i=t.length-1,n=i*r,o=Math.floor(n),a=e.Interpolation.Utils.CatmullRom;return t[0]===t[i]?(0>r&&(o=Math.floor(n=i*(1+r))),a(t[(o-1+i)%i],t[o],t[(o+1)%i],t[(o+2)%i],n-o)):0>r?t[0]-(a(t[0],t[0],t[1],t[1],-n)-t[0]):r>1?t[i]-(a(t[i],t[i],t[i-1],t[i-1],n-i)-t[i]):a(t[o?o-1:0],t[o],t[o+1>i?i:o+1],t[o+2>i?i:o+2],n-o)},Utils:{Linear:function(e,t,r){return(t-e)*r+e},Bernstein:function(t,r){var i=e.Interpolation.Utils.Factorial;return i(t)/i(r)/i(t-r)},Factorial:function(){var e=[1];return function(t){var r,i=1;if(e[t])return e[t];for(r=t;r>1;r--)i*=r;return e[t]=i}}(),CatmullRom:function(e,t,r,i,n){var o=.5*(r-e),a=.5*(i-t),s=n*n,l=n*s;return(2*t-2*r+o+a)*l+(-3*t+3*r-2*o-a)*s+o*n+t}}},e}),r("Core/EasingFunction",["../ThirdParty/Tween","./freezeObject"],function(e,t){"use strict";var r={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(r)}),r("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";var p=new r,f=new r,v=new r,g=new r,_=new r,y=new r(1,1,1),C=Math.cos,w=Math.sin,S=function(e){e=n(e,n.EMPTY_OBJECT);var t=n(e.radii,y),i=n(e.stackPartitions,64),o=n(e.slicePartitions,64),a=n(e.vertexFormat,m.DEFAULT);this._radii=r.clone(t),this._stackPartitions=i,this._slicePartitions=o,this._vertexFormat=a,this._workerName="createEllipsoidGeometry"};return S.createGeometry=function(n){var o,m,y=n._radii,S=a.fromCartesian3(y),E=n._vertexFormat,b=n._slicePartitions+1,T=n._stackPartitions+1,x=T*b,P=new Float64Array(3*x),A=6*(b-1)*(T-1),M=c.createTypedArray(x,A),D=E.normal?new Float32Array(3*x):void 0,I=E.tangent?new Float32Array(3*x):void 0,O=E.binormal?new Float32Array(3*x):void 0,R=E.st?new Float32Array(2*x):void 0,L=new Array(b),N=new Array(b),F=0;for(o=0;b>o;o++){var B=h.TWO_PI*o/(b-1);L[o]=C(B),N[o]=w(B),P[F++]=0,P[F++]=0,P[F++]=y.z}for(o=1;T-1>o;o++){var z=Math.PI*o/(T-1),V=w(z),k=y.x*V,U=y.y*V,W=y.z*C(z);for(m=0;b>m;m++)P[F++]=L[m]*k,P[F++]=N[m]*U,P[F++]=W}for(o=0;b>o;o++)P[F++]=0,P[F++]=0,P[F++]=-y.z;var G=new u;E.position&&(G.position=new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:P}));var H=0,q=0,j=0,Y=0;if(E.st||E.normal||E.tangent||E.binormal){for(o=0;x>o;o++){var X=r.fromArray(P,3*o,p),Z=S.geodeticSurfaceNormal(X,f);if(E.st){var Q=t.negate(Z,_);t.magnitude(Q)P.length&&(F=3*(o-b*Math.floor(.5*T))),r.fromArray(P,F,Q),S.geodeticSurfaceNormal(Q,Q),t.negate(Q,Q)),R[H++]=Math.atan2(Q.y,Q.x)/h.TWO_PI+.5,R[H++]=Math.asin(Z.z)/Math.PI+.5}if(E.normal&&(D[q++]=Z.x,D[q++]=Z.y,D[q++]=Z.z),E.tangent||E.binormal){var J=v;if(b>o||o>x-b-1?(r.cross(r.UNIT_X,Z,J),r.normalize(J,J)):(r.cross(r.UNIT_Z,Z,J),r.normalize(J,J)),E.tangent&&(I[j++]=J.x,I[j++]=J.y,I[j++]=J.z),E.binormal){var K=r.cross(Z,J,g);r.normalize(K,K),O[Y++]=K.x,O[Y++]=K.y,O[Y++]=K.z}}}E.st&&(G.st=new l({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:R})),E.normal&&(G.normal=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:D})),E.tangent&&(G.tangent=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:I})),E.binormal&&(G.binormal=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:O}))}for(F=0,o=0;T>o;o++){var $=o*b,et=(o+1)*b;for(m=0;b-1>m;m++)M[F++]=et+m,M[F++]=et+m+1,M[F++]=$+m+1,M[F++]=et+m,M[F++]=$+m+1,M[F++]=$+m}return new s({attributes:G,indices:M,primitiveType:d.TRIANGLES,boundingSphere:e.fromEllipsoid(S)})},S}),r("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=new t(1,1,1),m=Math.cos,p=Math.sin,f=function(e){e=i(e,i.EMPTY_OBJECT);var r=i(e.radii,d),n=i(e.stackPartitions,10),o=i(e.slicePartitions,8),a=i(e.subdivisions,128);this._radii=t.clone(r),this._stackPartitions=n,this._slicePartitions=o,this._subdivisions=a,this._workerName="createEllipsoidOutlineGeometry"};return f.createGeometry=function(t){var i,n,d,f,v,g,_=t._radii,y=o.fromCartesian3(_),C=t._stackPartitions,w=t._slicePartitions,S=t._subdivisions,E=S*(C+w-1),b=E-w+2,T=new Float64Array(3*b),x=u.createTypedArray(b,2*E),P=0,A=new Array(S),M=new Array(S);for(i=0;S>i;i++)d=c.TWO_PI*i/S,A[i]=m(d),M[i]=p(d);for(i=1;C>i;i++)for(f=Math.PI*i/C,v=m(f),g=p(f),n=0;S>n;n++)T[P++]=_.x*A[n]*g,T[P++]=_.y*M[n]*g,T[P++]=_.z*v;for(A.length=w,M.length=w,i=0;w>i;i++)d=c.TWO_PI*i/w,A[i]=m(d),M[i]=p(d);for(T[P++]=0,T[P++]=0,T[P++]=_.z,i=1;S>i;i++)for(f=Math.PI*i/S,v=m(f),g=p(f),n=0;w>n;n++)T[P++]=_.x*A[n]*g,T[P++]=_.y*M[n]*g,T[P++]=_.z*v;for(T[P++]=0,T[P++]=0,T[P++]=-_.z,P=0,i=0;C-1>i;++i){var D=i*S;for(n=0;S-1>n;++n)x[P++]=D+n,x[P++]=D+n+1;x[P++]=D+S-1,x[P++]=D}var I=S*(C-1);for(n=1;w+1>n;++n)x[P++]=I,x[P++]=I+n;for(i=0;S-2>i;++i){var O=i*w+1+I,R=(i+1)*w+1+I;for(n=0;w-1>n;++n)x[P++]=R+n,x[P++]=O+n;x[P++]=R+w-1,x[P++]=O+w-1}var L=T.length/3-1;for(n=L-1;n>L-w-1;--n)x[P++]=L,x[P++]=n;var N=new l({position:new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:T})});return new a({attributes:N,indices:x,primitiveType:h.LINES,boundingSphere:e.fromEllipsoid(y)})},f}),r("Core/EllipsoidTerrainProvider",["./defaultValue","./defined","./defineProperties","./Ellipsoid","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./TerrainProvider"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(r){r=e(r,{}),this._tilingScheme=r.tilingScheme,t(this._tilingScheme)||(this._tilingScheme=new o({ellipsoid:e(r.ellipsoid,i.WGS84)})),this._levelZeroMaximumGeometricError=s.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0));var l=16,u=16;this._terrainData=new a({buffer:new Uint8Array(l*u),width:16,height:16}),this._errorEvent=new n};return r(l.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return void 0}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),l.prototype.requestTileGeometry=function(){return this._terrainData},l.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<=r||r===1/0||r!==r?void 0:t.multiplyByScalar(e,r,i)}function u(e,r){return e.transformPositionToScaledSpace(r,v),t.normalize(v,v)}var c=function(e,r){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,i(r)&&(this.cameraPosition=r)};n(c.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var r=this._ellipsoid,i=r.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),n=t.magnitudeSquared(i)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=i,this._distanceToLimbInScaledSpaceSquared=n}}});var h=new t;c.prototype.isPointVisible=function(e){var t=this._ellipsoid,r=t.transformPositionToScaledSpace(e,h);return this.isScaledSpacePointVisible(r)},c.prototype.isScaledSpacePointVisible=function(e){var r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared,n=t.subtract(e,r,h),o=-t.dot(n,r),a=o>i&&o*o/t.magnitudeSquared(n)>i;return!a},c.prototype.computeHorizonCullingPoint=function(e,r,n){i(n)||(n=new t);for(var o=this._ellipsoid,a=u(o,e),c=0,h=0,d=r.length;d>h;++h){var m=r[h],p=s(o,m,a);c=Math.max(c,p)}return l(a,c,n)};var d=new t;c.prototype.computeHorizonCullingPointFromVertices=function(e,n,o,a,c){i(c)||(c=new t),a=r(a,t.ZERO);for(var h=this._ellipsoid,m=u(h,e),p=0,f=0,v=n.length;v>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=s(h,d,m);p=Math.max(p,g)}return l(m,p,c)};var m=[];c.prototype.computeHorizonCullingPointFromRectangle=function(r,i,n){var o=a.subsample(r,i,0,m),s=e.fromPoints(o);return t.magnitude(s.center)<.1*i.minimumRadius?void 0:this.computeHorizonCullingPoint(s.center,o,n)};var p=new t,f=new t,v=new t;return c}),r("Core/EventHelper",["./defined","./DeveloperError"],function(){"use strict";var e=function(){this._removalFunctions=[]};return e.prototype.add=function(e,t,r){var i=e.addEventListener(t,r);this._removalFunctions.push(i);var n=this;return function(){i();var e=n._removalFunctions;e.splice(e.indexOf(i),1)}},e.prototype.removeAll=function(){for(var e=this._removalFunctions,t=0,r=e.length;r>t;++t)e[t]();e.length=0},e}),r("Core/ExtrapolationType",["./freezeObject"],function(e){"use strict";var t={NONE:0,HOLD:1,EXTRAPOLATE:2};return e(t)}),r("Core/GeometryInstanceAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.value=t.value};return t}),r("Core/HermitePolynomialApproximation",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,i){"use strict";function n(e,t,r,i,o,a){var s,l,u,c=0;if(i>0){for(l=0;o>l;l++){for(s=!1,u=0;ul;l++){for(s=!1,u=0;ud;d++){var m=Math.floor(d*h);for(s=0;c>s;s++)l=t[s]*o*(a+1)+d,e[m+s]=n[l];for(var p=1;c>p;p++){var f=0,v=Math.floor(p*(1-p)/2)+c*p,g=!1;for(s=0;c-p>s;s++){var _,y,C=r[t[s]],w=r[t[s+p]];if(0>=w-C)l=t[s]*o*(a+1)+o*p+d,_=n[l],y=_/i.factorial(p),e[m+v+f]=y,f++;else{var S=Math.floor((p-1)*(2-p)/2)+c*(p-1);_=e[m+S+s+1]-e[m+S+s],y=_/(w-C),e[m+v+f]=y,f++}g=g||0!==_}g&&(u=Math.max(u,p))}}return u}var a=i.factorial,s={type:"Hermite"};s.getRequiredDataPoints=function(t,r){return r=e(r,0),Math.max(Math.floor((t+1)/(r+1)),2)},s.interpolateOrderZero=function(e,r,i,o,s){t(s)||(s=new Array(o));var l,u,c,h,d,m,p=r.length,f=new Array(o);for(l=0;o>l;l++){s[l]=0;var v=new Array(p);for(f[l]=v,u=0;p>u;u++)v[u]=[]}var g=p,_=new Array(g);for(l=0;g>l;l++)_[l]=l;var y=p-1;for(h=0;o>h;h++){for(u=0;g>u;u++)m=_[u]*o+h,f[h][0].push(i[m]);for(l=1;g>l;l++){var C=!1;for(u=0;g-l>u;u++){var w,S=r[_[u]],E=r[_[u+l]];0>=E-S?(m=_[u]*o+o*l+h,w=i[m],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;d>=c;c++)for(l=c;y>=l;l++){var b=n(e,_,r,c,l,[]);for(h=0;o>h;h++){var T=f[h][l][0];s[h+c*o]+=T*b}}return s};var l=[];return s.interpolate=function(e,r,i,a,s,u,c){var h=a*(u+1);t(c)||(c=new Array(h));for(var d=0;h>d;d++)c[d]=0;for(var m=r.length,p=new Array(m*(s+1)),f=0;m>f;f++)for(var v=0;s+1>v;v++)p[f*(s+1)+v]=f;for(var g=p.length,_=l,y=o(_,p,r,i,a,s),C=[],w=g*(g+1)/2,S=Math.min(y,u),E=0;S>=E;E++)for(f=E;y>=f;f++){C.length=0;for(var b=n(e,p,r,E,f,C),T=Math.floor(f*(1-f)/2)+g*f,x=0;a>x;x++){var P=Math.floor(x*w),A=_[P+T];c[x+E*a]+=A*b}}return c},s}),r("Core/IauOrientationParameters",[],function(){"use strict";var e=function(e,t,r,i){this.rightAscension=e,this.declination=t,this.rotation=r,this.rotationRate=i};return e}),r("Core/Iau2000Orientation",["./defined","./IauOrientationParameters","./JulianDate","./Math","./TimeConstants"],function(e,t,r,i,n){"use strict";var o={},a=32.184,s=2451545,l=-.0529921,u=-.1059842,c=13.0120009,h=13.3407154,d=.9856003,m=26.4057084,p=13.064993,f=.3287146,v=1.7484877,g=-.1589763,_=.0036096,y=.1643573,C=12.9590088,w=new r;return o.ComputeMoon=function(o,S){e(o)||(o=r.now()),w=r.addSeconds(o,a,w);var E=r.totalDays(w)-s,b=E/n.DAYS_PER_JULIAN_CENTURY,T=(125.045+l*E)*i.RADIANS_PER_DEGREE,x=(250.089+u*E)*i.RADIANS_PER_DEGREE,P=(260.008+c*E)*i.RADIANS_PER_DEGREE,A=(176.625+h*E)*i.RADIANS_PER_DEGREE,M=(357.529+d*E)*i.RADIANS_PER_DEGREE,D=(311.589+m*E)*i.RADIANS_PER_DEGREE,I=(134.963+p*E)*i.RADIANS_PER_DEGREE,O=(276.617+f*E)*i.RADIANS_PER_DEGREE,R=(34.226+v*E)*i.RADIANS_PER_DEGREE,L=(15.134+g*E)*i.RADIANS_PER_DEGREE,N=(119.743+_*E)*i.RADIANS_PER_DEGREE,F=(239.961+y*E)*i.RADIANS_PER_DEGREE,B=(25.053+C*E)*i.RADIANS_PER_DEGREE,z=Math.sin(T),V=Math.sin(x),k=Math.sin(P),U=Math.sin(A),W=Math.sin(M),G=Math.sin(D),H=Math.sin(I),q=Math.sin(O),j=Math.sin(R),Y=Math.sin(L),X=Math.sin(N),Z=Math.sin(F),Q=Math.sin(B),J=Math.cos(T),K=Math.cos(x),$=Math.cos(P),et=Math.cos(A),tt=Math.cos(M),rt=Math.cos(D),it=Math.cos(I),nt=Math.cos(O),ot=Math.cos(R),at=Math.cos(L),st=Math.cos(N),lt=Math.cos(F),ut=Math.cos(B),ct=(269.9949+.0031*b-3.8787*z-.1204*V+.07*k-.0172*U+.0072*G-.0052*Y+.0043*Q)*i.RADIANS_PER_DEGREE,ht=(66.5392+.013*b+1.5419*J+.0239*K-.0278*$+.0068*et-.0029*rt+9e-4*it+8e-4*at-9e-4*ut)*i.RADIANS_PER_DEGREE,dt=(38.3213+13.17635815*E-1.4e-12*E*E+3.561*z+.1208*V-.0642*k+.0158*U+.0252*W-.0066*G-.0047*H-.0046*q+.0028*j+.0052*Y+.004*X+.0019*Z-.0044*Q)*i.RADIANS_PER_DEGREE,mt=(13.17635815-1.4e-12*2*E+3.561*J*l+.1208*K*u-.0642*$*c+.0158*et*h+.0252*tt*d-.0066*rt*m-.0047*it*p-.0046*nt*f+.0028*ot*v+.0052*at*g+.004*st*_+.0019*lt*y-.0044*ut*C)/86400*i.RADIANS_PER_DEGREE;return e(S)||(S=new t),S.rightAscension=ct,S.declination=ht,S.rotation=dt,S.rotationRate=mt,S},o}),r("Core/IauOrientationAxes",["./Cartesian3","./defined","./Iau2000Orientation","./JulianDate","./Math","./Matrix3","./Quaternion"],function(e,t,r,i,n,o,a){"use strict";function s(r,i,a){var s=u;s.x=Math.cos(r+n.PI_OVER_TWO),s.y=Math.sin(r+n.PI_OVER_TWO),s.z=0;var l=Math.cos(i),d=h;d.x=l*Math.cos(r),d.y=l*Math.sin(r),d.z=Math.sin(i);var m=e.cross(d,s,c);return t(a)||(a=new o),a[0]=s.x,a[1]=m.x,a[2]=d.x,a[3]=s.y,a[4]=m.y,a[5]=d.y,a[6]=s.z,a[7]=m.z,a[8]=d.z,a}var l=function(e){t(e)&&"function"==typeof e||(e=r.ComputeMoon),this._computeFunction=e},u=new e,c=new e,h=new e,d=new o,m=new a;return l.prototype.evaluate=function(r,l){t(r)||(r=i.now());var u=this._computeFunction(r),c=s(u.rightAscension,u.declination,l),h=n.zeroToTwoPi(u.rotation),p=a.fromAxisAngle(e.UNIT_Z,h,m),f=o.fromQuaternion(a.conjugate(p,p),d),v=o.multiply(f,c,c);return v},l}),r("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}),r("Core/TimeInterval",["./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./JulianDate"],function(e,t,r,i,n,o){"use strict";var a=function(r){r=e(r,e.EMPTY_OBJECT),this.start=t(r.start)?o.clone(r.start):new o,this.stop=t(r.stop)?o.clone(r.stop):new o,this.data=r.data,this.isStartIncluded=e(r.isStartIncluded,!0),this.isStopIncluded=e(r.isStopIncluded,!0)};r(a.prototype,{isEmpty:{get:function(){var e=o.compare(this.stop,this.start);return 0>e||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(r,i){var n=r.iso8601.split("/"),l=o.fromIso8601(n[0]),u=o.fromIso8601(n[1]),c=e(r.isStartIncluded,!0),h=e(r.isStopIncluded,!0),d=r.data;return t(i)?(i.start=l,i.stop=u,i.isStartIncluded=c,i.isStopIncluded=h,i.data=d,i):(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,r){return t(e)?t(r)?(r.start=e.start,r.stop=e.stop,r.isStartIncluded=e.isStartIncluded,r.isStopIncluded=e.isStopIncluded,r.data=e.data,r):new a(e):void 0},a.equals=function(e,r,i){return e===r||t(e)&&t(r)&&(e.isEmpty&&r.isEmpty||e.isStartIncluded===r.isStartIncluded&&e.isStopIncluded===r.isStopIncluded&&o.equals(e.start,r.start)&&o.equals(e.stop,r.stop)&&(e.data===r.data||t(i)&&i(e.data,r.data)))},a.equalsEpsilon=function(e,r,i,n){return e===r||t(e)&&t(r)&&(e.isEmpty&&r.isEmpty||e.isStartIncluded===r.isStartIncluded&&e.isStopIncluded===r.isStopIncluded&&o.equalsEpsilon(e.start,r.start,i)&&o.equalsEpsilon(e.stop,r.stop,i)&&(e.data===r.data||t(n)&&n(e.data,r.data)))},a.intersect=function(e,r,i,n){if(!t(r))return a.clone(a.EMPTY,i);var s=e.start,l=e.stop,u=r.start,c=r.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,i);var m=e.isStartIncluded,p=e.isStopIncluded,f=r.isStartIncluded,v=r.isStopIncluded,g=o.lessThan(l,c);return i.start=h?u:s,i.isStartIncluded=m&&f||!o.equals(u,s)&&(h&&f||d&&m),i.stop=g?l:c,i.isStopIncluded=g?p:p&&v||!o.equals(c,l)&&v,i.data=t(n)?n(e.data,r.data):e.data,i},a.contains=function(e,t){if(e.isEmpty)return!1;var r=o.compare(e.start,t);if(0===r)return e.isStartIncluded;var i=o.compare(t,e.stop);return 0===i?e.isStopIncluded:0>r&&0>i},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,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return a.toIso8601(this)},a.EMPTY=n(new a({start:new o,stop:new o,isStartIncluded:!1,isStopIncluded:!1})),a}),r("Core/Iso8601",["./freezeObject","./JulianDate","./TimeInterval"],function(e,t,r){"use strict";var i=e(t.fromIso8601("0000-01-01T00:00:00Z")),n=e(t.fromIso8601("9999-12-31T24:00:00Z")),o=e(new r({start:i,stop:n})),a={MINIMUM_VALUE:i,MAXIMUM_VALUE:n,MAXIMUM_INTERVAL:o};return a}),r("Core/KeyboardEventModifier",["./freezeObject"],function(e){"use strict";var t={SHIFT:0,CTRL:1,ALT:2};return e(t)}),r("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,r,i,n,o){e(o)||(o=new Array(n));var a,s,l=r.length;for(a=0;n>a;a++)o[a]=0;for(a=0;l>a;a++){var u=1;for(s=0;l>s;s++)if(s!==a){var c=r[a]-r[s];u*=(t-r[s])/c}for(s=0;n>s;s++)o[s]+=u*i[a*n+s]}return o},t}),r("Core/LinearApproximation",["./defined","./DeveloperError"],function(e){"use strict";var t={type:"Linear"};return t.getRequiredDataPoints=function(){return 2},t.interpolateOrderZero=function(t,r,i,n,o){e(o)||(o=new Array(n));var a,s,l,u=r[0],c=r[1];for(a=0;n>a;a++)s=i[a],l=i[a+n],o[a]=((l-s)*t+c*s-u*l)/(c-u);return o},t}),r("Core/MapProjection",["./defineProperties","./DeveloperError"],function(e,t){"use strict";var r=function(){t.throwInstantiationError()};return e(r.prototype,{ellipsoid:{get:t.throwInstantiationError}}),r.prototype.project=t.throwInstantiationError,r.prototype.unproject=t.throwInstantiationError,r}),r("Core/Matrix2",["./Cartesian2","./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,i,n){"use strict";var o=function(e,r,i,n){this[0]=t(e,0),this[1]=t(i,0),this[2]=t(r,0),this[3]=t(n,0)};o.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new o(e[0],e[2],e[1],e[3]):void 0},o.fromArray=function(e,i,n){return i=t(i,0),r(n)||(n=new o),n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],n[3]=e[i+3],n},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 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 o(i,-n,n,i)},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 i=2*t,n=e[i],o=e[i+1];return r.x=n,r.y=o,r},o.setColumn=function(e,t,r,i){i=o.clone(e,i);var n=2*t;return i[n]=r.x,i[n+1]=r.y,i},o.getRow=function(e,t,r){var i=e[t],n=e[t+2];return r.x=i,r.y=n,r},o.setRow=function(e,t,r,i){return i=o.clone(e,i),i[t]=r.x,i[t+2]=r.y,i};var a=new e;o.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],a)),r.y=e.magnitude(e.fromElements(t[2],t[3],a)),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 i=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 r[0]=i,r[1]=o,r[2]=n,r[3]=a,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 i=e[0]*t.x+e[2]*t.y,n=e[1]*t.x+e[3]*t.y;return r.x=i,r.y=n,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.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],i=e[2],n=e[1],o=e[3];return t[0]=r,t[1]=i,t[2]=n,t[3]=o,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.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},o.IDENTITY=n(new o(1,0,0,1)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN1ROW0=2,o.COLUMN1ROW1=3,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}),r("Core/NearFarScalar",["./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(t,r,i,n){this.near=e(t,0),this.nearValue=e(r,0),this.far=e(i,1),this.farValue=e(n,0)};return r.clone=function(e,i){return t(e)?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):void 0},r.packedLength=4,r.pack=function(t,r,i){i=e(i,0),r[i++]=t.near,r[i++]=t.nearValue,r[i++]=t.far,r[i]=t.farValue},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,r){return e===r||t(e)&&t(r)&&e.near===r.near&&e.nearValue===r.nearValue&&e.far===r.far&&e.farValue===r.farValue},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equals=function(e){return r.equals(this,e)},r}),r("Core/ObjectOrientedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Matrix3"],function(e,t,r,i,n){"use strict";function o(e,t,r,i,o){var a=t[e]+r[0]*i[n.getElementIndex(0,e)]+r[1]*i[n.getElementIndex(1,e)]+r[2]*i[n.getElementIndex(2,e)];return Math.abs(o[e])>a?!0:!1}function a(e,t,r,i,o){var a=o[0]*i[n.getElementIndex(0,e)]+o[1]*i[n.getElementIndex(1,e)]+o[2]*i[n.getElementIndex(2,e)],s=r[e]+t[0]*i[n.getElementIndex(0,e)]+t[1]*i[n.getElementIndex(1,e)]+t[2]*i[n.getElementIndex(2,e)];return Math.abs(a)>s?!0:!1}function s(e,t,r,i,o,a){var s=a[(e+2)%3]*o[n.getElementIndex((e+1)%3,t)]-a[(e+1)%3]*o[n.getElementIndex((e+2)%3,t)],l=r[(e+1)%3]*o[n.getElementIndex((e+2)%3,t)]+r[(e+2)%3]*o[n.getElementIndex((e+1)%3,t)];return l+=i[(t+1)%3]*o[n.getElementIndex(e,(t+2)%3)]+i[(t+2)%3]*o[n.getElementIndex(e,(t+1)%3)],Math.abs(s)>l?!0:!1}var l=function(r,i,o){this.rotation=n.clone(t(r,n.IDENTITY)),this.translation=e.clone(t(i,e.ZERO)),this.scale=e.clone(t(o,e.ZERO))},u=new e,c=new e,h=new e,d=new e,m=new e,p=new n,f={unitary:new n,diagonal:new n};l.fromPoints=function(t,i){if(r(i)||(i=new l),!r(t)||0===t.length)return i.tranformMatrix=n.IDENTITY,i.translation=e.ZERO,i.scale=e.ZERO,i;var o,a=t.length,s=e.clone(t[0],u);for(o=1;a>o;o++)e.add(s,t[o],s);var v=1/a;e.multiplyByScalar(s,v,s);var g,_=0,y=0,C=0,w=0,S=0,E=0;for(o=0;a>o;o++)g=e.subtract(t[o],s,c),_+=g.x*g.x,y+=g.x*g.y,C+=g.x*g.z,w+=g.y*g.y,S+=g.y*g.z,E+=g.z*g.z;_*=v,y*=v,C*=v,w*=v,S*=v,E*=v;var b=p;b[0]=_,b[1]=y,b[2]=C,b[3]=y,b[4]=w,b[5]=S,b[6]=C,b[7]=S,b[8]=E;var T=n.computeEigenDecomposition(b,f),x=n.transpose(T.unitary,i.rotation);g=e.subtract(t[0],s,c);var P=n.multiplyByVector(x,g,h),A=e.clone(P,d),M=e.clone(P,m);for(o=1;a>o;o++)g=e.subtract(t[o],s,g),n.multiplyByVector(x,g,P),e.minimumByComponent(M,P,M),e.maximumByComponent(A,P,A);var D=e.add(M,A,h);e.multiplyByScalar(D,.5,D),n.multiplyByVector(x,D,D),e.add(s,D,i.translation);var I=e.subtract(A,M,h);return e.multiplyByScalar(I,.5,i.scale),i},l.fromBoundingRectangle=function(e,t,i){r(i)||(i=new l),r(t)?n.fromRotationZ(t,i.rotation):n.clone(n.IDENTITY,i.rotation);var o=i.scale;o.x=.5*e.width,o.y=.5*e.height,o.z=0;var a=n.multiplyByVector(i.rotation,o,i.translation);return a.x+=e.x,a.y+=e.y,i},l.clone=function(t,i){return r(t)?r(i)?(n.clone(t.rotation,i.rotation),e.clone(t.translation,i.translation),e.clone(t.scale,i.scale),i):new l(t.rotation,t.translation,t.scale):void 0};var v=new n,g=new n,_=new e,y=new Array(3),C=new Array(3),w=new Array(3);return l.intersect=function(t,r){var i=n.transpose(t.rotation,v),l=n.multiply(i,r.rotation,g);n.abs(l,l);var u=y,c=C,h=w;return e.subtract(t.translation,r.translation,_),n.multiplyByVector(i,_,_),e.pack(_,u),e.pack(t.scale,c),e.pack(r.scale,h),o(0,c,h,l,u)?!1:o(1,c,h,l,u)?!1:o(2,c,h,l,u)?!1:a(0,c,h,l,u)?!1:a(1,c,h,l,u)?!1:a(2,c,h,l,u)?!1:s(0,0,c,h,l,u)?!1:s(1,0,c,h,l,u)?!1:s(2,0,c,h,l,u)?!1:s(0,1,c,h,l,u)?!1:s(1,1,c,h,l,u)?!1:s(2,1,c,h,l,u)?!1:s(0,2,c,h,l,u)?!1:s(1,2,c,h,l,u)?!1:s(2,2,c,h,l,u)?!1:!0},l.equals=function(t,i){return t===i||r(t)&&r(i)&&e.equals(t.transformedPosition,i.transformedPosition)&&n.equals(t.transformMatrix,i.transformMatrix)&&e.equals(t.rectangle,i.rectangle)},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l}),r("Core/Visibility",["./freezeObject"],function(e){"use strict";var t={NONE:-1,PARTIAL:0,FULL:1};return e(t)}),r("Core/Occluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math","./Rectangle","./Visibility"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=function(e,r){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=r},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 r,i,n,o=t.subtract(this._occluderPosition,e,h),a=t.magnitudeSquared(o),s=this._occluderRadius*this._occluderRadius;if(a>s){r=Math.sqrt(a-s),a=1/Math.sqrt(a),i=t.multiplyByScalar(o,a,h);var l=r*r*a;n=t.add(e,t.multiplyByScalar(i,l,h),h)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=i,this._horizonPlanePosition=n,this._cameraPosition=e}}}),c.fromBoundingSphere=function(e,r,n){if(!i(e))throw new o("occluderBoundingSphere is required.");if(!i(r))throw new o("camera position is required.");return i(n)?(t.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=r,n):new c(e,r)};var d=new t;c.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var r=t.subtract(e,this._occluderPosition,d),i=this._occluderRadius;if(i=t.magnitudeSquared(r)-i*i,i>0)return i=Math.sqrt(i)+this._horizonDistance,r=t.subtract(e,this._cameraPosition,r),i*i>t.magnitudeSquared(r)}return!1};var m=new t;c.prototype.isBoundingSphereVisible=function(e){var r=t.clone(e.center,m),i=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(r,this._occluderPosition,d),o=this._occluderRadius-i;if(o=t.magnitudeSquared(n)-o*o,i0?(o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(r,this._cameraPosition,n),o*o+i*i>t.magnitudeSquared(n)):!1;if(o>0){n=t.subtract(r,this._cameraPosition,n);var a=t.magnitudeSquared(n),s=this._occluderRadius*this._occluderRadius,l=i*i;return(this._horizonDistance*this._horizonDistance+s)*l>a*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+l>a)}return!0}return!1};var p=new t;c.prototype.computeVisibility=function(e){if(!i(e))throw new o("occludeeBS is required.");var r=t.clone(e.center),n=e.radius;if(n>this._occluderRadius)return u.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var a=t.subtract(r,this._occluderPosition,p),s=this._occluderRadius-n,l=t.magnitudeSquared(a);if(s=l-s*s,s>0){s=Math.sqrt(s)+this._horizonDistance,a=t.subtract(r,this._cameraPosition,a);var c=t.magnitudeSquared(a);return c>s*s+n*n?u.NONE:(s=this._occluderRadius+n,s=l-s*s,s>0?(s=Math.sqrt(s)+this._horizonDistance,s*s+n*n>c?u.FULL:u.PARTIAL):(a=t.subtract(r,this._horizonPlanePosition,a),t.dot(a,this._horizonPlaneNormal)>-n?u.PARTIAL:u.FULL))}}return u.NONE};var f=new t;c.computeOccludeePoint=function(e,r,i){var n=t.clone(r),a=t.clone(e.center),s=e.radius,l=i.length;if(t.equals(a,r))throw new o("occludeePosition must be different than occluderBoundingSphere.center");var u=t.normalize(t.subtract(n,a,f),f),h=-t.dot(u,a),d=c._anyRotationVector(a,u,h),m=c._horizonToPlaneNormalDotProduct(e,u,h,d,i[0]);if(!m)return void 0;for(var p,v=1;l>v;++v){if(p=c._horizonToPlaneNormalDotProduct(e,u,h,d,i[v]),!p)return void 0;m>p&&(m=p)}if(.0017453283658983088>m)return void 0;var g=s/m;return t.add(a,t.multiplyByScalar(u,g,f),f)};var v=[];c.computeOccludeePointFromRectangle=function(i,n){n=r(n,a.WGS84);var o=l.subsample(i,n,0,v),s=e.fromPoints(o),u=t.ZERO;return t.equals(u,s.center)?void 0:c.computeOccludeePoint(new e(u,n.minimumRadius),s.center,o)};var g=new t;c._anyRotationVector=function(e,r,i){var n=t.abs(r,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(r,n)+i)/-t.dot(r,a);return t.normalize(t.subtract(t.add(n,t.multiplyByScalar(a,l,s),n),e,n),n)};var _=new t;c._rotationVector=function(e,r,i,n,o){var a=t.subtract(n,e,_);if(a=t.normalize(a,a),t.dot(r,a)<.9999999847691291){var l=t.cross(r,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,r,i,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(h>c)return!1;var d=c-h,m=Math.sqrt(d),p=Math.sqrt(c),f=1/p,v=m*f,g=v*m;u=t.normalize(u,u);var _=t.add(a,t.multiplyByScalar(u,g,S),S),E=Math.sqrt(d-g*g),b=this._rotationVector(s,r,i,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(_,x,w),s,w),w);var P=t.dot(r,b);b=t.normalize(t.subtract(t.subtract(_,x,b),s,b),b);var A=t.dot(r,b);return A>P?P:A},c}),r("Core/Packable",["./DeveloperError"],function(e){"use strict";var t={packedLength:void 0,pack:e.throwInstantiationError,unpack:e.throwInstantiationError};return t}),r("Core/PackableForInterpolation",["./DeveloperError"],function(e){"use strict";var t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:e.throwInstantiationError,unpackInterpolationResult:e.throwInstantiationError};return t}),r("ThirdParty/measureText",[],function(){var e=function(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},t=function(t,r,i,n){var o=t.measureText(r),a=e(t.canvas,"font-family"),s=e(t.canvas,"font-size").replace("px",""),l=!/\S/.test(r);o.fontsize=s;var u=document.createElement("div");u.style.position="absolute",u.style.opacity=0,u.style.font=s+"px "+a,u.innerHTML=r+"
"+r,document.body.appendChild(u),o.leading=1.2*s;var c=e(u,"height");if(c=c.replace("px",""),c>=2*s&&(o.leading=0|c/2),document.body.removeChild(u),l)o.ascent=0,o.descent=0,o.bounds={minx:0,maxx:o.width,miny:0,maxy:0},o.height=0;else{var h=document.createElement("canvas"),d=100;h.width=o.width+d,h.height=3*s,h.style.opacity=1,h.style.fontFamily=a,h.style.fontSize=s;var m=h.getContext("2d");m.font=s+"px "+a;var p=h.width,f=h.height,v=f/2;m.fillStyle="white",m.fillRect(-1,-1,p+2,f+2),i&&(m.strokeStyle="black",m.lineWidth=t.lineWidth,m.strokeText(r,d/2,v)),n&&(m.fillStyle="black",m.fillText(r,d/2,v));for(var g=m.getImageData(0,0,p,f).data,_=0,y=4*p,C=g.length;++_0&&255===g[_];);var S=0|_/y;for(_=0;C>_&&255===g[_];)_+=y,_>=C&&(_=_-C+4);var E=0|_%y/4,b=1;for(_=C-3;_>=0&&255===g[_];)_-=y,0>_&&(_=C-3-4*b++);var T=0|_%y/4+1;o.ascent=v-w,o.descent=S-v,o.bounds={minx:E-d/2,maxx:T-d/2,miny:0,maxy:S-w},o.height=1+(S-w)}return o};return t}),r("Core/writeTextToCanvas",["../ThirdParty/measureText","./Color","./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var i=function(i,n){if(""===i)return void 0;n=r(n,r.EMPTY_OBJECT);var o=r(n.font,"10px sans-serif"),a=document.createElement("canvas");a.width=a.height=1,a.style.font=o;var s=a.getContext("2d");s.font=o,s.textBaseline=r(n.textBaseline,"bottom"),a.style.visibility="hidden",document.body.appendChild(a);var l=r(n.stroke,!1),u=r(n.fill,!0),c=2*r(n.strokeWidth,1);s.lineWidth=c;var h=e(s,i,l,u);a.dimensions=h,document.body.removeChild(a),a.style.visibility="";var d=h.height-h.ascent;a.width=h.width,a.height=h.height;var m=a.height-d;if(s.font=o,l){var p=r(n.strokeColor,t.BLACK);s.strokeStyle=p.toCssColorString(),s.lineWidth=c,s.strokeText(i,0,m)}if(u){var f=r(n.fillColor,t.WHITE);s.fillStyle=f.toCssColorString(),s.fillText(i,0,m)}return a};return i}),r("Core/PinBuilder",["./buildModuleUrl","./Color","./defined","./DeveloperError","./loadImage","./writeTextToCanvas"],function(e,t,r,i,n,o){"use strict";function a(e,t,r){e.save(),e.scale(r/24,r/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 s(e,r,i){var n=i/2.5,o=n,a=n;r.width>r.height?a=n*(r.height/r.width):r.widthl&&(l=0);var u=Math.pow(2,l),c=o/u,h=new Array(3*u),d=0;h[d++]=t.x,h[d++]=t.y,h[d++]=t.z;for(var m=1;u>m;m++){var p=n(t,r,m*c,o);h[d++]=p[0],h[d++]=p[1],h[d++]=p[2]}return h};var s=new e,l=new e,u=new e,c=new e;return o.scaleToGeodeticHeightExtruded=function(n,o,a,h,d){h=t(h,i.WGS84);var m=s,p=l,f=u,v=c;if(r(n)&&r(n.attributes)&&r(n.attributes.position))for(var g=n.attributes.position.values,_=g.length/2,y=0;_>y;y+=3)e.fromArray(g,y,f),h.geodeticSurfaceNormal(f,m),v=h.scaleToGeodeticSurface(f,v),p=e.multiplyByScalar(m,a,p),p=e.add(v,p,p),g[y+_]=p.x,g[y+1+_]=p.y,g[y+2+_]=p.z,d&&(v=e.clone(f,v)),p=e.multiplyByScalar(m,o,p),p=e.add(v,p,p),g[y]=p.x,g[y+1]=p.y,g[y+2]=p.z;return n},o}),r("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";var r=new t,i=function(t,i,n,o){return e(t,i,n,o,r),r.x>0&&r.y>0&&r.z>0};return i}),r("Core/Queue",[],function(){"use strict";var e=function(){this._array=[],this._offset=0,this.length=0};return e.prototype.enqueue=function(e){this._array.push(e),this.length++},e.prototype.dequeue=function(){if(0===this.length)return void 0;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},e.prototype.contains=function(e){return-1!==this._array.indexOf(e)},e.prototype.clear=function(){this._array.length=this._offset=this.length=0},e.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},e}),r("Core/WindingOrder",["./freezeObject"],function(e){"use strict";var t={CLOCKWISE:2304,COUNTER_CLOCKWISE:2305,validate:function(e){return e===t.CLOCKWISE||e===t.COUNTER_CLOCKWISE}};return e(t)}),r("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(t,r,i){var n=e.subtract(r,t,z),o=e.subtract(i,r,V);return n.x*o.y-n.y*o.x>=0}function v(e){for(var t=e[0].x,r=0,i=0;it&&(t=e[i].x,r=i);return r}function g(e){for(var t=e[0][0].x,r=0,i=0;it&&(t=n,r=i)}return r}function _(e){for(var t=[],r=0;rc&&(c=n[h].x);c+=c-u;var d=new t(c,r.y,0);for(h=0;h=r.x||p.x>=r.x)&&(m.y>=r.y&&p.y<=r.y||m.y<=r.y&&p.y>=r.y)){var f=(p.y-m.y)*(d.x-r.x)-(p.x-m.x)*(d.y-r.y);if(0!==f){f=1/f;var g=((p.x-m.x)*(r.y-m.y)-(p.y-m.y)*(r.x-m.x))*f,_=((d.x-r.x)*(r.y-m.y)-(d.y-r.y)*(r.x-m.x))*f;if(g>=0&&1>=g&&_>=0&&1>=_){var y=new e(r.x+g*(d.x-r.x),r.y+g*(d.y-r.y)),C=e.subtract(y,r,k);f=e.magnitudeSquared(C),a>f&&(l=y,a=f,o[0]=h,o[1]=(h+1)%n.length)}}}}return l}function w(t,r){var i=g(r),n=r[i],o=v(n),a=n[o],s=[],l=C(a,t,s),u=y(t,l);if(-1!==u)return u;var d=e.magnitudeSquared(e.subtract(t[s[0]],a,U)),m=e.magnitudeSquared(e.subtract(t[s[1]],a,U)),p=m>d?t[s[0]]:t[s[1]],f=_(t),w=f.indexOf(p);-1!==w&&f.splice(w,1);for(var S=[],E=0;E0){var x=e.fromElements(1,0,U);for(E=0;EM&&(T=M,p=S[E])}}}return t.indexOf(p)}function S(e,r,i){for(var n=st.computeWindingOrder2D(e),o=0;oi&&(i=t.length-1),i===t.length&&(i=0),A(i,t),i}function A(t,r){var i=t-1,n=t+1;0>i&&(i=r.length-1),n===r.length&&(n=0);var a=e.subtract(r[i].position,r[t].position,Z),s=e.subtract(r[n].position,r[t].position,Q);if(M(a,s)){var l=new o("Superfluous vertex found.");throw l.vertexIndex=t,l}}function M(e,r){return 0===t.cross(e,r,J).z}function D(e,r){return t.cross(e,r,K).z<0}function I(e,r){return t.cross(e,r,$).z>0}function O(e,r,i){return t.cross(e,i,et).z>0&&t.cross(i,r,et).z>0}function R(e,r,i){return t.cross(e,i,tt).z<0&&t.cross(i,r,tt).z<0}function L(t,r,i){for(var n=0;nt||e>r)&&(t>e||r>e)||t===r&&t===e}function B(e){var t=e.length;if(3===t)return N(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new o("Invalid polygon: must have at least three vertices.");for(var r=!1,i=0;!r;){var n=10*e.length;if(i>n)return[];i++;for(var a=E(e.length),s=a+1;Math.abs(a-s)<2||Math.abs(a-s)>e.length-2;)s=E(e.length);if(a>s){var l=a;a=s,s=l}try{if(b(a,s,e)){var u=e.splice(a,s-a+1,e[a],e[s]);return B(e).concat(B(u))}}catch(c){if(c.hasOwnProperty("vertexIndex"))return e.splice(c.vertexIndex,1),B(e);throw c}}}var z=new e,V=new e,k=new e,U=new e(1,0),W=new e,G=0,H=-1,q=1,j=new t,Y=new t,X=new t,Z=new t,Q=new t,J=new t,K=new t,$=new t,et=new t,tt=new t,rt=new e,it=new t,nt=new t,ot=new t,at=new t,st={};return st.removeDuplicates=function(e){for(var r=e.length,i=[],n=r-1,o=0;r>o;n=o++){var a=e[n],s=e[o];t.equals(a,s)||i.push(s)}return i},st.computeArea2D=function(e){for(var t=e.length,r=0,i=t-1,n=0;t>n;i=n++){var o=e[i],a=e[n];r+=o.x*a.y-a.x*o.y}return.5*r},st.computeWindingOrder2D=function(e){var t=st.computeArea2D(e);return t>0?p.COUNTER_CLOCKWISE:p.CLOCKWISE},st.triangulate=function(e){for(var t=e.length,r=[],i=0;t>i;++i)r[i]={position:e[i],index:i};return B(r)},st.resetSeed=function(e){G=i(e,0)},st.computeSubdivision=function(e,n,o){o=i(o,c.RADIANS_PER_DEGREE);for(var a=new m,s=n.length,h=0;s>h;h+=3)a.enqueue({i0:n[h],i1:n[h+1],i2:n[h+2]});for(var p,f=e.slice(0),v=[],g={};a.length>0;){var _,y,C=a.dequeue(),w=f[C.i0],S=f[C.i1],E=f[C.i2],b=t.angleBetween(w,S),T=t.angleBetween(S,E),x=t.angleBetween(E,w),P=Math.max(b,Math.max(T,x));P>o?b===P?(_=Math.min(C.i0,C.i1).toString()+" "+Math.max(C.i0,C.i1).toString(),p=g[_],p||(y=t.add(w,S,new t),t.multiplyByScalar(y,.5,y),f.push(y),p=f.length-1,g[_]=p),a.enqueue({i0:C.i0,i1:p,i2:C.i2}),a.enqueue({i0:p,i1:C.i1,i2:C.i2})):T===P?(_=Math.min(C.i1,C.i2).toString()+" "+Math.max(C.i1,C.i2).toString(),p=g[_],p||(y=t.add(S,E,new t),t.multiplyByScalar(y,.5,y),f.push(y),p=f.length-1,g[_]=p),a.enqueue({i0:C.i1,i1:p,i2:C.i0}),a.enqueue({i0:p,i1:C.i2,i2:C.i0})):x===P&&(_=Math.min(C.i2,C.i0).toString()+" "+Math.max(C.i2,C.i0).toString(),p=g[_],p||(y=t.add(E,w,new t),t.multiplyByScalar(y,.5,y),f.push(y),p=f.length-1,g[_]=p),a.enqueue({i0:C.i2,i1:p,i2:C.i1}),a.enqueue({i0:p,i1:C.i0,i2:C.i1})):(v.push(C.i0),v.push(C.i1),v.push(C.i2))}var A=f.length,M=new Array(3*A),D=0;for(p=0;A>p;p++){var I=f[p];M[D++]=I.x,M[D++]=I.y,M[D++]=I.z}return new l({attributes:{position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:M})},indices:v,primitiveType:d.TRIANGLES})},st.scaleToGeodeticHeight=function(e,r,o,s){o=i(o,a.WGS84);var l=ot,u=at;if(r=i(r,0),s=i(s,!0),n(e)&&n(e.attributes)&&n(e.attributes.position))for(var c=e.attributes.position.values,h=c.length,d=0;h>d;d+=3)t.fromArray(c,d,u),s&&(u=o.scaleToGeodeticSurface(u,u)),l=o.geodeticSurfaceNormal(u,l),t.multiplyByScalar(l,r,l),t.add(u,l,u),c[d]=u.x,c[d+1]=u.y,c[d+2]=u.z;return e},st.eliminateHoles=function(e,r,n){n=i(n,a.WGS84);for(var o=[],s=0;s0;)c=S(c,o,n);return c},st}),r("Core/PolygonGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Quaternion","./Queue","./VertexFormat","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S,E,b){"use strict";function T(e,t,r,n){for(var o=w.fromAxisAngle(e._plane.normal,r,O),s=g.fromQuaternion(o,R),l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,d=t.length,m=0;d>m;++m){var p=i.clone(t[m],I);g.multiplyByVector(s,p,p);var f=e.projectPointOntoPlane(p,D);a(f)&&(l=Math.min(l,f.x),u=Math.max(u,f.x),c=Math.min(c,f.y),h=Math.max(h,f.y))}return n.x=l,n.y=c,n.width=u-l,n.height=h-c,n}function x(e,t,r,i){var o=u.fromPoints(t,e),a=o.projectPointsOntoPlane(t,L),s=y.computeWindingOrder2D(a);s===b.CLOCKWISE&&(a.reverse(),t.reverse());var l=y.triangulate(a);l.length<3&&(l=[0,1,2]);var d;if(i){for(var p=t.length,f=new Array(3*p),v=0,g=0;p>g;g++){var _=t[g];f[v++]=_.x,f[v++]=_.y,f[v++]=_.z}d=new c({attributes:{position:new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:f})},indices:l,primitiveType:C.TRIANGLES})}else d=y.computeSubdivision(t,l,r);return new m({geometry:d})}function P(e,t,o,a,s,l,c){if(e.st||e.normal||e.tangent||e.binormal){var d=u.fromPoints(o,a),m=T(d,o,s,N),p=W;p.x=m.x,p.y=m.y;var f=t.attributes.position.values,_=f.length,y=e.st?new Float32Array(2*(_/3)):void 0,C=e.normal?new Float32Array(_):void 0,S=e.tangent?new Float32Array(_):void 0,E=e.binormal?new Float32Array(_):void 0,b=0,x=0,P=B,A=z,M=V,D=!0,I=w.fromAxisAngle(d._plane.normal,s,q),O=g.fromQuaternion(I,j),R=_/2,L=_/3;l&&(_/=2);for(var Y=0;_>Y;Y+=3){var X=i.fromArray(f,Y,H);if(e.st){var Z=g.multiplyByVector(O,X,F),Q=d.projectPointOntoPlane(Z,G);r.subtract(Q,p,Q),l&&(y[b+L]=Q.x/m.width,y[b+1+L]=Q.y/m.height),y[b]=Q.x/m.width,y[b+1]=Q.y/m.height,b+=2}if(e.normal||e.tangent||e.binormal){var J=x+1,K=x+2;if(c){if(_>Y+3){var $=i.fromArray(f,Y+3,k);if(D){var et=i.fromArray(f,Y+_,U);i.subtract($,X,$),i.subtract(et,X,et),P=i.normalize(i.cross(et,$,P),P),D=!1}i.equalsEpsilon($,X,v.EPSILON10)&&(D=!0)}(e.tangent||e.binormal)&&(M=a.geodeticSurfaceNormal(X,M),e.tangent&&(A=i.normalize(i.cross(M,P,A),A)))}else P=a.geodeticSurfaceNormal(X,P),(e.tangent||e.binormal)&&(A=i.cross(i.UNIT_Z,P,A),A=i.normalize(g.multiplyByVector(O,A,A),A),e.binormal&&(M=i.normalize(i.cross(P,A,M),M)));e.normal&&(l&&!c?(C[x+R]=-P.x,C[J+R]=-P.y,C[K+R]=-P.z):(C[x+R]=P.x,C[J+R]=P.y,C[K+R]=P.z),C[x]=P.x,C[J]=P.y,C[K]=P.z),e.tangent&&(l&&!c?(S[x+R]=-A.x,S[J+R]=-A.y,S[K+R]=-A.z):(S[x+R]=A.x,S[J+R]=A.y,S[K+R]=A.z),S[x]=A.x,S[J]=A.y,S[K]=A.z),e.binormal&&(l&&(E[x+R]=M.x,E[J+R]=M.y,E[K+R]=M.z),E[x]=M.x,E[J]=M.y,E[K]=M.z),x+=3}}e.st&&(t.attributes.st=new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:y})),e.normal&&(t.attributes.normal=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:C})),e.tangent&&(t.attributes.tangent=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),e.binormal&&(t.attributes.binormal=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E}))}return t}function A(e,t,r){var o,a,s,l,u,m,p,g,y,w=[],S=e.length;if(r)for(p=0;S>p;p++)g=e[p],y=e[(p+1)%S],w.push(g.x,g.y,g.z,y.x,y.y,y.z);else for(p=0;S>p;p++)g=e[p],y=e[(p+1)%S],o=_.subdivideLine(g,y,t),o.push(y.x,y.y,y.z),w=w.concat(o);w=w.concat(w),S=w.length;var E=f.createTypedArray(S/3,S-6*e.length);for(a=0,S/=6,p=0;S>p;p++)s=p,l=s+1,g=i.fromArray(w,3*s,k),y=i.fromArray(w,3*l,U),i.equalsEpsilon(g,y,v.EPSILON6)||(u=s+S,m=u+1,E[a++]=s,E[a++]=u,E[a++]=l,E[a++]=l,E[a++]=u,E[a++]=m);return new c({attributes:new d({position:new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:w})}),indices:E,primitiveType:C.TRIANGLES})}function M(e,t,r,i,o){var a=x(e,t,r,o).geometry,s=a.attributes.position.values,l=a.indices,p=s.concat(s),v=p.length/3,g=f.createTypedArray(v,2*l.length);g.set(l);var _,C=l.length,w=v/2;for(_=0;C>_;_+=3){var S=g[_]+w,E=g[_+1]+w,T=g[_+2]+w;g[_+C]=T,g[_+1+C]=E,g[_+2+C]=S}var P=new c({attributes:new d({position:new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:p})}),indices:g,primitiveType:a.primitiveType}),M={topAndBottom:new m({geometry:P})};M.walls=[];var D=i.outerRing,I=u.fromPoints(D,e),O=I.projectPointsOntoPlane(D,Y),R=y.computeWindingOrder2D(O);R===b.CLOCKWISE&&D.reverse();var L=A(D,r,o);M.walls.push(new m({geometry:L}));var N=i.holes;for(_=0;_b;b++){var R=D[b];if(R.positions=y.removeDuplicates(R.positions),R.positions.length<3)throw new s("At least three positions are required.");O.push(R.positions);var L=0;a(R.holes)&&(L=R.holes.length);for(var N=0;L>N;N++)E.enqueue(R.holes[N])}g.push({outerRing:A,holes:O});var F=y.eliminateHoles(A,O);w.push(F)}}n=w[0];var B,z=[];if(v){for(b=0;by;y++){var E=o[y],b=o[(y+1)%S];C.push(E.x,E.y,E.z,b.x,b.y,b.z)}else for(y=0;S>y;y++)C=C.concat(p.subdivideLine(o[y],o[(y+1)%S],i));S=C.length/3;var T=2*S,x=d.createTypedArray(C.length/3,T),P=0;for(y=0;S-1>y;y++)x[P++]=y,x[P++]=y+1;return x[P++]=S-1,x[P++]=0,new c({geometry:new s({attributes:new u({position:new l({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:new Float64Array(C)})}),indices:x,primitiveType:v.LINES})})}function C(e,r,i,n){var o=f.removeDuplicates(r),h=a.fromPoints(o,e),m=h.projectPointsOntoPlane(o,w),g=f.computeWindingOrder2D(m);g===_.CLOCKWISE&&(m.reverse(),o.reverse());var y,C=[],S=o.length,E=new Array(S);if(E[0]=0,n){var b,T;for(y=0;S-1>y;y++)b=o[y],T=o[(y+1)%S],C.push(b.x,b.y,b.z,T.x,T.y,T.z),E[y+1]=C.length/3;b=o[S-1],T=o[0],C.push(b.x,b.y,b.z,T.x,T.y,T.z)}else{for(y=0;S-1>y;y++)C=C.concat(p.subdivideLine(o[y],o[y+1],i)),E[y+1]=C.length/3;C=C.concat(p.subdivideLine(o[S-1],o[0],i))}S=C.length/3;var x=2*(2*S+E.length),P=d.createTypedArray(C.length/3,x),A=0;for(y=0;S-1>y;y++)P[A++]=y,P[A++]=y+1,P[A++]=y+S,P[A++]=y+1+S;for(P[A++]=S-1,P[A++]=0,P[A++]=S+S-1,P[A++]=S,y=0;y_;_++){var b=w.holes[_];m.push(b.positions);var T=0;i(b.holes)&&(T=b.holes.length);for(var x=0;T>x;x++)v.enqueue(b.holes[x])}m.push(S)}var P,A=[];if(u)for(_=0;_a;a++)l[a]=r.clone(i);return l}var _=(m-u)/s,y=(f-c)/s,C=(v-h)/s,w=(g-d)/s;for(a=0;s>a;a++)l[a]=new r(u+a*_,c+a*y,h+a*C,d+a*w);return l}var _=function(e){e=n(e,n.EMPTY_OBJECT);var t=e.positions,r=e.colors,i=n(e.width,1),o=n(e.colorsPerVertex,!1);this._positions=t,this._colors=r,this._width=i,this._perVertex=o,this._vertexFormat=n(e.vertexFormat,v.DEFAULT),this._followSurface=n(e.followSurface,!0),this._granularity=n(e.granularity,m.RADIANS_PER_DEGREE),this._ellipsoid=n(e.ellipsoid,s.WGS84),this._workerName="createPolylineGeometry"},y=new t,C=new t,w=new t,S=new t;return _.createGeometry=function(n){var a,s,m,v,_,E,b,T=n._width,x=n._vertexFormat,P=n._colors,A=n._perVertex,M=n._followSurface,D=n._granularity,I=n._ellipsoid,O=n._positions;if(M){var R=p.extractHeights(O,I),L=o(P)?[]:void 0;if(o(P)){for(a=0;as;s++)L.push(r.clone(E))}L.push(r.clone(P[P.length-1])),P=L}O=p.generateCartesianArc({positions:O,granularity:D,ellipsoid:I,height:R})}else O=n._positions;var F,B=4*O.length-4,z=new Float64Array(3*B),V=new Float64Array(3*B),k=new Float64Array(3*B),U=new Float32Array(2*B),W=x.st?new Float32Array(2*B):void 0,G=o(P)?new Uint8Array(4*B):void 0,H=0,q=0,j=0,Y=0,X=O.length;for(s=0;X>s;++s){0===s?(F=y,t.subtract(O[0],O[1],F),t.add(O[0],F,F)):F=O[s-1],t.clone(F,w),t.clone(O[s],C),s===X-1?(F=y,t.subtract(O[X-1],O[X-2],F),t.add(O[X-1],F,F)):F=O[s+1],t.clone(F,S);var Z,Q;o(G)&&(Z=0===s||A?P[s]:P[s-1],s!==X-1&&(Q=P[s]));var J=0===s?2:0,K=s===X-1?2:4;for(m=J;K>m;++m){t.pack(C,z,H),t.pack(w,V,H),t.pack(S,k,H),H+=3;var $=0>m-2?-1:1;if(U[q++]=2*(m%2)-1,U[q++]=$*T,x.st&&(W[j++]=s/(X-1),W[j++]=Math.max(U[q-2],0)),o(G)){var et=2>m?Z:Q;G[Y++]=r.floatToByte(et.red),G[Y++]=r.floatToByte(et.green),G[Y++]=r.floatToByte(et.blue),G[Y++]=r.floatToByte(et.alpha)}}}var tt=new c;tt.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:z}),tt.prevPosition=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:V}),tt.nextPosition=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:k}),tt.expandAndWidth=new u({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:U}),x.st&&(tt.st=new u({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:W})),o(G)&&(tt.color=new u({componentDatatype:i.UNSIGNED_BYTE,componentsPerAttribute:4,values:G,normalize:!0}));var rt=d.createTypedArray(B,6*O.length-6),it=0,nt=0,ot=O.length-1;for(s=0;ot>s;++s)rt[nt++]=it,rt[nt++]=it+2,rt[nt++]=it+1,rt[nt++]=it+1,rt[nt++]=it+2,rt[nt++]=it+3,it+=4;return new l({attributes:tt,indices:rt,primitiveType:f.TRIANGLES,boundingSphere:e.fromPoints(O),geometryType:h.POLYLINES})},_}),r("Core/PolylineVolumeGeometry",["./BoundingRectangle","./BoundingSphere","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./VertexFormat","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_){"use strict";function y(e,i,n,o){var a=new c;o.position&&(a.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:e}));var s,m,f,g,_,y,C=i.length,w=e.length/3,S=(w-2*C)/(2*C),E=p.triangulate(i),b=6*(S-1)*C+2*E.length,T=d.createTypedArray(w,b),x=2*C,P=0;for(s=0;S-1>s;s++){for(m=0;C-1>m;m++)f=2*m+2*s*C,y=f+x,g=f+1,_=g+x,T[P++]=g,T[P++]=f,T[P++]=_,T[P++]=_,T[P++]=f,T[P++]=y;f=2*C-2+2*s*C,g=f+1,_=g+x,y=f+x,T[P++]=g,T[P++]=f,T[P++]=_,T[P++]=_,T[P++]=f,T[P++]=y}if(o.st||o.tangent||o.binormal){var A,M,D=new Float32Array(2*w),I=1/(S-1),O=1/n.height,R=n.height/2,L=0;for(s=0;S>s;s++){for(A=s*I,M=O*(i[0].y+R),D[L++]=A,D[L++]=M,m=1;C>m;m++)M=O*(i[m].y+R),D[L++]=A,D[L++]=M,D[L++]=A,D[L++]=M;M=O*(i[0].y+R),D[L++]=A,D[L++]=M}for(m=0;C>m;m++)A=0,M=O*(i[m].y+R),D[L++]=A,D[L++]=M;for(m=0;C>m;m++)A=(S-1)*I,M=O*(i[m].y+R),D[L++]=A,D[L++]=M;a.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:new Float32Array(D)})}var N=w-2*C;for(s=0;sa;a++)v[g++]=a+_,v[g++]=a+_+1;for(v[g++]=s-1+_,v[g++]=_,o=p-1,_=o*s,a=0;s-1>a;a++)v[g++]=a+_,v[g++]=a+_+1;for(v[g++]=s-1+_,v[g++]=_,o=0;p-1>o;o++){var y=s*o,C=y+s;for(a=0;s>a;a++)v[g++]=a+y,v[g++]=a+C}var w=new l({attributes:n,indices:h.createTypedArray(d,v),boundingSphere:t.fromVertices(e),primitiveType:f.LINES});return w}var _=function(e){e=n(e,n.EMPTY_OBJECT);var t=e.polylinePositions,r=e.shapePositions;this._positions=t,this._shape=r,this._ellipsoid=n(e.ellipsoid,s.WGS84),this._cornerType=n(e.cornerType,i.ROUNDED),this._granularity=n(e.granularity,d.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry"},y=new e;return _.createGeometry=function(t){var r=t._positions,i=p.removeDuplicatesFromPositions(r,t._ellipsoid),n=t._shape;n=p.removeDuplicatesFromShape(n),m.computeWindingOrder2D(n)===v.CLOCKWISE&&n.reverse();var o=e.fromPoints(n,y),a=p.computePositions(i,n,o,t,!1);return g(a,n)},_}),r("Core/QuaternionSpline",["./defaultValue","./defined","./defineProperties","./DeveloperError","./Quaternion","./Spline"],function(e,t,r,i,n,o){"use strict";function a(e,r,i){var o=e.length,a=new Array(o);a[0]=t(r)?r:e[0],a[o-1]=t(i)?i:e[o-1];for(var s=1;o-1>s;++s)a[s]=n.computeInnerQuadrangle(e[s-1],e[s],e[s+1],new n);return a}function s(e){var r=e.points,i=e.innerQuadrangles,o=e.times;if(r.length<3){var a=o[0],s=1/(o[1]-a),l=r[0],u=r[1];return function(e,r){t(r)||(r=new n);var i=(e-a)*s;return n.fastSlerp(l,u,i,r)}}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=r[l],h=r[l+1],d=i[l],m=i[l+1];return n.fastSquad(c,h,d,m,u,s)}}var l=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.points,i=t.times,n=t.firstInnerQuadrangle,o=t.lastInnerQuadrangle,l=a(r,n,o);this._times=i,this._points=r,this._innerQuadrangles=l,this._evaluateFunction=s(this),this._lastTimeIndex=0};return r(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}),r("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,r,i,n,o,a,s){"use strict";var l=Math.cos,u=Math.sin,c=Math.sqrt,h={};h.computePosition=function(e,t,i,n,o){var s=e.ellipsoid.radiiSquared,h=e.nwCorner,d=e.rectangle,m=h.latitude-e.granYCos*t+i*e.granXSin,p=l(m),f=u(m),v=s.z*f,g=h.longitude+t*e.granYSin+i*e.granXCos,_=p*l(g),y=p*u(g),C=s.x*_,w=s.y*y,S=c(C*_+w*y+v*f);n.x=C/S,n.y=w/S,n.z=v/S,r(e.vertexFormat)&&e.vertexFormat.st&&(o.x=(g-d.west)*e.lonScalar-.5,o.y=(m-d.south)*e.latScalar-.5,a.multiplyByVector(e.textureMatrix,o,o),o.x+=.5,o.y+=.5)};var d=new a,m=new e,p=new t,f=new e,v=new n;return h.computeOptions=function(t,n,l){var u,c,h,g,_,y=t._granularity,C=t._ellipsoid,w=t._surfaceHeight,S=t._rotation,E=t._extrudedHeight,b=n.east,T=n.west,x=n.north,P=n.south,A=x-P;T>b?(_=o.TWO_PI-T+b,u=Math.ceil(_/y)+1,c=Math.ceil(A/y)+1,h=_/(u-1),g=A/(c-1)):(_=b-T,u=Math.ceil(_/y)+1,c=Math.ceil(A/y)+1,h=_/(u-1),g=A/(c-1)),l=s.northwest(n,l);var M=s.center(n,p),D=g,I=h,O=0,R=0;if(r(S)){var L=Math.cos(S);D*=L,I*=L;var N=Math.sin(S);O=g*N,R=h*N,m=v.project(l,m),f=v.project(M,f),m=e.subtract(m,f,m);var F=a.fromRotation(S,d);m=a.multiplyByVector(F,m,m),m=e.add(m,f,m),l=v.unproject(m,l);var B=l.latitude,z=B+(u-1)*R,V=B-D*(c-1),k=B-D*(c-1)+(u-1)*R;x=Math.max(B,z,V,k),P=Math.min(B,z,V,k);var U=l.longitude,W=U+(u-1)*I,G=U+(c-1)*O,H=U+(c-1)*O+(u-1)*I;if(b=Math.max(U,W,G,H),T=Math.min(U,W,G,H),x<-o.PI_OVER_TWO||x>o.PI_OVER_TWO||P<-o.PI_OVER_TWO||P>o.PI_OVER_TWO)throw new i("Rotated extent is invalid.");n.north=x,n.south=P,n.east=b,n.west=T}return{granYCos:D,granYSin:O,granXCos:I,granXSin:R,ellipsoid:C,width:u,height:c,surfaceHeight:w,extrudedHeight:E,nwCorner:l,rectangle:n}},h}),r("Core/RectangleGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix2","./Matrix3","./PolygonPipeline","./PrimitiveType","./Quaternion","./Rectangle","./RectangleGeometryLibrary","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S,E){"use strict";function b(e,t){var r=new u({attributes:new h,primitiveType:y.TRIANGLES});return r.attributes.position=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(r.attributes.normal=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(r.attributes.tangent=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.binormal&&(r.attributes.binormal=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.binormals})),r}function T(e,t,i,n){for(var o=e.length,a=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,l=t.binormal?new Float32Array(o):void 0,u=0,c=L,h=R,d=O,m=0;o>m;m+=3){var p=r.fromArray(e,m,I),f=u+1,v=u+2;(t.normal||t.tangent||t.binormal)&&(d=i.geodeticSurfaceNormal(p,d),(t.tangent||t.binormal)&&(r.cross(r.UNIT_Z,d,h),g.multiplyByVector(n,h,h),r.normalize(h,h),t.binormal&&r.normalize(r.cross(d,h,c),c)),t.normal&&(a[u]=d.x,a[f]=d.y,a[v]=d.z),t.tangent&&(s[u]=h.x,s[f]=h.y,s[v]=h.z),t.binormal&&(l[u]=c.x,l[f]=c.y,l[v]=c.z)),u+=3}return b(t,{positions:e,normals:a,tangents:s,binormals:l})}function x(e,t,i){for(var n=e.length,o=t.normal?new Float32Array(n):void 0,a=t.tangent?new Float32Array(n):void 0,s=t.binormal?new Float32Array(n):void 0,l=0,u=0,c=0,h=!0,d=L,m=R,p=O,v=0;n>v;v+=6){var g=r.fromArray(e,v,I);if(t.normal||t.tangent||t.binormal){var _=r.fromArray(e,v+6,V);if(h){var y=r.fromArray(e,v+3,k);r.subtract(_,g,_),r.subtract(y,g,y),p=r.normalize(r.cross(y,_,p),p),h=!1}r.equalsEpsilon(_,g,f.EPSILON10)&&(h=!0),(t.tangent||t.binormal)&&(d=i.geodeticSurfaceNormal(g,d),t.tangent&&(m=r.normalize(r.cross(d,p,m),m))),t.normal&&(o[l++]=p.x,o[l++]=p.y,o[l++]=p.z,o[l++]=p.x,o[l++]=p.y,o[l++]=p.z),t.tangent&&(a[u++]=m.x,a[u++]=m.y,a[u++]=m.z,a[u++]=m.x,a[u++]=m.y,a[u++]=m.z),t.binormal&&(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 b(t,{positions:e,normals:o,tangents:a,binormals:s})}function P(e){for(var t=e.vertexFormat,r=e.ellipsoid,i=e.size,o=e.height,a=e.width,s=t.position?new Float64Array(3*i):void 0,l=t.st?new Float32Array(2*i):void 0,u=0,h=0,d=I,m=F,f=Number.MAX_VALUE,v=Number.MAX_VALUE,g=Number.MIN_VALUE,_=Number.MIN_VALUE,y=0;o>y;++y)for(var C=0;a>C;++C)S.computePosition(e,y,C,d,m),s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,t.st&&(l[h++]=m.x,l[h++]=m.y,f=Math.min(f,m.x),v=Math.min(v,m.y),g=Math.max(g,m.x),_=Math.max(_,m.y));if(t.st&&(0>f||0>v||g>1||_>1))for(var w=0;wM;++M){for(var D=0;a-1>D;++D){var O=P,R=O+a,L=R+1,N=O+1;x[A++]=O,x[A++]=R,x[A++]=N,x[A++]=N,x[A++]=R,x[A++]=L,++P}++P}return E.indices=x,t.st&&(E.attributes.st=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:l})),E}function A(e,t,r,i,n){return e[t++]=i[r],e[t++]=i[r+1],e[t++]=i[r+2],e[t++]=n[r],e[t++]=n[r+1],e[t++]=n[r+2],e}function M(e,t,r,i){return e[t++]=i[r],e[t++]=i[r+1],e[t++]=i[r],e[t++]=i[r+1],e}function D(e){var t,i=e.vertexFormat,o=e.surfaceHeight,a=e.extrudedHeight,s=Math.min(a,o),l=Math.max(a,o),u=e.height,h=e.width,v=e.ellipsoid,g=P(e);if(f.equalsEpsilon(s,l,.1))return g;g=_.scaleToGeodeticHeight(g,l,v,!1);var y=new Float64Array(g.attributes.position.values),C=y.length,w=2*C,S=new Float64Array(w);S.set(y),g=_.scaleToGeodeticHeight(g,s,v);var E=g.attributes.position.values;S.set(E,C),g.attributes.position.values=S;var b,T=i.normal?new Float32Array(w):void 0,D=i.tangent?new Float32Array(w):void 0,I=i.binormal?new Float32Array(w):void 0,O=i.st?new Float32Array(2*(w/3)):void 0;if(i.normal){var R=g.attributes.normal.values;for(T.set(R),t=0;C>t;t++)R[t]=-R[t];T.set(R,C),g.attributes.normal.values=T}if(i.tangent){var L=g.attributes.tangent.values;for(D.set(L),t=0;C>t;t++)L[t]=-L[t];D.set(L,C),g.attributes.tangent.values=D}if(i.binormal){var N=g.attributes.binormal.values;I.set(N),I.set(N,C),g.attributes.binormal.values=I}i.st&&(b=g.attributes.st.values,O.set(b),O.set(b,2*(C/3)),g.attributes.st.values=O);var F=g.indices,B=F.length,z=C/3,U=p.createTypedArray(w/3,2*B);for(U.set(F),t=0;B>t;t+=3)U[t+B]=F[t+2]+z,U[t+1+B]=F[t+1]+z,U[t+2+B]=F[t]+z;g.indices=U;var W=2*h+2*u-4,G=2*(W+4),H=new Float64Array(3*G),q=i.st?new Float32Array(2*G):void 0,j=0,Y=0,X=h*u;for(t=0;X>t;t+=h)H=A(H,j,3*t,y,E),j+=6,i.st&&(q=M(q,Y,2*t,b),Y+=4);for(t=X-h;X>t;t++)H=A(H,j,3*t,y,E),j+=6,i.st&&(q=M(q,Y,2*t,b),Y+=4);for(t=X-1;t>0;t-=h)H=A(H,j,3*t,y,E),j+=6,i.st&&(q=M(q,Y,2*t,b),Y+=4);for(t=h-1;t>=0;t--)H=A(H,j,3*t,y,E),j+=6,i.st&&(q=M(q,Y,2*t,b),Y+=4);var Z=x(H,i,v);i.st&&(Z.attributes.st=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:q}));var Q,J,K,$,et=p.createTypedArray(G,6*W);C=H.length/3;var tt=0;for(t=0;C-1>t;t+=2){Q=t,$=Q+2;var rt=r.fromArray(H,3*Q,V),it=r.fromArray(H,3*$,k);r.equalsEpsilon(rt,it,f.EPSILON10)||(J=Q+1,K=J+2,et[tt++]=Q,et[tt++]=J,et[tt++]=$,et[tt++]=$,et[tt++]=J,et[tt++]=K)}return Z.indices=et,Z=m.combine([new d({geometry:g}),new d({geometry:Z})])}var I=new r,O=new r,R=new r,L=new r,N=new w,F=new t,B=new e,z=new e,V=new r,k=new r,U=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.rectangle,r=o(e.granularity,f.RADIANS_PER_DEGREE),i=o(e.ellipsoid,l.WGS84),n=o(e.height,0),a=e.rotation,s=e.stRotation,u=o(e.vertexFormat,E.DEFAULT);this._rectangle=t,this._granularity=r,this._ellipsoid=i,this._surfaceHeight=n,this._rotation=a,this._stRotation=s,this._vertexFormat=u,this._extrudedHeight=e.extrudedHeight,this._closeTop=e.closeTop,this._closeBottom=e.closeBottom,this._workerName="createRectangleGeometry"},W=new v,G=new g,H=new i,q=new C,j=new i;return U.createGeometry=function(t){var i=w.clone(t._rectangle,N),n=t._ellipsoid,o=t._surfaceHeight,s=t._extrudedHeight,l=t._stRotation,c=t._vertexFormat,d=S.computeOptions(t,i,H),m=W,p=G;if(a(l)){v.fromRotation(-l,m);var f=w.center(i,j),y=n.cartographicToCartesian(f,V);r.normalize(y,y),C.fromAxisAngle(y,-l,q),g.fromQuaternion(q,p)}else v.clone(v.IDENTITY,m),g.clone(g.IDENTITY,p);d.lonScalar=1/(i.east-i.west),d.latScalar=1/(i.north-i.south),d.vertexFormat=c,d.textureMatrix=m,d.tangentRotationMatrix=p,d.size=d.width*d.height;var E,b;if(i=t._rectangle,a(s)){E=D(d);var T=e.fromRectangle3D(i,n,o,z),x=e.fromRectangle3D(i,n,s,B);b=e.union(T,x)}else E=P(d),E=_.scaleToGeodeticHeight(E,o,n,!1),b=e.fromRectangle3D(i,n,o);return c.position||delete E.attributes.position,new u({attributes:new h(E.attributes),indices:E.indices,primitiveType:E.primitiveType,boundingSphere:b})},U}),r("Core/RectangleOutlineGeometry",["./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./RectangleGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";function g(e){var t,r=e.size,n=e.height,o=e.width,a=new Float64Array(3*r),s=0,d=0,m=w;for(t=0;o>t;t++)v.computePosition(e,d,t,m),a[s++]=m.x,a[s++]=m.y,a[s++]=m.z;for(t=o-1,d=1;n>d;d++)v.computePosition(e,d,t,m),a[s++]=m.x,a[s++]=m.y,a[s++]=m.z;for(d=n-1,t=o-2;t>=0;t--)v.computePosition(e,d,t,m),a[s++]=m.x,a[s++]=m.y,a[s++]=m.z;for(t=0,d=n-2;d>0;d--)v.computePosition(e,d,t,m),a[s++]=m.x,a[s++]=m.y,a[s++]=m.z;for(var f=2*(a.length/3),g=h.createTypedArray(a.length/3,f),_=0,y=0;yC;C++)_[y++]=C,_[y++]=C+1,_[y++]=C+c,_[y++]=C+c+1;return _[y++]=c-1,_[y++]=0,_[y++]=c+c-1,_[y++]=c,_[y++]=0,_[y++]=c,_[y++]=l-1,_[y++]=c+l-1,_[y++]=l+s-2,_[y++]=l+s-2+c,_[y++]=2*l+s-3,_[y++]=2*l+s-3+c,a.indices=_,a}var y=new e,C=new e,w=new t,S=new f,E=function(e){e=n(e,n.EMPTY_OBJECT);var t=e.rectangle,r=n(e.granularity,d.RADIANS_PER_DEGREE),i=n(e.ellipsoid,s.WGS84),o=n(e.height,0),a=e.rotation;this._rectangle=t,this._granularity=r,this._ellipsoid=i,this._surfaceHeight=o,this._rotation=a,this._extrudedHeight=e.extrudedHeight,this._workerName="createRectangleOutlineGeometry"},b=new r;return E.createGeometry=function(t){var r=f.clone(t._rectangle,S),i=t._ellipsoid,n=t._surfaceHeight,a=t._extrudedHeight,s=v.computeOptions(t,r,b);s.size=2*s.width+2*s.height-4;var u,c;if(r=t._rectangle,o(a)){u=_(s);var h=e.fromRectangle3D(r,i,n,C),d=e.fromRectangle3D(r,i,a,y);c=e.union(h,d)}else u=g(s),u=m.scaleToGeodeticHeight(u,n,i,!1),c=e.fromRectangle3D(r,i,n);return new l({attributes:u.attributes,indices:u.indices,primitiveType:p.LINES,boundingSphere:c})},E}),r("Core/ReferenceFrame",["./freezeObject"],function(e){"use strict";var t={FIXED:0,INERTIAL:1};return e(t)}),r("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)}),r("Core/ScreenSpaceEventHandler",["./Cartesian2","./defaultValue","./defined","./destroyObject","./DeveloperError","./KeyboardEventModifier","./ScreenSpaceEventType"],function(e,t,r,i,n,o,a){"use strict";function s(e,t,r){if(e._element===document)return r.x=t.clientX,r.y=t.clientY,r;var i=e._element.getBoundingClientRect();return r.x=t.clientX-i.left,r.y=t.clientY-i.top,r}function l(e,t){var i=e;return r(t)&&(i+="+"+t),i}function u(e){return e.shiftKey?o.SHIFT:e.ctrlKey?o.CTRL:e.altKey?o.ALT:void 0}function c(e,t){var i=s(e,t,C.position);if(e._lastMousePosition.x=i.x,e._lastMousePosition.y=i.y,e._totalPixels=0,!e._seenAnyTouchEvents){var n,o=u(t);0===t.button?(e._leftMouseButtonDown=!0,n=e.getInputAction(a.LEFT_DOWN,o)):1===t.button?(e._middleMouseButtonDown=!0,n=e.getInputAction(a.MIDDLE_DOWN,o)):2===t.button&&(e._rightMouseButtonDown=!0,n=e.getInputAction(a.RIGHT_DOWN,o)),r(n)&&n(C),t.preventDefault()}}function h(e,t){var i,n,o=u(t);if(!e._seenAnyTouchEvents){0===t.button?(e._leftMouseButtonDown=!1,i=e.getInputAction(a.LEFT_UP,o),n=e.getInputAction(a.LEFT_CLICK,o)):1===t.button?(e._middleMouseButtonDown=!1,i=e.getInputAction(a.MIDDLE_UP,o),n=e.getInputAction(a.MIDDLE_CLICK,o)):2===t.button&&(e._rightMouseButtonDown=!1,i=e.getInputAction(a.RIGHT_UP,o),n=e.getInputAction(a.RIGHT_CLICK,o));var l=s(e,t,w.position),c=e._lastMousePosition.x-l.x,h=e._lastMousePosition.y-l.y;e._totalPixels+=Math.sqrt(c*c+h*h),r(i)&&i(w),r(n)&&e._totalPixels0)){var h=s(e,t.changedTouches[0],T.position),d=e._lastMousePosition.x-h.x,p=e._lastMousePosition.y-h.y;e._totalPixels+=Math.sqrt(d*d+p*p),r(i)&&i(T),r(n)&&e._totalPixelss&&(s=-s,u+=n.PI),0>s||s>n.PI)throw new r("The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.");var v=i*(1-a),g=l-u,_=u,y=d(c-l,a),C=h(a,0);if("Hyperbolic"===C&&Math.abs(n.NegativePiToPi(y))>=Math.acos(-1/a))throw new r("The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.");f(g,s,_,M);var w=v*(1+a),S=Math.cos(y),E=Math.sin(y),b=1+a*S;if(b<=n.Epsilon10)throw new r("elements cannot be converted to cartesian");var T=w/b;return t(p)?(p.x=T*S,p.y=T*E,p.z=0):p=new e(T*S,T*E,0),o.multiplyByVector(M,p,p)}function h(e,t){if(0>e)throw new r("eccentricity cannot be negative.");return t>=e?"Circular":1-t>e?"Elliptical":1+t>=e?"Parabolic":"Hyperbolic"}function d(e,t){if(0>t||t>=1)throw new r("eccentricity out of range.");var i=m(e,t);return p(i,t)}function m(e,t){if(0>t||t>=1)throw new r("eccentricity out of range.");var i=Math.floor(e/n.TWO_PI);e-=i*n.TWO_PI;var o,a=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),s=Number.MAX_VALUE;for(o=0;D>o&&Math.abs(s-a)>I;++o){s=a;var l=s-t*Math.sin(s)-e,u=1-t*Math.cos(s);a=s-l/u}if(o>=D)throw new r("Kepler equation did not converge");return s=a+i*n.TWO_PI}function p(e,t){if(0>t||t>=1)throw new r("eccentricity out of range.");var i=Math.floor(e/n.TWO_PI);e-=i*n.TWO_PI;var o=Math.cos(e)-t,a=Math.sin(e)*Math.sqrt(1-t*t),s=Math.atan2(a,o);return s=n.zeroToTwoPi(s),0>e&&(s-=n.TWO_PI),s+=i*n.TWO_PI}function f(e,i,a,s){if(0>i||i>n.PI)throw new r("inclination out of range");var l=Math.cos(e),u=Math.sin(e),c=Math.cos(i),h=Math.sin(i),d=Math.cos(a),m=Math.sin(a);return t(s)?(s[0]=d*l-m*u*c,s[1]=m*l+d*u*c,s[2]=u*h,s[3]=-d*u-m*l*c,s[4]=-m*u+d*l*c,s[5]=l*h,s[6]=m*h,s[7]=-d*h,s[8]=c):s=new o(d*l-m*u*c,-d*u-m*l*c,m*h,m*l+d*u*c,-m*u+d*l*c,-d*h,u*h,l*h,c),s}function v(e,t){u(e,Mt);var r=Mt.dayNumber-S.dayNumber+(Mt.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,i=r/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*i,o=O+G*Math.cos(N*n)+J*Math.sin(N*n)+H*Math.cos(F*n)+K*Math.sin(F*n)+q*Math.cos(B*n)+$*Math.sin(B*n)+j*Math.cos(z*n)+et*Math.sin(z*n)+Y*Math.cos(V*n)+tt*Math.sin(V*n)+X*Math.cos(k*n)+rt*Math.sin(k*n)+Z*Math.cos(U*n)+it*Math.sin(U*n)+Q*Math.cos(W*n)+nt*Math.sin(W*n),s=R+L*i+mt*Math.cos(ot*n)+wt*Math.sin(ot*n)+pt*Math.cos(at*n)+St*Math.sin(at*n)+ft*Math.cos(st*n)+Et*Math.sin(st*n)+vt*Math.cos(lt*n)+bt*Math.sin(lt*n)+gt*Math.cos(ut*n)+Tt*Math.sin(ut*n)+_t*Math.cos(ct*n)+xt*Math.sin(ct*n)+yt*Math.cos(ht*n)+Pt*Math.sin(ht*n)+Ct*Math.cos(dt*n)+At*Math.sin(dt*n),l=.0167086342-.0004203654*i,h=102.93734808*x+11612.3529*P*i,d=469.97289*P*i,m=174.87317577*x-8679.27034*P*i;return c(o,l,d,h,m,s,b,t)}function g(e,t){u(e,Mt);var r=Mt.dayNumber-S.dayNumber+(Mt.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,i=r/a.DAYS_PER_JULIAN_CENTURY,n=i*i,o=n*i,s=o*i,l=383397.7725+.004*i,h=.055545526-1.6e-8*i,d=5.15668983*x,m=-8e-5*i+.02966*n-42e-6*o-1.3e-7*s,p=83.35324312*x,f=14643420.2669*i-38.2702*n-.045047*o+21301e-8*s,v=125.04455501*x,g=-6967919.3631*i+6.3602*n+.007625*o-3586e-8*s,_=218.31664563*x,y=1732559343.4847*i-6.391*n+.006588*o-3169e-8*s,C=297.85019547*x+P*(1602961601.209*i-6.3706*n+.006593*o-3169e-8*s),w=93.27209062*x+P*(1739527262.8478*i-12.7512*n-.001037*o+417e-8*s),b=134.96340251*x+P*(1717915923.2178*i+31.8792*n+.051635*o-2447e-7*s),A=357.52910918*x+P*(129596581.0481*i-.5532*n+136e-6*o-1149e-8*s),M=310.17137918*x-P*(6967051.436*i+6.2068*n+.007618*o-3219e-8*s),D=2*C,I=4*C,O=6*C,R=2*b,L=3*b,N=4*b,F=2*w;l+=3400.4*Math.cos(D)-635.6*Math.cos(D-b)-235.6*Math.cos(b)+218.1*Math.cos(D-A)+181*Math.cos(D+b),h+=.014216*Math.cos(D-b)+.008551*Math.cos(D-R)-.001383*Math.cos(b)+.001356*Math.cos(D+b)-.001147*Math.cos(I-L)-914e-6*Math.cos(I-R)+869e-6*Math.cos(D-A-b)-627e-6*Math.cos(D)-394e-6*Math.cos(I-N)+282e-6*Math.cos(D-A-R)-279e-6*Math.cos(C-b)-236e-6*Math.cos(R)+231e-6*Math.cos(I)+229e-6*Math.cos(O-N)-201e-6*Math.cos(R-F),m+=486.26*Math.cos(D-F)-40.13*Math.cos(D)+37.51*Math.cos(F)+25.73*Math.cos(R-F)+19.97*Math.cos(D-A-F),f+=-55609*Math.sin(D-b)-34711*Math.sin(D-R)-9792*Math.sin(b)+9385*Math.sin(I-L)+7505*Math.sin(I-R)+5318*Math.sin(D+b)+3484*Math.sin(I-N)-3417*Math.sin(D-A-b)-2530*Math.sin(O-N)-2376*Math.sin(D)-2075*Math.sin(D-L)-1883*Math.sin(R)-1736*Math.sin(O-5*b)+1626*Math.sin(A)-1370*Math.sin(O-L),g+=-5392*Math.sin(D-F)-540*Math.sin(A)-441*Math.sin(D)+423*Math.sin(F)-288*Math.sin(R-F),y+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-b)-662.5*Math.sin(A)+396.3*Math.sin(b)-218*Math.sin(D-A);var B=2*M,z=3*M;m+=46.997*Math.cos(M)*i-.614*Math.cos(D-F+M)*i+.614*Math.cos(D-F-M)*i-.0297*Math.cos(B)*n-.0335*Math.cos(M)*n+.0012*Math.cos(D-F+B)*n-16e-5*Math.cos(M)*o+4e-5*Math.cos(z)*o+4e-5*Math.cos(B)*o;var V=2.116*Math.sin(M)*i-.111*Math.sin(D-F-M)*i-.0015*Math.sin(M)*n;f+=V,y+=V,g+=-520.77*Math.sin(M)*i+13.66*Math.sin(D-F+M)*i+1.12*Math.sin(D-M)*i-1.06*Math.sin(F-M)*i+.66*Math.sin(B)*n+.371*Math.sin(M)*n-.035*Math.sin(D-F+B)*n-.015*Math.sin(D-F+M)*n+.0014*Math.sin(M)*o-.0011*Math.sin(z)*o-9e-4*Math.sin(B)*o,l*=T;var k=d+m*P,U=p+f*P,W=_+y*P,G=v+g*P;return c(l,h,k,U,G,W,E,t)}function _(t,r){return r=g(t,r),e.multiplyByScalar(r,It,r)}var y={},C=32.184,w=2451545,S=new i(2451545,0,s.TAI),E=398600435e6,b=328900.56*1.012300034*E,T=1e3,x=n.RADIANS_PER_DEGREE,P=n.RADIANS_PER_ARCSECOND,A=14959787e4,M=new o,D=50,I=n.EPSILON8,O=1.0000010178*A,R=100.46645683*x,L=1295977422.83429*P,N=16002,F=21863,B=32004,z=10931,V=14529,k=16368,U=15318,W=32794,G=64e-7*A,H=-152*1e-7*A,q=62e-7*A,j=-8e-7*A,Y=32e-7*A,X=-41*1e-7*A,Z=19e-7*A,Q=-11*1e-7*A,J=-150*1e-7*A,K=-46*1e-7*A,$=68*1e-7*A,et=54e-7*A,tt=14e-7*A,rt=24e-7*A,it=-28*1e-7*A,nt=22e-7*A,ot=10,at=16002,st=21863,lt=10931,ut=1473,ct=32004,ht=4387,dt=73,mt=-325*1e-7,pt=-322*1e-7,ft=-79*1e-7,vt=232*1e-7,gt=-52*1e-7,_t=97e-7,yt=55e-7,Ct=-41*1e-7,wt=-105*1e-7,St=-137*1e-7,Et=258e-7,bt=35e-7,Tt=-116*1e-7,xt=-88*1e-7,Pt=-112*1e-7,At=-80*1e-7,Mt=new i(0,0,s.TAI),Dt=.012300034,It=-1*(Dt/(Dt+1)),Ot=new o(1.0000000000000002,5.619723173785822e-16,4.690511510146299e-19,-5.154129427414611e-16,.9174820620691819,-.39777715593191376,-2.23970096136568e-16,.39777715593191376,.9174820620691819),Rt=new e;return y.computeSunPositionInEarthInertialFrame=function(r,n){return t(r)||(r=i.now()),t(n)||(n=new e),Rt=v(r,Rt),n=e.negate(Rt,n),_(r,Rt),e.subtract(n,Rt,n),o.multiplyByVector(Ot,n,n),n},y.computeMoonPositionInEarthInertialFrame=function(e,r){return t(e)||(e=i.now()),r=g(e,r),o.multiplyByVector(Ot,r,r),r},y}),r("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,t,i,n,o,a,s){var l,u=m.numberOfPoints(e,t,o),c=i.red,h=i.green,d=i.blue,p=i.alpha,f=n.red,v=n.green,g=n.blue,_=n.alpha;if(r.equals(i,n)){for(l=0;u>l;l++)a[s++]=r.floatToByte(c),a[s++]=r.floatToByte(h),a[s++]=r.floatToByte(d),a[s++]=r.floatToByte(p);return s}var y=(f-c)/u,C=(v-h)/u,w=(g-d)/u,S=(_-p)/u,E=s;for(l=0;u>l;l++)a[E++]=r.floatToByte(c+l*y),a[E++]=r.floatToByte(h+l*C),a[E++]=r.floatToByte(d+l*w),a[E++]=r.floatToByte(p+l*S);return E}var v=function(e){e=n(e,n.EMPTY_OBJECT);var t=e.positions,r=e.colors,i=n(e.colorsPerVertex,!1);this._positions=t,this._colors=r,this._perVertex=i,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"},g=new Array(2),_=new Array(2);return v.createGeometry=function(n){var a,s,d,v,y,C,w,S,E,b,T=n._positions,x=n._colors,P=n._perVertex,A=n._followSurface,M=n._granularity,D=n._ellipsoid,I=o(x)&&!P,O=T.length,R=0,L=0,N=0,F=0;if(A){var B=m.extractHeights(T,D);if(I){for(a=0;O-1>a;a++)y=T[a],C=T[a+1],L+=m.numberOfPoints(y,C,M),L++;for(s=new Float64Array(3*L),v=new Uint8Array(4*L),E=0,a=0;O-1>a;a++){g[0]=T[a],g[1]=T[a+1],_[0]=B[a],_[1]=B[a+1];var z=m.generateArc({positions:g,granularity:M,ellipsoid:D,height:_});if(o(x)){var V=z.length/3;for(b=x[a],N=0;V>N;N++)v[E++]=r.floatToByte(b.red),v[E++]=r.floatToByte(b.green),v[E++]=r.floatToByte(b.blue),v[E++]=r.floatToByte(b.alpha)}s.set(z,R),R+=z.length}}else if(s=new Float64Array(m.generateArc({positions:T,granularity:M,ellipsoid:D,height:B})),o(x)){for(v=new Uint8Array(4*(s.length/3)),a=0;O-1>a;a++)y=T[a],C=T[a+1],w=x[a],S=x[a+1],R=f(y,C,w,S,M,v,R);v[R++]=r.floatToByte(S.red),v[R++]=r.floatToByte(S.green),v[R++]=r.floatToByte(S.blue),v[R++]=r.floatToByte(S.alpha)}}else for(d=I?2*T.length-2:T.length,s=new Float64Array(3*d),v=o(x)?new Uint8Array(4*d):void 0,a=0;O>a;++a){var k=T[a];if(I&&a>0&&(t.pack(k,s,F),F+=3,b=x[a-1],v[N++]=r.floatToByte(b.red),v[N++]=r.floatToByte(b.green),v[N++]=r.floatToByte(b.blue),v[N++]=r.floatToByte(b.alpha)),I&&a===O-1)break;t.pack(k,s,F),F+=3,o(x)&&(b=x[a],v[N++]=r.floatToByte(b.red),v[N++]=r.floatToByte(b.green),v[N++]=r.floatToByte(b.blue),v[N++]=r.floatToByte(b.alpha)) -}var U=new c;U.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:s}),o(x)&&(U.color=new u({componentDatatype:i.UNSIGNED_BYTE,componentsPerAttribute:4,values:v,normalize:!0})),d=s.length/3;var W=2*(d-1),G=h.createTypedArray(d,W);for(F=0,a=0;d-1>a;a++)G[F++]=a,G[F++]=a+1;return new l({attributes:U,indices:G,primitiveType:p.LINES,boundingSphere:e.fromPoints(T)})},v}),r("Core/SphereGeometry",["./Cartesian3","./defaultValue","./EllipsoidGeometry"],function(e,t,r){"use strict";var i=function(i){var n=t(i.radius,1),o=new e(n,n,n),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,vertexFormat:i.vertexFormat};this._ellipsoidGeometry=new r(a),this._workerName="createSphereGeometry"};return i.createGeometry=function(e){return r.createGeometry(e._ellipsoidGeometry)},i}),r("Core/SphereOutlineGeometry",["./Cartesian3","./defaultValue","./EllipsoidOutlineGeometry"],function(e,t,r){"use strict";var i=function(i){var n=t(i.radius,1),o=new e(n,n,n),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,subdivisions:i.subdivisions};this._ellipsoidGeometry=new r(a),this._workerName="createSphereOutlineGeometry"};return i.createGeometry=function(e){return r.createGeometry(e._ellipsoidGeometry)},i}),r("Core/Spherical",["./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(t,r,i){this.clock=e(t,0),this.cone=e(r,0),this.magnitude=e(i,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){return t(e)?t(i)?(i.clock=e.clock,i.cone=e.cone,i.magnitude=e.magnitude,i):new r(e.clock,e.cone,e.magnitude):void 0},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,r){return e===r||t(e)&&t(r)&&e.clock===r.clock&&e.cone===r.cone&&e.magnitude===r.magnitude},r.equalsEpsilon=function(r,i,n){return n=e(n,0),r===i||t(r)&&t(i)&&Math.abs(r.clock-i.clock)<=n&&Math.abs(r.cone-i.cone)<=n&&Math.abs(r.magnitude-i.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}),r("Core/TerrainData",["./defineProperties","./DeveloperError"],function(e,t){"use strict";var r=function(){t.throwInstantiationError()};return e(r.prototype,{waterMask:{get:t.throwInstantiationError}}),r.prototype.interpolateHeight=t.throwInstantiationError,r.prototype.isChildAvailable=t.throwInstantiationError,r.prototype.createMesh=t.throwInstantiationError,r.prototype.upsample=t.throwInstantiationError,r.prototype.wasCreatedByUpsampling=t.throwInstantiationError,r}),r("Core/TilingScheme",["./defineProperties","./DeveloperError"],function(e,t){"use strict";var r=function(){throw new t("This type should not be instantiated directly. Instead, use WebMercatorTilingScheme or GeographicTilingScheme.")};return e(r.prototype,{ellipsoid:{get:t.throwInstantiationError},rectangle:{get:t.throwInstantiationError},projection:{get:t.throwInstantiationError}}),r.prototype.getNumberOfXTilesAtLevel=t.throwInstantiationError,r.prototype.getNumberOfYTilesAtLevel=t.throwInstantiationError,r.prototype.rectangleToNativeRectangle=t.throwInstantiationError,r.prototype.tileXYToNativeRectangle=t.throwInstantiationError,r.prototype.tileXYToRectangle=t.throwInstantiationError,r.prototype.positionToTileXY=t.throwInstantiationError,r}),r("Core/TimeIntervalCollection",["./binarySearch","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./JulianDate","./TimeInterval"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){return a.compare(e.start,t.start)}var u=function(){this._intervals=[],this._changedEvent=new o};i(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?!1: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?!1: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 r=this._intervals,i=e._intervals,n=r.length;if(n!==i.length)return!1;for(var o=0;n>o;o++)if(!s.equals(r[o],i[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 r=this._intervals;c.start=t,c.stop=t;var i=e(r,c,l);return i>=0?r[i].isStartIncluded?i:i>0&&r[i-1].stop.equals(t)&&r[i-1].isStopIncluded?i-1:~i:(i=~i,i>0&&i-1l;l++){var c=s[l];if(!(r(i)&&!c.start.equals(i)||r(n)&&!c.stop.equals(n)||r(o)&&c.isStartIncluded!==o||r(a)&&c.isStopIncluded!==a))return s[l]}return void 0},u.prototype.addInterval=function(t,i){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),this._changedEvent.raiseEvent(this),void 0;for(o=e(u,t,l),0>o?o=~o:o>0&&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))&&((r(i)?i(u[o-1].data,t.data):u[o-1].data===t.data)?(t=a.greaterThan(t.stop,u[o-1].stop)?new s({start:u[o-1].start,stop:t.stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:t.isStopIncluded,data:t.data}):new s({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(r(i)?i(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 r=!1,i=this._intervals,n=e(i,t,l);0>n&&(n=~n);var o=t.start,u=t.stop,c=t.isStartIncluded,h=t.isStopIncluded;if(n>0){var d=i[n-1],m=d.stop;(a.greaterThan(m,o)||s.equals(m,o)&&d.isStopIncluded&&c)&&(r=!0,(a.greaterThan(m,u)||d.isStopIncluded&&!h&&s.equals(m,u))&&i.splice(n,0,new s({start:u,stop:m,isStartIncluded:!h,isStopIncluded:d.isStopIncluded,data:d.data})),i[n-1]=new s({start:d.start,stop:o,isStartIncluded:d.isStartIncluded,isStopIncluded:!c,data:d.data}))}var p=i[n];for(n0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._errorEvent=new s,this._ready=!1,this._proxy=n.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0};var v=n.credit;"string"==typeof v&&(v=new t(v)),this._credit=v,this._tilingScheme=void 0,this._rectangles=[];var y,C=this,w=r(n.ellipsoid,a.WGS84);h()};n(w.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){if(!this.ready)throw new o("requestTileGeometry must not be called before ready returns true.");return this._tilingScheme}},ready:{get:function(){return this._ready}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),w.prototype.requestTileGeometry=function(t,n,a,s){if(!this.ready)throw new o("requestTileGeometry must not be called before ready returns true.");var l=this._tilingScheme.getNumberOfYTilesAtLevel(a),d=this._url+a+"/"+t+"/"+(l-n-1)+".tif?cesium=true",m=this._proxy;i(m)&&(d=m.getURL(d));var p;if(s=r(s,!0)){if(p=v(h,d),!i(p))return void 0}else p=h(d);var f=this;return e(p,function(e){return new c({buffer:u(e),width:f._heightmapWidth,height:f._heightmapHeight,childTileMask:y(f,t,n,a),structure:f._terrainDataStructure})})},w.prototype.getLevelMaximumGeometricError=function(e){if(!this.ready)throw new o("requestTileGeometry must not be called before ready returns true.");return this._levelZeroMaximumGeometricError/(1<p)return{positions:i};var f=i[0];u.push(f);var v=r.cartesianToCartographic(f,h);s&&(v.height=n[0]),c.push(v.height),a?m.push(o[0]):m.push(0);for(var g=1;p>g;++g){var _=i[g],y=r.cartesianToCartographic(_,d);s&&(y.height=n[g]),l(v,y)?v.height=3){var d=i.fromPoints(t,e),m=d.projectPointsOntoPlane(t);o.computeWindingOrder2D(m)===s.CLOCKWISE&&(t.reverse(),r.reverse(),n.reverse())}var p,f,v,g,_,y=t.length;if(c){var C=0;for(p=0;y-1>p;p++)g=t[p],_=t[p+1],C+=a.numberOfPoints(g,_,l),C++;f=new Float64Array(3*C),v=new Float64Array(3*C);var w=0;for(p=0;y-1>p;p++){g=t[p],_=t[p+1];var S=r[p],E=r[p+1],b=a.generateArc({positions:[g,_],height:[S,E],granularity:l,ellipsoid:e});f.set(b,w),S=n[p],E=n[p+1],v.set(a.generateArc({positions:[g,_],height:[S,E],granularity:l,ellipsoid:e}),w),w+=b.length}}else f=new Float64Array(a.generateArc({positions:t,height:r,granularity:l,ellipsoid:e})),v=new Float64Array(a.generateArc({positions:t,height:n,granularity:l,ellipsoid:e}));return{bottomPositions:v,topPositions:f}},c}),r("Core/WallGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat","./WallGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";var f=new t,v=new t,g=new t,_=new t,y=new t,C=new t,w=new t,S=new t,E=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.positions,r=e.maximumHeights,n=e.minimumHeights,o=i(e.vertexFormat,m.DEFAULT),s=i(e.granularity,h.RADIANS_PER_DEGREE),l=i(e.ellipsoid,a.WGS84);this._positions=t,this._minimumHeights=n,this._maximumHeights=r,this._vertexFormat=o,this._granularity=s,this._ellipsoid=l,this._workerName="createWallGeometry"};return E.fromConstantHeights=function(e){e=i(e,i.EMPTY_OBJECT);var t,r,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,r=u?new Array(c):void 0;for(var h=0;c>h;++h)l&&(t[h]=a),u&&(r[h]=s)}var d={positions:o,maximumHeights:r,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new E(d)},E.createGeometry=function(i){var n=i._positions,o=i._minimumHeights,a=i._maximumHeights,m=i._vertexFormat,E=i._granularity,b=i._ellipsoid,T=p.computePositions(b,n,a,o,E,!0),x=T.bottomPositions,P=T.topPositions,A=P.length,M=2*A,D=m.position?new Float64Array(M):void 0,I=m.normal?new Float32Array(M):void 0,O=m.tangent?new Float32Array(M):void 0,R=m.binormal?new Float32Array(M):void 0,L=m.st?new Float32Array(2*(M/3)):void 0,N=0,F=0,B=0,z=0,V=0,k=S,U=w,W=C,G=!0;A/=3;var H;for(H=0;A>H;++H){var q=3*H,j=t.fromArray(P,q,f),Y=t.fromArray(x,q,v);if(m.position&&(D[N++]=Y.x,D[N++]=Y.y,D[N++]=Y.z,D[N++]=j.x,D[N++]=j.y,D[N++]=j.z),m.normal||m.tangent||m.binormal){var X,Z=new t,Q=b.scaleToGeodeticSurface(t.fromArray(P,q,v),v);if(A>H+1&&(X=b.scaleToGeodeticSurface(t.fromArray(P,q+3,g),g),Z=t.fromArray(P,q+3,y)),G){var J=t.subtract(Z,j,_),K=t.subtract(Q,j,f);k=t.normalize(t.cross(K,J,k),k),G=!1}t.equalsEpsilon(X,Q,h.EPSILON6)?G=!0:(m.tangent&&(U=t.normalize(t.subtract(X,Q,U),U)),m.binormal&&(W=t.normalize(t.cross(k,U,W),W))),m.normal&&(I[F++]=k.x,I[F++]=k.y,I[F++]=k.z,I[F++]=k.x,I[F++]=k.y,I[F++]=k.z),m.tangent&&(O[z++]=U.x,O[z++]=U.y,O[z++]=U.z,O[z++]=U.x,O[z++]=U.y,O[z++]=U.z),m.binormal&&(R[B++]=W.x,R[B++]=W.y,R[B++]=W.z,R[B++]=W.x,R[B++]=W.y,R[B++]=W.z)}if(m.st){var $=H/(A-1);L[V++]=$,L[V++]=0,L[V++]=$,L[V++]=1}}var et=new u;m.position&&(et.position=new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:D})),m.normal&&(et.normal=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:I})),m.tangent&&(et.tangent=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:O})),m.binormal&&(et.binormal=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R})),m.st&&(et.st=new l({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:L}));var tt=M/3;M-=6;var rt=c.createTypedArray(tt,M),it=0;for(H=0;tt-2>H;H+=2){var nt=H,ot=H+2,at=t.fromArray(D,3*nt,f),st=t.fromArray(D,3*ot,v);if(!t.equalsEpsilon(at,st,h.EPSILON6)){var lt=H+1,ut=H+3;rt[it++]=lt,rt[it++]=nt,rt[it++]=ut,rt[it++]=ut,rt[it++]=nt,rt[it++]=ot}}return new s({attributes:et,indices:rt,primitiveType:d.TRIANGLES,boundingSphere:new e.fromVertices(D)})},E}),r("Core/WallOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./WallGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";var p=new t,f=new t,v=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.positions,r=e.maximumHeights,n=e.minimumHeights,o=i(e.granularity,h.RADIANS_PER_DEGREE),s=i(e.ellipsoid,a.WGS84);this._positions=t,this._minimumHeights=n,this._maximumHeights=r,this._granularity=o,this._ellipsoid=s,this._workerName="createWallOutlineGeometry"};return v.fromConstantHeights=function(e){e=i(e,i.EMPTY_OBJECT);var t,r,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,r=u?new Array(c):void 0;for(var h=0;c>h;++h)l&&(t[h]=a),u&&(r[h]=s)}var d={positions:o,maximumHeights:r,minimumHeights:t,ellipsoid:e.ellipsoid};return new v(d)},v.createGeometry=function(i){var n=i._positions,o=i._minimumHeights,a=i._maximumHeights,v=i._granularity,g=i._ellipsoid,_=m.computePositions(g,n,a,o,v,!1),y=_.bottomPositions,C=_.topPositions,w=C.length,S=2*w,E=new Float64Array(S),b=0;w/=3;var T;for(T=0;w>T;++T){var x=3*T,P=t.fromArray(C,x,p),A=t.fromArray(y,x,f);E[b++]=A.x,E[b++]=A.y,E[b++]=A.z,E[b++]=P.x,E[b++]=P.y,E[b++]=P.z}var M=new u({position:new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:E})}),D=S/3;S=2*D-4+D;var I=c.createTypedArray(D,S),O=0;for(T=0;D-2>T;T+=2){var R=T,L=T+2,N=t.fromArray(E,3*R,p),F=t.fromArray(E,3*L,f);if(!t.equalsEpsilon(N,F,h.EPSILON6)){var B=T+1,z=T+3;I[O++]=B,I[O++]=R,I[O++]=B,I[O++]=z,I[O++]=R,I[O++]=L}}return I[O++]=D-2,I[O++]=D-1,new s({attributes:M,indices:I,primitiveType:d.LINES,boundingSphere:new e.fromVertices(E)})},v}),r("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(e){this._ellipsoid=r(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,r){var n=this._semimajorAxis,o=t.longitude*n,a=l.geodeticLatitudeToMercatorAngle(t.latitude)*n,s=t.height;return i(r)?(r.x=o,r.y=a,r.z=s,r):new e(o,a,s)},l.prototype.unproject=function(e,r){var n=this._oneOverSemimajorAxis,o=e.x*n,a=l.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;return i(r)?(r.longitude=o,r.latitude=a,r.height=s,r):new t(o,a,s)},l}),r("Core/WebMercatorTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Rectangle","./WebMercatorProjection"],function(e,t,r,i,n,o,a){"use strict";var s=function(i){if(i=t(i,{}),this._ellipsoid=t(i.ellipsoid,n.WGS84),this._numberOfLevelZeroTilesX=t(i.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=t(i.numberOfLevelZeroTilesY,1),this._projection=new a(this._ellipsoid),r(i.rectangleSouthwestInMeters)&&r(i.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=i.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=i.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 i(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<o.north||t.latitudeo.east)return void 0;var a=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),l=this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x,u=l/a,c=this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y,h=c/s,d=this._projection,m=d.project(t),p=m.x-this._rectangleSouthwestInMeters.x,f=this._rectangleNortheastInMeters.y-m.y,v=0|p/u;v>=a&&(v=a-1);var g=0|f/h;return g>=s&&(g=s-1),r(n)?(n.x=v,n.y=g,n):new e(v,g)},s}),r("Core/cancelAnimationFrame",["./defined"],function(e){"use strict";var t=window.cancelAnimationFrame;!function(){if(!e(t))for(var r=["webkit","moz","ms","o"],i=0,n=r.length;n>i&&!e(t);)t=window[r[i]+"CancelAnimationFrame"],e(t)||(t=window[r[i]+"CancelRequestAnimationFrame"]),++i;e(t)||(t=clearTimeout)}();var r=function(e){t(e)};return r}),r("Core/combine",["./defaultValue","./defined"],function(e,t){"use strict";var r=function(i,n,o){o=e(o,!1);var a,s,l,u={},c=t(i),h=t(n);if(c)for(a in i)i.hasOwnProperty(a)&&(s=i[a],h&&o&&"object"==typeof s&&n.hasOwnProperty(a)?(l=n[a],u[a]="object"==typeof l?r(s,l,o):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 r}),r("Core/createGuid",[],function(){"use strict";var e=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=0|16*Math.random(),r="x"===e?t:8|3&t;return r.toString(16)})};return e}),r("Core/deprecationWarning",["./defined","./DeveloperError"],function(e){"use strict";var t={},r=function(r,i){e(t[r])||(t[r]=!0,console.log(i))};return r}),r("Core/getFilenameFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){var r=new e(t);r.normalize();var i=r.path,n=i.lastIndexOf("/");return-1!==n&&(i=i.substr(n+1)),i};return t}),r("Core/objectToQuery",["./defined","./DeveloperError","./isArray"],function(e,t,r){"use strict";var i=function(e){var t="";for(var i in e)if(e.hasOwnProperty(i)){var n=e[i],o=encodeURIComponent(i)+"=";if(r(n))for(var a=0,s=n.length;s>a;++a)t+=o+encodeURIComponent(n[a])+"&";else t+=o+encodeURIComponent(n)+"&"}return t=t.slice(0,-1)};return i}),r("Core/queryToObject",["./defined","./DeveloperError","./isArray"],function(e,t,r){"use strict";var i=function(t){var i={};if(""===t)return i;for(var n=t.replace(/\+/g,"%20").split("&"),o=0,a=n.length;a>o;++o){var s=n[o].split("="),l=decodeURIComponent(s[0]),u=s[1];u=e(u)?decodeURIComponent(u):"";var c=i[l];"string"==typeof c?i[l]=[c,u]:r(c)?c.push(u):i[l]=u}return i};return i}),r("Core/jsonp",["../ThirdParty/Uri","../ThirdParty/when","./combine","./defaultValue","./defined","./DeveloperError","./objectToQuery","./queryToObject"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(o,u){u=i(u,i.EMPTY_OBJECT);var c;do c="jsonp"+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(t){window[c]=void 0}};var d=new e(o),m=s(i(d.query,""));n(u.parameters)&&(m=r(u.parameters,m));var p=i(u.callbackParameterName,"callback");m[p]=c,d.query=a(m),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,r){var i=document.createElement("script");i.async=!0,i.src=e;var n=document.getElementsByTagName("head")[0];i.onload=function(){i.onload=void 0,n.removeChild(i)},i.onerror=function(e){r.reject(e)},n.appendChild(i)},l.defaultLoadAndExecuteScript=l.loadAndExecuteScript,l}),r("Core/loadBlob",["./loadWithXhr","./defined"],function(e,t){"use strict";var r=function(r,i){return e({url:r,responseType:"blob",headers:t(i)?i.headers:void 0,withCredentials:t(i)?i.withCredentials:void 0})};return r}),r("Core/loadImageViaBlob",["../ThirdParty/when","./loadBlob","./loadImage"],function(e,t,r){"use strict";var i=/^data:/,n=function(n,o){return i.test(n)?r(n):t(n,o).then(function(t){var i=window.URL.createObjectURL(t);return r(i,!1).then(function(e){return e.blob=t,window.URL.revokeObjectURL(i),e},function(t){return window.URL.revokeObjectURL(i),e.reject(t)})})},o=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(t){return!1}}();return o?n:r}),r("Core/mergeSort",["./defined","./DeveloperError"],function(){"use strict";function e(e,t,n,o,a,s){var l,u,c=a-o+1,h=s-a,d=r,m=i;for(l=0;c>l;++l)d[l]=e[o+l];for(u=0;h>u;++u)m[u]=e[a+u+1];l=0,u=0;for(var p=o;s>=p;++p){var f=d[l],v=m[u];c>l&&(u>=h||t(f,v,n)<=0)?(e[p]=f,++l):h>u&&(e[p]=v,++u)}}function t(r,i,n,o,a){if(!(o>=a)){var s=Math.floor(.5*(o+a));t(r,i,n,o,s),t(r,i,n,s+1,a),e(r,i,n,o,s,a)}}var r=[],i=[],n=function(e,n,o){var a=e.length,s=Math.ceil(.5*a);r.length=s,i.length=s,t(e,n,o,0,a-1),r.length=0,i.length=0};return n}),r("Core/requestAnimationFrame",["./defined"],function(e){"use strict";var t=window.requestAnimationFrame;!function(){if(!e(t))for(var r=["webkit","moz","ms","o"],i=0,n=r.length;n>i&&!e(t);)t=window[r[i]+"RequestAnimationFrame"],++i;if(!e(t)){var o=0;t=function(e){var t=Date.now(),r=Math.max(16-(t-o),0);return o=t+r,setTimeout(function(){e(o)},r)}}}();var r=function(e){return t(e)};return r}),r("Core/sampleTerrain",["../ThirdParty/when","./defined","./DeveloperError"],function(e){"use strict";function t(t,n,o){var a,s=t.tilingScheme,l=[],u={};for(a=0;an;){var o=Math.ceil((i-n)/t--);r.push(e.slice(n,n+o)),n+=o}return r};return e}),r("Core/wrapFunction",["./DeveloperError"],function(){"use strict";var e=function(e,t,r){return function(){r.apply(e,arguments),t.apply(e,arguments)}};return e}),r("DataSources/createPropertyDescriptor",["../Core/defaultValue","../Core/defined"],function(e,t){"use strict";function r(e,r,i,n){return{configurable:n,get:function(){return this[r]},set:function(n){var o=this[r],a=this[i];t(a)&&(a(),this[i]=void 0),o!==n&&(this[r]=n,this._definitionChanged.raiseEvent(this,e,n,o)),t(n)&&t(n.definitionChanged)&&(this[i]=n.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,n,n)},this))}}}function i(t,i){return r(t,"_"+t,"_"+t+"Subscription",e(i,!1))}return i}),r("DataSources/BillboardGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){this._image=void 0,this._imageSubscription=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._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._definitionChanged=new n -};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},image:o("image"),scale:o("scale"),rotation:o("rotation"),alignedAxis:o("alignedAxis"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),color:o("color"),eyeOffset:o("eyeOffset"),pixelOffset:o("pixelOffset"),show:o("show"),width:o("width"),height:o("height"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.color=this._color,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.image=this._image,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},a.prototype.merge=function(t){this.color=e(this._color,t._color),this.eyeOffset=e(this._eyeOffset,t._eyeOffset),this.horizontalOrigin=e(this._horizontalOrigin,t._horizontalOrigin),this.image=e(this._image,t._image),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)},a}),r("Renderer/BufferUsage",["../Core/freezeObject"],function(e){"use strict";var t={STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,validate:function(e){return e===t.STREAM_DRAW||e===t.STATIC_DRAW||e===t.DYNAMIC_DRAW}};return e(t)}),r("Renderer/DrawCommand",["../Core/defaultValue","../Core/PrimitiveType"],function(e,t){"use strict";var r=function(r){r=e(r,e.EMPTY_OBJECT),this.boundingVolume=r.boundingVolume,this.cull=e(r.cull,!0),this.modelMatrix=r.modelMatrix,this.primitiveType=e(r.primitiveType,t.TRIANGLES),this.vertexArray=r.vertexArray,this.count=r.count,this.offset=e(r.offset,0),this.shaderProgram=r.shaderProgram,this.uniformMap=r.uniformMap,this.renderState=r.renderState,this.framebuffer=r.framebuffer,this.pass=r.pass,this.executeInClosestFrustum=e(r.executeInClosestFrustum,!1),this.owner=r.owner,this.debugShowBoundingVolume=e(r.debugShowBoundingVolume,!1),this.debugOverlappingFrustums=0,this.oit=void 0};return r.prototype.execute=function(e,t,r,i){e.draw(this,t,r,i)},r}),r("Shaders/Builtin/Constants/degreesPerRadian",[],function(){"use strict";return"const float czm_degreesPerRadian = 57.29577951308232;\n"}),r("Shaders/Builtin/Constants/depthRange",[],function(){"use strict";return"const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\n"}),r("Shaders/Builtin/Constants/epsilon1",[],function(){"use strict";return"const float czm_epsilon1 = 0.1;\n"}),r("Shaders/Builtin/Constants/epsilon2",[],function(){"use strict";return"const float czm_epsilon2 = 0.01;\n"}),r("Shaders/Builtin/Constants/epsilon3",[],function(){"use strict";return"const float czm_epsilon3 = 0.001;\n"}),r("Shaders/Builtin/Constants/epsilon4",[],function(){"use strict";return"const float czm_epsilon4 = 0.0001;\n"}),r("Shaders/Builtin/Constants/epsilon5",[],function(){"use strict";return"const float czm_epsilon5 = 0.00001;\n"}),r("Shaders/Builtin/Constants/epsilon6",[],function(){"use strict";return"const float czm_epsilon6 = 0.000001;\n"}),r("Shaders/Builtin/Constants/epsilon7",[],function(){"use strict";return"const float czm_epsilon7 = 0.0000001;\n"}),r("Shaders/Builtin/Constants/infinity",[],function(){"use strict";return"const float czm_infinity = 5906376272000.0;\n"}),r("Shaders/Builtin/Constants/oneOverPi",[],function(){"use strict";return"const float czm_oneOverPi = 0.3183098861837907;\n"}),r("Shaders/Builtin/Constants/oneOverTwoPi",[],function(){"use strict";return"const float czm_oneOverTwoPi = 0.15915494309189535;\n"}),r("Shaders/Builtin/Constants/pi",[],function(){"use strict";return"const float czm_pi = 3.141592653589793;\n"}),r("Shaders/Builtin/Constants/piOverFour",[],function(){"use strict";return"const float czm_piOverFour = 0.7853981633974483;\n"}),r("Shaders/Builtin/Constants/piOverSix",[],function(){"use strict";return"const float czm_piOverSix = 0.5235987755982988;\n"}),r("Shaders/Builtin/Constants/piOverThree",[],function(){"use strict";return"const float czm_piOverThree = 1.0471975511965976;\n"}),r("Shaders/Builtin/Constants/piOverTwo",[],function(){"use strict";return"const float czm_piOverTwo = 1.5707963267948966;\n"}),r("Shaders/Builtin/Constants/radiansPerDegree",[],function(){"use strict";return"const float czm_radiansPerDegree = 0.017453292519943295;\n"}),r("Shaders/Builtin/Constants/sceneMode2D",[],function(){"use strict";return"const float czm_sceneMode2D = 2.0;\n"}),r("Shaders/Builtin/Constants/sceneMode3D",[],function(){"use strict";return"const float czm_sceneMode3D = 3.0;\n"}),r("Shaders/Builtin/Constants/sceneModeColumbusView",[],function(){"use strict";return"const float czm_sceneModeColumbusView = 1.0;\n"}),r("Shaders/Builtin/Constants/sceneModeMorphing",[],function(){"use strict";return"const float czm_sceneModeMorphing = 0.0;\n"}),r("Shaders/Builtin/Constants/solarRadius",[],function(){"use strict";return"const float czm_solarRadius = 695500000.0;\n"}),r("Shaders/Builtin/Constants/threePiOver2",[],function(){"use strict";return"const float czm_threePiOver2 = 4.71238898038469;\n"}),r("Shaders/Builtin/Constants/twoPi",[],function(){"use strict";return"const float czm_twoPi = 6.283185307179586;\n"}),r("Shaders/Builtin/Constants/webMercatorMaxLatitude",[],function(){"use strict";return"const float czm_webMercatorMaxLatitude = 1.4844222297453324;\n"}),r("Shaders/Builtin/Structs/depthRangeStruct",[],function(){"use strict";return"struct czm_depthRangeStruct\n{\nfloat near;\nfloat far;\n};\n"}),r("Shaders/Builtin/Structs/ellipsoid",[],function(){"use strict";return"struct czm_ellipsoid\n{\nvec3 center;\nvec3 radii;\nvec3 inverseRadii;\nvec3 inverseRadiiSquared;\n};\n"}),r("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"}),r("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"}),r("Shaders/Builtin/Structs/ray",[],function(){"use strict";return"struct czm_ray\n{\nvec3 origin;\nvec3 direction;\n};\n"}),r("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"}),r("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"}),r("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"}),r("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;\nfloat z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 1.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"}),r("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"}),r("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"}),r("Shaders/Builtin/Functions/computePosition",[],function(){"use strict";return"vec4 czm_computePosition();\n"}),r("Shaders/Builtin/Functions/cosineAndSine",[],function(){"use strict";return"#ifndef DISABLE_CORDIC\nvec2 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#endif\n"}),r("Shaders/Builtin/Functions/decompressTextureCoordinates",[],function(){"use strict";return"vec2 czm_decompressTextureCoordinates(float encoded)\n{\nfloat temp = encoded / 4096.0;\nfloat stx = floor(temp) / 4096.0;\nfloat sty = temp - floor(temp);\nreturn vec2(stx, sty);\n}\n"}),r("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"}),r("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"}),r("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"}),r("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"}),r("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"}),r("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"}),r("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"}),r("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"}),r("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"}),r("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"}),r("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, shininess);\n}\n"}),r("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"}),r("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"}),r("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"}),r("Shaders/Builtin/Functions/isEmpty",[],function(){"use strict";return"bool czm_isEmpty(czm_raySegment interval)\n{\nreturn (interval.stop < 0.0);\n}\n"}),r("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"}),r("Shaders/Builtin/Functions/latitudeToWebMercatorFraction",[],function(){"use strict";return"float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorYLow, float southMercatorYHigh, float oneOverMercatorHeight)\n{\n#ifdef DISABLE_CORDIC\nfloat sinLatitude = sin(latitude);\n#else\nfloat sinLatitude = czm_cosineAndSine(latitude).y;\n#endif\nfloat mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\nfloat t1 = 0.0 - southMercatorYLow;\nfloat e = t1 - 0.0;\nfloat t2 = ((-southMercatorYLow - e) + (0.0 - (t1 - e))) + mercatorY - southMercatorYHigh;\nfloat highDifference = t1 + t2;\nfloat lowDifference = t2 - (highDifference - t1);\nreturn highDifference * oneOverMercatorHeight + lowDifference * oneOverMercatorHeight;\n}\n"}),r("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"}),r("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"}),r("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"}),r("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"}),r("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) + czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\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"}),r("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"}),r("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"}),r("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"}),r("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"}),r("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"}),r("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"}),r("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);\ndiffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\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"}),r("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"}),r("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"}),r("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/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","./Functions/RGBToXYZ","./Functions/XYZToRGB","./Functions/alphaWeight","./Functions/antialias","./Functions/columbusViewMorph","./Functions/computePosition","./Functions/cosineAndSine","./Functions/decompressTextureCoordinates","./Functions/eastNorthUpToEyeCoordinates","./Functions/ellipsoidContainsPoint","./Functions/ellipsoidNew","./Functions/ellipsoidWgs84TextureCoordinates","./Functions/equalsEpsilon","./Functions/eyeOffset","./Functions/eyeToWindowCoordinates","./Functions/geodeticSurfaceNormal","./Functions/getDefaultMaterial","./Functions/getLambertDiffuse","./Functions/getSpecular","./Functions/getWaterNoise","./Functions/getWgs84EllipsoidEC","./Functions/hue","./Functions/isEmpty","./Functions/isFull","./Functions/latitudeToWebMercatorFraction","./Functions/luminance","./Functions/modelToWindowCoordinates","./Functions/multiplyWithColorBalance","./Functions/octDecode","./Functions/phong","./Functions/pointAlongRay","./Functions/rayEllipsoidIntersectionInterval","./Functions/saturation","./Functions/signNotZero","./Functions/tangentToEyeSpaceMatrix","./Functions/translateRelativeToEye","./Functions/translucentPhong","./Functions/transpose","./Functions/windowToEyeCoordinates"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S,E,b,T,x,P,A,M,D,I,O,R,L,N,F,B,z,V,k,U,W,G,H,q,j,Y,X,Z,Q,J,K,$,et,tt,rt,it,nt,ot,at,st,lt,ut,ct,ht,dt,mt,pt,ft,vt){"use strict"; -return{czm_degreesPerRadian:e,czm_depthRange:t,czm_epsilon1:r,czm_epsilon2:i,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_pi:d,czm_piOverFour:m,czm_piOverSix:p,czm_piOverThree:f,czm_piOverTwo:v,czm_radiansPerDegree:g,czm_sceneMode2D:_,czm_sceneMode3D:y,czm_sceneModeColumbusView:C,czm_sceneModeMorphing:w,czm_solarRadius:S,czm_threePiOver2:E,czm_twoPi:b,czm_webMercatorMaxLatitude:T,czm_depthRangeStruct:x,czm_ellipsoid:P,czm_material:A,czm_materialInput:M,czm_ray:D,czm_raySegment:I,czm_RGBToXYZ:O,czm_XYZToRGB:R,czm_alphaWeight:L,czm_antialias:N,czm_columbusViewMorph:F,czm_computePosition:B,czm_cosineAndSine:z,czm_decompressTextureCoordinates:V,czm_eastNorthUpToEyeCoordinates:k,czm_ellipsoidContainsPoint:U,czm_ellipsoidNew:W,czm_ellipsoidWgs84TextureCoordinates:G,czm_equalsEpsilon:H,czm_eyeOffset:q,czm_eyeToWindowCoordinates:j,czm_geodeticSurfaceNormal:Y,czm_getDefaultMaterial:X,czm_getLambertDiffuse:Z,czm_getSpecular:Q,czm_getWaterNoise:J,czm_getWgs84EllipsoidEC:K,czm_hue:$,czm_isEmpty:et,czm_isFull:tt,czm_latitudeToWebMercatorFraction:rt,czm_luminance:it,czm_modelToWindowCoordinates:nt,czm_multiplyWithColorBalance:ot,czm_octDecode:at,czm_phong:st,czm_pointAlongRay:lt,czm_rayEllipsoidIntersectionInterval:ut,czm_saturation:ct,czm_signNotZero:ht,czm_tangentToEyeSpaceMatrix:dt,czm_translateRelativeToEye:mt,czm_translucentPhong:pt,czm_transpose:ft,czm_windowToEyeCoordinates:vt}}),r("Renderer/AutomaticUniforms",["../Core/Cartesian3","../Core/defineProperties","../Core/Matrix4"],function(e,t,r){"use strict";var i=new e,n=function(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue};if(t(n.prototype,{size:{get:function(){return this._size}},datatype:{get:function(){return this._datatype}}}),"undefined"==typeof WebGLRenderingContext)return{};var o={};o[WebGLRenderingContext.FLOAT]="float",o[WebGLRenderingContext.FLOAT_VEC2]="vec2",o[WebGLRenderingContext.FLOAT_VEC3]="vec3",o[WebGLRenderingContext.FLOAT_VEC4]="vec4",o[WebGLRenderingContext.INT]="int",o[WebGLRenderingContext.INT_VEC2]="ivec2",o[WebGLRenderingContext.INT_VEC3]="ivec3",o[WebGLRenderingContext.INT_VEC4]="ivec4",o[WebGLRenderingContext.BOOL]="bool",o[WebGLRenderingContext.BOOL_VEC2]="bvec2",o[WebGLRenderingContext.BOOL_VEC3]="bvec3",o[WebGLRenderingContext.BOOL_VEC4]="bvec4",o[WebGLRenderingContext.FLOAT_MAT2]="mat2",o[WebGLRenderingContext.FLOAT_MAT3]="mat3",o[WebGLRenderingContext.FLOAT_MAT4]="mat4",o[WebGLRenderingContext.SAMPLER_2D]="sampler2D",o[WebGLRenderingContext.SAMPLER_CUBE]="samplerCube",n.prototype.getDeclaration=function(e){var t="uniform "+o[this._datatype]+" "+e,r=this._size;return t+=1===r?";":"["+r.toString()+"];"};var a={czm_viewport:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_model:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_inverseProjectionOIT:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseProjectionOIT}}),czm_infiniteProjection:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_normal:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight2D:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_sunPositionWC:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_encodedCameraPositionMCHigh:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new n({size:1,datatype:WebGLRenderingContext.FLOAT_VEC3,getValue:function(e){return r.getTranslation(e.inverseView,i)}}),czm_frameNumber:new n({size:1,datatype:WebGLRenderingContext.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new n({size:1,datatype:WebGLRenderingContext.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new n({size:1,datatype:WebGLRenderingContext.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_temeToPseudoFixed:new n({size:1,datatype:WebGLRenderingContext.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_resolutionScale:new n({size:1,datatype:WebGLRenderingContext.FLOAT,getValue:function(e){return e.resolutionScale}})};return a}),r("Renderer/ShaderSource",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Shaders/Builtin/CzmBuiltins","./AutomaticUniforms"],function(e,t,r,i,n){"use strict";function o(e){return e.replace(/\/\*\*[\s\S]*?\*\//gm,function(e){for(var t=e.match(/\n/gm).length,r="",i=0;t>i;++i)r+="\n";return r})}function a(e,r,i){for(var n,a=0;a0;){var n=e.pop();i.push(n),0===n.requiredBy.length&&t.push(n)}for(;t.length>0;){var o=t.shift();e.push(o);for(var a=0;a=0;--n)i=i+t[n].glslSource+"\n";return i.replace(r.glslSource,"")}function c(e,i){var n,a,s="",l=e.sources;if(t(l))for(n=0,a=l.length;a>n;++n)s+="\n#line 0\n"+l[n];s=o(s);var c;s=s.replace(/#version\s+(.*?)\n/gm,function(e,i){if(t(c)&&c!==i)throw new r("inconsistent versions found: "+c+" and "+i);return c=i,"\n"});var h=e.pickColorQualifier;t(h)&&(s=s.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_old_main()"),s+="\n"+h+" 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}");var d="";t(c)&&(d="#version "+c),i&&(d+="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n\n");var m=e.defines;if(t(m))for(n=0,a=m.length;a>n;++n){var p=m[n];0!==p.length&&(d+="#define "+p+"\n")}return e.includeBuiltIns&&(d+=u(s)),d+="\n#line 0\n",d+=s}var h=function(r){r=e(r,e.EMPTY_OBJECT);var i=r.pickColorQualifier;this.defines=t(r.defines)?r.defines.slice(0):[],this.sources=t(r.sources)?r.sources.slice(0):[],this.pickColorQualifier=i,this.includeBuiltIns=e(r.includeBuiltIns,!0)};h.prototype.clone=function(){return new h({sources:this.sources,defines:this.defines,pickColorQuantifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})},h.prototype.createCombinedVertexShader=function(){return c(this,!1)},h.prototype.createCombinedFragmentShader=function(){return c(this,!0)},h._czmBuiltinsAndUniforms={};for(var d in i)i.hasOwnProperty(d)&&(h._czmBuiltinsAndUniforms[d]=i[d]);for(var m in n)if(n.hasOwnProperty(m)){var p=n[m];"function"==typeof p.getDeclaration&&(h._czmBuiltinsAndUniforms[m]=p.getDeclaration(m))}return h}),r("Renderer/VertexArrayFacade",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./BufferUsage"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;var i=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,o=r(i);if(!o||i.sizeInBytes0){var i=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*r;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,n),i)}}function u(e){var t=e.va;if(r(t)){for(var i=t.length,n=0;i>n;++n)t[n].va.destroy();e.va=void 0}}var c=function(t,i,n){function o(t,r){return e.getSizeInBytes(r.componentDatatype)-e.getSizeInBytes(t.componentDatatype)}var s=c._verifyAttributes(i);n=n||0;for(var l,u,h=[],d={},m=s.length,p=0;m>p;++p){var f=s[p];f.vertexBuffer?h.push(f):(u=f.usage,l=d[u],r(l)||(l=d[u]=[]),l.push(f))}this._buffersByUsage={},this._allBuffers=[];for(u in d)if(d.hasOwnProperty(u)){l=d[u],l.sort(o);var v,g=c._vertexSizeInBytes(l);switch(Number(u)){case a.STATIC_DRAW:v=a.STATIC_DRAW;break;case a.STREAM_DRAW:v=a.STREAM_DRAW;break;case a.DYNAMIC_DRAW:v=a.DYNAMIC_DRAW}var _={vertexSizeInBytes:g,vertexBuffer:void 0,usage:v,needsCommit:!1,arrayBuffer:void 0,arrayViews:c._createArrayViews(l,g)};this._buffersByUsage[u]=_,this._allBuffers.push(_)}this._size=0,this._precreated=h,this._context=t,this.writers=void 0,this.va=void 0,this.resize(n)};c._verifyAttributes=function(r){for(var i=[],o=0;on;++n){var o=t[n];r+=o.componentsPerAttribute*e.getSizeInBytes(o.componentDatatype)}var a=i>0?e.getSizeInBytes(t[0].componentDatatype):0,s=a>0?r%a:0,l=0===s?0:a-s;return r+=l},c._createArrayViews=function(t,r){for(var i=[],n=0,o=t.length,a=0;o>a;++a){var s=t[a],l=s.componentDatatype;i.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:l,normalize:s.normalize,offsetInBytes:n,vertexSizeInComponentType:r/e.getSizeInBytes(l),view:void 0}),n+=s.componentsPerAttribute*e.getSizeInBytes(l)}return i},c.prototype.resize=function(e){this._size=e;var t=this._allBuffers;this.writers=[];for(var r=0,i=t.length;i>r;++r){var n=t[r];c._resize(n,this._size),c._appendWriters(this.writers,n)}u(this)},c._resize=function(t,i){if(t.vertexSizeInBytes>0){var n=new ArrayBuffer(i*t.vertexSizeInBytes);if(r(t.arrayBuffer))for(var o=new Uint8Array(n),a=new Uint8Array(t.arrayBuffer),s=a.length,l=0;s>l;++l)o[l]=a[l];for(var u=t.arrayViews,c=u.length,h=0;c>h;++h){var d=u[h];d.view=e.createArrayBufferView(d.componentDatatype,n,d.offsetInBytes)}t.arrayBuffer=n}};var h=[function(e,t,r){return function(i,n){t[i*r]=n,e.needsCommit=!0}},function(e,t,r){return function(i,n,o){var a=i*r;t[a]=n,t[a+1]=o,e.needsCommit=!0}},function(e,t,r){return function(i,n,o,a){var s=i*r;t[s]=n,t[s+1]=o,t[s+2]=a,e.needsCommit=!0}},function(e,t,r){return function(i,n,o,a,s){var l=i*r;t[l]=n,t[l+1]=o,t[l+2]=a,t[l+3]=s,e.needsCommit=!0}}];return c._appendWriters=function(e,t){for(var r=t.arrayViews,i=r.length,n=0;i>n;++n){var o=r[n];e[o.index]=h[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}},c.prototype.commit=function(e){for(var t,i=!1,n=this._allBuffers,a=0,l=n.length;l>a;++a)t=n[a],i=s(this,t)||i;if(i||!r(this.va)){var h=this._buffersByUsage;u(this);for(var d=this.va=[],m=Math.ceil(this._size/o.SIXTY_FOUR_KILOBYTES),p=0;m>p;++p){var f=[];for(var v in h)h.hasOwnProperty(v)&&(t=h[v],c._appendAttributes(f,t,p*t.vertexSizeInBytes*o.SIXTY_FOUR_KILOBYTES));f=f.concat(this._precreated),d.push({va:this._context.createVertexArray(f,e),indicesCount:1.5*(p!==m-1?o.SIXTY_FOUR_KILOBYTES:this._size%o.SIXTY_FOUR_KILOBYTES)})}}},c._appendAttributes=function(e,t,r){for(var i=t.arrayViews,n=i.length,o=0;n>o;++o){var a=i[o];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:r+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes})}},c.prototype.subCommit=function(e,t){for(var r=this._allBuffers,i=0,n=r.length;n>i;++i)l(r[i],e,t)},c.prototype.endSubCommits=function(){for(var e=this._allBuffers,t=0,r=e.length;r>t;++t)e[t].needsCommit=!1},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){for(var e=this._allBuffers,t=0,r=e.length;r>t;++t){var n=e[t];n.vertexBuffer=n.vertexBuffer&&n.vertexBuffer.destroy()}return u(this),i(this)},c}),r("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;\nif (color.a == 0.0)\n{\ndiscard;\n}\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),r("Shaders/BillboardCollectionVS",[],function(){"use strict";return"attribute vec4 positionHighAndScale;\nattribute vec4 positionLowAndRotation;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 compressedAttribute2;\nattribute vec3 eyeOffset;\nattribute vec4 scaleByDistance;\nattribute vec4 pixelOffsetScaleByDistance;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nfloat getNearFarScalar(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}\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;\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#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;\nvec2 direction;\ndirection.x = floor(compressed * SHIFT_RIGHT1);\ndirection.y = compressed - direction.x * SHIFT_LEFT1;\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;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);\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(temp));\n#else\nvec3 alignedAxis = vec3(0.0);\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;\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);\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET)\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 *= getNearFarScalar(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 = getNearFarScalar(translucencyByDistance, lengthSq);\nif (translucency == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\nfloat pixelOffsetScale = getNearFarScalar(pixelOffsetScaleByDistance, lengthSq);\npixelOffset *= pixelOffsetScale;\n#endif\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = imageSize * scale * czm_resolutionScale;\nhalfSize *= ((direction * 2.0) - 1.0);\npositionWC.xy += (origin * abs(halfSize));\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nif (!all(equal(alignedAxis, vec3(0.0))) || rotation != 0.0)\n{\nfloat angle = rotation;\nif (!all(equal(alignedAxis, vec3(0.0))))\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\npositionWC.xy += halfSize;\npositionWC.xy += translate;\npositionWC.xy += (pixelOffset * czm_resolutionScale);\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"}),r("Scene/HorizontalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,LEFT:1,RIGHT:-1};return e(t)}),r("Scene/SceneMode",["../Core/freezeObject"],function(e){"use strict";var t={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};return t.getMorphTime=function(e){return e===t.SCENE3D?1:e===t.MORPHING?void 0:0},e(t)}),r("Scene/SceneTransforms",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/Math","../Core/Matrix4","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c={},h=new i(0,0,0,1),d=new i,m=new l;c.wgs84ToWindowCoordinates=function(e,t,r){var n=c.computeActualWgs84Position(e.frameState,t,h);if(!o(n))return void 0;var a=e.camera,s=l.multiply(a.frustum.projectionMatrix,a.viewMatrix,m);return l.multiplyByVector(s,i.fromElements(n.x,n.y,n.z,1,d),d),d.z<0&&e.mode!==u.SCENE2D?void 0:(r=c.clipToGLWindowCoordinates(e,d,r),r.y=e.canvas.clientHeight-r.y,r)},c.wgs84ToDrawingBufferCoordinates=function(e,t,r){var n=c.computeActualWgs84Position(e.frameState,t,h);if(!o(n))return void 0;var a=e.camera,s=l.multiply(a.frustum.projectionMatrix,a.viewMatrix,m);return l.multiplyByVector(s,i.fromElements(n.x,n.y,n.z,1,d),d),d.z<0&&e.mode!==u.SCENE2D?void 0:c.clipToDrawingBufferCoordinates(e,d,r)};var p=new r,f=new n;c.computeActualWgs84Position=function(e,t,i){var n=e.mode;if(n===u.SCENE3D)return r.clone(t,i);var a=e.mapProjection,l=a.ellipsoid.cartesianToCartographic(t,f);if(!o(l))return void 0;if(a.project(l,p),n===u.COLUMBUS_VIEW)return r.fromElements(p.z,p.x,p.y,i);if(n===u.SCENE2D)return r.fromElements(0,p.x,p.y,i);var c=e.morphTime;return r.fromElements(s.lerp(p.z,t.x,c),s.lerp(p.x,t.y,c),s.lerp(p.y,t.z,c),i)};var v=new r,g=new r,_=new e,y=new l;return c.clipToGLWindowCoordinates=function(e,i,n){var o=e.canvas;return r.divideByScalar(i,i.w,v),_.width=o.clientWidth,_.height=o.clientHeight,l.computeViewportTransformation(_,0,1,y),l.multiplyByPoint(y,v,g),t.fromCartesian3(g,n)},c.clipToDrawingBufferCoordinates=function(e,i,n){return r.divideByScalar(i,i.w,v),_.width=e.drawingBufferWidth,_.height=e.drawingBufferHeight,l.computeViewportTransformation(_,0,1,y),l.multiplyByPoint(y,v,g),t.fromCartesian3(g,n)},c.transformWindowToDrawingBuffer=function(e,r,i){var n=e.canvas,o=e.drawingBufferWidth/n.clientWidth,a=e.drawingBufferHeight/n.clientHeight;return t.fromElements(r.x*o,r.y*a,i)},c}),r("Scene/VerticalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,BOTTOM:1,TOP:-1};return e(t)}),r("Scene/Billboard",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","../Core/NearFarScalar","./HorizontalOrigin","./SceneMode","./SceneTransforms","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";function v(e,t){var r=e._billboardCollection;s(r)&&(r._updateBillboard(e,t),e._dirty=!0)}var g=function(e,i){e=a(e,a.EMPTY_OBJECT),this._show=a(e.show,!0),this._position=r.clone(a(e.position,r.ZERO)),this._actualPosition=r.clone(this._position),this._pixelOffset=t.clone(a(e.pixelOffset,t.ZERO)),this._translate=new t(0,0),this._eyeOffset=r.clone(a(e.eyeOffset,r.ZERO)),this._verticalOrigin=a(e.verticalOrigin,f.CENTER),this._horizontalOrigin=a(e.horizontalOrigin,d.CENTER),this._scale=a(e.scale,1),this._color=n.clone(a(e.color,n.WHITE)),this._rotation=a(e.rotation,0),this._alignedAxis=r.clone(a(e.alignedAxis,r.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._pixelOffsetScaleByDistance=e.pixelOffsetScaleByDistance,this._id=e.id,this._collection=a(e.collection,i),this._pickId=void 0,this._pickPrimitive=a(e._pickPrimitive,this),this._billboardCollection=i,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 l=e.image,u=e.imageId;s(l)&&(s(u)||(u="string"==typeof l?l:s(l.src)?l.src:o()),this._imageId=u,this._image=l),s(e.imageSubRegion)&&(this._imageId=u,this._imageSubRegion=e.imageSubRegion),s(this._billboardCollection._textureAtlas)&&this._loadImage()},_=g.SHOW_INDEX=0,y=g.POSITION_INDEX=1,C=g.PIXEL_OFFSET_INDEX=2,w=g.EYE_OFFSET_INDEX=3,S=g.HORIZONTAL_ORIGIN_INDEX=4,E=g.VERTICAL_ORIGIN_INDEX=5,b=g.SCALE_INDEX=6,T=g.IMAGE_INDEX_INDEX=7,x=g.COLOR_INDEX=8,P=g.ROTATION_INDEX=9,A=g.ALIGNED_AXIS_INDEX=10,M=g.SCALE_BY_DISTANCE_INDEX=11,D=g.TRANSLUCENCY_BY_DISTANCE_INDEX=12,I=g.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13;g.NUMBER_OF_PROPERTIES=14,l(g.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,v(this,_))}},position:{get:function(){return this._position},set:function(e){var t=this._position;r.equals(t,e)||(r.clone(e,t),r.clone(e,this._actualPosition),v(this,y))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var r=this._pixelOffset;t.equals(r,e)||(t.clone(e,r),v(this,C))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;h.equals(t,e)||(this._scaleByDistance=h.clone(e,t),v(this,M))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;h.equals(t,e)||(this._translucencyByDistance=h.clone(e,t),v(this,D))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;h.equals(t,e)||(this._pixelOffsetScaleByDistance=h.clone(e,t),v(this,I))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;r.equals(t,e)||(r.clone(e,t),v(this,w))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,v(this,S))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,v(this,E))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,v(this,b))}},color:{get:function(){return this._color},set:function(e){var t=this._color;n.equals(t,e)||(n.clone(e,t),v(this,x))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,v(this,P))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;r.equals(t,e)||(r.clone(e,t),v(this,A))}},width:{get:function(){return a(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,v(this,T))}},height:{get:function(){return a(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,v(this,T))}},id:{get:function(){return this._id},set:function(e){this._id=e,s(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,s(this._pickId)&&(this._pickId.object.primitive=e)}},image:{get:function(){return this._imageId},set:function(e){s(e)?"string"==typeof e?this.setImage(e,e):s(e.src)?this.setImage(e.src,e):this.setImage(o(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,v(this,T))}},ready:{get:function(){return-1!==this._imageIndex}}}),g.prototype.getPickId=function(e){return s(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},g.prototype._loadImage=function(){var t,r=this._billboardCollection._textureAtlas,i=this._imageId,n=this._image,o=this._imageSubRegion;if(s(n)&&(t=r.addImage(i,n)),s(o)&&(t=r.addSubRegion(i,o)),this._imageIndexPromise=t,s(t)){var a=this; -t.then(function(t){if(a._imageId===i&&a._image===n&&e.equals(a._imageSubRegion,o)){var s=r.textureCoordinates[t];a._imageWidth=r.texture.width*s.width,a._imageHeight=r.texture.height*s.height,a._imageIndex=t,a._ready=!0,a._image=void 0,a._imageIndexPromise=void 0,v(a,T)}}).otherwise(function(e){console.error("Error loading image for billboard: "+e),a._imageIndexPromise=void 0})}},g.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,s(this._billboardCollection._textureAtlas)&&this._loadImage())},g.prototype.setImageSubRegion=function(t,r){this._imageId===t&&e.equals(this._imageSubRegion,r)||(this._imageIndex=-1,this._imageId=t,this._imageSubRegion=r,s(this._billboardCollection._textureAtlas)&&this._loadImage())},g.prototype._setTranslate=function(e){var r=this._translate;t.equals(r,e)||(t.clone(e,r),v(this,C))},g.prototype._getActualPosition=function(){return this._actualPosition},g.prototype._setActualPosition=function(e){r.clone(e,this._actualPosition),v(this,y)};var O=new i;g._computeActualPosition=function(e,t,r){return t.mode===m.SCENE3D?e:(c.multiplyByPoint(r,e,O),p.computeActualWgs84Position(t,O))};var R=new c,L=new i,N=new r,F=new t,B=new t;g._computeScreenSpacePosition=function(e,n,o,a,s){var l=s.camera,u=l.viewMatrix,h=l.frustum.projectionMatrix,d=c.multiplyTransformation(u,e,R),m=c.multiplyByVector(d,i.fromElements(n.x,n.y,n.z,1,L),L),f=r.multiplyComponents(o,r.normalize(m,N),N);m.x+=o.x+f.x,m.y+=o.y+f.y,m.z+=f.z;var v=c.multiplyByVector(h,m,L),g=p.clipToGLWindowCoordinates(s,v,new t);a=t.clone(a,B),a.y=-a.y;var _=t.multiplyByScalar(a,s.context.uniformState.resolutionScale,F);return g.x+=_.x,g.y+=_.y,g};var z=new t(0,0);return g.prototype.computeScreenSpacePosition=function(e){var r=this._billboardCollection;t.clone(this._pixelOffset,z),t.add(z,this._translate,z);var i=r.modelMatrix,n=g._computeScreenSpacePosition(i,this._actualPosition,this._eyeOffset,z,e);return n.y=e.canvas.clientHeight-n.y,n},g.prototype.equals=function(i){return this===i||s(i)&&this._show===i._show&&this._scale===i._scale&&this._verticalOrigin===i._verticalOrigin&&this._horizontalOrigin===i._horizontalOrigin&&this._id===i._id&&this._imageId===i._imageId&&e.equals(this._imageSubRegion,i._imageSubRegion)&&r.equals(this._position,i._position)&&n.equals(this._color,i._color)&&t.equals(this._pixelOffset,i._pixelOffset)&&t.equals(this._translate,i._translate)&&r.equals(this._eyeOffset,i._eyeOffset)&&h.equals(this._scaleByDistance,i._scaleByDistance)&&h.equals(this._translucencyByDistance,i._translucencyByDistance)&&h.equals(this._pixelOffsetScaleByDistance,i._pixelOffsetScaleByDistance)},g.prototype._destroy=function(){this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0},g}),r("Scene/BlendEquation",["../Core/freezeObject"],function(e){"use strict";var t={ADD:32774,SUBTRACT:32778,REVERSE_SUBTRACT:32779};return e(t)}),r("Scene/BlendFunction",["../Core/freezeObject"],function(e){"use strict";var t={ZERO:0,ONE:1,SOURCE_COLOR:768,ONE_MINUS_SOURCE_COLOR:769,DESTINATION_COLOR:774,ONE_MINUS_DESTINATION_COLOR:775,SOURCE_ALPHA:770,ONE_MINUS_SOURCE_ALPHA:771,DESTINATION_ALPHA:772,ONE_MINUS_DESTINATION_ALPHA:773,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,SOURCE_ALPHA_SATURATE:776};return e(t)}),r("Scene/BlendingState",["../Core/freezeObject","./BlendEquation","./BlendFunction"],function(e,t,r){"use strict";var i={DISABLED:e({enabled:!1}),ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:r.SOURCE_ALPHA,functionSourceAlpha:r.SOURCE_ALPHA,functionDestinationRgb:r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:r.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:r.ONE,functionSourceAlpha:r.ONE,functionDestinationRgb:r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:r.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:r.SOURCE_ALPHA,functionSourceAlpha:r.SOURCE_ALPHA,functionDestinationRgb:r.ONE,functionDestinationAlpha:r.ONE})};return e(i)}),r("Scene/Pass",["../Core/freezeObject"],function(e){"use strict";var t={OPAQUE:0,TRANSLUCENT:1,OVERLAY:2};return e(t)}),r("Scene/TextureAtlas",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/loadImage","../Core/PixelFormat","../Core/RuntimeError","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,r,n,o,a){this.bottomLeft=i(e,t.ZERO),this.topRight=i(r,t.ZERO),this.childNode1=n,this.childNode2=o,this.imageIndex=a}function m(e,r){var i=e.numberOfImages,o=2;if(i>0){var a=e._texture.width,s=e._texture.height,l=o*(a+r.width+e._borderWidthInPixels),u=o*(s+r.height+e._borderWidthInPixels),c=a/l,h=s/u,m=new d(new t(a+e._borderWidthInPixels,0),new t(l,s)),p=new d(new t,new t(l,s),e._root,m),f=new d(new t(0,s+e._borderWidthInPixels),new t(l,u)),v=new d(new t,new t(l,u),p,f);e._root=v;for(var g=0;gs||0>l)return void 0;if(0===s&&0===l)return r;if(s>l){r.childNode1=new d(new t(r.bottomLeft.x,r.bottomLeft.y),new t(r.bottomLeft.x+i.width,r.topRight.y));var u=r.bottomLeft.x+i.width+e._borderWidthInPixels;un;++n){var a=r[n];a&&(a._index=o++,t.push(a))}e._billboards=t}}function A(e){var t=16384,r=e.cache.billboardCollection_indexBuffer;if(s(r))return r;for(var i=6*t,n=new Uint16Array(i),o=0,a=0;i>o;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 r=e.createIndexBuffer(n,f.STATIC_DRAW,d.UNSIGNED_SHORT),r.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBuffer=r,r}function M(e,t,r){return new _(e,[{index:rt.positionHighAndScale,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[W]},{index:rt.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[W]},{index:rt.compressedAttribute0,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[G]},{index:rt.compressedAttribute1,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[$]},{index:rt.compressedAttribute2,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[Z]},{index:rt.eyeOffset,componentsPerAttribute:3,componentDatatype:o.FLOAT,usage:r[H]},{index:rt.scaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[K]},{index:rt.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[et]}],4*t)}function D(e,r,i,n,o){var a=4*o._index,s=o._getActualPosition();e._mode===T.SCENE3D&&(t.expand(e._baseVolume,s,e._baseVolume),e._boundingVolumeDirty=!0),h.fromCartesian(s,nt);var l=o.scale,u=o.rotation;0!==u&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,l);var c=n[rt.positionHighAndScale],d=nt.high;c(a+0,d.x,d.y,d.z,l),c(a+1,d.x,d.y,d.z,l),c(a+2,d.x,d.y,d.z,l),c(a+3,d.x,d.y,d.z,l);var m=n[rt.positionLowAndRotation],p=nt.low;m(a+0,p.x,p.y,p.z,u),m(a+1,p.x,p.y,p.z,u),m(a+2,p.x,p.y,p.z,u),m(a+3,p.x,p.y,p.z,u)}function I(t,r,i,n,o){var a=4*o._index,s=o.pixelOffset,l=s.x,u=s.y,c=o._translate,h=c.x,d=c.y;t._maxPixelOffset=Math.max(t._maxPixelOffset,Math.abs(l+h),Math.abs(-u+d));var p=o.horizontalOrigin,f=o.verticalOrigin,v=o.show;0===o.color.alpha&&(v=!1),t._allHorizontalCenter=t._allHorizontalCenter&&p===E.CENTER;var g=0,_=0,y=0,C=0,w=o._imageIndex;if(-1!==w){var S=i[w];g=S.x,_=S.y,y=S.width,C=S.height}var b=g+y,T=_+C,x=Math.floor(m.clamp(l,-at,at)+at)*ut;x+=(p+1)*ct,x+=(f+1)*ht,x+=(v?1:0)*dt;var P=Math.floor(m.clamp(u,-at,at)+at)*lt,A=Math.floor(m.clamp(h,-at,at)+at)*lt,M=(m.clamp(d,-at,at)+at)*mt,D=Math.floor(M),I=Math.floor((M-D)*lt);P+=D,A+=I,ot.x=g,ot.y=_;var O=e.compressTextureCoordinates(ot);ot.x=b;var R=e.compressTextureCoordinates(ot);ot.y=T;var L=e.compressTextureCoordinates(ot);ot.x=g;var N=e.compressTextureCoordinates(ot),F=n[rt.compressedAttribute0];F(a+0,x+pt,P,A,O),F(a+1,x+ft,P,A,R),F(a+2,x+vt,P,A,L),F(a+3,x+gt,P,A,N)}function O(t,r,n,o,l){var u=4*l._index,c=l.alignedAxis;i.equals(c,i.ZERO)||(t._shaderAlignedAxis=!0);var h=0,d=1,p=1,f=1,v=l.translucencyByDistance;s(v)&&(h=v.near,d=v.nearValue,p=v.far,f=v.farValue,(1!==d||1!==f)&&(t._shaderTranslucencyByDistance=!0));var g=0,_=l._imageIndex;if(-1!==_){var y=n[_];g=y.width}var C=t._textureAtlas.texture.width,w=Math.ceil(.5*a(l.width,C*g));t._maxSize=Math.max(t._maxSize,w);var S=m.clamp(w,0,st),E=0;Math.abs(i.magnitudeSquared(c)-1)c;++c){var h=r[c],d=h.position,m=w._computeActualPosition(d,n,o);s(m)&&(h._setActualPosition(m),a?u.push(m):t.expand(l,m,l))}a&&t.fromPoints(u,l)}function V(e,t){var r=t.mode,i=e._billboards,n=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==r||r!==T.SCENE3D&&!p.equals(o,e.modelMatrix)?(e._mode=r,p.clone(e.modelMatrix,o),e._createVertexArray=!0,(r===T.SCENE3D||r===T.SCENE2D||r===T.COLUMBUS_VIEW)&&z(e,i,i.length,t,o,!0)):r===T.MORPHING?z(e,i,i.length,t,o,!0):(r===T.SCENE2D||r===T.COLUMBUS_VIEW)&&z(e,n,e._billboardsToUpdateIndex,t,o,!1)}function k(e,t,r,n){var o=r.camera,a=o.frustum,s=i.subtract(o.positionWC,n.center,yt),l=i.multiplyByScalar(o.directionWC,i.dot(s,o.directionWC),Ct),u=Math.max(0,i.magnitude(l)-n.radius);_t.x=t.drawingBufferWidth,_t.y=t.drawingBufferHeight;var c=a.getPixelSize(_t,u),h=Math.max(c.x,c.y),d=2*h*e._maxScale*e._maxSize;e._allHorizontalCenter&&(d*=.5);var m=h*e._maxPixelOffset+e._maxEyeOffset;n.radius+=d+m}var U=w.SHOW_INDEX,W=w.POSITION_INDEX,G=w.PIXEL_OFFSET_INDEX,H=w.EYE_OFFSET_INDEX,q=w.HORIZONTAL_ORIGIN_INDEX,j=w.VERTICAL_ORIGIN_INDEX,Y=w.SCALE_INDEX,X=w.IMAGE_INDEX_INDEX,Z=w.COLOR_INDEX,Q=w.ROTATION_INDEX,J=w.ALIGNED_AXIS_INDEX,K=w.SCALE_BY_DISTANCE_INDEX,$=w.TRANSLUCENCY_BY_DISTANCE_INDEX,et=w.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,tt=w.NUMBER_OF_PROPERTIES,rt={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7},it=function(e){e=a(e,a.EMPTY_OBJECT),this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._rs=void 0,this._vaf=void 0,this._spPick=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._propertiesChanged=new Uint32Array(tt),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!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=p.clone(a(e.modelMatrix,p.IDENTITY)),this._modelMatrix=p.clone(p.IDENTITY),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this._mode=T.SCENE3D,this._buffersUsage=[f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW,f.STATIC_DRAW];var r=this;this._uniforms={u_atlas:function(){return r._textureAtlas.texture}}};l(it.prototype,{length:{get:function(){return P(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}}}),it.prototype.add=function(e){var t=new w(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},it.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},it.prototype.removeAll=function(){this._destroyBillboards(),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},it.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},it.prototype.contains=function(e){return s(e)&&e._billboardCollection===this},it.prototype.get=function(e){return P(this),this._billboards[e]},it.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,r=this._propertiesChanged,i=0;tt>i;++i){var n=0===r[i]?f.STATIC_DRAW:f.STREAM_DRAW;t=t||e[i]!==n,e[i]=n}return t};var nt=new h,ot=new r,at=32768,st=65536,lt=256,ut=128,ct=32,ht=8,dt=4,mt=1/256,pt=0,ft=2,vt=3,gt=1,_t=new r,yt=new i,Ct=new i;return it.prototype.update=function(e,r,i){var n=this._billboards,o=n.length,a=this._textureAtlas;if(!s(a)){a=this._textureAtlas=new x({context:e});for(var l=0;o>l;++l)n[l]._loadImage()}var u=a.textureCoordinates;if(0!==u.length){P(this),V(this,r),n=this._billboards,o=n.length;var c=this._billboardsToUpdate,h=this._billboardsToUpdateIndex,d=this._propertiesChanged,m=a.guid,f=this._createVertexArray||this._textureAtlasGUID!==m;this._textureAtlasGUID=m;var _,w=r.passes,E=w.pick;if(f||!E&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var z=0;tt>z;++z)d[z]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),o>0){this._vaf=M(e,o,this._buffersUsage),_=this._vaf.writers;for(var it=0;o>it;++it){var nt=this._billboards[it];nt._dirty=!1,B(this,e,u,_,nt)}this._vaf.commit(A(e))}this._billboardsToUpdateIndex=0}else if(h>0){var ot=[];if((d[W]||d[Q]||d[Y])&&ot.push(D),(d[X]||d[G]||d[q]||d[j]||d[U])&&ot.push(I),(d[X]||d[J]||d[$])&&ot.push(O),(d[X]||d[Z])&&ot.push(R),d[H]&&ot.push(L),d[K]&&ot.push(N),d[et]&&ot.push(F),_=this._vaf.writers,h/o>.1){for(var at=0;h>at;++at){var st=c[at];st._dirty=!1;for(var lt=0;ltut;++ut){var ct=c[ut];ct._dirty=!1;for(var ht=0;ht1.5*o&&(c.length=o),s(this._vaf)&&s(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,t.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var dt,mt=p.IDENTITY;r.mode===T.SCENE3D?(mt=this.modelMatrix,dt=t.clone(this._baseVolumeWC,this._boundingVolume)):dt=t.clone(this._baseVolume2D,this._boundingVolume),k(this,e,r,dt);var pt,ft,vt,gt,_t,yt;if(w.render){var Ct=this._colorCommands;for(s(this._rs)||(this._rs=e.createRenderState({depthTest:{enabled:!0},blending:S.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)&&(_t=new g({sources:[C]}),this._shaderRotation&&_t.defines.push("ROTATION"),this._shaderAlignedAxis&&_t.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&_t.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&_t.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&_t.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._sp=e.replaceShaderProgram(this._sp,_t,y,rt),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance),pt=this._vaf.va,ft=pt.length,Ct.length=ft,gt=0;ft>gt;++gt)vt=Ct[gt],s(vt)||(vt=Ct[gt]=new v({pass:b.OPAQUE,owner:this})),vt.boundingVolume=dt,vt.modelMatrix=mt,vt.count=pt[gt].indicesCount,vt.shaderProgram=this._sp,vt.uniformMap=this._uniforms,vt.vertexArray=pt[gt].va,vt.renderState=this._rs,vt.debugShowBoundingVolume=this.debugShowBoundingVolume,i.push(vt)}if(E){var wt=this._pickCommands;for((!s(this._spPick)||this._shaderRotation&&!this._compiledShaderRotationPick||this._shaderAlignedAxis&&!this._compiledShaderAlignedAxisPick||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistancePick||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistancePick||this._shaderPixelOffsetScaleByDistance&&!this._compiledShaderPixelOffsetScaleByDistancePick)&&(_t=new g({defines:["RENDER_FOR_PICK"],sources:[C]}),this._shaderRotation&&_t.defines.push("ROTATION"),this._shaderAlignedAxis&&_t.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&_t.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&_t.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&_t.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),yt=new g({defines:["RENDER_FOR_PICK"],sources:[y]}),this._spPick=e.replaceShaderProgram(this._spPick,_t,yt,rt),this._compiledShaderRotationPick=this._shaderRotation,this._compiledShaderAlignedAxisPick=this._shaderAlignedAxis,this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistancePick=this._shaderPixelOffsetScaleByDistance),pt=this._vaf.va,ft=pt.length,wt.length=ft,gt=0;ft>gt;++gt)vt=wt[gt],s(vt)||(vt=wt[gt]=new v({pass:b.OPAQUE,owner:this})),vt.boundingVolume=dt,vt.modelMatrix=mt,vt.count=pt[gt].indicesCount,vt.shaderProgram=this._spPick,vt.uniformMap=this._uniforms,vt.vertexArray=pt[gt].va,vt.renderState=this._rs,i.push(vt)}}}},it.prototype.isDestroyed=function(){return!1},it.prototype.destroy=function(){return this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),this._destroyBillboards(),u(this)},it.prototype._destroyBillboards=function(){for(var e=this._billboards,t=e.length,r=0;t>r;++r)e[r]&&e[r]._destroy()},it}),r("DataSources/Property",["../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,r){"use strict";var i=function(){r.throwInstantiationError()};return t(i.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError}}),i.prototype.getValue=r.throwInstantiationError,i.prototype.equals=r.throwInstantiationError,i.equals=function(t,r){return t===r||e(t)&&t.equals(r)},i.arrayEquals=function(t,r){if(t===r)return!0;if(!e(t)||!e(r)||t.length!==r.length)return!1;for(var n=t.length,o=0;n>o;o++)if(!i.equals(t[o],r[o]))return!1;return!0},i.isConstant=function(t){return!e(t)||t.isConstant},i.getValueOrUndefined=function(t,r,i){return e(t)?t.getValue(r,i):void 0},i.getValueOrDefault=function(t,r,i,n){var o;return e(t)&&(o=t.getValue(r,n)),e(o)||(o=i),o},i.getValueOrClonedDefault=function(t,r,i,n){var o;return e(t)&&(o=t.getValue(r,n)),e(o)||(o=i.clone(o)),o},i}),r("DataSources/BillboardVisualizer",["../Core/AssociativeArray","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/NearFarScalar","../Scene/BillboardCollection","../Scene/HorizontalOrigin","../Scene/VerticalOrigin","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,t){if(n(e)){var r=e.billboard;n(r)&&(e.billboard=void 0,r.show=!1,r.image=void 0,t.push(r._index))}}var m=i.WHITE,p=r.ZERO,f=t.ZERO,v=1,g=0,_=r.ZERO,y=u.CENTER,C=c.CENTER,w=new r,S=new i,E=new r,b=new t,T=new s,x=new s,P=new s,A=function(e){this.entity=e,this.billboard=void 0},M=function(t,r,i){r.collectionChanged.addEventListener(M.prototype._onCollectionChanged,this),this._primitiveCollection=t,this._unusedIndexes=[],this._billboardCollection=void 0,this._entityCollection=r,this._items=new e,this._propertyName=n(i)?i:"_billboard",this._onCollectionChanged(r,r.entities,[],[])};return M.prototype.update=function(e){for(var t=this._items.values,r=this._unusedIndexes,i=this._propertyName,o=0,a=t.length;a>o;o++){var s,u=t[o],c=u.entity,A=c[i],M=u.billboard,D=c.isAvailable(e)&&h.getValueOrDefault(A._show,e,!0);if(D&&(w=h.getValueOrUndefined(c._position,e,w),s=h.getValueOrUndefined(A._image,e),D=n(w)&&n(s)),D){if(!n(M)){var I=this._billboardCollection;n(I)||(I=new l,this._billboardCollection=I,this._primitiveCollection.add(I));var O=r.length;M=O>0?I.get(r.pop()):I.add(),M.id=c,M.image=void 0,u.billboard=M}M.show=D,M.image=s,M.position=w,M.color=h.getValueOrDefault(A._color,e,m,S),M.eyeOffset=h.getValueOrDefault(A._eyeOffset,e,p,E),M.pixelOffset=h.getValueOrDefault(A._pixelOffset,e,f,b),M.scale=h.getValueOrDefault(A._scale,e,v),M.rotation=h.getValueOrDefault(A._rotation,e,g),M.alignedAxis=h.getValueOrDefault(A._alignedAxis,e,_),M.horizontalOrigin=h.getValueOrDefault(A._horizontalOrigin,e,y),M.verticalOrigin=h.getValueOrDefault(A._verticalOrigin,e,C),M.width=h.getValueOrUndefined(A._width,e),M.height=h.getValueOrUndefined(A._height,e),M.scaleByDistance=h.getValueOrUndefined(A._scaleByDistance,e,T),M.translucencyByDistance=h.getValueOrUndefined(A._translucencyByDistance,e,x),M.pixelOffsetScaleByDistance=h.getValueOrUndefined(A._pixelOffsetScaleByDistance,e,P)}else d(u,r)}return!0},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){return this._entityCollection.collectionChanged.removeEventListener(M.prototype._onCollectionChanged,this),n(this._billboardCollection)&&this._primitiveCollection.remove(this._billboardCollection),o(this)},M.prototype._onCollectionChanged=function(e,t,r,i){var o,a,s=this._unusedIndexes,l=this._items,u=this._propertyName;for(o=t.length-1;o>-1;o--)a=t[o],n(a[u])&&n(a._position)&&l.set(a.id,new A(a));for(o=i.length-1;o>-1;o--)a=i[o],n(a[u])&&n(a._position)?l.contains(a.id)||l.set(a.id,new A(a)):(d(l.get(a.id),s),l.remove(a.id));for(o=r.length-1;o>-1;o--)a=r[o],d(l.get(a.id),s),l.remove(a.id)},M}),r("DataSources/ConstantProperty",["../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/isArray"],function(e,t,r,i){"use strict";var n=function(e){this._value=void 0,this._simple=!0,this._definitionChanged=new r,this.setValue(e)};return e(n.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),n.prototype.getValue=function(e,t){return this._simple?this._value:this._value.clone(t)},n.prototype.setValue=function(e){var t=this._value,r=this._simple;(r&&t!==e||!r&&!t.equals(e))&&(r="object"!=typeof e||i(e),this._value=r?e:e.clone(),this._simple=r,this._definitionChanged.raiseEvent(this))},n.prototype.equals=function(e){return this===e||e instanceof n&&(this._simple&&this._value===e._value||!this._simple&&this._value.equals(e._value))},n}),r("DataSources/ColorMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./ConstantProperty","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(e){this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=e};return l.fromColor=function(e){return new l(new o(e))},r(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color")}),l.prototype.getType=function(){return"Color"},l.prototype.getValue=function(r,i){return t(i)||(i={}),i.color=s.getValueOrClonedDefault(this._color,r,e.WHITE,i.color),i},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._color,e._color)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),r("DataSources/Entity",["../Core/Cartesian3","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Transforms","./Property","./createPropertyDescriptor"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";var m=function(e){i(e)||(e=t()),this._availability=void 0,this._id=e,this._definitionChanged=new a,this._name=void 0,this._parent=void 0,this._propertyNames=["billboard","description","ellipse","ellipsoid","label","model","orientation","path","point","polygon","polyline","position","rectangle","viewFrom","wall"],this._billboard=void 0,this._billboardSubscription=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._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};n(m.prototype,{availability:d("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:{configurable:!1,get:function(){return this._name},set:function(e){var t=this._name;t!==e&&(this._name=e,this._definitionChanged.raiseEvent(this,"name",e,t))}},parent:d("parent"),propertyNames:{get:function(){return this._propertyNames}},billboard:d("billboard"),description:d("description"),ellipse:d("ellipse"),ellipsoid:d("ellipsoid"),label:d("label"),model:d("model"),orientation:d("orientation"),path:d("path"),point:d("point"),polygon:d("polygon"),polyline:d("polyline"),position:d("position"),rectangle:d("rectangle"),viewFrom:d("viewFrom"),wall:d("wall")}),m.prototype.isAvailable=function(e){var t=this._availability; -return!i(t)||t.contains(e)},m.prototype.addProperty=function(e){var t=this._propertyNames;t.push(e),Object.defineProperty(this,e,d(e,!0))},m.prototype.removeProperty=function(e){this._propertyNames;var t=this._propertyNames.indexOf(e);t>-1&&this._propertyNames.splice(t,1),delete this[e]},m.prototype.merge=function(e){this.name=r(this.name,e.name),this.availability=r(e.availability,this.availability);for(var t=this._propertyNames,n=e._propertyNames,o=n.length,a=0;o>a;a++){var s=n[a],l=this[s],u=e[s];i(l)||-1!==t.indexOf(s)||this.addProperty(s),i(u)&&(i(l)?i(l.merge)&&l.merge(u):this[s]=i(u.merge)&&i(u.clone)?u.clone():u)}};var p=new s,f=new e,v=new u;return m.prototype._getModelMatrix=function(e,t){var r=h.getValueOrUndefined(this._position,e,f);if(!i(r))return void 0;var n=h.getValueOrUndefined(this._orientation,e,v);return t=i(n)?l.fromRotationTranslation(s.fromQuaternion(n,p),r,t):c.eastNorthUpToFixedFrame(r,void 0,t)},m}),r("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,r,i,n,o,a,s,l,u,c){"use strict";function h(e){if(0===e._suspendCount){var t=e._addedEntities,r=e._removedEntities,i=e._changedEntities;(0!==i.length||0!==t.length||0!==r.length)&&(e._collectionChanged.raiseEvent(e,t.values,r.values,i.values),t.removeAll(),r.removeAll(),i.removeAll())}}var d=function(){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()};return d.prototype.suspendEvents=function(){this._suspendCount++},d.prototype.resumeEvents=function(){this._suspendCount--,h(this)},d.collectionChangedEventCallback=void 0,i(d.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},entities:{get:function(){return this._entities.values}}}),d.prototype.computeAvailability=function(){for(var e=a.MAXIMUM_VALUE,t=a.MINIMUM_VALUE,i=this._entities.values,n=0,o=i.length;o>n;n++){var l=i[n],c=l.availability;if(r(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){var t=e.id,r=this._entities;if(r.contains(t))throw new l("An entity with id "+t+" already exists in this collection.");r.set(t,e),this._removedEntities,this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(d.prototype._onEntityDefinitionChanged,this),h(this)},d.prototype.remove=function(e){return this.removeById(e.id)},d.prototype.removeById=function(e){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):!1},d.prototype.removeAll=function(){for(var e=this._entities,t=e.length,i=e.values,n=this._addedEntities,o=this._removedEntities,a=0;t>a;a++){var s=i[a],l=s.id,u=n.get(l);r(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 r(t)||(t=new c(e),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}),r("DataSources/CompositeEntityCollection",["../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Math","./Entity","./EntityCollection"],function(e,t,r,i,n,o,a){"use strict";function s(e){for(var t=e.propertyNames,r=t.length,i=0;r>i;i++)e[t[i]]=void 0}function l(e,t,r,i){m[0]=r,m[1]=i.id,t[JSON.stringify(m)]=i.definitionChanged.addEventListener(p.prototype._onDefinitionChanged,e)}function u(e,t,r,i){m[0]=r,m[1]=i.id;var n=JSON.stringify(m);t[n](),t[n]=void 0}function c(e){if(e._shouldRecomposite=!0,0===e._suspendCount){var r,i,n,c,h,d,m=e._collections,f=m.length,v=e._collectionsCopy,g=v.length,_=e._composite,y=new a,C=e._eventHash;for(r=0;g>r;r++)for(h=v[r],h.collectionChanged.removeEventListener(p.prototype._onCollectionChanged,e),n=h.entities,d=h.id,c=n.length-1;c>-1;c--)i=n[c],u(e,C,d,i);for(r=f-1;r>=0;r--)for(h=m[r],h.collectionChanged.addEventListener(p.prototype._onCollectionChanged,e),n=h.entities,d=h.id,c=n.length-1;c>-1;c--){i=n[c],l(e,C,d,i);var w=y.getById(i.id);t(w)||(w=_.getById(i.id),t(w)?s(w):w=new o(i.id),y.add(w)),w.merge(i)}e._collectionsCopy=m.slice(0),_.suspendEvents(),_.removeAll();var S=y.entities;for(r=0;rh;h++){var _=i[h];u(this,v,g,_);var y=_.id;for(d=a-1;d>=0;d--)m=n[d].getById(y),t(m)&&(t(p)||(p=c.getById(y),s(p)),p.merge(m));t(p)||c.removeById(y),p=void 0}var C=r.length;for(h=0;C>h;h++){var w=r[h];l(this,v,g,w);var S=w.id;for(d=a-1;d>=0;d--)m=n[d].getById(S),t(m)&&(t(p)||(p=c.getById(S),t(p)?s(p):(p=new o(S),c.add(p))),p.merge(m));p=void 0}c.resumeEvents()},p.prototype._onDefinitionChanged=function(e,r){for(var i=this._collections,n=this._composite,o=i.length,a=e.id,s=n.getById(a),l=s[r],u=!t(l),c=!0,h=o-1;h>=0;h--){var d=i[h].getById(e.id);if(t(d)){var m=d[r];if(t(m)){if(c){if(c=!1,!t(m.merge)||!t(m.clone)){l=m;break}l=m.clone(l)}l.merge(m)}}}u&&-1===s.propertyNames.indexOf(r)&&s.addProperty(r),s[r]=l},p}),r("DataSources/CompositeProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/TimeIntervalCollection","./Property"],function(e,t,r,i,n,o,a){"use strict";function s(t,r,i,n){var o=function(){i.raiseEvent(t)},a=[];r.removeAll();for(var s=n.length,l=0;s>l;l++){var u=n.get(l);e(u.data)&&-1===a.indexOf(u.data)&&r.add(u.data.definitionChanged,o)}}var l=function(){this._eventHelper=new n,this._definitionChanged=new i,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,r){var i=this._intervals.findDataForIntervalContainingDate(t);return e(i)?i.getValue(t,r):void 0},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}),r("DataSources/CompositeMaterialProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./CompositeProperty","./Property"],function(e,t,r,i,n,o){"use strict";var a=function(){this._definitionChanged=new i,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 r=this._composite._intervals.findDataForIntervalContainingDate(t);return e(r)?r.getType(t):void 0},a.prototype.getValue=function(t,r){var i=this._composite._intervals.findDataForIntervalContainingDate(t);return e(i)?i.getValue(t,r):void 0},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}),r("DataSources/CompositePositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./CompositeProperty","./Property"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(t){this._referenceFrame=e(t,o.FIXED),this._definitionChanged=new n,this._composite=new a,this._composite.definitionChanged.addEventListener(l.prototype._raiseDefinitionChanged,this)};return r(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,r,i){var n=this._composite._intervals.findDataForIntervalContainingDate(e);return t(n)?n.getValueInReferenceFrame(e,r,i):void 0},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}),r("DataSources/PositionProperty",["../Core/Cartesian3","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix3","../Core/ReferenceFrame","../Core/Transforms"],function(e,t,r,i,n,o,a){"use strict";var s=function(){i.throwInstantiationError()};r(s.prototype,{isConstant:{get:i.throwInstantiationError},definitionChanged:{get:i.throwInstantiationError},referenceFrame:{get:i.throwInstantiationError}}),s.prototype.getValue=i.throwInstantiationError,s.prototype.getValueInReferenceFrame=i.throwInstantiationError,s.prototype.equals=i.throwInstantiationError;var l=new n;return s.convertToReferenceFrame=function(r,i,s,u,c){if(!t(i))return i;if(t(c)||(c=new e),s===u)return e.clone(i,c);var h=a.computeIcrfToFixedMatrix(r,l);return t(h)||(h=a.computeTemeToPseudoFixedMatrix(r,l)),s===o.INERTIAL?n.multiplyByVector(h,i,c):s===o.FIXED?n.multiplyByVector(n.transpose(h,l),i,c):void 0},s}),r("DataSources/ConstantPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(r,i){this._definitionChanged=new o,this._value=e.clone(r),this._referenceFrame=t(i,a.FIXED)};return i(l.prototype,{isConstant:{get:function(){return!r(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,i){var n=!1;e.equals(this._value,t)||(n=!0,this._value=e.clone(t)),r(i)&&this._referenceFrame!==i&&(n=!0,this._referenceFrame=i),n&&this._definitionChanged.raiseEvent(this)},l.prototype.getValueInReferenceFrame=function(e,t,r){return s.convertToReferenceFrame(e,this._value,this._referenceFrame,t,r)},l.prototype.equals=function(t){return this===t||t instanceof l&&e.equals(this._value,t._value)&&this._referenceFrame===t._referenceFrame},l}),r("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;\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(v_normalEC, vec3(0.0, 0.0, 1.0), -v_normalEC));\n#else\nnormalEC = normalize(v_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"}),r("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;\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"}),r("Shaders/Appearances/BasicMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC;\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(v_normalEC, vec3(0.0, 0.0, 1.0), -v_normalEC));\n#else\nnormalEC = normalize(v_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"}),r("Shaders/Appearances/BasicMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\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"}),r("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;\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(v_normalEC, vec3(0.0, 0.0, 1.0), -v_normalEC));\n#else\nnormalEC = normalize(v_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"}),r("Shaders/Appearances/TexturedMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\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"}),r("Scene/CullFace",["../Core/freezeObject"],function(e){"use strict";var t={FRONT:1028,BACK:1029,FRONT_AND_BACK:1032};return e(t)}),r("Scene/Appearance",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","./BlendingState","./CullFace"],function(e,t,r,i,n,o){"use strict";var a=function(e){e=t(e,t.EMPTY_OBJECT),this.material=e.material,this.translucent=t(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=t(e.closed,!1)};return i(a.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}}}),a.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")},a.prototype.isTranslucent=function(){return r(this.material)&&this.material.isTranslucent()||!r(this.material)&&this.translucent},a.prototype.getRenderState=function(){var t=this.isTranslucent(),r=e(this.renderState,!1);return t?(r.depthMask=!1,r.blending=n.ALPHA_BLEND):r.depthMask=!0,r},a.getDefaultRenderState=function(e,t){var r={depthTest:{enabled:!0}};return e&&(r.depthMask=!1,r.blending=n.ALPHA_BLEND),t&&(r.cull={enabled:!0,face:o.BACK}),r},a}),r("Renderer/PixelDatatype",["../Core/freezeObject"],function(e){"use strict";var t={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126,UNSIGNED_INT_24_8_WEBGL:34042,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,validate:function(e){return e===t.UNSIGNED_BYTE||e===t.UNSIGNED_SHORT||e===t.UNSIGNED_INT||e===t.FLOAT||e===t.UNSIGNED_INT_24_8_WEBGL||e===t.UNSIGNED_SHORT_4_4_4_4||e===t.UNSIGNED_SHORT_5_5_5_1||e===t.UNSIGNED_SHORT_5_6_5}};return e(t)}),r("Renderer/CubeMapFace",["../Core/defaultValue","../Core/defineProperties","../Core/DeveloperError","./PixelDatatype"],function(e,t){"use strict";var r=function(e,t,r,i,n,o,a,s,l){this._gl=e,this._texture=t,this._textureTarget=r,this._targetFace=i,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l};return t(r.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),r.prototype.copyFrom=function(t,r,i){r=e(r,0),i=e(i,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,r,i,t.width,t.height,this._pixelFormat,this._pixelDatatype,t.arrayBufferView):n.texSubImage2D(this._targetFace,0,r,i,this._pixelFormat,this._pixelDatatype,t),n.bindTexture(o,null)},r.prototype.copyFromFramebuffer=function(t,r,i,n,o,a){t=e(t,0),r=e(r,0),i=e(i,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,r,i,n,o,a),s.bindTexture(l,null)},r}),r("Renderer/MipmapHint",["../Core/freezeObject"],function(e){"use strict";var t={DONT_CARE:4352,FASTEST:4353,NICEST:4354,validate:function(e){return e===t.DONT_CARE||e===t.FASTEST||e===t.NICEST}};return e(t)}),r("Renderer/TextureMagnificationFilter",["../Core/freezeObject"],function(e){"use strict";var t={NEAREST:9728,LINEAR:9729,validate:function(e){return e===t.NEAREST||e===t.LINEAR}};return e(t)}),r("Renderer/TextureMinificationFilter",["../Core/freezeObject"],function(e){"use strict";var t={NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,validate:function(e){return e===t.NEAREST||e===t.LINEAR||e===t.NEAREST_MIPMAP_NEAREST||e===t.LINEAR_MIPMAP_NEAREST||e===t.NEAREST_MIPMAP_LINEAR||e===t.LINEAR_MIPMAP_LINEAR}};return e(t)}),r("Renderer/TextureWrap",["../Core/freezeObject"],function(e){"use strict";var t={CLAMP_TO_EDGE:33071,REPEAT:10497,MIRRORED_REPEAT:33648,validate:function(e){return e===t.CLAMP_TO_EDGE||e===t.REPEAT||e===t.MIRRORED_REPEAT}};return e(t)}),r("Renderer/CubeMap",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./CubeMapFace","./MipmapHint","./PixelDatatype","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";var d=function(e,t,r,i,n,o,s,l,u){this._gl=e,this._textureFilterAnisotropic=t,this._textureTarget=r,this._texture=i,this._pixelFormat=n,this._pixelDatatype=o,this._size=s,this._preMultiplyAlpha=l,this._flipY=u,this._sampler=void 0,this._positiveX=new a(e,i,r,e.TEXTURE_CUBE_MAP_POSITIVE_X,n,o,s,l,u),this._negativeX=new a(e,i,r,e.TEXTURE_CUBE_MAP_NEGATIVE_X,n,o,s,l,u),this._positiveY=new a(e,i,r,e.TEXTURE_CUBE_MAP_POSITIVE_Y,n,o,s,l,u),this._negativeY=new a(e,i,r,e.TEXTURE_CUBE_MAP_NEGATIVE_Y,n,o,s,l,u),this._positiveZ=new a(e,i,r,e.TEXTURE_CUBE_MAP_POSITIVE_Z,n,o,s,l,u),this._negativeZ=new a(e,i,r,e.TEXTURE_CUBE_MAP_NEGATIVE_Z,n,o,s,l,u),this.sampler=void 0};return r(d.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 r=!0;if(!t(e)){r=!1;var i=c.LINEAR,o=u.LINEAR;this._pixelDatatype===l.FLOAT&&(i=c.NEAREST,o=u.NEAREST),e={wrapS:h.CLAMP_TO_EDGE,wrapT:h.CLAMP_TO_EDGE,minificationFilter:i,magnificationFilter:o,maximumAnisotropy:1}}if(this._pixelDatatype===l.FLOAT){if(e.minificationFilter!==c.NEAREST&&e.minificationFilter!==c.NEAREST_MIPMAP_NEAREST)throw new n("Only NEAREST and NEAREST_MIPMAP_NEAREST minification filters are supported for floating point textures.");if(e.magnificationFilter!==u.NEAREST)throw new n("Only the NEAREST magnification filter is supported for floating point textures.")}var a=this._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.texParameteri(s,a.TEXTURE_MIN_FILTER,e.minificationFilter),a.texParameteri(s,a.TEXTURE_MAG_FILTER,e.magnificationFilter),a.texParameteri(s,a.TEXTURE_WRAP_S,e.wrapS),a.texParameteri(s,a.TEXTURE_WRAP_T,e.wrapT),t(this._textureFilterAnisotropic)&&a.texParameteri(s,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),a.bindTexture(s,null),this._sampler=r?{wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy}:void 0}},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}}}),d.prototype.generateMipmap=function(t){t=e(t,s.DONT_CARE);var r=this._gl,i=this._textureTarget;r.hint(r.GENERATE_MIPMAP_HINT,t),r.activeTexture(r.TEXTURE0),r.bindTexture(i,this._texture),r.generateMipmap(i),r.bindTexture(i,null)},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),this._positiveX=i(this._positiveX),this._negativeX=i(this._negativeX),this._positiveY=i(this._positiveY),this._negativeY=i(this._negativeY),this._positiveZ=i(this._positiveZ),this._negativeZ=i(this._negativeZ),i(this)},d}),r("Renderer/Texture",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","./MipmapHint","./PixelDatatype","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";var m=function(i,n){n=t(n,t.EMPTY_OBJECT);var a=n.source,l=r(a)?a.width:n.width,c=r(a)?a.height:n.height,h=t(n.pixelFormat,s.RGBA),d=t(n.pixelDatatype,u.UNSIGNED_BYTE);if(d===u.FLOAT&&!i.floatingPointTexture)throw new o("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(s.isDepthFormat(h)&&!i.depthTexture)throw new o("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.");var m=n.preMultiplyAlpha||h===s.RGB||h===s.LUMINANCE,p=t(n.flipY,!0),f=i._gl,v=f.TEXTURE_2D,g=f.createTexture();f.activeTexture(f.TEXTURE0),f.bindTexture(v,g),r(a)?(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,m),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,p),r(a.arrayBufferView)?f.texImage2D(v,0,h,l,c,0,h,d,a.arrayBufferView):r(a.framebuffer)?(a.framebuffer!==i.defaultFramebuffer&&a.framebuffer._bind(),f.copyTexImage2D(v,0,h,a.xOffset,a.yOffset,l,c,0),a.framebuffer!==i.defaultFramebuffer&&a.framebuffer._unBind()):f.texImage2D(v,0,h,h,d,a)):f.texImage2D(v,0,h,l,c,0,h,d,null),f.bindTexture(v,null),this._context=i,this._textureFilterAnisotropic=i._textureFilterAnisotropic,this._textureTarget=v,this._texture=g,this._pixelFormat=h,this._pixelDatatype=d,this._width=l,this._height=c,this._dimensions=new e(l,c),this._preMultiplyAlpha=m,this._flipY=p,this._sampler=void 0,this.sampler=void 0};return i(m.prototype,{sampler:{get:function(){return this._sampler},set:function(e){var t=!0;if(!r(e)){t=!1;var i=h.LINEAR,n=c.LINEAR;this._pixelDatatype===u.FLOAT&&(i=h.NEAREST,n=c.NEAREST),e={wrapS:d.CLAMP_TO_EDGE,wrapT:d.CLAMP_TO_EDGE,minificationFilter:i,magnificationFilter:n,maximumAnisotropy:1}}if(this._pixelDatatype===u.FLOAT){if(e.minificationFilter!==h.NEAREST&&e.minificationFilter!==h.NEAREST_MIPMAP_NEAREST)throw new o("Only NEAREST and NEAREST_MIPMAP_NEAREST minification filters are supported for floating point textures.");if(e.magnificationFilter!==c.NEAREST)throw new o("Only the NEAREST magnification filter is supported for floating point textures.")}var a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.texParameteri(s,a.TEXTURE_MIN_FILTER,e.minificationFilter),a.texParameteri(s,a.TEXTURE_MAG_FILTER,e.magnificationFilter),a.texParameteri(s,a.TEXTURE_WRAP_S,e.wrapS),a.texParameteri(s,a.TEXTURE_WRAP_T,e.wrapT),r(this._textureFilterAnisotropic)&&a.texParameteri(s,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),a.bindTexture(s,null),this._sampler=t?{wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy}:void 0}},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}}}),m.prototype.copyFrom=function(e,r,i){r=t(r,0),i=t(i,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,r,i,e.width,e.height,this._pixelFormat,this._pixelDatatype,e.arrayBufferView):n.texSubImage2D(o,0,r,i,this._pixelFormat,this._pixelDatatype,e),n.bindTexture(o,null)},m.prototype.copyFromFramebuffer=function(e,r,i,n,o,a){e=t(e,0),r=t(r,0),i=t(i,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,r,i,n,o,a),s.bindTexture(l,null)},m.prototype.generateMipmap=function(e){e=t(e,l.DONT_CARE);var r=this._context._gl,i=this._textureTarget;r.hint(r.GENERATE_MIPMAP_HINT,e),r.activeTexture(r.TEXTURE0),r.bindTexture(i,this._texture),r.generateMipmap(i),r.bindTexture(i,null)},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),n(this)},m}),r("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"}),r("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" -}),r("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"}),r("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"}),r("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"}),r("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"}),r("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"}),r("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"}),r("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"}),r("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"}),r("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"}),r("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"}),r("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,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S,E,b,T,x,P,A,M){"use strict";function D(e,r){e=o(e,o.EMPTY_OBJECT),r._strict=o(e.strict,!1),r._count=o(e.count,0),r._template=t(o(e.fabric,o.EMPTY_OBJECT)),r._template.uniforms=t(o(r._template.uniforms,o.EMPTY_OBJECT)),r._template.materials=t(o(r._template.materials,o.EMPTY_OBJECT)),r.type=a(r._template.type)?r._template.type:n(),r.shaderSource="",r.materials={},r.uniforms={},r._uniforms={},r._translucentFunctions=[];var s,l=H._materialCache.getMaterial(r.type);if(a(l)){var u=t(l.fabric,!0);r._template=i(r._template,u,!0),s=l.translucent}L(r),a(l)||H._materialCache.addMaterial(r.type,r),N(r),z(r),U(r);var c=0===r._translucentFunctions.length?!0:void 0;if(s=o(s,c),s=o(e.translucent,s),a(s))if("function"==typeof s){var h=function(){return s(r)};r._translucentFunctions.push(h)}else r._translucentFunctions.push(s)}function I(e,t,r,i){if(a(e))for(var n in e)if(e.hasOwnProperty(n)){var o=-1!==t.indexOf(n);(i&&!o||!i&&o)&&r(n,t)}}function O(e,t){for(var r="fabric: property name '"+e+"' is not valid. It should be ",i=0;i0&&(i[s]={type:"ivec3",x:1,y:1},V(e,s))}var l=new RegExp("uniform\\s+"+o+"\\s+"+t+"\\s*;");if(!l.test(e.shaderSource)){var c="uniform "+o+" "+t+";";e.shaderSource=c+e.shaderSource}var h=t+"_"+e._count++;if(1===W(e,t,h)&&r)throw new u("strict: shader source does not use uniform '"+t+"'.");if(e.uniforms[t]=n,"sampler2D"===o)e._uniforms[h]=function(){return e._textures[t]},e._updateFunctions.push(F(t));else if("samplerCube"===o)e._uniforms[h]=function(){return e._textures[t]},e._updateFunctions.push(B(t));else if(-1!==o.indexOf("mat")){var d=new Y[o];e._uniforms[h]=function(){return Y[o].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[h]=function(){return e.uniforms[t]}}}function k(e){var t=e.type;if(!a(t)){var r=typeof e;if("number"===r)t="float";else if("boolean"===r)t="bool";else if("string"===r)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===H.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===r)if(c(e))(4===e.length||9===e.length||16===e.length)&&(t="mat"+Math.sqrt(e.length));else{var i=0;for(var n in e)e.hasOwnProperty(n)&&(i+=1);i>=2&&4>=i?t="vec"+i:6===i&&(t="samplerCube")}}return t}function U(e){var t=e._strict,r=e._template.materials;for(var n in r)if(r.hasOwnProperty(n)){var o=new H({strict:t,fabric:r[n],count:e._count});e._count=o._count,e._uniforms=i(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)";if(0===W(e,n,l)&&t)throw new u("strict: shader source does not use material '"+n+"'.")}}function W(e,t,r,i){i=o(i,!0);var n=0,a="([\\w])?",s="([\\w"+(i?".":"")+"])?",l=new RegExp(s+t+a,"g");return e.shaderSource=e.shaderSource.replace(l,function(e,t,i){return t||i?e:(n+=1,r)}),n}function G(e,t,r){return W(e,t,t,r)}var H=function(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=[],D(e,this),s(this,{type:{value:this.type,writable:!1}}),a(H._uniformList[this.type])||(H._uniformList[this.type]=Object.keys(this._uniforms))};H._uniformList={},H.fromType=function(e,t){var r=new H({fabric:{type:e}});if(a(t))for(var i in t)t.hasOwnProperty(i)&&(r.uniforms[i]=t[i]);return r},H.prototype.isTranslucent=function(){if(a(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;for(var e=!0,t=this._translucentFunctions,r=t.length,i=0;r>i;++i){var n=t[i];if(e="function"==typeof n?e&&n():e&&n,!e)break}return e},H.prototype.update=function(e){var t,r,i=this._loadedImages,n=i.length;for(t=0;n>t;++t){var o=i[t];r=o.id;var s=o.image,l=H._textureCache.getTexture(this._texturePaths[r]);a(l)||(l=e.createTexture2D({source:s}),H._textureCache.addTexture(this._texturePaths[r],l)),this._textures[r]=l;var u=r+"Dimensions";if(this.uniforms.hasOwnProperty(u)){var c=this.uniforms[u];c.x=l._width,c.y=l._height}}i.length=0;var h=this._loadedCubeMaps;for(n=h.length,t=0;n>t;++t){var d=h[t];r=d.id;var m=d.images,p=H._textureCache.getTexture(this._texturePaths[r]);a(p)||(p=e.createCubeMap({source:{positiveX:m[0],negativeX:m[1],positiveY:m[2],negativeY:m[3],positiveZ:m[4],negativeZ:m[5]}}),H._textureCache.addTexture(this._texturePaths[r],p)),this._textures[r]=p}h.length=0;var f=this._updateFunctions;for(n=f.length,t=0;n>t;++t)f[t](this,e);var v=this.materials;for(var g in v)v.hasOwnProperty(g)&&v[g].update(e)},H.prototype.isDestroyed=function(){return!1},H.prototype.destroy=function(){var e=this.materials,t=this.uniforms;for(var r in t)if(t.hasOwnProperty(r)){var i=this._texturePaths[r];H._textureCache.releaseTexture(i)}for(var n in e)e.hasOwnProperty(n)&&e[n].destroy();return l(this)};var q=["type","materials","uniforms","components","source"],j=["diffuse","specular","shininess","normal","emission","alpha"],Y={mat2:d,mat3:m,mat4:p};return H._textureCache={_textures:{},addTexture:function(e,t){this._textures[e]={texture:t,count:1}},getTexture:function(e){var t=this._textures[e];return a(t)?(t.count++,t.texture):void 0},releaseTexture:function(e){var t=this._textures[e];a(t)&&0===--t.count&&(t.texture=t.texture&&t.texture.destroy(),this._textures[e]=void 0)}},H._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},H.DefaultImageId="czm_defaultImage",H.DefaultCubeMapId="czm_defaultCubeMap",H.ColorType="Color",H._materialCache.addMaterial(H.ColorType,{fabric:{type:H.ColorType,uniforms:{color:new r(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),H.ImageType="Image",H._materialCache.addMaterial(H.ImageType,{fabric:{type:H.ImageType,uniforms:{image:H.DefaultImageId,repeat:new e(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).rgb",alpha:"texture2D(image, fract(repeat * materialInput.st)).a"}},translucent:!0}),H.DiffuseMapType="DiffuseMap",H._materialCache.addMaterial(H.DiffuseMapType,{fabric:{type:H.DiffuseMapType,uniforms:{image:H.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),H.AlphaMapType="AlphaMap",H._materialCache.addMaterial(H.AlphaMapType,{fabric:{type:H.AlphaMapType,uniforms:{image:H.DefaultImageId,channel:"a",repeat:new e(1,1)},components:{alpha:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),H.SpecularMapType="SpecularMap",H._materialCache.addMaterial(H.SpecularMapType,{fabric:{type:H.SpecularMapType,uniforms:{image:H.DefaultImageId,channel:"r",repeat:new e(1,1)},components:{specular:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),H.EmissionMapType="EmissionMap",H._materialCache.addMaterial(H.EmissionMapType,{fabric:{type:H.EmissionMapType,uniforms:{image:H.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{emission:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),H.BumpMapType="BumpMap",H._materialCache.addMaterial(H.BumpMapType,{fabric:{type:H.BumpMapType,uniforms:{image:H.DefaultImageId,channel:"r",strength:.8,repeat:new e(1,1)},source:g},translucent:!1}),H.NormalMapType="NormalMap",H._materialCache.addMaterial(H.NormalMapType,{fabric:{type:H.NormalMapType,uniforms:{image:H.DefaultImageId,channels:"rgb",strength:.8,repeat:new e(1,1)},source:S},translucent:!1}),H.GridType="Grid",H._materialCache.addMaterial(H.GridType,{fabric:{type:H.GridType,uniforms:{color:new r(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}}),H.StripeType="Stripe",H._materialCache.addMaterial(H.StripeType,{fabric:{type:H.StripeType,uniforms:{horizontal:!0,evenColor:new r(1,1,1,.5),oddColor:new r(0,0,1,.5),offset:0,repeat:5},source:P},translucent:function(e){var t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<0}}),H.CheckerboardType="Checkerboard",H._materialCache.addMaterial(H.CheckerboardType,{fabric:{type:H.CheckerboardType,uniforms:{lightColor:new r(1,1,1,.5),darkColor:new r(0,0,0,.5),repeat:new e(5,5)},source:_},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),H.DotType="Dot",H._materialCache.addMaterial(H.DotType,{fabric:{type:H.DotType,uniforms:{lightColor:new r(1,1,0,.75),darkColor:new r(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}}),H.WaterType="Water",H._materialCache.addMaterial(H.WaterType,{fabric:{type:H.WaterType,uniforms:{baseWaterColor:new r(.2,.3,.6,1),blendColor:new r(0,1,.699,1),specularMap:H.DefaultImageId,normalMap:H.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:A},translucent:function(e){var t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<0}}),H.RimLightingType="RimLighting",H._materialCache.addMaterial(H.RimLightingType,{fabric:{type:H.RimLightingType,uniforms:{color:new r(1,0,0,.7),rimColor:new r(1,1,1,.4),width:.3},source:x},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<0}}),H.FadeType="Fade",H._materialCache.addMaterial(H.FadeType,{fabric:{type:H.FadeType,uniforms:{fadeInColor:new r(1,0,0,1),fadeOutColor:new r(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<0}}),H.PolylineArrowType="PolylineArrow",H._materialCache.addMaterial(H.PolylineArrowType,{fabric:{type:H.PolylineArrowType,uniforms:{color:new r(1,1,1,1)},source:E},translucent:!0}),H.PolylineGlowType="PolylineGlow",H._materialCache.addMaterial(H.PolylineGlowType,{fabric:{type:H.PolylineGlowType,uniforms:{color:new r(0,.5,1,1),glowPower:.25},source:b},translucent:!0}),H.PolylineOutlineType="PolylineOutline",H._materialCache.addMaterial(H.PolylineOutlineType,{fabric:{type:H.PolylineOutlineType,uniforms:{color:new r(1,1,1,1),outlineColor:new r(1,0,0,1),outlineWidth:1},source:T},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),H}),r("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,r,i,n,o,a,s,l,u,c,h,d){"use strict";var m=function(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),n=e(r.closed,!1),o=e(r.materialSupport,m.MaterialSupport.TEXTURED);this.material=t(r.material)?r.material:d.fromType(d.ColorType),this.translucent=i,this._vertexShaderSource=e(r.vertexShaderSource,o.vertexShaderSource),this._fragmentShaderSource=e(r.fragmentShaderSource,o.fragmentShaderSource),this._renderState=e(r.renderState,h.getDefaultRenderState(i,n)),this._closed=n,this._materialSupport=o,this._vertexFormat=o.vertexFormat,this._flat=e(r.flat,!1),this._faceForward=e(r.faceForward,!n)};return r(m.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}}}),m.prototype.getFragmentShaderSource=h.prototype.getFragmentShaderSource,m.prototype.isTranslucent=h.prototype.isTranslucent,m.prototype.getRenderState=h.prototype.getRenderState,m.MaterialSupport={BASIC:i({vertexFormat:n.POSITION_AND_NORMAL,vertexShaderSource:l,fragmentShaderSource:s}),TEXTURED:i({vertexFormat:n.POSITION_NORMAL_AND_ST,vertexShaderSource:c,fragmentShaderSource:u}),ALL:i({vertexFormat:n.ALL,vertexShaderSource:a,fragmentShaderSource:o})},m}),r("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;\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(v_normalEC, vec3(0.0, 0.0, 1.0), -v_normalEC));\n#else\nnormalEC = normalize(v_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"}),r("Shaders/Appearances/PerInstanceColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec4 color;\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"}),r("Shaders/Appearances/PerInstanceFlatColorAppearanceFS",[],function(){"use strict";return"varying vec4 v_color;\nvoid main()\n{\ngl_FragColor = v_color;\n}\n"}),r("Shaders/Appearances/PerInstanceFlatColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),r("Scene/PerInstanceColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceColorAppearanceFS","../Shaders/Appearances/PerInstanceColorAppearanceVS","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Appearance"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(t){t=e(t,e.EMPTY_OBJECT);var r=e(t.translucent,!0),u=e(t.closed,!1),c=e(t.flat,!1),h=c?a:n,d=c?o:i,m=c?l.FLAT_VERTEX_FORMAT:l.VERTEX_FORMAT;this.material=void 0,this.translucent=r,this._vertexShaderSource=e(t.vertexShaderSource,h),this._fragmentShaderSource=e(t.fragmentShaderSource,d),this._renderState=e(t.renderState,s.getDefaultRenderState(r,u)),this._closed=u,this._vertexFormat=m,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=r.POSITION_AND_NORMAL,l.FLAT_VERTEX_FORMAT=r.POSITION_ONLY,l.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,l.prototype.isTranslucent=s.prototype.isTranslucent,l.prototype.getRenderState=s.prototype.getRenderState,l}),r("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,t,r){var i,n=!r,o=e.length;if(!n&&o>1){var a=e[0].modelMatrix;for(i=1;o>i;++i)if(!m.equals(a,e[i].modelMatrix)){n=!0;break}}if(n)for(i=0;o>i;++i)h.transformToWorldCoordinates(e[i]);else m.clone(e[0].modelMatrix,t)}function v(e,i){for(var n=e.length,o=0;n>o;++o){var a=e[o],s=a.geometry,l=s.attributes,u=l.position,h=4*(u.values.length/u.componentsPerAttribute);l.pickColor=new c({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0,values:new Uint8Array(h)});for(var d=i[o],m=t.floatToByte(d.red),p=t.floatToByte(d.green),f=t.floatToByte(d.blue),v=t.floatToByte(d.alpha),g=l.pickColor.values,_=0;h>_;_+=4)g[_]=m,g[_+1]=p,g[_+2]=f,g[_+3]=v}}function g(e){var t,r=e.length,i=[],o=e[0].attributes;for(t in o)if(o.hasOwnProperty(t)){for(var a=o[t],s=!0,l=1;r>l;++l){var u=e[l].attributes[t];if(!n(u)||a.componentDatatype!==u.componentDatatype||a.componentsPerAttribute!==u.componentsPerAttribute||a.normalize!==u.normalize){s=!1;break}}s&&i.push(t)}return i}function _(e,t){for(var i=e.length,n=0;i>n;++n)for(var o=e[n],a=o.attributes,s=o.geometry,l=u.computeNumberOfVertices(s),h=t.length,d=0;h>d;++d){for(var m=t[d],p=a[m],f=p.componentDatatype,v=p.value,g=v.length,_=r.createTypedArray(f,l*g),y=0;l>y;++y)_.set(v,y*g);s.attributes[m]=new c({componentDatatype:f,componentsPerAttribute:g,normalize:p.normalize,values:_})}}function y(e){var t,i=e.instances,n=e.pickIds,o=e.projection,a=e.elementIndexUintSupported,s=e.scene3DOnly,l=e.allowPicking,u=e.vertexCacheOptimize,c=e.compressVertices,d=e.modelMatrix,m=i.length;if(i[0].geometry.primitiveType,f(i,d,s),!s)for(t=0;m>t;++t)h.wrapLongitude(i[t].geometry);l&&v(i,n);var p=g(i);if(_(i,p),u)for(t=0;m>t;++t)h.reorderForPostVertexCache(i[t].geometry),h.reorderForPreVertexCache(i[t].geometry);var y,C=h.combine(i),w=C.attributes;if(s)for(y in w)w.hasOwnProperty(y)&&w[y].componentDatatype===r.DOUBLE&&h.encodeAttribute(C,y,y+"3DHigh",y+"3DLow");else for(y in w)if(w.hasOwnProperty(y)&&w[y].componentDatatype===r.DOUBLE){var S=y+"3D",E=y+"2D";h.projectTo2D(C,y,S,E,o),h.encodeAttribute(C,S,S+"High",S+"Low"),h.encodeAttribute(C,E,E+"High",E+"Low")}return c&&h.compressVertices(C),a?[C]:h.fitToUnsignedShortIndices(C)}function C(e,t,i){for(var n=[],o=e.attributes,a=i.length,s=0;a>s;++s){var l=i[s],u=o[l],c=u.componentDatatype;c===r.DOUBLE&&(c=r.FLOAT);var h=r.createTypedArray(c,u.values);n.push({index:t[l],componentDatatype:c,componentsPerAttribute:u.componentsPerAttribute,normalize:u.normalize,values:h}),delete o[l]}return n}function w(e,t,r){for(var o=[],a=g(e),s=e.length,l={},c={},h=0;s>h;++h)for(var d=e[h],m=u.computeNumberOfVertices(d.geometry),p=a.length,f=0;p>f;++f)for(var v=a[f],_=r[v],y=m;y>0;){for(var C,w=i(c[v],0),S=t[w],E=S.length,b=0;E>b&&(C=S[b],C.index!==_);++b);n(o[h])||(o[h]={}),n(o[h][v])||(o[h][v]={dirty:!1,value:d.attributes[v].value,indices:[]}); -var T,x=C.values.length/C.componentsPerAttribute,P=i(l[v],0);x>P+y?(T=y,o[h][v].indices.push({attribute:C,offset:P,count:T}),l[v]=P+y):(T=x-P,o[h][v].indices.push({attribute:C,offset:P,count:T}),l[v]=0,c[v]=w+1),y-=T}return o}function S(e,t){var r=e.attributes;for(var i in r)if(r.hasOwnProperty(i)){var o=r[i];n(o)&&n(o.values)&&t.push(o.values.buffer)}n(e.indices)&&t.push(e.indices.buffer)}function E(e,t){for(var r=e.length,i=0;r>i;++i)S(e[i],t)}function b(e,t){for(var r=e.length,i=0;r>i;++i)for(var n=e[i],o=n.length,a=0;o>a;++a)t.push(n[a].values.buffer)}function T(t){for(var r=1,i=t.length,o=0;i>o;o++){var a=t[o],s=a.attributes;r+=4+e.packedLength+(n(a.indices)?a.indices.length:0);for(var l in s)if(s.hasOwnProperty(l)&&n(s[l])){var u=s[l];r+=5+u.values.length}}return r}function x(e,t){for(var r=e.length,i=new Uint32Array(e.length),n=0;r>n;++n)i[n]=e[n].toRgba();return t.push(i.buffer),i}function P(e){for(var r=e.length,i=new Array(r),n=0;r>n;n++)i[n]=t.fromRgba(e[n]);return i}function A(e){for(var t=e.length,r=1+17*t,i=0;t>i;i++){var o=e[i].attributes;for(var a in o)if(o.hasOwnProperty(a)&&n(o[a])){var s=o[a];r+=5+s.value.length}}return r}function M(e,t){var r=new Float64Array(A(e)),i={},o=[],a=e.length,s=0;r[s++]=a;for(var l=0;a>l;l++){var u=e[l];m.pack(u.modelMatrix,r,s),s+=m.packedLength;var c=u.attributes,h=[];for(var d in c)c.hasOwnProperty(d)&&n(c[d])&&(h.push(d),n(i[d])||(i[d]=o.length,o.push(d)));r[s++]=h.length;for(var p=0;pc;c++){for(var h=i[t[a++]],d=t[a++],p=t[a++],f=0!==t[a++],v=t[a++],g=r.createTypedArray(d,v),_=0;v>_;_++)g[_]=t[a++];l[h]={componentDatatype:d,componentsPerAttribute:p,normalize:f,value:g}}n[o++]={attributes:l,modelMatrix:s}}return n}function I(e){for(var t=e.length,r=1+t,i=0;t>i;i++){var o=e[i];for(var a in o)if(o.hasOwnProperty(a)&&n(o[a])){var s=o[a];r+=3+3*s.indices.length+s.value.length}}return r}function O(e,t){var r=new Float64Array(I(e)),i=[],o=[],a={},s=e.length,l=0;r[l++]=s;for(var u=0;s>u;u++){var c=e[u],h=[];for(var d in c)c.hasOwnProperty(d)&&n(c[d])&&(h.push(d),n(a[d])||(a[d]=i.length,i.push(d)));r[l++]=h.length;for(var m=0;m_;_++){var y=v[_];r[l++]=y.count,r[l++]=y.offset;var C=o.indexOf(y.attribute);-1===C&&(C=o.length,o.push(y.attribute)),r[l++]=C}r[l++]=f.value.length,r.set(f.value,l),l+=f.value.length}}return t.push(r.buffer),{stringTable:i,packedData:r,attributeTable:o}}function R(e){for(var t=e.stringTable,i=e.attributeTable,n=e.packedData,o=new Array(n[0]),a=0,s=1,l=n.length;l>s;){for(var u={},c=n[s++],h=0;c>h;h++){for(var d=t[n[s++]],m=new Array(n[s++]),p=0;p_;_++)g[_]=n[s++];u[d]={dirty:!1,indices:m,value:g}}o[a++]=u}return o}if(!s.supportsTypedArrays())return{};var L={};return L.combineGeometry=function(e){for(var t=y(e),r=h.createAttributeLocations(t[0]),i=e.instances,n=g(i),o=[],a=t.length,s=0;a>s;++s){var l=t[s];o.push(C(l,r,n))}var u=w(i,o,r);return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:r,vaAttributes:o,vaAttributeLocations:u}},L.packCreateGeometryResults=function(t,r){var i=new Float64Array(T(t)),o=[],a={},s=t.length,l=0;i[l++]=s;for(var u=0;s>u;u++){var c=t[u];i[l++]=c.primitiveType,i[l++]=c.geometryType,e.pack(c.boundingSphere,i,l),l+=e.packedLength;var h=c.attributes,d=[];for(var m in h)h.hasOwnProperty(m)&&n(h[m])&&(d.push(m),n(a[m])||(a[m]=o.length,o.push(m)));i[l++]=d.length;for(var p=0;p0&&(i.set(c.indices,l),l+=g)}return r.push(i.buffer),{stringTable:o,packedData:i}},L.unpackCreateGeometryResults=function(t){for(var i,n=t.stringTable,o=t.packedData,a=new Array(o[0]),s=0,l=1;li;i++){var C=n[o[l++]],w=o[l++];g=o[l++];var S=0!==o[l++];f=o[l++],v=r.createTypedArray(w,f);for(var E=0;f>E;E++)v[E]=o[l++];_[C]=new c({componentDatatype:w,componentsPerAttribute:g,normalize:S,values:v})}var b;if(f=o[l++],f>0){var T=v.length/g;for(b=d.createTypedArray(T,f),i=0;f>i;i++)b[i]=o[l++]}a[s++]=new u({primitiveType:h,geometryType:m,boundingSphere:p,indices:b,attributes:_})}return a},L.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,i=r.length,n=0;i>n;n++)t.push(r[n].packedData.buffer);var o;return e.allowPicking&&(o=x(e.pickIds,t)),{createGeometryResults:e.createGeometryResults,packedInstances:M(e.instances,t),packedPickIds:o,ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof l,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix}},L.unpackCombineGeometryParameters=function(e){for(var t=D(e.packedInstances),r=e.allowPicking?P(e.packedPickIds):void 0,i=e.createGeometryResults,n=i.length,o=0,s=0;n>s;s++)for(var u=L.unpackCreateGeometryResults(i[s]),c=u.length,h=0;c>h;h++)t[o++].geometry=u[h];var d=a.clone(e.ellipsoid),f=e.isGeographic?new l(d):new p(d);return{instances:t,pickIds:r,ellipsoid:d,projection:f,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:m.clone(e.modelMatrix)}},L.packCombineGeometryResults=function(e,t){return E(e.geometries,t),b(e.vaAttributes,t),{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,packedVaAttributeLocations:O(e.vaAttributeLocations,t),modelMatrix:e.modelMatrix}},L.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,perInstanceAttributeLocations:R(e.packedVaAttributeLocations,e.vaAttributes),modelMatrix:e.modelMatrix}},L}),r("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)}),r("Scene/Primitive",["../Core/BoundingSphere","../Core/clone","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryInstance","../Core/GeometryInstanceAttribute","../Core/isArray","../Core/Matrix4","../Core/subdivideArray","../Core/TaskProcessor","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/ShaderSource","../ThirdParty/when","./CullFace","./Pass","./PrimitivePipeline","./PrimitiveState","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S,E,b,T,x,P){"use strict";function A(e){return new h({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:new e.values.constructor(e.values)})}function M(t){var r=t.attributes,i=new d;for(var n in r)r.hasOwnProperty(n)&&o(r[n])&&(i[n]=A(r[n]));var a;if(o(t.indices)){var s=t.indices;a=new s.constructor(s)}return new c({attributes:i,indices:a,primitiveType:t.primitiveType,boundingSphere:e.clone(t.boundingSphere)})}function D(e){return new p({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,value:new e.value.constructor(e.value)})}function I(e,t){var r=e.attributes,i={};for(var n in r)r.hasOwnProperty(n)&&(i[n]=D(r[n]));return new m({geometry:t,modelMatrix:v.clone(e.modelMatrix),attributes:i})}function O(e,t,r){for(var i,n="",o="",a="";null!==(i=G.exec(t));){var s=i[1],l="vec4 czm_compute"+s[0].toUpperCase()+s.substr(1)+"()";"vec4 czm_computePosition()"!==l&&(n+=l+";\n"),r?a+=l+"\n"+"{\n"+" return czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow);\n"+"}\n\n":(o+="attribute vec3 "+s+"2DHigh;\n"+"attribute 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")}function R(e){var t=e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_old_main()"),r="attribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n czm_pickColor = pickColor; \n}";return t+"\n"+r}function L(e,t){if(!o(e._attributeLocations.show))return t;var r=t.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_non_show_main()"),i="attribute float show;\nvoid main() \n{ \n czm_non_show_main(); \n gl_Position *= show; \n}";return r+"\n"+i}function N(e,t){if(!e.compressVertices)return t;var r=-1!==t.search(/attribute\s+vec3\s+normal;/g),i=-1!==t.search(/attribute\s+vec2\s+st;/g);if(!r&&!i)return t;var n=-1!==t.search(/attribute\s+vec3\s+tangent;/g),o=-1!==t.search(/attribute\s+vec3\s+binormal;/g),a=i&&r?2:1;a+=n||o?1:0;var s=a>1?"vec"+a:"float",l="compressedAttributes",u="attribute "+s+" "+l+";",c="",h="";if(i){c+="vec2 st;\n";var d=a>1?l+".x":l;h+=" st = czm_decompressTextureCoordinates("+d+");\n"}r&&n&&o?(c+="vec3 normal;\nvec3 tangent;\nvec3 binormal;\n",h+=" czm_octDecode("+l+"."+(i?"yz":"xy")+", normal, tangent, binormal);\n"):(r&&(c+="vec3 normal;\n",h+=" normal = czm_octDecode("+l+(a>1?"."+(i?"y":"x"):"")+");\n"),n&&(c+="vec3 tangent;\n",h+=" tangent = czm_octDecode("+l+"."+(i&&r?"z":"y")+");\n"),o&&(c+="vec3 binormal;\n",h+=" binormal = czm_octDecode("+l+"."+(i&&r?"z":"y")+");\n"));var m=t;m=m.replace(/attribute\s+vec3\s+normal;/g,""),m=m.replace(/attribute\s+vec2\s+st;/g,""),m=m.replace(/attribute\s+vec3\s+tangent;/g,""),m=m.replace(/attribute\s+vec3\s+binormal;/g,""),m=m.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_non_compressed_main()");var p="void main() \n{ \n"+h+" czm_non_compressed_main(); \n"+"}";return[u,c,m,p].join("\n")}function F(e){e.vertexAttributes}function B(e,t,r){for(var i=[],a=r.length,s=0;a>s;++s){var l={primitive:n(r[s].pickPrimitive,t)};o(r[s].id)&&(l.id=r[s].id);var u=e.createPickId(l);t._pickIds.push(u),i.push(u.color)}return i}function z(e,t){return function(){return e[t]}}function V(e,t){return function(){return t[e].value}}function k(e,t,r){return function(i){var n=t[e];n.value=i,n.dirty||(r.push(n),n.dirty=!0)}}var U=function(e){e=n(e,n.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.modelMatrix=v.clone(n(e.modelMatrix,v.IDENTITY)),this._modelMatrix=new v,this.show=n(e.show,!0),this._vertexCacheOptimize=n(e.vertexCacheOptimize,!1),this._interleave=n(e.interleave,!1),this._releaseGeometryInstances=n(e.releaseGeometryInstances,!0),this._allowPicking=n(e.allowPicking,!0),this._asynchronous=n(e.asynchronous,!0),this._compressVertices=n(e.compressVertices,!0),this.cull=n(e.cull,!0),this.debugShowBoundingVolume=n(e.debugShowBoundingVolume,!1),this._translucent=void 0,this._state=x.READY,this._geometries=[],this._vaAttributes=void 0,this._error=void 0,this._numberOfInstances=0,this._boundingSphere=void 0,this._boundingSphereWC=void 0,this._boundingSphereCV=void 0,this._boundingSphere2D=void 0,this._perInstanceAttributeLocations=void 0,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._dirtyAttributes=[],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._createGeometryResults=void 0};a(U.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._state===x.COMPLETE}}});var W,G=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g,H=Math.max(u.hardwareConcurrency-1,1),q=new _("combineGeometry",Number.POSITIVE_INFINITY);return U.prototype.update=function(n,a,s){if(!(!o(this.geometryInstances)&&0===this._va.length||o(this.geometryInstances)&&f(this.geometryInstances)&&0===this.geometryInstances.length||!o(this.appearance)||a.mode!==P.SCENE3D&&a.scene3DOnly||!a.passes.render&&!a.passes.pick)){var u,c,h,d,m,p,A,D,V,k,U,G,j,Y=a.mapProjection,X=this.allowPicking,Z=this._instanceIds,Q=a.scene3DOnly,J=this;if(this._state!==x.COMPLETE&&this._state!==x.COMBINED)if(this.asynchronous){if(this._state===x.FAILED)throw this._error;if(this._state===x.READY){U=f(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],this._numberOfInstances=p=U.length;var K=[],$=[];for(A=0;p>A;++A)h=U[A].geometry,Z.push(U[A].id),$.push({moduleName:h._workerName,geometry:h});if(!o(W))for(W=new Array(H),A=0;H>A;A++)W[A]=new _("createGeometry",Number.POSITIVE_INFINITY);for($=g($,H),A=0;A<$.length;A++)K.push(W[A].scheduleTask({subTasks:$[A]}));this._state=x.CREATING,S.all(K,function(e){J._createGeometryResults=e,J._state=x.CREATED},function(e){J._error=e,J._state=x.FAILED})}else if(this._state===x.CREATED){var et=[];U=f(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],k=q.scheduleTask(T.packCombineGeometryParameters({createGeometryResults:this._createGeometryResults,instances:U,pickIds:X?B(n,this,U):void 0,ellipsoid:Y.ellipsoid,projection:Y,elementIndexUintSupported:n.elementIndexUint,scene3DOnly:Q,allowPicking:X,vertexCacheOptimize:this.vertexCacheOptimize,compressVertices:this.compressVertices,modelMatrix:this.modelMatrix},et),et),this._createGeometryResults=void 0,this._state=x.COMBINING,S(k,function(e){var t=T.unpackCombineGeometryResults(e);J._geometries=t.geometries,J._attributeLocations=t.attributeLocations,J._vaAttributes=t.vaAttributes,J._perInstanceAttributeLocations=t.perInstanceAttributeLocations,J._state=x.COMBINED,J.modelMatrix=v.clone(t.modelMatrix,J.modelMatrix)},function(e){J._error=e,J._state=x.FAILED})}}else{for(U=f(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],this._numberOfInstances=p=U.length,j=new Array(p),G=new Array(U.length),A=0;p>A;A++){var tt=U[A];h=tt.geometry,Z.push(tt.id);var rt;rt=o(h.attributes)&&o(h.primitiveType)?M(h):h.constructor.createGeometry(h),j[A]=rt,G[A]=I(tt,rt)}var it=T.combineGeometry({instances:G,pickIds:X?B(n,this,U):void 0,ellipsoid:Y.ellipsoid,projection:Y,elementIndexUintSupported:n.elementIndexUint,scene3DOnly:Q,allowPicking:X,vertexCacheOptimize:this.vertexCacheOptimize,compressVertices:this.compressVertices,modelMatrix:this.modelMatrix});this._geometries=it.geometries,this._attributeLocations=it.attributeLocations,this._vaAttributes=it.vaAttributes,this._perInstanceAttributeLocations=it.vaAttributeLocations,this._state=x.COMBINED}var nt=this._attributeLocations;if(this._state===x.COMBINED){j=this._geometries;var ot=this._vaAttributes;this._boundingSphere=e.clone(j[0].boundingSphere);var at=[];for(p=j.length,A=0;p>A;++A){h=j[A],d=ot[A];var st=d.length;for(D=0;st>D;++D)m=d[D],m.vertexBuffer=n.createVertexBuffer(m.values,y.DYNAMIC_DRAW),delete m.values;at.push(n.createVertexArrayFromGeometry({geometry:h,attributeLocations:nt,bufferUsage:y.STATIC_DRAW,interleave:this._interleave,vertexArrayAttributes:d}))}this._va=at,this._primitiveType=j[0].primitiveType,this.releaseGeometryInstances&&(this.geometryInstances=void 0),this._geometries=void 0,this._state=x.COMPLETE}if(this.show&&this._state===x.COMPLETE){var lt=this.appearance,ut=lt.material,ct=!1,ht=!1;this._appearance!==lt?(this._appearance=lt,this._material=ut,ct=!0,ht=!0):this._material!==ut&&(this._material=ut,ht=!0);var dt=this._appearance.isTranslucent();this._translucent!==dt&&(this._translucent=dt,ct=!0),o(this._material)&&this._material.update(n);var mt=lt.closed&&dt;if(ct){var pt,ft=lt.getRenderState();mt?(pt=t(ft,!1),pt.cull={enabled:!0,face:E.BACK},this._frontFaceRS=n.createRenderState(pt),pt.cull.face=E.FRONT,this._backFaceRS=n.createRenderState(pt)):(this._frontFaceRS=n.createRenderState(ft),this._backFaceRS=this._frontFaceRS),X?mt?(pt=t(ft,!1),pt.cull={enabled:!1},this._pickRS=n.createRenderState(pt)):this._pickRS=this._frontFaceRS:(pt=t(ft,!1),pt.colorMask={red:!1,green:!1,blue:!1,alpha:!1},mt?(pt.cull={enabled:!1},this._pickRS=n.createRenderState(pt)):this._pickRS=n.createRenderState(pt))}if(ht){var vt=O(this,lt.vertexShaderSource,Q);vt=L(this,vt),vt=N(this,vt);var gt=lt.getFragmentShaderSource();if(this._sp=n.replaceShaderProgram(this._sp,vt,gt,nt),F(this._sp,nt),X){var _t=new w({sources:[gt],pickColorQualifier:"varying"});this._pickSP=n.replaceShaderProgram(this._pickSP,R(vt),_t,nt)}else this._pickSP=n.createShaderProgram(vt,gt,nt);F(this._pickSP,nt)}var yt=this._colorCommands,Ct=this._pickCommands;if(ct||ht){var wt=o(ut)?ut._uniforms:void 0,St={},Et=lt.uniforms;if(o(Et))for(var bt in Et)if(Et.hasOwnProperty(bt)){if(o(wt)&&o(wt[bt]))throw new l("Appearance and material have a uniform with the same name: "+bt);St[bt]=z(Et,bt)}var Tt=r(St,wt),xt=dt?b.TRANSLUCENT:b.OPAQUE;yt.length=this._va.length*(mt?2:1),Ct.length=this._va.length,p=yt.length;var Pt=0,At=0;for(A=0;p>A;++A)mt&&(u=yt[A],o(u)||(u=yt[A]=new C({owner:this,primitiveType:this._primitiveType})),u.vertexArray=this._va[At],u.renderState=this._backFaceRS,u.shaderProgram=this._sp,u.uniformMap=Tt,u.pass=xt,++A),u=yt[A],o(u)||(u=yt[A]=new C({owner:this,primitiveType:this._primitiveType})),u.vertexArray=this._va[At],u.renderState=this._frontFaceRS,u.shaderProgram=this._sp,u.uniformMap=Tt,u.pass=xt,c=Ct[Pt],o(c)||(c=Ct[Pt]=new C({owner:this,primitiveType:this._primitiveType})),c.vertexArray=this._va[At],c.renderState=this._pickRS,c.shaderProgram=this._pickSP,c.uniformMap=Tt,c.pass=xt,++Pt,++At}if(this._dirtyAttributes.length>0){for(d=this._dirtyAttributes,p=d.length,A=0;p>A;++A){m=d[A];var Mt=m.value,Dt=m.indices,It=Dt.length;for(D=0;It>D;++D){V=Dt[D];for(var Ot=V.offset,Rt=V.count,Lt=V.attribute,Nt=Lt.componentDatatype,Ft=Lt.componentsPerAttribute,Bt=i.createTypedArray(Nt,Rt*Ft),zt=0;Rt>zt;++zt)Bt.set(Mt,zt*Ft);var Vt=Ot*Ft*i.getSizeInBytes(Nt);Lt.vertexBuffer.copyFromArrayView(Bt,Vt)}m.dirty=!1}d.length=0}var kt;kt=this._numberOfInstances>1||a.mode!==P.SCENE3D?v.IDENTITY:this.modelMatrix,v.equals(kt,this._modelMatrix)||(v.clone(kt,this._modelMatrix),this._boundingSphereWC=e.transform(this._boundingSphere,kt,this._boundingSphereWC),!Q&&o(this._boundingSphere)&&(this._boundingSphereCV=e.projectTo2D(this._boundingSphereWC,Y,this._boundingSphereCV),this._boundingSphere2D=e.clone(this._boundingSphereCV,this._boundingSphere2D),this._boundingSphere2D.center.x=0));var Ut;a.mode===P.SCENE3D?Ut=this._boundingSphereWC:a.mode===P.COLUMBUS_VIEW?Ut=this._boundingSphereCV:a.mode===P.SCENE2D&&o(this._boundingSphere2D)?Ut=this._boundingSphere2D:o(this._boundingSphereWC)&&o(this._boundingSphereCV)&&(Ut=e.union(this._boundingSphereWC,this._boundingSphereCV));var Wt=a.passes;if(Wt.render)for(p=yt.length,A=0;p>A;++A)yt[A].modelMatrix=kt,yt[A].boundingVolume=Ut,yt[A].cull=this.cull,yt[A].debugShowBoundingVolume=this.debugShowBoundingVolume,s.push(yt[A]);if(Wt.pick)for(p=Ct.length,A=0;p>A;++A)Ct[A].modelMatrix=kt,Ct[A].boundingVolume=Ut,Ct[A].cull=this.cull,s.push(Ct[A])}}},U.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,r=this._lastPerInstanceAttributeIndex,i=this._instanceIds,n=i.length,o=0;n>o;++o){var s=(r+o)%n;if(e===i[s]){t=s;break}}if(-1===t)return void 0;var l=this._perInstanceAttributeLocations[t],u={},c={},h=!1;for(var d in l)l.hasOwnProperty(d)&&(h=!0,c[d]={get:V(d,l),set:k(d,l,this._dirtyAttributes)});return h&&a(u,c),this._lastPerInstanceAttributeIndex=t,u},U.prototype.isDestroyed=function(){return!1},U.prototype.destroy=function(){var e,t;this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy();var r=this._va;for(e=r.length,t=0;e>t;++t)r[t].destroy();this._va=void 0;var i=this._pickIds;for(e=i.length,t=0;e>t;++t)i[t].destroy();return this._pickIds=void 0,s(this)},U}),r("DataSources/MaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Scene/Material"],function(e,t,r,i,n){"use strict";var o=function(){i.throwInstantiationError()};return r(o.prototype,{isConstant:{get:i.throwInstantiationError},definitionChanged:{get:i.throwInstantiationError}}),o.prototype.getType=i.throwInstantiationError,o.prototype.getValue=i.throwInstantiationError,o.prototype.equals=i.throwInstantiationError,o.getValue=function(r,i,o){var a;return t(i)&&(a=i.getType(r),t(a))?(t(o)&&o.type===a||(o=n.fromType(a)),i.getValue(r,o.uniforms),o):(t(o)&&o.type===n.ColorType||(o=n.fromType(n.ColorType)),e.clone(e.WHITE,o.uniforms.color),o)},o}),r("DataSources/CylinderGeometryUpdater",["../Core/Cartesian3","../Core/Matrix4","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CylinderGeometry","../Core/CylinderOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/VerticalOrigin","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S){"use strict";var E=new y(r.WHITE),b=new C(!0),T=new C(!0),x=new C(!1),P=new C(r.BLACK),A=new r,M=function(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.verticalOrigin=void 0,this.offset=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0},D=function(e,t,r){this._propertyName=s(r)?r:"cylinder",this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(D.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._verticalOriginProperty=void 0,this._offsetProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new M(e),this._onEntityPropertyChanged(e,this._propertyName,e[this._propertyName],void 0)};l(D,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:f}}),l(D.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!s(this._entity.availability)&&S.isConstant(this._showProperty)&&S.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!s(this._entity.availability)&&S.isConstant(this._showProperty)&&S.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},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(o){var a,l,u=this._entity,c=u.isAvailable(o),h=new p(c&&this._showProperty.getValue(o)&&this._fillProperty.getValue(o));if(this._materialProperty instanceof y){var f=r.WHITE;s(this._materialProperty.color)&&(this._materialProperty.color.isConstant||c)&&(f=this._materialProperty.color.getValue(o)),l=i.fromColor(f),a={show:h,color:l}}else a={show:h};var v=this._offsetProperty.getValue(o),g=this._verticalOriginProperty.getValue(o);g===_.BOTTOM?e.add(v,new e(0,0,this._options.length/2),v):g===_.TOP&&e.add(v,new e(0,0,-(this._options.length/2)),v);var C=u._getModelMatrix(m.MINIMUM_VALUE);if(C){var w=new t;t.fromTranslation(v,w),t.multiply(C,w,C)}return new d({id:u,geometry:new n(this._options),modelMatrix:C,attributes:a})},D.prototype.createOutlineGeometryInstance=function(n){var a=this._entity,s=a.isAvailable(n),l=S.getValueOrDefault(this._outlineColorProperty,n,r.BLACK),u=this._offsetProperty.getValue(n),c=this._verticalOriginProperty.getValue(n),u=this._offsetProperty.getValue(n),c=this._verticalOriginProperty.getValue(n);c===_.BOTTOM?e.add(u,new e(0,0,this._options.length/2),u):c===_.TOP&&e.add(u,new e(0,0,-(this._options.length/2)),u);var h=a._getModelMatrix(m.MINIMUM_VALUE);if(h){var f=new t;t.fromTranslation(u,f),t.multiply(h,f,h)}return new d({id:a,geometry:new o(this._options),modelMatrix:h,attributes:{show:new p(s&&this._showProperty.getValue(n)&&this._showOutlineProperty.getValue(n)),color:i.fromColor(l)}})},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){this._entitySubscription(),u(this)},D.prototype._onEntityPropertyChanged=function(t,r){if("availability"===r||"position"===r||"orientation"===r||r===this._propertyName){var i=t[this._propertyName];if(!s(i))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var n=i.fill,o=s(n)&&n.isConstant?n.getValue(m.MINIMUM_VALUE):!0,l=i.outline,u=s(l);if(u&&l.isConstant&&(u=l.getValue(m.MINIMUM_VALUE)),!o&&!u)return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var c=t.position,h=i.length,d=i.topRadius,p=i.bottomRadius,g=i.show;if(s(g)&&g.isConstant&&!g.getValue(m.MINIMUM_VALUE)||!s(c)||!s(h)||!s(d)||!s(p))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var w=a(i.material,E),A=w instanceof y;this._materialProperty=w,this._fillProperty=a(n,T),this._showProperty=a(g,b),this._showOutlineProperty=a(i.outline,x),this._outlineColorProperty=u?a(i.outlineColor,P):void 0,this._offsetProperty=a(i.offset,new C(new e(0,0,0))),this._verticalOriginProperty=a(i.verticalOrigin,new C(_.BOTTOM));var M=i.slices,D=i.outlineWidth,I=i.numberOfVerticalLines;if(this._fillEnabled=o,this._outlineEnabled=u,c.isConstant&&S.isConstant(t.orientation)&&h.isConstant&&d.isConstant&&p.isConstant&&S.isConstant(M)&&S.isConstant(D)&&S.isConstant(I)){var O=this._options;O.vertexFormat=A?v.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,O.length=h.getValue(m.MINIMUM_VALUE),O.topRadius=d.getValue(m.MINIMUM_VALUE),O.bottomRadius=p.getValue(m.MINIMUM_VALUE),O.slices=s(M)?M.getValue(m.MINIMUM_VALUE):void 0,O.numberOfVerticalLines=s(I)?I.getValue(m.MINIMUM_VALUE):void 0,this._outlineWidth=s(D)?D.getValue(m.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},D.prototype.createDynamicUpdater=function(e){return new I(e,this)};var I=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new M(t._entity)};return I.prototype.update=function(a){var l=this._primitives;l.remove(this._primitive),l.remove(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var u=this._geometryUpdater,c=u._entity,h=c[u._propertyName];if(c.isAvailable(a)&&S.getValueOrDefault(h.show,a,!0)){var p=this._options,y=c._getModelMatrix(a),C=S.getValueOrUndefined(h.length,a),E=S.getValueOrUndefined(h.topRadius,a),b=S.getValueOrUndefined(h.bottomRadius,a),T=S.getValueOrUndefined(h.offset,a),x=S.getValueOrUndefined(h.verticalOrigin,a);if(s(y)&&s(C)&&s(E)&&s(b)){if(p.length=C,p.topRadius=E,p.bottomRadius=b,p.slices=S.getValueOrUndefined(h.slices,a),p.numberOfVerticalLines=S.getValueOrUndefined(h.numberOfVerticalLines,a),p.offset=T,S.getValueOrDefault(h.fill,a,!0)){var P=w.getValue(a,u.fillMaterialProperty,this._material);this._material=P;var M=new f({material:P,translucent:P.isTranslucent(),closed:!0});p.vertexFormat=M.vertexFormat,x===_.BOTTOM?e.add(T,new e(0,0,p.length/2),T):x===_.TOP&&e.add(T,new e(0,0,-(p.length/2)),T);var y=c._getModelMatrix(m.MINIMUM_VALUE);if(y){var D=new t;t.fromTranslation(T,D),t.multiply(y,D,y)}this._primitive=l.add(new g({geometryInstances:new d({id:c,geometry:new n(p),modelMatrix:y}),appearance:M,asynchronous:!1}))}if(S.getValueOrDefault(h.outline,a,!1)){p.vertexFormat=v.VERTEX_FORMAT;var I=S.getValueOrClonedDefault(h.outlineColor,a,r.BLACK,A),O=S.getValueOrDefault(h.outlineWidth,a,1),R=1!==I.alpha;this._outlinePrimitive=l.add(new g({geometryInstances:new d({id:c,geometry:new o(p),modelMatrix:y,attributes:{color:i.fromColor(I)}}),appearance:new v({flat:!0,translucent:R,renderState:{lineWidth:u._scene.clampLineWidth(O)}}),asynchronous:!1}))}}}},I.prototype.isDestroyed=function(){return!1},I.prototype.destroy=function(){var e=this._primitives;e.remove(this._primitive),e.remove(this._outlinePrimitive),u(this)},D}),r("DataSources/ImageMaterialProperty",["../Core/Cartesian2","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o){"use strict";var a=new e(1,1),s=function(){this._definitionChanged=new i,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0};return r(s.prototype,{isConstant:{get:function(){return o.isConstant(this._image)&&o.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:n("image"),repeat:n("repeat")}),s.prototype.getType=function(){return"Image"},s.prototype.getValue=function(e,r){return t(r)||(r={}),r.image=o.getValueOrUndefined(this._image,e),r.repeat=o.getValueOrClonedDefault(this._repeat,e,a,r.repeat),r},s.prototype.equals=function(e){return this===e||e instanceof s&&o.equals(this._image,e._image)&&o.equals(this._repeat,e._repeat)},s.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},s}),r("DataSources/createMaterialPropertyDescriptor",["../Core/Color","../Core/DeveloperError","./ColorMaterialProperty","./createPropertyDescriptor","./ImageMaterialProperty"],function(e,t,r,i,n){"use strict";function o(t){if(t instanceof e)return new r(t);if("string"==typeof t){var i=new n;return i.image=t,i}}function a(e,t){return i(e,t,o)}return a}),r("DataSources/CylinderGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict"; -var s=function(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._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))};return r(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"),verticalOrigin:a("verticalOrigin"),offset:a("offset")}),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.verticalOrigin=this.verticalOrigin,e.offset=this.offset,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.verticalOrigin=e(this.verticalOrigin,t.verticalOrigin),this.offset=e(this.offset,t.offset)},s}),r("Scene/LabelStyle",["../Core/freezeObject"],function(e){"use strict";var t={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};return e(t)}),r("DataSources/DataSourceClock",["../Core/Clock","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./createPropertyDescriptor"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(){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 i(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 r(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||r(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(t){return r(t)||(t=new e),t.startTime=this.startTime,t.stopTime=this.stopTime,t.clockRange=this.clockRange,t.clockStep=this.clockStep,t.multiplier=this.multiplier,t.currentTime=this.currentTime,t},l}),r("DataSources/EllipseGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){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._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._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},semiMajorAxis:o("semiMajorAxis"),semiMinorAxis:o("semiMinorAxis"),rotation:o("rotation"),show:o("show"),material:o("material"),height:o("height"),extrudedHeight:o("extrudedHeight"),granularity:o("granularity"),stRotation:o("stRotation"),fill:o("fill"),outline:o("outline"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),numberOfVerticalLines:o("numberOfVerticalLines")}),a.prototype.clone=function(e){return t(e)||(e=new a),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},a.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)},a}),r("DataSources/EllipsoidGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){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._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),radii:o("radii"),material:o("material"),fill:o("fill"),outline:o("outline"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),stackPartitions:o("stackPartitions"),slicePartitions:o("slicePartitions"),subdivisions:o("subdivisions")}),a.prototype.clone=function(e){return t(e)||(e=new a),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},a.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)},a}),r("DataSources/GridMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a){"use strict";var s=t.WHITE,l=.1,u=new e(8,8),c=new e(0,0),h=new e(1,1),d=function(){this._definitionChanged=new n,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=void 0,this.cellAlpha=void 0,this.lineCount=void 0,this.lineThickness=void 0,this.lineOffset=void 0};return i(d.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._cellAlpha)&&a.isConstant(this._lineCount)&&a.isConstant(this._lineThickness)&&a.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),cellAlpha:o("cellAlpha"),lineCount:o("lineCount"),lineThickness:o("lineThickness"),lineOffset:o("lineOffset")}),d.prototype.getType=function(){return"Grid"},d.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,s,t.color),t.cellAlpha=a.getValueOrDefault(this._cellAlpha,e,l),t.lineCount=a.getValueOrClonedDefault(this._lineCount,e,u,t.lineCount),t.lineThickness=a.getValueOrClonedDefault(this._lineThickness,e,h,t.lineThickness),t.lineOffset=a.getValueOrClonedDefault(this._lineOffset,e,c,t.lineOffset),t},d.prototype.equals=function(e){return this===e||e instanceof d&&a.equals(this._color,e._color)&&a.equals(this._cellAlpha,e._cellAlpha)&&a.equals(this._lineCount,e._lineCount)&&a.equals(this._lineThickness,e._lineThickness)&&a.equals(this._lineOffset,e._lineOffset)},d.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},d}),r("DataSources/LabelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){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._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._positionOffset=void 0,this._positionOffsetSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._definitionChanged=new n};return r(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"),pixelOffset:o("pixelOffset"),positionOffset:o("positionOffset"),scale:o("scale"),show:o("show"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance")}),a.prototype.clone=function(e){return t(e)||(e=new a),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.scale=this.scale,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.eyeOffset=this.eyeOffset,e.pixelOffset=this.pixelOffset,e.positionOffset=this.positionOffset,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e},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.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.pixelOffset=e(this.pixelOffset,t.pixelOffset),this.positionOffset=e(this.positionOffset,t.positionOffset),this.translucencyByDistance=e(this._translucencyByDistance,t._translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t._pixelOffsetScaleByDistance)},a}),r("DataSources/ModelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){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._uri=void 0,this._uriSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),scale:o("scale"),minimumPixelSize:o("minimumPixelSize"),uri:o("uri")}),a.prototype.clone=function(e){return t(e)||(e=new a),e.show=this.show,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.uri=this.uri,e},a.prototype.merge=function(t){this.show=e(this.show,t.show),this.scale=e(this.scale,t.scale),this.minimumPixelSize=e(this.minimumPixelSize,t.minimumPixelSize),this.uri=e(this.uri,t.uri)},a}),r("DataSources/PathGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){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._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},material:o("material"),show:o("show"),width:o("width"),resolution:o("resolution"),leadTime:o("leadTime"),trailTime:o("trailTime")}),a.prototype.clone=function(e){return t(e)||(e=new a),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},a.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)},a}),r("DataSources/PointGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){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._definitionChanged=new n};return r(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")}),a.prototype.clone=function(e){return t(e)||(e=new a),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},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)},a}),r("DataSources/PolygonGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){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._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._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),material:o("material"),positions:o("positions"),height:o("height"),extrudedHeight:o("extrudedHeight"),granularity:o("granularity"),stRotation:o("stRotation"),fill:o("fill"),outline:o("outline"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),perPositionHeight:o("perPositionHeight")}),a.prototype.clone=function(e){return t(e)||(e=new a),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.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e},a.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.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)},a}),r("DataSources/PolylineGlowMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o){"use strict";var a=e.WHITE,s=.25,l=function(){this._definitionChanged=new i,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0};return r(l.prototype,{isConstant:{get:function(){return o.isConstant(this._color)&&o.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:n("color"),glowPower:n("glowPower")}),l.prototype.getType=function(){return"PolylineGlow"},l.prototype.getValue=function(e,r){return t(r)||(r={}),r.color=o.getValueOrClonedDefault(this._color,e,a,r.color),r.glowPower=o.getValueOrDefault(this._glowPower,e,s,r.glowPower),r},l.prototype.equals=function(e){return this===e||e instanceof l&&o.equals(this._color,e._color)&&o.equals(this._glowPower,e._glowPower)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),r("DataSources/PolylineGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){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._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),material:o("material"),positions:o("positions"),width:o("width"),followSurface:o("followSurface"),granularity:o("granularity")}),a.prototype.clone=function(e){return t(e)||(e=new a),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},a.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)},a}),r("DataSources/PolylineOutlineMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o){"use strict";var a=e.WHITE,s=e.BLACK,l=0,u=function(){this._definitionChanged=new i,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0};return r(u.prototype,{isConstant:{get:function(){return o.isConstant(this._color)&&o.isConstant(this._outlineColor)&&o.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:n("color"),outlineColor:n("outlineColor"),outlineWidth:n("outlineWidth")}),u.prototype.getType=function(){return"PolylineOutline"},u.prototype.getValue=function(e,r){return t(r)||(r={}),r.color=o.getValueOrClonedDefault(this._color,e,a,r.color),r.outlineColor=o.getValueOrClonedDefault(this._outlineColor,e,s,r.outlineColor),r.outlineWidth=o.getValueOrDefault(this._outlineWidth,e,l),r},u.prototype.equals=function(e){return this===e||e instanceof u&&o.equals(this._color,e._color)&&o.equals(this._outlineColor,e._outlineColor)&&o.equals(this._outlineWidth,e._outlineWidth)},u.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},u}),r("DataSources/PositionPropertyArray",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/ReferenceFrame","./Property"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(t,r){this._value=void 0,this._definitionChanged=new n,this._eventHelper=new o,this._referenceFrame=e(r,a.FIXED),this.setValue(t)};return r(l.prototype,{isConstant:{get:function(){var e=this._value;if(!t(e))return!0;for(var r=e.length,i=0;r>i;i++)if(!s.isConstant(e[i]))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,r,i){var n=this._value;if(!t(n))return void 0;var o=n.length;t(i)||(i=new Array(o));for(var a=0,s=0;o>a;){var l=n[a],u=l.getValueInReferenceFrame(e,r,i[a]);t(u)&&(i[s]=u,s++),a++}return i.length=s,i},l.prototype.setValue=function(e){var r=this._eventHelper;if(r.removeAll(),t(e)){this._value=e.slice();for(var i=e.length,n=0;i>n;n++){var o=e[n];t(o)&&r.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}),r("DataSources/RectangleGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){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._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),coordinates:o("coordinates"),material:o("material"),height:o("height"),extrudedHeight:o("extrudedHeight"),granularity:o("granularity"),stRotation:o("stRotation"),rotation:o("rotation"),fill:o("fill"),outline:o("outline"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),closeTop:o("closeTop"),closeBottom:o("closeBottom")}),a.prototype.clone=function(e){return t(e)||(e=new a),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},a.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)},a}),r("DataSources/ReferenceProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/RuntimeError","./Property"],function(e,t,r,i,n,o){"use strict";function a(t){var r=!0;if(t._resolveEntity){var i=t._targetCollection.getById(t._targetId);if(e(i)?(i.definitionChanged.addEventListener(l.prototype._onTargetEntityDefinitionChanged,t),t._targetEntity=i,t._resolveEntity=!1):(i=t._targetEntity,r=!1),!e(i))throw new n('target entity "'+t._targetId+'" could not be resolved.')}return r}function s(t){var r=t._targetProperty;if(t._resolveProperty){var i=a(t),o=t._targetPropertyNames;r=t._targetEntity;for(var s=o.length,l=0;s>l&&e(r);l++)r=r[o[l]];if(e(r))t._targetProperty=r,t._resolveProperty=!i;else if(!e(t._targetProperty))throw new n('targetProperty "'+t._targetId+"."+o.join(".")+'" could not be resolved.')}return r}var l=function(e,t,r){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=r,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new i,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 r,i=[],n=!0,o=!1,a="",s=0;sn;n++)if(t[n]!==r[n])return!1;return!0},l.prototype._onTargetEntityDefinitionChanged=function(e,t){this._targetPropertyNames[0]===t&&(this._resolveProperty=!0,this._definitionChanged.raiseEvent(this))},l.prototype._onCollectionChanged=function(t,r,i){var n=this._targetEntity;e(n)&&(-1!==i.indexOf(n)?(n.definitionChanged.removeEventListener(l.prototype._onTargetEntityDefinitionChanged,this),this._resolveEntity=!0,this._resolveProperty=!0):this._resolveEntity&&(s(this),this._resolveEntity||this._definitionChanged.raiseEvent(this)))},l}),r("DataSources/SampledProperty",["../Core/binarySearch","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ExtrapolationType","../Core/JulianDate","../Core/LinearApproximation"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,t,r){var i,n=e.length,o=r.length,a=n+o;if(e.length=a,n!==t){var s=n-1;for(i=a-1;i>=t;i--)e[i]=e[s--]}for(i=0;o>i;i++)e[t++]=r[i]}function c(e,t){return e instanceof s?e:"string"==typeof e?s.fromIso8601(e):s.addSeconds(t,e,new s)}var h={packedLength:1,pack:function(e,r,i){i=t(i,0),r[i]=e},unpack:function(e,r){return r=t(r,0),e[r]}},d=[],m=[],p=function(t,i,n,o,a){for(var l,h,p,f,v,g,_=0;_p){for(p=~p,f=p*a,h=void 0,g=i[p];_=0||r(g)&&s.compare(v,g)>=0));){for(d[y++]=v,_+=1,l=0;a>l;l++)m[C++]=o[_],_+=1;h=v}y>0&&(m.length=C,u(n,f,m),d.length=y,u(i,p,d))}else{for(l=0;a>l;l++)_++,n[p*a+l]=o[_];_++}}},f=function(e,i){var n=e;n===Number&&(n=h);var s,u=n.packedLength,c=t(n.packedInterpolationLength,u),d=0;if(r(i)){var m=i.length;s=new Array(m);for(var p=0;m>p;p++){var f=i[p];f===Number&&(f=h);var v=f.packedLength;u+=v,c+=t(f.packedInterpolationLength,v),s[p]=f}d=m}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=i,this._innerDerivativeTypes=s,this._inputOrder=d,this._forwardExtrapolationType=a.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=a.NONE,this._backwardExtrapolationDuration=0 -};return i(f.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))}}}),f.prototype.getValue=function(t,i){var n,o=this._innerType,l=this._times,u=this._values,c=e(l,t,s.compare);if(0>c){if(c=~c,0===c){var h=l[c];if(n=this._backwardExtrapolationDuration,this._backwardExtrapolationType===a.NONE||0!==n&&s.secondsDifference(h,t)>n)return void 0;if(this._backwardExtrapolationType===a.HOLD)return o.unpack(this._values,0,i)}if(c>=l.length){c=l.length-1;var d=l[c];if(n=this._forwardExtrapolationDuration,this._forwardExtrapolationType===a.NONE||0!==n&&s.secondsDifference(t,d)>n)return void 0;if(this._forwardExtrapolationType===a.HOLD)return c=l.length-1,o.unpack(this._values,c*o.packedLength,i)}var m=this._xTable,p=this._yTable,f=this._interpolationAlgorithm,v=this._packedInterpolationLength,g=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;var _=Math.min(f.getRequiredDataPoints(this._interpolationDegree,g),l.length);_!==this._numberOfPoints&&(this._numberOfPoints=_,m.length=_,p.length=_*v)}var y=this._numberOfPoints-1;if(1>y)return void 0;var C=0,w=l.length-1,S=w-C+1;if(y+1>S);else{var E=c-(0|y/2)-1;C>E&&(E=C);var b=E+y;b>w&&(b=w,E=b-y,C>E&&(E=C)),C=E,w=b}for(var T=w-C+1,x=0;T>x;++x)m[x]=s.secondsDifference(l[C+x],l[w]);if(r(o.convertPackedArrayForInterpolation))o.convertPackedArrayForInterpolation(u,C,w,p);else for(var P=0,A=this._packedLength,M=C*A,D=(w+1)*A;D>M;)p[P]=u[M],M++,P++;var I,O=s.secondsDifference(t,l[w]);if(0!==g&&r(f.interpolate)){var R=Math.floor(v/(g+1));I=f.interpolate(O,m,p,R,g,g,this._interpolationResult)}else I=f.interpolateOrderZero(O,m,p,v,this._interpolationResult);return r(o.unpackInterpolationResult)?o.unpackInterpolationResult(I,u,C,w,i):o.unpack(I,0,i)}return o.unpack(this._values,c*this._packedLength,i)},f.prototype.setInterpolationOptions=function(e){var t=!1,r=e.interpolationAlgorithm,i=e.interpolationDegree;this._interpolationAlgorithm!==r&&(this._interpolationAlgorithm=r,t=!0),this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))},f.prototype.addSample=function(e,t,i){var n=this._innerDerivativeTypes,o=r(n),a=this._innerType,s=[];if(s.push(e),a.pack(t,s,s.length),o)for(var l=n.length,u=0;l>u;u++)n[u].pack(i[u],s,s.length);p(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},f.prototype.addSamples=function(e,t,i){for(var n=this._innerDerivativeTypes,o=r(n),a=this._innerType,s=e.length,l=[],u=0;s>u;u++)if(l.push(e[u]),a.pack(t[u],l,l.length),o)for(var c=i[u],h=n.length,d=0;h>d;d++)n[d].pack(c[d],l,l.length);p(void 0,this._times,this._values,l,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},f.prototype.addSamplesPackedArray=function(e,t){p(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},f.prototype.equals=function(e){if(this===e)return!0;if(!r(e))return!1;if(this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;var t=this._derivativeTypes,i=r(t),n=e._derivativeTypes,o=r(n);if(i!==o)return!1;var a,l;if(i){if(l=t.length,l!==n.length)return!1;for(a=0;l>a;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;l>a;a++)if(!s.equals(u[a],c[a]))return!1;var h=this._values,d=e._values;for(a=0;l>a;a++)if(h[a]!==d[a])return!1;return!0},f._mergeNewSamples=p,f}),r("DataSources/SampledPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty","./Property","./SampledProperty"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=function(r,i){i=t(i,0);var n;if(i>0){n=new Array(i);for(var s=0;i>s;s++)n[s]=e}this._numberOfDerivatives=i,this._property=new u(e,n),this._definitionChanged=new o,this._referenceFrame=t(r,a.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)};return i(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,i){return i=this._property.getValue(e,i),r(i)?s.convertToReferenceFrame(e,i,this._referenceFrame,t,i):void 0},c.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},c.prototype.addSample=function(e,t,r){this._numberOfDerivatives,this._property.addSample(e,t,r)},c.prototype.addSamples=function(e,t,r){this._property.addSamples(e,t,r)},c.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},c.prototype.equals=function(e){return this===e||l.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame},c}),r("DataSources/StripeOrientation",["../Core/freezeObject"],function(e){"use strict";var t={HORIZONTAL:0,VERTICAL:1};return e(t)}),r("DataSources/StripeMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property","./StripeOrientation"],function(e,t,r,i,n,o,a){"use strict";var s=a.HORIZONTAL,l=e.WHITE,u=e.BLACK,c=0,h=1,d=function(){this._definitionChanged=new i,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};return r(d.prototype,{isConstant:{get:function(){return o.isConstant(this._orientation)&&o.isConstant(this._evenColor)&&o.isConstant(this._oddColor)&&o.isConstant(this._offset)&&o.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:n("orientation"),evenColor:n("evenColor"),oddColor:n("oddColor"),offset:n("offset"),repeat:n("repeat")}),d.prototype.getType=function(){return"Stripe"},d.prototype.getValue=function(e,r){return t(r)||(r={}),r.horizontal=o.getValueOrDefault(this._orientation,e,s)===a.HORIZONTAL,r.evenColor=o.getValueOrClonedDefault(this._evenColor,e,l,r.evenColor),r.oddColor=o.getValueOrClonedDefault(this._oddColor,e,u,r.oddColor),r.offset=o.getValueOrDefault(this._offset,e,c),r.repeat=o.getValueOrDefault(this._repeat,e,h),r},d.prototype.equals=function(e){return this===e||e instanceof d&&o.equals(this._orientation,e._orientation)&&o.equals(this._evenColor,e._evenColor)&&o.equals(this._oddColor,e._oddColor)&&o.equals(this._offset,e._offset)&&o.equals(this._repeat,e._repeat)},d.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},d}),r("DataSources/TimeIntervalCollectionPositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","../Core/TimeIntervalCollection","./PositionProperty","./Property"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(t){this._definitionChanged=new n,this._intervals=new a,this._intervals.changedEvent.addEventListener(u.prototype._intervalsChanged,this),this._referenceFrame=e(t,o.FIXED)};return r(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,r,i){var n=this._intervals.findDataForIntervalContainingDate(e);return t(n)?s.convertToReferenceFrame(e,n,this._referenceFrame,r,i):void 0},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}),r("DataSources/TimeIntervalCollectionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/isArray","../Core/TimeIntervalCollection","./Property"],function(e,t,r,i,n,o,a){"use strict";var s=function(){this._definitionChanged=new i,this._intervals=new o,this._intervals.changedEvent.addEventListener(s.prototype._intervalsChanged,this)};return t(s.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),s.prototype.getValue=function(t,r){var i=this._intervals.findDataForIntervalContainingDate(t);return e(i)&&"object"==typeof i&&!n(i)?i.clone(r):i},s.prototype.equals=function(e){return this===e||e instanceof s&&this._intervals.equals(e._intervals,a.equals)},s.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},s}),r("DataSources/WallGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";var a=function(){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._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._definitionChanged=new n};return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),material:o("material"),positions:o("positions"),minimumHeights:o("minimumHeights"),maximumHeights:o("maximumHeights"),granularity:o("granularity"),fill:o("fill"),outline:o("outline"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth")}),a.prototype.clone=function(e){return t(e)||(e=new a),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},a.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)},a}),r("DataSources/CzmlDataSource",["../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/ExtrapolationType","../Core/getFilenameFromUri","../Core/HermitePolynomialApproximation","../Core/isArray","../Core/Iso8601","../Core/JulianDate","../Core/LagrangePolynomialApproximation","../Core/LinearApproximation","../Core/loadJson","../Core/Math","../Core/Quaternion","../Core/Rectangle","../Core/ReferenceFrame","../Core/RuntimeError","../Core/Spherical","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/VerticalOrigin","../ThirdParty/Uri","../ThirdParty/when","./BillboardGraphics","./ColorMaterialProperty","./CompositeMaterialProperty","./CompositePositionProperty","./CompositeProperty","./ConstantPositionProperty","./ConstantProperty","./DataSourceClock","./EllipseGraphics","./EllipsoidGraphics","./EntityCollection","./GridMaterialProperty","./ImageMaterialProperty","./LabelGraphics","./ModelGraphics","./PathGraphics","./PointGraphics","./PolygonGraphics","./PolylineGlowMaterialProperty","./PolylineGraphics","./PolylineOutlineMaterialProperty","./PositionPropertyArray","./RectangleGraphics","./ReferenceProperty","./SampledPositionProperty","./SampledProperty","./StripeMaterialProperty","./StripeOrientation","./TimeIntervalCollectionPositionProperty","./TimeIntervalCollectionProperty","./WallGraphics"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S,E,b,T,x,P,A,M,D,I,O,R,L,N,F,B,z,V,k,U,W,G,H,q,j,Y,X,Z,Q,J,K,$,et,tt,rt,it,nt,ot,at,st,lt,ut,ct,ht){"use strict";function dt(e,t){return"#"===t[0]&&(t=Zt+t),nt.fromString(e,t)}function mt(e){var t=e.rgbaf;if(l(t))return t;var r=e.rgba;if(!l(r))return void 0;if(r.length===o.length)return[o.byteToFloat(r[0]),o.byteToFloat(r[1]),o.byteToFloat(r[2]),o.byteToFloat(r[3])];var i=r.length;t=new Array(i);for(var n=0;i>n;n+=5)t[n]=r[n],t[n+1]=o.byteToFloat(r[n+1]),t[n+2]=o.byteToFloat(r[n+2]),t[n+3]=o.byteToFloat(r[n+3]),t[n+4]=o.byteToFloat(r[n+4]);return t}function pt(e,t){var r=s(e.uri,e);if(l(t)){var i=new R(document.location.href);t=new R(t),r=new R(r).resolve(t.resolve(i)).toString()}return r}function ft(e){var t=e.wsenDegrees;if(l(t)){for(var r=t.length,i=0;r>i;i++)t[i]=S.toRadians(t[i]);return t}return e.wsen}function vt(e){if(l(e.cartesian))return e.cartesian;if(l(e.cartesianVelocity))return e.cartesianVelocity;if(l(e.unitCartesian))return e.unitCartesian;var r,i,n,o=e.unitSpherical;if(l(o)){if(i=o.length,2===i)Jt.clock=o[0],Jt.cone=o[1],t.fromSpherical(Jt,Qt),n=[Qt.x,Qt.y,Qt.z];else{var a=0;for(n=new Array(4*(i/3)),r=0;i>r;r+=4)n[r]=o[a++],Jt.clock=o[a++],Jt.cone=o[a++],t.fromSpherical(Jt,Qt),n[r+1]=Qt.x,n[r+2]=Qt.y,n[r+3]=Qt.z}return n}var s=e.cartographicRadians;if(l(s)){if(3===s.length)Kt.longitude=s[0],Kt.latitude=s[1],Kt.height=s[2],h.WGS84.cartographicToCartesian(Kt,Qt),n=[Qt.x,Qt.y,Qt.z];else for(i=s.length,n=new Array(i),r=0;i>r;r+=4)Kt.longitude=s[r+1],Kt.latitude=s[r+2],Kt.height=s[r+3],h.WGS84.cartographicToCartesian(Kt,Qt),n[r]=s[r],n[r+1]=Qt.x,n[r+2]=Qt.y,n[r+3]=Qt.z;return n}var u=e.cartographicDegrees;if(!l(u))throw new x(JSON.stringify(e)+" is not a valid CZML interval.");if(3===u.length)Kt.longitude=S.toRadians(u[0]),Kt.latitude=S.toRadians(u[1]),Kt.height=u[2],h.WGS84.cartographicToCartesian(Kt,Qt),n=[Qt.x,Qt.y,Qt.z];else for(i=u.length,n=new Array(i),r=0;i>r;r+=4)Kt.longitude=S.toRadians(u[r+1]),Kt.latitude=S.toRadians(u[r+2]),Kt.height=u[r+3],h.WGS84.cartographicToCartesian(Kt,Qt),n[r]=u[r],n[r+1]=Qt.x,n[r+2]=Qt.y,n[r+3]=Qt.z;return n}function gt(r,i,n){switch(r){case Boolean:return s(i["boolean"],i);case e:return i.cartesian2;case t:return vt(i);case o:return mt(i);case lt:return lt[s(i.stripeOrientation,i)];case D:return D[s(i.horizontalOrigin,i)];case Image:return pt(i,n);case _:return _.fromIso8601(s(i.date,i));case I:return I[s(i.labelStyle,i)];case Number:return s(i.number,i);case String:return s(i.string,i);case Array:return i.array;case E:return i.unitQuaternion;case b:return ft(i);case R:return pt(i,n);case O:return O[s(i.verticalOrigin,i)];default:throw new c(r)}}function _t(e,t){var r=e.interpolationAlgorithm;(l(r)||l(e.interpolationDegree))&&t.setInterpolationOptions({interpolationAlgorithm:er[r],interpolationDegree:e.interpolationDegree});var i=e.forwardExtrapolationType;l(i)&&(t.forwardExtrapolationType=m[i]);var n=e.forwardExtrapolationDuration;l(n)&&(t.forwardExtrapolationDuration=n);var o=e.backwardExtrapolationType;l(o)&&(t.backwardExtrapolationType=m[o]);var a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}function yt(e,t,r,i,n,o,a){var u,c=i.interval;l(c)?(tr.iso8601=c,u=A.fromIso8601(tr),l(n)&&(u=A.intersect(u,n,$t))):l(n)&&(u=n);var h,d,m,p,f=l(i.reference),v=l(u)&&!u.equals(g.MAXIMUM_INTERVAL);if(f||(m=gt(e,i,o),h=s(e.packedLength,1),p=s(m.length,1),d=!l(i.array)&&"string"!=typeof m&&p>h),!d&&!v)return t[r]=f?dt(a,i.reference):l(e.unpack)?new U(e.unpack(m,0)):new U(m),void 0;var y,C=t[r],w=i.epoch;if(l(w)&&(y=_.fromIso8601(w)),d&&!v)return C instanceof at||(C=new at(e),t[r]=C),C.addSamplesPackedArray(m,y),_t(i,C),void 0;var S;if(!d&&v)return u=u.clone(),u.data=f?dt(a,i.reference):l(e.unpack)?e.unpack(m,0):m,l(C)||(C=f?new V:new ct,t[r]=C),!f&&C instanceof ct?C.intervals.addInterval(u):C instanceof V?(u.data=f?u.data:new U(u.data),C.intervals.addInterval(u)):(S=g.MAXIMUM_INTERVAL.clone(),S.data=C,C=new V,t[r]=C,C.intervals.addInterval(S),u.data=f?u.data:new U(u.data),C.intervals.addInterval(u)),void 0;l(C)||(C=new V,t[r]=C),C instanceof V||(S=g.MAXIMUM_INTERVAL.clone(),S.data=C,C=new V,t[r]=C,C.intervals.addInterval(S));var E=C.intervals;S=E.findInterval(u),l(S)&&S.data instanceof at||(S=u.clone(),S.data=new at(e),E.addInterval(S)),S.data.addSamplesPackedArray(m,y),_t(i,S.data)}function Ct(e,t,r,i,n,o,a){if(l(i))if(v(i))for(var s=0,u=i.length;u>s;s++)yt(e,t,r,i[s],n,o,a);else yt(e,t,r,i,n,o,a)}function wt(e,r,i,n,o,a){var u,c=i.interval;l(c)?(tr.iso8601=c,u=A.fromIso8601(tr),l(n)&&(u=A.intersect(u,n,$t))):l(n)&&(u=n);var h,d,m,p=!1,f=l(i.cartesianVelocity)?1:0,v=t.packedLength*(f+1),y=l(i.reference),C=l(u)&&!u.equals(g.MAXIMUM_INTERVAL);if(y||(h=s(T[i.referenceFrame],void 0),d=vt(i),m=s(d.length,1),p=m>v),!p&&!C)return e[r]=y?dt(a,i.reference):new k(t.unpack(d),h),void 0;var w,S=e[r],E=i.epoch;if(l(E)&&(w=_.fromIso8601(E)),p&&!C)return(!(S instanceof ot)||l(h)&&S.referenceFrame!==h)&&(S=new ot(h,f),e[r]=S),S.addSamplesPackedArray(d,w),_t(i,S),void 0;var b;if(!p&&C)return u=u.clone(),u.data=y?dt(a,i.reference):t.unpack(d),l(S)||(S=y?new z(h):new ut(h),e[r]=S),!y&&S instanceof ut&&l(h)&&S.referenceFrame===h?S.intervals.addInterval(u):S instanceof z?(u.data=y?u.data:new k(u.data,h),S.intervals.addInterval(u)):(b=g.MAXIMUM_INTERVAL.clone(),b.data=S,S=new z(S.referenceFrame),e[r]=S,S.intervals.addInterval(b),u.data=y?u.data:new k(u.data,h),S.intervals.addInterval(u)),void 0;l(S)?S instanceof z||(b=g.MAXIMUM_INTERVAL.clone(),b.data=S,S=new z(S.referenceFrame),e[r]=S,S.intervals.addInterval(b)):(S=new z(h),e[r]=S);var x=S.intervals;b=x.findInterval(u),l(b)&&b.data instanceof ot&&(!l(h)||b.data.referenceFrame===h)||(b=u.clone(),b.data=new ot(h,f),x.addInterval(b)),b.data.addSamplesPackedArray(d,w),_t(i,b.data)}function St(e,t,r,i,n,o){if(l(r))if(v(r))for(var a=0,s=r.length;s>a;a++)wt(e,t,r[a],i,n,o);else wt(e,t,r,i,n,o)}function Et(t,r,i,n,a,s){var u,c=i.interval;l(c)?(tr.iso8601=c,u=A.fromIso8601(tr),l(n)&&(u=A.intersect(u,n,$t))):l(n)&&(u=n);var h,d,m=t[r];if(l(u)){m instanceof B||(m=new B,t[r]=m);var p=m.intervals;d=p.findInterval({start:u.start,stop:u.stop}),l(d)?h=d.data:(d=u.clone(),p.addInterval(d))}else h=m;var f;l(i.solidColor)?(h instanceof F||(h=new F),f=i.solidColor,Ct(o,h,"color",f.color,void 0,void 0,s)):l(i.grid)?(h instanceof j||(h=new j),f=i.grid,Ct(o,h,"color",f.color,void 0,a,s),Ct(Number,h,"cellAlpha",f.cellAlpha,void 0,a,s),Ct(e,h,"lineThickness",f.lineThickness,void 0,a,s),Ct(e,h,"lineOffset",f.lineOffset,void 0,a,s),Ct(e,h,"lineCount",f.lineCount,void 0,a,s)):l(i.image)?(h instanceof Y||(h=new Y),f=i.image,Ct(Image,h,"image",f.image,void 0,a,s),Ct(e,h,"repeat",f.repeat,void 0,a,s)):l(i.stripe)?(h instanceof st||(h=new st),f=i.stripe,Ct(lt,h,"orientation",f.orientation,void 0,a,s),Ct(o,h,"evenColor",f.evenColor,void 0,a,s),Ct(o,h,"oddColor",f.oddColor,void 0,a,s),Ct(Number,h,"offset",f.offset,void 0,a,s),Ct(Number,h,"repeat",f.repeat,void 0,a,s)):l(i.polylineOutline)?(h instanceof tt||(h=new tt),f=i.polylineOutline,Ct(o,h,"color",f.color,void 0,a,s),Ct(o,h,"outlineColor",f.outlineColor,void 0,a,s),Ct(Number,h,"outlineWidth",f.outlineWidth,void 0,a,s)):l(i.polylineGlow)&&(h instanceof $||(h=new $),f=i.polylineGlow,Ct(o,h,"color",f.color,void 0,a,s),Ct(Number,h,"glowPower",f.glowPower,void 0,a,s)),l(d)?d.data=h:t[r]=h}function bt(e,t,r,i,n,o){if(l(r))if(v(r))for(var a=0,s=r.length;s>a;a++)Et(e,t,r[a],i,n,o);else Et(e,t,r,i,n,o)}function Tt(e,t){e.name=s(t.name,e.name)}function xt(e,t,r,i){var n=t.description;l(n)&&Ct(String,e,"description",n,void 0,i,r)}function Pt(e,t,r,i){var n=t.position;l(n)&&St(e,"position",n,void 0,i,r)}function At(e,r,i,n){var o=r.viewFrom;l(o)&&Ct(t,e,"viewFrom",o,void 0,n,i)}function Mt(e,t,r,i){var n=t.orientation;l(n)&&Ct(E,e,"orientation",n,void 0,i,r)}function Dt(e,r,i){var n,o,a=r.references;if(l(a)){var s=[];for(n=0,o=a.length;o>n;n++)s.push(dt(i,a[n]));var u=r.interval;l(u)?(u=A.fromIso8601(u),e.positions instanceof z||(e.positions=new z,u.data=new rt(s),e.positions.intervals.addInterval(u))):e.positions=new rt(s)}else{var c=[],d=r.cartesian;if(l(d)){for(n=0,o=d.length;o>n;n+=3)c.push(new t(d[n],d[n+1],d[n+2]));r.array=c}else if(d=r.cartographicRadians,l(d)){for(n=0,o=d.length;o>n;n+=3)Kt.longitude=d[n],Kt.latitude=d[n+1],Kt.height=d[n+2],c.push(h.WGS84.cartographicToCartesian(Kt));r.array=c}else if(d=r.cartographicDegrees,l(d)){for(n=0,o=d.length;o>n;n+=3)c.push(t.fromDegrees(d[n],d[n+1],d[n+2]));r.array=c}l(r.array)&&Ct(Array,e,"positions",r,void 0,void 0,i)}}function It(e,t,r){if(l(t))if(v(t))for(var i=t.length,n=0;i>n;n++)Dt(e,t[n],r);else Dt(e,t,r)}function Ot(e,t){var r,i=t.availability;if(l(i)){var n;if(v(i))for(var o=i.length,a=0;o>a;a++)l(n)||(n=new M),tr.iso8601=i[a],r=A.fromIso8601(tr),n.addInterval(r);else tr.iso8601=i,r=A.fromIso8601(tr),n=new M,n.addInterval(r);e.availability=n}}function Rt(r,i,n,a){var s=i.billboard;if(l(s)){var u,c=s.interval;l(c)&&(tr.iso8601=c,u=A.fromIso8601(tr));var h=r.billboard;l(h)||(r.billboard=h=new N),Ct(o,h,"color",s.color,u,a,n),Ct(t,h,"eyeOffset",s.eyeOffset,u,a,n),Ct(D,h,"horizontalOrigin",s.horizontalOrigin,u,a,n),Ct(Image,h,"image",s.image,u,a,n),Ct(e,h,"pixelOffset",s.pixelOffset,u,a,n),Ct(Number,h,"scale",s.scale,u,a,n),Ct(Number,h,"rotation",s.rotation,u,a,n),Ct(t,h,"alignedAxis",s.alignedAxis,u,a,n),Ct(Boolean,h,"show",s.show,u,a,n),Ct(O,h,"verticalOrigin",s.verticalOrigin,u,a,n)}}function Lt(e,t){var r=e.version;if(l(r)&&"string"==typeof r){var i=r.split(".");if(2===i.length){if("1"!==i[0])throw new x("Cesium only supports CZML version 1.");t._version=r}}if(!l(t._version))throw new x("CZML version information invalid. It is expected to be a property on the document object in the . version format.");var n=t._documentPacket;l(e.name)&&(n.name=e.name);var o=e.clock;if(l(o)){var a=n.clock;l(a)?(a.interval=s(o.interval,a.interval),a.currentTime=s(o.currentTime,a.currentTime),a.range=s(o.range,a.range),a.step=s(o.step,a.step),a.multiplier=s(o.multiplier,a.multiplier)):n.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function Nt(e,t,r,i){var n=t.ellipse;if(l(n)){var a,s=n.interval;l(s)&&(tr.iso8601=s,a=A.fromIso8601(tr));var u=e.ellipse;l(u)||(e.ellipse=u=new G),Ct(Boolean,u,"show",n.show,a,i,r),Ct(Number,u,"rotation",n.rotation,a,i,r),Ct(Number,u,"semiMajorAxis",n.semiMajorAxis,a,i,r),Ct(Number,u,"semiMinorAxis",n.semiMinorAxis,a,i,r),Ct(Number,u,"height",n.height,a,i,r),Ct(Number,u,"extrudedHeight",n.extrudedHeight,a,i,r),Ct(Number,u,"granularity",n.granularity,a,i,r),Ct(Number,u,"stRotation",n.stRotation,a,i,r),bt(u,"material",n.material,a,i,r),Ct(Boolean,u,"fill",n.fill,a,i,r),Ct(Boolean,u,"outline",n.outline,a,i,r),Ct(o,u,"outlineColor",n.outlineColor,a,i,r),Ct(Number,u,"outlineWidth",n.outlineWidth,a,i,r),Ct(Number,u,"numberOfVerticalLines",n.numberOfVerticalLines,a,i,r)}}function Ft(e,r,i,n){var a=r.ellipsoid;if(l(a)){var s,u=a.interval;l(u)&&(tr.iso8601=u,s=A.fromIso8601(tr));var c=e.ellipsoid;l(c)||(e.ellipsoid=c=new H),Ct(Boolean,c,"show",a.show,s,n,i),Ct(t,c,"radii",a.radii,s,n,i),bt(c,"material",a.material,s,n,i),Ct(Boolean,c,"fill",a.fill,s,n,i),Ct(Boolean,c,"outline",a.outline,s,n,i),Ct(o,c,"outlineColor",a.outlineColor,s,n,i),Ct(Number,c,"outlineWidth",a.outlineWidth,s,n,i)}}function Bt(r,i,n,a){var s=i.label;if(l(s)){var u,c=s.interval;l(c)&&(tr.iso8601=c,u=A.fromIso8601(tr));var h=r.label;l(h)||(r.label=h=new X),Ct(o,h,"fillColor",s.fillColor,u,a,n),Ct(o,h,"outlineColor",s.outlineColor,u,a,n),Ct(Number,h,"outlineWidth",s.outlineWidth,u,a,n),Ct(t,h,"eyeOffset",s.eyeOffset,u,a,n),Ct(D,h,"horizontalOrigin",s.horizontalOrigin,u,a,n),Ct(String,h,"text",s.text,u,a,n),Ct(e,h,"pixelOffset",s.pixelOffset,u,a,n),Ct(Number,h,"scale",s.scale,u,a,n),Ct(Boolean,h,"show",s.show,u,a,n),Ct(O,h,"verticalOrigin",s.verticalOrigin,u,a,n),Ct(String,h,"font",s.font,u,a,n),Ct(I,h,"style",s.style,u,a,n)}}function zt(e,t,r,i){var n=t.model;if(l(n)){var o,a=n.interval;l(a)&&(tr.iso8601=a,o=A.fromIso8601(tr));var s=e.model;l(s)||(e.model=s=new Z),Ct(Boolean,s,"show",n.show,o,i,r),Ct(Number,s,"scale",n.scale,o,i,r),Ct(Number,s,"minimumPixelSize",n.minimumPixelSize,o,i,r),Ct(R,s,"uri",n.gltf,o,i,r)}}function Vt(e,t,r,i){var n=t.path;if(l(n)){var o,a=n.interval;l(a)&&(tr.iso8601=a,o=A.fromIso8601(tr));var s=e.path;l(s)||(e.path=s=new Q),Ct(Boolean,s,"show",n.show,o,i,r),Ct(Number,s,"width",n.width,o,i,r),Ct(Number,s,"resolution",n.resolution,o,i,r),Ct(Number,s,"leadTime",n.leadTime,o,i,r),Ct(Number,s,"trailTime",n.trailTime,o,i,r),bt(s,"material",n.material,o,i,r)}}function kt(e,t,r,i){var n=t.point;if(l(n)){var a,s=n.interval;l(s)&&(tr.iso8601=s,a=A.fromIso8601(tr));var u=e.point;l(u)||(e.point=u=new J),Ct(o,u,"color",n.color,a,i,r),Ct(Number,u,"pixelSize",n.pixelSize,a,i,r),Ct(o,u,"outlineColor",n.outlineColor,a,i,r),Ct(Number,u,"outlineWidth",n.outlineWidth,a,i,r),Ct(Boolean,u,"show",n.show,a,i,r)}}function Ut(e,t,r,i){var n=t.polygon;if(l(n)){var a,s=n.interval;l(s)&&(tr.iso8601=s,a=A.fromIso8601(tr));var u=e.polygon;l(u)||(e.polygon=u=new K),Ct(Boolean,u,"show",n.show,a,i,r),bt(u,"material",n.material,a,i,r),Ct(Number,u,"height",n.height,a,i,r),Ct(Number,u,"extrudedHeight",n.extrudedHeight,a,i,r),Ct(Number,u,"granularity",n.granularity,a,i,r),Ct(Number,u,"stRotation",n.stRotation,a,i,r),Ct(Boolean,u,"fill",n.fill,a,i,r),Ct(Boolean,u,"outline",n.outline,a,i,r),Ct(o,u,"outlineColor",n.outlineColor,a,i,r),Ct(Number,u,"outlineWidth",n.outlineWidth,a,i,r),Ct(Boolean,u,"perPositionHeight",n.perPositionHeight,a,i,r),It(u,n.positions,r)}}function Wt(e,t,r,i){var n=t.rectangle;if(l(n)){var a,s=n.interval;l(s)&&(tr.iso8601=s,a=A.fromIso8601(tr));var u=e.rectangle;l(u)||(e.rectangle=u=new it),Ct(Boolean,u,"show",n.show,a,i,r),Ct(b,u,"coordinates",n.coordinates,a,i,r),bt(u,"material",n.material,a,i,r),Ct(Number,u,"height",n.height,a,i,r),Ct(Number,u,"extrudedHeight",n.extrudedHeight,a,i,r),Ct(Number,u,"granularity",n.granularity,a,i,r),Ct(Number,u,"rotation",n.rotation,a,i,r),Ct(Number,u,"stRotation",n.stRotation,a,i,r),Ct(Boolean,u,"fill",n.fill,a,i,r),Ct(Boolean,u,"outline",n.outline,a,i,r),Ct(o,u,"outlineColor",n.outlineColor,a,i,r),Ct(Number,u,"outlineWidth",n.outlineWidth,a,i,r),Ct(Boolean,u,"closeBottom",n.closeBottom,a,i,r),Ct(Boolean,u,"closeTop",n.closeTop,a,i,r)}}function Gt(e,t,r,i){var n=t.wall;if(l(n)){var a,s=n.interval;l(s)&&(tr.iso8601=s,a=A.fromIso8601(tr));var u=e.wall;l(u)||(e.wall=u=new ht),Ct(Boolean,u,"show",n.show,a,i,r),bt(u,"material",n.material,a,i,r),Ct(Array,u,"minimumHeights",n.minimumHeights,a,i,r),Ct(Array,u,"maximumHeights",n.maximumHeights,a,i,r),Ct(Number,u,"granularity",n.granularity,a,i,r),Ct(Boolean,u,"fill",n.fill,a,i,r),Ct(Boolean,u,"outline",n.outline,a,i,r),Ct(o,u,"outlineColor",n.outlineColor,a,i,r),Ct(Number,u,"outlineWidth",n.outlineWidth,a,i,r),It(u,n.positions,r)}}function Ht(e,t,r,i){var n=t.polyline;if(l(n)){var o,a=n.interval;l(a)&&(tr.iso8601=a,o=A.fromIso8601(tr));var s=e.polyline;l(s)||(e.polyline=s=new et),Ct(Boolean,s,"show",n.show,o,i,r),Ct(Number,s,"width",n.width,o,i,r),bt(s,"material",n.material,o,i,r),Ct(Boolean,s,"followSurface",n.followSurface,o,i,r),Ct(Number,s,"granularity",n.granularity,o,i,r),It(s,n.positions,r)}}function qt(e,t,r,i,n){var o=e.id;if(l(o)||(o=a()),Zt=o,!l(n._version)&&"document"!==o)throw new x("The first CZML packet is required to be the document object.");if(e["delete"]===!0)t.removeById(o);else if("document"===o)Lt(e,n);else{var s=t.getOrCreateEntity(o),u=e.parent;l(u)&&(s.parent=t.getOrCreateEntity(u));for(var c=r.length-1;c>-1;c--)r[c](s,e,t,i)}Zt=void 0}function jt(e){var t,r=e._documentPacket.clock;if(!l(r)){if(!l(e._clock)){var o=e._entityCollection.computeAvailability();if(!o.start.equals(g.MINIMUM_VALUE)){var a=o.start,u=o.stop,c=_.secondsDifference(u,a),h=Math.round(c/120);return t=new W,t.startTime=_.clone(a),t.stopTime=_.clone(u),t.clockRange=i.LOOP_STOP,t.multiplier=h,t.currentTime=_.clone(a),t.clockStep=n.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}if(l(e._clock)?t=e._clock.clone():(t=new W,t.startTime=g.MINIMUM_VALUE.clone(),t.stopTime=g.MAXIMUM_VALUE.clone(),t.currentTime=g.MINIMUM_VALUE.clone(),t.clockRange=i.LOOP_STOP,t.clockStep=n.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1),l(r.interval)){tr.iso8601=r.interval;var d=A.fromIso8601(tr);t.startTime=d.start,t.stopTime=d.stop}return l(r.currentTime)&&(t.currentTime=_.fromIso8601(r.currentTime)),l(r.range)&&(t.clockRange=s(i[r.range],i.LOOP_STOP)),l(r.step)&&(t.clockStep=s(n[r.step],n.SYSTEM_CLOCK_MULTIPLIER)),l(r.multiplier)&&(t.multiplier=r.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function Yt(e,t,r,i){var n=e._entityCollection;n.suspendEvents(),i&&(e._version=void 0,e._documentPacket=new rr,n.removeAll()),ir._processCzml(t,n,r,void 0,e);var o=jt(e),a=e._documentPacket;l(a.name)&&e._name!==a.name?(e._name=a.name,o=!0):!l(e._name)&&l(r)&&(e._name=p(r),o=!0),n.resumeEvents(),o&&e._changed.raiseEvent(e)}function Xt(e,t){e._isLoading!==t&&(e._isLoading=t,e._loading.raiseEvent(e,t))}var Zt,Qt=new t,Jt=new P,Kt=new r,$t=new A,er={HERMITE:f,LAGRANGE:y,LINEAR:C},tr={iso8601:void 0},rr=function(){this.name=void 0,this.clock=void 0 -},ir=function(e){this._name=e,this._changed=new d,this._error=new d,this._isLoading=!1,this._loading=new d,this._clock=void 0,this._documentPacket=new rr,this._version=void 0,this._entityCollection=new q};return u(ir.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}}}),ir.updaters=[Rt,Nt,Ft,Bt,zt,Tt,xt,Vt,kt,Ut,Ht,Wt,Pt,At,Gt,Mt,Ot],ir.prototype.process=function(e,t){Yt(this,e,t,!1)},ir.prototype.load=function(e,t){Yt(this,e,t,!0)},ir.prototype.processUrl=function(e){Xt(this,!0);var t=this;return L(w(e),function(r){t.process(r,e),Xt(t,!1)}).otherwise(function(e){return Xt(t,!1),t._error.raiseEvent(t,e),L.reject(e)})},ir.prototype.loadUrl=function(e){Xt(this,!0);var t=this;return L(w(e),function(r){t.load(r,e),Xt(t,!1)}).otherwise(function(e){return Xt(t,!1),t._error.raiseEvent(t,e),L.reject(e)})},ir.processPacketData=Ct,ir.processPositionPacketData=St,ir.processMaterialPacketData=bt,ir._processCzml=function(e,t,r,i,n){if(i=l(i)?i:ir.updaters,v(e))for(var o=0,a=e.length;a>o;o++)qt(e[o],t,i,r,n);else qt(e,t,i,r,n)},ir}),r("DataSources/DataSource",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";var r=function(){t.throwInstantiationError()};return e(r.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}}),r.prototype.update=t.throwInstantiationError,r}),r("DataSources/DataSourceCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event"],function(e,t,r,i,n,o){"use strict";var a=function(){this._dataSources=[],this._dataSourceAdded=new o,this._dataSourceRemoved=new o};return r(a.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}}}),a.prototype.add=function(e){this._dataSources.push(e),this._dataSourceAdded.raiseEvent(this,e)},a.prototype.remove=function(t,r){r=e(r,!1);var i=this._dataSources.indexOf(t);return-1!==i?(this._dataSources.splice(i,1),this._dataSourceRemoved.raiseEvent(this,t),r&&"function"==typeof t.destroy&&t.destroy(),!0):!1},a.prototype.removeAll=function(t){t=e(t,!1);for(var r=this._dataSources,i=0,n=r.length;n>i;++i){var o=r[i];this._dataSourceRemoved.raiseEvent(this,o),t&&"function"==typeof o.destroy&&o.destroy()}r.length=0},a.prototype.contains=function(e){return-1!==this.indexOf(e)},a.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},a.prototype.get=function(e){return this._dataSources[e]},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this.removeAll(!0),i(this)},a}),r("DataSources/EllipseGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipseGeometry","../Core/EllipseOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y){"use strict";var C=v.fromColor(e.WHITE),w=new g(!0),S=new g(!0),E=new g(!1),b=new g(e.BLACK),T=function(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},x=function(e,t,r){this._entity=e,this._scene=t,this._propertyName=i(r)?r:"ellipse",this._entitySubscription=e.definitionChanged.addEventListener(x.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._options=new T(e),this._onEntityPropertyChanged(e,this._propertyName,e[this._propertyName],void 0)};n(x,{perInstanceColorAppearanceType:{value:p},materialAppearanceType:{value:m}}),n(x.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._entity.availability)&&y.isConstant(this._showProperty)&&y.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!i(this._entity.availability)&&y.isConstant(this._showProperty)&&y.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),x.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},x.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},x.prototype.createFillGeometryInstance=function(r){var n,o,a=this._entity,l=a.isAvailable(r),u=new d(l&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r));if(this._materialProperty instanceof v){var h=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(h=this._materialProperty.color.getValue(r)),o=t.fromColor(h),n={show:u,color:o}}else n={show:u};return new c({id:a,geometry:new s(this._options),attributes:n})},x.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r);return new c({id:i,geometry:new l(this._options),attributes:{show:new d(n&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(n?this._outlineColorProperty.getValue(r):e.BLACK)}})},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._entitySubscription(),o(this)},x.prototype._onEntityPropertyChanged=function(e,t){if("availability"===t||"position"===t||t===this._propertyName){var n=e[t];if(!i(n))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var o=n.fill,a=i(o)&&o.isConstant?o.getValue(h.MINIMUM_VALUE):!0,s=n.outline,l=i(s);if(l&&s.isConstant&&(l=s.getValue(h.MINIMUM_VALUE)),!a&&!l)return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var u=this._entity.position,c=n.semiMajorAxis,d=n.semiMinorAxis,f=n.show;if(i(f)&&f.isConstant&&!f.getValue(h.MINIMUM_VALUE)||!i(u)||!i(c)||!i(d))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var g=r(n.material,C),_=g instanceof v;this._materialProperty=g,this._fillProperty=r(o,S),this._showProperty=r(f,w),this._showOutlineProperty=r(n.outline,E),this._outlineColorProperty=l?r(n.outlineColor,b):void 0;var T=n.rotation,x=n.height,P=n.extrudedHeight,A=n.granularity,M=n.stRotation,D=n.outlineWidth,I=n.numberOfVerticalLines;if(this._isClosed=i(P),this._fillEnabled=a,this._outlineEnabled=l,u.isConstant&&c.isConstant&&d.isConstant&&y.isConstant(T)&&y.isConstant(x)&&y.isConstant(P)&&y.isConstant(A)&&y.isConstant(M)&&y.isConstant(D)&&y.isConstant(I)){var O=this._options;O.vertexFormat=_?p.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,O.center=u.getValue(h.MINIMUM_VALUE,O.center),O.semiMajorAxis=c.getValue(h.MINIMUM_VALUE,O.semiMajorAxis),O.semiMinorAxis=d.getValue(h.MINIMUM_VALUE,O.semiMinorAxis),O.rotation=i(T)?T.getValue(h.MINIMUM_VALUE):void 0,O.height=i(x)?x.getValue(h.MINIMUM_VALUE):void 0,O.extrudedHeight=i(P)?P.getValue(h.MINIMUM_VALUE):void 0,O.granularity=i(A)?A.getValue(h.MINIMUM_VALUE):void 0,O.stRotation=i(M)?M.getValue(h.MINIMUM_VALUE):void 0,O.numberOfVerticalLines=i(I)?I.getValue(h.MINIMUM_VALUE):void 0,this._outlineWidth=i(D)?D.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},x.prototype.createDynamicUpdater=function(e){return new P(e,this)};var P=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new T(t._entity)};return P.prototype.update=function(r){var n=this._geometryUpdater;i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive);var o=n._entity,a=o[n._propertyName],u=a.show;if(o.isAvailable(r)&&(!i(u)||u.getValue(r))){var h=this._options,d=o.position,v=a.semiMajorAxis,g=a.semiMinorAxis,y=a.rotation,C=a.height,w=a.extrudedHeight,S=a.granularity,E=a.stRotation,b=a.numberOfVerticalLines;if(h.center=d.getValue(r,h.center),h.semiMajorAxis=v.getValue(r,h.semiMajorAxis),h.semiMinorAxis=g.getValue(r,h.semiMinorAxis),h.rotation=i(y)?y.getValue(r,h):void 0,h.height=i(C)?C.getValue(r,h):void 0,h.extrudedHeight=i(w)?w.getValue(r,h):void 0,h.granularity=i(S)?S.getValue(r):void 0,h.stRotation=i(E)?E.getValue(r):void 0,!i(a.fill)||a.fill.getValue(r)){this._material=_.getValue(r,n.fillMaterialProperty,this._material);var T=this._material,x=new m({material:T,translucent:T.isTranslucent(),closed:i(h.extrudedHeight)});h.vertexFormat=x.vertexFormat,this._primitive=new f({geometryInstances:new c({id:o,geometry:new s(h)}),appearance:x,asynchronous:!1}),this._primitives.add(this._primitive)}if(i(a.outline)&&a.outline.getValue(r)){h.vertexFormat=p.VERTEX_FORMAT,h.numberOfVerticalLines=i(b)?b.getValue(r):void 0;var P=i(a.outlineColor)?a.outlineColor.getValue(r):e.BLACK,A=i(a.outlineWidth)?a.outlineWidth.getValue(r):1,M=1!==P.alpha;this._outlinePrimitive=new f({geometryInstances:new c({id:o,geometry:new l(h),attributes:{color:t.fromColor(P)}}),appearance:new p({flat:!0,translucent:M,renderState:{depthTest:{enabled:!M},lineWidth:n._scene.clampLineWidth(A)}}),asynchronous:!1}),this._primitives.add(this._outlinePrimitive)}}},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive),o(this)},x}),r("DataSources/EllipsoidGeometryUpdater",["../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidGeometry","../Core/EllipsoidOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/Matrix3","../Core/Matrix4","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/SceneMode","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S,E){"use strict";var b,T,x,P,A=C.fromColor(t.WHITE),M=new w(!0),D=new w(!0),I=new w(!1),O=new w(t.BLACK),R=new e(1,1,1),L=function(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0},N=function(e,t,r){this._scene=t,this._entity=e,this._propertyName=n(r)?r:"ellipsoid",this._entitySubscription=e.definitionChanged.addEventListener(N.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new c,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new L(e),this._onEntityPropertyChanged(e,this._propertyName,e[this._propertyName],void 0)};o(N,{perInstanceColorAppearanceType:{value:g},materialAppearanceType:{value:v}}),o(N.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(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||!n(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),N.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},N.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},N.prototype.createFillGeometryInstance=function(e){var i,o,a=this._entity,s=a.isAvailable(e),u=new f(s&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e));if(this._materialProperty instanceof C){var c=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(c=this._materialProperty.color.getValue(e)),o=r.fromColor(c),i={show:u,color:o}}else i={show:u};return b=a.position.getValue(d.MINIMUM_VALUE,b),T=a.orientation.getValue(d.MINIMUM_VALUE,T),P=m.fromQuaternion(T,P),new h({id:a,geometry:new l(this._options),modelMatrix:p.fromRotationTranslation(P,b),attributes:i})},N.prototype.createOutlineGeometryInstance=function(e){var i=this._entity,n=i.isAvailable(e);return b=i.position.getValue(d.MINIMUM_VALUE,b),T=i.orientation.getValue(d.MINIMUM_VALUE,T),P=m.fromQuaternion(T,P),new h({id:i,geometry:new u(this._options),modelMatrix:p.fromRotationTranslation(P,b),attributes:{show:new f(n&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(n?this._outlineColorProperty.getValue(e):t.BLACK)}})},N.prototype.isDestroyed=function(){return!1},N.prototype.destroy=function(){this._entitySubscription(),a(this)},N.prototype._onEntityPropertyChanged=function(e,t){if("availability"===t||"position"===t||"orientation"===t||t===this._propertyName){var r=e[t];if(!n(r))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var o=r.fill,a=n(o)&&o.isConstant?o.getValue(d.MINIMUM_VALUE):!0,s=r.outline,l=n(s);if(l&&s.isConstant&&(l=s.getValue(d.MINIMUM_VALUE)),!a&&!l)return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var u=this._entity.position,c=this._entity.orientation,h=r.radii,m=r.show;if(n(m)&&m.isConstant&&!m.getValue(d.MINIMUM_VALUE)||!n(u)||!n(c)||!n(h))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var p=i(r.material,A),f=p instanceof C;this._materialProperty=p,this._fillProperty=i(o,D),this._showProperty=i(m,M),this._showOutlineProperty=i(r.outline,I),this._outlineColorProperty=l?i(r.outlineColor,O):void 0,this._fillEnabled=a,this._outlineEnabled=l;var _=r.stackPartitions,y=r.slicePartitions,w=r.outlineWidth,S=r.subdivisions;if(u.isConstant&&c.isConstant&&h.isConstant&&E.isConstant(_)&&E.isConstant(y)&&E.isConstant(w)&&E.isConstant(S)){var b=this._options;b.vertexFormat=f?g.VERTEX_FORMAT:v.MaterialSupport.TEXTURED.vertexFormat,b.radii=h.getValue(d.MINIMUM_VALUE,b.radii),b.stackPartitions=n(_)?_.getValue(d.MINIMUM_VALUE):void 0,b.slicePartitions=n(y)?y.getValue(d.MINIMUM_VALUE):void 0,b.subdivisions=n(S)?S.getValue(d.MINIMUM_VALUE):void 0,this._outlineWidth=n(w)?w.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},N.prototype.createDynamicUpdater=function(e){return new F(e,this)};var F=function(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 L(t._entity),this._modelMatrix=new p,this._material=void 0,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastOutlineWidth=void 0};return F.prototype.update=function(e){var o=this._entity,a=o[geometryUpdater._propertyName],s=a.show;if(!o.isAvailable(e)||n(s)&&!s.getValue(e))return n(this._primitive)&&(this._primitive.show=!1),n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1),void 0;var c,d=!n(a.fill)||a.fill.getValue(e),C=n(a.outline)&&a.outline.getValue(e),w=n(a.outlineColor)?a.outlineColor.getValue(e):t.BLACK,E=S.getValue(e,i(a.material,A),this._material);this._material=E;var M=a.stackPartitions,D=a.slicePartitions,I=a.subdivisions,O=a.outlineWidth,L=n(M)?M.getValue(e):void 0,N=n(D)?D.getValue(e):void 0,F=n(I)?I.getValue(e):void 0,B=n(O)?O.getValue(e):1,z=this._options,V=this._scene.mode,k=V===y.SCENE3D,U=this._modelMatrix,W=o.position,G=o.orientation,H=a.radii;b=W.getValue(e,b),T=G.getValue(e,T),P=m.fromQuaternion(T,P),x=H.getValue(e,x),U=p.fromRotationTranslation(P,b,U);var q=!k||this._lastSceneMode!==V||!n(this._primitive)||z.stackPartitions!==L||z.slicePartitions!==N||z.subdivisions!==F||this._lastOutlineWidth!==B;if(q){this._removePrimitives(),this._lastSceneMode=V,this._lastOutlineWidth=B,z.stackPartitions=L,z.slicePartitions=N,z.subdivisions=F,z.radii=k?R:x,this._material=E,E=this._material,c=new v({material:E,translucent:E.isTranslucent(),closed:!0}),z.vertexFormat=c.vertexFormat,this._primitive=new _({geometryInstances:new h({id:o,geometry:new l(z),modelMatrix:k?void 0:U,attributes:{show:new f(d)}}),appearance:c,asynchronous:!1}),this._primitives.add(this._primitive),z.vertexFormat=g.VERTEX_FORMAT;var j=1!==w.alpha;this._outlinePrimitive=new _({geometryInstances:new h({id:o,geometry:new u(z),modelMatrix:k?void 0:U,attributes:{show:new f(C),color:r.fromColor(w)}}),appearance:new g({flat:!0,translucent:j,renderState:{depthTest:{enabled:!j},lineWidth:this._geometryUpdater._scene.clampLineWidth(B)}}),asynchronous:!1}),this._primitives.add(this._outlinePrimitive)}else if(this._primitive.ready){var Y=this._primitive;c=Y.appearance,c.material=E;var X=this._attributes;n(X)||(X=Y.getGeometryInstanceAttributes(o),this._attributes=X),X.show=f.toValue(d,X.show);var Z=this._outlinePrimitive,Q=this._outlineAttributes;n(Q)||(Q=Z.getGeometryInstanceAttributes(o),this._outlineAttributes=Q),Q.show=f.toValue(C,Q.show),Q.color=r.toValue(w,Q.color)}k&&(x.x=Math.max(x.x,.001),x.y=Math.max(x.y,.001),x.z=Math.max(x.z,.001),U=p.multiplyByScale(U,x,U),this._primitive.modelMatrix=U,this._outlinePrimitive.modelMatrix=U)},F.prototype.isDestroyed=function(){return!1},F.prototype._removePrimitives=function(){n(this._primitive)&&this._primitives.remove(this._primitive),n(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive)},F.prototype.destroy=function(){this._removePrimitives(),a(this)},N}),r("DataSources/StaticGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive"],function(e,t,r,i,n,o){"use strict";var a=new t,s=function(t,r,i,n){this.translucent=r,this.appearanceType=i,this.closed=n,this.primitives=t,this.createPrimitive=!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=[]};s.prototype.add=function(e,t){var r=e.entity.id;this.createPrimitive=!0,this.geometry.set(r,t),this.updaters.set(r,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant||this.updatersWithAttributes.set(r,e)},s.prototype.remove=function(e){var t=e.entity.id;this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t),this.updatersWithAttributes.remove(t)},s.prototype.update=function(e){var s=!0,l=!0,u=0,c=this.primitive,h=this.primitives;if(this.createPrimitive){this.attributes.removeAll(),i(c)&&(c.ready?this.oldPrimitive=c:h.remove(c),s=!1);var d=this.geometry.values;d.length>0&&(c=new o({asynchronous:!0,geometryInstances:d,appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed})}),c.show=s,h.add(c),l=!1),this.primitive=c,this.createPrimitive=!1}else if(i(c)&&c.ready){i(this.oldPrimitive)&&(h.remove(this.oldPrimitive),this.oldPrimitive=void 0,c.show=!0);for(var m=this.updatersWithAttributes.values,p=m.length,f=0;p>f;f++){var v=m[f],g=this.geometry.get(v.entity.id),_=this.attributes.get(g.id.id);if(i(_)||(_=c.getGeometryInstanceAttributes(g.id),this.attributes.set(g.id.id,_)),!v.fillMaterialProperty.isConstant){var y=v.fillMaterialProperty.color;y.getValue(e,a),t.equals(_._lastColor,a)||(_._lastColor=t.clone(a,_._lastColor),_.color=r.toValue(a,_.color),(this.translucent&&255===_.color[3]||!this.translucent&&255!==_.color[3])&&(this.itemsToRemove[u++]=v))}v.hasConstantFill||(s=v.isFilled(e),s!==_._lastShow&&(_._lastShow=s,_.show=n.toValue(s,_.show)))}}else i(c)&&!c.ready&&(l=!1);return this.itemsToRemove.length=u,l},s.prototype.removeAllPrimitives=function(){var e=this.primitive;i(e)&&(this.primitives.remove(e),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll())};var l=function(e,t,r){this._solidBatch=new s(e,!1,t,r),this._translucentBatch=new s(e,!0,t,r)};return l.prototype.add=function(e,t){var r=t.createFillGeometryInstance(e);255===r.attributes.color.value[3]?this._solidBatch.add(t,r):this._translucentBatch.add(t,r)},l.prototype.remove=function(e){this._solidBatch.remove(e)||this._translucentBatch.remove(e)},l.prototype.update=function(e){var t,r,i=this._solidBatch.update(e);i=this._translucentBatch.update(e)&&i;var n=this._solidBatch.itemsToRemove,o=n.length;if(o>0)for(t=0;o>t;t++)r=n[t],this._solidBatch.remove(r),this._translucentBatch.add(r,r.createFillGeometryInstance(e));n=this._translucentBatch.itemsToRemove;var a=n.length;if(a>0)for(t=0;a>t;t++)r=n[t],this._translucentBatch.remove(r),this._solidBatch.add(r,r.createFillGeometryInstance(e));return(o>0||a>0)&&(i=this._solidBatch.update(e)&&i,i=this._translucentBatch.update(e)&&i),i},l.prototype.removeAllPrimitives=function(){this._solidBatch.removeAllPrimitives(),this._translucentBatch.removeAllPrimitives()},l}),r("DataSources/StaticGeometryPerMaterialBatch",["../Core/AssociativeArray","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./MaterialProperty"],function(e,t,r,i,n){"use strict";var o=function(t,r,i,n){this.primitives=t,this.appearanceType=r,this.materialProperty=i,this.closed=n,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=i.definitionChanged.addEventListener(o.prototype.onMaterialChanged,this)};o.prototype.onMaterialChanged=function(){this.invalidated=!0},o.prototype.isMaterial=function(e){var r=this.materialProperty,i=e.fillMaterialProperty;return i===r?!0:t(r)?r.equals(i):!1},o.prototype.add=function(e,t){var r=t.entity.id;this.updaters.set(r,t),this.geometry.set(r,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant||this.updatersWithAttributes.set(r,t),this.createPrimitive=!0},o.prototype.remove=function(e){var t=e.entity.id;return this.createPrimitive=this.updaters.remove(t),this.geometry.remove(t),this.updatersWithAttributes.remove(t),this.createPrimitive},o.prototype.update=function(e){var o=!0,a=!0,s=this.primitive,l=this.primitives,u=this.geometry.values;if(this.createPrimitive)t(s)&&(s.ready?this.oldPrimitive=s:l.remove(s),o=!1),u.length>0&&(this.material=n.getValue(e,this.materialProperty,this.material),s=new i({asynchronous:!0,geometryInstances:u,appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed})}),s.show=o,l.add(s),a=!1),this.primitive=s,this.createPrimitive=!1;else if(t(s)&&s.ready){t(this.oldPrimitive)&&(l.remove(this.oldPrimitive),this.oldPrimitive=void 0,s.show=!0),this.material=n.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;for(var c=this.updatersWithAttributes.values,h=c.length,d=0;h>d;d++){var m=c[d],p=this.geometry.get(m.entity.id),f=this.attributes.get(p.id.id);t(f)||(f=s.getGeometryInstanceAttributes(p.id),this.attributes.set(p.id.id,f)),m.hasConstantFill||(o=m.isFilled(e),o!==f._lastShow&&(f._lastShow=o,f.show=r.toValue(o,f.show)))}}else t(s)&&!s.ready&&(a=!1);return a},o.prototype.destroy=function(){var e=this.primitive,r=this.primitives;t(e)&&r.remove(e),this.removeMaterialSubscription()};var a=function(e,t,r){this._items=[],this._primitives=e,this._appearanceType=t,this._closed=r};return a.prototype.add=function(e,t){for(var r=this._items,i=r.length,n=0;i>n;n++){var a=r[n];if(a.isMaterial(t))return a.add(e,t),void 0}var s=new o(this._primitives,this._appearanceType,t.fillMaterialProperty,this._closed);s.add(e,t),r.push(s)},a.prototype.remove=function(e){for(var t=this._items,r=t.length,i=r-1;i>=0;i--){var n=t[i];if(n.remove(e)){0===n.updaters.length&&(t.splice(i,1),n.destroy());break}}},a.prototype.update=function(e){var t,r=this._items,i=r.length;for(t=i-1;t>=0;t--){var n=r[t];if(n.invalidated){r.splice(t,1);for(var o=n.updaters.values,a=o.length,s=0;a>s;s++)this.add(e,o[s]);n.destroy()}}var l=!0;for(t=0;i>t;t++)l=r[t].update(e)&&l;return l},a.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,r=0;t>r;r++)e[r].destroy();this._items.length=0},a}),r("DataSources/StaticOutlineGeometryBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/PerInstanceColorAppearance","../Scene/Primitive"],function(e,t,r,i,n,o,a){"use strict";var s=function(t,r,i){this.translucent=r,this.primitives=t,this.createPrimitive=!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.width=i};s.prototype.add=function(e,t){var r=e.entity.id;this.createPrimitive=!0,this.geometry.set(r,t),this.updaters.set(r,e),e.hasConstantOutline&&e.outlineColorProperty.isConstant||this.updatersWithAttributes.set(r,e)},s.prototype.remove=function(e){var t=e.entity.id;this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t),this.updatersWithAttributes.remove(t)};var l=new t;s.prototype.update=function(e){var s=!0,u=!0,c=0,h=this.primitive,d=this.primitives;if(this.createPrimitive){this.attributes.removeAll(),i(h)&&(h.ready?this.oldPrimitive=h:d.remove(h),s=!1);var m=this.geometry.values;m.length>0&&(h=new a({asynchronous:!0,geometryInstances:m,appearance:new o({flat:!0,translucent:this.translucent,renderState:{depthTest:{enabled:!this.translucent},lineWidth:this.width}})}),d.add(h),u=!1,h.show=s),this.primitive=h,this.createPrimitive=!1}else if(i(h)&&h.ready){i(this.oldPrimitive)&&(d.remove(this.oldPrimitive),this.oldPrimitive=void 0,h.show=!0);for(var p=this.updatersWithAttributes.values,f=p.length,v=0;f>v;v++){var g=p[v],_=this.geometry.get(g.entity.id),y=this.attributes.get(_.id.id);if(i(y)||(y=h.getGeometryInstanceAttributes(_.id),this.attributes.set(_.id.id,y)),!g.outlineColorProperty.isConstant){var C=g.outlineColorProperty;C.getValue(e,l),t.equals(y._lastColor,l)||(y._lastColor=t.clone(l,y._lastColor),y.color=r.toValue(l,y.color),(this.translucent&&255===y.color[3]||!this.translucent&&255!==y.color[3])&&(this.itemsToRemove[c++]=g))}g.hasConstantOutline||(s=g.isOutlineVisible(e),s!==y._lastShow&&(y._lastShow=s,y.show=n.toValue(s,y.show)))}}else i(h)&&!h.ready&&(u=!1);return this.itemsToRemove.length=c,u},s.prototype.removeAllPrimitives=function(){var e=this.primitive;i(e)&&(this.primitives.remove(e),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll())};var u=function(t,r){this._primitives=t,this._scene=r,this._solidBatches=new e,this._translucentBatches=new e};return u.prototype.add=function(e,t){var r,n,o=t.createOutlineGeometryInstance(e),a=this._scene.clampLineWidth(t.outlineWidth);255===o.attributes.color.value[3]?(r=this._solidBatches,n=r.get(a),i(n)||(n=new s(this._primitives,!1,a),r.set(a,n)),n.add(t,o)):(r=this._translucentBatches,n=r.get(a),i(n)||(n=new s(this._primitives,!0,a),r.set(a,n)),n.add(t,o))},u.prototype.remove=function(e){var t,r=this._solidBatches.values,i=r.length;for(t=0;i>t;t++)if(r[t].remove(e))return;var n=this._translucentBatches.values,o=n.length;for(t=0;o>t;t++)if(n.remove(e))return},u.prototype.update=function(e){var t,r,i,n,o,a=this._solidBatches.values,s=a.length,l=this._translucentBatches.values,u=l.length,c=!0,h=!1;do{for(h=!1,r=0;s>r;r++){n=a[r],c=n.update(e),o=n.itemsToRemove;var d=o.length;if(d>0)for(h=!0,t=0;d>t;t++)i=o[t],n.remove(i),this.add(e,i)}for(r=0;u>r;r++){n=l[r],c=n.update(e),o=n.itemsToRemove;var m=o.length;if(m>0)for(h=!0,t=0;m>t;t++)i=o[t],n.remove(i),this.add(e,i)}}while(h);return c},u.prototype.removeAllPrimitives=function(){var e,t=this._solidBatches.values,r=t.length;for(e=0;r>e;e++)t[e].removeAllPrimitives();var i=this._translucentBatches.values,n=i.length;for(e=0;n>e;e++)i[e].removeAllPrimitives()},u}),r("DataSources/GeometryVisualizer",["../Core/AssociativeArray","../Core/defined","../Core/destroyObject","../Core/DeveloperError","./ColorMaterialProperty","./StaticGeometryColorBatch","./StaticGeometryPerMaterialBatch","./StaticOutlineGeometryBatch"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){e._outlineBatch.remove(t),e._closedColorBatch.remove(t),e._closedMaterialBatch.remove(t),e._openColorBatch.remove(t),e._openMaterialBatch.remove(t),e._dynamicBatch.remove(t)}function u(e,t,r){return r.isDynamic?(e._dynamicBatch.add(t,r),void 0):(r.outlineEnabled&&e._outlineBatch.add(t,r),r.fillEnabled&&(r.isClosed?r.fillMaterialProperty instanceof n?e._closedColorBatch.add(t,r):e._closedMaterialBatch.add(t,r):r.fillMaterialProperty instanceof n?e._openColorBatch.add(t,r):e._openMaterialBatch.add(t,r)),void 0)}var c=[],h=function(t){this._primitives=t,this._dynamicUpdaters=new e};h.prototype.add=function(e,t){this._dynamicUpdaters.set(t.entity.id,t.createDynamicUpdater(this._primitives))},h.prototype.remove=function(e){var r=e.entity.id,i=this._dynamicUpdaters.get(r);t(i)&&(this._dynamicUpdaters.remove(r),i.destroy())},h.prototype.update=function(e){for(var t=this._dynamicUpdaters.values,r=0,i=t.length;i>r;r++)t[r].update(e);return!0},h.prototype.removeAllPrimitives=function(){for(var e=this._dynamicUpdaters.values,t=0,r=e.length;r>t;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};var d=function(r,i,n,l,u){this._type=r,this._propertyName=t(u)?u:void 0;var m=t(i)?i:n.primitives; -this._scene=n,this._primitives=m,this._entityCollection=void 0,this._addedObjects=new e,this._removedObjects=new e,this._changedObjects=new e,this._outlineBatch=new s(m,n),this._closedColorBatch=new o(m,r.perInstanceColorAppearanceType,!0),this._closedMaterialBatch=new a(m,r.materialAppearanceType,!0),this._openColorBatch=new o(m,r.perInstanceColorAppearanceType,!1),this._openMaterialBatch=new a(m,r.materialAppearanceType,!1),this._dynamicBatch=new h(m),this._subscriptions=new e,this._updaters=new e,this._entityCollection=l,l.collectionChanged.addEventListener(d.prototype._onCollectionChanged,this),this._onCollectionChanged(l,l.entities,c)};return d.prototype.update=function(e){var t,r,i,n,o=this._addedObjects,a=o.values,s=this._removedObjects,c=s.values,h=this._changedObjects,m=h.values;for(t=c.length-1;t>-1;t--)r=c[t],i=r.id,n=this._updaters.get(i),l(this,n),n.destroy(),this._updaters.remove(i),this._subscriptions.get(i)(),this._subscriptions.remove(i);for(t=a.length-1;t>-1;t--)r=a[t],i=r.id,n=new this._type(r,this._scene,this._propertyName),this._updaters.set(i,n),u(this,e,n),this._subscriptions.set(i,n.geometryChanged.addEventListener(d._onGeometryChanged,this));for(t=m.length-1;t>-1;t--)r=m[t],i=r.id,n=this._updaters.get(i),l(this,n),u(this,e,n);o.removeAll(),s.removeAll(),h.removeAll();var p=this._closedColorBatch.update(e);return p=this._closedMaterialBatch.update(e)&&p,p=this._openColorBatch.update(e)&&p,p=this._openMaterialBatch.update(e)&&p,p=this._dynamicBatch.update(e)&&p,p=this._outlineBatch.update(e)&&p},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(d.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll(),this._outlineBatch.removeAllPrimitives(),this._closedColorBatch.removeAllPrimitives(),this._closedMaterialBatch.removeAllPrimitives(),this._openColorBatch.removeAllPrimitives(),this._openMaterialBatch.removeAllPrimitives(),this._dynamicBatch.removeAllPrimitives();for(var e=this._subscriptions.values,t=e.length,i=0;t>i;i++)e[i]();return this._subscriptions.removeAll(),r(this)},d._onGeometryChanged=function(e){var r=this._removedObjects,i=this._changedObjects,n=e.entity,o=n.id;t(r.get(o))||t(i.get(o))||i.set(o,n)},d.prototype._onCollectionChanged=function(e,t,r){var i,n,o,a=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(i=r.length-1;i>-1;i--)o=r[i],n=o.id,a.remove(n)||(s.set(n,o),l.remove(n));for(i=t.length-1;i>-1;i--)o=t[i],n=o.id,s.remove(n)?l.set(n,o):a.set(n,o)},d}),r("Scene/Label",["../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/NearFarScalar","./Billboard","./HorizontalOrigin","./LabelStyle","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function m(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}var p=function(n,o){n=i(n,i.EMPTY_OBJECT),this._text=i(n.text,""),this._show=i(n.show,!0),this._font=i(n.font,"30px sans-serif"),this._fillColor=r.clone(i(n.fillColor,r.WHITE)),this._outlineColor=r.clone(i(n.outlineColor,r.BLACK)),this._outlineWidth=i(n.outlineWidth,1),this._style=i(n.style,c.FILL),this._verticalOrigin=i(n.verticalOrigin,h.BOTTOM),this._horizontalOrigin=i(n.horizontalOrigin,u.LEFT),this._pixelOffset=e.clone(i(n.pixelOffset,e.ZERO)),this._eyeOffset=t.clone(i(n.eyeOffset,t.ZERO)),this._position=t.clone(i(n.position,t.ZERO)),this._scale=i(n.scale,1),this._id=n.id,this._translucencyByDistance=n.translucencyByDistance,this._pixelOffsetScaleByDistance=n.pixelOffsetScaleByDistance,this._labelCollection=o,this._glyphs=[],this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0};return o(p.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(var t=this._glyphs,r=0,i=t.length;i>r;r++){var o=t[r];n(o.billboard)&&(o.billboard.show=e)}}}},position:{get:function(){return this._position},set:function(e){var r=this._position;if(!t.equals(r,e)){t.clone(e,r);for(var i=this._glyphs,o=0,a=i.length;a>o;o++){var s=i[o];n(s.billboard)&&(s.billboard.position=e)}}}},text:{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e,d(this))}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,d(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){var t=this._fillColor;r.equals(t,e)||(r.clone(e,t),d(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;r.equals(t,e)||(r.clone(e,t),d(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,d(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,d(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(t){var r=this._pixelOffset;if(!e.equals(r,t)){e.clone(t,r);for(var i=this._glyphs,o=0,a=i.length;a>o;o++){var s=i[o];n(s.billboard)&&(s.billboard.pixelOffset=t)}}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;if(!s.equals(t,e)){this._translucencyByDistance=s.clone(e,t);for(var r=this._glyphs,i=0,o=r.length;o>i;i++){var a=r[i];n(a.billboard)&&(a.billboard.translucencyByDistance=e)}}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;if(!s.equals(t,e)){this._pixelOffsetScaleByDistance=s.clone(e,t);for(var r=this._glyphs,i=0,o=r.length;o>i;i++){var a=r[i];n(a.billboard)&&(a.billboard.pixelOffsetScaleByDistance=e)}}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var r=this._eyeOffset;if(!t.equals(r,e)){t.clone(e,r);for(var i=this._glyphs,o=0,a=i.length;a>o;o++){var s=i[o];n(s.billboard)&&(s.billboard.eyeOffset=e)}}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,m(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;for(var t=this._glyphs,r=0,i=t.length;i>r;r++){var o=t[r];n(o.billboard)&&(o.billboard.verticalOrigin=e)}m(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;for(var t=this._glyphs,r=0,i=t.length;i>r;r++){var o=t[r];n(o.billboard)&&(o.billboard.scale=e)}m(this)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;for(var t=this._glyphs,r=0,i=t.length;i>r;r++){var o=t[r];n(o.billboard)&&(o.billboard.id=e)}}}}}),p.prototype.computeScreenSpacePosition=function(e){var t=this._labelCollection,r=t.modelMatrix,i=l._computeActualPosition(this._position,e.frameState,r),n=l._computeScreenSpacePosition(r,i,this._eyeOffset,this._pixelOffset,e);return n.y=e.canvas.clientHeight-n.y,n},p.prototype.equals=function(i){return this===i||n(i)&&this._show===i._show&&this._scale===i._scale&&this._style===i._style&&this._verticalOrigin===i._verticalOrigin&&this._horizontalOrigin===i._horizontalOrigin&&this._text===i._text&&this._font===i._font&&t.equals(this._position,i._position)&&r.equals(this._fillColor,i._fillColor)&&r.equals(this._outlineColor,i._outlineColor)&&e.equals(this._pixelOffset,i._pixelOffset)&&t.equals(this._eyeOffset,i._eyeOffset)&&s.equals(this._translucencyByDistance,i._translucencyByDistance)&&s.equals(this._pixelOffsetScaleByDistance,i._pixelOffsetScaleByDistance)&&this._id===i._id},p.prototype.isDestroyed=function(){return!1},p}),r("Scene/LabelCollection",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/writeTextToCanvas","./BillboardCollection","./HorizontalOrigin","./Label","./LabelStyle","./TextureAtlas","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";function p(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function f(e,t,r){this.labelCollection=e,this.index=t,this.dimensions=r}function v(e,t,r,i,n,o,a){return S.font=t,S.fillColor=r,S.strokeColor=i,S.strokeWidth=n,S.textBaseline=a===m.BOTTOM?"bottom":a===m.TOP?"top":"middle",S.fill=o===h.FILL||o===h.FILL_AND_OUTLINE,S.stroke=o===h.OUTLINE||o===h.FILL_AND_OUTLINE,s(e,S)}function g(e,t){t.textureInfo=void 0,t.dimensions=void 0;var i=t.billboard;r(i)&&(i.show=!1,i.image=void 0,e._spareBillboards.push(i),t.billboard=void 0)}function _(e,t,r,i){e.addImage(t,r).then(function(e){i.index=e})}function y(e,t){var i,n,o,a=t._text,s=a.length,l=t._glyphs,c=l.length;if(c>s)for(n=s;c>n;++n)g(e,l[n]);l.length=s;var h=e._glyphTextureCache;for(o=0;s>o;++o){var d=a.charAt(o),m=t._font,y=t._fillColor,C=t._outlineColor,w=t._outlineWidth,S=t._style,E=t._verticalOrigin,b=JSON.stringify([d,m,y.toRgba(),C.toRgba(),w,+S,+E]),T=h[b];if(!r(T)){var x=v(d,m,y,C,w,S,E);T=new f(e,-1,x.dimensions),h[b]=T,x.width>0&&x.height>0&&_(e._textureAtlas,b,x,T)}if(i=l[o],r(i)?-1===T.index?g(e,i):r(i.textureInfo)&&(i.textureInfo=void 0):(i=new p,l[o]=i),i.textureInfo=T,i.dimensions=T.dimensions,-1!==T.index){var P=i.billboard;r(P)||(P=e._spareBillboards.length>0?e._spareBillboards.pop():e._billboardCollection.add({collection:e}),i.billboard=P),P.show=t._show,P.position=t._position,P.eyeOffset=t._eyeOffset,P.pixelOffset=t._pixelOffset,P.horizontalOrigin=u.LEFT,P.verticalOrigin=t._verticalOrigin,P.scale=t._scale,P.pickPrimitive=t,P.id=t._id,P.image=b,P.translucencyByDistance=t._translucencyByDistance,P.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance}}t._repositionAllGlyphs=!0}function C(e,t){var i,n,o=e._glyphs,a=0,s=0,l=0,c=o.length;for(l=0;c>l;++l)i=o[l],n=i.dimensions,a+=n.width,s=Math.max(s,n.height);var h=e._scale,d=e._horizontalOrigin,p=0;d===u.CENTER?p-=a/2*h:d===u.RIGHT&&(p-=a*h),E.x=p*t,E.y=0;var f=e._verticalOrigin;for(l=0;c>l;++l)i=o[l],n=i.dimensions,f===m.BOTTOM||n.height===s?E.y=-n.descent*h:f===m.TOP?E.y=-(s-n.height)*h-n.descent*h:f===m.CENTER&&(E.y=-(s-n.height)/2*h-n.descent*h),E.y*=t,r(i.billboard)&&i.billboard._setTranslate(E),E.x+=n.width*h*t}function w(e,t){for(var r=t._glyphs,i=0,o=r.length;o>i;++i)g(e,r[i]);t._labelCollection=void 0,n(t)}var S={},E=new e,b=function(e){e=t(e,t.EMPTY_OBJECT),this._textureAtlas=void 0,this._billboardCollection=new l,this._billboardCollection.destroyTextureAtlas=!1,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._resolutionScale=void 0,this.modelMatrix=a.clone(t(e.modelMatrix,a.IDENTITY)),this.debugShowBoundingVolume=t(e.debugShowBoundingVolume,!1)};return i(b.prototype,{length:{get:function(){return this._labels.length}}}),b.prototype.add=function(e){var t=new c(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},b.prototype.remove=function(e){if(r(e)&&e._labelCollection===this){var t=this._labels.indexOf(e);if(-1!==t)return this._labels.splice(t,1),w(this,e),!0}return!1},b.prototype.removeAll=function(){for(var e=this._labels,t=0,r=e.length;r>t;++t)w(this,e[t]);e.length=0},b.prototype.contains=function(e){return r(e)&&e._labelCollection===this},b.prototype.get=function(e){return this._labels[e]},b.prototype.update=function(e,t,i){var n=this._billboardCollection;n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume,r(this._textureAtlas)||(this._textureAtlas=new d({context:e}),n.textureAtlas=this._textureAtlas);var o=e.uniformState,a=o.resolutionScale,s=this._resolutionScale!==a;this._resolutionScale=a;var l;l=s?this._labels:this._labelsToUpdate;for(var u=0,c=l.length;c>u;++u){var h=l[u];if(!h.isDestroyed()){var m=h._glyphs.length;h._rebindAllGlyphs&&(y(this,h),h._rebindAllGlyphs=!1),(s||h._repositionAllGlyphs)&&(C(h,a),h._repositionAllGlyphs=!1);var p=h._glyphs.length-m;this._totalGlyphCount+=p}}this._labelsToUpdate.length=0,n.update(e,t,i)},b.prototype.isDestroyed=function(){return!1},b.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),n(this)},b}),r("DataSources/LabelVisualizer",["../Core/AssociativeArray","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Iso8601","../Core/Matrix4","../Core/NearFarScalar","../Scene/HorizontalOrigin","../Scene/LabelCollection","../Scene/LabelStyle","../Scene/VerticalOrigin","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,t){if(n(e)){var r=e.label;n(r)&&(t.push(e.index),r.show=!1,e.label=void 0,e.index=-1)}}var v=1,g="30px sans-serif",_=d.FILL,y=i.WHITE,C=i.BLACK,w=1,S=t.ZERO,E=r.ZERO,b=c.CENTER,T=m.CENTER,x=new r,P=new i,A=new i,M=new r,D=new t,I=new r,O=new u,R=new u,L=function(e){this.entity=e,this.label=void 0,this.index=void 0},N=function(t,r,i){r.collectionChanged.addEventListener(N.prototype._onCollectionChanged,this),this._primitiveCollection=t,this._unusedIndexes=[],this._labelCollection=void 0,this._entityCollection=r,this._items=new e,this._propertyName=n(i)?i:"_label",this._onCollectionChanged(r,r.entities,[],[])};return N.prototype.update=function(e){for(var t=this._items.values,i=this._unusedIndexes,o=this._propertyName,a=0,u=t.length;u>a;a++){var c,d=t[a],m=d.entity,L=m[o],N=d.label,F=m.isAvailable(e)&&p.getValueOrDefault(L._show,e,!0);if(F){console.log("positionOffset"),x=p.getValueOrUndefined(m._position,e,x),I=p.getValueOrUndefined(L._positionOffset,e);var B=m._getModelMatrix(s.MINIMUM_VALUE);if(B){var z=new l;l.fromTranslation(I,z),l.multiply(B,z,B)}new r,l.getTranslation(B,x),c=p.getValueOrUndefined(L._text,e),F=n(x)&&n(c)}if(F){if(!n(N)){var V=this._labelCollection;n(V)||(V=new h,this._labelCollection=V,this._primitiveCollection.add(V));var k=i.length;if(k>0){var U=i.pop();d.index=U,N=V.get(U)}else N=V.add(),d.index=V.length-1;N.id=m,d.label=N}N.show=!0,N.position=x,N.text=c,N.scale=p.getValueOrDefault(L._scale,e,v),N.font=p.getValueOrDefault(L._font,e,g),N.style=p.getValueOrDefault(L._style,e,_),N.fillColor=p.getValueOrDefault(L._fillColor,e,y,P),N.outlineColor=p.getValueOrDefault(L._outlineColor,e,C,A),N.outlineWidth=p.getValueOrDefault(L._outlineWidth,e,w),N.pixelOffset=p.getValueOrDefault(L._pixelOffset,e,S,D),N.eyeOffset=p.getValueOrDefault(L._eyeOffset,e,E,M),N.horizontalOrigin=p.getValueOrDefault(L._horizontalOrigin,e,b),N.verticalOrigin=p.getValueOrDefault(L._verticalOrigin,e,T),N.translucencyByDistance=p.getValueOrUndefined(L._translucencyByDistance,e,O),N.pixelOffsetScaleByDistance=p.getValueOrUndefined(L._pixelOffsetScaleByDistance,e,R)}else f(d,i)}return!0},N.prototype.isDestroyed=function(){return!1},N.prototype.destroy=function(){return this._entityCollection.collectionChanged.removeEventListener(N.prototype._onCollectionChanged,this),n(this._labelCollection)&&this._primitiveCollection.remove(this._labelCollection),o(this)},N.prototype._onCollectionChanged=function(e,t,r,i){var o,a,s=this._unusedIndexes,l=this._items,u=this._propertyName;for(o=t.length-1;o>-1;o--)a=t[o],n(a[u])&&n(a._position)&&l.set(a.id,new L(a));for(o=i.length-1;o>-1;o--)a=i[o],n(a[u])&&n(a._position)?l.contains(a.id)||l.set(a.id,new L(a)):(f(l.get(a.id),s),l.remove(a.id));for(o=r.length-1;o>-1;o--)a=r[o],f(l.get(a.id),s),l.remove(a.id)},N}),r("ThirdParty/gltfDefaults",["../Core/defaultValue","../Core/defined"],function(e,t){"use strict";function r(r){t(r.accessors)||(r.accessors={});var i=r.accessors;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];o.byteStride=e(o.byteStride,0)}}function i(r){t(r.animations)||(r.animations={});var i=r.animations;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];t(o.channels)||(o.channels=[]),t(o.parameters)||(o.parameters={}),t(o.samplers)||(o.samplers={});var a=i.samplers;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s];l.interpolation=e(l.interpolation,"LINEAR")}}}function n(r){t(r.asset)||(r.asset={}),r.asset.premultipliedAlpha=e(r.asset.premultipliedAlpha,!1)}function o(r){t(r.buffers)||(r.buffers={});var i=r.buffers;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];o.type=e(o.type,"arraybuffer")}}function a(e){t(e.bufferViews)||(e.bufferViews={})}function s(e){t(e.cameras)||(e.cameras={})}function l(e){t(e.images)||(e.images={})}function u(r){t(r.lights)||(r.lights={});var i=r.lights;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];if("ambient"===o.type){t(o.ambient)||(o.ambient={});var a=o.ambient;t(a.color)||(a.color=[1,1,1])}else if("directional"===o.type){t(o.directional)||(o.directional={});var s=o.directional;t(s.color)||(s.color=[1,1,1])}else if("point"===o.type){t(o.point)||(o.point={});var l=o.point;t(l.color)||(l.color=[1,1,1]),l.constantAttenuation=e(l.constantAttenuation,1),l.linearAttenuation=e(l.linearAttenuation,0),l.quadraticAttenuation=e(l.quadraticAttenuation,0)}else if("spot"===o.type){t(o.spot)||(o.spot={});var u=o.spot;t(u.color)||(u.color=[1,1,1]),u.constantAttenuation=e(u.constantAttenuation,1),u.fallOffAngle=e(u.fallOffAngle,3.14159265),u.fallOffExponent=e(u.fallOffExponent,0),u.linearAttenuation=e(u.linearAttenuation,0),u.quadraticAttenuation=e(u.quadraticAttenuation,0)}}}function c(e){t(e.materials)||(e.materials={});var r=e.materials;for(var i in r)if(r.hasOwnProperty(i)){var n=r[i].instanceTechnique;t(n.values)||(n.values={})}}function h(r){t(r.meshes)||(r.meshes={});var i=r.meshes;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];t(o.primitives)||(o.primitives=[]);for(var a=o.primitives.length,s=a.length,l=0;s>l;++l){var u=a[l];t(u.attributes)||(u.attributes={}),u.primitive=e(u.primitive,WebGLRenderingContext.TRIANGLES)}}}function d(e){t(e.nodes)||(e.nodes={});var r=e.nodes;for(var i in r)if(r.hasOwnProperty(i)){var n=r[i];t(n.children)||(n.children=[]),t(n.matrix)||(t(n.translation)&&t(n.rotation)&&t(n.scale)?(t(n.translation)||(n.translation=[0,0,0]),t(n.rotation)||(n.rotation=[1,0,0,0]),t(n.scale)||(n.scale=[1,1,1])):n.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}}function m(e){t(e.programs)||(e.programs={});var r=e.programs;for(var i in r)if(r.hasOwnProperty(i)){var n=r[i];t(n.attributes)||(n.attributes=[])}}function p(r){t(r.samplers)||(r.samplers={});var i=r.samplers;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];o.magFilter=e(o.magFilter,WebGLRenderingContext.LINEAR),o.minFilter=e(o.minFilter,WebGLRenderingContext.NEAREST_MIPMAP_LINEAR),o.wrapS=e(o.wrapS,WebGLRenderingContext.REPEAT),o.wrapT=e(o.wrapT,WebGLRenderingContext.REPEAT)}}function f(e){t(e.scenes)||(e.scenes={});var r=e.scenes;for(var i in r)if(r.hasOwnProperty(i)){var n=r[i];t(n.node)||(n.node=[])}}function v(e){t(e.shaders)||(e.shaders={})}function g(e){t(e.skins)||(e.skins={});var r=e.skins;for(var i in r)if(r.hasOwnProperty(i)){var n=r[i];t(n.bindShapeMatrix)&&(n.bindShapeMatrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}}function _(e){t(e.enable)||(e.enable=[]),t(e.disable)||(e.disable=[])}function y(e){t(e.techniques)||(e.techniques={});var r=e.techniques;for(var i in r)if(r.hasOwnProperty(i)){var n=r[i];t(n.parameters)||(n.parameters={});var o=n.passes;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a],l=s.instanceProgram;t(l.attributes)||(l.attributes={}),t(l.uniforms)||(l.uniforms={}),t(s.states)||(s.states={}),_(s.states)}}}function C(r){t(r.textures)||(r.textures={});var i=r.textures;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];o.format=e(o.format,WebGLRenderingContext.RGBA),o.internalFormat=e(o.internalFormat,o.format),o.target=e(o.target,WebGLRenderingContext.TEXTURE_2D),o.type=e(o.type,WebGLRenderingContext.UNSIGNED_BYTE)}}var w=function(_){return t(_)?(t(_.allExtensions)||(_.allExtensions=[]),r(_),i(_),n(_),o(_),a(_),s(_),l(_),u(_),c(_),h(_),d(_),m(_),p(_),f(_),v(_),g(_),y(_),_.profile=e(_.profile,"WebGL 1.0.2"),_.version=e(_.version,"1.0"),C(_),_):void 0};return w}),r("Scene/getModelAccessor",["../Core/ComponentDatatype"],function(e){"use strict";var t={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},r=function(r){var i=r.componentType,n=t[r.type];return{componentsPerAttribute:n,createArrayBufferView:function(t,r,o){return e.createArrayBufferView(i,t,r,n*o)}}};return r}),r("Scene/ModelAnimationCache",["../Core/Cartesian3","../Core/defined","../Core/LinearSpline","../Core/Quaternion","../Core/QuaternionSpline","./getModelAccessor"],function(e,t,r,i,n,o){"use strict";function a(e,t){var r=e.gltf,i=r.buffers,n=r.bufferViews,a=n[t.bufferView],s=i[a.buffer],l=a.byteOffset+t.byteOffset,u=t.count*o(t).componentsPerAttribute;return e.basePath+s.path+":"+l+":"+u}function s(e,t,r){return e.basePath+":"+t+":"+r}var l=function(){},u={},c=new e;l.getAnimationParameterValues=function(r,n){var s=a(r,n),l=u[s];if(!t(l)){var h,d=r._loadResources.buffers,m=r.gltf,p=m.bufferViews,f=p[n.bufferView],v=n.componentType,g=n.type,_=n.count,y=o(n).createArrayBufferView(d[f.buffer],f.byteOffset+n.byteOffset,_);if(v===WebGLRenderingContext.FLOAT&&"SCALAR"===g)l=y;else if(v===WebGLRenderingContext.FLOAT&&"VEC3"===g)for(l=new Array(_),h=0;_>h;++h)l[h]=e.fromArray(y,3*h);else if(v===WebGLRenderingContext.FLOAT&&"VEC4"===g)for(l=new Array(_),h=0;_>h;++h){var C=4*h;l[h]=i.fromAxisAngle(e.fromArray(y,C,c),y[C+3])}""!==r.basePath&&(u[s]=l)}return l};var h={},d=function(e){this._value=e};return d.prototype.evaluate=function(){return this._value},l.getAnimationSpline=function(e,i,o,a,l,u){var c=s(e,i,a),m=h[c];if(!t(m)){var p=u[l.input],f=e.gltf.accessors[o.parameters[l.output]],v=u[l.output];if(1===p.length&&1===v.length)m=new d(v[0]);else{var g=f.componentType,_=f.type;"LINEAR"===l.interpolation&&(g===WebGLRenderingContext.FLOAT&&"VEC3"===_?m=new r({times:p,points:v}):g===WebGLRenderingContext.FLOAT&&"VEC4"===_&&(m=new n({times:p,points:v})))}""!==e.basePath&&(h[c]=m)}return m},l}),r("Scene/ModelAnimationLoop",["../Core/freezeObject"],function(e){"use strict";var t={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};return e(t)}),r("Scene/ModelAnimationState",["../Core/freezeObject"],function(e){"use strict";return e({STOPPED:0,ANIMATING:1})}),r("Scene/ModelAnimation",["../Core/defaultValue","../Core/defineProperties","../Core/Event","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,r,i,n){"use strict";var o=function(t,o,a){this._name=t.name,this._startTime=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,i.NONE),this.start=new r,this.update=new r,this.stop=new r,this._state=n.STOPPED,this._runtimeAnimation=a,this._startTime=void 0,this._duration=void 0;var s=this;this._raiseStartEvent=function(){s.start.raiseEvent(o,s)},this._updateEventTime=0,this._raiseUpdateEvent=function(){s.update.raiseEvent(o,s,s._updateEventTime)},this._raiseStopEvent=function(){s.stop.raiseEvent(o,s)}};return t(o.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}}}),o}),r("Scene/ModelAnimationCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","../Core/Math","./ModelAnimation","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(e,t){for(var r=e.channelEvaluators,i=r.length,n=0;i>n;++n)r[n](t)}function d(e,t,r){return function(){e.animationRemoved.raiseEvent(t,r)}}var m=function(e){this.animationAdded=new o,this.animationRemoved=new o,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0};i(m.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),m.prototype.add=function(e){e=t(e,t.EMPTY_OBJECT);var r=this._model,i=r._runtime.animations,n=i[e.name],o=new l(e,r,n);return this._scheduledAnimations.push(o),this.animationAdded.raiseEvent(r,o),o},m.prototype.addAll=function(r){r=t(r,t.EMPTY_OBJECT),r=e(r);var i=[],n=this._model.gltf.animations;for(var o in n)n.hasOwnProperty(o)&&(r.name=o,i.push(this.add(r)));return i},m.prototype.remove=function(e){if(r(e)){var t=this._scheduledAnimations,i=t.indexOf(e);if(-1!==i)return t.splice(i,1),this.animationRemoved.raiseEvent(this._model,e),!0}return!1},m.prototype.removeAll=function(){var e=this._model,t=this._scheduledAnimations,r=t.length;this._scheduledAnimations=[];for(var i=0;r>i;++i)this.animationRemoved.raiseEvent(e,t[i])},m.prototype.contains=function(e){return r(e)?-1!==this._scheduledAnimations.indexOf(e):!1},m.prototype.get=function(e){return this._scheduledAnimations[e]};var p=[];return m.prototype.update=function(e){if(a.equals(e.time,this._previousTime))return!1;this._previousTime=a.clone(e.time,this._previousTime);for(var i=!1,n=e.time,o=this._model,l=this._scheduledAnimations,m=l.length,f=0;m>f;++f){var v=l[f],g=v._runtimeAnimation;r(v._startTime)||(v._startTime=a.addSeconds(t(v.startTime,n),v.delay,new a)),r(v._duration)||(v._duration=g.stopTime*(1/v.speedup));var _=v._startTime,y=v._duration,C=v.stopTime,w=0!==y?a.secondsDifference(n,_)/y:0,S=w>=0,E=S&&(1>=w||v.loop===u.REPEAT||v.loop===u.MIRRORED_REPEAT)&&(!r(C)||a.lessThanOrEquals(n,C));if(E){if(v._state===c.STOPPED&&(v._state=c.ANIMATING,v.start.numberOfListeners>0&&e.afterRender.push(v._raiseStartEvent)),v.loop===u.REPEAT)w-=Math.floor(w);else if(v.loop===u.MIRRORED_REPEAT){var b=Math.floor(w),T=w-b;w=1===b%2?1-T:T}v.reverse&&(w=1-w);var x=w*y*v.speedup;x=s.clamp(x,g.startTime,g.stopTime),h(g,x),v.update.numberOfListeners>0&&(v._updateEventTime=x,e.afterRender.push(v._raiseUpdateEvent)),i=!0}else S&&v._state===c.ANIMATING&&(v._state=c.STOPPED,v.stop.numberOfListeners>0&&e.afterRender.push(v._raiseStopEvent),v.removeOnStop&&p.push(v))}m=p.length;for(var P=0;m>P;++P){var A=p[P];l.splice(l.indexOf(A),1),e.afterRender.push(d(this,o,A))}return p.length=0,i},m}),r("Scene/ModelMaterial",["../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";var r=function(e,t,r){this._name=t.name,this._id=r,this._uniformMap=e._rendererResources.uniformMaps[r]};return t(r.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}}),r.prototype.setValue=function(e,t){var r=this._uniformMap.values[e];r.value=r.clone(t,r.value)},r.prototype.getValue=function(t){var r=this._uniformMap.values[t];return e(r)?r.value:void 0},r}),r("Scene/ModelMesh",["../Core/defineProperties"],function(e){"use strict";var t=function(e,t,r){for(var i=[],n=e.primitives,o=n.length,a=0;o>a;++a){var s=n[a];i[a]=t[s.material]}this._name=e.name,this._materials=i,this._id=r};return e(t.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}}),t}),r("Scene/ModelNode",["../Core/defaultValue","../Core/defineProperties","../Core/Matrix4"],function(e,t,r){"use strict";var i=function(t,i,n,o){this._model=t,this._runtimeNode=n,this._name=i.name,this._id=o,this.useMatrix=!1,this._matrix=r.clone(e(i.matrix,r.IDENTITY))};return t(i.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},matrix:{get:function(){return this._matrix},set:function(e){this._matrix=r.clone(e,this._matrix),this.useMatrix=!0;var t=this._model;t._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=t._maxDirtyNumber}}}),i}),r("Scene/Model",["../ThirdParty/when","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/combine","../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/IndexDatatype","../Core/loadArrayBuffer","../Core/loadImage","../Core/loadText","../Core/Math","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/PrimitiveType","../Core/Quaternion","../Core/Queue","../Core/RuntimeError","../Core/throttleRequestByServer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/ShaderSource","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../ThirdParty/gltfDefaults","../ThirdParty/Uri","./getModelAccessor","./ModelAnimationCache","./ModelAnimationCollection","./ModelMaterial","./ModelMesh","./ModelNode","./Pass","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S,E,b,T,x,P,A,M,D,I,O,R,L,N,F,B,z,V,k){"use strict";function U(){this.buffersToCreate=new E,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new E,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new E,this.pendingTextureLoads=0,this.createSamplers=!0,this.createSkins=!0,this.createRuntimeAnimations=!0,this.createVertexArrays=!0,this.createRenderStates=!0,this.createUniformMaps=!0,this.createRuntimeNodes=!0,this.skinnedNodesNames=[]}function W(e,t,r){return e._runtime[t][r]}function G(e){if(l(e.matrix))return C.fromArray(e.matrix);var t=i.fromArray(e.rotation,0,Yt);return C.fromTranslationQuaternionRotationScale(i.fromArray(e.translation,0,Xt),S.fromAxisAngle(t,e.rotation[3],Zt),i.fromArray(e.scale,0,Qt))}function H(e){for(var r=e.nodes,n=e.meshes,o=e.accessors,a=e.scenes[e.scene].nodes,u=a.length,c=[],h=new i(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),d=new i(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),m=0;u>m;++m){var p=r[a[m]];for(p._transformToRoot=G(p),c.push(p);c.length>0;){p=c.pop();var f=p._transformToRoot,v=s(p.meshes,l(p.instanceSkin)?p.instanceSkin.meshes:void 0);if(l(v))for(var g=v.length,_=0;g>_;++_)for(var y=n[v[_]].primitives,w=y.length,S=0;w>S;++S){var E=y[S].attributes.POSITION;if(l(E)){var b=o[E],T=i.fromArray(b.min,0,Jt),x=i.fromArray(b.max,0,Kt);l(h)&&l(d)&&(C.multiplyByPoint(f,T,T),C.multiplyByPoint(f,x,x),i.minimumByComponent(h,T,h),i.maximumByComponent(d,x,d))}}for(var P=p.children,A=P.length,M=0;A>M;++M){var D=r[P[M]];D._transformToRoot=G(D),C.multiplyTransformation(f,D._transformToRoot,D._transformToRoot),c.push(D)}delete p._transformToRoot}}var I=t.fromCornerPoints(h,d);return t.transformWithoutScale(I,Ht,I)}function q(e,t,r){return function(){e._loadError=e._failedLoadFunction(e,t,r),e._state=qt.FAILED}}function j(e,t){return function(r){var i=e._loadResources;i.buffers[t]=r,--i.pendingBufferLoads}}function Y(e){var t=e.gltf.buffers;for(var r in t)if(t.hasOwnProperty(r)){++e._loadResources.pendingBufferLoads;var i=t[r],n=new O(i.uri),o=n.resolve(e._baseUri).toString();p(o,{withCredentials:e._withCredentials,headers:e._headers}).then(j(e,r)).otherwise(q(e,"buffer",o))}}function X(e){var t=e.gltf.bufferViews;for(var r in t)t.hasOwnProperty(r)&&e._loadResources.buffersToCreate.enqueue(r)}function Z(e,t){return function(r){var i=e._loadResources;i.shaders[t]=r,--i.pendingShaderLoads}}function Q(e){var t=e.gltf.shaders;if(!l(e._shaderParser)||!e._shaderParser(t))for(var r in t)if(t.hasOwnProperty(r)){++e._loadResources.pendingShaderLoads;var i,n=t[r];if(e.shaderOverride&&(i=e.shaderOverride(n,r,e.gltf)))Z(e,r)(i);else{var o=new O(n.uri),a=o.resolve(e._baseUri).toString();v(a).then(Z(e,r)).otherwise(q(e,"shader",a))}}}function J(e){var t=e.gltf.programs;for(var r in t)t.hasOwnProperty(r)&&e._loadResources.programsToCreate.enqueue(r)}function K(e,t){return function(r){var i=e._loadResources;--i.pendingTextureLoads,i.texturesToCreate.enqueue({name:t,image:r})}}function $(e){var t,r=e.gltf.images,i=e.gltf.textures;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n],a=new O(r[o.source].uri),s=a.resolve(e._baseUri).toString();if(l(e._cache)&&(t=e._cache.get(s),l(t)&&(e._rendererResources.textures[n]=t,t.ref())),!l(t)){++e._loadResources.pendingTextureLoads;var u=!0,c=!1; -e._withCredentials&&(c=!0),f(s,u,c).then(K(e,n)).otherwise(q(e,"image",s))}}}function et(e){var t={},r={},i=[],n=e._loadResources.skinnedNodesNames,o=e.gltf.nodes;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a],u={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,transformToRoot:new C,computedMatrix:new C,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:s.jointName,children:[],parents:[],publicNode:void 0};u.publicNode=new z(e,s,u,a),t[a]=u,r[s.name]=u,l(s.instanceSkin)&&(n.push(a),i.push(u))}e._runtime.nodes=t,e._runtime.nodesByName=r,e._runtime.skinnedNodes=i}function tt(e){var t={},r={},i=e.gltf.materials,n=e._rendererResources.uniformMaps;for(var o in i)if(i.hasOwnProperty(o)){n[o]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0};var a=i[o],s=new F(e,a,o);t[a.name]=s,r[o]=s}e._runtime.materialsByName=t,e._runtime.materialsById=r}function rt(e){var t={},r=e._runtime.materialsById,i=e.gltf.meshes;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];t[o.name]=new B(o,r,n)}e._runtime.meshesByName=t}function it(e){Y(e),X(e),Q(e),J(e),$(e),tt(e),rt(e),et(e)}function nt(e,t){var r=e._loadResources;if(0===r.pendingBufferLoads){for(var i,n,o=e.gltf.bufferViews,a=r.buffers,s=e._rendererResources.buffers;r.buffersToCreate.length>0;){var u=r.buffersToCreate.dequeue();if(n=o[u],n.target===WebGLRenderingContext.ARRAY_BUFFER){i=new Uint8Array(a[n.buffer],n.byteOffset,n.byteLength);var c=t.createVertexBuffer(i,x.STATIC_DRAW);c.vertexArrayDestroyable=!1,s[u]=c}}var h=e.gltf.accessors;for(var d in h)if(h.hasOwnProperty(d)){var m=h[d];if(n=o[m.bufferView],n.target===WebGLRenderingContext.ELEMENT_ARRAY_BUFFER&&!l(s[m.bufferView])){i=new Uint8Array(a[n.buffer],n.byteOffset,n.byteLength);var p=t.createIndexBuffer(i,x.STATIC_DRAW,m.componentType);p.vertexArrayDestroyable=!1,s[m.bufferView]=p}}}}function ot(e){for(var t={},r=e.length,i=0;r>i;++i)t[e[i]]=i;return t}function at(e,t,r){var i=t.gltf.programs,n=t._loadResources.shaders,o=i[e],a=ot(o.attributes),s=n[o.vertexShader],l=n[o.fragmentShader];if(t._rendererResources.programs[e]=r.createShaderProgram(s,l,a),t.allowPicking){var u=new A({sources:[l],pickColorQualifier:"uniform"});t._rendererResources.pickPrograms[e]=r.createShaderProgram(s,u,a)}}function st(e,t){var r,i=e._loadResources;if(0===i.pendingShaderLoads)if(e.asynchronous)i.programsToCreate.length>0&&(r=i.programsToCreate.dequeue(),at(r,e,t));else for(;i.programsToCreate.length>0;)r=i.programsToCreate.dequeue(),at(r,e,t)}function lt(e,t){var r=e._loadResources;if(r.createSamplers){r.createSamplers=!1;var i=e._rendererResources.samplers,n=e.gltf.samplers;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];i[o]=t.createSampler({wrapS:a.wrapS,wrapT:a.wrapT,minificationFilter:a.minFilter,magnificationFilter:a.magFilter})}}}function ut(e,t,r){var i=t.gltf.textures,n=i[e.name],o=t._rendererResources.samplers,a=o[n.sampler],s=a.minificationFilter===M.NEAREST_MIPMAP_NEAREST||a.minificationFilter===M.NEAREST_MIPMAP_LINEAR||a.minificationFilter===M.LINEAR_MIPMAP_NEAREST||a.minificationFilter===M.LINEAR_MIPMAP_LINEAR,u=s||a.wrapS===D.REPEAT||a.wrapS===D.MIRRORED_REPEAT||a.wrapT===D.REPEAT||a.wrapT===D.MIRRORED_REPEAT,c=e.image,h=!g.isPowerOfTwo(c.width)||!g.isPowerOfTwo(c.height);if(u&&h){var d=document.createElement("canvas");d.width=g.nextPowerOfTwo(c.width),d.height=g.nextPowerOfTwo(c.height);var m=d.getContext("2d");m.drawImage(c,0,0,c.width,c.height,0,0,d.width,d.height),c=d}var p;n.target===WebGLRenderingContext.TEXTURE_2D&&(p=r.createTexture2D({source:c,pixelFormat:n.internalFormat,pixelDatatype:n.type,flipY:!1})),s&&p.generateMipmap(),p.sampler=a,t._rendererResources.textures[e.name]=p,l(t._cache)&&t._cache.add(p,c.src)}function ct(e,t){var r,i=e._loadResources;if(e.asynchronous)i.texturesToCreate.length>0&&(r=i.texturesToCreate.dequeue(),ut(r,e,t));else for(;i.texturesToCreate.length>0;)r=i.texturesToCreate.dequeue(),ut(r,e,t)}function ht(e,t){var r=e.gltf;r.programs;var i=r.techniques,n=r.materials,o={},a=i[n[t.material].instanceTechnique.technique],s=a.parameters,l=a.passes[a.pass],u=l.instanceProgram,c=u.attributes,h=e._rendererResources.programs[u.program].vertexAttributes;for(var d in c)if(c.hasOwnProperty(d)){var m=s[c[d]];o[m.semantic]=h[d].index}return o}function dt(e,t){for(var r=e.length,i=0;r>i;++i)for(var n=[e[i]];n.length>0;){var o=n.pop();if(o.jointName===t)return o;for(var a=o.children,s=a.length,l=0;s>l;++l)n.push(a[l])}return void 0}function mt(e,t){for(var r=e.gltf,i=r.skins,n=r.nodes,o=e._runtime.nodes,a=e._loadResources.skinnedNodesNames,s=a.length,l=0;s>l;++l){var u=a[l],c=o[u],h=n[u].instanceSkin,d=t[h.skin];c.inverseBindMatrices=d.inverseBindMatrices,c.bindShapeMatrix=d.bindShapeMatrix;for(var m=[],p=h.skeletons,f=p.length,v=0;f>v;++v)m.push(o[p[v]]);for(var g=i[h.skin].jointNames,_=g.length,y=0;_>y;++y){var C=g[y];c.joints.push(dt(m,C))}}}function pt(e){var t=e._loadResources;if(t.finishedBuffersCreation()&&t.createSkins){t.createSkins=!1;var r=e.gltf,i=t.buffers,n=r.accessors,o=r.bufferViews,a=r.skins,s={};for(var l in a)if(a.hasOwnProperty(l)){var u=a[l],c=n[u.inverseBindMatrices],h=o[c.bufferView],d=c.componentType,m=c.type,p=c.count,f=R(c).createArrayBufferView(i[h.buffer],h.byteOffset+c.byteOffset,p),v=new Array(p);if(d===WebGLRenderingContext.FLOAT&&"MAT4"===m)for(var g=0;p>g;++g)v[g]=C.fromArray(f,16*g);var _;C.equals(u.bindShapeMatrix,C.IDENTITY)||(_=C.clone(u.bindShapeMatrix)),s[l]={inverseBindMatrices:v,bindShapeMatrix:_}}mt(e,s)}}function ft(e,t,r,i){return function(n){t[r]=i.evaluate(n,t[r]),t.dirtyNumber=e._maxDirtyNumber}}function vt(e){var t=e._loadResources;if(t.finishedPendingLoads()&&t.createRuntimeAnimations){t.createRuntimeAnimations=!1,e._runtime.animations={};var r,i=e._runtime.nodes,n=e.gltf.animations,o=e.gltf.accessors;for(var a in n)if(n.hasOwnProperty(a)){var s=n[a],l=s.channels,u=s.parameters,c=s.samplers,h={};for(r in u)u.hasOwnProperty(r)&&(h[r]=L.getAnimationParameterValues(e,o[u[r]]));for(var d=Number.MAX_VALUE,m=-Number.MAX_VALUE,p=l.length,f=new Array(p),v=0;p>v;++v){var g=l[v],_=g.target,y=c[g.sampler],C=h[y.input];d=Math.min(d,C[0]),m=Math.max(m,C[C.length-1]);var w=L.getAnimationSpline(e,a,s,g.sampler,y,h);f[v]=ft(e,i[_.id],_.path,w)}e._runtime.animations[a]={startTime:d,stopTime:m,channelEvaluators:f}}}}function gt(e,t){var r=e._loadResources;if(r.finishedBuffersCreation()&&r.finishedProgramCreation()&&r.createVertexArrays){r.createVertexArrays=!1;var i=e._rendererResources.buffers,n=e._rendererResources.vertexArrays,o=e.gltf,a=o.accessors,s=o.meshes;for(var u in s)if(s.hasOwnProperty(u))for(var c=s[u].primitives,h=c.length,d=0;h>d;++d){var m=c[d],p=ht(e,m),f=[],v=m.attributes;for(var g in v)if(v.hasOwnProperty(g)){var _=p[g];if(l(_)){var y=a[v[g]];f.push({index:_,vertexBuffer:i[y.bufferView],componentsPerAttribute:R(y).componentsPerAttribute,componentDatatype:y.componentType,normalize:!1,offsetInBytes:y.byteOffset,strideInBytes:y.byteStride})}}var C=a[m.indices],w=i[C.bufferView];n[u+".primitive."+d]=t.createVertexArray(f,w)}}}function _t(e){var t={};t[WebGLRenderingContext.BLEND]=!1,t[WebGLRenderingContext.CULL_FACE]=!1,t[WebGLRenderingContext.DEPTH_TEST]=!1,t[WebGLRenderingContext.POLYGON_OFFSET_FILL]=!1,t[WebGLRenderingContext.SCISSOR_TEST]=!1;var r,i=e.enable,n=i.length;for(r=0;n>r;++r)t[i[r]]=!0;return t}function yt(e,t){var r=e._loadResources;if(r.createRenderStates){r.createRenderStates=!1;var i=e._rendererResources.renderStates,n=e.gltf.techniques;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o],u=a.passes[a.pass],c=u.states,h=_t(c),d=s(c.functions,s.EMPTY_OBJECT),m=s(d.blendColor,[0,0,0,0]),p=s(d.blendEquationSeparate,[WebGLRenderingContext.FUNC_ADD,WebGLRenderingContext.FUNC_ADD]),f=s(d.blendFuncSeparate,[WebGLRenderingContext.ONE,WebGLRenderingContext.ONE,WebGLRenderingContext.ZERO,WebGLRenderingContext.ZERO]),v=s(d.colorMask,[!0,!0,!0,!0]),g=s(d.depthRange,[0,1]),_=s(d.polygonOffset,[0,0]),y=s(d.scissor,[0,0,0,0]);i[o]=t.createRenderState({frontFace:l(d.frontFace)?d.frontFace[0]:WebGLRenderingContext.CCW,cull:{enabled:h[WebGLRenderingContext.CULL_FACE],face:l(d.cullFace)?d.cullFace[0]:WebGLRenderingContext.BACK},lineWidth:l(d.lineWidth)?d.lineWidth[0]:1,polygonOffset:{enabled:h[WebGLRenderingContext.POLYGON_OFFSET_FILL],factor:_[0],units:_[1]},scissorTest:{enabled:h[WebGLRenderingContext.SCISSOR_TEST],rectangle:{x:y[0],y:y[1],width:y[2],height:y[3]}},depthRange:{near:g[0],far:g[1]},depthTest:{enabled:h[WebGLRenderingContext.DEPTH_TEST],func:l(d.depthFunc)?d.depthFunc[0]:WebGLRenderingContext.LESS},colorMask:{red:v[0],green:v[1],blue:v[2],alpha:v[3]},depthMask:l(d.depthMask)?d.depthMask[0]:!0,blending:{enabled:h[WebGLRenderingContext.BLEND],color:{red:m[0],green:m[1],blue:m[2],alpha:m[3]},equationRgb:p[0],equationAlpha:p[1],functionSourceRgb:f[0],functionSourceAlpha:f[1],functionDestinationRgb:f[2],functionDestinationAlpha:f[3]}})}}}function Ct(e){var t={value:e,clone:function(e){return e},func:function(){return t.value}};return t}function wt(e){var t={value:r.fromArray(e),clone:r.clone,func:function(){return t.value}};return t}function St(e){var t={value:i.fromArray(e),clone:i.clone,func:function(){return t.value}};return t}function Et(e){var t={value:n.fromArray(e),clone:n.clone,func:function(){return t.value}};return t}function bt(e){var t={value:_.fromColumnMajorArray(e),clone:_.clone,func:function(){return t.value}};return t}function Tt(e){var t={value:y.fromColumnMajorArray(e),clone:y.clone,func:function(){return t.value}};return t}function xt(e){var t={value:C.fromColumnMajorArray(e),clone:C.clone,func:function(){return t.value}};return t}function Pt(e,t){var r={value:t._rendererResources.textures[e],clone:function(e){return e},func:function(){return r.value}};return r}function At(e,t){var r=t._runtime.nodes[e];return function(){return r.computedMatrix}}function Mt(e,t){var r=e._loadResources;if(r.finishedTextureCreation()&&r.finishedProgramCreation()&&r.createUniformMaps){r.createUniformMaps=!1;var i=e.gltf,n=i.materials,o=i.techniques;i.programs;var a=e._rendererResources.uniformMaps;for(var s in n)if(n.hasOwnProperty(s)){var u=n[s],c=u.instanceTechnique,h=c.values,d=o[c.technique],m=d.parameters,p=d.passes[d.pass],f=p.instanceProgram,v=f.uniforms;e._rendererResources.programs[f.program].allUniforms;var g,_={},y={};for(var C in v)if(v.hasOwnProperty(C)){var w=v[C],S=m[w];if(l(h[w])){var E=er[S.type](h[w],e);_[C]=E.func,y[w]=E}else if(l(S.semantic))"JOINTMATRIX"!==S.semantic?_[C]=$t[S.semantic](t.uniformState):g=C;else if(l(S.source))_[C]=At(S.source,e);else if(l(S.value)){var b=er[S.type](S.value,e);_[C]=b.func,y[w]=b}}var T=a[s];T.uniformMap=_,T.values=y,T.jointMatrixUniformName=g}}}function Dt(e){return function(){return e}}function It(e){return function(){return e.computedJointMatrices}}function Ot(e,r,n,a){for(var u=e._renderCommands,c=e._pickCommands,h=e._pickIds,d=e.allowPicking,p=e._runtime.meshesByName,f=e.debugShowBoundingVolume,v=e._rendererResources,g=v.vertexArrays,_=v.programs,y=v.pickPrograms,w=v.renderStates,S=v.uniformMaps,E=e.gltf,b=E.accessors,T=E.meshes,x=E.techniques,A=E.materials,M=l(r.meshes)?r.meshes:r.instanceSkin.meshes,D=M.length,I=0;D>I;++I)for(var O=M[I],R=T[O],L=R.primitives,N=L.length,F=0;N>F;++F){var B,z=L[F],k=b[z.indices],U=A[z.material].instanceTechnique,W=x[U.technique],G=W.passes[W.pass],H=G.instanceProgram,q=z.attributes.POSITION;if(l(q)){var j=b[q];B=t.fromCornerPoints(i.fromArray(j.min),i.fromArray(j.max))}var Y=g[O+".primitive."+F],X=k.count,Z=k.byteOffset/m.getSizeInBytes(k.componentType),Q=S[z.material],J=Q.uniformMap;if(l(Q.jointMatrixUniformName)){var K={};K[Q.jointMatrixUniformName]=It(n),J=o(J,K)}var $=w[U.technique],et=$.blending.enabled,tt={primitive:s(e.pickPrimitive,e),id:e.id,node:n.publicNode,mesh:p[R.name]},rt=new P({boundingVolume:new t,modelMatrix:new C,primitiveType:z.primitive,vertexArray:Y,count:X,offset:Z,shaderProgram:_[H.program],uniformMap:J,renderState:$,owner:tt,debugShowBoundingVolume:f,pass:et?V.TRANSLUCENT:V.OPAQUE});u.push(rt);var it;if(d){var nt=a.createPickId(tt);h.push(nt);var ot=o(J,{czm_pickColor:Dt(nt.color)});it=new P({boundingVolume:new t,modelMatrix:new C,primitiveType:z.primitive,vertexArray:Y,count:X,offset:Z,shaderProgram:y[H.program],uniformMap:ot,renderState:$,owner:tt,pass:V.OPAQUE}),c.push(it)}n.commands.push({command:rt,pickCommand:it,boundingSphere:B})}}function Rt(e,t){var r=e._loadResources;if(r.finishedPendingLoads()&&r.finishedResourceCreation()&&r.createRuntimeNodes){r.createRuntimeNodes=!1;for(var n=[],o=e._runtime.nodes,a=e.gltf,s=a.nodes,u=a.scenes[a.scene],c=u.nodes,h=c.length,d=[],m=new i,p=0;h>p;++p)for(d.push({parentRuntimeNode:void 0,gltfNode:s[c[p]],id:c[p]});d.length>0;){var f=d.pop(),v=f.parentRuntimeNode,g=f.gltfNode,_=o[f.id];0===_.parents.length&&(l(g.matrix)?_.matrix=C.fromColumnMajorArray(g.matrix):(m=i.fromArray(g.rotation,0,m),_.translation=i.fromArray(g.translation),_.rotation=S.fromAxisAngle(m,g.rotation[3]),_.scale=i.fromArray(g.scale))),l(v)?(v.children.push(_),_.parents.push(v)):n.push(_),(l(g.meshes)||l(g.instanceSkin))&&Ot(e,g,_,t);for(var y=g.children,w=y.length,E=0;w>E;++E)d.push({parentRuntimeNode:_,gltfNode:s[y[E]],id:y[E]})}e._runtime.rootNodes=n,e._runtime.nodes=o}}function Lt(e,t){nt(e,t),st(e,t),lt(e,t),ct(e,t),pt(e),vt(e),gt(e,t),yt(e,t),Mt(e,t),Rt(e,t)}function Nt(e,t){var r=e.publicNode,i=r.matrix;r.useMatrix&&l(i)?C.clone(i,t):l(e.matrix)?C.clone(e.matrix,t):C.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)}function Ft(e,r,i){for(var n=e._maxDirtyNumber,o=e.allowPicking,a=e._runtime.rootNodes,s=a.length,l=tr,u=e._computedModelMatrix,c=0;s>c;++c){var h=a[c];for(Nt(h,h.transformToRoot),l.push(h);l.length>0;){h=l.pop();var d=h.transformToRoot,m=h.commands;if(h.dirtyNumber===n||r||i){var p=m.length;if(p>0)for(var f=0;p>f;++f){var v=m[f],g=v.command;if(C.multiplyTransformation(u,d,g.modelMatrix),t.transform(v.boundingSphere,g.modelMatrix,g.boundingVolume),o){var _=v.pickCommand;C.clone(g.modelMatrix,_.modelMatrix),t.clone(g.boundingVolume,_.boundingVolume)}}else h.computedMatrix=C.multiplyTransformation(u,d,h.computedMatrix)}for(var y=h.children,w=y.length,S=0;w>S;++S){var E=y[S];E.dirtyNumber=Math.max(E.dirtyNumber,h.dirtyNumber),(E.dirtyNumber===n||i)&&(Nt(E,E.transformToRoot),C.multiplyTransformation(d,E.transformToRoot,E.transformToRoot)),l.push(E)}}}++e._maxDirtyNumber}function Bt(e){for(var t=e._runtime.skinnedNodes,r=t.length,i=0;r>i;++i){var n=t[i];rr=C.inverseTransformation(n.transformToRoot,rr);for(var o=n.computedJointMatrices,a=n.joints,s=n.bindShapeMatrix,u=n.inverseBindMatrices,c=u.length,h=0;c>h;++h)l(o[h])||(o[h]=new C),o[h]=C.multiplyTransformation(rr,a[h].transformToRoot,o[h]),o[h]=C.multiplyTransformation(o[h],u[h],o[h]),l(s)&&(o[h]=C.multiplyTransformation(o[h],s,o[h]))}}function zt(e){var t=e.id;if(e._id!==t){e._id=t;for(var r=e._pickIds,i=r.length,n=0;i>n;++n)r[n].object.id=t}}function Vt(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?w.LINES:w.TRIANGLES,r=e._renderCommands,i=r.length,n=0;i>n;++n)r[n].primitiveType=t}}function kt(e,t,r,n){var o=n.camera,a=o.frustum,s=i.subtract(o.positionWC,e,nr),l=i.multiplyByScalar(o.directionWC,i.dot(s,o.directionWC),or),u=Math.max(a.near,i.magnitude(l)-t);ir.x=r.drawingBufferWidth,ir.y=r.drawingBufferHeight;var c=a.getPixelSize(ir,u),h=Math.max(c.x,c.y);return h}function Ut(e,t,r){var i=e.scale;if(0!==e.minimumPixelSize){var n=Math.max(t.drawingBufferWidth,t.drawingBufferHeight),o=e.modelMatrix;ar.x=o[12],ar.y=o[13],ar.z=o[14];var a=e.boundingSphere.radius,s=kt(ar,a,t,r),l=1/s,u=Math.min(l*2*a,n);ud;++d)r.push(p[d]);if(this.debugShowBoundingVolume!==this._debugShowBoundingVolume)for(this._debugShowBoundingVolume=this.debugShowBoundingVolume,d=0;dd;++d)r.push(p[d])}}},jt.prototype.isDestroyed=function(){return!1},jt.prototype.destroy=function(){var e=this._rendererResources;Wt(e.buffers),Wt(e.vertexArrays),Gt(e.programs),Gt(e.pickPrograms),Wt(e.textures),e=void 0,this._rendererResources=void 0;for(var t=this._pickIds,r=t.length,i=0;r>i;++i)t[i].destroy();return c(this)},jt}),r("DataSources/ModelVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Transforms","../Scene/Model","../Scene/ModelAnimationLoop","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,t,i,n){var o=i[t.id];if(r(o)){var a=o.modelPrimitive;a.readyToRender.removeEventListener(m,e),n.remove(a),a.isDestroyed()||a.destroy(),delete i[t.id]}}function m(e){e.activeAnimations.addAll({loop:c.REPEAT})}var p=1,f=0,v=new o,g=new t,_=new s,y=function(t,r){r.collectionChanged.addEventListener(y.prototype._onCollectionChanged,this),this._scene=t,this._primitives=t.primitives,this._entityCollection=r,this._modelHash={},this._entitiesToVisualize=new e,this._onCollectionChanged(r,r.entities,[],[])};return y.prototype.update=function(e){this._scene.context;for(var i=this._entitiesToVisualize.values,n=this._modelHash,c=this._primitives,d=this._scene,y=0,C=i.length;C>y;y++){var w,S=i[y],E=S._model,b=n[S.id],T=S.isAvailable(e)&&h.getValueOrDefault(E._show,e,!0);if(T&&(g=h.getValueOrUndefined(S._position,e,g),w=h.getValueOrUndefined(E._uri,e),T=r(g)&&r(w)),T){var x=r(b)?b.modelPrimitive:void 0;r(x)&&w===b.uri||(r(x)&&(c.remove(x),x.isDestroyed()||x.destroy(),delete n[S.id]),x=u.fromGltf({url:w}),x.readyToRender.addEventListener(m,this),x.id=S,c.add(x),b={modelPrimitive:x,uri:w,position:void 0,orientation:void 0},n[S.id]=b),x.show=!0,x.scale=h.getValueOrDefault(E._scale,e,p),x.minimumPixelSize=h.getValueOrDefault(E._minimumPixelSize,e,f),_=h.getValueOrUndefined(S._orientation,e,_),t.equals(g,b.position)&&s.equals(_,b.orientation)||(r(_)?a.fromRotationTranslation(o.fromQuaternion(_,v),g,x.modelMatrix):l.eastNorthUpToFixedFrame(g,d.globe.ellipsoid,x.modelMatrix),b.position=t.clone(g,b.position),b.orientation=s.clone(_,b.orientation))}else r(b)&&(b.modelPrimitive.show=!1)}return!0},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(y.prototype._onCollectionChanged,this);for(var e=this._entitiesToVisualize.values,t=this._modelHash,r=this._primitives,n=e.length-1;n>-1;n--)d(this,e[n],t,r);return i(this)},y.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)?s.set(a.id,a):(d(this,a,l,u),s.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],d(this,a,l,u),s.remove(a.id)},y}),r("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(normalize(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(normalize(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"}),r("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"}),r("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 texCoordExpandWidthAndShow;\nattribute vec4 pickColor;\nvarying vec2 v_st;\nvarying float v_width;\nvarying vec4 czm_pickColor;\nvoid main()\n{\nfloat texCoord = texCoordExpandWidthAndShow.x;\nfloat expandDir = texCoordExpandWidthAndShow.y;\nfloat width = abs(texCoordExpandWidthAndShow.z) + 0.5;\nbool usePrev = texCoordExpandWidthAndShow.z < 0.0;\nfloat show = texCoordExpandWidthAndShow.w;\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}\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"}),r("Scene/Polyline",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","../Core/PolylinePipeline","./Material"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t){++e._propertiesChanged[t];var r=e._polylineCollection;n(r)&&(r._updatePolyline(e,t),e._dirty=!0)}var h=function(o,a){o=i(o,i.EMPTY_OBJECT),this._show=i(o.show,!0),this._width=i(o.width,1),this._loop=i(o.loop,!1),this._material=o.material,n(this._material)||(this._material=u.fromType(u.ColorType,{color:new r(1,1,1,1)}));var c=o.positions;n(c)||(c=[]),this._positions=c,this._actualPositions=l.removeDuplicates(c),n(this._actualPositions)||(this._actualPositions=c),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=c.slice()),this._actualPositions.push(t.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=o.id;var h;n(a)&&(h=s.clone(a.modelMatrix)),this._modelMatrix=h,this._segments=l.wrapLongitude(this._actualPositions,h),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(g),this._polylineCollection=a,this._dirty=!1,this._pickId=void 0,this._boundingVolume=e.fromPoints(this._actualPositions),this._boundingVolumeWC=e.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new e -},d=h.SHOW_INDEX=0,m=h.WIDTH_INDEX=1,p=h.POSITION_INDEX=2,f=h.MATERIAL_INDEX=3,v=h.POSITION_SIZE_INDEX=4,g=h.NUMBER_OF_PROPERTIES=5;return o(h.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,c(this,d))}},positions:{get:function(){return this._positions},set:function(r){var i=l.removeDuplicates(r);n(i)||(i=r),this._loop&&i.length>2&&(i===r&&(i=r.slice()),i.push(t.clone(i[0]))),(this._actualPositions.length!==i.length||this._actualPositions.length!==this._length)&&c(this,v),this._positions=r,this._actualPositions=i,this._length=i.length,this._boundingVolume=e.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=e.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),c(this,p),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,c(this,f))}},width:{get:function(){return this._width},set:function(e){var t=this._width;e!==t&&(this._width=e,c(this,m))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){var r=this._actualPositions;e?r.length>2&&!t.equals(r[0],r[r.length-1])&&(r.length===this._positions.length&&(this._actualPositions=r=this._positions.slice()),r.push(t.clone(r[0]))):r.length>2&&t.equals(r[0],r[r.length-1])&&(r.length-1===this._positions.length?this._actualPositions=this._positions:r.pop()),this._loop=e,c(this,v)}}},id:{get:function(){return this._id},set:function(e){this._id=e,n(this._pickId)&&(this._pickId.object.id=e)}}}),h.prototype.update=function(){var t=s.IDENTITY;n(this._polylineCollection)&&(t=this._polylineCollection.modelMatrix);var r=this._segments.positions.length,i=this._segments.lengths,o=this._propertiesChanged[p]>0||this._propertiesChanged[v]>0;if((!s.equals(t,this._modelMatrix)||o)&&(this._segments=l.wrapLongitude(this._actualPositions,t),this._boundingVolumeWC=e.transform(this._boundingVolume,t,this._boundingVolumeWC)),this._modelMatrix=t,this._segments.positions.length!==r)c(this,v);else for(var a=i.length,u=0;a>u;++u)if(i[u]!==this._segments.lengths[u]){c(this,v);break}},h.prototype.getPickId=function(e){return n(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId},h.prototype._clean=function(){this._dirty=!1;for(var e=this._propertiesChanged,t=0;g-1>t;++t)e[t]=0},h.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0},h}),r("Scene/PolylineCollection",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/ShaderSource","../Shaders/PolylineCommon","../Shaders/PolylineFS","../Shaders/PolylineVS","./BlendingState","./Material","./Pass","./Polyline","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S,E,b,T){"use strict";function x(t,r,i,n,o,s,l){for(var u=n.length,c=0,h=!0,d=t._vertexArrays,m=t.debugShowBoundingVolume,p=d.length,f=0;p>f;++f)for(var g=d[f],_=g.buckets,y=_.length,C=0;y>C;++C){for(var w,S,b,x=_[C],P=x.offset,A=l?x.bucket.shaderProgram:x.bucket.pickShaderProgram,D=x.bucket.polylines,I=D.length,O=0,R=0;I>R;++R){var L=D[R],N=M(L._material);if(N!==w){if(a(w)&&O>0){var F=S.isTranslucent();c>=u?(b=new v({owner:t}),n.push(b)):b=n[c],++c,b.boundingVolume=e.clone(j,b.boundingVolume),b.modelMatrix=s,b.shaderProgram=A,b.vertexArray=g.va,b.renderState=F?t._translucentRS:t._opaqueRS,b.pass=F?E.TRANSLUCENT:E.OPAQUE,b.debugShowBoundingVolume=l?m:!1,b.uniformMap=S._uniforms,b.count=O,b.offset=P,P+=O,O=0,h=!0,o.push(b)}S=L._material,S.update(r),w=N}for(var B=L._locatorBuckets,z=B.length,V=0;z>V;++V){var k=B[V];k.locator===x&&(O+=k.count)}var U;i.mode===T.SCENE3D?U=L._boundingVolumeWC:i.mode===T.COLUMBUS_VIEW?U=L._boundingVolume2D:i.mode===T.SCENE2D?a(L._boundingVolume2D)&&(U=e.clone(L._boundingVolume2D,Y),U.center.x=0):a(L._boundingVolumeWC)&&a(L._boundingVolume2D)&&(U=e.union(L._boundingVolumeWC,L._boundingVolume2D,Y)),h?(h=!1,e.clone(U,j)):e.union(U,j,j)}a(w)&&O>0&&(c>=u?(b=new v({owner:t}),n.push(b)):b=n[c],++c,b.boundingVolume=e.clone(j,b.boundingVolume),b.modelMatrix=s,b.shaderProgram=A,b.vertexArray=g.va,b.renderState=S.isTranslucent()?t._translucentRS:t._opaqueRS,b.pass=S.isTranslucent()?E.TRANSLUCENT:E.OPAQUE,b.debugShowBoundingVolume=l?m:!1,b.uniformMap=S._uniforms,b.count=O,b.offset=P,h=!0,o.push(b)),w=void 0}n.length=c}function P(e){for(var t=e._buffersUsage,r=!1,i=e._propertiesChanged,n=0;G-2>n;++n){var o=t[n];i[n]?o.bufferUsage!==f.STREAM_DRAW?(r=!0,o.bufferUsage=f.STREAM_DRAW,o.frameCount=100):o.frameCount=100:o.bufferUsage!==f.STATIC_DRAW&&(0===o.frameCount?(r=!0,o.bufferUsage=f.STATIC_DRAW):o.frameCount--)}return r}function A(e,t,r){e._createVertexArray=!1,R(e),L(e),D(e);var i,o,s=[[]],l=s[0],u=[0],c=0,d=[[]],p=0,v=e._polylineBuckets;for(i in v)v.hasOwnProperty(i)&&(o=v[i],o.updateShader(t),p+=o.lengthOfPositions);if(p>0){var g,_=e._mode,y=new Float32Array(3*6*p),C=new Uint8Array(4*p),w=new Float32Array(4*p),S=0,E=0,b=0;for(i in v)if(v.hasOwnProperty(i)){o=v[i],o.write(y,C,w,S,E,b,t,r),_===T.MORPHING&&(a(g)||(g=new Float32Array(3*6*p)),o.writeForMorph(g,S));var x=o.lengthOfPositions;S+=3*6*x,E+=4*x,b+=4*x,c=o.updateIndices(s,u,d,c)}var P=e._buffersUsage[k].bufferUsage,A=e._buffersUsage[z].bufferUsage,M=e._buffersUsage[V].bufferUsage,I=A===f.STREAM_DRAW||M===f.STREAM_DRAW?f.STREAM_DRAW:f.STATIC_DRAW;e._positionBuffer=t.createVertexBuffer(y,P);var O;a(g)&&(O=t.createVertexBuffer(g,P)),e._pickColorBuffer=t.createVertexBuffer(C,f.STATIC_DRAW),e._texCoordExpandWidthAndShowBuffer=t.createVertexBuffer(w,I);for(var N=4*Uint8Array.BYTES_PER_ELEMENT,F=3*Float32Array.BYTES_PER_ELEMENT,B=4*Float32Array.BYTES_PER_ELEMENT,U=0,W=s.length,G=0;W>G;++G)if(l=s[G],l.length>0){var q=new Uint16Array(l),j=t.createIndexBuffer(q,f.STATIC_DRAW,h.UNSIGNED_SHORT);U+=u[G];var Y,Z,Q,J,K=6*(G*F*m.SIXTY_FOUR_KILOBYTES-U*F),$=F+K,et=F+$,tt=F+et,rt=F+tt,it=F+rt,nt=G*N*m.SIXTY_FOUR_KILOBYTES-U*N,ot=G*B*m.SIXTY_FOUR_KILOBYTES-U*B,at=[{index:H.position3DHigh,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:K,strideInBytes:6*F},{index:H.position3DLow,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:$,strideInBytes:6*F},{index:H.position2DHigh,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:K,strideInBytes:6*F},{index:H.position2DLow,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:$,strideInBytes:6*F},{index:H.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:et,strideInBytes:6*F},{index:H.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:tt,strideInBytes:6*F},{index:H.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:et,strideInBytes:6*F},{index:H.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:tt,strideInBytes:6*F},{index:H.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:rt,strideInBytes:6*F},{index:H.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:it,strideInBytes:6*F},{index:H.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:rt,strideInBytes:6*F},{index:H.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:n.FLOAT,offsetInBytes:it,strideInBytes:6*F},{index:H.texCoordExpandWidthAndShow,componentsPerAttribute:4,componentDatatype:n.FLOAT,vertexBuffer:e._texCoordExpandWidthAndShowBuffer,offsetInBytes:ot},{index:H.pickColor,componentsPerAttribute:4,componentDatatype:n.UNSIGNED_BYTE,vertexBuffer:e._pickColorBuffer,offsetInBytes:nt,normalize:!0}];_===T.SCENE3D?(Y=e._positionBuffer,Z="vertexBuffer",Q=X,J="value"):_===T.SCENE2D||_===T.COLUMBUS_VIEW?(Y=X,Z="value",Q=e._positionBuffer,J="vertexBuffer"):(Y=O,Z="vertexBuffer",Q=e._positionBuffer,J="vertexBuffer"),at[0][Z]=Y,at[1][Z]=Y,at[2][J]=Q,at[3][J]=Q,at[4][Z]=Y,at[5][Z]=Y,at[6][J]=Q,at[7][J]=Q,at[8][Z]=Y,at[9][Z]=Y,at[10][J]=Q,at[11][J]=Q;var st=t.createVertexArray(at,j);e._vertexArrays.push({va:st,buckets:d[G]})}}}function M(e){var t=S._uniformList[e.type],r=t.length;Z.length=2*r;for(var i=0,n=0;r>n;++n){var o=t[n];Z[i]=o,Z[i+1]=e._uniforms[o](),i+=2}return e.type+":"+JSON.stringify(Z)}function D(e){for(var t=e._mode,r=e._modelMatrix,i=e._polylineBuckets={},n=e._polylines,o=n.length,s=0;o>s;++s){var l=n[s];if(l._actualPositions.length>1){l.update();var u=l.material,c=i[u.type];a(c)||(c=i[u.type]=new Q(u,t,r)),c.addPolyline(l)}}}function I(e,t){var r=t.mode;e._mode===r&&p.equals(e._modelMatrix,e.modelMatrix)||(e._mode=r,e._modelMatrix=p.clone(e.modelMatrix),e._createVertexArray=!0)}function O(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var t=[],r=e._polylines.length,i=0,n=0;r>i;++i){var o=e._polylines[i];a(o)&&(o._index=n++,t.push(o))}e._polylines=t}}function R(e){for(var t=e._polylines,r=t.length,i=0;r>i;++i)if(a(t[i])){var n=t[i]._bucket;a(n)&&(n.shaderProgram=n.shaderProgram&&n.shaderProgram.destroy())}}function L(e){for(var t=e._vertexArrays.length,r=0;t>r;++r)e._vertexArrays[r].va.destroy();e._vertexArrays.length=0}function N(e){for(var t=e._polylines,r=t.length,i=0;r>i;++i)a(t[i])&&t[i]._destroy()}function F(e,t,r){this.count=e,this.offset=t,this.bucket=r}function B(e){return t.dot(t.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersect(r.UNIT_Y)===d.INTERSECTING}var z=b.SHOW_INDEX,V=b.WIDTH_INDEX,k=b.POSITION_INDEX,U=b.MATERIAL_INDEX,W=b.POSITION_SIZE_INDEX,G=b.NUMBER_OF_PROPERTIES,H={texCoordExpandWidthAndShow: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,pickColor:13},q=function(e){e=o(e,o.EMPTY_OBJECT),this.modelMatrix=p.clone(o(e.modelMatrix,p.IDENTITY)),this._modelMatrix=p.clone(p.IDENTITY),this.debugShowBoundingVolume=o(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(G),this._polylines=[],this._polylineBuckets={},this._buffersUsage=[{bufferUsage:f.STATIC_DRAW,frameCount:0},{bufferUsage:f.STATIC_DRAW,frameCount:0},{bufferUsage:f.STATIC_DRAW,frameCount:0}],this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._pickColorBuffer=void 0,this._texCoordExpandWidthAndShowBuffer=void 0};s(q.prototype,{length:{get:function(){return O(this),this._polylines.length}}}),q.prototype.add=function(e){var t=new b(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,t},q.prototype.remove=function(e){if(this.contains(e)){if(this._polylines[e._index]=void 0,this._polylinesRemoved=!0,this._createVertexArray=!0,a(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},q.prototype.removeAll=function(){R(this),N(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},q.prototype.contains=function(e){return a(e)&&e._polylineCollection===this},q.prototype.get=function(e){return O(this),this._polylines[e]},q.prototype.update=function(e,t,r){if(O(this),0!==this._polylines.length){I(this,t);var i,n=t.mapProjection,o=this._propertiesChanged;if(this._createVertexArray||P(this))A(this,e,n);else if(this._polylinesUpdated){var s=this._polylinesToUpdate;if(this._mode!==T.SCENE3D)for(var l=s.length,u=0;l>u;++u)i=s[u],i.update();if(o[W]||o[U])A(this,e,n);else for(var c=s.length,h=this._polylineBuckets,d=0;c>d;++d){i=s[d],o=i._propertiesChanged;var m=i._bucket,f=0;for(var v in h)if(h.hasOwnProperty(v)){if(h[v]===m){(o[k]||o[z]||o[V])&&m.writeUpdate(f,i,this._positionBuffer,this._texCoordExpandWidthAndShowBuffer,n);break}f+=h[v].lengthOfPositions}i._clean()}s.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(var g=0;G>g;++g)o[g]=0;var _=p.IDENTITY;t.mode===T.SCENE3D&&(_=this.modelMatrix);var y=t.passes,C=0!==t.morphTime;if(a(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===C||(this._opaqueRS=e.createRenderState({depthMask:C,depthTest:{enabled:C}})),a(this._translucentRS)&&this._translucentRS.depthTest.enabled===C||(this._translucentRS=e.createRenderState({blending:w.ALPHA_BLEND,depthMask:!C,depthTest:{enabled:C}})),y.render){var S=this._colorCommands;x(this,e,t,S,r,_,!0)}if(y.pick){var E=this._pickCommands;x(this,e,t,E,r,_,!1)}}};var j=new e,Y=new e;q.prototype.isDestroyed=function(){return!1},q.prototype.destroy=function(){return L(this),R(this),N(this),l(this)};var X=[0,0,0],Z=[];q.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};var Q=function(e,t,r){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.pickShaderProgram=void 0,this.mode=t,this.modelMatrix=r};Q.prototype.addPolyline=function(e){var t=this.polylines;t.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},Q.prototype.updateShader=function(e){if(!a(this.shaderProgram)){var t=new g({sources:[_,C]}),r=new g({sources:[this.material.shaderSource,y]}),i=new g({sources:r.sources,pickColorQualifier:"varying"});this.shaderProgram=e.createShaderProgram(t,r,H),this.pickShaderProgram=e.createShaderProgram(t,i,H)}},Q.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===T.SCENE3D||!B(e))return t=e._actualPositions.length,4*t-4;var r=0,i=e._segments.lengths;t=i.length;for(var n=0;t>n;++n)r+=4*i[n]-4;return r};var J=new t,K=new t,$=new t,et=new t;Q.prototype.write=function(e,r,n,o,a,s,l,u){for(var h=this.mode,d=this.polylines,m=d.length,p=0;m>p;++p)for(var f,v=d[p],g=v.width,_=v.show&&g>0,y=this.getSegments(v,u),C=y.positions,w=y.lengths,S=C.length,E=v.getPickId(l).color,b=0,x=0,P=0;S>P;++P){0===P?v._loop?f=C[S-2]:(f=et,t.subtract(C[0],C[1],f),t.add(C[0],f,f)):f=C[P-1],K.x=f.x,K.y=f.y,K.z=h!==T.SCENE2D?f.z:0,f=C[P],J.x=f.x,J.y=f.y,J.z=h!==T.SCENE2D?f.z:0,P===S-1?v._loop?f=C[1]:(f=et,t.subtract(C[S-1],C[S-2],f),t.add(C[S-1],f,f)):f=C[P+1],$.x=f.x,$.y=f.y,$.z=h!==T.SCENE2D?f.z:0;var A=w[b];P===x+A&&(x+=A,++b);for(var M=0===P-x,D=P===x+w[b]-1,I=M?2:0,O=D?2:4,R=I;O>R;++R){c.writeElements(J,e,o),c.writeElements(K,e,o+6),c.writeElements($,e,o+12),r[a]=i.floatToByte(E.red),r[a+1]=i.floatToByte(E.green),r[a+2]=i.floatToByte(E.blue),r[a+3]=i.floatToByte(E.alpha);var L=0>R-2?-1:1;n[s]=P/(S-1),n[s+1]=2*(R%2)-1,n[s+2]=L*g,n[s+3]=_,o+=18,a+=4,s+=4}}};var tt=new t,rt=new t,it=new t,nt=new t;Q.prototype.writeForMorph=function(e,r){for(var i=this.modelMatrix,n=this.polylines,o=n.length,a=0;o>a;++a)for(var s=n[a],l=s._segments.positions,u=s._segments.lengths,h=l.length,d=0,m=0,f=0;h>f;++f){var v;0===f?s._loop?v=l[h-2]:(v=nt,t.subtract(l[0],l[1],v),t.add(l[0],v,v)):v=l[f-1],v=p.multiplyByPoint(i,v,rt);var g,_=p.multiplyByPoint(i,l[f],tt);f===h-1?s._loop?g=l[1]:(g=nt,t.subtract(l[h-1],l[h-2],g),t.add(l[h-1],g,g)):g=l[f+1],g=p.multiplyByPoint(i,g,it);var y=u[d];f===m+y&&(m+=y,++d);for(var C=0===f-m,w=f===m+u[d]-1,S=C?2:0,E=w?2:4,b=S;E>b;++b)c.writeElements(_,e,r),c.writeElements(v,e,r+6),c.writeElements(g,e,r+12),r+=18}};var ot=new Array(1);Q.prototype.updateIndices=function(e,t,r,i){var n=r.length-1,o=new F(0,i,this);r[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;c>h;++h){var d=u[h];d._locatorBuckets=[];var p;if(this.mode===T.SCENE3D){p=ot;var f=d._actualPositions.length;if(!(f>0))continue;p[0]=f}else p=d._segments.lengths;var v=p.length;if(v>0){for(var g=0,_=0;v>_;++_)for(var y=p[_]-1,C=0;y>C;++C)l+4>=m.SIXTY_FOUR_KILOBYTES-1&&(d._locatorBuckets.push({locator:o,count:g}),g=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,i=0,o=new F(0,0,this),r[++n]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),g+=6,a+=6,i+=6,l+=4;d._locatorBuckets.push({locator:o,count:g}),l+4>=m.SIXTY_FOUR_KILOBYTES-1&&(t.push(0),s=[],e.push(s),l=0,o.count=a,i=0,a=0,o=new F(0,0,this),r[++n]=[o])}d._clean()}return o.count=a,i},Q.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,r=0,i=t.length,n=0;i>n;++n){var o=t[n];if(o===e)break;r+=o._actualLength}return r};var at={positions:void 0,lengths:void 0},st=new Array(1),lt=new t;Q.prototype.getSegments=function(r,i){var n=r._actualPositions;if(this.mode===T.SCENE3D)return st[0]=n.length,at.positions=n,at.lengths=st,at;B(r)&&(n=r._segments.positions);for(var o,a=i.ellipsoid,s=[],l=this.modelMatrix,u=n.length,c=lt,h=0;u>h;++h)o=n[h],c=p.multiplyByPoint(l,o,c),s.push(i.project(a.cartesianToCartographic(c)));if(s.length>0){r._boundingVolume2D=e.fromPoints(s,r._boundingVolume2D);var d=r._boundingVolume2D.center;r._boundingVolume2D.center=new t(d.z,d.x,d.y)}return at.positions=s,at.lengths=r._segments.lengths,at};var ut,ct;return Q.prototype.writeUpdate=function(e,r,i,n,o){var s=this.mode,l=r._actualLength;if(l){e+=this.getPolylineStartIndex(r);var u=ut,h=ct,d=3*6*l;!a(u)||u.lengthd&&(u=new Float32Array(u.buffer,0,d),h=new Float32Array(h.buffer,0,4*l));var m,p=0,f=0,v=this.getSegments(r,o),g=v.positions,_=v.lengths,y=0,C=0,w=r.width,S=r.show&&w>0;l=g.length;for(var E=0;l>E;++E){0===E?r._loop?m=g[l-2]:(m=et,t.subtract(g[0],g[1],m),t.add(g[0],m,m)):m=g[E-1],K.x=m.x,K.y=m.y,K.z=s!==T.SCENE2D?m.z:0,m=g[E],J.x=m.x,J.y=m.y,J.z=s!==T.SCENE2D?m.z:0,E===l-1?r._loop?m=g[1]:(m=et,t.subtract(g[l-1],g[l-2],m),t.add(g[l-1],m,m)):m=g[E+1],$.x=m.x,$.y=m.y,$.z=s!==T.SCENE2D?m.z:0;var b=_[y];E===C+b&&(C+=b,++y);for(var x=0===E-C,P=E===C+_[y]-1,A=x?2:0,M=P?2:4,D=A;M>D;++D){c.writeElements(J,u,p),c.writeElements(K,u,p+6),c.writeElements($,u,p+12);var I=0>D-2?-1:1;h[f]=E/(l-1),h[f+1]=2*(D%2)-1,h[f+2]=I*w,h[f+3]=S,p+=18,f+=4}}i.copyFromArrayView(u,18*Float32Array.BYTES_PER_ELEMENT*e),n.copyFromArrayView(h,4*Float32Array.BYTES_PER_ELEMENT*e)}},q}),r("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","./TimeIntervalCollectionPositionProperty"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y){"use strict";function C(e,t,i,n,a,s,l,u){var c,h=e._property._times,d=l;c=e.getValueInReferenceFrame(t,a,u[d]),r(c)&&(u[d++]=c);for(var m,p,f,v=!r(n)||o.lessThanOrEquals(n,t)||o.greaterThanOrEquals(n,i),g=0,_=h.length,y=h[g],C=i,w=!1;_>g;){if(!v&&o.greaterThanOrEquals(y,n)&&(c=e.getValueInReferenceFrame(n,a,u[d]),r(c)&&(u[d++]=c),v=!0),o.greaterThan(y,t)&&o.lessThan(y,C)&&!y.equals(n)&&(c=e.getValueInReferenceFrame(y,a,u[d]),r(c)&&(u[d++]=c)),_-1>g){if(s>0&&!w){var S=h[g+1],E=o.secondsDifference(S,y);w=E>s,w&&(m=Math.ceil(E/s),p=0,f=E/Math.max(m,2),m=Math.max(m-1,1))}if(w&&m>p){y=o.addSeconds(y,f,new o),p++;continue}}w=!1,g++,y=h[g]}return c=e.getValueInReferenceFrame(i,a,u[d]),r(c)&&(u[d++]=c),d}function w(e,t,i,n,a,s,l,u){for(var c,h=0,d=l,m=t,p=Math.max(s,60),f=!r(n)||o.lessThanOrEquals(n,t)||o.greaterThanOrEquals(n,i);o.lessThan(m,i);)!f&&o.greaterThanOrEquals(m,n)&&(f=!0,c=e.getValueInReferenceFrame(n,a,u[d]),r(c)&&(u[d]=c,d++)),c=e.getValueInReferenceFrame(m,a,u[d]),r(c)&&(u[d]=c,d++),h++,m=o.addSeconds(t,p*h,new o);return c=e.getValueInReferenceFrame(i,a,u[d]),r(c)&&(u[d]=c,d++),d}function S(e,t,i,n,a,s,l,c){D.start=t,D.stop=i;for(var h=l,d=e.intervals,m=0;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 A=v.getValueOrDefault(s._resolution,e,x);c.show=!0,c.positions=T(l,i,n,e,this._referenceFrame,A,c.positions),c.material=f.getValue(e,s._material,c.material),c.width=v.getValueOrDefault(s._width,e,P)},R.prototype.removeObject=function(e){var t=e.polyline;r(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,e.index=void 0)},R.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),i(this)};var L=function(t,r){r.collectionChanged.addEventListener(L.prototype._onCollectionChanged,this),this._scene=t,this._updaters={},this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.entities,[],[])};return L.prototype.update=function(e){var t=this._updaters;for(var i in t)t.hasOwnProperty(i)&&t[i].update(e);for(var n=this._items.values,o=0,a=n.length;a>o;o++){var s=n[o],u=s.entity,c=u._position,h=u._pathUpdater,m=l.FIXED;this._scene.mode===d.SCENE3D&&(m=c.referenceFrame);var p=this._updaters[m];h===p&&r(p)?p.updateObject(e,s):(r(h)&&h.removeObject(s),r(p)||(p=new R(this._scene,m),p.update(e),this._updaters[m]=p),s.updater=p,r(p)&&p.updateObject(e,s))}return!0},L.prototype.isDestroyed=function(){return!1},L.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(L.prototype._onCollectionChanged,this);var e=this._updaters;for(var t in e)e.hasOwnProperty(t)&&e[t].destroy();return i(this)},L.prototype._onCollectionChanged=function(e,t,i,n){var o,a,s,l=this._items;for(o=t.length-1;o>-1;o--)a=t[o],r(a._path)&&r(a._position)&&l.set(a.id,new I(a));for(o=n.length-1;o>-1;o--)a=n[o],r(a._path)&&r(a._position)?l.contains(a.id)||l.set(a.id,new I(a)):(s=l.get(a.id),r(s)&&(s.updater.removeObject(s),l.remove(a.id)));for(o=i.length-1;o>-1;o--)a=i[o],s=l.get(a.id),r(s)&&(s.updater.removeObject(s),l.remove(a.id))},L._subSample=T,L}),r("DataSources/PointVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/NearFarScalar","../Scene/BillboardCollection","./Property"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,t){if(i(e)){var r=e.billboard;i(r)&&(e.billboard=void 0,r.show=!1,r.image=void 0,t.push(r._index))}}function c(e,t,r,i,n){return function(){var o=document.createElement("canvas"),a=n+2*i;o.height=o.width=a;var s=o.getContext("2d");return s.clearRect(0,0,a,a),0!==i&&(s.beginPath(),s.arc(a/2,a/2,a/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=r,s.fill(),1>e&&(s.save(),s.globalCompositeOperation="destination-out",s.beginPath(),s.arc(a/2,a/2,n/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle="black",s.fill(),s.restore())),s.beginPath(),s.arc(a/2,a/2,n/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=t,s.fill(),o}}var h=r.WHITE,d=r.BLACK,m=0,p=1,f=new r,v=new t,g=new r,_=new a,y=function(e){this.entity=e,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0},C=function(t,r,n){r.collectionChanged.addEventListener(C.prototype._onCollectionChanged,this),this._primitiveCollection=t,this._unusedIndexes=[],this._entityCollection=r,this._billboardCollection=void 0,this._items=new e,this._propertyName=i(n)?n:"_point",this._onCollectionChanged(r,r.entities,[],[])};return C.prototype.update=function(e){for(var t=this._items.values,n=this._unusedIndexes,o=this._propertyName,a=0,y=t.length;y>a;a++){var C=t[a],w=C.entity,S=w[o],E=C.billboard,b=w.isAvailable(e)&&l.getValueOrDefault(S._show,e,!0);if(b&&(v=l.getValueOrUndefined(w._position,e,v),b=i(v)),b){var T=!1,x=!1;if(!i(E)){T=!0;var P=this._billboardCollection;i(P)||(P=new s,this._billboardCollection=P,this._primitiveCollection.add(P));var A=n.length;E=A>0?P.get(n.pop()):P.add(),E.id=w,E.image=void 0,C.billboard=E,x=!0}E.show=!0,E.position=v,E.scaleByDistance=l.getValueOrUndefined(S._scaleByDistance,e,_);var M=S._color,D=S._outlineColor,I=T||!l.isConstant(M)?l.getValueOrDefault(M,e,h,f):C.color,O=T||!l.isConstant(D)?l.getValueOrDefault(D,e,d,g):C.outlineColor,R=Math.round(l.getValueOrDefault(S._outlineWidth,e,m)),L=Math.max(1,Math.round(l.getValueOrDefault(S._pixelSize,e,p)));if(R>0?(E.scale=1,x=x||R!==C.outlineWidth||L!==C.pixelSize||!r.equals(I,C.color)||!r.equals(O,C.outlineColor)):(E.scale=L/50,L=50,x=x||R!==C.outlineWidth||!r.equals(I,C.color)||!r.equals(O,C.outlineColor)),x){C.color=r.clone(I,C.color),C.outlineColor=r.clone(O,C.outlineColor),C.pixelSize=L,C.outlineWidth=R;var N=I.alpha,F=I.toCssColorString(),B=O.toCssColorString(),z=JSON.stringify([F,L,B,R]);E.setImage(z,c(N,F,B,R,L))}}else u(C,n)}return!0},C.prototype.isDestroyed=function(){return!1},C.prototype.destroy=function(){return this._entityCollection.collectionChanged.removeEventListener(C.prototype._onCollectionChanged,this),i(this._billboardCollection)&&this._primitiveCollection.remove(this._billboardCollection),n(this)},C.prototype._onCollectionChanged=function(e,t,r,n){var o,a,s=this._unusedIndexes,l=this._items,c=this._propertyName;for(o=t.length-1;o>-1;o--)a=t[o],i(a[c])&&i(a._position)&&l.set(a.id,new y(a));for(o=n.length-1;o>-1;o--)a=n[o],i(a[c])&&i(a._position)?l.contains(a.id)||l.set(a.id,new y(a)):(u(l.get(a.id),s),l.remove(a.id));for(o=r.length-1;o>-1;o--)a=r[o],u(l.get(a.id),s),l.remove(a.id)},C}),r("DataSources/PolygonGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolygonGeometry","../Core/PolygonOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y){"use strict";var C=v.fromColor(e.WHITE),w=new g(!0),S=new g(!0),E=new g(!1),b=new g(e.BLACK),T=function(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy={positions:void 0},this.perPositionHeight=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0},x=function(e,t,r){this._entity=e,this._scene=t,this._propertyName=i(r)?r:"polygon",this._entitySubscription=e.definitionChanged.addEventListener(x.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new T(e),this._onEntityPropertyChanged(e,this._propertyName,e[this._propertyName],void 0)};n(x,{perInstanceColorAppearanceType:{value:p},materialAppearanceType:{value:m}}),n(x.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._entity.availability)&&y.isConstant(this._showProperty)&&y.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!i(this._entity.availability)&&y.isConstant(this._showProperty)&&y.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),x.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},x.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},x.prototype.createFillGeometryInstance=function(r){var n,o,a=this._entity,s=a.isAvailable(r),u=new d(s&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r));if(this._materialProperty instanceof v){var h=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(h=this._materialProperty.color.getValue(r)),o=t.fromColor(h),n={show:u,color:o}}else n={show:u};return new l({id:a,geometry:new c(this._options),attributes:n})},x.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r);return new l({id:i,geometry:new h(this._options),attributes:{show:new d(n&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(n?this._outlineColorProperty.getValue(r):e.BLACK)}})},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._entitySubscription(),o(this)},x.prototype._onEntityPropertyChanged=function(e,t){if("availability"===t||t===this._propertyName){var n=e[this._propertyName];if(!i(n))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var o=n.fill,a=i(o)&&o.isConstant?o.getValue(u.MINIMUM_VALUE):!0,s=n.outline,l=i(s);if(l&&s.isConstant&&(l=s.getValue(u.MINIMUM_VALUE)),!a&&!l)return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0; -var c=n.positions,h=n.show;if(i(h)&&h.isConstant&&!h.getValue(u.MINIMUM_VALUE)||!i(c))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var d=r(n.material,C),f=d instanceof v;this._materialProperty=d,this._fillProperty=r(o,S),this._showProperty=r(h,w),this._showOutlineProperty=r(n.outline,E),this._outlineColorProperty=l?r(n.outlineColor,b):void 0;var g=n.height,_=n.extrudedHeight,T=n.granularity,x=n.stRotation,P=n.outlineWidth,A=n.perPositionHeight;if(this._isClosed=i(_),this._fillEnabled=a,this._outlineEnabled=l,c.isConstant&&y.isConstant(g)&&y.isConstant(_)&&y.isConstant(T)&&y.isConstant(x)&&y.isConstant(P)&&y.isConstant(A)){var M=this._options;M.vertexFormat=f?p.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,M.polygonHierarchy.positions=c.getValue(u.MINIMUM_VALUE,M.polygonHierarchy.positions),M.height=i(g)?g.getValue(u.MINIMUM_VALUE):void 0,M.extrudedHeight=i(_)?_.getValue(u.MINIMUM_VALUE):void 0,M.granularity=i(T)?T.getValue(u.MINIMUM_VALUE):void 0,M.stRotation=i(x)?x.getValue(u.MINIMUM_VALUE):void 0,M.perPositionHeight=i(A)?A.getValue(u.MINIMUM_VALUE):void 0,this._outlineWidth=i(P)?P.getValue(u.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},x.prototype.createDynamicUpdater=function(e){return new P(e,this)};var P=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new T(t._entity)};return P.prototype.update=function(r){var n=this._geometryUpdater;i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive);var o=n._entity,a=o[n._propertyName],s=a.show;if(o.isAvailable(r)&&(!i(s)||s.getValue(r))){var u=this._options,d=a.positions,v=a.perPositionHeight,g=a.height,y=a.extrudedHeight,C=a.granularity,w=a.stRotation;if(u.polygonHierarchy.positions=d.getValue(r,u.polygonHierarchy.positions),u.height=i(g)?g.getValue(r,u):void 0,u.extrudedHeight=i(y)?y.getValue(r,u):void 0,u.granularity=i(C)?C.getValue(r):void 0,u.stRotation=i(w)?w.getValue(r):void 0,!i(a.fill)||a.fill.getValue(r)){u.perPositionHeight=i(v)?v.getValue(r):void 0,this._material=_.getValue(r,n.fillMaterialProperty,this._material);var S=this._material,E=new m({material:S,translucent:S.isTranslucent(),closed:i(u.extrudedHeight)});u.vertexFormat=E.vertexFormat,this._primitive=new f({geometryInstances:new l({id:o,geometry:new c(u)}),appearance:E,asynchronous:!1}),this._primitives.add(this._primitive)}if(i(a.outline)&&a.outline.getValue(r)){u.vertexFormat=p.VERTEX_FORMAT;var b=i(a.outlineColor)?a.outlineColor.getValue(r):e.BLACK,T=i(a.outlineWidth)?a.outlineWidth.getValue(r):1,x=1!==b.alpha;this._outlinePrimitive=new f({geometryInstances:new l({id:o,geometry:new h(u),attributes:{color:t.fromColor(b)}}),appearance:new p({flat:!0,translucent:x,renderState:{depthTest:{enabled:!x},lineWidth:n._scene.clampLineWidth(T)}}),asynchronous:!1}),this._primitives.add(this._outlinePrimitive)}}},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive),o(this)},x}),r("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;\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"}),r("Scene/PolylineColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PolylineColorAppearanceVS","../Shaders/PolylineCommon","./Appearance"],function(e,t,r,i,n,o,a){"use strict";var s=o+"\n"+n,l=i,u=function(t){t=e(t,e.EMPTY_OBJECT);var r=e(t.translucent,!0),i=!1,n=u.VERTEX_FORMAT;this.material=void 0,this.translucent=r,this._vertexShaderSource=e(t.vertexShaderSource,s),this._fragmentShaderSource=e(t.fragmentShaderSource,l),this._renderState=e(t.renderState,a.getDefaultRenderState(r,i)),this._closed=i,this._vertexFormat=n};return t(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_ONLY,u.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,u.prototype.isTranslucent=a.prototype.isTranslucent,u.prototype.getRenderState=a.prototype.getRenderState,u}),r("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;\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"}),r("Scene/PolylineMaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PolylineMaterialAppearanceVS","../Shaders/PolylineCommon","../Shaders/PolylineFS","./Appearance","./Material"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=o+"\n"+n,c=a,h=function(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),n=!1,o=h.VERTEX_FORMAT;this.material=t(r.material)?r.material:l.fromType(l.ColorType),this.translucent=i,this._vertexShaderSource=e(r.vertexShaderSource,u),this._fragmentShaderSource=e(r.fragmentShaderSource,c),this._renderState=e(r.renderState,s.getDefaultRenderState(i,n)),this._closed=n,this._vertexFormat=o};return r(h.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}}}),h.VERTEX_FORMAT=i.POSITION_AND_ST,h.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,h.prototype.isTranslucent=s.prototype.isTranslucent,h.prototype.getRenderState=s.prototype.getRenderState,h}),r("DataSources/PolylineGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineGeometry","../Core/PolylinePipeline","../Core/ShowGeometryInstanceAttribute","../Scene/PolylineCollection","../Scene/PolylineColorAppearance","../Scene/PolylineMaterialAppearance","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C){"use strict";var w={},S=g.fromColor(e.WHITE),E=new _(!0),b=function(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.followSurface=void 0,this.granularity=void 0},T=function(e,t,r){this._entity=e,this._scene=t,this._propertyName=i(r)?r:"polyline",this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new l,this._showProperty=void 0,this._materialProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,this._propertyName,e[this._propertyName],void 0)};n(T,{perInstanceColorAppearanceType:{value:f},materialAppearanceType:{value:v}}),n(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._entity.availability)&&C.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(){return!1},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(r){var n,o,a=this._entity,s=a.isAvailable(r),l=new m(s&&this._showProperty.getValue(r));if(this._materialProperty instanceof g){var c=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(c=this._materialProperty.color.getValue(r)),n=t.fromColor(c),o={show:l,color:n}}else o={show:l};return new u({id:a,geometry:new h(this._options),attributes:o})},T.prototype.createOutlineGeometryInstance=function(){},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),o(this)},T.prototype._onEntityPropertyChanged=function(e,t){if("availability"===t||t===this._propertyName){var n=e[this._propertyName];if(!i(n))return this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var o=n.positions,a=n.show;if(i(a)&&a.isConstant&&!a.getValue(c.MINIMUM_VALUE)||!i(o))return this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var s=r(n.material,S),l=s instanceof g;this._materialProperty=s,this._showProperty=r(a,E),this._fillEnabled=!0;var u=n.width,h=n.followSurface,d=n.granularity;if(o.isConstant&&C.isConstant(u)&&C.isConstant(h)&&C.isConstant(d)){var m=this._options,p=o.getValue(c.MINIMUM_VALUE,m.positions);if(!i(p)||p.length<2)return this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;m.vertexFormat=l?f.VERTEX_FORMAT:v.VERTEX_FORMAT,m.positions=p,m.width=i(u)?u.getValue(c.MINIMUM_VALUE):void 0,m.followSurface=i(h)?h.getValue(c.MINIMUM_VALUE):void 0,m.granularity=i(d)?d.getValue(c.MINIMUM_VALUE):void 0,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)};var x=function(e,t){var r=t._scene.id,n=w[r];i(n)||(n=new p,w[r]=n,e.add(n));var o=n.add();o.id=t._entity,this._line=o,this._primitives=e,this._geometryUpdater=t,this._positions=[]};return x.prototype.update=function(e){var t=this._geometryUpdater,r=t._entity,i=r[t._propertyName],n=this._line,o=r.isAvailable(e)&&C.getValueOrDefault(i._show,e,!0);if(!o)return n.show=!1,void 0;var a=i.positions,l=a.getValue(e,this._positions),u=C.getValueOrDefault(i._followSurface,e,!0);if(u){var c=C.getValueOrUndefined(i._granularity,e);l=d.generateCartesianArc({positions:l,granularity:c,height:d.extractHeights(l,s.WGS84)})}n.show=!0,n.positions=l,n.material=y.getValue(e,t.fillMaterialProperty,n.material),n.width=C.getValueOrDefault(i._width,e,1)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._geometryUpdater,t=e._scene.id,r=w[t];r.remove(this._line),0===r.length&&(this._primitives.remove(r),r.isDestroyed()||r.destroy(),delete w[t]),o(this)},T}),r("DataSources/RectangleGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/RectangleGeometry","../Core/RectangleOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y){"use strict";var C=v.fromColor(e.WHITE),w=new g(!0),S=new g(!0),E=new g(!1),b=new g(e.BLACK),T=function(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},x=function(e,t,r){this._entity=e,this._scene=t,this._propertyName=i(r)?r:"rectangle",this._entitySubscription=e.definitionChanged.addEventListener(x.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new T(e),this._onEntityPropertyChanged(e,this._propertyName,e[this._propertyName],void 0)};n(x,{perInstanceColorAppearanceType:{value:p},materialAppearanceType:{value:m}}),n(x.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._entity.availability)&&y.isConstant(this._showProperty)&&y.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!i(this._entity.availability)&&y.isConstant(this._showProperty)&&y.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),x.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},x.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},x.prototype.createFillGeometryInstance=function(r){var n,o,a=this._entity,s=a.isAvailable(r),u=new d(s&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r));if(this._materialProperty instanceof v){var h=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(h=this._materialProperty.color.getValue(r)),o=t.fromColor(h),n={show:u,color:o}}else n={show:u};return new l({id:a,geometry:new c(this._options),attributes:n})},x.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r);return new l({id:i,geometry:new h(this._options),attributes:{show:new d(n&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(n?this._outlineColorProperty.getValue(r):e.BLACK)}})},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._entitySubscription(),o(this)},x.prototype._onEntityPropertyChanged=function(e,t){if("availability"===t||t===this._propertyName){var n=e[this._propertyName];if(!i(n))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var o=n.fill,a=i(o)&&o.isConstant?o.getValue(u.MINIMUM_VALUE):!0,s=n.outline,l=i(s);if(l&&s.isConstant&&(l=s.getValue(u.MINIMUM_VALUE)),!a&&!l)return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var c=n.coordinates,h=n.show;if(i(h)&&h.isConstant&&!h.getValue(u.MINIMUM_VALUE)||!i(c))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var d=r(n.material,C),f=d instanceof v;this._materialProperty=d,this._fillProperty=r(o,S),this._showProperty=r(h,w),this._showOutlineProperty=r(n.outline,E),this._outlineColorProperty=l?r(n.outlineColor,b):void 0;var g=n.height,_=n.extrudedHeight,T=n.granularity,x=n.stRotation,P=n.rotation,A=n.outlineWidth,M=n.closeBottom,D=n.closeTop;if(this._fillEnabled=a,this._outlineEnabled=l,c.isConstant&&y.isConstant(g)&&y.isConstant(_)&&y.isConstant(T)&&y.isConstant(x)&&y.isConstant(P)&&y.isConstant(A)&&y.isConstant(M)&&y.isConstant(D)){var I=this._options;I.vertexFormat=f?p.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,I.rectangle=c.getValue(u.MINIMUM_VALUE,I.rectangle),I.height=i(g)?g.getValue(u.MINIMUM_VALUE):void 0,I.extrudedHeight=i(_)?_.getValue(u.MINIMUM_VALUE):void 0,I.granularity=i(T)?T.getValue(u.MINIMUM_VALUE):void 0,I.stRotation=i(x)?x.getValue(u.MINIMUM_VALUE):void 0,I.rotation=i(P)?P.getValue(u.MINIMUM_VALUE):void 0,I.closeBottom=i(M)?M.getValue(u.MINIMUM_VALUE):void 0,I.closeTop=i(D)?D.getValue(u.MINIMUM_VALUE):void 0,this._isClosed=i(_)&&i(I.closeTop)&&i(I.closeBottom)&&I.closeTop&&I.closeBottom,this._outlineWidth=i(A)?A.getValue(u.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},x.prototype.createDynamicUpdater=function(e){return new P(e,this)};var P=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new T(t._entity)};return P.prototype.update=function(r){var n=this._geometryUpdater;i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive);var o=n._entity,a=o[n._propertyName],s=a.show;if(o.isAvailable(r)&&(!i(s)||s.getValue(r))){var u=this._options,d=a.coordinates,v=a.closeBottom,g=a.closeTop,y=a.height,C=a.extrudedHeight,w=a.granularity,S=a.stRotation,E=a.rotation;if(u.rectangle=d.getValue(r,u.rectangle),u.height=i(y)?y.getValue(r,u):void 0,u.extrudedHeight=i(C)?C.getValue(r,u):void 0,u.granularity=i(w)?w.getValue(r):void 0,u.stRotation=i(S)?S.getValue(r):void 0,u.rotation=i(E)?E.getValue(r):void 0,!i(a.fill)||a.fill.getValue(r)){u.closeBottom=i(v)?v.getValue(r):void 0,u.closeTop=i(g)?g.getValue(r):void 0,this._material=_.getValue(r,n.fillMaterialProperty,this._material);var b=this._material,T=new m({material:b,translucent:b.isTranslucent(),closed:u.closeTop&&u.closeBottom});u.vertexFormat=T.vertexFormat,this._primitive=new f({geometryInstances:new l({id:o,geometry:new c(u)}),appearance:T,asynchronous:!1}),this._primitives.add(this._primitive)}if(i(a.outline)&&a.outline.getValue(r)){u.vertexFormat=p.VERTEX_FORMAT;var x=i(a.outlineColor)?a.outlineColor.getValue(r):e.BLACK,P=i(a.outlineWidth)?a.outlineWidth.getValue(r):1,A=1!==x.alpha;this._outlinePrimitive=new f({geometryInstances:new l({id:o,geometry:new h(u),attributes:{color:t.fromColor(x)}}),appearance:new p({flat:!0,translucent:A,renderState:{depthTest:{enabled:!A},lineWidth:n._scene.clampLineWidth(P)}}),asynchronous:!1}),this._primitives.add(this._outlinePrimitive)}}},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive),o(this)},x}),r("DataSources/WallGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Core/WallGeometry","../Core/WallOutlineGeometry","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y){"use strict";var C=v.fromColor(e.WHITE),w=new g(!0),S=new g(!0),E=new g(!1),b=new g(e.BLACK),T=function(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0},x=function(e,t,r){this._entity=e,this._scene=t,this._propertyName=i(r)?r:"wall",this._entitySubscription=e.definitionChanged.addEventListener(x.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new T(e),this._onEntityPropertyChanged(e,this._propertyName,e[this._propertyName],void 0)};n(x,{perInstanceColorAppearanceType:{value:p},materialAppearanceType:{value:m}}),n(x.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._entity.availability)&&y.isConstant(this._showProperty)&&y.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!i(this._entity.availability)&&y.isConstant(this._showProperty)&&y.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return!1}},geometryChanged:{get:function(){return this._geometryChanged}}}),x.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},x.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},x.prototype.createFillGeometryInstance=function(r){var n,o,a=this._entity,s=a.isAvailable(r),u=new c(s&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r));if(this._materialProperty instanceof v){var d=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(d=this._materialProperty.color.getValue(r)),o=t.fromColor(d),n={show:u,color:o}}else n={show:u};return new l({id:a,geometry:new h(this._options),attributes:n})},x.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r);return new l({id:i,geometry:new d(this._options),attributes:{show:new c(n&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(n?this._outlineColorProperty.getValue(r):e.BLACK)}})},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._entitySubscription(),o(this)},x.prototype._onEntityPropertyChanged=function(e,t){if("availability"===t||t===this._propertyName){var n=e[this._propertyName];if(!i(n))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var o=n.fill,a=i(o)&&o.isConstant?o.getValue(u.MINIMUM_VALUE):!0,s=n.outline,l=i(s);if(l&&s.isConstant&&(l=s.getValue(u.MINIMUM_VALUE)),!a&&!l)return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var c=n.positions,h=n.show;if(i(h)&&h.isConstant&&!h.getValue(u.MINIMUM_VALUE)||!i(c))return(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)),void 0;var d=r(n.material,C),f=d instanceof v;this._materialProperty=d,this._fillProperty=r(o,S),this._showProperty=r(h,w),this._showOutlineProperty=r(n.outline,E),this._outlineColorProperty=l?r(n.outlineColor,b):void 0;var g=n.minimumHeights,_=n.maximumHeights,T=n.outlineWidth,x=n.granularity;if(this._fillEnabled=a,this._outlineEnabled=l,c.isConstant&&y.isConstant(g)&&y.isConstant(_)&&y.isConstant(T)&&y.isConstant(x)){var P=this._options;P.vertexFormat=f?p.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,P.positions=c.getValue(u.MINIMUM_VALUE,P.positions),P.minimumHeights=i(g)?g.getValue(u.MINIMUM_VALUE,P.minimumHeights):void 0,P.maximumHeights=i(_)?_.getValue(u.MINIMUM_VALUE,P.maximumHeights):void 0,P.granularity=i(x)?x.getValue(u.MINIMUM_VALUE):void 0,this._outlineWidth=i(T)?T.getValue(u.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},x.prototype.createDynamicUpdater=function(e){return new P(e,this)};var P=function(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new T(t._entity)};return P.prototype.update=function(r){var n=this._geometryUpdater;i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive);var o=n._entity,a=o[n._propertyName],s=a.show;if(o.isAvailable(r)&&(!i(s)||s.getValue(r))){var u=this._options,c=a.positions,v=a.minimumHeights,g=a.maximumHeights,y=a.granularity;if(u.positions=c.getValue(r,u.positions),u.minimumHeights=i(v)?v.getValue(r,u.minimumHeights):void 0,u.maximumHeights=i(g)?g.getValue(r,u.maximumHeights):void 0,u.granularity=i(y)?y.getValue(r):void 0,!i(a.fill)||a.fill.getValue(r)){this._material=_.getValue(r,n.fillMaterialProperty,this._material);var C=this._material,w=new m({material:C,translucent:C.isTranslucent(),closed:!1});u.vertexFormat=w.vertexFormat,this._primitive=new f({geometryInstances:new l({id:o,geometry:new h(u)}),appearance:w,asynchronous:!1}),this._primitives.add(this._primitive)}if(i(a.outline)&&a.outline.getValue(r)){u.vertexFormat=p.VERTEX_FORMAT;var S=i(a.outlineColor)?a.outlineColor.getValue(r):e.BLACK,E=i(a.outlineWidth)?a.outlineWidth.getValue(r):1,b=1!==S.alpha;this._outlinePrimitive=new f({geometryInstances:new l({id:o,geometry:new d(u),attributes:{color:t.fromColor(S)}}),appearance:new p({flat:!0,translucent:b,renderState:{depthTest:{enabled:!b},lineWidth:n._scene.clampLineWidth(E)}}),asynchronous:!1}),this._primitives.add(this._outlinePrimitive)}}},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){i(this._primitive)&&this._primitives.remove(this._primitive),i(this._outlinePrimitive)&&this._primitives.remove(this._outlinePrimitive),o(this)},x}),r("DataSources/DataSourceDisplay",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/EventHelper","./BillboardVisualizer","./EllipseGeometryUpdater","./EllipsoidGeometryUpdater","./GeometryVisualizer","./LabelVisualizer","./ModelVisualizer","./PathVisualizer","./PointVisualizer","./PolygonGeometryUpdater","./PolylineGeometryUpdater","./RectangleGeometryUpdater","./WallGeometryUpdater"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";var g=function(t){var r=t.scene,i=t.dataSourceCollection;this._eventHelper=new n,this._eventHelper.add(i.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(i.dataSourceRemoved,this._onDataSourceRemoved,this),this._dataSourceCollection=i,this._scene=r,this._visualizersCallback=e(t.visualizersCallback,g.defaultVisualizersCallback);for(var o=0,a=i.length;a>o;o++)this._onDataSourceAdded(i,i.get(o))};return g.defaultVisualizersCallback=function(e,t){var r=t.entities;return[new o(e.primitives,r),new l(a,e.primitives,e,r),new l(s,e.primitives,e,r),new l(m,e.primitives,e,r),new l(p,e.primitives,e,r),new l(f,e.primitives,e,r),new l(v,e.primitives,e,r),new u(e.primitives,r),new c(e,r),new d(e.primitives,r),new h(e,r)]},g.prototype.getScene=function(){return this._scene},g.prototype.getDataSources=function(){return this._dataSourceCollection},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){this._eventHelper.removeAll();for(var e=this._dataSourceCollection,t=0,i=e.length;i>t;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return r(this)},g.prototype.update=function(e){var r,i,n,o,a=!0,s=this._dataSourceCollection,l=s.length;for(r=0;l>r;r++){var u=s.get(r);for(t(u.update)&&(a=u.update(e)&&a),n=u._visualizers,o=n.length,i=0;o>i;i++)a=n[i].update(e)&&a}return a},g.prototype._onDataSourceAdded=function(e,t){var r=this._visualizersCallback(this._scene,t);t._visualizers=r},g.prototype._onDataSourceRemoved=function(e,t){for(var r=t._visualizers,i=r.length,n=0;i>n;n++)r[n].destroy(),t._visualizers=void 0},g}),r("DataSources/DynamicGeometryUpdater",["../Core/DeveloperError"],function(e){"use strict";var t=function(){e.throwInstantiationError()};return t.prototype.update=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),r("DataSources/EntityView",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/JulianDate","../Core/Math","../Core/Matrix3","../Core/Transforms","../Scene/SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(t,i,n,o,h,E){var b=o.getValue(h,t._lastCartesian);if(r(b)){var T,x,P,A=!1;w=a.addSeconds(h,.001,w);var M=o.getValue(w,f);if(r(M)){var D,I=u.computeFixedToIcrfMatrix(h,d),O=u.computeFixedToIcrfMatrix(w,m);r(I)&&r(O)?D=l.transpose(I,p):(D=u.computeTemeToPseudoFixedMatrix(h,p),I=l.transpose(D,d),O=u.computeTemeToPseudoFixedMatrix(w,m),l.transpose(O,O));var R=l.multiplyByVector(I,b,y),L=l.multiplyByVector(O,M,C);e.subtract(R,L,_);var N=1e3*e.magnitude(_),F=3986004418e5,B=-F/(N*N-2*F/e.magnitude(R));0>B||B>S*E.maximumRadius?(T=v,e.normalize(b,T),e.negate(T,T),P=e.clone(e.UNIT_Z,g),x=e.cross(P,T,f),e.magnitude(x)>s.EPSILON7&&(e.normalize(T,T),e.normalize(x,x),P=e.cross(T,x,g),e.normalize(P,P),A=!0)):e.equalsEpsilon(b,M,s.EPSILON7)||(P=v,e.normalize(R,P),e.normalize(L,L),x=e.cross(P,L,g),e.equalsEpsilon(x,e.ZERO,s.EPSILON7)||(T=e.cross(x,P,f),l.multiplyByVector(D,T,T),l.multiplyByVector(D,x,x),l.multiplyByVector(D,P,P),e.normalize(T,T),e.normalize(x,x),e.normalize(P,P),A=!0))}if(A){var z=i.transform;z[0]=T.x,z[1]=T.y,z[2]=T.z,z[3]=0,z[4]=x.x,z[5]=x.y,z[6]=x.z,z[7]=0,z[8]=P.x,z[9]=P.y,z[10]=P.z,z[11]=0,z[12]=b.x,z[13]=b.y,z[14]=b.z,z[15]=0}else u.eastNorthUpToFixedFrame(b,E,i.transform)}n&&(t.scene.mode===c.SCENE2D?i.lookAt(t._offset2D,e.ZERO,t._up2D):i.lookAt(t._offset3D,e.ZERO,t._up3D))}var d=new l,m=new l,p=new l,f=new e,v=new e,g=new e,_=new e,y=new e,C=new e,w=new a,S=1.25,E=new e,b=function(r,i,n){this.entity=r,this.scene=i,this.ellipsoid=t(n,o.WGS84),this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new e,this._offset3D=new e,this._up3D=new e,this._offset2D=new e,this._up2D=new e};return i(b,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(t){this._defaultOffset3D=e.clone(t,new e),this._defaultUp3D=e.cross(this._defaultOffset3D,e.cross(e.UNIT_Z,this._defaultOffset3D,E),new e),e.normalize(this._defaultUp3D,this._defaultUp3D),this._defaultOffset2D=new e(0,0,e.magnitude(this._defaultOffset3D)),this._defaultUp2D=e.clone(e.UNIT_Y)}}}),b.defaultOffset3D=new e(-14e3,3500,3500),b.prototype.update=function(t){var i=this.scene,n=this.entity,o=this.ellipsoid,a=n.position,s=n!==this._lastEntity,l=i.mode!==this._mode&&i.mode!==c.MORPHING,u=this._offset3D,d=this._up3D,m=this._offset2D,p=this._up2D,f=i.camera; -if(s){var v=n.viewFrom;if(r(v)&&r(v.getValue(t,u))){e.cross(e.UNIT_Z,u,d),e.cross(u,d,d),e.normalize(d,d);var g=e.magnitude(u);e.fromElements(0,0,g,m),e.clone(this._defaultUp2D,p)}else e.clone(b._defaultOffset2D,m),e.clone(b._defaultUp2D,p),e.clone(b._defaultOffset3D,u),e.clone(b._defaultUp3D,d)}else if(!l&&i.mode!==c.MORPHING)if(this._mode===c.SCENE2D){var _=Math.max(f.frustum.right-f.frustum.left,f.frustum.top-f.frustum.bottom);e.fromElements(0,0,_,m),e.clone(f.up,p)}else(this._mode===c.SCENE3D||this._mode===c.COLUMBUS_VIEW)&&(e.clone(f.position,u),e.clone(f.up,d));var y=s||l;this._lastEntity=n,this._mode=i.mode!==c.MORPHING?i.mode:this._mode,i.mode!==c.MORPHING&&h(this,i.camera,y,a,t,o)},b}),!function(){function e(e,t){function r(t){var r,i=e.arcs[0>t?~t:t],n=i[0];return e.transform?(r=[0,0],i.forEach(function(e){r[0]+=e[0],r[1]+=e[1]})):r=i[i.length-1],0>t?[r,n]:[n,r]}function i(e,t){for(var r in e){var i=e[r];delete t[i.start],delete i.start,delete i.end,i.forEach(function(e){n[0>e?~e:e]=1}),s.push(i)}}var n={},o={},a={},s=[],l=-1;return t.forEach(function(r,i){var n,o=e.arcs[0>r?~r:r];o.length<3&&!o[1][0]&&!o[1][1]&&(n=t[++l],t[l]=r,t[i]=n)}),t.forEach(function(e){var t,i,n=r(e),s=n[0],l=n[1];if(t=a[s])if(delete a[t.end],t.push(e),t.end=l,i=o[l]){delete o[i.start];var u=i===t?t:t.concat(i);o[u.start=t.start]=a[u.end=i.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,i=a[s]){delete a[i.end];var c=i===t?t:i.concat(t);o[c.start=i.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}),i(a,o),i(o,a),t.forEach(function(e){n[0>e?~e:e]||s.push([e])}),s}function t(t,r,i){function n(e){var t=0>e?~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(r),c.forEach(arguments.length<3?function(e){l.push(e[0].i)}:function(e){i(e[0].g,e[e.length-1].g)&&l.push(e[0].i)})}else for(var d=0,m=t.arcs.length;m>d;++d)l.push(d);return{type:"MultiLineString",arcs:e(t,l)}}function i(t,r){function i(e){e.forEach(function(t){t.forEach(function(t){(a[t=0>t?~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 r.forEach(function(e){"Polygon"===e.type?i(e.arcs):"MultiPolygon"===e.type&&e.arcs.forEach(i)}),l.forEach(function(e){if(!e._){var t=[],r=[e];for(e._=1,u.push(t);e=r.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){a[0>e?~e:e].forEach(function(e){e._||(e._=1,r.push(e))})})})}}),l.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:u.map(function(r){var i=[];if(r.forEach(function(e){e.forEach(function(e){e.forEach(function(e){a[0>e?~e:e].length<2&&i.push(e)})})}),i=e(t,i),(n=i.length)>1)for(var s,l=o(r[0][0]),u=0;n>u;++u)if(l===o(i[u])){s=i[0],i[0]=i[u],i[u]=s;break}return i})}}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 r={type:"Feature",id:t.id,properties:t.properties||{},geometry:s(e,t)};return null==t.id&&delete r.id,r}function s(e,t){function r(e,t){t.length&&t.pop();for(var r,i=c[0>e?~e:e],n=0,o=i.length;o>n;++n)t.push(r=i[n].slice()),u(r,n);0>e&&l(t,o)}function i(e){return e=e.slice(),u(e,0),e}function n(e){for(var t=[],i=0,n=e.length;n>i;++i)r(e[i],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=v(e.transform),c=e.arcs,h={Point:function(e){return i(e.coordinates)},MultiPoint:function(e){return e.coordinates.map(i)},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 r,i=e.length,n=i-t;n<--i;)r=e[n],e[n++]=e[i],e[i]=r}function u(e,t){for(var r=0,i=e.length;i>r;){var n=r+i>>>1;e[n]e&&(e=~e);var r=n[e];r?r.push(t):n[e]=[t]})}function r(e,r){e.forEach(function(e){t(e,r)})}function i(e,t){"GeometryCollection"===e.type?e.geometries.forEach(function(e){i(e,t)}):e.type in a&&a[e.type](e.arcs,t)}var n={},o=e.map(function(){return[]}),a={LineString:t,MultiLineString:r,Polygon:r,MultiPolygon:function(e,t){e.forEach(function(e){r(e,t)})}};e.forEach(i);for(var s in n)for(var l=n[s],c=l.length,h=0;c>h;++h)for(var d=h+1;c>d;++d){var m,p=l[h],f=l[d];(m=o[p])[s=u(m,f)]!==f&&m.splice(s,0,f),(m=o[f])[s=u(m,p)]!==p&&m.splice(s,0,p)}return o}function h(e,t){function r(e){o.remove(e),e[1][2]=t(e),o.push(e)}var i=v(e.transform),n=g(e.transform),o=f();return t||(t=m),e.arcs.forEach(function(e){for(var a,s,l=[],u=0,c=0,h=e.length;h>c;++c)s=e[c],i(e[c]=[s[0],s[1],1/0],c);for(var c=1,h=e.length-1;h>c;++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;h>c;++c)a=l[c],a.previous=l[c-1],a.next=l[c+1];for(;a=o.pop();){var d=a.previous,m=a.next;a[1][2]0;){var r=(t+1>>1)-1,n=i[r];if(p(e,n)>=0)break;i[n._=t]=n,i[e._=t=r]=e}}function t(e,t){for(;;){var r=t+1<<1,o=r-1,a=t,s=i[a];if(n>o&&p(i[o],s)<0&&(s=i[a=o]),n>r&&p(i[r],s)<0&&(s=i[a=r]),a===t)break;i[s._=t]=s,i[e._=t=a]=e}}var r={},i=[],n=0;return r.push=function(t){return e(i[t._=n]=t,n++),n},r.pop=function(){if(!(0>=n)){var e,r=i[0];return--n>0&&(e=i[n],t(i[e._=0]=e,0)),r}},r.remove=function(r){var o,a=r._;if(i[a]===r)return a!==--n&&(o=i[n],(p(o,r)<0?e:t)(i[o._=a]=o,a)),a},r}function v(e){if(!e)return _;var t,r,i=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=r=0),e[0]=(t+=e[0])*i+o,e[1]=(r+=e[1])*n+a}}function g(e){if(!e)return _;var t,r,i=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=r=0);var l=0|(e[0]-o)/i,u=0|(e[1]-a)/n;e[0]=l-t,e[1]=u-r,t=l,r=u}}function _(){}var y={version:"1.6.18",mesh:function(e){return s(e,t.apply(this,arguments))},meshArcs:t,merge:function(e){return s(e,i.apply(this,arguments))},mergeArcs:i,feature:o,neighbors:c,presimplify:h};"function"==typeof r&&r.amd?r("ThirdParty/topojson",y):"object"==typeof module&&module.exports?module.exports=y:this.topojson=y}(),r("DataSources/GeoJsonDataSource",["../Core/Cartesian3","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/Event","../Core/getFilenameFromUri","../Core/loadJson","../Core/PinBuilder","../Core/RuntimeError","../Scene/VerticalOrigin","../ThirdParty/topojson","../ThirdParty/when","./BillboardGraphics","./ColorMaterialProperty","./ConstantPositionProperty","./ConstantProperty","./EntityCollection","./PolygonGraphics","./PolylineGraphics"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S){"use strict";function E(t){return e.fromDegrees(t[0],t[1],t[2])}function b(e,t){var r='';for(var i in e)if(e.hasOwnProperty(i)){if(i===t||-1!==tt.indexOf(i))continue;var o=e[i];n(o)&&(r+="object"==typeof o?"":"")}return r+="
"+i+""+b(o)+"
"+i+""+o+"
"}function T(e,t){var i=e.id;if(n(i)&&"Feature"===e.type){for(var o=2,a=i;n(t.getById(a));)a=i+"_"+o,o++;i=a}else i=r();var s=t.getOrCreateEntity(i),l=e.properties;if(n(l)){s.addProperty("properties"),s.properties=l;var u,c=l.title;if(n(c))s.name=c,u="title";else{var h=Number.MAX_VALUE;for(var d in l)if(l.hasOwnProperty(d)&&l[d]){var m=d.toLowerCase();if(h>1&&"title"===m){h=1,u=d;break}h>2&&"name"===m?(h=2,u=d):h>3&&/title/i.test(d)?(h=3,u=d):h>4&&/name/i.test(d)&&(h=4,u=d)}n(u)&&(s.name=l[u])}var p=l.description;n(p)||(p=b(l,u)),s.description=new y(p)}return s}function x(e,t){for(var r=new Array(e.length),i=0;ia;a++)P(e,o[a],void 0,i,n)}function M(e,t,r,i,o){for(var a=r.geometries,s=0,l=a.length;l>s;s++){var u=a[s],c=u.type,h=it[c];if(!n(h))throw new d("Unknown geometry type: "+c);h(e,t,u,i,o)}}function D(e,r,o,a,s){var l=s.markerSymbol,u=s.markerColor,c=s.markerSize,h=r.properties;if(n(h)){var d=h["marker-color"];n(d)&&(u=t.fromCssColorString(d)),c=i(et[h["marker-size"]],c),l=i(h["marker-symbol"],l)}var p;p=n(l)?1===l.length?e._pinBuilder.fromText(l.toUpperCase(),u,c):e._pinBuilder.fromMakiIconId(l,u,c):e._pinBuilder.fromColor(u,c),e._promises.push(f(p,function(t){var i=new v;i.verticalOrigin=new y(m.BOTTOM),i.image=new y(t.toDataURL());var n=T(r,e._entityCollection);n.billboard=i,n.position=new _(o(a))}))}function I(e,t,r,i,n){D(e,t,i,r.coordinates,n)}function O(e,t,r,i,n){for(var o=r.coordinates,a=0;a0&&o[0].length>2&&(_.perPositionHeight=new y(!0));var C=T(r,e._entityCollection);C.polygon=_}function B(e,t,r,i,n){F(e,t,i,r.coordinates[0],n)}function z(e,t,r,i,n){for(var o=r.coordinates,a=0;ai;i++)if(!o.isConstant(t[i]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),a.prototype.getValue=function(t,r){var i=this._value;if(!e(i))return void 0;var n=i.length;e(r)||(r=new Array(n));for(var o=0,a=0;n>o;){var s=this._value[o],l=s.getValue(t,r[o]);e(l)&&(r[a]=l,a++),o++}return r.length=a,r},a.prototype.setValue=function(t){var r=this._eventHelper;if(r.removeAll(),e(t)){this._value=t.slice();for(var i=t.length,n=0;i>n;n++){var o=t[n];e(o)&&r.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}),r("DataSources/Visualizer",["../Core/DeveloperError"],function(e){"use strict";var t=function(){e.throwInstantiationError()};return t.prototype.update=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),r("Renderer/Buffer",["../Core/defaultValue","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError"],function(e,t,r){"use strict";var i=function(e,t,r,i,n){this._gl=e,this._bufferTarget=t,this._sizeInBytes=r,this._usage=i,this._buffer=n,this.vertexArrayDestroyable=!0};return t(i.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),i.prototype._getBuffer=function(){return this._buffer},i.prototype.copyFromArrayView=function(t,r){r=e(r,0);var i=this._gl,n=this._bufferTarget;i.bindBuffer(n,this._buffer),i.bufferSubData(n,r,t),i.bindBuffer(n,null)},i.prototype.isDestroyed=function(){return!1},i.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),r(this)},i}),r("Renderer/ClearCommand",["../Core/Color","../Core/defaultValue","../Core/freezeObject"],function(e,t,r){"use strict";var i=function(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 i.ALL=r(new i({color:new e(0,0,0,0),depth:1,stencil:0})),i.prototype.execute=function(e,t){e.clear(this,t)},i}),r("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"}),r("Renderer/Framebuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat"],function(e,t,r,i){"use strict";function n(e,t,r){var i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,r._target,r._texture,0)}function o(e,t,r){var i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,r._getRenderbuffer())}var a=function(r,i,a){a=e(a,e.EMPTY_OBJECT),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(a.destroyAttachments,!0),t(a.depthTexture)||t(a.depthRenderbuffer),t(a.depthStencilTexture)||t(a.depthStencilRenderbuffer),this._bind();var s,l,u,c,h;if(t(a.colorTextures)){var d=a.colorTextures;for(c=this._colorTextures.length=this._activeColorAttachments.length=d.length,u=0;c>u;++u)s=d[u],h=this._gl.COLOR_ATTACHMENT0+u,n(this,h,s),this._activeColorAttachments[u]=h,this._colorTextures[u]=s}if(t(a.colorRenderbuffers)){var m=a.colorRenderbuffers;for(c=this._colorRenderbuffers.length=this._activeColorAttachments.length=m.length,u=0;c>u;++u)l=m[u],h=this._gl.COLOR_ATTACHMENT0+u,o(this,h,l),this._activeColorAttachments[u]=h,this._colorRenderbuffers[u]=l}t(a.depthTexture)&&(s=a.depthTexture,n(this,this._gl.DEPTH_ATTACHMENT,s),this._depthTexture=s),t(a.depthRenderbuffer)&&(l=a.depthRenderbuffer,o(this,this._gl.DEPTH_ATTACHMENT,l),this._depthRenderbuffer=l),t(a.stencilRenderbuffer)&&(l=a.stencilRenderbuffer,o(this,this._gl.STENCIL_ATTACHMENT,l),this._stencilRenderbuffer=l),t(a.depthStencilTexture)&&(s=a.depthStencilTexture,n(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilTexture=s),t(a.depthStencilRenderbuffer)&&(l=a.depthStencilRenderbuffer,o(this,this._gl.DEPTH_STENCIL_ATTACHMENT,l),this._depthStencilRenderbuffer=l),this._unBind()};return r(a.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)}}}),a.prototype._bind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},a.prototype._unBind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},a.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},a.prototype.getColorTexture=function(e){return this._colorTextures[e]},a.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){if(this.destroyAttachments){for(var e=0,r=this._colorTextures,n=r.length;n>e;++e){var o=r[e];t(o)&&o.destroy()}var a=this._colorRenderbuffers;for(n=a.length,e=0;n>e;++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),i(this)},a}),r("Renderer/PassState",[],function(){"use strict";var e=function(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0};return e}),r("Renderer/RenderbufferFormat",["../Core/freezeObject"],function(e){"use strict";var t={RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,validate:function(e){return e===t.RGBA4||e===t.RGB5_A1||e===t.RGB565||e===t.DEPTH_COMPONENT16||e===t.STENCIL_INDEX8||e===t.DEPTH_STENCIL}};return e(t)}),r("Renderer/PickFramebuffer",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","./PassState","./RenderbufferFormat"],function(e,t,r,i,n,o,a){"use strict";var s=function(t){var r=new o(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new e},this._context=t,this._fb=void 0,this._passState=r,this._width=0,this._height=0};s.prototype.begin=function(t){var r=this._context,n=r.drawingBufferWidth,o=r.drawingBufferHeight;return e.clone(t,this._passState.scissorTest.rectangle),i(this._fb)&&this._width===n&&this._height===o||(this._width=n,this._height=o,this._fb=this._fb&&this._fb.destroy(),this._fb=r.createFramebuffer({colorTextures:[r.createTexture2D({width:n,height:o})],depthRenderbuffer:r.createRenderbuffer({format:a.DEPTH_COMPONENT16})}),this._passState.framebuffer=this._fb),this._passState};var l=new t;return s.prototype.end=function(e){for(var n=r(e.width,1),o=r(e.height,1),a=this._context,s=a.readPixels({x:e.x,y:e.y,width:n,height:o,framebuffer:this._fb}),u=Math.max(n,o),c=u*u,h=Math.floor(.5*n),d=Math.floor(.5*o),m=0,p=0,f=0,v=-1,g=0;c>g;++g){if(m>=-h&&h>=m&&p>=-d&&d>=p){var _=4*((d-p)*n+m+h);l.red=t.byteToFloat(s[_]),l.green=t.byteToFloat(s[_+1]),l.blue=t.byteToFloat(s[_+2]),l.alpha=t.byteToFloat(s[_+3]);var y=a.getObjectByPickColor(l);if(i(y))return y}if(m===p||0>m&&-m===p||m>0&&m===1-p){var C=f;f=-v,v=C}m+=f,p+=v}return void 0},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),n(this)},s}),r("Renderer/Renderbuffer",["../Core/defineProperties","../Core/destroyObject"],function(e,t){"use strict";function r(e,t,r,i){this._gl=e,this._format=t,this._width=r,this._height=i,this._renderbuffer=this._gl.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,this._renderbuffer),e.renderbufferStorage(e.RENDERBUFFER,t,r,i),e.bindRenderbuffer(e.RENDERBUFFER,null)}return e(r.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),r.prototype._getRenderbuffer=function(){return this._renderbuffer},r.prototype.isDestroyed=function(){return!1},r.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),t(this)},r}),r("Renderer/RenderState",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/RuntimeError","../Core/WindingOrder"],function(e,t,r,i,n,o,a){"use strict";function s(e,t,r){r?e.enable(t):e.disable(t)}function l(e,t){e.frontFace(t.frontFace)}function u(e,t){var r=t.cull,i=r.enabled;s(e,e.CULL_FACE,i),i&&e.cullFace(r.face)}function c(e,t){e.lineWidth(t.lineWidth)}function h(e,t){var r=t.polygonOffset,i=r.enabled;s(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(r.factor,r.units)}function d(e,t,r){var n=t.scissorTest,o=i(r.scissorTest)?r.scissorTest.enabled:n.enabled;if(s(e,e.SCISSOR_TEST,o),o){var a=i(r.scissorTest)?r.scissorTest.rectangle:n.rectangle;e.scissor(a.x,a.y,a.width,a.height)}}function m(e,t){var r=t.depthRange;e.depthRange(r.near,r.far)}function p(e,t){var r=t.depthTest,i=r.enabled;s(e,e.DEPTH_TEST,i),i&&e.depthFunc(r.func)}function f(e,t){var r=t.colorMask;e.colorMask(r.red,r.green,r.blue,r.alpha)}function v(e,t){e.depthMask(t.depthMask)}function g(e,t){e.stencilMask(t.stencilMask)}function _(e,t,r){var n=t.blending,o=i(r.blendingEnabled)?r.blendingEnabled:n.enabled;s(e,e.BLEND,o),o&&(E(e,n.color),e.blendEquationSeparate(n.equationRgb,n.equationAlpha),e.blendFuncSeparate(n.functionSourceRgb,n.functionDestinationRgb,n.functionSourceAlpha,n.functionDestinationAlpha))}function y(e,t){var r=t.stencilTest,i=r.enabled;if(s(e,e.STENCIL_TEST,i),i){var n=r.frontFunction,o=r.backFunction,a=r.reference,l=r.mask;e.stencilFunc(r.frontFunction,r.reference,r.mask),e.stencilFuncSeparate(e.BACK,o,a,l),e.stencilFuncSeparate(e.FRONT,n,a,l);var u=r.frontOperation,c=u.fail,h=u.zFail,d=u.zPass;e.stencilOpSeparate(e.FRONT,c,h,d);var m=r.backOperation,p=m.fail,f=m.zFail,v=m.zPass;e.stencilOpSeparate(e.BACK,p,f,v)}}function C(e,t,r){var n=t.viewport;i(n)||(n=T,n.width=r.context.drawingBufferWidth,n.height=r.context.drawingBufferHeight),r.context.uniformState.viewport=n,e.viewport(n.x,n.y,n.width,n.height)}function w(e,t){var r=[];return e.frontFace!==t.frontFace&&r.push(l),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&r.push(u),e.lineWidth!==t.lineWidth&&r.push(c),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&r.push(h),r.push(d),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&r.push(m),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&r.push(p),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&r.push(f),e.depthMask!==t.depthMask&&r.push(v),r.push(_),e.stencilMask!==t.stencilMask&&r.push(g),(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)&&r.push(y),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&r.push(b),r.push(C),r}var S=function(n,s){var l=r(s,{}),u=r(l.cull,{}),c=r(l.polygonOffset,{}),h=r(l.scissorTest,{}),d=r(h.rectangle,{}),m=r(l.depthRange,{}),p=r(l.depthTest,{}),f=r(l.colorMask,{}),v=r(l.blending,{}),g=r(v.color,{}),_=r(l.stencilTest,{}),y=r(_.frontOperation,{}),C=r(_.backOperation,{}),w=r(l.sampleCoverage,{}),S=l.viewport;if(this.frontFace=r(l.frontFace,a.COUNTER_CLOCKWISE),this.cull={enabled:r(u.enabled,!1),face:r(u.face,WebGLRenderingContext.BACK)},this.lineWidth=r(l.lineWidth,1),this.polygonOffset={enabled:r(c.enabled,!1),factor:r(c.factor,0),units:r(c.units,0)},this.scissorTest={enabled:r(h.enabled,!1),rectangle:e.clone(d)},this.depthRange={near:r(m.near,0),far:r(m.far,1)},this.depthTest={enabled:r(p.enabled,!1),func:r(p.func,WebGLRenderingContext.LESS)},this.colorMask={red:r(f.red,!0),green:r(f.green,!0),blue:r(f.blue,!0),alpha:r(f.alpha,!0)},this.depthMask=r(l.depthMask,!0),this.stencilMask=r(l.stencilMask,-1),this.blending={enabled:r(v.enabled,!1),color:new t(r(g.red,0),r(g.green,0),r(g.blue,0),r(g.alpha,0)),equationRgb:r(v.equationRgb,WebGLRenderingContext.FUNC_ADD),equationAlpha:r(v.equationAlpha,WebGLRenderingContext.FUNC_ADD),functionSourceRgb:r(v.functionSourceRgb,WebGLRenderingContext.ONE),functionSourceAlpha:r(v.functionSourceAlpha,WebGLRenderingContext.ONE),functionDestinationRgb:r(v.functionDestinationRgb,WebGLRenderingContext.ZERO),functionDestinationAlpha:r(v.functionDestinationAlpha,WebGLRenderingContext.ZERO)},this.stencilTest={enabled:r(_.enabled,!1),frontFunction:r(_.frontFunction,WebGLRenderingContext.ALWAYS),backFunction:r(_.backFunction,WebGLRenderingContext.ALWAYS),reference:r(_.reference,0),mask:r(_.mask,-1),frontOperation:{fail:r(y.fail,WebGLRenderingContext.KEEP),zFail:r(y.zFail,WebGLRenderingContext.KEEP),zPass:r(y.zPass,WebGLRenderingContext.KEEP)},backOperation:{fail:r(C.fail,WebGLRenderingContext.KEEP),zFail:r(C.zFail,WebGLRenderingContext.KEEP),zPass:r(C.zPass,WebGLRenderingContext.KEEP)}},this.sampleCoverage={enabled:r(w.enabled,!1),value:r(w.value,1),invert:r(w.invert,!1)},this.viewport=i(S)?new e(S.x,S.y,i(S.width)?S.width:n.drawingBufferWidth,i(S.height)?S.height:n.drawingBufferHeight):void 0,this.lineWidthn.maximumAliasedLineWidth)throw new o("renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(i(this.viewport)){if(this.viewport.width>n.maximumViewportWidth)throw new o("renderState.viewport.width must be less than or equal to the maximum viewport width ("+this.maximumViewportWidth.toString()+"). Check maximumViewportWidth.");if(this.viewport.height>n.maximumViewportHeight)throw new o("renderState.viewport.height must be less than or equal to the maximum viewport height ("+this.maximumViewportHeight.toString()+"). Check maximumViewportHeight.") -}this.id=0,this._applyFunctions=[]},E=function(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)},b=function(e,t){var r=t.sampleCoverage,i=r.enabled;s(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(r.value,r.invert)},T=new e;return S.apply=function(e,t,r){l(e,t),u(e,t),c(e,t),h(e,t),d(e,t,r),m(e,t),p(e,t),f(e,t),v(e,t),g(e,t),_(e,t,r),y(e,t),b(e,t),C(e,t,r)},S.partialApply=function(e,t,r,n){var o=r._applyFunctions[t.id];i(o)||(o=w(t,r),r._applyFunctions[t.id]=o);for(var a=o.length,s=0;a>s;++s)o[s](e,r,n)},S.clone=function(r){return{frontFace:r.frontFace,cull:{enabled:r.cull.enabled,face:r.cull.face},lineWidth:r.lineWidth,polygonOffset:{enabled:r.polygonOffset.enabled,factor:r.polygonOffset.factor,units:r.polygonOffset.units},scissorTest:{enabled:r.scissorTest.enabled,rectangle:e.clone(r.scissorTest.rectangle)},depthRange:{near:r.depthRange.near,far:r.depthRange.far},depthTest:{enabled:r.depthTest.enabled,func:r.depthTest.func},colorMask:{red:r.colorMask.red,green:r.colorMask.green,blue:r.colorMask.blue,alpha:r.colorMask.alpha},depthMask:r.depthMask,stencilMask:r.stencilMask,blending:{enabled:r.blending.enabled,color:t.clone(r.blending.color),equationRgb:r.blending.equationRgb,equationAlpha:r.blending.equationAlpha,functionSourceRgb:r.blending.functionSourceRgb,functionSourceAlpha:r.blending.functionSourceAlpha,functionDestinationRgb:r.blending.functionDestinationRgb,functionDestinationAlpha:r.blending.functionDestinationAlpha},stencilTest:{enabled:r.stencilTest.enabled,frontFunction:r.stencilTest.frontFunction,backFunction:r.stencilTest.backFunction,reference:r.stencilTest.reference,mask:r.stencilTest.mask,frontOperation:{fail:r.stencilTest.frontOperation.fail,zFail:r.stencilTest.frontOperation.zFail,zPass:r.stencilTest.frontOperation.zPass},backOperation:{fail:r.stencilTest.backOperation.fail,zFail:r.stencilTest.backOperation.zFail,zPass:r.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:r.sampleCoverage.enabled,value:r.sampleCoverage.value,invert:r.sampleCoverage.invert},viewport:i(r.viewport)?e.clone(r.viewport):void 0}},S}),r("Renderer/ShaderProgram",["../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError","./AutomaticUniforms"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t){var r=t._gl,n=t._location;switch(t._activeUniform.type){case r.FLOAT:return function(){r.uniform1f(n,t.value)};case r.FLOAT_VEC2:return function(){var e=t.value;r.uniform2f(n,e.x,e.y)};case r.FLOAT_VEC3:return function(){var o=t.value;if(e(o.red))r.uniform3f(n,o.red,o.green,o.blue);else{if(!e(o.x))throw new i('Invalid vec3 value for uniform "'+t._activeUniform.name+'".');r.uniform3f(n,o.x,o.y,o.z)}};case r.FLOAT_VEC4:return function(){var o=t.value;if(e(o.red))r.uniform4f(n,o.red,o.green,o.blue,o.alpha);else{if(!e(o.x))throw new i('Invalid vec4 value for uniform "'+t._activeUniform.name+'".');r.uniform4f(n,o.x,o.y,o.z,o.w)}};case r.SAMPLER_2D:case r.SAMPLER_CUBE:return function(){r.activeTexture(r.TEXTURE0+t.textureUnitIndex),r.bindTexture(t.value._target,t.value._texture)};case r.INT:case r.BOOL:return function(){r.uniform1i(n,t.value)};case r.INT_VEC2:case r.BOOL_VEC2:return function(){var e=t.value;r.uniform2i(n,e.x,e.y)};case r.INT_VEC3:case r.BOOL_VEC3:return function(){var e=t.value;r.uniform3i(n,e.x,e.y,e.z)};case r.INT_VEC4:case r.BOOL_VEC4:return function(){var e=t.value;r.uniform4i(n,e.x,e.y,e.z,e.w)};case r.FLOAT_MAT2:return function(){r.uniformMatrix2fv(n,!1,o.toArray(t.value,_))};case r.FLOAT_MAT3:return function(){r.uniformMatrix3fv(n,!1,a.toArray(t.value,y))};case r.FLOAT_MAT4:return function(){r.uniformMatrix4fv(n,!1,s.toArray(t.value,C))};default:throw new l("Unrecognized uniform type: "+t._activeUniform.type+' for uniform "'+t._activeUniform.name+'".')}}function h(t){var r=t._gl,n=t._locations;switch(t._activeUniform.type){case r.FLOAT:return function(){for(var e=t.value,i=e.length,o=0;i>o;++o)r.uniform1f(n[o],e[o])};case r.FLOAT_VEC2:return function(){for(var e=t.value,i=e.length,o=0;i>o;++o){var a=e[o];r.uniform2f(n[o],a.x,a.y)}};case r.FLOAT_VEC3:return function(){for(var o=t.value,a=o.length,s=0;a>s;++s){var l=o[s];if(e(l.red))r.uniform3f(n[s],l.red,l.green,l.blue);else{if(!e(l.x))throw new i("Invalid vec3 value.");r.uniform3f(n[s],l.x,l.y,l.z)}}};case r.FLOAT_VEC4:return function(){for(var o=t.value,a=o.length,s=0;a>s;++s){var l=o[s];if(e(l.red))r.uniform4f(n[s],l.red,l.green,l.blue,l.alpha);else{if(!e(l.x))throw new i("Invalid vec4 value.");r.uniform4f(n[s],l.x,l.y,l.z,l.w)}}};case r.SAMPLER_2D:case r.SAMPLER_CUBE:return function(){for(var e=t.value,i=e.length,n=0;i>n;++n){var o=e[n],a=t.textureUnitIndex+n;r.activeTexture(r.TEXTURE0+a),r.bindTexture(o._target,o._texture)}};case r.INT:case r.BOOL:return function(){for(var e=t.value,i=e.length,o=0;i>o;++o)r.uniform1i(n[o],e[o])};case r.INT_VEC2:case r.BOOL_VEC2:return function(){for(var e=t.value,i=e.length,o=0;i>o;++o){var a=e[o];r.uniform2i(n[o],a.x,a.y)}};case r.INT_VEC3:case r.BOOL_VEC3:return function(){for(var e=t.value,i=e.length,o=0;i>o;++o){var a=e[o];r.uniform3i(n[o],a.x,a.y,a.z)}};case r.INT_VEC4:case r.BOOL_VEC4:return function(){for(var e=t.value,i=e.length,o=0;i>o;++o){var a=e[o];r.uniform4i(n[o],a.x,a.y,a.z,a.w)}};case r.FLOAT_MAT2:return function(){for(var e=t.value,i=e.length,a=0;i>a;++a)r.uniformMatrix2fv(n[a],!1,o.toArray(e[a],_))};case r.FLOAT_MAT3:return function(){for(var e=t.value,i=e.length,o=0;i>o;++o)r.uniformMatrix3fv(n[o],!1,a.toArray(e[o],y))};case r.FLOAT_MAT4:return function(){for(var e=t.value,i=e.length,o=0;i>o;++o)r.uniformMatrix4fv(n[o],!1,s.toArray(e[o],C))};default:throw new l("Unrecognized uniform type: "+t._activeUniform.type)}}function d(e,t,r){e.useProgram(t);for(var i=0,n=r.length,o=0;n>o;++o)i=r[o]._setSampler(i);return e.useProgram(null),i}function m(t,r){var i=r._vertexShaderText,n=r._fragmentShaderText,o=t.createShader(t.VERTEX_SHADER);t.shaderSource(o,i),t.compileShader(o);var a=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(a,n),t.compileShader(a);var s=t.createProgram();t.attachShader(s,o),t.attachShader(s,a),t.deleteShader(o),t.deleteShader(a);var u=r._attributeLocations;if(e(u))for(var c in u)u.hasOwnProperty(c)&&t.bindAttribLocation(s,u[c],c);t.linkProgram(s);var h;if(!t.getProgramParameter(s,t.LINK_STATUS)){var d=r._debugShaders;if(!t.getShaderParameter(a,t.COMPILE_STATUS)){if(h=t.getShaderInfoLog(a),console.error(T+"Fragment shader compile log: "+h),e(d)){var m=d.getTranslatedShaderSource(a);""!==m?console.error(T+"Translated fragment shader source:\n"+m):console.error(T+"Fragment shader translation failed.")}throw t.deleteProgram(s),new l("Fragment shader failed to compile. Compile log: "+h)}if(!t.getShaderParameter(o,t.COMPILE_STATUS)){if(h=t.getShaderInfoLog(o),console.error(T+"Vertex shader compile log: "+h),e(d)){var p=d.getTranslatedShaderSource(o);""!==p?console.error(T+"Translated vertex shader source:\n"+p):console.error(T+"Vertex shader translation failed.")}throw t.deleteProgram(s),new l("Vertex shader failed to compile. Compile log: "+h)}throw h=t.getProgramInfoLog(s),console.error(T+"Shader program link log: "+h),e(d)&&(console.error(T+"Translated vertex shader source:\n"+d.getTranslatedShaderSource(o)),console.error(T+"Translated fragment shader source:\n"+d.getTranslatedShaderSource(a))),t.deleteProgram(s),new l("Program failed to link. Link log: "+h)}var f=r._logShaderCompilation;return f&&(h=t.getShaderInfoLog(o),e(h)&&h.length>0&&console.log(T+"Vertex shader compile log: "+h)),f&&(h=t.getShaderInfoLog(a),e(h)&&h.length>0&&console.log(T+"Fragment shader compile log: "+h)),f&&(h=t.getProgramInfoLog(s),e(h)&&h.length>0&&console.log(T+"Shader program link log: "+h)),s}function p(e,t,r){for(var i={},n=0;r>n;++n){var o=e.getActiveAttrib(t,n),a=e.getAttribLocation(t,o.name);i[o.name]={name:o.name,type:o.type,index:a}}return i}function f(t,r){for(var i={},n=[],o=[],a=t.getProgramParameter(r,t.ACTIVE_UNIFORMS),s=0;a>s;++s){var l=t.getActiveUniform(r,s),u="[0]",c=-1!==l.name.indexOf(u,l.name.length-u.length)?l.name.slice(0,l.name.length-3):l.name;if(0!==c.indexOf("gl_"))if(l.name.indexOf("[")<0){var h=t.getUniformLocation(r,c);if(null!==h){var d=t.getUniform(r,h),m=new w(t,l,c,h,d);i[c]=m,n.push(m),m._setSampler&&o.push(m)}}else{var p,f,v,g,_=c.indexOf("[");if(_>=0){if(p=i[c.slice(0,_)],!e(p))continue;f=p._locations,f.length<=1&&(v=p.value,g=t.getUniformLocation(r,c),null!==g&&(f.push(g),v.push(t.getUniform(r,g))))}else{f=[],v=[];for(var y=0;yn;++n){var o=t+n;e.uniform1i(i[n],o)}return t+r})};t(S.prototype,{name:{get:function(){return this._uniformName}},datatype:{get:function(){return this._activeUniform.type}}});var E=0,b=function(e){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._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=e.fragmentShaderText,this.id=E++};t(b.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return g(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return g(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return g(this),this._uniformsByName}},manualUniforms:{get:function(){return g(this),this._manualUniforms}}});var T="[Cesium WebGL] ";return b.prototype._bind=function(){g(this),this._gl.useProgram(this._program)},b.prototype._setUniforms=function(e,t,r){var n,o,a=this._uniforms,s=this._manualUniforms,l=this._automaticUniforms;if(e)for(var u in s)s.hasOwnProperty(u)&&(s[u].value=e[u]());for(n=l.length,o=0;n>o;++o)l[o].uniform.value=l[o].automaticUniform.getValue(t);for(n=a.length,o=0;n>o;++o)a[o]._set();if(r){var c=this._gl,h=this._program;if(c.validateProgram(h),!c.getProgramParameter(h,c.VALIDATE_STATUS))throw new i("Program validation failed. Link log: "+c.getProgramInfoLog(h))}},b.prototype.isDestroyed=function(){return!1},b.prototype.destroy=function(){return this._cachedShader.cache.releaseShaderProgram(this),void 0},b.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),r(this)},b}),r("Renderer/ShaderCache",["../Core/defined","../Core/destroyObject","./ShaderProgram","./ShaderSource"],function(e,t,r,i){"use strict";var n=function(e){this._context=e,this._shaders={},this._shadersToRelease={}};return n.prototype.replaceShaderProgram=function(t,r,i,n){return e(t)&&t.destroy(),this.getShaderProgram(r,i,n)},n.prototype.getShaderProgram=function(e,t,n){"string"==typeof e&&(e=new i({sources:[e]})),"string"==typeof t&&(t=new i({sources:[t]}));var o,a=e.createCombinedVertexShader(),s=t.createCombinedFragmentShader(),l=a+s+JSON.stringify(n);if(this._shaders[l])o=this._shaders[l],delete this._shadersToRelease[l];else{var u=this._context,c=new r({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:e,vertexShaderText:a,fragmentShaderSource:t,fragmentShaderText:s,attributeLocations:n});o={cache:this,shaderProgram:c,keyword:l,count:0},c._cachedShader=o,this._shaders[l]=o}return++o.count,o.shaderProgram},n.prototype.destroyReleasedShaderPrograms=function(){var e=this._shadersToRelease;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];delete this._shaders[r.keyword],r.shaderProgram.finalDestroy()}this._shadersToRelease={}},n.prototype.releaseShaderProgram=function(e){if(e){var t=e._cachedShader;t&&0===--t.count&&(this._shadersToRelease[t.keyword]=t)}},n.prototype.isDestroyed=function(){return!1},n.prototype.destroy=function(){var e=this._shaders;for(var r in e)e.hasOwnProperty(r)&&e[r].shaderProgram.finalDestroy();return t(this)},n}),r("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,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";function p(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._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function f(e,t){c.clone(t,e._inverseView),c.getRotation(t,e._inverseViewRotation)}function v(e,t){c.clone(t,e._projection),e._inverseProjectionDirty=!0,e._inverseProjectionOITDirty=!0,e._viewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function g(e,t){c.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function _(e,t){r.clone(t.positionWC,e._cameraPosition),r.clone(t.directionWC,e._cameraDirection),r.clone(t.rightWC,e._cameraRight),r.clone(t.upWC,e._cameraUp),e._encodedCameraPositionMCDirty=!0}function y(e,t){o(d.computeIcrfToFixedMatrix(t.time,U))||(U=d.computeTemeToPseudoFixedMatrix(t.time,U));var i=h.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);u.multiplyByVector(U,i,i),r.normalize(i,e._sunDirectionWC),i=u.multiplyByVector(e.viewRotation3D,i,e._sunDirectionEC),r.normalize(i,i),i=h.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),u.multiplyByVector(U,i,i),u.multiplyByVector(e.viewRotation3D,i,i),r.normalize(i,i);var n=t.mapProjection,a=n.ellipsoid,s=a.cartesianToCartographic(e._sunPositionWC,W);n.project(s,e._sunPositionColumbusView)}function C(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 w(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,c.inverse(e._projection,e._inverseProjection))}function S(e){e._inverseProjectionOITDirty&&(e._inverseProjectionOITDirty=!1,e._mode!==m.SCENE2D&&e._mode!==m.MORPHING?c.inverse(e._projection,e._inverseProjectionOIT):c.clone(c.IDENTITY,e._inverseProjectionOIT))}function E(e){e._modelViewDirty&&(e._modelViewDirty=!1,c.multiplyTransformation(e._view,e._model,e._modelView))}function b(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,c.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function T(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,c.inverse(e.modelView,e._inverseModelView))}function x(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 A(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 D(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;var t=e.modelView,r=e._modelViewRelativeToEye;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]=0,r[13]=0,r[14]=0,r[15]=t[15]}}function I(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 R(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 N(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 B(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,c.getRotation(e.inverseModelView3D,e._inverseNormal3D))}function z(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,c.multiplyByPoint(e.inverseModel,e._cameraPosition,G),s.fromCartesian(G,e._encodedCameraPositionMC))}function V(e,t,i,n,a,s,u,h){var p=H;p.x=e.y,p.y=e.z,p.z=e.x;var f=q;f.x=i.y,f.y=i.z,f.z=i.x;var v=j;v.x=n.y,v.y=n.z,v.z=n.x;var g=Y;g.x=t.y,g.y=t.z,g.z=t.x,s===m.SCENE2D&&(p.z=.5*a);var _=u.unproject(p,X);_.longitude=l.clamp(_.longitude,-Math.PI,Math.PI),_.latitude=l.clamp(_.latitude,-l.PI_OVER_TWO,l.PI_OVER_TWO);var y=u.ellipsoid,C=y.cartographicToCartesian(_,Z),w=d.eastNorthUpToFixedFrame(C,y,Q);return c.multiplyByPointAsVector(w,f,f),c.multiplyByPointAsVector(w,v,v),c.multiplyByPointAsVector(w,g,g),o(h)||(h=new c),h[0]=f.x,h[1]=v.x,h[2]=-g.x,h[3]=0,h[4]=f.y,h[5]=v.y,h[6]=-g.y,h[7]=0,h[8]=f.z,h[9]=v.z,h[10]=-g.z,h[11]=0,h[12]=-r.dot(f,C),h[13]=-r.dot(v,C),h[14]=r.dot(g,C),h[15]=1,h}var k=function(){this._viewport=new e,this._viewportCartesian4=new i,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._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 r,this._sunPositionWC=new r,this._sunPositionColumbusView=new r,this._sunDirectionWC=new r,this._sunDirectionEC=new r,this._moonDirectionEC=new r,this._mode=void 0,this._mapProjection=void 0,this._cameraDirection=new r,this._cameraRight=new r,this._cameraUp=new r,this._frustum2DWidth=0,this._eyeHeight2D=new t,this._resolutionScale=1};a(k.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 r=this._viewport,i=this._viewportCartesian4;i.x=r.x,i.y=r.y,i.z=r.width,i.w=r.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return C(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return C(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._viewProjectionDirty=!0,this._inverseViewProjectionDirty=!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}},inverseTranposeModel:{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 this._view3DDirty&&(this._mode===m.SCENE3D?c.clone(this._view,this._view3D):V(this._cameraPosition,this._cameraDirection,this._cameraRight,this._cameraUp,this._frustum2DWidth,this._mode,this._mapProjection,this._view3D),c.getRotation(this._view3D,this._viewRotation3D),this._view3DDirty=!1),this._view3D}},viewRotation:{get:function(){return this._viewRotation}},viewRotation3D:{get:function(){return this.view3D,this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return this._inverseView3DDirty&&(c.inverseTransformation(this.view3D,this._inverseView3D),c.getRotation(this._inverseView3D,this._inverseViewRotation3D),this._inverseView3DDirty=!1),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return this.inverseView3D,this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return w(this),this._inverseProjection}},inverseProjectionOIT:{get:function(){return S(this),this._inverseProjectionOIT}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return E(this),this._modelView}},modelView3D:{get:function(){return b(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return D(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return T(this),this._inverseModelView}},inverseModelView3D:{get:function(){return x(this),this._inverseModelView3D}},viewProjection:{get:function(){return P(this),this._viewProjection}},inverseViewProjection:{get:function(){return A(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return M(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return I(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return O(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return R(this),this._modelViewInfiniteProjection}},normal:{get:function(){return L(this),this._normal}},normal3D:{get:function(){return N(this),this._normal3D}},inverseNormal:{get:function(){return F(this),this._inverseNormal}},inverseNormal3D:{get:function(){return B(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},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 z(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return z(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},resolutionScale:{get:function(){return this._resolutionScale}}});var U=new u,W=new n;k.prototype.updateFrustum=function(e){v(this,e.projectionMatrix),o(e.infiniteProjectionMatrix)&&g(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far},k.prototype.update=function(e,t){this._mode=t.mode,this._mapProjection=t.mapProjection;var r=e._canvas;this._resolutionScale=r.width/r.clientWidth;var i=t.camera;p(this,i.viewMatrix),f(this,i.inverseViewMatrix),_(this,i),t.mode===m.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),y(this,t),this._entireFrustum.x=i.frustum.near,this._entireFrustum.y=i.frustum.far,this.updateFrustum(i.frustum),this._frameState=t,this._temeToPseudoFixed=d.computeTemeToPseudoFixedMatrix(t.time,this._temeToPseudoFixed)};var G=new r,H=new r,q=new r,j=new r,Y=new r,X=new n,Z=new r,Q=new c;return k}),r("Renderer/VertexArray",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError"],function(e,t,r,i,n,o){"use strict";function a(i,n,o){var a=r(n.vertexBuffer),s=r(n.value),l=n.value?n.value.length:n.componentsPerAttribute,u={index:t(n.index,o),enabled:t(n.enabled,!0),vertexBuffer:n.vertexBuffer,value:s?n.value.slice(0):void 0,componentsPerAttribute:l,componentDatatype:t(n.componentDatatype,e.FLOAT),normalize:t(n.normalize,!1),offsetInBytes:t(n.offsetInBytes,0),strideInBytes:t(n.strideInBytes,0)};if(a)u.vertexAttrib=function(e){e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),e.vertexAttribPointer(this.index,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),e.enableVertexAttribArray(this.index)},u.disableVertexAttribArray=function(e){e.disableVertexAttribArray(this.index)};else{switch(u.componentsPerAttribute){case 1:u.vertexAttrib=function(e){e.vertexAttrib1fv(this.index,this.value)};break;case 2:u.vertexAttrib=function(e){e.vertexAttrib2fv(this.index,this.value)};break;case 3:u.vertexAttrib=function(e){e.vertexAttrib3fv(this.index,this.value)};break;case 4:u.vertexAttrib=function(e){e.vertexAttrib4fv(this.index,this.value)}}u.disableVertexAttribArray=function(){}}i.push(u)}function s(e,t,i){for(var n=0;ni;++i){var n=e.getExtension(t[i]);if(n)return n}return void 0}function G(e,t,r,i){var n;"number"==typeof r?n=r:"object"==typeof r&&"number"==typeof r.byteLength&&(n=r.byteLength);var o=e.createBuffer();return e.bindBuffer(t,o),e.bufferData(t,r,i),e.bindBuffer(t,null),new _(e,t,n,i,o)}function H(e){if(e.validateFramebuffer){var t=e._gl,r=t.checkFramebufferStatus(t.FRAMEBUFFER);if(r!==t.FRAMEBUFFER_COMPLETE){var i;switch(r){case t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:i="Framebuffer is not complete. Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached. Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.";break;case t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:i="Framebuffer is not complete. Incomplete dimensions: not all attached images have the same width and height.";break;case t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:i="Framebuffer is not complete. Missing attachment: no images are attached to the framebuffer.";break;case t.FRAMEBUFFER_UNSUPPORTED:i="Framebuffer is not complete. Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions."}throw new l(i)}}}function q(e,t,r){var i=e._currentRenderState;i!==t&&(e._currentRenderState=t,M.partialApply(e._gl,i,t,r))}function j(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;var r=it;if(o(t))t._bind(),H(e,t),r=t._getActiveColorAttachments();else{var i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e._drawBuffers.drawBuffersWEBGL(r)}}function Y(e,t,r,i,o,a){var s=n(n(o,r.renderState),e._defaultRenderState);j(e,t);var l=n(a,r.shaderProgram);l._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,l.maximumTextureUnitIndex),q(e,s,i)}function X(e,t,r){var i=t.primitiveType,a=t.vertexArray,s=t.offset,l=t.count;e._us.model=n(t.modelMatrix,m.IDENTITY);var u=n(r,t.shaderProgram);u._setUniforms(t.uniformMap,e._us,e.validateShaderProgram);var c=a.indexBuffer;o(c)?(s*=c.bytesPerIndex,l=n(l,c.numberOfIndices),a._bind(),e._gl.drawElements(i,l,c.indexDatatype,s),a._unBind()):(l=n(l,a.numberOfVertices),a._bind(),e._gl.drawArrays(i,s,l),a._unBind())}function Z(e){return e.values.length/e.componentsPerAttribute}function Q(e){return r.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function J(e){var t,i,n,a=[];for(i in e)e.hasOwnProperty(i)&&o(e[i])&&o(e[i].values)&&(a.push(i),e[i].componentDatatype===r.DOUBLE&&(e[i].componentDatatype=r.FLOAT,e[i].values=r.createTypedArray(r.FLOAT,e[i].values)));var s,l=a.length;if(l>0)for(s=Z(e[a[0]]),t=1;l>t;++t){var u=Z(e[a[t]]);if(u!==s)throw new v("Each attribute list must have the same number of vertices. Attribute "+a[t]+" has a different number of vertices "+"("+u.toString()+")"+" than attribute "+a[0]+" ("+s.toString()+").")}a.sort(function(t,i){return r.getSizeInBytes(e[i].componentDatatype)-r.getSizeInBytes(e[t].componentDatatype)});var c=0,h={};for(t=0;l>t;++t)i=a[t],n=e[i],h[i]=c,c+=Q(n);if(c>0){var d=r.getSizeInBytes(e[a[0]].componentDatatype),m=c%d;0!==m&&(c+=d-m);var p=s*c,f=new ArrayBuffer(p),g={};for(t=0;l>t;++t){i=a[t];var _=r.getSizeInBytes(e[i].componentDatatype);g[i]={pointer:r.createTypedArray(e[i].componentDatatype,f),index:h[i]/_,strideInComponentType:c/_}}for(t=0;s>t;++t)for(var y=0;l>y;++y){i=a[y],n=e[i];for(var C=n.values,w=g[i],S=w.pointer,E=n.componentsPerAttribute,b=0;E>b;++b)S[w.index+b]=C[t*E+b];w.index+=w.strideInComponentType}return{buffer:f,offsetsInBytes:h,vertexSizeInBytes:c}}return void 0}function K(e,t,r){this._pickObjects=e,this.key=t,this.color=r}var $=function(r,a){if("undefined"==typeof WebGLRenderingContext)throw new v("The browser does not support WebGL. Visit http://get.webgl.org.");this._canvas=r,a=e(a,!0),a=n(a,{}),a.allowTextureFilterAnisotropic=n(a.allowTextureFilterAnisotropic,!0);var s=n(a.webgl,{});if(s.alpha=n(s.alpha,!1),s.stencil=n(s.stencil,!1),s.failIfMajorPerformanceCaveat=n(s.failIfMajorPerformanceCaveat,!0),this._originalGLContext=r.getContext("webgl",s)||r.getContext("experimental-webgl",s)||void 0,!o(this._originalGLContext))throw new v("The browser supports WebGL, but initialization failed.");this._id=i(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new D(this);var l=this._gl=this._originalGLContext;this._version=l.getParameter(l.VERSION),this._shadingLanguageVersion=l.getParameter(l.SHADING_LANGUAGE_VERSION),this._vendor=l.getParameter(l.VENDOR),this._renderer=l.getParameter(l.RENDERER),this._redBits=l.getParameter(l.RED_BITS),this._greenBits=l.getParameter(l.GREEN_BITS),this._blueBits=l.getParameter(l.BLUE_BITS),this._alphaBits=l.getParameter(l.ALPHA_BITS),this._depthBits=l.getParameter(l.DEPTH_BITS),this._stencilBits=l.getParameter(l.STENCIL_BITS),this._maximumCombinedTextureImageUnits=l.getParameter(l.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this._maximumCubeMapSize=l.getParameter(l.MAX_CUBE_MAP_TEXTURE_SIZE),this._maximumFragmentUniformVectors=l.getParameter(l.MAX_FRAGMENT_UNIFORM_VECTORS),this._maximumTextureImageUnits=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),this._maximumRenderbufferSize=l.getParameter(l.MAX_RENDERBUFFER_SIZE),this._maximumTextureSize=l.getParameter(l.MAX_TEXTURE_SIZE),this._maximumVaryingVectors=l.getParameter(l.MAX_VARYING_VECTORS),this._maximumVertexAttributes=l.getParameter(l.MAX_VERTEX_ATTRIBS),this._maximumVertexTextureImageUnits=l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this._maximumVertexUniformVectors=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),this._aliasedLineWidthRange=l.getParameter(l.ALIASED_LINE_WIDTH_RANGE),this._aliasedPointSizeRange=l.getParameter(l.ALIASED_POINT_SIZE_RANGE),this._maximumViewportDimensions=l.getParameter(l.MAX_VIEWPORT_DIMS),this._antialias=l.getContextAttributes().antialias,this._standardDerivatives=W(l,["OES_standard_derivatives"]),this._elementIndexUint=W(l,["OES_element_index_uint"]),this._depthTexture=W(l,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._textureFloat=W(l,["OES_texture_float"]);var u=a.allowTextureFilterAnisotropic?W(l,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=u,this._maximumTextureFilterAnisotropy=o(u)?l.getParameter(u.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,this._vertexArrayObject=W(l,["OES_vertex_array_object"]),this._fragDepth=W(l,["EXT_frag_depth"]),this._drawBuffers=W(l,["WEBGL_draw_buffers"]),this._maximumDrawBuffers=o(this._drawBuffers)?l.getParameter(this._drawBuffers.MAX_DRAW_BUFFERS_WEBGL):1,this._maximumColorAttachments=o(this._drawBuffers)?l.getParameter(this._drawBuffers.MAX_COLOR_ATTACHMENTS_WEBGL):1,this._debugShaders=W(l,["WEBGL_debug_shaders"]);var c=l.getParameter(l.COLOR_CLEAR_VALUE);this._clearColor=new t(c[0],c[1],c[2],c[3]),this._clearDepth=l.getParameter(l.DEPTH_CLEAR_VALUE),this._clearStencil=l.getParameter(l.STENCIL_CLEAR_VALUE);var h=new N,d=new b(this),m=this.createRenderState();this._defaultPassState=d,this._defaultRenderState=m,this._defaultTexture=void 0,this._defaultCubeMap=void 0,this._us=h,this._currentRenderState=m,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=a,this.cache={},M.apply(l,m,d)},et={};a($.prototype,{id:{get:function(){return this._id}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},uniformState:{get:function(){return this._us}},version:{get:function(){return this._version}},shadingLanguageVersion:{get:function(){return this._shadingLanguageVersion}},vendor:{get:function(){return this._vendor}},renderer:{get:function(){return this._renderer}},redBits:{get:function(){return this._redBits}},greenBits:{get:function(){return this._greenBits}},blueBits:{get:function(){return this._blueBits}},alphaBits:{get:function(){return this._alphaBits}},depthBits:{get:function(){return this._depthBits}},stencilBits:{get:function(){return this._stencilBits}},maximumCombinedTextureImageUnits:{get:function(){return this._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return this._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return this._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return this._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return this._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return this._maximumTextureSize}},maximumVaryingVectors:{get:function(){return this._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return this._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return this._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return this._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return this._aliasedLineWidthRange[0]}},maximumAliasedLineWidth:{get:function(){return this._aliasedLineWidthRange[1]}},minimumAliasedPointSize:{get:function(){return this._aliasedPointSizeRange[0]}},maximumAliasedPointSize:{get:function(){return this._aliasedPointSizeRange[1]}},maximumViewportWidth:{get:function(){return this._maximumViewportDimensions[0]}},maximumViewportHeight:{get:function(){return this._maximumViewportDimensions[1]}},antialias:{get:function(){return this._antialias}},standardDerivatives:{get:function(){return!!this._standardDerivatives}},elementIndexUint:{get:function(){return!!this._elementIndexUint}},depthTexture:{get:function(){return!!this._depthTexture}},floatingPointTexture:{get:function(){return!!this._textureFloat}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},maximumTextureFilterAnisotropy:{get:function(){return this._maximumTextureFilterAnisotropy}},vertexArrayObject:{get:function(){return!!this._vertexArrayObject}},fragmentDepth:{get:function(){return!!this._fragDepth}},drawBuffers:{get:function(){return!!this._drawBuffers}},maximumDrawBuffers:{get:function(){return this._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return this._maximumColorAttachments}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=U(this._originalGLContext,e?V:null)}},defaultTexture:{get:function(){return void 0===this._defaultTexture&&(this._defaultTexture=this.createTexture2D({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=this.createCubeMap({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 et}}}),$.prototype.replaceShaderProgram=function(e,t,r,i){return this._shaderCache.replaceShaderProgram(e,t,r,i)},$.prototype.createShaderProgram=function(e,t,r){return this._shaderCache.getShaderProgram(e,t,r)},$.prototype.createVertexBuffer=function(e,t){return G(this._gl,this._gl.ARRAY_BUFFER,e,t)},$.prototype.createIndexBuffer=function(e,t,r){if(r===h.UNSIGNED_INT&&!this.elementIndexUint)throw new l("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint.");var i=h.getSizeInBytes(r),n=this._gl,o=G(n,n.ELEMENT_ARRAY_BUFFER,e,t),s=o.sizeInBytes/i;return a(o,{indexDatatype:{get:function(){return r}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return s}}}),o},$.prototype.createVertexArray=function(e,t){return new F(this._gl,this._vertexArrayObject,e,t)},$.prototype.createTexture2D=function(e){return new I(this,e)},$.prototype.createTexture2DFromFramebuffer=function(e,t,r,i,a,s){var l=this._gl;e=n(e,p.RGB),t=n(t,0),r=n(r,0),i=n(i,l.drawingBufferWidth),a=n(a,l.drawingBufferHeight);var u=new I(this,{width:i,height:a,pixelFormat:e,source:{framebuffer:o(s)?s:this.defaultFramebuffer,xOffset:t,yOffset:r,width:i,height:a}});return u},$.prototype.createCubeMap=function(e){function t(e,t){t.arrayBufferView?f.texImage2D(e,0,c,u,u,0,c,h,t.arrayBufferView):f.texImage2D(e,0,c,c,h,t)}e=n(e,n.EMPTY_OBJECT);var r,i,a=e.source;if(o(a)){var s=[a.positiveX,a.negativeX,a.positiveY,a.negativeY,a.positiveZ,a.negativeZ];r=s[0].width,i=s[0].height}else r=e.width,i=e.height;var u=r,c=n(e.pixelFormat,p.RGBA),h=n(e.pixelDatatype,x.UNSIGNED_BYTE);if(h===x.FLOAT&&!this.floatingPointTexture)throw new l("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");var d=e.preMultiplyAlpha||c===p.RGB||c===p.LUMINANCE,m=n(e.flipY,!0),f=this._gl,v=f.TEXTURE_CUBE_MAP,g=f.createTexture();return f.activeTexture(f.TEXTURE0),f.bindTexture(v,g),o(a)?(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,m),t(f.TEXTURE_CUBE_MAP_POSITIVE_X,a.positiveX),t(f.TEXTURE_CUBE_MAP_NEGATIVE_X,a.negativeX),t(f.TEXTURE_CUBE_MAP_POSITIVE_Y,a.positiveY),t(f.TEXTURE_CUBE_MAP_NEGATIVE_Y,a.negativeY),t(f.TEXTURE_CUBE_MAP_POSITIVE_Z,a.positiveZ),t(f.TEXTURE_CUBE_MAP_NEGATIVE_Z,a.negativeZ)):(f.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X,0,c,u,u,0,c,h,null),f.texImage2D(f.TEXTURE_CUBE_MAP_NEGATIVE_X,0,c,u,u,0,c,h,null),f.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_Y,0,c,u,u,0,c,h,null),f.texImage2D(f.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,c,u,u,0,c,h,null),f.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_Z,0,c,u,u,0,c,h,null),f.texImage2D(f.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,c,u,u,0,c,h,null)),f.bindTexture(v,null),new w(f,this._textureFilterAnisotropic,v,g,c,h,u,d,m)},$.prototype.createFramebuffer=function(e){return new E(this._gl,this._maximumColorAttachments,e)},$.prototype.createRenderbuffer=function(e){var t=this._gl;e=n(e,n.EMPTY_OBJECT);var r=n(e.format,A.RGBA4),i=o(e.width)?e.width:t.drawingBufferWidth,a=o(e.height)?e.height:t.drawingBufferHeight;return new P(t,r,i,a)};var tt=0,rt={};$.prototype.createRenderState=function(e){var t=JSON.stringify(e),r=rt[t];if(o(r))return r;var i=new M(this,e),n=JSON.stringify(i);return r=rt[n],o(r)||(i.id=tt++,r=i,rt[n]=r),rt[t]=r,r},$.prototype.createSampler=function(e){var t={wrapS:n(e.wrapS,L.CLAMP_TO_EDGE),wrapT:n(e.wrapT,L.CLAMP_TO_EDGE),minificationFilter:n(e.minificationFilter,R.LINEAR),magnificationFilter:n(e.magnificationFilter,O.LINEAR),maximumAnisotropy:o(e.maximumAnisotropy)?e.maximumAnisotropy:1};return t};var it;"undefined"!=typeof WebGLRenderingContext&&(it=[WebGLRenderingContext.BACK]);var nt=new C;$.prototype.clear=function(e,r){e=n(e,nt),r=n(r,this._defaultPassState);var i=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),i.clearColor(s.red,s.green,s.blue,s.alpha)),a|=i.COLOR_BUFFER_BIT),o(l)&&(l!==this._clearDepth&&(this._clearDepth=l,i.clearDepth(l)),a|=i.DEPTH_BUFFER_BIT),o(u)&&(u!==this._clearStencil&&(this._clearStencil=u,i.clearStencil(u)),a|=i.STENCIL_BUFFER_BIT);var c=n(e.renderState,this._defaultRenderState);q(this,c,r);var h=n(e.framebuffer,r.framebuffer);j(this,h),i.clear(a)},$.prototype.draw=function(e,t,r,i){t=n(t,this._defaultPassState);var o=n(e.framebuffer,t.framebuffer);Y(this,o,e,t,r,i),X(this,e,i)},$.prototype.endFrame=function(){var e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null),this.drawBuffers&&this._drawBuffers.drawBuffersWEBGL(it);var t=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(var r=0;t>r;++r)e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)},$.prototype.readPixels=function(e){var t=this._gl;e=e||{};var r=Math.max(e.x||0,0),i=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 j(this,a),t.readPixels(r,i,n,o,t.RGBA,t.UNSIGNED_BYTE,s),s},$.prototype.createVertexArrayFromGeometry=function(e){e=n(e,n.EMPTY_OBJECT);var t,i,a,s=n(e.geometry,n.EMPTY_OBJECT),l=n(e.bufferUsage,y.DYNAMIC_DRAW),c=n(e.attributeLocations,n.EMPTY_OBJECT),m=n(e.interleave,!1),p=e.vertexArrayAttributes,f=o(p)?p:[],v=s.attributes;if(m){var g=J(v);if(o(g)){a=this.createVertexBuffer(g.buffer,l);var _=g.offsetsInBytes,C=g.vertexSizeInBytes;for(t in v)v.hasOwnProperty(t)&&o(v[t])&&(i=v[t],o(i.values)?f.push({index:c[t],vertexBuffer:a,componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,offsetInBytes:_[t],strideInBytes:C}):f.push({index:c[t],value:i.value,componentDatatype:i.componentDatatype,normalize:i.normalize}))}}else for(t in v)if(v.hasOwnProperty(t)&&o(v[t])){i=v[t];var w=i.componentDatatype;w===r.DOUBLE&&(w=r.FLOAT),a=void 0,o(i.values)&&(a=this.createVertexBuffer(r.createTypedArray(w,i.values),l)),f.push({index:c[t],vertexBuffer:a,value:i.value,componentDatatype:w,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize})}var S,E=s.indices;return o(E)&&(S=u.computeNumberOfVertices(s)>d.SIXTY_FOUR_KILOBYTES&&this.elementIndexUint?this.createIndexBuffer(new Uint32Array(E),l,h.UNSIGNED_INT):this.createIndexBuffer(new Uint16Array(E),l,h.UNSIGNED_SHORT)),this.createVertexArray(f,S)};var ot={position:0,textureCoordinates:1};return $.prototype.createViewportQuadCommand=function(e,t){var i=this.cache.viewportQuad_vertexArray;if(!o(i)){var a=new u({attributes:{position:new c({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new c({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:f.TRIANGLES});i=this.createVertexArrayFromGeometry({geometry:a,attributeLocations:{position:0,textureCoordinates:1},bufferUsage:y.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=i}return t=n(t,n.EMPTY_OBJECT),new S({vertexArray:i,primitiveType:f.TRIANGLES,renderState:t.renderState,shaderProgram:this.createShaderProgram(g,e,ot),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer})},$.prototype.createPickFramebuffer=function(){return new T(this)},$.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]},a(K.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),K.prototype.destroy=function(){return delete this._pickObjects[this.key],void 0},$.prototype.createPickId=function(e){++this._nextPickColor[0];var r=this._nextPickColor[0];if(0===r)throw new v("Out of unique Pick IDs.");return this._pickObjects[r]=e,new K(this._pickObjects,r,t.fromRgba(r))},$.prototype.isDestroyed=function(){return!1},$.prototype.destroy=function(){var e=this.cache;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];o(r.destroy)&&r.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),s(this)},$}),r("Renderer/loadCubeMap",["../Core/defined","../Core/DeveloperError","../Core/loadImage","../ThirdParty/when"],function(e,t,r,i){"use strict";var n=function(e,t,n){var o=[r(t.positiveX,n),r(t.negativeX,n),r(t.positiveY,n),r(t.negativeY,n),r(t.positiveZ,n),r(t.negativeZ,n)];return i.all(o,function(t){return e.createCubeMap({source:{positiveX:t[0],negativeX:t[1],positiveY:t[2],negativeY:t[3],positiveZ:t[4],negativeZ:t[5]}})})};return n}),r("Scene/DiscardMissingTileImagePolicy",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/getImagePixels","../Core/loadImageViaBlob","../ThirdParty/when"],function(e,t,r,i,n,o){"use strict";var a=function(a){function s(e){t(e.blob)&&(u._missingImageByteLength=e.blob.size);var r=i(e);if(a.disableCheckIfAllPixelsAreTransparent){for(var n=!0,o=e.width,s=a.pixelsToCheck,l=0,c=s.length;n&&c>l;++l){var h=s[l],d=4*h.x+h.y*o,m=r[d+3];m>0&&(n=!1)}n&&(r=void 0)}u._missingImagePixels=r,u._isReady=!0}function l(){u._missingImagePixels=void 0,u._isReady=!0}if(a=e(a,e.EMPTY_OBJECT),!t(a.missingImageUrl))throw new r("options.missingImageUrl is required.");if(!t(a.pixelsToCheck))throw new r("options.pixelsToCheck is required.");this._pixelsToCheck=a.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var u=this;o(n(a.missingImageUrl),s,l)};return a.prototype.isReady=function(){return this._isReady},a.prototype.shouldDiscardImage=function(e){if(!this._isReady)throw new r("shouldDiscardImage must not be called before the discard policy is ready.");var n=this._pixelsToCheck,o=this._missingImagePixels;if(!t(o))return!1;if(t(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var a=i(e),s=e.width,l=0,u=n.length;u>l;++l)for(var c=n[l],h=4*c.x+c.y*s,d=0;4>d;++d){var m=h+d;if(a[m]!==o[m])return!1}return!0},a}),r("Scene/ImageryProvider",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/loadImage","../Core/loadImageViaBlob","../Core/throttleRequestByServer"],function(e,t,r,i,n,o){"use strict";var a=function(){this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,r.throwInstantiationError()};return t(a.prototype,{ready:{get:r.throwInstantiationError},rectangle:{get:r.throwInstantiationError},tileWidth:{get:r.throwInstantiationError},tileHeight:{get:r.throwInstantiationError},maximumLevel:{get:r.throwInstantiationError},minimumLevel:{get:r.throwInstantiationError},tilingScheme:{get:r.throwInstantiationError},tileDiscardPolicy:{get:r.throwInstantiationError},errorEvent:{get:r.throwInstantiationError},credit:{get:r.throwInstantiationError},proxy:{get:r.throwInstantiationError},hasAlphaChannel:{get:r.throwInstantiationError}}),a.prototype.getTileCredits=r.throwInstantiationError,a.prototype.requestImage=r.throwInstantiationError,a.prototype.pickFeatures=r.throwInstantiationError,a.loadImage=function(t,r){return e(t.tileDiscardPolicy)?o(n,r,{headers:t.headers,withCredentials:t.withCredentials}):o(i,r)},a}),r("Scene/ArcGisMapServerImageryProvider",["../Core/Cartesian2","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicProjection","../Core/GeographicTilingScheme","../Core/jsonp","../Core/Rectangle","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../ThirdParty/when","./DiscardMissingTileImagePolicy","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";function g(e,t,r,n){var o;if(e._useTiles)o=e._url+"/tile/"+n+"/"+r+"/"+t;else{var a=e._tilingScheme.tileXYToNativeRectangle(t,r,n),s=a.west+"%2C"+a.south+"%2C"+a.east+"%2C"+a.north;o=e._url+"/export?",o+="bbox="+s,o+="&bboxSR=4326&size=256%2C256&imageSR=4326&format=png&transparent=true&f=image"}var l=e._proxy;return i(l)&&(o=l.getURL(o)),o}var _=function(n){function o(r){var n=r.tileInfo;if(C._useTiles&&i(n)){if(C._tileWidth=n.rows,C._tileHeight=n.cols,102100===n.spatialReference.wkid||102113===n.spatialReference.wkid)C._tilingScheme=new m;else{if(4326!==r.tileInfo.spatialReference.wkid){var o="Tile spatial reference WKID "+r.tileInfo.spatialReference.wkid+" is not supported.";return y=h.handleError(y,C,C._errorEvent,o,void 0,void 0,void 0,_),void 0}C._tilingScheme=new l}if(C._maximumLevel=r.tileInfo.lods.length-1,i(r.fullExtent)){var a=C._tilingScheme.projection;if(i(r.fullExtent.spatialReference)&&i(r.fullExtent.spatialReference.wkid))if(102100===r.fullExtent.spatialReference.wkid||102113===r.fullExtent.spatialReference.wkid)a=new d;else{if(4326!==r.fullExtent.spatialReference.wkid){var u="fullExtent.spatialReference WKID "+r.fullExtent.spatialReference.wkid+" is not supported.";return y=h.handleError(y,C,C._errorEvent,u,void 0,void 0,void 0,_),void 0}a=new s}var p=a.unproject(new e(r.fullExtent.xmin,r.fullExtent.ymin)),v=a.unproject(new e(r.fullExtent.xmax,r.fullExtent.ymax));C._rectangle=new c(p.longitude,p.latitude,v.longitude,v.latitude)}else C._rectangle=C._tilingScheme.rectangle;i(C._tileDiscardPolicy)||(C._tileDiscardPolicy=new f({missingImageUrl:g(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._tileWidth=256,C._tileHeight=256,C._tilingScheme=new l,C._rectangle=C._tilingScheme.rectangle,C._useTiles=!1;i(r.copyrightText)&&r.copyrightText.length>0&&(C._credit=new t(r.copyrightText)),C._ready=!0,h.handleSuccess(y)}function v(){var e="An error occurred while accessing "+C._url+".";y=h.handleError(y,C,C._errorEvent,e,void 0,void 0,void 0,_)}function _(){var e=u(C._url,{parameters:{f:"json"},proxy:C._proxy});p(e,o,v)}n=r(n,{}),this._url=n.url,this._tileDiscardPolicy=n.tileDiscardPolicy,this._proxy=n.proxy,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._tilingScheme=void 0,this._credit=void 0,this._useTiles=r(n.usePreCachedTilesIfAvailable,!0),this._rectangle=void 0,this._errorEvent=new a,this._ready=!1;var y,C=this;_()};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 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}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}}}),_.prototype.getTileCredits=function(){return void 0},_.prototype.requestImage=function(e,t,r){var i=g(this,e,t,r);return v.loadImage(this,i)},_.prototype.pickFeatures=function(){return void 0},_}),r("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)}),r("Scene/BingMapsImageryProvider",["../Core/BingMapsApi","../Core/Cartesian2","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/jsonp","../Core/Math","../Core/Rectangle","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./BingMapsStyle","./DiscardMissingTileImagePolicy","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v){"use strict";function g(e,t,r,i){var o=e._imageUrlTemplate,a=y.tileXYToQuadKey(t,r,i);o=o.replace("{quadkey}",a);var s=e._imageUrlSubdomains,l=(t+r+i)%s.length;o=o.replace("{subdomain}",s[l]);var u=e._proxy;return n(u)&&(o=u.getURL(o)),o}function _(e,t,r){++t;for(var i=[],n=0,o=e.length;o>n;++n){for(var a=e[n],s=a.coverageAreas,l=!1,u=0,h=a.coverageAreas.length;!l&&h>u;++u){var d=s[u];if(t>=d.zoomMin&&t<=d.zoomMax){var m=c.intersectWith(r,d.bbox,w);c.isEmpty(m)||(l=!0)}}l&&i.push(a.credit)}return i}var y=function S(o){function a(e){var i=e.resourceSets[0].resources[0];w._tileWidth=i.imageWidth,w._tileHeight=i.imageHeight,w._maximumLevel=i.zoomMax-1,w._imageUrlSubdomains=i.imageUrlSubdomains,w._imageUrlTemplate=i.imageUrl.replace("{culture}",w._culture);var o=w._tileProtocol;if(!n(o)){var a=document.location.protocol;o=/^http/.test(a)?a:"http:"}w._imageUrlTemplate=w._imageUrlTemplate.replace(/^http:/,o),n(w._tileDiscardPolicy)||(w._tileDiscardPolicy=new f({missingImageUrl:g(w,0,0,w._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=w._attributionList=i.imageryProviders;s||(s=w._attributionList=[]);for(var l=0,d=s.length;d>l;++l){var m=s[l];m.credit=new r(m.attribution);for(var p=m.coverageAreas,v=0,_=m.coverageAreas.length;_>v;++v){var C=p[v],S=C.bbox;C.bbox=new c(u.toRadians(S[1]),u.toRadians(S[0]),u.toRadians(S[3]),u.toRadians(S[2]))}}w._ready=!0,h.handleSuccess(y)}function v(){var e="An error occurred while accessing "+C+".";y=h.handleError(y,w,w._errorEvent,e,void 0,void 0,void 0,_)}function _(){var e=l(C,{callbackParameterName:"jsonp",proxy:w._proxy});m(e,a,v)}o=i(o,{}),this._key=e.getKey(o.key),this._url=o.url,this._tileProtocol=o.tileProtocol,this._mapStyle=i(o.mapStyle,p.AERIAL),this._culture=i(o.culture,""),this._tileDiscardPolicy=o.tileDiscardPolicy,this._proxy=o.proxy,this._credit=new r("Bing Imagery",S._logoData,"http://www.bing.com"),this.defaultGamma=1,(this._mapStyle===p.AERIAL||this._mapStyle===p.AERIAL_WITH_LABELS)&&(this.defaultGamma=1.3),this._tilingScheme=new d({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2}),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;var y,C=this._url+"/REST/v1/Imagery/Metadata/"+this._mapStyle+"?incl=ImageryProviders&key="+this._key,w=this;_()};o(y.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}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});var C=new c;y.prototype.getTileCredits=function(e,t,r){if(!this._ready)throw new a("getTileCredits must not be called before the imagery provider is ready.");var i=this._tilingScheme.tileXYToRectangle(e,t,r,C);return _(this._attributionList,r,i)},y.prototype.requestImage=function(e,t,r){var i=g(this,e,t,r);return v.loadImage(this,i)},y.prototype.pickFeatures=function(){return void 0},y._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==",y.tileXYToQuadKey=function(e,t,r){for(var i="",n=r;n>=0;--n){var o=1<=0;--n){var o=1<n;++n){var a=e.intersect(t[n]);if(a===i.OUTSIDE)return i.OUTSIDE;a===i.INTERSECTING&&(r=!0)}return r?i.INTERSECTING:i.INSIDE},n}),r("Scene/PerspectiveOffCenterFrustum",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){var t=e.top,r=e.bottom,i=e.right,n=e.left,o=e.near,a=e.far;(t!==e._top||r!==e._bottom||n!==e._left||i!==e._right||o!==e._near||a!==e._far)&&(e._left=n,e._right=i,e._top=t,e._bottom=r,e._near=o,e._far=a,e._perspectiveMatrix=s.computePerspectiveOffCenter(n,i,r,t,o,a,e._perspectiveMatrix),e._infinitePerspective=s.computeInfinitePerspectiveOffCenter(n,i,r,t,o,e._infinitePerspective))}var c=function(){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 l,this._perspectiveMatrix=new s,this._infinitePerspective=new s};o(c.prototype,{projectionMatrix:{get:function(){return u(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return u(this),this._infinitePerspective}}});var h=new t,d=new t,m=new t,p=new t;return c.prototype.computeCullingVolume=function(e,i,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,u=this.right,c=this.left,f=this.near,v=this.far,g=t.cross(i,o,h),_=d;t.multiplyByScalar(i,f,_),t.add(e,_,_);var y=m;t.multiplyByScalar(i,v,y),t.add(e,y,y);var C=p;t.multiplyByScalar(g,c,C),t.add(_,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(C,o,C);var w=a[0];return n(w)||(w=a[0]=new r),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-t.dot(C,e),t.multiplyByScalar(g,u,C),t.add(_,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(o,C,C),w=a[1],n(w)||(w=a[1]=new r),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-t.dot(C,e),t.multiplyByScalar(o,l,C),t.add(_,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(g,C,C),w=a[2],n(w)||(w=a[2]=new r),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-t.dot(C,e),t.multiplyByScalar(o,s,C),t.add(_,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(C,g,C),w=a[3],n(w)||(w=a[3]=new r),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-t.dot(C,e),w=a[4],n(w)||(w=a[4]=new r),w.x=i.x,w.y=i.y,w.z=i.z,w.w=-t.dot(i,_),t.negate(i,C),w=a[5],n(w)||(w=a[5]=new r),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-t.dot(C,y),this._cullingVolume},c.prototype.getPixelSize=function(t,r,o){u(this);var a=t.x,s=t.y;r=i(r,this.near);var l=1/this.near,c=this.top*l,h=2*r*c/s;c=this.right*l;var d=2*r*c/a;return n(o)?(o.x=d,o.y=h,o):new e(d,h)},c.prototype.clone=function(e){return n(e)||(e=new c),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},c.prototype.equals=function(e){return n(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},c}),r("Scene/PerspectiveFrustum",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","./PerspectiveOffCenterFrustum"],function(e,t,r,i){"use strict";function n(e){var t=e._offCenterFrustum;(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far)&&(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,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)}var o=function(){this._offCenterFrustum=new i,this.fov=void 0,this._fov=void 0,this._fovy=void 0,this.aspectRatio=void 0,this._aspectRatio=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far};return t(o.prototype,{projectionMatrix:{get:function(){return n(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return n(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return n(this),this._fovy}}}),o.prototype.computeCullingVolume=function(e,t,r){return n(this),this._offCenterFrustum.computeCullingVolume(e,t,r)},o.prototype.getPixelSize=function(e,t,r){return n(this),this._offCenterFrustum.getPixelSize(e,t,r)},o.prototype.clone=function(t){return e(t)||(t=new o),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},o.prototype.equals=function(t){return e(t)?(n(this),n(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this.near===t.near&&this.far===t.far&&this._offCenterFrustum.equals(t._offCenterFrustum)):!1},o}),r("Scene/CameraFlightPath",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/clone","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/EasingFunction","../Core/HermiteSpline","../Core/LinearSpline","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/QuaternionSpline","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g){"use strict";function _(e,r,i){return t.cross(e,r,I),t.cross(I,e,O),D[0]=I.x,D[1]=O.x,D[2]=-e.x,D[3]=I.y,D[4]=O.y,D[5]=-e.y,D[6]=I.z,D[7]=O.z,D[8]=-e.z,m.fromRotationMatrix(D,i)}function y(e,t,r){var i,n,o;if(e instanceof f){var a=Math.tan(.5*e.fovy);return i=e.near,n=e.near*a,o=e.aspectRatio*n,Math.max(t*i/o,r*i/n)}return e instanceof v?(i=e.near,n=e.top,o=e.right,Math.max(t*i/o,r*i/n)):Math.max(t,r)}function C(e,r,i,n,o,a,s){var u,d,p,f=r.maximumRadius,v=e.frustum,g=y(v,f,f),_=t.dot(t.normalize(i,R),t.normalize(a,L));if(t.magnitude(i)>g)d=f+.6*(g-f),p=.35;else{var C=t.subtract(i,a,R);d=t.magnitude(t.add(t.multiplyByScalar(C,.5,L),a,L));var w=t.magnitude(t.multiplyByScalar(n,t.dot(C,n),L)),S=t.magnitude(t.multiplyByScalar(o,t.dot(C,o),L));d+=y(v,w,S),p=c.clamp(_+1,.25,.5)}var E,b,T,x=t.multiplyByScalar(t.normalize(a,L),d,L),P=t.multiplyByScalar(t.normalize(i,R),d,R),A=new t;if(t.magnitude(a)>g&&_>.75)A=t.add(t.multiplyByScalar(t.subtract(i,a,A),.5,A),a,A),u=[i,A,a];else if(t.magnitude(i)>g&&_>0)A=t.add(t.multiplyByScalar(t.subtract(i,x,A),.5,A),x,A),u=[i,A,a];else{u=[i],b=c.acosClamped(t.dot(t.normalize(P,N),t.normalize(x,F))),E=t.cross(x,P,N),t.equalsEpsilon(E,t.ZERO,c.EPSILON6)&&(E=t.UNIT_Z);for(var M=p*b,D=b-M,I=D;I>0;I-=M)T=h.fromQuaternion(m.fromAxisAngle(E,I),B),u.push(h.multiplyByVector(T,x,new t));u.push(a)}for(var O=new Array(u.length),z=s/(u.length-1),V=0;Vh;++h)u=s[h],t.normalize(t.negate(u,z),z),t.normalize(t.cross(z,t.UNIT_Z,V),V),t.cross(V,z,k),l[h]=_(z,k,U);return u=s[c],o(n)&&o(a)?l[c]=_(n,a):(t.normalize(t.negate(u,z),z),t.normalize(t.cross(z,t.UNIT_Z,V),V),t.cross(V,z,k),l[c]=_(z,k,U)),new p({points:l,times:e.times})}function S(e,r,i,n,o){var a=e.camera,s=e.mapProjection.ellipsoid,l=a.cameraToWorldCoordinatesPoint(a.position,W),u=a.cameraToWorldCoordinatesVector(a.direction,G),c=a.cameraToWorldCoordinatesVector(a.up,H),m=t.cross(u,c,q),p=C(a,s,l,c,m,r,i),f=w(p,u,c,n,o),v=function(e){var r=e.time,i=f.evaluate(r);h.fromQuaternion(i,M),d.clone(a.transform,j),d.clone(d.IDENTITY,a.transform),a.position=p.evaluate(r,a.position),a.right=h.getRow(M,0,a.right),a.up=h.getRow(M,1,a.up),a.direction=t.negate(h.getRow(M,2,a.direction),a.direction),a.setTransform(j)};return v}function E(r,i,n,o,a){if(c.equalsEpsilon(e.magnitude(n),e.magnitude(o),1e4))return new u({points:[n,o],times:[0,a]});var s,h,d=i.maximumRadius,m=r.frustum,p=y(m,Math.PI*d,c.PI_OVER_TWO*d),f=.5;if(n.z>p)h=.6*p;else{var v=t.subtract(n,o,Y);h=y(m,Math.abs(v.y),Math.abs(v.x))}var g=t.clone(o);g.z=h;var _=t.clone(n);_.z=h;var C=new t;if(o.z>p)C=t.add(t.multiplyByScalar(t.subtract(n,o,C),.5,C),o,C),s=[n,C,o];else if(n.z>p)C=t.add(t.multiplyByScalar(t.subtract(n,g,C),.5,C),g,C),s=[n,C,o];else{s=[n];var w=t.subtract(_,g,Y),S=t.magnitude(w);t.normalize(w,w);for(var E=f*S,b=S-E,T=b;T>0;T-=E){var x=new t;s.push(t.add(t.multiplyByScalar(w,T,x),g,x))}s.push(o)}for(var P=new Array(s.length),A=a/(s.length-1),M=0;Ml;++l)a[l]=J;return a[s]=o(r)&&o(i)?_(r,i):J,new p({points:a,times:t.times})}function T(e,r,i,n,o){var a=e.camera,s=e.mapProjection.ellipsoid,l=E(a,s,t.clone(a.position),r,i),u=b(a,l,n,o),c=function(e){var r=e.time,i=u.evaluate(r);h.fromQuaternion(i,M),d.clone(a.transform,j),d.clone(d.IDENTITY,a.transform),a.position=l.evaluate(r,a.position),a.right=h.getRow(M,0,a.right),a.up=h.getRow(M,1,a.up),a.direction=t.negate(h.getRow(M,2,a.direction),a.direction),a.setTransform(j)};return c}function x(e,r,i,n,o){var a=e.camera,s=e.mapProjection.ellipsoid,l=t.clone(a.position);l.z=a.frustum.right-a.frustum.left;var u=E(a,s,l,r,i),c=b(a,u,t.negate(t.UNIT_Z,new t),o),d=a.position.z,m=function(e){var r=e.time,i=c.evaluate(r);h.fromQuaternion(i,M),a.position=u.evaluate(r);var n=a.position.z;a.position.z=d,a.right=h.getRow(M,0,a.right),a.up=h.getRow(M,1,a.up),a.direction=t.negate(h.getRow(M,2,a.direction),a.direction);var o=a.frustum,s=o.top/o.right,l=.5*(n-(o.right-o.left));o.right+=l,o.left-=l,o.top=s*o.right,o.bottom=-o.top};return m}var P={},A=new t,M=new h,D=new h,I=new t,O=new t,R=new t,L=new t,N=new t,F=new t,B=new h,z=new t,V=new t,k=new t,U=new m,W=new t,G=new t,H=new t,q=new t,j=new d,Y=new t,X=t.negate(t.UNIT_Z,new t),Z=new t;Z=t.normalize(t.cross(X,t.UNIT_Y,Z),Z);var Q=t.cross(Z,X,new t),J=_(X,Q),K=new t,$=new t,et=new t,tt=new r,rt=new t;return P.createTween=function(r,i){i=n(i,n.EMPTY_OBJECT);var a=i.destination,l=i.direction,u=i.up;if(r.mode===g.MORPHING)return{startObject:{},stopObject:{},duration:0};var h=n(i.convert,!0);if(h&&r.mode!==g.SCENE3D){var d=r.mapProjection,m=d.ellipsoid;m.cartesianToCartographic(a,tt),a=d.project(tt,rt)}var p=n(i.duration,3),f=r.screenSpaceCameraController;f.enableInputs=!1;var v=function(e){var t=function(){"function"==typeof e&&e(),f.enableInputs=!0};return t},_=v(i.complete),y=v(i.cancel),C=r.camera,w=i.endTransform;o(w)&&C.setTransform(w);var E=C.frustum;if(r.mode===g.SCENE2D){if(e.equalsEpsilon(C.position,a,c.EPSILON6)&&c.equalsEpsilon(Math.max(E.right-E.left,E.top-E.bottom),a.z,c.EPSILON6))return{startObject:{},stopObject:{},duration:0,complete:_,cancel:y}}else if(t.equalsEpsilon(a,C.position,c.EPSILON6))return{startObject:{},stopObject:{},duration:0,complete:_,cancel:y};if(0>=p){var b=function(){var e=a;if(r.mode===g.SCENE3D?(o(i.direction)||o(i.up)?(K=i.direction,$=t.normalize(t.cross(K,i.up,$),$)):(K=t.normalize(t.negate(e,K),K),$=t.normalize(t.cross(K,t.UNIT_Z,$),$)),et=n(i.up,t.cross($,K,et))):(o(i.direction)||o(i.up)?(K=i.direction,$=t.normalize(t.cross(K,i.up,$),$)):(K=t.negate(t.UNIT_Z,K),$=t.normalize(t.cross(K,t.UNIT_Y,$),$)),et=n(i.up,t.cross($,K,et))),t.clone(e,C.position),t.clone(K,C.direction),t.clone(et,C.up),t.clone($,C.right),r.mode===g.SCENE2D){var s=C.position.z,l=E.top/E.right,u=.5*(s-(E.right-E.left));E.right+=u,E.left-=u,E.top=l*E.right,E.bottom=-E.top}"function"==typeof _&&_()};return{startObject:{},stopObject:{},duration:0,complete:b,cancel:y}}var P;return P=r.mode===g.SCENE3D?S(r,a,p,l,u):r.mode===g.SCENE2D?x(r,a,p,l,u):T(r,a,p,l,u),{duration:p,easingFunction:s.SINUSOIDAL_IN_OUT,startObject:{time:0},stopObject:{time:p},update:P,complete:_,cancel:y}},P.createTweenRectangle=function(e,t){t=n(t,n.EMPTY_OBJECT);var r=t.destination,o=i(t);return e.camera.getRectangleCameraCoordinates(r,A),o.destination=A,o.convert=!1,this.createTween(e,o)},P}),r("Scene/Camera",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/Ellipsoid","../Core/IntersectionTests","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Ray","../Core/Rectangle","../Core/Transforms","./CameraFlightPath","./PerspectiveFrustum","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C){"use strict";function w(e){var r=e._right,i=e._up,n=e._direction,o=e._position,a=e._viewMatrix;a[0]=r.x,a[1]=i.x,a[2]=-n.x,a[3]=0,a[4]=r.y,a[5]=i.y,a[6]=-n.y,a[7]=0,a[8]=r.z,a[9]=i.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(r,o),a[13]=-t.dot(i,o),a[14]=t.dot(n,o),a[15]=1,m.multiply(a,e._actualInvTransform,e._viewMatrix),m.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function S(e){var i=e._projection,n=i.ellipsoid,o=m.getColumn(e._transform,3,et),a=n.cartesianToCartographic(o,J),s=i.project(a,K),l=tt;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=r.add(m.getColumn(e._transform,0,$),o,$);n.cartesianToCartographic(u,a),i.project(a,s);var c=rt;c.x=s.z,c.y=s.x,c.z=s.y,c.w=0,t.subtract(c,l,c);var h=r.add(m.getColumn(e._transform,1,$),o,$);n.cartesianToCartographic(h,a),i.project(a,s);var d=it;d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,t.subtract(d,l,d);var p=nt;t.cross(c,d,p),t.normalize(p,p),t.cross(d,p,c),t.normalize(c,c),t.cross(p,c,d),t.normalize(d,d),m.setColumn(e._actualTransform,0,c,e._actualTransform),m.setColumn(e._actualTransform,1,d,e._actualTransform),m.setColumn(e._actualTransform,2,p,e._actualTransform),m.setColumn(e._actualTransform,3,l,e._actualTransform)}function E(e){var i=e._projection,n=i.ellipsoid,o=m.getColumn(e._transform,3,et),a=n.cartesianToCartographic(o,J),s=i.project(a,K),l=tt;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=r.clone(r.UNIT_X,nt),c=r.add(m.getColumn(e._transform,0,$),o,$);n.cartesianToCartographic(c,a),i.project(a,s);var d=rt;d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,t.subtract(d,l,d),d.x=0;var p=it;if(t.magnitudeSquared(d)>h.EPSILON10)t.cross(u,d,p);else{var f=r.add(m.getColumn(e._transform,1,$),o,$);n.cartesianToCartographic(f,a),i.project(a,s),p.x=s.z,p.y=s.x,p.z=s.y,p.w=0,t.subtract(p,l,p),p.x=0,t.magnitudeSquared(p)h.EPSILON2){n=t.normalize(n,e._direction),t.clone(n,e.direction);var g=1/t.magnitudeSquared(a),_=t.dot(a,n)*g,y=t.multiplyByScalar(n,_,ot);a=t.normalize(t.subtract(a,y,e._up),e._up),t.clone(a,e.up),l=t.cross(n,a,e._right),t.clone(l,e.right)}}(o||c)&&(e._directionWC=m.multiplyByPointAsVector(d,n,e._directionWC)),(s||c)&&(e._upWC=m.multiplyByPointAsVector(d,a,e._upWC)),(u||c)&&(e._rightWC=m.multiplyByPointAsVector(d,l,e._rightWC)),(i||o||s||u||c)&&w(e)}function T(e){return Math.atan2(e.right.y,e.right.x)}function x(e){var t=e._projection.ellipsoid,r=g.eastNorthUpToFixedFrame(e.position,t,at),i=m.getRotation(r,st);d.transpose(i,i);var n=d.multiplyByVector(i,e.right,lt);return Math.atan2(n.y,n.x)}function P(e,r){var i=T(e);r=i-r,e.look(t.UNIT_Z,r)}function A(e,r){var i=t.normalize(e.position,ut),n=x(e);r=n-r,e.look(i,r)}function M(e){return h.PI_OVER_TWO-h.acosClamped(-e.direction.z)}function D(e){var r=t.normalize(e.position,ct);return t.negate(r,r),h.PI_OVER_TWO-h.acosClamped(t.dot(e.direction,r))}function I(e,t){var r=e._maxCoord.x*e.maximumTranslateFactor;t.x>r&&(t.x=r),t.x<-r&&(t.x=-r);var i=e._maxCoord.y*e.maximumTranslateFactor;t.y>i&&(t.y=i),t.y<-i&&(t.y=-i)}function O(e,r){var i=e.position,n=t.normalize(i,yt);if(o(e.constrainedAxis)){var a=t.equalsEpsilon(n,e.constrainedAxis,h.EPSILON2),s=t.equalsEpsilon(n,t.negate(e.constrainedAxis,St),h.EPSILON2);if(a||s)(a&&0>r||s&&r>0)&&e.rotate(e.right,r);else{var l=t.normalize(e.constrainedAxis,Ct),u=t.dot(n,l),c=h.acosClamped(u);r>0&&r>c&&(r=c-h.EPSILON4),u=t.dot(n,t.negate(l,St)),c=h.acosClamped(u),0>r&&-r>c&&(r=-c+h.EPSILON4);var d=t.cross(l,n,wt);e.rotate(d,r)}}else e.rotate(e.right,r)}function R(e,t){o(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function L(e,t){var r=e.frustum;t=.5*t;var i=r.right-t,n=r.left+t,o=e._maxCoord.x*e.maximumZoomFactor;i>o&&(i=o,n=-o),n>=i&&(i=1,n=-1);var a=r.top/r.right;r.right=i,r.left=n,r.top=r.right*a,r.bottom=-r.top}function N(e,t){e.move(e.direction,t)}function F(r,i){var n=.5*-i.height,o=-n,a=r.frustum;if(o>n){var s=a.top/a.right;a.right=o,a.left=n,a.top=a.right*s,a.bottom=-a.top}e.clone(r._projection.project(i),r.position),t.negate(t.UNIT_Z,r.direction),t.clone(t.UNIT_Y,r.up),t.clone(t.UNIT_X,r.right)}function B(e,r){var i=e._projection;e.position=i.project(r),t.negate(t.UNIT_Z,e.direction),t.clone(t.UNIT_Y,e.up),t.clone(t.UNIT_X,e.right)}function z(e,r){var i=e._projection.ellipsoid;i.cartographicToCartesian(r,e.position),t.negate(e.position,e.direction),t.normalize(e.direction,e.direction),t.cross(e.direction,t.UNIT_Z,e.right),t.cross(e.right,e.direction,e.up),t.cross(e.direction,e.up,e.right)}function V(e,r,i,n,a){o(n)||(n=new t);var s=e;a&&(s=Mt);var l=r.north,u=r.south,c=r.east,d=r.west;d>c&&(c+=h.TWO_PI);var m=Et;m.longitude=c,m.latitude=l;var p=i.cartographicToCartesian(m,bt);m.latitude=u;var f=i.cartographicToCartesian(m,Pt);m.longitude=d;var v=i.cartographicToCartesian(m,Tt);m.latitude=l;var g=i.cartographicToCartesian(m,xt),_=t.subtract(p,v,At);t.multiplyByScalar(_,.5,_),t.add(v,_,_);var y=t.magnitude(_);yy?(m=v,p=m/_):(p=g,m=y),g=Math.max(2*m,2*p),o(n)||(n=new t),n.x=.5*(d.x-f.x)+f.x,n.y=.5*(d.y-f.y)+f.y,a)h=i.unproject(n,h),h.height=g,n=i.project(h,n);else{var C=e.frustum;C.right=m,C.left=-m,C.top=p,C.bottom=-p;var w=t.clone(t.UNIT_Z,e.direction);t.negate(w,w),t.clone(t.UNIT_X,e.right),t.clone(t.UNIT_Y,e.up)}return n}function W(e,t,r,i){r=n(r,u.WGS84);var o=e.getPickRay(t,Ft),a=c.rayEllipsoid(o,r);if(!a)return void 0;var s=a.start>0?a.start:a.stop;return f.getPoint(o,s,i)}function G(e,t,r,i){var n=e.getPickRay(t,Bt),o=n.origin;o.z=0;var a=r.unproject(o);return a.latitude<-h.PI_OVER_TWO||a.latitude>h.PI_OVER_TWO||a.longitude<-Math.PI||a.longitude>Math.PI?void 0:r.ellipsoid.cartographicToCartesian(a,i)}function H(e,r,i,n){var o=e.getPickRay(r,zt),a=-o.origin.x/o.direction.x;f.getPoint(o,a,n);var s=i.unproject(new t(n.y,n.z,0));return s.latitude<-h.PI_OVER_TWO||s.latitude>h.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI?void 0:i.ellipsoid.cartographicToCartesian(s,n)}function q(e,r,i){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*r.x-1,h=2/a*(a-r.y)-1,d=e.positionWC;t.clone(d,i.origin);var m=t.multiplyByScalar(e.directionWC,u,Vt);t.add(d,m,m);var p=t.multiplyByScalar(e.rightWC,c*u*l,kt),f=t.multiplyByScalar(e.upWC,h*u*s,Ut),v=t.add(m,p,i.direction);return t.add(v,f,v),t.subtract(v,d,v),t.normalize(v,v),i}function j(e,r,i){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=2/o*r.x-1;s*=.5*(e.frustum.right-e.frustum.left);var l=2/a*(a-r.y)-1;l*=.5*(e.frustum.top-e.frustum.bottom);var u=i.origin;return t.clone(e.position,u),t.multiplyByScalar(e.right,s,Wt),t.add(Wt,u,u),t.multiplyByScalar(e.up,l,Wt),t.add(Wt,u,u),t.clone(e.directionWC,i.direction),i}function Y(e,r){var i=e.position,n=i.x<-e._maxCoord.x||i.x>e._maxCoord.x,o=i.y<-e._maxCoord.y||i.y>e._maxCoord.y,a=n||o,s=e.frustum,u=s.top,c=s.bottom,d=s.right,m=s.left,p=e._max2Dfrustum,f=d>e._max2Dfrustum.right;if(a||f){var v=t.clone(i);v.x>e._maxCoord.x?v.x=e._maxCoord.x:v.x<-e._maxCoord.x&&(v.x=-e._maxCoord.x),v.y>e._maxCoord.y?v.y=e._maxCoord.y:v.y<-e._maxCoord.y&&(v.y=-e._maxCoord.y);var g=function(r){a&&(e.position=t.lerp(i,v,r.time,e.position)),f&&(e.frustum.top=h.lerp(u,p.top,r.time),e.frustum.bottom=h.lerp(c,p.bottom,r.time),e.frustum.right=h.lerp(d,p.right,r.time),e.frustum.left=h.lerp(m,p.left,r.time))};return{easingFunction:l.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:g}}return void 0}function X(e,r,i,n,o,a){var s=t.clone(r);i.y>n?s.y-=i.y-n:i.y<-n&&(s.y+=-n-i.y),i.z>o?s.z-=i.z-o:i.z<-o&&(s.z+=-o-i.z);var u=function(i){var n=t.lerp(r,s,i.time,new t);e.worldToCameraCoordinatesPoint(n,e.position)};return{easingFunction:l.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:u}}function Z(e,r){var i=e.position,n=e.direction,o=e.worldToCameraCoordinatesVector(t.UNIT_X,Gt),a=-t.dot(o,i)/t.dot(o,n),s=t.add(i,t.multiplyByScalar(n,a,Ht),Ht);e.cameraToWorldCoordinatesPoint(s,s),i=e.cameraToWorldCoordinatesPoint(e.position,qt);var l=Math.tan(.5*e.frustum.fovy),u=e.frustum.aspectRatio*l,c=t.magnitude(t.subtract(i,s,jt)),h=u*c,d=l*c,m=e._maxCoord.x,p=e._maxCoord.y,f=Math.max(h-m,m),v=Math.max(d-p,p);if(i.z<-f||i.z>f||i.y<-v||i.y>v){var g=s.y<-f||s.y>f,_=s.z<-v||s.z>v;if(g||_)return X(e,i,s,f,v,r)}return void 0}var Q=function(e){this._scene=e,this.transform=m.clone(m.IDENTITY),this._transform=m.clone(m.IDENTITY),this._invTransform=m.clone(m.IDENTITY),this._actualTransform=m.clone(m.IDENTITY),this._actualInvTransform=m.clone(m.IDENTITY),this.position=new t,this._position=new t,this._positionWC=new t,this._positionCartographic=new i,this.direction=new t,this._direction=new t,this._directionWC=new t,this.up=new t,this._up=new t,this._upWC=new t,this.right=new t,this._right=new t,this._rightWC=new t,this.frustum=new y,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=h.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumTranslateFactor=1.5,this.maximumZoomFactor=2.5,this._viewMatrix=new m,this._invViewMatrix=new m,w(this),this._mode=C.SCENE3D,this._modeChanged=!0;var r=e.mapProjection;this._projection=r,this._maxCoord=r.project(new i(Math.PI,h.PI_OVER_TWO)),this._max2Dfrustum=void 0,this.viewRectangle(Q.DEFAULT_VIEW_RECTANGLE);var n=t.magnitude(this.position);n+=n*Q.DEFAULT_VIEW_FACTOR,t.normalize(this.position,this.position),t.multiplyByScalar(this.position,n,this.position)};Q.TRANSFORM_2D=new m(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Q.TRANSFORM_2D_INVERSE=m.inverseTransformation(Q.TRANSFORM_2D,new m),Q.DEFAULT_VIEW_RECTANGLE=v.fromDegrees(-95,-20,-70,90),Q.DEFAULT_VIEW_FACTOR=.5;var J=new i,K=new t,$=new t,et=new r,tt=new r,rt=new r,it=new r,nt=new r,ot=new t,at=new m,st=new d,lt=new t,ut=new t,ct=new t;a(Q.prototype,{inverseTransform:{get:function(){return b(this),this._invTransform}},viewMatrix:{get:function(){return b(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return b(this),this._invViewMatrix}},positionCartographic:{get:function(){return b(this),this._positionCartographic}},positionWC:{get:function(){return b(this),this._positionWC}},directionWC:{get:function(){return b(this),this._directionWC}},upWC:{get:function(){return b(this),this._upWC}},rightWC:{get:function(){return b(this),this._rightWC}},heading:{get:function(){return this._mode===C.SCENE2D||this._mode===C.COLUMBUS_VIEW?T(this):this._mode===C.SCENE3D?x(this):void 0},set:function(e){this._mode===C.SCENE2D||this._mode===C.COLUMBUS_VIEW?P(this,e):this._mode===C.SCENE3D&&A(this,e)}},tilt:{get:function(){return this._mode===C.COLUMBUS_VIEW?M(this):this._mode===C.SCENE3D?D(this):void 0},set:function(e){(this._mode===C.COLUMBUS_VIEW||this._mode===C.SCENE3D)&&(e=h.clamp(e,0,h.PI_OVER_TWO),e-=this.tilt,this.look(this.right,e))}}}),Q.prototype.update=function(e){var t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==C.MORPHING,t=this._mode===C.SCENE2D),t){var r=this._max2Dfrustum=this.frustum.clone(),i=2,n=r.top/r.right;r.right=this._maxCoord.x*i,r.left=-r.right,r.top=n*r.right,r.bottom=-r.top}};var ht=new t,dt=new t,mt=new t;Q.prototype.setTransform=function(e){var r=t.clone(this.positionWC,ht),i=t.clone(this.upWC,dt),n=t.clone(this.directionWC,mt);m.clone(e,this.transform),b(this);var o=this._actualInvTransform;m.multiplyByPoint(o,r,this.position),m.multiplyByPointAsVector(o,n,this.direction),m.multiplyByPointAsVector(o,i,this.up),t.cross(this.direction,this.up,this.right)},Q.prototype.worldToCameraCoordinates=function(e,t){return o(t)||(t=new r),b(this),m.multiplyByVector(this._actualInvTransform,e,t)},Q.prototype.worldToCameraCoordinatesPoint=function(e,r){return o(r)||(r=new t),b(this),m.multiplyByPoint(this._actualInvTransform,e,r)},Q.prototype.worldToCameraCoordinatesVector=function(e,r){return o(r)||(r=new t),b(this),m.multiplyByPointAsVector(this._actualInvTransform,e,r)},Q.prototype.cameraToWorldCoordinates=function(e,t){return o(t)||(t=new r),b(this),m.multiplyByVector(this._actualTransform,e,t)},Q.prototype.cameraToWorldCoordinatesPoint=function(e,r){return o(r)||(r=new t),b(this),m.multiplyByPoint(this._actualTransform,e,r)},Q.prototype.cameraToWorldCoordinatesVector=function(e,r){return o(r)||(r=new t),b(this),m.multiplyByPointAsVector(this._actualTransform,e,r)};var pt=new t;Q.prototype.move=function(e,r){var i=this.position;t.multiplyByScalar(e,r,pt),t.add(i,pt,i),this._mode===C.SCENE2D&&I(this,i)},Q.prototype.moveForward=function(e){e=n(e,this.defaultMoveAmount),this.move(this.direction,e)},Q.prototype.moveBackward=function(e){e=n(e,this.defaultMoveAmount),this.move(this.direction,-e)},Q.prototype.moveUp=function(e){e=n(e,this.defaultMoveAmount),this.move(this.up,e)},Q.prototype.moveDown=function(e){e=n(e,this.defaultMoveAmount),this.move(this.up,-e)},Q.prototype.moveRight=function(e){e=n(e,this.defaultMoveAmount),this.move(this.right,e)},Q.prototype.moveLeft=function(e){e=n(e,this.defaultMoveAmount),this.move(this.right,-e)},Q.prototype.lookLeft=function(e){e=n(e,this.defaultLookAmount),this.look(this.up,-e)},Q.prototype.lookRight=function(e){e=n(e,this.defaultLookAmount),this.look(this.up,e)},Q.prototype.lookUp=function(e){e=n(e,this.defaultLookAmount),this.look(this.right,-e)},Q.prototype.lookDown=function(e){e=n(e,this.defaultLookAmount),this.look(this.right,e)};var ft=new p,vt=new d;Q.prototype.look=function(e,t){var r=n(t,this.defaultLookAmount),i=p.fromAxisAngle(e,-r,ft),o=d.fromQuaternion(i,vt),a=this.direction,s=this.up,l=this.right;d.multiplyByVector(o,a,a),d.multiplyByVector(o,s,s),d.multiplyByVector(o,l,l)},Q.prototype.twistLeft=function(e){e=n(e,this.defaultLookAmount),this.look(this.direction,e)},Q.prototype.twistRight=function(e){e=n(e,this.defaultLookAmount),this.look(this.direction,-e)};var gt=new p,_t=new d;Q.prototype.rotate=function(e,r){var i=n(r,this.defaultRotateAmount),o=p.fromAxisAngle(e,-i,gt),a=d.fromQuaternion(o,_t);d.multiplyByVector(a,this.position,this.position),d.multiplyByVector(a,this.direction,this.direction),d.multiplyByVector(a,this.up,this.up),t.cross(this.direction,this.up,this.right),t.cross(this.right,this.direction,this.up)},Q.prototype.rotateDown=function(e){e=n(e,this.defaultRotateAmount),O(this,e)},Q.prototype.rotateUp=function(e){e=n(e,this.defaultRotateAmount),O(this,-e)};var yt=new t,Ct=new t,wt=new t,St=new t;Q.prototype.rotateRight=function(e){e=n(e,this.defaultRotateAmount),R(this,-e)},Q.prototype.rotateLeft=function(e){e=n(e,this.defaultRotateAmount),R(this,e)},Q.prototype.zoomIn=function(e){e=n(e,this.defaultZoomAmount),this._mode===C.SCENE2D?L(this,e):N(this,e)},Q.prototype.zoomOut=function(e){e=n(e,this.defaultZoomAmount),this._mode===C.SCENE2D?L(this,-e):N(this,-e)},Q.prototype.getMagnitude=function(){return this._mode===C.SCENE3D?t.magnitude(this.position):this._mode===C.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===C.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0},Q.prototype.setPositionCartographic=function(e){this._mode===C.SCENE2D?F(this,e):this._mode===C.COLUMBUS_VIEW?B(this,e):this._mode===C.SCENE3D&&z(this,e)},Q.prototype.lookAt=function(r,i,n){if(this._mode===C.SCENE2D){e.clone(i,this.position),t.negate(t.UNIT_Z,this.direction),t.clone(n,this.up),this.up.z=0,t.magnitudeSquared(this.up)0&&n.clientHeight>0){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 r=f.angleAndHeight.endPosition.x,i=f.prevAngle,l=2*Math.PI;r>=i+Math.PI;)r-=l;for(;r0||e}}}),g.prototype.isMoving=function(e,t){var r=c(e,t);return!this._update[r]},g.prototype.getMovement=function(e,t){var r=c(e,t),i=this._movement[r];return i},g.prototype.getLastMovement=function(e,t){var r=c(e,t),i=this._lastMovement[r];return i.valid?i:void 0},g.prototype.isButtonDown=function(e,t){var r=c(e,t);return this._isDown[r]},g.prototype.getStartMousePosition=function(e,t){if(e===u.WHEEL)return this._currentMousePosition;var r=c(e,t);return this._eventStartPosition[r]},g.prototype.getButtonPressTime=function(e,t){var r=c(e,t);return this._pressTime[r]},g.prototype.getButtonReleaseTime=function(e,t){var r=c(e,t);return this._releaseTime[r]},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(),i(this)},g}),r("Scene/CreditDisplay",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError"],function(e,t,r,i){"use strict";function n(e,t,i){if(!r(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=i,l.className="cesium-credit-delimiter",t.appendChild(l)}t.appendChild(e.element)}function o(e,t){if(!r(e.element)){var i=e.text,n=e.link,o=document.createElement("span"),a=document.createElement("img");if(a.src=e.imageUrl,a.style["vertical-align"]="bottom",r(i)&&(a.alt=i,a.title=i),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 a(t,r){for(var i=t.length,n=0;i>n;n++){var o=t[n];if(e.equals(o,r))return!0}return!1}function s(e){var t=e.element;if(r(t)){var i=t.parentNode;if(!e.hasImage()){var n=t.previousSibling;null===n&&(n=t.nextSibling),null!==n&&i.removeChild(n)}i.removeChild(t)}}function l(e,t){var r,i,o,a=e._displayedCredits.textCredits;for(r=0;r= 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"}),r("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"}),r("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/ShaderSource","../Shaders/EllipsoidFS","../Shaders/EllipsoidVS","./BlendingState","./CullFace","./Material","./Pass","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y){"use strict";function C(e){var i=e.cache.ellipsoidPrimitive_vertexArray;if(o(i))return i;var n=t.createGeometry(t.fromDimensions({dimensions:new r(2,2,2),vertexFormat:u.POSITION_ONLY}));return i=e.createVertexArrayFromGeometry({geometry:n,attributeLocations:w,bufferUsage:c.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=i,i}var w={position:0},S=function(t){t=n(t,n.EMPTY_OBJECT),this.center=r.clone(n(t.center,r.ZERO)),this._center=new r,this.radii=r.clone(t.radii),this._radii=new r,this._oneOverEllipsoidRadiiSquared=new r,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,g.fromType(g.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._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 i=this;this._uniforms={u_radii:function(){return i.radii},u_oneOverEllipsoidRadiiSquared:function(){return i._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return i._pickId.color}}};return S.prototype.update=function(t,n,a){if(this.show&&n.mode===y.SCENE3D&&o(this.center)&&o(this.radii)){var s=this.material.isTranslucent(),u=this._translucent!==s;(!o(this._rs)||u)&&(this._translucent=s,this._rs=t.createRenderState({cull:{enabled:!0,face:v.FRONT},depthTest:{enabled:!0},depthMask:!s&&t.fragmentDepth,blending:s?f.ALPHA_BLEND:void 0})),o(this._va)||(this._va=C(t));var c=!1,h=this.radii;if(!r.equals(this._radii,h)){r.clone(h,this._radii);var g=this._oneOverEllipsoidRadiiSquared;g.x=1/(h.x*h.x),g.y=1/(h.y*h.y),g.z=1/(h.z*h.z),c=!0}l.equals(this.modelMatrix,this._modelMatrix)&&r.equals(this.center,this._center)||(l.clone(this.modelMatrix,this._modelMatrix),r.clone(this.center,this._center),l.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),c=!0),c&&(r.clone(r.ZERO,this._boundingSphere.center),this._boundingSphere.radius=r.maximumComponent(h),e.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));var S=this._material!==this.material;this._material=this.material,this._material.update(t);var E=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var b,T=this._colorCommand;(S||E||u)&&(b=new d({sources:[this.material.shaderSource,m]}),this.onlySunLighting&&b.defines.push("ONLY_SUN_LIGHTING"),!s&&t.fragmentDepth&&b.defines.push("WRITE_DEPTH"),this._sp=t.replaceShaderProgram(this._sp,p,b,w),T.vertexArray=this._va,T.renderState=this._rs,T.shaderProgram=this._sp,T.uniformMap=i(this._uniforms,this.material._uniforms),T.executeInClosestFrustum=s);var x=n.passes;if(x.render&&(T.boundingVolume=this._boundingSphere,T.debugShowBoundingVolume=this.debugShowBoundingVolume,T.modelMatrix=this._computedModelMatrix,T.pass=s?_.TRANSLUCENT:_.OPAQUE,a.push(T)),x.pick){var P=this._pickCommand;o(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(S||E||!o(this._pickSP))&&(b=new d({sources:[this.material.shaderSource,m],pickColorQualifier:"uniform"}),this.onlySunLighting&&b.defines.push("ONLY_SUN_LIGHTING"),!s&&t.fragmentDepth&&b.defines.push("WRITE_DEPTH"),this._pickSP=t.replaceShaderProgram(this._pickSP,p,b,w),P.vertexArray=this._va,P.renderState=this._rs,P.shaderProgram=this._pickSP,P.uniformMap=i(i(this._uniforms,this._pickUniforms),this.material._uniforms),P.executeInClosestFrustum=s),P.boundingVolume=this._boundingSphere,P.modelMatrix=this._computedModelMatrix,P.pass=s?_.TRANSLUCENT:_.OPAQUE,a.push(P)}}},S.prototype.isDestroyed=function(){return!1},S.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)},S}),r("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 = czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC));\n#else\nnormalEC = normalize(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"}),r("Shaders/Appearances/EllipsoidSurfaceAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec2 st;\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"}),r("Scene/EllipsoidSurfaceAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/EllipsoidSurfaceAppearanceFS","../Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Appearance","./Material"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),l=e(r.aboveGround,!1);this.material=t(r.material)?r.material:s.fromType(s.ColorType),this.translucent=e(r.translucent,!0),this._vertexShaderSource=e(r.vertexShaderSource,o),this._fragmentShaderSource=e(r.fragmentShaderSource,n),this._renderState=e(r.renderState,a.getDefaultRenderState(i,!l)),this._closed=!1,this._flat=e(r.flat,!1),this._faceForward=e(r.faceForward,l),this._aboveGround=l};return r(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=i.POSITION_AND_ST,l.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,l.prototype.isTranslucent=a.prototype.isTranslucent,l.prototype.getRenderState=a.prototype.getRenderState,l}),r("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"}),r("Scene/FXAA",["../Core/Cartesian2","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/PixelDatatype","../Renderer/RenderbufferFormat","../Shaders/PostProcessFilters/FXAA"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){e._fbo=e._fbo&&e._fbo.destroy(),e._texture=e._texture&&e._texture.destroy(),e._depthTexture=e._depthTexture&&e._depthTexture.destroy(),e._depthRenderbuffer=e._depthRenderbuffer&&e._depthRenderbuffer.destroy(),e._fbo=void 0,e._texture=void 0,e._depthTexture=void 0,e._depthRenderbuffer=void 0,r(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0)}var c=function(){this._texture=void 0,this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._fbo=void 0,this._command=void 0;var e=new o({color:new t(0,0,0,0),depth:1,owner:this});this._clearCommand=e};return c.prototype.update=function(t){var i=t.drawingBufferWidth,o=t.drawingBufferHeight,u=this._texture,c=!r(u)||u.width!==i||u.height!==o;if(c&&(this._texture=this._texture&&this._texture.destroy(),this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._texture=t.createTexture2D({width:i,height:o,pixelFormat:n.RGBA,pixelDatatype:a.UNSIGNED_BYTE}),t.depthTexture?this._depthTexture=t.createTexture2D({width:i,height:o,pixelFormat:n.DEPTH_COMPONENT,pixelDatatype:a.UNSIGNED_SHORT}):this._depthRenderbuffer=t.createRenderbuffer({width:i,height:o,format:s.DEPTH_COMPONENT16})),(!r(this._fbo)||c)&&(this._fbo=this._fbo&&this._fbo.destroy(),this._fbo=t.createFramebuffer({colorTextures:[this._texture],depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,destroyAttachments:!1})),r(this._command)||(this._command=t.createViewportQuadCommand(l,{renderState:t.createRenderState(),owner:this})),c){var h=this,d=new e(1/this._texture.width,1/this._texture.height);this._command.uniformMap={u_texture:function(){return h._texture},u_step:function(){return d -}}}},c.prototype.execute=function(e,t){this._command.execute(e,t)},c.prototype.clear=function(e,r,i){var n=r.framebuffer;r.framebuffer=this._fbo,t.clone(i,this._clearCommand.color),this._clearCommand.execute(e,r),r.framebuffer=n},c.prototype.getColorFramebuffer=function(){return this._fbo},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return u(this),i(this)},c}),r("Scene/FrameRateMonitor",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/TimeConstants"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){if(!(e._pauseCount>0)){var t=a();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=t+e.quietPeriod/s.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/s.SECONDS_PER_MILLISECOND;else if(t>=e._quietPeriodEndTime){e._frameTimes.push(t);var r=t-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);i>n?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 u(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var c=function(r){function i(){u(n)}this._scene=r.scene,this.samplingWindow=e(r.samplingWindow,c.defaultSettings.samplingWindow),this.quietPeriod=e(r.quietPeriod,c.defaultSettings.quietPeriod),this.warmupPeriod=e(r.warmupPeriod,c.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=e(r.minimumFrameRateDuringWarmup,c.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=e(r.minimumFrameRateAfterWarmup,c.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){l(n,t)}),this._hiddenPropertyName=t(document.hidden)?"hidden":t(document.mozHidden)?"mozHidden":t(document.msHidden)?"msHidden":t(document.webkitHidden)?"webkitHidden":void 0;var a=t(document.hidden)?"visibilitychange":t(document.mozHidden)?"mozvisibilitychange":t(document.msHidden)?"msvisibilitychange":t(document.webkitHidden)?"webkitvisibilitychange":void 0;this._visibilityChangeRemoveListener=void 0,t(a)&&(document.addEventListener(a,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(a,i,!1)})};return c.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8},c.fromScene=function(e){return(!t(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new c({scene:e})),e._frameRateMonitor},r(c.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}}}),c.prototype.pause=function(){++this._pauseCount,1===this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},c.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._preRenderRemoveListener(),t(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),i(this)},c}),r("Scene/FrameState",["./SceneMode"],function(e){"use strict";var t=function(t){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=t,this.afterRender=[],this.scene3DOnly=!1};return t}),r("Scene/FrustumCommands",["../Core/defaultValue"],function(e){"use strict";var t=function(t,r){this.near=e(t,0),this.far=e(r,0),this.opaqueCommands=[],this.translucentCommands=[]};return t}),r("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];\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 vec2 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\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 sample = texture2D(texture, textureCoordinates);\nvec3 color = sample.rgb;\nfloat alpha = sample.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, vec2 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 = normalize(czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\nvec3 normalEC = normalize(czm_normal3D * normalMC);\n#elif defined(ENABLE_VERTEX_LIGHTING)\nvec3 normalMC = normalize(v_normalMC);\nvec3 normalEC = normalize(v_normalEC);\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates * 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, normalEC) * 0.9 + 0.3, 0.0, 1.0);\ngl_FragColor = 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);\ngl_FragColor = vec4(color.rgb * diffuseIntensity, color.a);\n#else\ngl_FragColor = color;\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 specularMapValue)\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);\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), specularMapValue);\nfloat specular = specularIntensity * surfaceReflectance;\nreturn vec4(imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular, imageryColor.a);\n}\n#endif\n"}),r("Shaders/GlobeFSDepth",[],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"}),r("Shaders/GlobeFSPole",[],function(){"use strict";return"uniform vec3 u_color;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nvec3 direction = normalize(czm_windowToEyeCoordinates(gl_FragCoord).xyz);\nczm_ray ray = czm_ray(vec3(0.0), direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (!czm_isEmpty(intersection))\n{\nvec3 positionEC = czm_pointAlongRay(ray, intersection.start);\nvec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\nvec3 normalMC = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), vec3(1.0)));\nvec3 normalEC = normalize(czm_normal * normalMC);\nvec3 startDayColor = u_color;\ngl_FragColor = vec4(startDayColor, 1.0);\n}\nelse\n{\ndiscard;\n}\n}\n"}),r("Shaders/GlobeVS",[],function(){"use strict";return"attribute vec4 position3DAndHeight;\nattribute vec4 textureCoordAndEncodedNormals;\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform vec4 u_tileRectangle;\nuniform vec2 u_southAndNorthLatitude;\nuniform vec3 u_southMercatorYLowAndHighAndOneOverHeight;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\nvec4 getPosition(vec3 position3DWC);\nfloat get2DYPositionFraction();\nvec4 getPosition3DMode(vec3 position3DWC)\n{\nreturn czm_projection * (u_modifiedModelView * vec4(position3DAndHeight.xyz, 1.0));\n}\nfloat get2DMercatorYPositionFraction()\n{\nconst float maxTileWidth = 0.003068;\nfloat positionFraction = textureCoordAndEncodedNormals.y;\nfloat southLatitude = u_southAndNorthLatitude.x;\nfloat northLatitude = u_southAndNorthLatitude.y;\nif (northLatitude - southLatitude > maxTileWidth)\n{\nfloat southMercatorYLow = u_southMercatorYLowAndHighAndOneOverHeight.x;\nfloat southMercatorYHigh = u_southMercatorYLowAndHighAndOneOverHeight.y;\nfloat oneOverMercatorHeight = u_southMercatorYLowAndHighAndOneOverHeight.z;\nfloat currentLatitude = mix(southLatitude, northLatitude, textureCoordAndEncodedNormals.y);\ncurrentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\npositionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorYLow, southMercatorYHigh, oneOverMercatorHeight);\n}\nreturn positionFraction;\n}\nfloat get2DGeographicYPositionFraction()\n{\nreturn textureCoordAndEncodedNormals.y;\n}\nvec4 getPositionPlanarEarth(vec3 position3DWC, float height2D)\n{\nfloat yPositionFraction = get2DYPositionFraction();\nvec4 rtcPosition2D = vec4(height2D, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordAndEncodedNormals.x, yPositionFraction)), 1.0);\nreturn czm_projection * (u_modifiedModelView * rtcPosition2D);\n}\nvec4 getPosition2DMode(vec3 position3DWC)\n{\nreturn getPositionPlanarEarth(position3DWC, 0.0);\n}\nvec4 getPositionColumbusViewMode(vec3 position3DWC)\n{\nreturn getPositionPlanarEarth(position3DWC, position3DAndHeight.w);\n}\nvec4 getPositionMorphingMode(vec3 position3DWC)\n{\nfloat yPositionFraction = get2DYPositionFraction();\nvec4 position2DWC = vec4(0.0, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordAndEncodedNormals.x, yPositionFraction)), 1.0);\nvec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\nreturn czm_modelViewProjection * morphPosition;\n}\nvoid main()\n{\nvec3 position3DWC = position3DAndHeight.xyz + u_center3D;\ngl_Position = getPosition(position3DWC);\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING)\nv_positionEC = (czm_modelView3D * vec4(position3DWC, 1.0)).xyz;\nv_positionMC = position3DWC;\n#elif defined(ENABLE_VERTEX_LIGHTING)\nv_positionEC = (czm_modelView3D * vec4(position3DWC, 1.0)).xyz;\nv_positionMC = position3DWC;\nfloat encodedNormal = textureCoordAndEncodedNormals.z;\nv_normalMC = czm_octDecode(encodedNormal);\nv_normalEC = czm_normal3D * v_normalMC;\n#endif\nv_textureCoordinates = textureCoordAndEncodedNormals.xy;\n}\n"}),r("Shaders/GlobeVSDepth",[],function(){"use strict";return"attribute vec4 position;\nvarying vec4 positionEC;\nvoid main()\n{\npositionEC = czm_modelView * position;\ngl_Position = czm_projection * positionEC;\n}\n"}),r("Shaders/GlobeVSPole",[],function(){"use strict";return"attribute vec4 position;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nfloat x = (position.x - czm_viewport.x) / czm_viewport.z;\nfloat y = (position.y - czm_viewport.y) / czm_viewport.w;\nv_textureCoordinates = vec2(x, y);\ngl_Position = czm_viewportOrthographic * position;\n}\n"}),r("Scene/terrainAttributeLocations",[],function(){"use strict";return{position3DAndHeight:0,textureCoordAndEncodedNormals:1}}),r("Scene/GlobeSurfaceShaderSet",["../Core/defined","../Core/destroyObject","../Scene/terrainAttributeLocations"],function(e,t,r){"use strict";function i(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._attributeLocations=r,this._shaders={}}function n(e,t,r,i,n,o,a,s,l){return""+e+ +t+ +r+ +i+ +n+ +o+ +a+ +s+ +l}return i.prototype.invalidateShaders=function(){var e=this._shaders;for(var t in e)e.hasOwnProperty(t)&&e[t].destroy();this._shaders={}},i.prototype.getShaderProgram=function(t,r,i,o,a,s,l,u,c,h){var d=n(r,i,o,a,s,l,u,c,h),m=this._shaders[d];if(!e(m)){var p=this.baseVertexShaderSource.clone(),f=this.baseFragmentShaderSource.clone();f.defines.push("TEXTURE_UNITS "+r),i&&f.defines.push("APPLY_BRIGHTNESS"),o&&f.defines.push("APPLY_CONTRAST"),a&&f.defines.push("APPLY_HUE"),s&&f.defines.push("APPLY_SATURATION"),l&&f.defines.push("APPLY_GAMMA"),u&&f.defines.push("APPLY_ALPHA"),c&&(f.defines.push("SHOW_REFLECTIVE_OCEAN"),p.defines.push("SHOW_REFLECTIVE_OCEAN")),h&&f.defines.push("SHOW_OCEAN_WAVES");for(var v="vec4 computeDayColor(vec4 initialColor, vec2 textureCoordinates)\n{\n vec4 color = initialColor;\n",g=0;r>g;++g)v+=" color = sampleAndBlend(\n color,\n u_dayTextures["+g+"],\n textureCoordinates,\n u_dayTextureTexCoordsRectangle["+g+"],\n u_dayTextureTranslationAndScale["+g+"],\n "+(u?"u_dayTextureAlpha["+g+"]":"1.0")+",\n "+(i?"u_dayTextureBrightness["+g+"]":"0.0")+",\n "+(o?"u_dayTextureContrast["+g+"]":"0.0")+",\n "+(a?"u_dayTextureHue["+g+"]":"0.0")+",\n "+(s?"u_dayTextureSaturation["+g+"]":"0.0")+",\n "+(l?"u_dayTextureOneOverGamma["+g+"]":"0.0")+"\n );\n";v+=" return color;\n}",f.sources.push(v),m=t.createShaderProgram(p,f,this._attributeLocations),this._shaders[d]=m}return m},i.prototype.destroy=function(){return this.invalidateShaders(),t(this)},i}),r("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)}),r("Scene/QuadtreeTileLoadState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,DONE:2,FAILED:3};return e(t)}),r("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)}),r("Scene/TileTerrain",["../Core/BoundingSphere","../Core/Cartesian3","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/IndexDatatype","../Core/TileProviderError","../Renderer/BufferUsage","../ThirdParty/when","./terrainAttributeLocations","./TerrainState"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(e,t,r,n,o){function s(t){e.data=t,e.state=c.RECEIVED}function u(){e.state=c.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,h)}function h(){e.data=t.requestTileGeometry(r,n,o),i(e.data)?(e.state=c.RECEIVING,l(e.data,s,u)):e.state=c.UNLOADED}h()}function d(e,t,r,n,o,a){var s=r.tilingScheme,u=e.data,h=u.createMesh(s,n,o,a);i(h)&&(e.state=c.TRANSFORMING,l(h,function(t){e.mesh=t,e.state=c.TRANSFORMED},function(){e.state=c.FAILED}))}function m(e,t,n){var a,l,h=r.FLOAT,d=e.mesh.vertices,m=t.createVertexBuffer(d,s.STATIC_DRAW);n.hasVertexNormals?(a=7*r.getSizeInBytes(h),l=3):(a=6*r.getSizeInBytes(h),l=2);var p=4,f=[{index:u.position3DAndHeight,vertexBuffer:m,componentDatatype:h,componentsPerAttribute:p,offsetInBytes:0,strideInBytes:a},{index:u.textureCoordAndEncodedNormals,vertexBuffer:m,componentDatatype:h,componentsPerAttribute:l,offsetInBytes:p*r.getSizeInBytes(h),strideInBytes:a}],v=e.mesh.indices.indexBuffers||{},g=v[t.id];if(!i(g)||g.isDestroyed()){var _=e.mesh.indices,y=2===_.BYTES_PER_ELEMENT?o.UNSIGNED_SHORT:o.UNSIGNED_INT;g=t.createIndexBuffer(_,s.STATIC_DRAW,y),g.vertexArrayDestroyable=!1,g.referenceCount=1,v[t.id]=g,e.mesh.indices.indexBuffers=v}else++g.referenceCount;e.vertexArray=t.createVertexArray(f,g),e.state=c.READY}var p=function(e){this.state=c.UNLOADED,this.data=void 0,this.mesh=void 0,this.vertexArray=void 0,this.upsampleDetails=e};return p.prototype.freeResources=function(){if(this.state=c.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(r){var i=r.data,n=this.mesh;t.clone(n.center,i.center),i.minimumHeight=n.minimumHeight,i.maximumHeight=n.maximumHeight,i.boundingSphere3D=e.clone(n.boundingSphere3D,i.boundingSphere3D),r.data.occludeePointInScaledSpace=t.clone(n.occludeePointInScaledSpace,i.occludeePointInScaledSpace),i.freeVertexArray(),i.vertexArray=this.vertexArray,this.vertexArray=void 0},p.prototype.processLoadStateMachine=function(e,t,r,i,n){this.state===c.UNLOADED&&h(this,t,r,i,n),this.state===c.RECEIVED&&d(this,e,t,r,i,n),this.state===c.TRANSFORMED&&m(this,e,t,r,i,n)},p.prototype.processUpsampleStateMachine=function(e,t,r,n,o){if(this.state===c.UNLOADED){var a=this.upsampleDetails,s=a.data,u=a.x,h=a.y,p=a.level;if(this.data=s.upsample(t.tilingScheme,u,h,p,r,n,o),!i(this.data))return;this.state=c.RECEIVING;var f=this;l(this.data,function(e){f.data=e,f.state=c.RECEIVED},function(){f.state=c.FAILED})}this.state===c.RECEIVED&&d(this,e,t,r,n,o),this.state===c.TRANSFORMED&&m(this,e,t,r,n,o)},p}),r("Scene/GlobeSurfaceTile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/IntersectionTests","../Core/PixelFormat","../Core/Rectangle","../Renderer/PixelDatatype","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./ImageryState","./QuadtreeTileLoadState","./SceneMode","./TerrainState","./TileTerrain"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y){"use strict";function C(e,r,i,n,a,s){if(t.unpack(i,a*n,s),t.add(e.center,s,s),o(r)&&r.mode!==g.SCENE3D){var l=r.mapProjection,u=l.ellipsoid,c=u.cartesianToCartographic(s);l.project(c,s),t.fromElements(s.z,s.x,s.y,s)}return s}function w(e,r,i){var n=e.data,a=E(e);o(a)&&(n.upsampledTerrain=new y(a)),x(e,r)&&(n.loadedTerrain=new y);for(var s=0,l=i.length;l>s;++s){var u=i.get(s);u.show&&u._createTileImagerySkeletons(e,r)}var h=e.tilingScheme.ellipsoid,d=e.rectangle;h.cartographicToCartesian(c.southwest(d),n.southwestCornerCartesian),h.cartographicToCartesian(c.northeast(d),n.northeastCornerCartesian),V.longitude=d.west,V.latitude=.5*(d.south+d.north),V.height=0;var m=h.cartographicToCartesian(V,B),p=t.cross(m,t.UNIT_Z,N);t.normalize(p,n.westNormal),V.longitude=d.east;var f=h.cartographicToCartesian(V,z),v=t.cross(t.UNIT_Z,f,N);t.normalize(v,n.eastNormal);var g=h.geodeticSurfaceNormalCartographic(c.southeast(d),F),_=t.subtract(m,f,N),C=t.cross(g,_,F);t.normalize(C,n.southNormal);var w=h.geodeticSurfaceNormalCartographic(c.northwest(d),F),S=t.cross(_,w,F);t.normalize(S,n.northNormal)}function S(e,t,r){var i=e.data,a=i.loadedTerrain,s=i.upsampledTerrain,l=!1;o(a)&&(a.processLoadStateMachine(t,r,e.x,e.y,e.level),a.state>=_.RECEIVED&&(i.terrainData!==a.data&&(i.terrainData=a.data,A(t,i),T(e)),l=!0),a.state===_.READY?(a.publishToTile(e),i.pickTerrain=n(i.loadedTerrain,i.upsampledTerrain),i.loadedTerrain=void 0,i.upsampledTerrain=void 0):a.state===_.FAILED&&(i.loadedTerrain=void 0)),!l&&o(s)&&(s.processUpsampleStateMachine(t,r,e.x,e.y,e.level),s.state>=_.RECEIVED&&i.terrainData!==s.data&&(i.terrainData=s.data,r.hasWaterMask&&M(e),b(e)),s.state===_.READY?(s.publishToTile(e),i.pickTerrain=i.upsampledTerrain,i.upsampledTerrain=void 0):s.state===_.FAILED&&(i.upsampledTerrain=void 0))}function E(e){for(var t=e.parent;o(t)&&o(t.data)&&!o(t.data.terrainData);)t=t.parent;return o(t)&&o(t.data)?{data:t.data.terrainData,x:t.x,y:t.y,level:t.level}:void 0}function b(e){var t=e.data;if(o(e._children))for(var r=0;4>r;++r){var i=e._children[r];if(i.state!==v.START){var n=i.data;if(o(n.terrainData)&&!n.terrainData.wasCreatedByUpsampling())continue;o(n.upsampledTerrain)&&n.upsampledTerrain.freeResources(),n.upsampledTerrain=new y({data:t.terrainData,x:e.x,y:e.y,level:e.level}),i.state=v.LOADING}}}function T(e){var t=e.data;if(o(e.children))for(var r=0;4>r;++r){var i=e.children[r];if(i.state!==v.START){var n=i.data;if(o(n.terrainData)&&!n.terrainData.wasCreatedByUpsampling())continue;o(n.upsampledTerrain)&&n.upsampledTerrain.freeResources(),n.upsampledTerrain=new y({data:t.terrainData,x:e.x,y:e.y,level:e.level}),t.terrainData.isChildAvailable(e.x,e.y,i.x,i.y)&&(o(n.loadedTerrain)||(n.loadedTerrain=new y)),i.state=v.LOADING}}}function x(e,t){if(o(t.getTileDataAvailable)){var r=t.getTileDataAvailable(e.x,e.y,e.level);if(o(r))return r}else s("TerrainProvider.getTileDataAvailable","TerrainProviders must now implement the getTileDataAvailable function.");var i=e.parent;return o(i)?o(i.data)&&o(i.data.terrainData)?i.data.terrainData.isChildAvailable(i.x,i.y,e.x,e.y):!1:!0}function P(e){var t=e.cache.tile_waterMaskData;if(!o(t)){var r=e.createTexture2D({pixelFormat:u.LUMINANCE,pixelDatatype:h.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});r.referenceCount=1;var i=e.createSampler({wrapS:p.CLAMP_TO_EDGE,wrapT:p.CLAMP_TO_EDGE,minificationFilter:m.LINEAR,magnificationFilter:d.LINEAR});t={allWaterTexture:r,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function A(e,t){var i=t.waterMaskTexture;o(i)&&(--i.referenceCount,0===i.referenceCount&&i.destroy(),t.waterMaskTexture=void 0);var n=t.terrainData.waterMask;if(o(n)){var a,s=P(e),l=n.length;if(1===l){if(0===n[0])return;a=s.allWaterTexture}else{var c=Math.sqrt(l);a=e.createTexture2D({pixelFormat:u.LUMINANCE,pixelDatatype:h.UNSIGNED_BYTE,source:{width:c,height:c,arrayBufferView:n}}),a.referenceCount=0,a.sampler=s.sampler}++a.referenceCount,t.waterMaskTexture=a,r.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}}function M(e){for(var t=e.data,r=e.parent;o(r)&&!o(r.data.terrainData)||r.data.terrainData.wasCreatedByUpsampling();)r=r.parent;if(o(r)&&o(r.data.waterMaskTexture)){t.waterMaskTexture=r.data.waterMaskTexture,++t.waterMaskTexture.referenceCount;var i=r.rectangle,n=e.rectangle,a=n.east-n.west,s=n.north-n.south,l=a/(i.east-i.west),u=s/(i.north-i.south);t.waterMaskTranslationAndScale.x=l*(n.west-i.west)/a,t.waterMaskTranslationAndScale.y=u*(n.south-i.south)/s,t.waterMaskTranslationAndScale.z=l,t.waterMaskTranslationAndScale.w=u}}var D=function(){this.imagery=[],this.southwestCornerCartesian=new t,this.northeastCornerCartesian=new t,this.westNormal=new t,this.southNormal=new t,this.eastNormal=new t,this.northNormal=new t,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new r(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.occludeePointInScaledSpace=new t,this.loadedTerrain=void 0,this.upsampledTerrain=void 0,this.pickBoundingSphere=new e,this.pickTerrain=void 0};a(D.prototype,{eligibleForUnloading:{get:function(){for(var e=this.loadedTerrain,t=o(e)&&(e.state===_.RECEIVING||e.state===_.TRANSFORMING),r=this.upsampledTerrain,i=o(r)&&(r.state===_.RECEIVING||r.state===_.TRANSFORMING),n=!t&&!i,a=this.imagery,s=0,l=a.length;n&&l>s;++s){var u=a[s];n=!o(u.loadingImagery)||u.loadingImagery.state!==f.TRANSITIONING}return n}}});var I=new t,O=new t,R=new t,L=new t;D.prototype.pick=function(e,r,i,n){var a=this.pickTerrain;if(!o(a))return void 0;var s=a.mesh;if(!o(s))return void 0;for(var u=s.vertices,c=s.stride,h=s.indices,d=h.length,m=0;d>m;m+=3){var p=h[m],f=h[m+1],v=h[m+2],g=C(this,r,u,c,p,I),_=C(this,r,u,c,f,O),y=C(this,r,u,c,v,R),w=l.rayTriangle(e,g,_,y,i,L);if(o(w))return t.clone(w,n)}return void 0},D.prototype.freeResources=function(){o(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,o(this.loadedTerrain)&&(this.loadedTerrain.freeResources(),this.loadedTerrain=void 0),o(this.upsampledTerrain)&&(this.upsampledTerrain.freeResources(),this.upsampledTerrain=void 0),o(this.pickTerrain)&&(this.pickTerrain.freeResources(),this.pickTerrain=void 0);var e,t,r=this.imagery;for(e=0,t=r.length;t>e;++e)r[e].freeResources();this.imagery.length=0,this.freeVertexArray()},D.prototype.freeVertexArray=function(){var e;o(this.vertexArray)&&(e=this.vertexArray.indexBuffer,this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&o(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())),o(this.wireframeVertexArray)&&(e=this.wireframeVertexArray.indexBuffer,this.wireframeVertexArray.destroy(),this.wireframeVertexArray=void 0,!e.isDestroyed()&&o(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy()))},D.processStateMachine=function(e,t,r,i){var n=e.data;o(n)||(n=e.data=new D),e.state===v.START&&(w(e,r,i),e.state=v.LOADING),e.state===v.LOADING&&S(e,t,r);for(var a=o(n.vertexArray),s=!o(n.loadedTerrain)&&!o(n.upsampledTerrain),l=o(n.terrainData)&&n.terrainData.wasCreatedByUpsampling(),u=n.imagery,c=0,h=u.length;h>c;++c){var d=u[c];if(o(d.loadingImagery)){if(d.loadingImagery.state===f.PLACEHOLDER){var m=d.loadingImagery.imageryLayer;if(m.imageryProvider.ready){d.freeResources(),u.splice(c,1),m._createTileImagerySkeletons(e,r,c),--c,h=u.length;continue}l=!1}var p=d.processStateMachine(e,t);s=s&&p,a=a&&(p||o(d.readyImagery)),l=l&&o(d.loadingImagery)&&(d.loadingImagery.state===f.FAILED||d.loadingImagery.state===f.INVALID)}else l=!1}e.upsampledFromParent=l,c===h&&(a&&(e.renderable=!0),s&&(e.state=v.DONE)) -};var N=new t,F=new t,B=new t,z=new t,V=new i;return D}),r("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"}),r("Shaders/ReprojectWebMercatorVS",[],function(){"use strict";return"attribute vec4 position;\nuniform vec2 u_textureDimensions;\nuniform float u_northLatitude;\nuniform float u_southLatitude;\nuniform float u_southMercatorYHigh;\nuniform float u_southMercatorYLow;\nuniform float u_oneOverMercatorHeight;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nfloat currentLatitude = mix(u_southLatitude, u_northLatitude, position.y);\nfloat fraction = czm_latitudeToWebMercatorFraction(currentLatitude, u_southMercatorYLow, u_southMercatorYHigh, u_oneOverMercatorHeight);\nv_textureCoordinates = vec2(position.x, fraction);\ngl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\n}\n"}),r("Scene/Imagery",["../Core/defined","../Core/destroyObject","./ImageryState"],function(e,t,r){"use strict";var i=function(t,i,n,o,a){if(this.imageryLayer=t,this.x=i,this.y=n,this.level=o,0!==o){var s=0|i/2,l=0|n/2,u=o-1;this.parent=t.getImageryFromCache(s,l,u)}if(this.state=r.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.credits=void 0,this.referenceCount=0,!e(a)&&t.imageryProvider.ready){var c=t.imageryProvider.tilingScheme;a=c.tileXYToRectangle(i,n,o)}this.rectangle=a};return i.createPlaceholder=function(e){var t=new i(e,0,0,0);return t.addReference(),t.state=r.PLACEHOLDER,t},i.prototype.addReference=function(){++this.referenceCount},i.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(),t(this),0):this.referenceCount},i}),r("Scene/TileImagery",["../Core/defined","./ImageryState"],function(e,t){"use strict";var r=function(e,t){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0};return r.prototype.freeResources=function(){e(this.readyImagery)&&this.readyImagery.releaseReference(),e(this.loadingImagery)&&this.loadingImagery.releaseReference()},r.prototype.processStateMachine=function(r,i){var n=this.loadingImagery,o=n.imageryLayer;if(n.state===t.UNLOADED&&(n.state=t.TRANSITIONING,o._requestImagery(n)),n.state===t.RECEIVED&&(n.state=t.TRANSITIONING,o._createTexture(i,n)),n.state===t.TEXTURE_LOADED&&(n.state=t.TRANSITIONING,o._reprojectTexture(i,n)),n.state===t.READY)return e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(r,this),!0;for(var a=n.parent,s=!1;e(a)&&a.state!==t.READY;)s=s||a.state!==t.FAILED&&a.state!==t.INVALID,a=a.parent;return this.readyImagery!==a&&(e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=a,e(a)&&(a.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(r,this))),s||n.state!==t.FAILED&&n.state!==t.INVALID?!1:!0},r}),r("Scene/ImageryLayer",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/FeatureDetection","../Core/GeographicTilingScheme","../Core/Geometry","../Core/GeometryAttribute","../Core/Math","../Core/PixelFormat","../Core/PrimitiveType","../Core/Rectangle","../Core/TerrainProvider","../Core/TileProviderError","../Renderer/BufferUsage","../Renderer/ClearCommand","../Renderer/DrawCommand","../Renderer/MipmapHint","../Renderer/ShaderSource","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Shaders/ReprojectWebMercatorFS","../Shaders/ReprojectWebMercatorVS","../ThirdParty/when","./Imagery","./ImageryState","./TileImagery"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S,E,b,T,x,P,A,M,D,I,O){"use strict";function R(e,t,r){return JSON.stringify([e,t,r])}function L(t,r,s,l){var c=r.cache.imageryLayer_reproject;if(!a(c)){c=r.cache.imageryLayer_reproject={framebuffer:void 0,vertexArray:void 0,shaderProgram:void 0,renderState:void 0,sampler:void 0,destroy:function(){a(this.framebuffer)&&this.framebuffer.destroy(),a(this.vertexArray)&&this.vertexArray.destroy(),a(this.shaderProgram)&&this.shaderProgram.destroy()}};for(var m=new Array(131072),p=0,v=0;256>v;++v)for(var _=v/255,M=0;256>M;++M){var D=M/255;m[p++]=D,m[p++]=_}var I=new h({attributes:{position:new d({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:m})},indices:g.getRegularGridIndices(256,256),primitiveType:f.TRIANGLES}),O={position:0};c.vertexArray=r.createVertexArrayFromGeometry({geometry:I,attributeLocations:O,bufferUsage:y.STATIC_DRAW});var R=new E({sources:[A]});if(u.isFirefox()){var L=u.firefoxVersion();L[0]>=33&&L[0]<=34&&R.defines.push("DISABLE_CORDIC")}c.shaderProgram=r.createShaderProgram(R,P,O);var N=r.maximumTextureFilterAnisotropy;c.sampler=r.createSampler({wrapS:x.CLAMP_TO_EDGE,wrapT:x.CLAMP_TO_EDGE,minificationFilter:T.LINEAR,magnificationFilter:b.LINEAR,maximumAnisotropy:Math.min(N,o(t._maximumAnisotropy,N))})}s.sampler=c.sampler;var F=s.width,B=s.height;k.textureDimensions.x=F,k.textureDimensions.y=B,k.texture=s,k.northLatitude=l.north,k.southLatitude=l.south;var z=Math.sin(l.south),V=.5*Math.log((1+z)/(1-z));U[0]=V,k.southMercatorYHigh=U[0],k.southMercatorYLow=V-U[0],z=Math.sin(l.north);var W=.5*Math.log((1+z)/(1-z));k.oneOverMercatorHeight=1/(W-V);var G=r.createTexture2D({width:F,height:B,pixelFormat:s.pixelFormat,pixelDatatype:s.pixelDatatype,preMultiplyAlpha:s.preMultiplyAlpha});G.generateMipmap(S.NICEST),a(c.framebuffer)&&c.framebuffer.destroy(),c.framebuffer=r.createFramebuffer({colorTextures:[G]}),c.framebuffer.destroyAttachments=!1;var H=new C({color:i.BLACK,framebuffer:c.framebuffer});H.execute(r),a(c.renderState)&&c.renderState.viewport.width===F&&c.renderState.viewport.height===B||(c.renderState=r.createRenderState({viewport:new e(0,0,F,B)}));var q=new w({framebuffer:c.framebuffer,shaderProgram:c.shaderProgram,renderState:c.renderState,primitiveType:f.TRIANGLES,vertexArray:c.vertexArray,uniformMap:k});return q.execute(r),G}function N(e,t,r){var i=e._imageryProvider,n=i.tilingScheme,o=n.ellipsoid,a=e._imageryProvider.tilingScheme instanceof c?1:Math.cos(r),s=n.rectangle,l=o.maximumRadius*(s.east-s.west)*a/(i.tileWidth*n.getNumberOfXTilesAtLevel(0)),u=l/t,h=Math.log(u)/Math.log(2),d=Math.round(h);return 0|d}var F=function W(e,t){this._imageryProvider=e,t=o(t,{}),this.alpha=o(t.alpha,o(e.defaultAlpha,1)),this.brightness=o(t.brightness,o(e.defaultBrightness,W.DEFAULT_BRIGHTNESS)),this.contrast=o(t.contrast,o(e.defaultContrast,W.DEFAULT_CONTRAST)),this.hue=o(t.hue,o(e.defaultHue,W.DEFAULT_HUE)),this.saturation=o(t.saturation,o(e.defaultSaturation,W.DEFAULT_SATURATION)),this.gamma=o(t.gamma,o(e.defaultGamma,W.DEFAULT_GAMMA)),this.show=o(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=o(t.rectangle,v.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new O(D.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0};s(F.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),F.DEFAULT_BRIGHTNESS=1,F.DEFAULT_CONTRAST=1,F.DEFAULT_HUE=0,F.DEFAULT_SATURATION=1,F.DEFAULT_GAMMA=1,F.prototype.isBaseLayer=function(){return this._isBaseLayer},F.prototype.isDestroyed=function(){return!1},F.prototype.destroy=function(){return l(this)};var B=new v,z=new v,V=new v;F.prototype._createTileImagerySkeletons=function(e,t,i){var n=e.data;if(a(this._minimumTerrainLevel)&&e.levelthis._maximumTerrainLevel)return!1;var o=this._imageryProvider;if(a(i)||(i=n.imagery.length),!o.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),n.imagery.splice(i,0,this._skeletonPlaceholder),!0;var s=v.intersectWith(o.rectangle,this._rectangle,B),l=v.intersectWith(e.rectangle,s,z);if(l.east<=l.west||l.north<=l.south){if(!this.isBaseLayer())return!1;var u=s,c=e.rectangle;c.south>=u.north?l.north=l.south=u.north:c.north<=u.south&&(l.north=l.south=u.south),c.west>=u.east?l.west=l.east=u.east:c.east<=u.west&&(l.west=l.east=u.west)}var h=0;l.south>0?h=l.south:l.north<0&&(h=l.north);var d=1,m=d*t.getLevelMaximumGeometricError(e.level),p=N(this,m,h);p=Math.max(0,p);var f=o.maximumLevel;if(p>f&&(p=f),a(o.minimumLevel)){var g=o.minimumLevel;g>p&&(p=g)}var _=o.tilingScheme,y=_.positionToTileXY(v.northwest(l),p),C=_.positionToTileXY(v.southeast(l),p),w=(e.rectangle.north-e.rectangle.south)/512,S=(e.rectangle.east-e.rectangle.west)/512,E=_.tileXYToRectangle(y.x,y.y,p);Math.abs(E.south-e.rectangle.north)y.y&&--C.y,Math.abs(b.west-e.rectangle.east)y.x&&--C.x;var T,x,P=e.rectangle,A=_.tileXYToRectangle(y.x,y.y,p),M=v.intersectWith(A,s,V),D=0,I=1;!this.isBaseLayer()&&Math.abs(M.west-e.rectangle.west)>=w&&(D=Math.min(1,(M.west-P.west)/(P.east-P.west))),!this.isBaseLayer()&&Math.abs(M.north-e.rectangle.north)>=S&&(I=Math.max(0,(M.north-P.south)/(P.north-P.south)));for(var R=I,L=y.x;L<=C.x;L++){T=D,A=_.tileXYToRectangle(L,y.y,p),M=v.intersectWith(A,s,V),D=Math.min(1,(M.east-P.west)/(P.east-P.west)),L===C.x&&(this.isBaseLayer()||Math.abs(M.east-e.rectangle.east)1e-5){var n=L(this,e,r,t.rectangle);r.destroy(),t.texture=r=n}if(m.isPowerOfTwo(r.width)&&m.isPowerOfTwo(r.height)){var s=e.cache.imageryLayer_mipmapSampler;if(!a(s)){var l=e.maximumTextureFilterAnisotropy;s=e.cache.imageryLayer_mipmapSampler=e.createSampler({wrapS:x.CLAMP_TO_EDGE,wrapT:x.CLAMP_TO_EDGE,minificationFilter:T.LINEAR_MIPMAP_LINEAR,magnificationFilter:b.LINEAR,maximumAnisotropy:Math.min(l,o(this._maximumAnisotropy,l))})}r.generateMipmap(S.NICEST),r.sampler=s}else{var u=e.cache.imageryLayer_nonMipmapSampler;a(u)||(u=e.cache.imageryLayer_nonMipmapSampler=e.createSampler({wrapS:x.CLAMP_TO_EDGE,wrapT:x.CLAMP_TO_EDGE,minificationFilter:T.LINEAR,magnificationFilter:b.LINEAR})),r.sampler=u}t.state=I.READY},F.prototype.getImageryFromCache=function(e,t,r,i){var n=R(e,t,r),o=this._imageryCache[n];return a(o)||(o=new D(this,e,t,r,i),this._imageryCache[n]=o),o.addReference(),o},F.prototype.removeImageryFromCache=function(e){var t=R(e.x,e.y,e.level);delete this._imageryCache[t]};var k={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},u_northLatitude:function(){return this.northLatitude},u_southLatitude:function(){return this.southLatitude},u_southMercatorYLow:function(){return this.southMercatorYLow},u_southMercatorYHigh:function(){return this.southMercatorYHigh},u_oneOverMercatorHeight:function(){return this.oneOverMercatorHeight},textureDimensions:new t,texture:void 0,northLatitude:0,southLatitude:0,southMercatorYHigh:0,southMercatorYLow:0,oneOverMercatorHeight:0},U=u.supportsTypedArrays()?new Float32Array(1):void 0;return F}),r("Scene/GlobeSurfaceTileProvider",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/FeatureDetection","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Intersect","../Core/Matrix4","../Core/PrimitiveType","../Core/Rectangle","../Core/Visibility","../Core/WebMercatorProjection","../Renderer/BufferUsage","../Renderer/DrawCommand","../Scene/BlendingState","../Scene/DepthFunction","../Scene/Pass","../ThirdParty/when","./GlobeSurfaceTile","./ImageryLayer","./ImageryState","./QuadtreeTileLoadState","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S,E,b,T,x,P,A,M){"use strict";function D(e,t){var r=e.loadingImagery;o(r)||(r=e.readyImagery);var i=t.loadingImagery;return o(i)||(i=t.readyImagery),r.imageryLayer._layerIndex-i.imageryLayer._layerIndex}function I(){var e={u_initialColor:function(){return this.initialColor},u_zoomedOutOceanSpecularIntensity:function(){return this.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.oceanNormalMap},u_lightingFadeDistance:function(){return this.lightingFadeDistance},u_center3D:function(){return this.center3D},u_tileRectangle:function(){return this.tileRectangle},u_modifiedModelView:function(){return this.modifiedModelView},u_dayTextures:function(){return this.dayTextures},u_dayTextureTranslationAndScale:function(){return this.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.dayTextureTexCoordsRectangle},u_dayTextureAlpha:function(){return this.dayTextureAlpha},u_dayTextureBrightness:function(){return this.dayTextureBrightness},u_dayTextureContrast:function(){return this.dayTextureContrast},u_dayTextureHue:function(){return this.dayTextureHue},u_dayTextureSaturation:function(){return this.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.dayTextureOneOverGamma},u_dayIntensity:function(){return this.dayIntensity},u_southAndNorthLatitude:function(){return this.southAndNorthLatitude},u_southMercatorYLowAndHighAndOneOverHeight:function(){return this.southMercatorYLowAndHighAndOneOverHeight},u_waterMask:function(){return this.waterMask},u_waterMaskTranslationAndScale:function(){return this.waterMaskTranslationAndScale},initialColor:new i(0,0,.5,1),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new t(65e5,9e6),center3D:void 0,modifiedModelView:new p,tileRectangle:new i,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayIntensity:0,southAndNorthLatitude:new t,southMercatorYLowAndHighAndOneOverHeight:new r,waterMask:void 0,waterMaskTranslationAndScale:new i};return e}function O(e,t,r){var i=r.data;if(!o(i.wireframeVertexArray)&&!o(i.meshForWireframePromise)&&(i.meshForWireframePromise=i.terrainData.createMesh(t._terrainProvider.tilingScheme,r.x,r.y,r.level),o(i.meshForWireframePromise))){var n=i.vertexArray;b(i.meshForWireframePromise,function(t){i.vertexArray===n&&(i.wireframeVertexArray=R(e,i.vertexArray,t)),i.meshForWireframePromise=void 0})}}function R(e,t,r){var i={indices:r.indices,primitiveType:f.TRIANGLES};h.toWireframe(i);var n=i.indices,o=e.createIndexBuffer(n,y.STATIC_DRAW,d.UNSIGNED_SHORT);return e.createVertexArray(t._attributes,o)}function L(t,n,a,s,l){var u=n.data,c=s.camera.viewMatrix,h=a.maximumTextureImageUnits,d=u.waterMaskTexture,m=t.hasWaterMask&&o(d),g=t.oceanNormalMap,y=m&&o(g);m&&--h,y&&--h;var w=u.center,S=V,b=0,T=0,A=0,D=0,R=0;if(s.mode!==M.SCENE3D){var L=s.mapProjection,N=L.project(v.southwest(n.rectangle),W),F=L.project(v.northeast(n.rectangle),G);if(S.x=N.x,S.y=N.y,S.z=F.x,S.w=F.y,s.mode!==M.MORPHING&&(w=k,w.x=0,w.y=.5*(S.z+S.x),w.z=.5*(S.w+S.y),S.x-=w.y,S.y-=w.z,S.z-=w.y,S.w-=w.z),L instanceof _){b=n.rectangle.south,T=n.rectangle.north;var H=_.geodeticLatitudeToMercatorAngle(b),q=_.geodeticLatitudeToMercatorAngle(T);B[0]=H,A=B[0],D=H-B[0],R=1/(q-H)}}var j=U;j.x=w.x,j.y=w.y,j.z=w.z,j.w=1,p.multiplyByVector(c,j,j),p.setColumn(c,3,j,z);var Y=u.imagery,X=0,Q=Y.length,J=t._renderState,K=t._blendRenderState,$=J,et=t._firstPassInitialColor;do{var tt,rt,it=0;t._drawCommands.length<=t._usedDrawCommands?(tt=new C,tt.owner=n,tt.cull=!1,tt.boundingVolume=new e,rt=I(),t._drawCommands.push(tt),t._uniformMaps.push(rt)):(tt=t._drawCommands[t._usedDrawCommands],rt=t._uniformMaps[t._usedDrawCommands]),tt.owner=n,++t._usedDrawCommands,tt.debugShowBoundingVolume=n===t._debug.boundingSphereTile,i.clone(et,rt.initialColor),rt.oceanNormalMap=g,rt.lightingFadeDistance.x=t.lightingFadeOutDistance,rt.lightingFadeDistance.y=t.lightingFadeInDistance,rt.zoomedOutOceanSpecularIntensity=t.zoomedOutOceanSpecularIntensity,rt.center3D=u.center,i.clone(S,rt.tileRectangle),rt.southAndNorthLatitude.x=b,rt.southAndNorthLatitude.y=T,rt.southMercatorYLowAndHighAndOneOverHeight.x=D,rt.southMercatorYLowAndHighAndOneOverHeight.y=A,rt.southMercatorYLowAndHighAndOneOverHeight.z=R,p.clone(z,rt.modifiedModelView);for(var nt=!1,ot=!1,at=!1,st=!1,lt=!1,ut=!1;h>it&&Q>X;){var ct=Y[X],ht=ct.readyImagery;if(++X,o(ht)&&ht.state===P.READY&&0!==ht.imageryLayer.alpha){var dt=ht.imageryLayer;if(o(ct.textureTranslationAndScale)||(ct.textureTranslationAndScale=dt._calculateTextureTranslationAndScale(n,ct)),rt.dayTextures[it]=ht.texture,rt.dayTextureTranslationAndScale[it]=ct.textureTranslationAndScale,rt.dayTextureTexCoordsRectangle[it]=ct.textureCoordinateRectangle,rt.dayTextureAlpha[it]=dt.alpha,ut=ut||1!==rt.dayTextureAlpha[it],rt.dayTextureBrightness[it]=dt.brightness,nt=nt||rt.dayTextureBrightness[it]!==x.DEFAULT_BRIGHTNESS,rt.dayTextureContrast[it]=dt.contrast,ot=ot||rt.dayTextureContrast[it]!==x.DEFAULT_CONTRAST,rt.dayTextureHue[it]=dt.hue,at=at||rt.dayTextureHue[it]!==x.DEFAULT_HUE,rt.dayTextureSaturation[it]=dt.saturation,st=st||rt.dayTextureSaturation[it]!==x.DEFAULT_SATURATION,rt.dayTextureOneOverGamma[it]=1/dt.gamma,lt=lt||rt.dayTextureOneOverGamma[it]!==1/x.DEFAULT_GAMMA,o(ht.credits))for(var mt=s.creditDisplay,pt=ht.credits,ft=0,vt=pt.length;vt>ft;++ft)mt.addCredit(pt[ft]);++it}}rt.dayTextures.length=it,rt.waterMask=d,i.clone(u.waterMaskTranslationAndScale,rt.waterMaskTranslationAndScale),tt.shaderProgram=t._surfaceShaderSet.getShaderProgram(a,it,nt,ot,at,st,lt,ut,m,y),tt.renderState=$,tt.primitiveType=f.TRIANGLES,tt.vertexArray=u.vertexArray,tt.uniformMap=rt,tt.pass=E.OPAQUE,t._debug.wireframe&&(O(a,t,n),o(u.wireframeVertexArray)&&(tt.vertexArray=u.wireframeVertexArray,tt.primitiveType=f.LINES));var gt=tt.boundingVolume;s.mode!==M.SCENE3D?(e.fromRectangleWithHeights2D(n.rectangle,s.mapProjection,u.minimumHeight,u.maximumHeight,gt),r.fromElements(gt.center.z,gt.center.x,gt.center.y,gt.center),s.mode===M.MORPHING&&(gt=e.union(u.boundingSphere3D,gt,gt))):e.clone(u.boundingSphere3D,gt),l.push(tt),$=K,et=Z}while(Q>X)}var N=function Q(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,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._errorEvent=new u,this._imageryLayers.layerAdded.addEventListener(Q.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(Q.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(Q.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(Q.prototype._onLayerShownOrHidden,this),this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new n(0,0,.5,1)};a(N.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=i.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,o(this._quadtree)&&this._quadtree.invalidateAllTiles())}}}),N.prototype.beginUpdate=function(e,t){this._imageryLayers._update(),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(D)}));var r,i,n=this._tilesToRenderByTextureCount;for(r=0,i=n.length;i>r;++r){var a=n[r];o(a)&&(a.length=0)}this._usedDrawCommands=0;var s=t.creditDisplay;this._terrainProvider.ready&&o(this._terrainProvider.credit)&&s.addCredit(this._terrainProvider.credit);var l=this._imageryLayers;for(r=0,i=l.length;i>r;++r){var u=l.get(r).imageryProvider;u.ready&&o(u.credit)&&s.addCredit(u.credit)}},N.prototype.endUpdate=function(e,t,r){o(this._renderState)||(this._renderState=e.createRenderState({cull:{enabled:!0},depthTest:{enabled:!0}})),o(this._blendRenderState)||(this._blendRenderState=e.createRenderState({cull:{enabled:!0},depthTest:{enabled:!0,func:S.LESS_OR_EQUAL},blending:w.ALPHA_BLEND})),this._renderState.depthTest.enabled=t.mode===M.SCENE3D||t.mode===M.COLUMBUS_VIEW,this._blendRenderState.depthTest.enabled=this._renderState.depthTest.enabled;for(var i=this._tilesToRenderByTextureCount,n=0,a=i.length;a>n;++n){var s=i[n];if(o(s))for(var l=0,u=s.length;u>l;++l)L(this,s[l],e,t,r)}},N.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},N.prototype.loadTile=function(e,t,r){T.processStateMachine(r,e,this._terrainProvider,this._imageryLayers)};var F=new e;N.prototype.computeTileVisibility=function(t,i,n){var a=t.data,s=i.cullingVolume,l=a.boundingSphere3D;i.mode!==M.SCENE3D&&(l=F,e.fromRectangleWithHeights2D(t.rectangle,i.mapProjection,a.minimumHeight,a.maximumHeight,l),r.fromElements(l.center.z,l.center.x,l.center.y,l.center),i.mode===M.MORPHING&&(l=e.union(a.boundingSphere3D,l,l)));var u=s.computeVisibility(l);if(u===m.OUTSIDE)return g.NONE;if(i.mode===M.SCENE3D){var c=a.occludeePointInScaledSpace;return o(c)?n.ellipsoid.isScaledSpacePointVisible(c)?u:g.NONE:u}return u};var B=c.supportsTypedArrays()?new Float32Array(1):void 0,z=new p,V=new i,k=new r,U=new i,W=new r,G=new r;N.prototype.showTileThisFrame=function(e){for(var t=0,r=e.data.imagery,i=0,n=r.length;n>i;++i){var a=r[i];o(a.readyImagery)&&0!==a.readyImagery.imageryLayer.alpha&&++t}var s=this._tilesToRenderByTextureCount[t];o(s)||(s=[],this._tilesToRenderByTextureCount[t]=s),s.push(e);var l=this._debug;++l.tilesRendered,l.texturesRendered+=t};var H=new r,q=new r,j=new r(0,-1,0),Y=new r(0,0,-1),X=new r;N.prototype.computeDistanceToTile=function(e,t){var i=e.data,n=i.southwestCornerCartesian,o=i.northeastCornerCartesian,a=i.westNormal,s=i.southNormal,l=i.eastNormal,u=i.northNormal,c=i.maximumHeight;t.mode!==M.SCENE3D&&(n=t.mapProjection.project(v.southwest(e.rectangle),H),n.z=n.y,n.y=n.x,n.x=0,o=t.mapProjection.project(v.northeast(e.rectangle),q),o.z=o.y,o.y=o.x,o.x=0,a=j,l=r.UNIT_Y,s=Y,u=r.UNIT_Z,c=0);var h,d=t.camera.positionWC,m=t.camera.positionCartographic,p=r.subtract(d,n,X),f=r.dot(p,a),g=r.dot(p,s),_=r.subtract(d,o,X),y=r.dot(_,l),C=r.dot(_,u);h=t.mode===M.SCENE3D?m.height:d.x;var w=h-c,S=0;return f>0?S+=f*f:y>0&&(S+=y*y),g>0?S+=g*g:C>0&&(S+=C*C),w>0&&(S+=w*w),Math.sqrt(S)},N.prototype.isDestroyed=function(){return!1},N.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),s(this)},N.prototype._onLayerAdded=function(e){if(e.show){var t=this._terrainProvider;this._quadtree.forEachLoadedTile(function(r){e._createTileImagerySkeletons(r,t)&&(r.state=A.LOADING)}),this._layerOrderChanged=!0}},N.prototype._onLayerRemoved=function(e){this._quadtree.forEachLoadedTile(function(t){for(var r=t.data.imagery,i=-1,n=0,a=0,s=r.length;s>a;++a){var l=r[a],u=l.loadingImagery;if(o(u)||(u=l.readyImagery),u.imageryLayer===e)-1===i&&(i=a),l.freeResources(),++n;else if(-1!==i)break}-1!==i&&r.splice(i,n)})},N.prototype._onLayerMoved=function(){this._layerOrderChanged=!0},N.prototype._onLayerShownOrHidden=function(e,t,r){r?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var Z=new i(0,0,0,0);return N}),r("Scene/ImageryLayerCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/Math","../Core/Rectangle","../ThirdParty/when","./ImageryLayer"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t){var r=e.indexOf(t);return r}function h(e,t,r){var i=e._layers;if(t=a.clamp(t,0,i.length-1),r=a.clamp(r,0,i.length-1),t!==r){var n=i[t];i[t]=i[r],i[r]=n,e._update(),e.layerMoved.raiseEvent(n,r,t)}}var d=function(){this._layers=[],this.layerAdded=new o,this.layerRemoved=new o,this.layerMoved=new o,this.layerShownOrHidden=new o};return r(d.prototype,{length:{get:function(){return this._layers.length}}}),d.prototype.add=function(e,r){var i=t(r);i?this._layers.splice(r,0,e):(r=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,r)},d.prototype.addImageryProvider=function(e,t){var r=new u(e);return this.add(r,t),r},d.prototype.remove=function(t,r){r=e(r,!0);var i=this._layers.indexOf(t);return-1!==i?(this._layers.splice(i,1),this._update(),this.layerRemoved.raiseEvent(t,i),r&&t.destroy(),!0):!1},d.prototype.removeAll=function(t){t=e(t,!0);for(var r=this._layers,i=0,n=r.length;n>i;i++){var o=r[i];this.layerRemoved.raiseEvent(o,i),t&&o.destroy()}this._layers=[]},d.prototype.contains=function(e){return-1!==this.indexOf(e)},d.prototype.indexOf=function(e){return this._layers.indexOf(e)},d.prototype.get=function(e){return this._layers[e]},d.prototype.raise=function(e){var t=c(this._layers,e);h(this,t,t+1)},d.prototype.lower=function(e){var t=c(this._layers,e);h(this,t,t-1)},d.prototype.raiseToTop=function(e){var t=c(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))},d.prototype.lowerToBottom=function(e){var t=c(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))},d.prototype.pickImageryLayerFeatures=function(e,r){var i=r.globe.pick(e,r);if(!t(i))return void 0;var n=r.globe.ellipsoid.cartesianToCartographic(i),o=r.globe._surface._tilesToRender;o.length;for(var a,u=0;!t(a)&&u=0;--m){var p=h[m],f=p.readyImagery;if(t(f)){var v=f.imageryLayer.imageryProvider;if(t(v.pickFeatures)){var g=v.pickFeatures(f.x,f.y,f.level,n.longitude,n.latitude);t(g)&&d.push(g)}}}return 0===d.length?void 0:l.all(d,function(e){for(var r=[],i=0;i0)for(var a=0;ao;++o)r=n[o],r._layerIndex=o,r.show?(r._isBaseLayer=i,i=!1):r._isBaseLayer=!1,r.show!==r._show&&(t(r._show)&&(t(e)||(e=[]),e.push(r)),r._show=r.show);if(t(e))for(o=0,a=e.length;a>o;++o)r=e[o],this.layerShownOrHidden.raiseEvent(r,r._layerIndex,r.show)},d}),r("Scene/QuadtreeOccluders",["../Core/Cartesian3","../Core/defineProperties","../Core/EllipsoidalOccluder"],function(e,t,r){"use strict";var i=function(t){this._ellipsoid=new r(t.ellipsoid,e.ZERO)};return t(i.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),i}),r("Scene/QuadtreeTile",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","./QuadtreeTileLoadState"],function(e,t,r,i){"use strict";var n=function(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._children=void 0,this._replacementPrevious=void 0,this._replacementNext=void 0,this._distance=0,this.state=i.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0};return n.createLevelZeroTiles=function(t){if(!e(t))throw new r("tilingScheme is required.");for(var i=t.getNumberOfXTilesAtLevel(0),o=t.getNumberOfYTilesAtLevel(0),a=new Array(i*o),s=0,l=0;o>l;++l)for(var u=0;i>u;++u)a[s++]=new n({tilingScheme:t,x:u,y:l,level:0});return a},t(n.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(){if(!e(this._children)){var t=this.tilingScheme,r=this.level+1,i=2*this.x,o=2*this.y;this._children=[new n({tilingScheme:t,x:i,y:o,level:r,parent:this}),new n({tilingScheme:t,x:i+1,y:o,level:r,parent:this}),new n({tilingScheme:t,x:i,y:o+1,level:r,parent:this}),new n({tilingScheme:t,x:i+1,y:o+1,level:r,parent:this})]}return this._children}},needsLoading:{get:function(){return this.statet;++t)this._children[t].freeResources();this._children=void 0}},n}),r("Scene/TileReplacementQueue",["../Core/defined"],function(e){"use strict";function t(e,t){var r=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:r.replacementNext=i,t===e.tail?e.tail=r:i.replacementPrevious=r,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}var r=function(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0};return r.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},r.prototype.trimTiles=function(r){for(var i=this.tail,n=!0;n&&e(this._lastBeforeStartOfFrame)&&this.count>r&&e(i);){n=i!==this._lastBeforeStartOfFrame; -var o=i.replacementPrevious;i.eligibleForUnloading&&(i.freeResources(),t(this,i)),i=o}},r.prototype.markTileRendered=function(r){var i=this.head;return i===r?(r===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=r.replacementNext),void 0):(++this.count,e(i)?((e(r.replacementPrevious)||e(r.replacementNext))&&t(this,r),r.replacementPrevious=void 0,r.replacementNext=i,i.replacementPrevious=r,this.head=r,void 0):(r.replacementPrevious=void 0,r.replacementNext=void 0,this.head=r,this.tail=r,void 0))},r}),r("Scene/QuadtreePrimitive",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/getTimestamp","../Core/Queue","../Core/Visibility","./QuadtreeOccluders","./QuadtreeTile","./QuadtreeTileLoadState","./SceneMode","./TileReplacementQueue"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e,r,i){var n=e._debug;if(!n.suspendLodUpdate){var o,s,u=e._tilesToRender;u.length=0;var c=e._tileTraversalQueue;if(c.clear(),n.maxDepth=0,n.tilesVisited=0,n.tilesCulled=0,n.tilesRendered=0,n.tilesWaitingForChildren=0,e._tileLoadQueue.length=0,e._tileReplacementQueue.markStartOfRenderFrame(),!t(e._levelZeroTiles)){if(!e._tileProvider.ready)return;var h=e._tileProvider.tilingScheme;e._levelZeroTiles=l.createLevelZeroTiles(h)}e._occluders.ellipsoid.cameraPosition=i.camera.positionWC;var d,p=e._tileProvider,_=e._occluders,y=e._levelZeroTiles;for(o=0,s=y.length;s>o;++o)d=y[o],e._tileReplacementQueue.markTileRendered(d),d.needsLoading&&g(e,d),d.renderable&&p.computeTileVisibility(d,i,_)!==a.NONE?c.enqueue(d):(++n.tilesCulled,d.renderable||++n.tilesWaitingForChildren);for(;t(d=c.dequeue());)if(++n.tilesVisited,e._tileReplacementQueue.markTileRendered(d),d.level>n.maxDepth&&(n.maxDepth=d.level),m(e,r,i,d)o;++o)p.computeTileVisibility(C[o],i,_)!==a.NONE?c.enqueue(C[o]):++n.tilesCulled}else++n.tilesWaitingForChildren,f(e,d);n.enableDebugOutput&&(n.tilesVisited!==n.lastTilesVisited||n.tilesRendered!==n.lastTilesRendered||n.tilesCulled!==n.lastTilesCulled||n.maxDepth!==n.lastMaxDepth||n.tilesWaitingForChildren!==n.lastTilesWaitingForChildren)&&(console.log("Visited "+n.tilesVisited+", Rendered: "+n.tilesRendered+", Culled: "+n.tilesCulled+", Max Depth: "+n.maxDepth+", Waiting for children: "+n.tilesWaitingForChildren),n.lastTilesVisited=n.tilesVisited,n.lastTilesRendered=n.tilesRendered,n.lastTilesCulled=n.tilesCulled,n.lastMaxDepth=n.maxDepth,n.lastTilesWaitingForChildren=n.tilesWaitingForChildren)}}function m(e,t,r,i){if(r.mode===c.SCENE2D)return p(e,t,r,i);var n=e._tileProvider.getLevelMaximumGeometricError(i.level),o=e._tileProvider.computeDistanceToTile(i,r);i._distance=o;var a=t.drawingBufferHeight,s=r.camera,l=s.frustum,u=l.fovy;return n*a/(2*o*Math.tan(.5*u))}function p(e,t,r,i){var n=r.camera,o=n.frustum,a=t.drawingBufferWidth,s=t.drawingBufferHeight,l=e._tileProvider.getLevelMaximumGeometricError(i.level),u=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,s);return l/u}function f(e,t){e._tilesToRender.push(t),++e._debug.tilesRendered}function v(e,t){for(var r=!0,i=!0,n=t.children,o=0,a=n.length;a>o;++o){var s=n[o];e._tileReplacementQueue.markTileRendered(s),i=i&&s.upsampledFromParent,r=r&&s.renderable,s.needsLoading&&g(e,s)}return r||++e._debug.tilesWaitingForChildren,r&&!i}function g(e,t){e._tileLoadQueue.push(t)}function _(e,t,r){var i=e._tileLoadQueue,o=e._tileProvider;if(0!==i.length){r.passes.pick||e._tileReplacementQueue.trimTiles(e.tileCacheSize);for(var a=n(),s=e._loadQueueTimeSlice,l=a+s,u=i.length-1,c=u;c>=0;--c){var h=i[c];if(e._tileReplacementQueue.markTileRendered(h),o.loadTile(t,r,h),n()>=l)break}}}function y(e,t){return e._distance-t._distance}function C(e,t,r,i){var n=e._tileProvider,o=e._tilesToRender;o.sort(y);for(var a=0,s=o.length;s>a;++a)n.showTileThisFrame(o[a],t,r,i)}var w=function(t){this._tileProvider=t.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 r=this._tileProvider.tilingScheme,i=r.ellipsoid;this._tilesToRender=[],this._tileTraversalQueue=new o,this._tileLoadQueue=[],this._tileReplacementQueue=new h,this._levelZeroTiles=void 0,this._levelZeroTilesReady=!1,this._loadQueueTimeSlice=5,this.maximumScreenSpaceError=e(t.maximumScreenSpaceError,2),this.tileCacheSize=e(t.tileCacheSize,100),this._occluders=new s({ellipsoid:i})};return r(w.prototype,{tileProvider:{get:function(){return this._tileProvider}}}),w.prototype.invalidateAllTiles=function(){var e=this._tileReplacementQueue;e.head=void 0,e.tail=void 0,e.count=0;var r=this._levelZeroTiles;if(t(r))for(var i=0;ir;++r)e(t[r])},w.prototype.update=function(e,t,r){this._tileProvider.beginUpdate(e,t,r),d(this,e,t),_(this,e,t),C(this,e,t,r),this._tileProvider.endUpdate(e,t,r)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()},w}),r("Scene/Globe",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/EllipsoidTerrainProvider","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/Intersect","../Core/IntersectionTests","../Core/loadImage","../Core/Math","../Core/Matrix4","../Core/Occluder","../Core/PrimitiveType","../Core/Ray","../Core/Rectangle","../Core/Transforms","../Renderer/BufferUsage","../Renderer/ClearCommand","../Renderer/DrawCommand","../Renderer/ShaderSource","../Shaders/GlobeFS","../Shaders/GlobeFSDepth","../Shaders/GlobeFSPole","../Shaders/GlobeVS","../Shaders/GlobeVSDepth","../Shaders/GlobeVSPole","../ThirdParty/when","./DepthFunction","./GlobeSurfaceShaderSet","./GlobeSurfaceTileProvider","./ImageryLayerCollection","./Pass","./QuadtreePrimitive","./SceneMode","./terrainAttributeLocations"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S,E,b,T,x,P,A,M,D,I,O,R,L,N,F,B,z,V,k,U,W,G,H,q,j,Y){"use strict";function X(e){return function(r,i){var n=t.distanceSquaredTo(r.pickBoundingSphere,e),o=t.distanceSquaredTo(i.pickBoundingSphere,e);return n-o}}function Z(e,t){var r=e._ellipsoid.radii,i=t.camera.positionWC,o=n.multiplyComponents(e._ellipsoid.oneOverRadii,i,at),a=n.magnitude(o),s=n.normalize(o,st),l=n.normalize(n.cross(n.UNIT_Z,o,lt),lt),u=n.normalize(n.cross(s,l,ut),ut),c=Math.sqrt(n.magnitudeSquared(o)-1),h=n.multiplyByScalar(s,1/a,at),d=c/a,m=n.multiplyByScalar(l,d,st),p=n.multiplyByScalar(u,d,lt),f=n.add(h,p,ut);n.subtract(f,m,f),n.multiplyComponents(r,f,f),n.pack(f,ot,0);var v=n.subtract(h,p,ut);n.subtract(v,m,v),n.multiplyComponents(r,v,v),n.pack(v,ot,3);var g=n.add(h,p,ut);n.add(g,m,g),n.multiplyComponents(r,g,g),n.pack(g,ot,6);var _=n.subtract(h,p,ut);return n.add(_,m,_),n.multiplyComponents(r,_,_),n.pack(_,ot,9),ot}function Q(t,r,i,a,s,l){var u,c=t._ellipsoid.cartographicToCartesian(new o(0,a)),h=t._ellipsoid.cartographicToCartesian(new o(Math.PI,a)),d=.5*n.magnitude(n.subtract(c,h,ct),ct),m=t._ellipsoid.cartographicToCartesian(new o(0,i)),p=r.camera.direction;u=1-n.dot(dt,p)-S.PI_OVER_TWO&&(h=new P(-Math.PI,-S.PI_OVER_TWO,Math.PI,o.south),d=t.fromRectangle3D(h,e._ellipsoid),m=i.cullingVolume.computeVisibility(d)===y.OUTSIDE,p=b.computeOccludeePointFromRectangle(h,e._ellipsoid),f=p&&!x.isPointVisible(p)||!x.isBoundingSphereVisible(d),e._drawSouthPole=!m&&!f,e._drawSouthPole&&(C=Q(e,i,h.south,h.north+T,l,w),ft[0]=C.x,ft[1]=C.y,ft[2]=C.x+C.width,ft[3]=C.y,ft[4]=C.x+C.width,ft[5]=C.y+C.height,ft[6]=C.x,ft[7]=C.y+C.height,u(e._southPoleCommand.vertexArray)?e._southPoleCommand.vertexArray.getAttribute(0).vertexBuffer.copyFromArrayView(ft):(e._southPoleCommand.boundingVolume=t.fromRectangle3D(h,e._ellipsoid),v=new g({attributes:{position:new _({componentDatatype:s.FLOAT,componentsPerAttribute:2,values:ft})}}),e._southPoleCommand.vertexArray=r.createVertexArrayFromGeometry({geometry:v,attributeLocations:{position:0},bufferUsage:M.STREAM_DRAW}))));var A=0,D=e._imageryLayerCollection.length>0?e._imageryLayerCollection.get(0):void 0;u(D)&&u(D.imageryProvider)&&u(D.imageryProvider.getPoleIntensity)&&(A=D.imageryProvider.getPoleIntensity());var I={u_dayIntensity:function(){return A}};if(!u(e._northPoleCommand.uniformMap)){var O=a(I,{u_color:function(){return e.northPoleColor}});e._northPoleCommand.uniformMap=a(O,e._drawUniforms)}if(!u(e._southPoleCommand.uniformMap)){var R=a(I,{u_color:function(){return e.southPoleColor}});e._southPoleCommand.uniformMap=a(R,e._drawUniforms)}}}var K=function(e){e=l(e,m.WGS84);var o=new p({ellipsoid:e}),a=new G;this._ellipsoid=e,this._imageryLayerCollection=a,this._surfaceShaderSet=new U,this._surface=new q({tileProvider:new W({terrainProvider:o,imageryLayers:a,surfaceShaderSet:this._surfaceShaderSet})}),this._occluder=new b(new t(n.ZERO,e.minimumRadius),n.ZERO),this._rsColor=void 0,this._rsColorWithoutDepthTest=void 0,this._clearDepthCommand=new D({depth:1,stencil:0,owner:this}),this._depthCommand=new I({boundingVolume:new t(n.ZERO,e.maximumRadius),pass:H.OPAQUE,owner:this}),this._northPoleCommand=new I({pass:H.OPAQUE,owner:this}),this._southPoleCommand=new I({pass:H.OPAQUE,owner:this}),this._drawNorthPole=!1,this._drawSouthPole=!1,this._mode=j.SCENE3D,this.terrainProvider=o,this.northPoleColor=new n(2/255,6/255,18/255),this.southPoleColor=new n(1,1,1),this.show=!0,this.oceanNormalMapUrl=r("Assets/Textures/waterNormalsSmall.jpg"),this._oceanNormalMapUrl=void 0,this.depthTestAgainstTerrain=!1,this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.enableLighting=!1,this._enableLighting=!1,this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.showWaterEffect=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=.5,this._hasVertexNormals=!1,this._lightingFadeDistance=new i(this.lightingFadeOutDistance,this.lightingFadeInDistance);var s=this;this._drawUniforms={u_zoomedOutOceanSpecularIntensity:function(){return s._zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return s._oceanNormalMap},u_lightingFadeDistance:function(){return s._lightingFadeDistance}}};c(K.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}}});var $=[],et={start:0,stop:0};K.prototype.pick=function(e,r,i){var o=r.mode,a=r.mapProjection,s=$;s.length=0;var l,c,h=this._surface._tilesToRender,d=h.length;for(c=0;d>c;++c){l=h[c];var m=l.data;if(u(m)){var p=m.pickBoundingSphere;o!==j.SCENE3D?(t.fromRectangleWithHeights2D(l.rectangle,a,m.minimumHeight,m.maximumHeight,p),n.fromElements(p.center.z,p.center.x,p.center.y,p.center)):t.clone(m.boundingSphere3D,p);var f=C.raySphere(e,p,et);u(f)&&s.push(m)}}s.sort(X(e.origin));var v;for(d=s.length,c=0;d>c&&(v=s[c].pick(e,r,!0,i),!u(v));++c);return v};var tt=new n,rt=new n,it=new o,nt=new x;K.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(u(t)){var r,i,o=t.length;for(i=0;o>i&&(r=t[i],!P.contains(r.rectangle,e));++i);if(!u(r)||!P.contains(r.rectangle,e))return void 0;for(;r.renderable;){var a=r.children;for(o=a.length,i=0;o>i&&(r=a[i],!P.contains(r.rectangle,e));++i);}for(;u(r)&&(!u(r.data)||!u(r.data.pickTerrain));)r=r.parent;if(!u(r))return void 0;var s=this._surface._tileProvider.tilingScheme.ellipsoid,l=s.cartographicToCartesian(e,tt),c=nt;n.normalize(l,c.direction);var h=r.data.pick(c,void 0,!1,rt);return u(h)?s.cartesianToCartographic(h,it).height:void 0}};var ot=f.supportsTypedArrays()?new Float32Array(12):[],at=new n,st=new n,lt=new n,ut=new n,ct=new n,ht=new n,dt=n.negate(n.UNIT_Z,new n),mt=new e,pt=new E,ft=f.supportsTypedArrays()?new Float32Array(8):[];return K.prototype.update=function(e,t,r){if(this.show){var i=e.drawingBufferWidth,n=e.drawingBufferHeight;if(0!==i&&0!==n){var o=t.mode,a=t.mapProjection,l=!1;this._mode===o&&u(this._rsColor)||(l=!0,o===j.SCENE3D||o===j.COLUMBUS_VIEW?(this._rsColor=e.createRenderState({cull:{enabled:!0},depthTest:{enabled:!0}}),this._rsColorWithoutDepthTest=e.createRenderState({cull:{enabled:!0}}),this._depthCommand.renderState=e.createRenderState({cull:{enabled:!0},depthTest:{enabled:!0,func:k.ALWAYS},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}})):(this._rsColor=e.createRenderState({cull:{enabled:!0}}),this._rsColorWithoutDepthTest=e.createRenderState({cull:{enabled:!0}}),this._depthCommand.renderState=e.createRenderState({cull:{enabled:!0}}))),this._mode=o;var c=this._northPoleCommand,h=this._southPoleCommand;c.renderState=this._rsColorWithoutDepthTest,h.renderState=this._rsColorWithoutDepthTest;var d=Z(this,t);if(this._depthCommand.vertexArray)this._depthCommand.vertexArray.getAttribute(0).vertexBuffer.copyFromArrayView(d);else{var m=new g({attributes:{position:new _({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:d})},indices:[0,1,2,2,1,3],primitiveType:T.TRIANGLES});this._depthCommand.vertexArray=e.createVertexArrayFromGeometry({geometry:m,attributeLocations:{position:0},bufferUsage:M.DYNAMIC_DRAW})}u(this._depthCommand.shaderProgram)||(this._depthCommand.shaderProgram=e.createShaderProgram(B,L,{position:0}));var p=this._surface,y=p.tileProvider,C=this.terrainProvider,S=this.showWaterEffect&&C.ready&&C.hasWaterMask;if(S&&this.oceanNormalMapUrl!==this._oceanNormalMapUrl){var E=this.oceanNormalMapUrl;if(this._oceanNormalMapUrl=E,u(E)){var b=this;V(w(E),function(t){E===b.oceanNormalMapUrl&&(b._oceanNormalMap=b._oceanNormalMap&&b._oceanNormalMap.destroy(),b._oceanNormalMap=e.createTexture2D({source:t}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}var x=C.ready&&C.hasVertexNormals,P=this.enableLighting;if(!u(c.shaderProgram)||!u(h.shaderProgram)||l||this._hasVertexNormals!==x||this._enableLighting!==P){var A,D="vec4 getPosition(vec3 position3DWC) { return getPosition3DMode(position3DWC); }",I="vec4 getPosition(vec3 position3DWC) { return getPosition2DMode(position3DWC); }",U="vec4 getPosition(vec3 position3DWC) { return getPositionColumbusViewMode(position3DWC); }",W="vec4 getPosition(vec3 position3DWC) { return getPositionMorphingMode(position3DWC); }";switch(o){case j.SCENE3D:A=D;break;case j.SCENE2D:A=I;break;case j.COLUMBUS_VIEW:A=U;break;case j.MORPHING:A=W}var G,H="float get2DYPositionFraction() { return get2DGeographicYPositionFraction(); }",q="float get2DYPositionFraction() { return get2DMercatorYPositionFraction(); }";G=a instanceof v?H:q;var X=this._surfaceShaderSet,Q=[];if(P&&(x?Q.push("ENABLE_VERTEX_LIGHTING"):Q.push("ENABLE_DAYNIGHT_SHADING")),f.isFirefox()){var K=f.firefoxVersion();K[0]>=33&&K[0]<=34&&Q.push("DISABLE_CORDIC")}X.baseVertexShaderSource=new O({defines:Q,sources:[F,A,G]}),X.baseFragmentShaderSource=new O({defines:Q,sources:[R]}),X.invalidateShaders();var $=e.replaceShaderProgram(c.shaderProgram,z,N,Y);c.shaderProgram=$,h.shaderProgram=$,this._hasVertexNormals=x,this._enableLighting=P}this._occluder.cameraPosition=t.camera.positionWC,J(this,e,t);var et=t.passes;et.render&&(o===j.SCENE3D&&(this._drawNorthPole&&r.push(c),this._drawSouthPole&&r.push(h)),this._zoomedOutOceanSpecularIntensity=o===j.SCENE3D?.5:0,p.maximumScreenSpaceError=this.maximumScreenSpaceError,p.tileCacheSize=this.tileCacheSize,y.terrainProvider=this.terrainProvider,y.lightingFadeOutDistance=this.lightingFadeOutDistance,y.lightingFadeInDistance=this.lightingFadeInDistance,y.zoomedOutOceanSpecularIntensity=this._zoomedOutOceanSpecularIntensity,y.hasWaterMask=S,y.oceanNormalMap=this._oceanNormalMap,p.update(e,t,r),(o===j.SCENE3D||o===j.COLUMBUS_VIEW)&&(this.depthTestAgainstTerrain||(r.push(this._clearDepthCommand),o===j.SCENE3D&&r.push(this._depthCommand)))),et.pick&&r.push(this._depthCommand)}}},K.prototype.isDestroyed=function(){return!1},K.prototype.destroy=function(){return this._northPoleCommand.vertexArray=this._northPoleCommand.vertexArray&&this._northPoleCommand.vertexArray.destroy(),this._southPoleCommand.vertexArray=this._southPoleCommand.vertexArray&&this._southPoleCommand.vertexArray.destroy(),this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._northPoleCommand.shaderProgram=this._northPoleCommand.shaderProgram&&this._northPoleCommand.shaderProgram.destroy(),this._southPoleCommand.shaderProgram=this._northPoleCommand.shaderProgram,this._depthCommand.shaderProgram=this._depthCommand.shaderProgram&&this._depthCommand.shaderProgram.destroy(),this._depthCommand.vertexArray=this._depthCommand.vertexArray&&this._depthCommand.vertexArray.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),h(this)},K}),r("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,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";function p(e,t,i,n){var o=e._imageUrlTemplate;o=o.replace("{x}",t),o=o.replace("{y}",i),o=o.replace("{zoom}",n+1);var a=e._proxy;return r(a)&&(o=a.getURL(o)),o}var f=function v(i){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;o1&&"name"===o?(i=1,r=n):i>2&&"title"===o?(i=2,r=n):i>3&&/name/i.test(n)?(i=3,r=n):i>4&&/title/i.test(n)&&(i=4,r=n)}e(r)&&(this.name=t[r])},t.prototype.configureDescriptionFromProperties=function(t){function r(t){var i='';for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];e(o)&&(i+="object"==typeof o?"":"")}return i+="
"+n+""+r(o)+"
"+n+""+o+"
"}this.description=r(t)},t}),r("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,r,i,n,o,a,s,l,u,c,h,d,m){"use strict";var p=function(t){t=r(t,r.EMPTY_OBJECT);var n=t.textureUrl;i(n)||(n=e("Assets/Textures/moonSmall.jpg")),this.show=r(t.show,!0),this.textureUrl=n,this._ellipsoid=r(t.ellipsoid,a.MOON),this.onlySunLighting=r(t.onlySunLighting,!0),this._ellipsoidPrimitive=new d({radii:this.ellipsoid.radii,material:m.fromType(m.ImageType),_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new s};n(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var f=new l,v=new l,g=new t;return p.prototype.update=function(e,t,r){if(this.show){var n=this._ellipsoidPrimitive;n.material.uniforms.image=this.textureUrl,n.onlySunLighting=this.onlySunLighting;var o=t.time;i(h.computeIcrfToFixedMatrix(o,f))||h.computeTemeToPseudoFixedMatrix(o,f);var a=this._axes.evaluate(o,v);l.transpose(a,a),l.multiply(f,a,a);var s=c.computeMoonPositionInEarthInertialFrame(o,g);l.multiplyByVector(f,s,s),u.fromRotationTranslation(a,s,n.modelMatrix),n.update(e,t,r)}},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),o(this)},p}),r("Scene/NeverTileDiscardPolicy",[],function(){"use strict";var e=function(){};return e.prototype.isReady=function(){return!0},e.prototype.shouldDiscardImage=function(){return!1},e}),r("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"}),r("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"}),r("Scene/OIT",["../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderSource","../Shaders/AdjustTranslucentFS","../Shaders/CompositeOITFS","./BlendEquation","./BlendFunction"],function(e,t,r,i,n,o,a,s,l,u,c,h){"use strict";function d(e){e._opaqueTexture=e._opaqueTexture&&!e._opaqueTexture.isDestroyed()&&e._opaqueTexture.destroy(),e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy(),e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function m(e){e._opaqueFBO=e._opaqueFBO&&!e._opaqueFBO.isDestroyed()&&e._opaqueFBO.destroy(),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 p(e){d(e),m(e)}function f(e,t,r,n){d(e),e._opaqueTexture=t.createTexture2D({width:r,height:n,pixelFormat:i.RGBA,pixelDatatype:o.UNSIGNED_BYTE}),e._accumulationTexture=t.createTexture2D({width:r,height:n,pixelFormat:i.RGBA,pixelDatatype:o.FLOAT}),e._revealageTexture=t.createTexture2D({width:r,height:n,pixelFormat:i.RGBA,pixelDatatype:o.FLOAT}),e._depthTexture=t.createTexture2D({width:r,height:n,pixelFormat:i.DEPTH_COMPONENT,pixelDatatype:o.UNSIGNED_SHORT})}function v(e,t){m(e);var r=WebGLRenderingContext.FRAMEBUFFER_COMPLETE,i=!0;if(e._translucentMRTSupport&&(e._translucentFBO=t.createFramebuffer({colorTextures:[e._accumulationTexture,e._revealageTexture],depthTexture:e._depthTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=t.createFramebuffer({colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1}),(e._translucentFBO.status!==r||e._adjustTranslucentFBO.status!==r)&&(m(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO=t.createFramebuffer({colorTextures:[e._accumulationTexture],depthTexture:e._depthTexture,destroyAttachments:!1}),e._alphaFBO=t.createFramebuffer({colorTextures:[e._revealageTexture],depthTexture:e._depthTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=t.createFramebuffer({colorTextures:[e._accumulationTexture],destroyAttachments:!1}),e._adjustAlphaFBO=t.createFramebuffer({colorTextures:[e._revealageTexture],destroyAttachments:!1});var n=e._translucentFBO.status===r,o=e._alphaFBO.status===r,a=e._adjustTranslucentFBO.status===r,s=e._adjustAlphaFBO.status===r;n&&o&&a&&s||(p(e),e._translucentMultipassSupport=!1,i=!1)}return i&&(e._opaqueFBO=t.createFramebuffer({colorTextures:[e._opaqueTexture],depthTexture:e._depthTexture,destroyAttachments:!1})),i}function g(e,r,i,n){var o=i[n.id];if(!t(o)){var s=a.clone(n);s.depthMask=!1,s.blending=r,o=e.createRenderState(s),i[n.id]=o}return o}function _(e,t,r){return g(t,A,e._translucentRenderStateCache,r)}function y(e,t,r){return g(t,M,e._translucentRenderStateCache,r)}function C(e,t,r){return g(t,D,e._alphaRenderStateCache,r)}function w(e,r,i,n){var o=r.id,a=i[o];if(!t(a)){var s=r._attributeLocations,l=r.fragmentShaderSource.clone();l.sources=l.sources.map(function(e){return e=e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void 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,(-1!==n.indexOf("gl_FragData")?"#extension GL_EXT_draw_buffers : enable \n":"")+"vec4 czm_gl_FragColor;\n"+"bool 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=e.createShaderProgram(r.vertexShaderSource,l,s),i[o]=a}return a}function S(e,t,r){return w(t,r,e._translucentShaderCache,I)}function E(e,t,r){return w(t,r,e._translucentShaderCache,O)}function b(e,t,r){return w(t,r,e._alphaShaderCache,R)}function T(e,r,i,n,o){var a,s,l,u,c=r.context,h=n.framebuffer,d=o.length;n.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(c,n),n.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(c,n);var m=e._opaqueFBO;for(n.framebuffer=e._translucentFBO,u=0;d>u;++u)a=o[u],t(a.oit)&&a.shaderProgram.id===a.oit.shaderProgramId||(a.oit={colorRenderState:y(e,c,a.renderState),alphaRenderState:C(e,c,a.renderState),colorShaderProgram:E(e,c,a.shaderProgram),alphaShaderProgram:b(e,c,a.shaderProgram),shaderProgramId:a.shaderProgram.id}),s=a.oit.colorRenderState,l=a.oit.colorShaderProgram,i(a,r,c,n,s,l,m);for(n.framebuffer=e._alphaFBO,u=0;d>u;++u)a=o[u],s=a.oit.alphaRenderState,l=a.oit.alphaShaderProgram,i(a,r,c,n,s,l,m);n.framebuffer=h}function x(e,r,i,n,o){var a=r.context,s=n.framebuffer,l=o.length;n.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(a,n);var u=e._opaqueFBO;n.framebuffer=e._translucentFBO;for(var c=0;l>c;++c){var h=o[c];t(h.oit)&&h.shaderProgram.id===h.oit.shaderProgramId||(h.oit={translucentRenderState:_(e,a,h.renderState),translucentShaderProgram:S(e,a,h.shaderProgram),shaderProgramId:h.shaderProgram.id});var d=h.oit.translucentRenderState,m=h.oit.translucentShaderProgram;i(h,r,a,n,d,m,u)}n.framebuffer=s}var P=function(t){var r=t.floatingPointTexture&&t.depthTexture;this._translucentMRTSupport=t.drawBuffers&&r,this._translucentMultipassSupport=!this._translucentMRTSupport&&r,this._opaqueTexture=void 0,this._accumulationTexture=void 0,this._depthTexture=void 0,this._opaqueFBO=void 0,this._translucentFBO=void 0,this._alphaFBO=void 0,this._adjustTranslucentFBO=void 0,this._adjustAlphaFBO=void 0,this._opaqueClearCommand=new n({color:new e(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new n({color:new e(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new n({color:new e(0,0,0,0),owner:this}),this._alphaClearCommand=new n({color:new e(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};P.prototype.update=function(e){if(this.isSupported()){var r=e.drawingBufferWidth,i=e.drawingBufferHeight,n=this._opaqueTexture,o=!t(n)||n.width!==r||n.height!==i;if(o&&f(this,e,r,i),t(this._opaqueFBO)&&!o||v(this,e)){var a,c,h=this;t(this._compositeCommand)||(a=new s({sources:[u]}),this._translucentMRTSupport&&a.defines.push("MRT"),c={u_opaque:function(){return h._opaqueTexture},u_accumulation:function(){return h._accumulationTexture},u_revealage:function(){return h._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(a,{renderState:e.createRenderState(),uniformMap:c,owner:this})),t(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(a=new s({defines:["MRT"],sources:[l]}),c={u_bgColor:function(){return h._translucentMRTClearCommand.color},u_depthTexture:function(){return h._depthTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(a,{renderState:e.createRenderState(),uniformMap:c,owner:this})):this._translucentMultipassSupport&&(a=new s({sources:[l]}),c={u_bgColor:function(){return h._translucentMultipassClearCommand.color},u_depthTexture:function(){return h._depthTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(a,{renderState:e.createRenderState(),uniformMap:c,owner:this}),c={u_bgColor:function(){return h._alphaClearCommand.color},u_depthTexture:function(){return h._depthTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(a,{renderState:e.createRenderState(),uniformMap:c,owner:this})))}}};var A={enabled:!0,color:new e(0,0,0,0),equationRgb:c.ADD,equationAlpha:c.ADD,functionSourceRgb:h.ONE,functionDestinationRgb:h.ONE,functionSourceAlpha:h.ZERO,functionDestinationAlpha:h.ONE_MINUS_SOURCE_ALPHA},M={enabled:!0,color:new e(0,0,0,0),equationRgb:c.ADD,equationAlpha:c.ADD,functionSourceRgb:h.ONE,functionDestinationRgb:h.ONE,functionSourceAlpha:h.ONE,functionDestinationAlpha:h.ONE},D={enabled:!0,color:new e(0,0,0,0),equationRgb:c.ADD,equationAlpha:c.ADD,functionSourceRgb:h.ZERO,functionDestinationRgb:h.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:h.ZERO,functionDestinationAlpha:h.ONE_MINUS_SOURCE_ALPHA},I=" 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",O=" 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",R=" float ai = czm_gl_FragColor.a;\n gl_FragColor = vec4(ai);\n";return P.prototype.executeCommands=function(e,t,r,i){return this._translucentMRTSupport?(x(this,e,t,r,i),void 0):(T(this,e,t,r,i),void 0)},P.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},P.prototype.clear=function(t,r,i){var n=r.framebuffer;r.framebuffer=this._opaqueFBO,e.clone(i,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(t,r),r.framebuffer=this._translucentFBO;var o=this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand;o.execute(t,r),this._translucentMultipassSupport&&(r.framebuffer=this._alphaFBO,this._alphaClearCommand.execute(t,r)),r.framebuffer=n},P.prototype.getColorFramebuffer=function(){return this._opaqueFBO},P.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){p(this),t(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),t(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),t(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy());var e,i=this._translucentShaderCache;for(e in i)i.hasOwnProperty(e)&&t(i[e])&&i[e].destroy();this._translucentShaderCache={},i=this._alphaShaderCache;for(e in i)i.hasOwnProperty(e)&&t(i[e])&&i[e].destroy();return this._alphaShaderCache={},r(this)},P}),r("Scene/OpenStreetMapImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Rectangle","../Core/WebMercatorTilingScheme","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,t,i,n){var o=e._url+n+"/"+t+"/"+i+"."+e._fileExtension,a=e._proxy;return r(a)&&(o=a.getURL(o)),o}var c=/\/$/,h=new e("MapQuest, Open Street Map and contributors, CC-BY-SA"),d=function(r){r=t(r,{});var i=t(r.url,"//a.tile.openstreetmap.org/");c.test(i)||(i+="/"),this._url=i,this._fileExtension=t(r.fileExtension,"png"),this._proxy=r.proxy,this._tileDiscardPolicy=r.tileDiscardPolicy,this._tilingScheme=new s,this._tileWidth=256,this._tileHeight=256,this._minimumLevel=t(r.minimumLevel,0),this._maximumLevel=t(r.maximumLevel,18),this._rectangle=t(r.rectangle,this._tilingScheme.rectangle);var l=this._tilingScheme.positionToTileXY(a.southwest(this._rectangle),this._minimumLevel),u=this._tilingScheme.positionToTileXY(a.northeast(this._rectangle),this._minimumLevel),d=(Math.abs(u.x-l.x)+1)*(Math.abs(u.y-l.y)+1);if(d>4)throw new n("The imagery provider's rectangle and minimumLevel indicate that there are "+d+" tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.");this._errorEvent=new o,this._ready=!0;var m=t(r.credit,h);"string"==typeof m&&(m=new e(m)),this._credit=m};return i(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 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 this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),d.prototype.getTileCredits=function(){return void 0},d.prototype.requestImage=function(e,t,r){var i=u(this,e,t,r);return l.loadImage(this,i)},d.prototype.pickFeatures=function(){return void 0},d}),r("Scene/OrthographicFrustum",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,r,i,n,o,a,s){"use strict";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=a.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}var u=function(){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 s,this._orthographicMatrix=new a};n(u.prototype,{projectionMatrix:{get:function(){return l(this),this._orthographicMatrix}}});var c=new t,h=new t,d=new t,m=new t;return u.prototype.computeCullingVolume=function(e,n,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,u=this.right,p=this.left,f=this.near,v=this.far,g=t.cross(n,o,c),_=h;t.multiplyByScalar(n,f,_),t.add(e,_,_);var y=d;t.multiplyByScalar(g,p,y),t.add(_,y,y);var C=a[0];return i(C)||(C=a[0]=new r),C.x=g.x,C.y=g.y,C.z=g.z,C.w=-t.dot(g,y),t.multiplyByScalar(g,u,y),t.add(_,y,y),C=a[1],i(C)||(C=a[1]=new r),C.x=-g.x,C.y=-g.y,C.z=-g.z,C.w=-t.dot(t.negate(g,m),y),t.multiplyByScalar(o,l,y),t.add(_,y,y),C=a[2],i(C)||(C=a[2]=new r),C.x=o.x,C.y=o.y,C.z=o.z,C.w=-t.dot(o,y),t.multiplyByScalar(o,s,y),t.add(_,y,y),C=a[3],i(C)||(C=a[3]=new r),C.x=-o.x,C.y=-o.y,C.z=-o.z,C.w=-t.dot(t.negate(o,m),y),C=a[4],i(C)||(C=a[4]=new r),C.x=n.x,C.y=n.y,C.z=n.z,C.w=-t.dot(n,_),t.multiplyByScalar(n,v,y),t.add(e,y,y),C=a[5],i(C)||(C=a[5]=new r),C.x=-n.x,C.y=-n.y,C.z=-n.z,C.w=-t.dot(t.negate(n,m),y),this._cullingVolume},u.prototype.getPixelSize=function(t,r,n){l(this);var o=this.right-this.left,a=this.top-this.bottom,s=o/t.x,u=a/t.y;return i(n)?(n.x=s,n.y=u,n):new e(s,u)},u.prototype.clone=function(e){return i(e)||(e=new u),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},u.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},u}),r("Widgets/getElement",["../Core/DeveloperError"],function(){"use strict";var e=function(e){if("string"==typeof e){var t=document.getElementById(e);e=t}return e};return e}),r("Scene/PerformanceDisplay",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/getTimestamp","../Widgets/getElement"],function(e,t,r,i,n,o,a){"use strict";var s=e.fromCssColorString("#e52"),l=e.fromCssColorString("#de3"),u=e.fromCssColorString("rgba(40, 40, 40, 0.7)"),c=function(e){e=t(e,t.EMPTY_OBJECT);var i=a(e.container);if(!r(i))throw new n("container is required");this._container=i,this._fpsColor=t(e.fpsColor,s).toCssColorString(),this._frameTimeColor=t(e.frameTimeColor,l).toCssColorString(),this._backgroundColor=t(e.backgroundColor,u).toCssColorString(),this._font=t(e.font,"bold 12px Helvetica,Arial,sans-serif");var o=document.createElement("div"),c=document.createElement("div");this._fpsText=document.createTextNode(""),c.appendChild(this._fpsText),c.style.color=this._fpsColor;var h=document.createElement("div");this._msText=document.createTextNode(""),h.style.color=this._frameTimeColor,h.appendChild(this._msText),o.appendChild(c),o.appendChild(h),o.style["z-index"]=1,o.style["background-color"]=this._backgroundColor,o.style.font=this._font,o.style.padding="7px",o.style["border-radius"]="5px",o.style.border="1px solid #444",this._container.appendChild(o),this._lastFpsSampleTime=void 0,this._frameCount=0,this._time=void 0,this._fps=0,this._frameTime=0};return c.prototype.update=function(){if(!r(this._time))return this._lastFpsSampleTime=o(),this._time=o(),void 0;var e=this._time,t=o();this._time=t;var i=t-e;this._frameCount++;var n=this._fps,a=t-this._lastFpsSampleTime;a>1e3&&(n=0|1e3*this._frameCount/a,this._lastFpsSampleTime=t,this._frameCount=0),n!==this._fps&&(this._fpsText.nodeValue=n+" FPS",this._fps=n),i!==this._frameTime&&(this._msText.nodeValue=i.toFixed(2)+" MS",this._frameTime=i)},c.prototype.destroy=function(){return i(this)},c}),r("Scene/Polygon",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/GeometryInstance","../Core/Math","../Core/PolygonGeometry","./EllipsoidSurfaceAppearance","./Material","./Primitive"],function(e,t,r,i,n,o,a,s,l,u,c,h,d){"use strict";var m=function(i){i=t(i,t.EMPTY_OBJECT),this.ellipsoid=t(i.ellipsoid,a.WGS84),this._ellipsoid=void 0,this.granularity=t(i.granularity,l.RADIANS_PER_DEGREE),this._granularity=void 0,this.height=t(i.height,0),this._height=void 0,this.textureRotationAngle=t(i.textureRotationAngle,0),this._textureRotationAngle=void 0,this.show=t(i.show,!0);var n=h.fromType(h.ColorType,{color:new e(1,1,0,.5)});this.material=t(i.material,n),this.id=i.id,this._id=void 0,this.asynchronous=t(i.asynchronous,!0),this.debugShowBoundingVolume=t(i.debugShowBoundingVolume,!1),this._positions=void 0,this._polygonHierarchy=void 0,this._createPrimitive=!1,this._primitive=void 0,r(i.positions)?this.positions=i.positions:r(i.polygonHierarchy)&&this.configureFromPolygonHierarchy(i.polygonHierarchy)};return i(m.prototype,{positions:{get:function(){return this._positions},set:function(e){this._positions=e,this._polygonHierarchy=void 0,this._createPrimitive=!0}}}),m.prototype.configureFromPolygonHierarchy=function(e){this._positions=void 0,this._polygonHierarchy=e,this._createPrimitive=!0},m.prototype.update=function(e,t,i){if(this.show&&(this._createPrimitive||r(this._primitive))){if(this._createPrimitive||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){if(this._createPrimitive=!1,this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id,this._primitive=this._primitive&&this._primitive.destroy(),!r(this._positions)&&!r(this._polygonHierarchy))return;var n;n=r(this._positions)?new s({geometry:u.fromPositions({positions:this._positions,height:this.height,vertexFormat:c.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity}),id:this.id,pickPrimitive:this}):new s({geometry:new u({polygonHierarchy:this._polygonHierarchy,height:this.height,vertexFormat:c.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity}),id:this.id,pickPrimitive:this}),this._primitive=new d({geometryInstances:n,appearance:new c({aboveGround:this.height>0}),asynchronous:this.asynchronous})}var o=this._primitive;o.debugShowBoundingVolume=this.debugShowBoundingVolume,o.appearance.material=this.material,o.update(e,t,i)}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),n(this)},m}),r("Scene/PrimitiveCollection",["../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError"],function(e,t,r,i,n){"use strict";function o(e,t){return e._primitives.indexOf(t)}var a=function(r){r=t(r,t.EMPTY_OBJECT),this._primitives=[],this._guid=e(),this.show=t(r.show,!0),this.destroyPrimitives=t(r.destroyPrimitives,!0)};return i(a.prototype,{length:{get:function(){return this._primitives.length}}}),a.prototype.add=function(e){var t=e._external=e._external||{},r=t._composites=t._composites||{};return r[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(-1!==t)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1},a.prototype.removeAll=function(){if(this.destroyPrimitives)for(var e=this._primitives,t=e.length,r=0;t>r;++r)e[r].destroy();this._primitives=[]},a.prototype.contains=function(e){return!!(r(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])},a.prototype.raise=function(e){if(r(e)){var t=o(this,e),i=this._primitives;if(t!==i.length-1){var n=i[t];i[t]=i[t+1],i[t+1]=n}}},a.prototype.raiseToTop=function(e){if(r(e)){var t=o(this,e),i=this._primitives;t!==i.length-1&&(i.splice(t,1),i.push(e))}},a.prototype.lower=function(e){if(r(e)){var t=o(this,e),i=this._primitives;if(0!==t){var n=i[t];i[t]=i[t-1],i[t-1]=n}}},a.prototype.lowerToBottom=function(e){if(r(e)){var t=o(this,e),i=this._primitives;0!==t&&(i.splice(t,1),i.unshift(e))}},a.prototype.get=function(e){return this._primitives[e]},a.prototype.update=function(e,t,r){if(this.show)for(var i=this._primitives,n=0;n0}),asynchronous:this.asynchronous})}var o=this._primitive;o.appearance.material=this.material,o.debugShowBoundingVolume=this.debugShowBoundingVolume,o.update(e,t,i)}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),i(this)},m}),r("Scene/SceneTransitioner",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/EasingFunction","../Core/Ellipsoid","../Core/Math","../Core/Matrix4","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","./Camera","./OrthographicFrustum","./PerspectiveFrustum","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new u(e._scene.canvas);var r=function(){e._morphCancelled=!0,t(e)};e._completeMorph=r,e._morphHandler.setInputAction(r,c.LEFT_DOWN),e._morphHandler.setInputAction(r,c.MIDDLE_DOWN),e._morphHandler.setInputAction(r,c.RIGHT_DOWN),e._morphHandler.setInputAction(r,c.WHEEL) -}}function v(e){for(var t=e._currentTweens,r=0;rb&&(E=0);var T=(b-E)*r;if(Tr;++r)n.uniforms[o[r]].alpha=e.alpha}e=t(e,t.EMPTY_OBJECT);var n=e.material,o=[];for(var a in n.uniforms)n.uniforms.hasOwnProperty(a)&&r(n.uniforms[a])&&r(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:i,complete:e.complete,cancel:e.cancel})},c.prototype.addOffsetIncrement=function(e){e=t(e,t.EMPTY_OBJECT);var r=e.material,i=r.uniforms;return this.addProperty({object:i,property:"offset",startValue:i.offset,stopValue:i.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(!r(e))return!1;var t=this._tweens.indexOf(e);return-1!==t?(e.tweenjs.stop(),r(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1},c.prototype.removeAll=function(){for(var e=this._tweens,t=0;te)return 0;var r=25*(1-t);return Math.exp(-r*e)}function b(t){return e.equalsEpsilon(t.startPosition,t.endPosition,d.EPSILON14)}function T(t,r,i,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(r,i),h=t.getButtonReleaseTime(r,i),d=c&&h&&(h.getTime()-c.getTime())/1e3,m=new Date,p=h&&(m.getTime()-h.getTime())/1e3;if(c&&h&&Q>d){var f=E(p,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 v=t.getLastMovement(r,i);if(!o(v)||b(v))return;u.motion.x=.5*(v.endPosition.x-v.startPosition.x),u.motion.y=.5*(v.endPosition.y-v.startPosition.y),u.startPosition=e.clone(v.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)||b(u))return u.active=!1,void 0;if(!t.isButtonDown(r,i)){var g=t.getStartMousePosition(r,i);a(s,g,u)}}else u.active=!1}function x(e,t,r,i,n,a){if(o(r)){var s=e._aggregator;c(r)||(J[0]=r,r=J);for(var l=r.length,u=0;l>u;++u){var h=r[u],d=o(h.eventType)?h.eventType:h,m=h.modifier,p=s.isMoving(d,m)&&s.getMovement(d,m),f=s.getStartMousePosition(d,m);e.enableInputs&&t&&(p?i(e,f,p):1>n&&T(s,d,m,n,i,e,a))}}}function P(e,t,r,i,n,a){var s=1;o(a)&&(s=d.clamp(Math.abs(a),.25,1));var l=e.minimumZoomDistance*s,u=e.maximumZoomDistance,c=n-l,h=i*c;h=d.clamp(h,e._minimumZoomRate,e._maximumZoomRate);var m=r.endPosition.y-r.startPosition.y,p=m/e._scene.canvas.clientHeight;p=Math.min(p,e.maximumMovementRatio);var f=h*p;f>0&&Math.abs(n-l)<1||0>f&&Math.abs(n-u)<1||(l>n-f?f=n-l-1:n-f>u&&(f=n-u),e._scene.camera.zoomIn(f))}function A(e,r,i){var n=e._scene,o=n.camera,a=o.getPickRay(i.startPosition,K).origin,s=o.getPickRay(i.endPosition,$).origin,l=o.position,u=t.subtract(a,l,et),c=t.subtract(s,l,tt),h=t.subtract(u,c,et),d=t.magnitude(h);d>0&&(t.normalize(h,h),o.move(h,d))}function M(e,t,r){o(r.distance)&&(r=r.distance);var i=e._scene,n=i.camera;P(e,t,r,e._zoomFactor,n.getMagnitude())}function D(t,r,i){if(o(i.angleAndHeight))return I(t,r,i.angleAndHeight),void 0;var n=t._scene,a=n.camera,s=n.canvas,l=s.clientWidth,u=s.clientHeight,c=rt;c.x=2/l*i.startPosition.x-1,c.y=2/u*(u-i.startPosition.y)-1,c=e.normalize(c,c);var h=it;h.x=2/l*i.endPosition.x-1,h.y=2/u*(u-i.endPosition.y)-1,h=e.normalize(h,h);var m=d.acosClamped(c.x);c.y<0&&(m=d.TWO_PI-m);var p=d.acosClamped(h.x);h.y<0&&(p=d.TWO_PI-p);var f=p-m;a.twistRight(f)}function I(e,t,r){var i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),is.position.z){var g=l.y;l.y=c.y,c.y=g}var _=f.fromPointNormal(m,p,ct);h=s.getPickRay(l,nt);var y=u.rayPlane(h,_,at),C=s.getPickRay(c,ot),w=u.rayPlane(C,_,st);if(!o(y)||!o(w))return r._looking=!0,j(r,i,n),e.clone(i,r._translateMousePosition),void 0;var S=t.subtract(y,w,lt),E=S.x;S.x=S.y,S.y=S.z,S.z=E;var b=t.magnitude(S);b>d.EPSILON6&&(t.normalize(S,S),s.move(S,b))}function L(t,r,i){if(o(i.angleAndHeight)&&(i=i.angleAndHeight),e.equals(r,t._tiltCenterMousePosition)||(t._tiltCVOffMap=!1,t._looking=!1),t._looking)return j(t,r,i),void 0;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,N(t,r,i)):F(t,r,i)}function N(r,i,n){var a=r._scene,s=a.camera,u=a.canvas,c=mt;c.x=u.clientWidth/2,c.y=u.clientHeight/2;var h,m=s.getPickRay(c,pt),f=t.UNIT_X,v=m.origin,g=m.direction,y=t.dot(f,g);if(Math.abs(y)>d.EPSILON6&&(h=-t.dot(f,v)/y),!o(h)||0>=h)return r._looking=!0,j(r,i,n),e.clone(i,r._tiltCenterMousePosition),void 0;var C=t.multiplyByScalar(g,h,ft);t.add(v,C,C);var w=a.mapProjection,S=w.ellipsoid;t.fromElements(C.y,C.z,C.x,C);var E=w.unproject(C,St);S.cartographicToCartesian(E,C);var b=_.eastNorthUpToFixedFrame(C,S,gt),T=r._globe,x=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var P=p.clone(s.transform,Et);s.setTransform(b),k(r,i,n,t.UNIT_Z),s.setTransform(P),r._globe=T,r._ellipsoid=x;var A=x.maximumRadius;r._rotateFactor=1/A,r._rotateRateRangeAdjustment=A}function F(r,i,n){var a,s,c=r._ellipsoid,h=r._scene,g=h.camera,y=t.UNIT_X;if(e.equals(i,r._tiltCenterMousePosition))a=t.clone(r._tiltCenter,ft);else{if(s=g.getPickRay(i,pt),o(r._globe)&&g.position.zd.EPSILON6&&(C=-t.dot(y,w)/E),!o(C)||0>=C)return r._looking=!0,j(r,i,n),e.clone(i,r._tiltCenterMousePosition),void 0;a=t.multiplyByScalar(S,C,ft),t.add(w,a,a)}e.clone(i,r._tiltCenterMousePosition),t.clone(a,r._tiltCenter)}var b=h.canvas,T=mt;T.x=b.clientWidth/2,T.y=r._tiltCenterMousePosition.y,s=g.getPickRay(T,pt);var x=t.clone(t.ZERO,yt);x.x=a.x;var P=f.fromPointNormal(x,y,Ct),A=u.rayPlane(s,P,vt),M=g._projection;c=M.ellipsoid,t.fromElements(a.y,a.z,a.x,a);var D=M.unproject(a,St);c.cartographicToCartesian(D,a);var I,O=_.eastNorthUpToFixedFrame(a,c,gt);o(A)?(t.fromElements(A.y,A.z,A.x,A),D=M.unproject(A,St),c.cartographicToCartesian(D,A),I=_.eastNorthUpToFixedFrame(A,c,_t)):I=O;var R=r._globe,L=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var N=t.UNIT_Z,F=p.clone(g.transform,Et);g.setTransform(O);var B=t.cross(t.UNIT_Z,t.normalize(g.position,wt),wt),z=t.dot(g.right,B);if(k(r,i,n,N,!1,!0),g.setTransform(I),0>z){n.startPosition.y>n.endPosition.y&&(N=void 0);var V=g.constrainedAxis;g.constrainedAxis=void 0,k(r,i,n,N,!0,!1),g.constrainedAxis=V}else k(r,i,n,N,!0,!1);if(o(g.constrainedAxis)){var U=t.cross(g.direction,g.constrainedAxis,Jt);t.equalsEpsilon(U,t.ZERO,d.EPSILON6)||(t.dot(U,g.right)<0&&t.negate(U,U),t.cross(U,g.direction,g.up),t.cross(g.direction,g.up,g.right),t.normalize(g.up,g.up),t.normalize(g.right,g.right))}g.setTransform(F),r._globe=R,r._ellipsoid=L;var W=L.maximumRadius;r._rotateFactor=1/W,r._rotateRateRangeAdjustment=W;var G=t.clone(g.positionWC,wt);if(X(r),!t.equals(g.positionWC,G)){g.setTransform(I),g.worldToCameraCoordinatesPoint(G,G);var H=t.magnitudeSquared(G);t.magnitudeSquared(g.position)>H&&(t.normalize(g.position,g.position),t.multiplyByScalar(g.position,Math.sqrt(H),g.position));var q=t.angleBetween(G,g.position),Y=t.cross(G,g.position,G);t.normalize(Y,Y);var Z=v.fromAxisAngle(Y,q,bt),Q=m.fromQuaternion(Z,Tt);m.multiplyByVector(Q,g.direction,g.direction),m.multiplyByVector(Q,g.up,g.up),t.cross(g.direction,g.up,g.right),t.cross(g.right,g.direction,g.up),g.setTransform(F)}}function B(e,r,i){o(i.distance)&&(i=i.distance);var n=e._scene,a=n.camera,s=n.canvas,l=xt;l.x=s.clientWidth/2,l.y=s.clientHeight/2;var u,c=a.getPickRay(l,Pt);o(e._globe)&&a.position.zr.minimumTrackBallHeight?(r._rotating=!0,k(r,i,n)):(r._looking=!0,j(r,i,n,d));e.clone(i,r._rotateMousePosition)}function k(e,r,i,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 m=t.magnitude(c.position),p=e._rotateFactor*(m-e._rotateRateRangeAdjustment);p>e._maximumRotateRate&&(p=e._maximumRotateRate),p0&&F>0?P-E:N>0&&0>=F?t.dot(u.position,_)>0?-E-P:E+P:E-P,u.rotateRight(O),u.rotateUp(R)}else{t.normalize(v,v),t.normalize(g,g);var B=t.dot(v,g),z=t.cross(v,g,zt);if(1>B&&!t.equalsEpsilon(z,t.ZERO,d.EPSILON14)){var V=Math.acos(B);u.rotate(z,V)}}}function W(e,r,i){o(i.distance)&&(i=i.distance);var n=e._ellipsoid,a=e._scene,s=a.camera,l=a.canvas,u=xt;u.x=l.clientWidth/2,u.y=l.clientHeight/2;var c,h=s.getPickRay(u,Pt),d=n.cartesianToCartographic(s.position).height;o(e._globe)&&dt.minimumCollisionTerrainHeight?(t._tiltOnEllipsoid=!0,H(t,r,i)):q(t,r,i)}}function H(r,i,n){var a=r._ellipsoid,s=r._scene,c=s.camera,h=.25*r.minimumZoomDistance,m=a.cartesianToCartographic(c.positionWC).height;if(!(m-h-1r.minimumTrackBallHeight)){r._looking=!0;var S=r._ellipsoid.geodeticSurfaceNormal(c.position,rr);return j(r,i,n,S),e.clone(i,r._tiltCenterMousePosition),void 0}var E=u.grazingAltitudeLocation(C,a);if(!o(E))return;var b=a.cartesianToCartographic(E,tr);b.height=0,y=a.cartographicToCartesian(b,Yt)}var T=_.eastNorthUpToFixedFrame(y,a,Zt),x=r._globe,P=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var A=p.clone(c.transform,Kt);c.setTransform(T),k(r,i,n,t.UNIT_Z),c.setTransform(A),r._globe=x,r._ellipsoid=P;var M=P.maximumRadius;r._rotateFactor=1/M,r._rotateRateRangeAdjustment=M}}function q(r,i,n){var a,s,c,h=r._ellipsoid,f=r._scene,y=f.camera;if(e.equals(i,r._tiltCenterMousePosition))a=t.clone(r._tiltCenter,Yt);else{if(s=y.getPickRay(i,jt),o(r._globe)&&(a=r._globe.pick(s,f,Yt)),!o(a)){if(c=u.rayEllipsoid(s,h),!o(c)){var C=h.cartesianToCartographic(y.position,tr);if(C.height<=r.minimumTrackBallHeight){r._looking=!0;var w=r._ellipsoid.geodeticSurfaceNormal(y.position,rr);j(r,i,n,w),e.clone(i,r._tiltCenterMousePosition)}return}a=g.getPoint(s,c.start,Yt)}e.clone(i,r._tiltCenterMousePosition),t.clone(a,r._tiltCenter)}var S=f.canvas,E=qt;E.x=S.clientWidth/2,E.y=r._tiltCenterMousePosition.y,s=y.getPickRay(E,jt);var b=t.magnitude(a),T=t.fromElements(b,b,b,Rt),x=l.fromCartesian3(T,Lt);if(c=u.rayEllipsoid(s,x),o(c)){var P=t.magnitude(s.origin)>b?c.start:c.stop,A=g.getPoint(s,P,Xt),M=_.eastNorthUpToFixedFrame(a,h,Zt),D=_.eastNorthUpToFixedFrame(A,x,Qt),I=r._globe,O=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var R=t.UNIT_Z,L=p.clone(y.transform,Kt);y.setTransform(M);var N=t.cross(A,y.positionWC,Jt),F=t.dot(y.rightWC,N);if(k(r,i,n,R,!1,!0),y.setTransform(D),0>F){n.startPosition.y>n.endPosition.y&&(R=void 0);var B=y.constrainedAxis;y.constrainedAxis=void 0,k(r,i,n,R,!0,!1),y.constrainedAxis=B}else k(r,i,n,R,!0,!1);if(o(y.constrainedAxis)){var z=t.cross(y.direction,y.constrainedAxis,Jt);t.equalsEpsilon(z,t.ZERO,d.EPSILON6)||(t.dot(z,y.right)<0&&t.negate(z,z),t.cross(z,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(L),r._globe=I,r._ellipsoid=O;var V=O.maximumRadius;r._rotateFactor=1/V,r._rotateRateRangeAdjustment=V;var U=t.clone(y.positionWC,Jt);if(X(r),!t.equals(y.positionWC,U)){y.setTransform(D),y.worldToCameraCoordinatesPoint(U,U);var W=t.magnitudeSquared(U);t.magnitudeSquared(y.position)>W&&(t.normalize(y.position,y.position),t.multiplyByScalar(y.position,Math.sqrt(W),y.position));var G=t.angleBetween(U,y.position),H=t.cross(U,y.position,U);t.normalize(H,H);var q=v.fromAxisAngle(H,G,$t),Y=m.fromQuaternion(q,er);m.multiplyByVector(Y,y.direction,y.direction),m.multiplyByVector(Y,y.up,y.up),t.cross(y.direction,y.up,y.right),t.cross(y.right,y.direction,y.up),y.setTransform(L)}}}function j(e,r,i,a){var s=e._scene,l=s.camera,u=ir;u.x=i.startPosition.x,u.y=0;var c=nr;c.x=i.endPosition.x,c.y=0;var h=l.getPickRay(u,or).direction,m=l.getPickRay(c,ar).direction,p=0,f=t.dot(h,m);1>f&&(p=Math.acos(f)),p=i.startPosition.x>i.endPosition.x?-p:p;var v=e._horizontalRotationAxis;if(o(a)?l.look(a,-p):o(v)?l.look(v,-p):l.lookLeft(p),u.x=0,u.y=i.startPosition.y,c.x=0,c.y=i.endPosition.y,h=l.getPickRay(u,or).direction,m=l.getPickRay(c,ar).direction,p=0,f=t.dot(h,m),1>f&&(p=Math.acos(f)),p=i.startPosition.y>i.endPosition.y?-p:p,a=n(a,v),o(a)){var g=l.direction,_=t.negate(a,sr),y=t.equalsEpsilon(g,a,d.EPSILON2),C=t.equalsEpsilon(g,_,d.EPSILON2);if(y||C)(y&&0>p||C&&p>0)&&l.look(l.right,-p);else{f=t.dot(g,a);var w=d.acosClamped(f);p>0&&p>w&&(p=w-d.EPSILON4),f=t.dot(g,_),w=d.acosClamped(f),0>p&&-p>w&&(p=-w+d.EPSILON4);var S=t.cross(a,g,lr);l.look(S,p)}}else l.lookUp(p)}function Y(e){x(e,e.enableRotate,e.rotateEventTypes,V,e.inertiaSpin,"_lastInertiaSpinMovement"),x(e,e.enableZoom,e.zoomEventTypes,W,e.inertiaZoom,"_lastInertiaZoomMovement"),x(e,e.enableTilt,e.tiltEventTypes,G,e.inertiaSpin,"_lastInertiaTiltMovement"),x(e,e.enableLook,e.lookEventTypes,j)}function X(e){var t=e._scene,r=t.mode,i=e._globe;if(o(i)&&r!==w.SCENE2D&&r!==w.MORPHING){var n=t.camera,a=e._ellipsoid,s=t.mapProjection,l=ur;if(r===w.SCENE3D?a.cartesianToCartographic(n.position,l):s.unproject(n.position,l),!(l.height>e.minimumCollisionTerrainHeight)){var u=i.getHeight(l);o(u)&&(u+=e.minimumZoomDistance,l.height>=u||(l.height=u,r===w.SCENE3D?a.cartographicToCartesian(l,n.position):s.project(l,n.position)))}}}var Z=function(r){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=20,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}],this.lookEventTypes={eventType:C.LEFT_DRAG,modifier:h.SHIFT},this.minimumPickingTerrainHeight=15e4,this.minimumCollisionTerrainHeight=1e4,this.minimumTrackBallHeight=75e5,this._scene=r,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new y(r.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaWheelZoomMovement=void 0,this._lastInertiaTiltMovement=void 0,this._tweens=new S,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._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1; -var n=r.mapProjection;this._maxCoord=n.project(new i(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._translateFactor=1,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3},Q=.4,J=[],K=new g,$=new g,et=new t,tt=new t,rt=new e,it=new e,nt=new g,ot=new g,at=new t,st=new t,lt=new t,ut=new t,ct=new f(t.ZERO,0),ht=new e,dt=new e,mt=new e,pt=new g,ft=new t,vt=new t,gt=new p,_t=new p,yt=new t,Ct=new f(t.ZERO,0),wt=new t,St=new i,Et=new p,bt=new v,Tt=new m,xt=new e,Pt=new g,At=new t,Mt=new t,Dt=new g,It=new i,Ot=new t,Rt=new t,Lt=new l,Nt=new t,Ft=r.clone(r.UNIT_W),Bt=r.clone(r.UNIT_W),zt=new t,Vt=new t,kt=new t,Ut=new t,Wt=new e,Gt=new e,Ht=new t,qt=new e,jt=new g,Yt=new t,Xt=new t,Zt=new p,Qt=new p,Jt=new t,Kt=new p,$t=new v,er=new m,tr=new i,rr=new t,ir=new e,nr=new e,or=new g,ar=new g,sr=new t,lr=new t,ur=new i;return Z.prototype.update=function(){p.equals(this._scene.camera.transform,p.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);var e=this._ellipsoid.maximumRadius;this._rotateFactor=1/e,this._rotateRateRangeAdjustment=e;var r=this._scene,i=r.mode;i===w.SCENE2D?O(this):i===w.COLUMBUS_VIEW?(this._horizontalRotationAxis=t.UNIT_Z,z(this)):i===w.SCENE3D&&(this._horizontalRotationAxis=void 0,Y(this)),X(this),this._aggregator.reset()},Z.prototype.isDestroyed=function(){return!1},Z.prototype.destroy=function(){return this._tweens.removeAll(),this._spinHandler=this._spinHandler&&this._spinHandler.destroy(),this._translateHandler=this._translateHandler&&this._translateHandler.destroy(),this._lookHandler=this._lookHandler&&this._lookHandler.destroy(),this._rotateHandler=this._rotateHandler&&this._rotateHandler.destroy(),this._zoomHandler=this._zoomHandler&&this._zoomHandler.destroy(),this._zoomWheelHandler=this._zoomWheelHandler&&this._zoomWheelHandler.destroy(),this._pinchHandler=this._pinchHandler&&this._pinchHandler.destroy(),a(this)},Z}),r("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"}),r("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"}),r("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"}),r("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"}),r("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/PassState","../Renderer/PixelDatatype","../Renderer/RenderbufferFormat","../Shaders/PostProcessFilters/AdditiveBlend","../Shaders/PostProcessFilters/BrightPass","../Shaders/PostProcessFilters/GaussianBlur1D","../Shaders/PostProcessFilters/PassThrough"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_){"use strict";var y=function(){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 d,this._downSamplePassState.scissorTest={enable:!0,rectangle:new e},this._upSamplePassState=new d,this._upSamplePassState.scissorTest={enabled:!0,rectangle:new e},this._uCenter=new t,this._uRadius=void 0,this._blurStep=new t};y.prototype.clear=function(e,t){var r=this._clearFBO1Command;i.clone(n(t,i.BLACK),r.color),r.execute(e),r=this._clearFBO2Command,i.clone(n(t,i.BLACK),r.color),r.execute(e)},y.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 C=new e,w=new e,S=new r,E=new t,b=new t,T=new l;return y.prototype.update=function(e){var r=e.drawingBufferWidth,n=e.drawingBufferHeight,a=this;if(!o(this._downSampleCommand)){this._clearFBO1Command=new h({color:new i}),this._clearFBO2Command=new h({color:new i});var d,y={};this._downSampleCommand=e.createViewportQuadCommand(_,{renderState:d,uniformMap:y,owner:this}),y={u_avgLuminance:function(){return.5},u_threshold:function(){return.25},u_offset:function(){return.1}},this._brightPassCommand=e.createViewportQuadCommand(v,{renderState:d,uniformMap:y,owner:this});var x=1,P=2;y={delta:function(){return x},sigma:function(){return P},direction:function(){return 0}},this._blurXCommand=e.createViewportQuadCommand(g,{renderState:d,uniformMap:y,owner:this}),y={delta:function(){return x},sigma:function(){return P},direction:function(){return 1}},this._blurYCommand=e.createViewportQuadCommand(g,{renderState:d,uniformMap:y,owner:this}),y={u_center:function(){return a._uCenter},u_radius:function(){return a._uRadius}},this._blendCommand=e.createViewportQuadCommand(f,{renderState:d,uniformMap:y,owner:this}),y={},this._fullScreenCommand=e.createViewportQuadCommand(_,{renderState:d,uniformMap:y,owner:this})}var A=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2))-2),M=Math.pow(2,Math.ceil(Math.log(n)/Math.log(2))-2),D=Math.max(A,M),I=C;I.width=r,I.height=n;var O=w;O.width=D,O.height=D;var R=this._fbo,L=o(R)&&R.getColorTexture(0)||void 0;if(!o(L)||L.width!==r||L.height!==n){R=R&&R.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._blurStep.x=this._blurStep.y=1/D;var N=[e.createTexture2D({width:r,height:n})];R=this._fbo=e.depthTexture?e.createFramebuffer({colorTextures:N,depthTexture:e.createTexture2D({width:r,height:n,pixelFormat:u.DEPTH_COMPONENT,pixelDatatype:m.UNSIGNED_SHORT})}):e.createFramebuffer({colorTextures:N,depthRenderbuffer:e.createRenderbuffer({format:p.DEPTH_COMPONENT16})}),this._downSampleFBO1=e.createFramebuffer({colorTextures:[e.createTexture2D({width:D,height:D})]}),this._downSampleFBO2=e.createFramebuffer({colorTextures:[e.createTexture2D({width:D,height:D})]}),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 F=e.createRenderState({viewport:O}),B=e.createRenderState();this._downSampleCommand.uniformMap.u_texture=function(){return R.getColorTexture(0)},this._downSampleCommand.renderState=F,this._brightPassCommand.uniformMap.u_texture=function(){return a._downSampleFBO1.getColorTexture(0)},this._brightPassCommand.renderState=F,this._blurXCommand.uniformMap.u_texture=function(){return a._downSampleFBO2.getColorTexture(0)},this._blurXCommand.uniformMap.u_step=function(){return a._blurStep},this._blurXCommand.renderState=F,this._blurYCommand.uniformMap.u_texture=function(){return a._downSampleFBO1.getColorTexture(0)},this._blurYCommand.uniformMap.u_step=function(){return a._blurStep},this._blurYCommand.renderState=F,this._blendCommand.uniformMap.u_texture0=function(){return R.getColorTexture(0)},this._blendCommand.uniformMap.u_texture1=function(){return a._downSampleFBO2.getColorTexture(0)},this._blendCommand.renderState=B,this._fullScreenCommand.uniformMap.u_texture=function(){return R.getColorTexture(0)},this._fullScreenCommand.renderState=B}var z=e.uniformState,V=z.sunPositionWC,k=z.view,U=z.viewProjection,W=z.projection,G=l.computeViewportTransformation(I,0,1,T),H=l.multiplyByPoint(k,V,S),q=c.pointToGLWindowCoordinates(U,G,V,E);H.x+=s.SOLAR_RADIUS;var j=c.pointToGLWindowCoordinates(W,G,H,H),Y=2*30*t.magnitude(t.subtract(j,q,j)),X=b;X.x=Y,X.y=Y;var Z=this._upSamplePassState.scissorTest.rectangle;return Z.x=Math.max(q.x-.5*X.x,0),Z.y=Math.max(q.y-.5*X.y,0),Z.width=Math.min(X.x,r),Z.height=Math.min(X.y,n),this._uCenter=t.clone(q,this._uCenter),this._uRadius=.5*Math.max(X.x,X.y),G=l.computeViewportTransformation(O,0,1,T),q=c.pointToGLWindowCoordinates(U,G,V,E),X.x*=A/r,X.y*=M/n,Z=this._downSamplePassState.scissorTest.rectangle,Z.x=Math.max(q.x-.5*X.x,0),Z.y=Math.max(q.y-.5*X.y,0),Z.width=Math.min(X.x,r),Z.height=Math.min(X.y,n),this._downSamplePassState.context=e,this._upSamplePassState.context=e,this._fbo},y.prototype.isDestroyed=function(){return!1},y.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)},y}),r("Scene/Scene",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../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/Intersect","../Core/Interval","../Core/JulianDate","../Core/Math","../Core/Matrix4","../Core/mergeSort","../Core/Occluder","../Core/ShowGeometryInstanceAttribute","../Renderer/ClearCommand","../Renderer/Context","../Renderer/PassState","./Camera","./CreditDisplay","./CullingVolume","./FrameState","./FrustumCommands","./FXAA","./OIT","./OrthographicFrustum","./Pass","./PerformanceDisplay","./PerInstanceColorAppearance","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./Primitive","./PrimitiveCollection","./SceneMode","./SceneTransforms","./SceneTransitioner","./ScreenSpaceCameraController","./SunPostProcess","./TweenCollection"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S,E,b,T,x,P,A,M,D,I,O,R,L,N,F,B,z,V,k,U,W,G,H,q,j,Y,X){"use strict";function Z(e){var t=e.globe;if(e._mode===G.SCENE3D&&l(t)){var r=t.ellipsoid;return _t.radius=r.minimumRadius,gt=E.fromBoundingSphere(_t,e._camera.positionWC,gt)}return void 0}function Q(e){e.render=!1,e.pick=!1}function J(e,t,r){var i=e._camera,n=e._frameState;n.mode=e._mode,n.morphTime=e.morphTime,n.mapProjection=e.mapProjection,n.frameNumber=t,n.time=y.clone(r,n.time),n.camera=i,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),n.occluder=Z(e),n.afterRender.length=0,Q(n.passes)}function K(e,t,r,i,n){n.length=i;for(var o=0;i>o;++o){var a=Math.max(e,Math.pow(r,o)*e),s=Math.min(t,r*a),u=n[o];l(u)?(u.near=a,u.far=s):u=n[o]=new O(a,s)}}function $(e,t,r){e.debugShowFrustums&&(t.debugOverlappingFrustums=0);for(var i=e._frustumCommandsList,n=i.length,o=0;n>o;++o){var a=i[o],s=a.near,u=a.far;if(!(r.start>u)){if(r.stoph;++h)u[h].opaqueIndex=0,u[h].translucentIndex=0;var d,m=Number.MAX_VALUE,p=Number.MIN_VALUE,f=!1;e._frameState.mode===G.SCENE3D&&(d=e._frameState.occluder);for(var v=yt.planes,_=0;5>_;++_)v[_]=n.planes[_];n=yt;for(var y=r.length,C=0;y>C;++C){var w=r[C],S=w.pass;if(S===F.OVERLAY)i.push(w);else{var E=w.boundingVolume;if(l(E)){if(w.cull&&(n.computeVisibility(E)===g.OUTSIDE||l(d)&&!d.isBoundingSphereVisible(E)))continue;Ct=t.computePlaneDistances(E,s,a,Ct),m=Math.min(m,Ct.start),p=Math.max(p,Ct.stop)}else Ct.start=o.frustum.near,Ct.stop=o.frustum.far,f=!(w instanceof T);$(e,w,Ct)}}f?(m=o.frustum.near,p=o.frustum.far):(m=Math.min(Math.max(m,o.frustum.near),o.frustum.far),p=Math.max(Math.min(p,o.frustum.far),m));var b=e.farToNearRatio,x=Math.ceil(Math.log(p/m)/Math.log(b));m!==Number.MAX_VALUE&&(x!==c||0!==u.length&&(mu[c-1].far))&&(K(m,p,b,x,u),et(e))}function tt(e){var t={},r=e.vertexAttributes;for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i].index);return t}function rt(e,t,r){var i=t.context,o=s(r,e.shaderProgram),a=o.fragmentShaderSource.clone();a.sources=a.sources.map(function(e){return e=e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,"void czm_Debug_main()")});var u="void main() \n{ \n czm_Debug_main(); \n";if(t.debugShowCommands){l(e._debugColor)||(e._debugColor=n.fromRandom());var c=e._debugColor;u+=" gl_FragColor.rgb *= vec3("+c.red+", "+c.green+", "+c.blue+"); \n"}if(t.debugShowFrustums){var h=1&e.debugOverlappingFrustums?"1.0":"0.0",d=2&e.debugOverlappingFrustums?"1.0":"0.0",m=4&e.debugOverlappingFrustums?"1.0":"0.0";u+=" gl_FragColor.rgb *= vec3("+h+", "+d+", "+m+"); \n"}u+="}",a.sources.push(u);var p=tt(o);return i.createShaderProgram(o.vertexShaderSource,a,p)}function it(e,t,r,i,n){if(l(e.shaderProgram)||l(n)){var o=rt(e,t,n);e.execute(t.context,r,i,o),o.destroy()}}function nt(e,t,r,n,a,s,u){if((!l(t.debugCommandFilter)||t.debugCommandFilter(e))&&(t.debugShowCommands||t.debugShowFrustums?it(e,t,n,a,s):e.execute(r,n,a,s),e.debugShowBoundingVolume&&l(e.boundingVolume))){l(t._debugSphere)&&t._debugSphere.destroy();var c=t._frameState,h=e.boundingVolume,m=h.radius,p=h.center,g=v.toWireframe(d.createGeometry(new d({radii:new i(m,m,m),vertexFormat:z.FLAT_VERTEX_FORMAT})));if(c.mode!==G.SCENE3D){p=w.multiplyByPoint(wt,p,p);var _=c.mapProjection,y=_.unproject(p);p=_.ellipsoid.cartographicToCartesian(y)}t._debugSphere=new U({geometryInstances:new f({geometry:g,modelMatrix:w.multiplyByTranslation(w.IDENTITY,p,new w),attributes:{color:new o(1,0,0,1)}}),appearance:new z({flat:!0,translucent:!1}),asynchronous:!1});var C=[];t._debugSphere.update(r,c,C);var S;l(u)&&(S=n.framebuffer,n.framebuffer=u),C[0].execute(r,n),l(S)&&(n.framebuffer=S)}}function ot(e,t){if(l(e)){for(var r=t.mode===G.SCENE3D?t.occluder:void 0,i=t.cullingVolume,n=yt.planes,o=0;5>o;++o)n[o]=i.planes[o];i=yt;var a=e.boundingVolume;return l(e)&&(!l(e.boundingVolume)||!e.cull||i.computeVisibility(a)!==g.OUTSIDE&&(!l(r)||r.isBoundingSphereVisible(a)))}}function at(e,r,i){return t.distanceSquaredTo(r.boundingVolume,i)-t.distanceSquaredTo(e.boundingVolume,i)}function st(e,t,r,i){var n=e.context;S(i,at,e._camera.positionWC);for(var o=i.length,a=0;o>a;++a)t(i[a],e,n,r)}function lt(e,t,r,i){var o,a=e._frameState,s=e._camera,u=e.context,c=u.uniformState;o=l(s.frustum.fov)?s.frustum.clone(St):l(s.frustum.infiniteProjectionMatrix)?s.frustum.clone(Et):s.frustum.clone(bt),l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom?e._sunPostProcess=new Y:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var h=a.passes.render&&l(e.skyBox)?e.skyBox.update(u,a):void 0,d=a.passes.render&&l(e.skyAtmosphere)?e.skyAtmosphere.update(u,a):void 0,m=a.passes.render&&l(e.sun)?e.sun.update(e):void 0,p=ot(m,a),f=e._clearColorCommand;n.clone(r,f.color),f.execute(u,t);var v,g=!1,_=e._frustumCommandsList,y=_.length;for(v=0;y>v;++v)if(_[v].translucentIndex>0){g=!0;break}var C=!i&&g&&l(e._oit)&&e._oit.isSupported();C&&(e._oit.update(u),e._oit.clear(u,t,r),C=C&&e._oit.isSupported());var w=!i&&(e.fxaa||C&&e.fxaaOrderIndependentTranslucency);w&&(e._fxaa.update(u),e._fxaa.clear(u,t,r));var S=t.framebuffer;C?S=e._oit.getColorFramebuffer():w&&(S=e._fxaa.getColorFramebuffer()),t.framebuffer=p&&e.sunBloom?e._sunPostProcess.update(u):S,o.near=s.frustum.near,o.far=s.frustum.far,c.updateFrustum(o),l(h)&&nt(h,e,u,t),l(d)&&nt(d,e,u,t),l(m)&&p&&(m.execute(u,t),e.sunBloom&&(e._sunPostProcess.execute(u,S),t.framebuffer=S));var E,b=e._depthClearCommand;for(C?(l(e._executeOITFunction)||(e._executeOITFunction=function(e,t,r,i){e._oit.executeCommands(e,t,r,i)}),E=e._executeOITFunction):E=st,v=0;y>v;++v){var T=y-v-1,x=_[T];o.near=x.near,o.far=x.far,0!==T&&(o.near*=.99),c.updateFrustum(o),b.execute(u,t);for(var P=x.opaqueCommands,A=x.opaqueIndex,M=0;A>M;++M)nt(P[M],e,u,t);o.near=x.near,c.updateFrustum(o),P=x.translucentCommands,P.length=x.translucentIndex,E(e,nt,t,P)}C&&(t.framebuffer=w?e._fxaa.getColorFramebuffer():void 0,e._oit.execute(u,t)),w&&(t.framebuffer=void 0,e._fxaa.execute(u,t))}function ut(e,t){for(var r=e.context,i=e._overlayCommandList,n=i.length,o=0;n>o;++o)i[o].execute(r,t)}function ct(e){var t=e.context,r=e._frameState,i=e._commandList;e._globe&&e._globe.update(t,r,i),e._primitives.update(t,r,i),l(e.moon)&&e.moon.update(t,r,i)}function ht(e){for(var t=e.afterRender,r=0,i=t.length;i>r;++r)t[r]();t.length=0}function dt(e,t){l(t)||(t=y.now()),e._preRender.raiseEvent(e,t);var r=e.context.uniformState,i=e._frameState,o=C.incrementWrap(i.frameNumber,15e6,1);J(e,o,t),i.passes.render=!0,i.creditDisplay.beginFrame();var a=e.context;r.update(a,i),e._commandList.length=0,e._overlayCommandList.length=0,ct(e),et(e);var u=e._passState;if(lt(e,u,s(e.backgroundColor,n.BLACK)),ut(e,u),i.creditDisplay.endFrame(),e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){var c=document.createElement("div");c.className="cesium-performanceDisplay",c.style.position="absolute",c.style.top="50px",c.style.right="10px";var h=e._canvas.parentNode;h.appendChild(c);var d=new B({container:c});e._performanceDisplay=d,e._performanceContainer=c}e._performanceDisplay.update()}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer));a.endFrame(),ht(i),e._postRender.raiseEvent(e,t)}function mt(e,t){var r=e._camera,n=r.frustum,o=e.drawingBufferWidth,a=e.drawingBufferHeight,s=2/o*t.x-1;s*=.5*(n.right-n.left);var l=2/a*(a-t.y)-1;l*=.5*(n.top-n.bottom);var u=i.clone(r.position,xt);i.multiplyByScalar(r.right,s,Pt),i.add(Pt,u,u),i.multiplyByScalar(r.up,l,Pt),i.add(Pt,u,u),i.fromElements(u.z,u.x,u.y,u),At.x=o,At.y=a;var c=n.getPixelSize(At,void 0,Mt),h=Tt;return h.right=.5*c.x,h.left=-h.right,h.top=.5*c.y,h.bottom=-h.top,h.near=n.near,h.far=n.far,h.computeCullingVolume(u,r.directionWC,r.upWC)}function pt(e,t,r,i){var n=e._camera,o=n.frustum,a=o.near,s=e.drawingBufferWidth,l=e.drawingBufferHeight,u=Math.tan(.5*o.fovy),c=o.aspectRatio*u,h=2/s*t.x-1,d=2/l*(l-t.y)-1,m=h*a*c,p=d*a*u;At.x=s,At.y=l;var f=o.getPixelSize(At,void 0,Mt),v=.5*f.x*r,g=.5*f.y*i,_=Dt;return _.top=p+g,_.bottom=p-g,_.right=m+v,_.left=m-v,_.near=a,_.far=o.far,_.computeCullingVolume(n.positionWC,n.directionWC,n.upWC)}function ft(e,t,r,i){return e._mode===G.SCENE2D?mt(e,t,r,i):pt(e,t,r,i)}var vt=function(e){e=s(e,s.EMPTY_OBJECT);var t=e.canvas,r=e.contextOptions,i=e.creditContainer,o=new x(t,r);l(i)||(i=document.createElement("div"),i.style.position="absolute",i.style.bottom="0",i.style["text-shadow"]="0px 0px 2px #000000",i.style.color="#ffffff",i.style["font-size"]="10px",i.style["padding-right"]="5px",t.parentNode.appendChild(i)),this._id=a(),this._frameState=new I(new M(i)),this._frameState.scene3DOnly=s(e.scene3DOnly,!1),this._passState=new P(o),this._canvas=t,this._context=o,this._globe=void 0,this._primitives=new W,this._pickFramebuffer=void 0,this._tweens=new X,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._commandList=[],this._frustumCommandsList=[],this._overlayCommandList=[],this._oit=s(e.orderIndependentTranslucency,!0)?new L(o):void 0,this._executeOITFunction=void 0,this._fxaa=new R,this._clearColorCommand=new T({color:new n,owner:this}),this._depthClearCommand=new T({depth:1,owner:this}),this._transitioner=new q(this),this._renderError=new m,this._preRender=new m,this._postRender=new m,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new m,this.morphComplete=new m,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=n.clone(n.BLACK),this._mode=G.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new p,this.morphTime=1,this.farToNearRatio=1e3,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this._debugFrustumStatistics=void 0,this.debugShowFramesPerSecond=!1,this.fxaaOrderIndependentTranslucency=!0,this.fxaa=!1,this._performanceDisplay=void 0,this._debugSphere=void 0;var u=new A(this);this._camera=u,this._screenSpaceCameraController=new j(this);var c=u.frustum.near,h=u.frustum.far,d=Math.ceil(Math.log(h/c)/Math.log(this.farToNearRatio));K(c,h,this.farToNearRatio,d,this._frustumCommandsList),J(this,0,y.now()),this.initializeFrame()};u(vt.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 this._context.maximumAliasedLineWidth}},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}},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}},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 l(this._oit)}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){if(this.scene3DOnly&&e!==G.SCENE3D)throw new h("Only SceneMode.SCENE3D is valid when scene3DOnly is true.");this._mode=e}}});var gt,_t=new t,yt=new D,Ct=new _,wt=new w(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);wt=w.inverseTransformation(wt,wt);var St=new V,Et=new k,bt=new N;vt.prototype.initializeFrame=function(){120===this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms()),this._tweens.update(),this._camera.update(this._mode),this._screenSpaceCameraController.update()},vt.prototype.render=function(e){try{dt(this,e)}catch(t){if(this._renderError.raiseEvent(this,t),this.rethrowRenderErrors)throw t}},vt.prototype.clampLineWidth=function(e){var t=this._context;return Math.max(t.minimumAliasedLineWidth,Math.min(e,t.maximumAliasedLineWidth))};var Tt=new N,xt=new i,Pt=new i,At=new r,Mt=new r,Dt=new k,It=3,Ot=3,Rt=new e(0,0,It,Ot),Lt=new n(0,0,0,0),Nt=new r;return vt.prototype.pick=function(e){var t=this._context,r=t.uniformState,i=this._frameState,n=H.transformWindowToDrawingBuffer(this,e,Nt);l(this._pickFramebuffer)||(this._pickFramebuffer=t.createPickFramebuffer()),J(this,i.frameNumber,i.time),i.cullingVolume=ft(this,n,It,Ot),i.passes.pick=!0,r.update(t,i),this._commandList.length=0,ct(this),et(this),Rt.x=n.x-.5*(It-1),Rt.y=this.drawingBufferHeight-n.y-.5*(Ot-1),lt(this,this._pickFramebuffer.begin(Rt),Lt,!0);var o=this._pickFramebuffer.end(Rt);return t.endFrame(),ht(i),o},vt.prototype.drillPick=function(e){for(var t=[],r=this.pick(e);l(r)&&l(r.primitive);){var i=r.primitive;if(t.push(r),l(i.show))i.show=!1;else if("function"==typeof i.getGeometryInstanceAttributes){var n=i.getGeometryInstanceAttributes(r.id);l(n)&&l(n.show)&&(n.show=b.toValue(!1))}r=this.pick(e)}for(var o=0;othis._outerRadius?this._spSkyFromSpace:this._spSkyFromAtmosphere,n},g.prototype.isDestroyed=function(){return!1},g.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(),n(this)},g}),r("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"}),r("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"}),r("Scene/SkyBox",["../Core/BoxGeometry","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryPipeline","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/loadCubeMap","../Shaders/SkyBoxFS","../Shaders/SkyBoxVS","./BlendingState","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f){"use strict";var v=function(e){this.sources=e.sources,this._sources=void 0,this.show=r(e.show,!0),this._command=new c({modelMatrix:s.clone(s.IDENTITY),owner:this}),this._cubeMap=void 0};return v.prototype.update=function(r,n){if(!this.show)return void 0;if(n.mode!==f.SCENE3D&&n.mode!==f.MORPHING)return void 0;if(!n.passes.render)return void 0;if(this._sources!==this.sources){this._sources=this.sources;var o=this.sources;"string"==typeof o.positiveX?h(r,this._sources).then(function(e){c._cubeMap=c._cubeMap&&c._cubeMap.destroy(),c._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=r.createCubeMap({source:o}))}var s=this._command;if(!i(s.vertexArray)){var c=this;s.uniformMap={u_cubeMap:function(){return c._cubeMap}};var v=e.createGeometry(e.fromDimensions({dimensions:new t(2,2,2),vertexFormat:l.POSITION_ONLY})),g=a.createAttributeLocations(v);s.vertexArray=r.createVertexArrayFromGeometry({geometry:v,attributeLocations:g,bufferUsage:u.STATIC_DRAW}),s.shaderProgram=r.createShaderProgram(m,d,g),s.renderState=r.createRenderState({blending:p.ALPHA_BLEND})}return i(this._cubeMap)?s:void 0},v.prototype.isDestroyed=function(){return!1},v.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)},v}),r("Scene/StencilFunction",["../Core/freezeObject"],function(e){"use strict";var t={NEVER:512,LESS:513,EQUAL:514,LESS_OR_EQUAL:515,GREATER:516,NOT_EQUAL:517,GREATER_OR_EQUAL:518,ALWAYS:519};return e(t)}),r("Scene/StencilOperation",["../Core/freezeObject"],function(e){"use strict";var t={ZERO:0,KEEP:7680,REPLACE:7681,INCREMENT:7682,DECREMENT:7683,INVERT:5386,INCREMENT_WRAP:34055,DECREMENT_WRAP:34056};return e(t)}),r("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"}),r("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"}),r("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"}),r("Scene/Sun",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Renderer/BufferUsage","../Renderer/ClearCommand","../Renderer/DrawCommand","../Shaders/SunFS","../Shaders/SunTextureFS","../Shaders/SunVS","./BlendingState","./SceneMode","./SceneTransforms"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S,E){"use strict";var b=function(){this.show=!0,this._command=new g({primitiveType:p.TRIANGLES,boundingVolume:new t,owner:this}),this._boundingVolume=new t,this._boundingVolume2D=new t,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 e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}};l(b.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var T=new r,x=new r,P=new n,A=new n;return b.prototype.update=function(n){var l=n.frameState,u=n.context;if(!this.show)return void 0;var p=l.mode;if(p===S.SCENE2D||p===S.MORPHING)return void 0;if(!l.passes.render)return void 0;var g=n.drawingBufferWidth,b=n.drawingBufferHeight;if(!s(this._texture)||g!==this._drawingBufferWidth||b!==this._drawingBufferHeight||this._glowFactorDirty){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=g,this._drawingBufferHeight=b,this._glowFactorDirty=!1;var M=Math.max(g,b);M=Math.pow(2,Math.ceil(Math.log(M)/Math.log(2))-2),this._texture=u.createTexture2D({width:M,height:M,pixelFormat:m.RGBA});var D=u.createFramebuffer({colorTextures:[this._texture]});D.destroyAttachments=!1;var I=new v({color:new o(0,0,0,0),framebuffer:D}),O=u.createRenderState({viewport:new e(0,0,M,M)});this._glowLengthTS=5*this._glowFactor,this._radiusTS=.5*(1/(1+2*this._glowLengthTS));var R=this,L={u_glowLengthTS:function(){return R._glowLengthTS},u_radiusTS:function(){return R._radiusTS}},N=u.createViewportQuadCommand(y,{renderState:O,uniformMap:L,framebuffer:D,owner:this});I.execute(u),N.execute(u),N.shaderProgram.destroy(),D.destroy()}var F=this._command;if(!s(F.vertexArray)){var B={direction:0},z=new Uint8Array(8);z[0]=0,z[1]=0,z[2]=255,z[3]=0,z[4]=255,z[5]=255,z[6]=0,z[7]=255;var V=u.createVertexBuffer(z,f.STATIC_DRAW),k=[{index:B.direction,vertexBuffer:V,componentsPerAttribute:2,normalize:!0,componentDatatype:a.UNSIGNED_BYTE}],U=u.createIndexBuffer(new Uint16Array([0,1,2,0,2,3]),f.STATIC_DRAW,c.UNSIGNED_SHORT);F.vertexArray=u.createVertexArray(k,U),F.shaderProgram=u.createShaderProgram(C,_,B),F.renderState=u.createRenderState({blending:w.ALPHA_BLEND}),F.uniformMap=this._uniformMap}var W=u.uniformState.sunPositionWC,G=u.uniformState.sunPositionColumbusView,H=this._boundingVolume,q=this._boundingVolume2D;i.clone(W,H.center),q.center.x=G.z,q.center.y=G.x,q.center.z=G.y,H.radius=h.SOLAR_RADIUS+h.SOLAR_RADIUS*this._glowLengthTS,q.radius=H.radius,p===S.SCENE3D?t.clone(H,F.boundingVolume):p===S.COLUMBUS_VIEW&&t.clone(q,F.boundingVolume);var j=E.computeActualWgs84Position(l,W,A),Y=i.magnitude(i.subtract(j,n.camera.position,A)),X=u.uniformState.projection,Z=P;Z.x=0,Z.y=0,Z.z=-Y,Z.w=1;var Q=d.multiplyByVector(X,Z,A),J=E.clipToDrawingBufferCoordinates(n,Q,T);Z.x=h.SOLAR_RADIUS;var K=d.multiplyByVector(X,Z,A),$=E.clipToDrawingBufferCoordinates(n,K,x);return this._size=Math.ceil(r.magnitude(r.subtract($,J,A))),this._size=2*this._size*(1+2*this._glowLengthTS),F},b.prototype.isDestroyed=function(){return!1},b.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),u(this)},b}),r("Scene/TileCoordinatesImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme"],function(e,t,r,i,n,o){"use strict";var a=function(i){i=t(i,t.EMPTY_OBJECT),this._tilingScheme=r(i.tilingScheme)?i.tilingScheme:new o,this._color=t(i.color,e.YELLOW),this._errorEvent=new n,this._tileWidth=t(i.tileWidth,256),this._tileHeight=t(i.tileHeight,256)};return i(a.prototype,{proxy:{get:function(){return void 0}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return void 0}},minimumLevel:{get:function(){return void 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return void 0}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},credit:{get:function(){return void 0}},hasAlphaChannel:{get:function(){return!0}}}),a.prototype.getTileCredits=function(){return void 0},a.prototype.requestImage=function(e,t,r){var i=document.createElement("canvas");i.width=256,i.height=256;var n=i.getContext("2d"),o=this._color.toCssColorString();n.strokeStyle=o,n.lineWidth=2,n.strokeRect(1,1,255,255);var a="L"+r+"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),i},a.prototype.pickFeatures=function(){return void 0},a}),r("Scene/TileDiscardPolicy",["../Core/DeveloperError"],function(e){"use strict";var t=function(){e.throwInstantiationError()};return t.prototype.isReady=e.throwInstantiationError,t.prototype.shouldDiscardImage=e.throwInstantiationError,t}),r("Scene/TileMapServiceImageryProvider",["../Core/Cartesian2","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadXML","../Core/Rectangle","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,t,r,i){var o=e._tilingScheme.getNumberOfYTilesAtLevel(i),a=e._url+i+"/"+t+"/"+(o-r-1)+"."+e._fileExtension,s=e._proxy;return n(s)&&(a=s.getURL(a)),a}var v=/\/$/,g=function(o){function a(r){for(var o,a,s,u,m=/tileformat/i,p=/tileset/i,v=/tilesets/i,_=/boundingbox/i,w=/srs/i,S=[],E=r.childNodes[0].childNodes,b=0;bD.rectangle.east&&(C._rectangle.east=D.rectangle.east),C._rectangle.southD.rectangle.north&&(C._rectangle.north=D.rectangle.north);var F=D.positionToTileXY(c.southwest(C._rectangle),C._minimumLevel),B=D.positionToTileXY(c.northeast(C._rectangle),C._minimumLevel),z=(Math.abs(B.x-F.x)+1)*(Math.abs(B.y-F.y)+1);z>4&&(C._minimumLevel=0),C._tilingScheme=D,C._ready=!0}function p(){C._fileExtension=i(o.fileExtension,"png"),C._tileWidth=i(o.tileWidth,256),C._tileHeight=i(o.tileHeight,256),C._minimumLevel=i(o.minimumLevel,0),C._maximumLevel=i(o.maximumLevel,18),C._tilingScheme=n(o.tilingScheme)?o.tilingScheme:new d,C._rectangle=i(o.rectangle,C._tilingScheme.rectangle),C._ready=!0}function f(){m(u(g+"tilemapresource.xml"),a,p)}o=i(o,{});var g=o.url;v.test(g)||(g+="/"),this._url=g,this._ready=!1,this._proxy=o.proxy,this._tileDiscardPolicy=o.tileDiscardPolicy,this._errorEvent=new s,this._fileExtension=o.fileExtension,this._tileWidth=o.tileWidth,this._tileHeight=o.tileHeight,this._minimumLevel=o.minimumLevel,this._maximumLevel=o.maximumLevel,this._rectangle=c.clone(o.rectangle),this._tilingScheme=o.tilingScheme;var _=o.credit;"string"==typeof _&&(_=new r(_)),this._credit=_;var y,C=this;f()};return o(g.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}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),g.prototype.getTileCredits=function(){return void 0},g.prototype.requestImage=function(e,t,r){var i=f(this,e,t,r);return p.loadImage(this,i)},g.prototype.pickFeatures=function(){return void 0},g}),r("Scene/TileState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};return e(t)}),r("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"}),r("Scene/ViewportQuad",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Renderer/ShaderSource","../Shaders/ViewportQuadFS","./BlendingState","./Material","./Pass"],function(e,t,r,i,n,o,a,s,l,u){"use strict";var c=function(i,n){this.show=!0,r(i)||(i=new e),this.rectangle=e.clone(i),r(n)||(n=l.fromType(l.ColorType,{color:new t(1,1,1,1)})),this.material=n,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0};return c.prototype.update=function(t,i,n){if(this.show){var l=this._rs;r(l)&&e.equals(l.viewport,this.rectangle)||(this._rs=t.createRenderState({blending:s.ALPHA_BLEND,viewport:this.rectangle}));var c=i.passes;if(c.render){if(this._material!==this.material||!r(this._overlayCommand)){this._material=this.material,r(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var h=new o({sources:[this._material.shaderSource,a]});this._overlayCommand=t.createViewportQuadCommand(h,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=u.OVERLAY}this._material.update(t),this._overlayCommand.uniformMap=this._material._uniforms,n.push(this._overlayCommand)}}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return r(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),i(this)},c}),r("Scene/WebMapServiceImageryProvider",["../Core/Cartesian3","../Core/Cartographic","../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/freezeObject","../Core/GeographicTilingScheme","../Core/loadJson","../Core/loadXML","../Core/Math","../Core/objectToQuery","../Core/queryToObject","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","../ThirdParty/when","./ImageryLayerFeatureInfo","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w){"use strict";function S(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r.toLowerCase()]=e[r]);return t}function E(e,t,i,a){var s=new _(e._url),l=f(n(s.query,""));if(l=r(e._parameters,l),o(l.layers)||(l.layers=e._layers),o(l.srs)||(l.srs=e._tilingScheme instanceof g?"EPSG:3857":"EPSG:4326"),!o(l.bbox)){var u=e._tilingScheme.tileXYToNativeRectangle(t,i,a);l.bbox=u.west+","+u.south+","+u.east+","+u.north}o(l.width)||(l.width=e._tileWidth),o(l.height)||(l.height=e._tileHeight),o(l.params)||(l.viewparams=e._viewParams),s.query=p(l);var c=s.toString(),h=e._proxy;return o(h)&&(c=h.getURL(c)),c}function b(e,t,i,a,s,l,u){var c=new _(e._url),h=f(n(c.query,""));if(h=r(e._getFeatureInfoParameters,h),o(h.layers)||(h.layers=e._layers),o(h.query_layers)||(h.query_layers=e._layers),o(h.srs)||(h.srs=e._tilingScheme instanceof g?"EPSG:3857":"EPSG:4326"),!o(h.bbox)){var d=e._tilingScheme.tileXYToNativeRectangle(i,a,s);h.bbox=d.west+","+d.south+","+d.east+","+d.north}o(h.x)||(h.x=l),o(h.y)||(h.y=u),o(h.width)||(h.width=e._tileWidth),o(h.height)||(h.height=e._tileHeight),o(h.info_format)||(h.info_format=t),o(h.params)||(h.viewparams=e._viewParams),c.query=p(h);var m=c.toString(),v=e._proxy;return o(v)&&(m=v.getURL(m)),m}function T(e,r){for(var i=[],n=e.features,o=0;o4)throw new o("The imagery provider's rectangle and minimumLevel indicate that there are "+l+" tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.");this._errorEvent=new a,this._ready=!0;var u=e.credit;"string"==typeof u&&(u=new t(u)),this._credit=u},v=s({service:"WMTS",version:"1.0.0",request:"GetTile"});return n(f.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:{get:function(){return this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},headers:{get:function(){return this._headers}}}),f.prototype.getTileCredits=function(){return void 0},f.prototype.requestImage=function(e,t,r){var i=p(this,e,t,r);return m.loadImage(this,i)},f.prototype.pickFeatures=function(){return void 0},f}),r("Scene/createTangentSpaceDebugPrimitive",["../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/Matrix4","./PerInstanceColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(i){i=t(i,t.EMPTY_OBJECT);var u=[],c=i.geometry;r(c.attributes)&&r(c.primitiveType)||(c=c.constructor.createGeometry(c));var h=c.attributes,d=a.clone(t(i.modelMatrix,a.IDENTITY)),m=t(i.length,1e4);return r(h.normal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"normal",m),attributes:{color:new e(1,0,0,1)},modelMatrix:d})),r(h.binormal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"binormal",m),attributes:{color:new e(0,1,0,1)},modelMatrix:d})),r(h.tangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"tangent",m),attributes:{color:new e(0,0,1,1)},modelMatrix:d})),u.length>0?new l({geometryInstances:u,appearance:new s({flat:!0,translucent:!1})}):void 0}return u}),function(){!function(e){var i=this||(0,eval)("this"),n=i.document,o=i.navigator,a=i.jQuery,s=i.JSON;!function(e){"function"==typeof t&&"object"==typeof exports&&"object"==typeof module?e(module.exports||exports,t):"function"==typeof r&&r.amd?r("ThirdParty/knockout-3.2.0",["exports","require"],e):e(i.ko={})}(function(t,r){function l(e,t){return null===e||typeof e in m?e===t:!1}function u(t,r){var i;return function(){i||(i=setTimeout(function(){i=e,t()},r))}}function c(e,t){var r;return function(){clearTimeout(r),r=setTimeout(e,t)}}function h(e,t,r,i){d.d[e]={init:function(e,n,o,a,s){var l,u;return d.s(function(){var o=d.a.c(n()),a=!r!=!o,c=!u;(c||t||a!==l)&&(c&&d.Y.la()&&(u=d.a.ia(d.f.childNodes(e),!0)),a?(c||d.f.T(e,d.a.ia(u)),d.Ca(i?i(s,o):s,e)):d.f.ja(e),l=a)},null,{o:e}),{controlsDescendantBindings:!0}}},d.h.ha[e]=!1,d.f.Q[e]=!0}var d="undefined"!=typeof t?t:{};d.b=function(e,t){for(var r=e.split("."),i=d,n=0;nr;r++)h[t[r]]=e -});var m={propertychange:!0},p=n&&function(){for(var t=3,r=n.createElement("div"),i=r.getElementsByTagName("i");r.innerHTML="",i[0];);return t>4?t:e}();return{vb:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],u:function(e,t){for(var r=0,i=e.length;i>r;r++)t(e[r],r)},m:function(e,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t);for(var r=0,i=e.length;i>r;r++)if(e[r]===t)return r;return-1},qb:function(e,t,r){for(var i=0,n=e.length;n>i;i++)if(t.call(r,e[i],i))return e[i];return null},ua:function(e,t){var r=d.a.m(e,t);r>0?e.splice(r,1):0===r&&e.shift()},rb:function(e){e=e||[];for(var t=[],r=0,i=e.length;i>r;r++)0>d.a.m(t,e[r])&&t.push(e[r]);return t},Da:function(e,t){e=e||[];for(var r=[],i=0,n=e.length;n>i;i++)r.push(t(e[i],i));return r},ta:function(e,t){e=e||[];for(var r=[],i=0,n=e.length;n>i;i++)t(e[i],i)&&r.push(e[i]);return r},ga:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var r=0,i=t.length;i>r;r++)e.push(t[r]);return e},ea:function(e,t,r){var i=d.a.m(d.a.Xa(e),t);0>i?r&&e.push(t):r||e.splice(i,1)},xa:u,extend:r,za:l,Aa:u?l:r,G:t,na:function(e,t){if(!e)return e;var r,i={};for(r in e)e.hasOwnProperty(r)&&(i[r]=t(e[r],r,e));return i},Ka:function(e){for(;e.firstChild;)d.removeNode(e.firstChild)},oc:function(e){e=d.a.S(e);for(var t=n.createElement("div"),r=0,i=e.length;i>r;r++)t.appendChild(d.R(e[r]));return t},ia:function(e,t){for(var r=0,i=e.length,n=[];i>r;r++){var o=e[r].cloneNode(!0);n.push(t?d.R(o):o)}return n},T:function(e,t){if(d.a.Ka(e),t)for(var r=0,i=t.length;i>r;r++)e.appendChild(t[r])},Lb:function(e,t){var r=e.nodeType?[e]:e;if(0o;o++)n.insertBefore(t[o],i);for(o=0,a=r.length;a>o;o++)d.removeNode(r[o])}},ka:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.shift();if(1p?e.setAttribute("selected",t):e.selected=t},cb:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},vc:function(e,t){return e=e||"",t.length>e.length?!1:e.substring(0,t.length)===t},cc: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},Ja:function(e){return d.a.cc(e,e.ownerDocument.documentElement)},ob:function(e){return!!d.a.qb(e,d.a.Ja)},t:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},n:function(e,t,r){var i=p&&m[t];if(!i&&a)a(e).bind(t,r);else 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)},o="on"+t;e.attachEvent(o,n),d.a.w.da(e,function(){e.detachEvent(o,n)})}else e.addEventListener(t,r,!1)},oa:function(e,t){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var r;if("input"===d.a.t(e)&&e.type&&"click"==t.toLowerCase()?(r=e.type,r="checkbox"==r||"radio"==r):r=!1,a&&!r)a(e).trigger(t);else if("function"==typeof n.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");r=n.createEvent(h[t]||"HTMLEvents"),r.initEvent(t,!0,!0,i,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(r)}else if(r&&e.click)e.click();else{if("undefined"==typeof e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+t)}},c:function(e){return d.C(e)?e():e},Xa:function(e){return d.C(e)?e.v():e},Ba:function(e,t,r){if(t){var i=/\S+/g,n=e.className.match(i)||[];d.a.u(t.match(i),function(e){d.a.ea(n,e,r)}),e.className=n.join(" ")}},bb:function(t,r){var i=d.a.c(r);(null===i||i===e)&&(i="");var n=d.f.firstChild(t);!n||3!=n.nodeType||d.f.nextSibling(n)?d.f.T(t,[t.ownerDocument.createTextNode(i)]):n.data=i,d.a.fc(t)},Mb:function(e,t){if(e.name=t,7>=p)try{e.mergeAttributes(n.createElement(""),!1)}catch(r){}},fc:function(e){p>=9&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},dc:function(e){if(p){var t=e.style.width;e.style.width=0,e.style.width=t}},sc:function(e,t){e=d.a.c(e),t=d.a.c(t);for(var r=[],i=e;t>=i;i++)r.push(i);return r},S:function(e){for(var t=[],r=0,i=e.length;i>r;r++)t.push(e[r]);return t},yc:6===p,zc:7===p,L:p,xb:function(e,t){for(var r=d.a.S(e.getElementsByTagName("input")).concat(d.a.S(e.getElementsByTagName("textarea"))),i="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],o=r.length-1;o>=0;o--)i(r[o])&&n.push(r[o]);return n},pc:function(e){return"string"==typeof e&&(e=d.a.cb(e))?s&&s.parse?s.parse(e):new Function("return "+e)():null},eb:function(e,t,r){if(!s||!s.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 s.stringify(d.a.c(e),t,r)},qc:function(e,r,i){i=i||{};var o=i.params||{},a=i.includeFields||this.vb,s=e;if("object"==typeof e&&"form"===d.a.t(e))for(var s=e.action,l=a.length-1;l>=0;l--)for(var u=d.a.xb(e,a[l]),c=u.length-1;c>=0;c--)o[u[c].name]=u[c].value;r=d.a.c(r);var h=n.createElement("form");h.style.display="none",h.action=s,h.method="post";for(var m in r)e=n.createElement("input"),e.type="hidden",e.name=m,e.value=d.a.eb(d.a.c(r[m])),h.appendChild(e);t(o,function(e,t){var r=n.createElement("input");r.type="hidden",r.name=e,r.value=t,h.appendChild(r)}),n.body.appendChild(h),i.submitter?i.submitter(h):h.submit(),setTimeout(function(){h.parentNode.removeChild(h)},0)}}}(),d.b("utils",d.a),d.b("utils.arrayForEach",d.a.u),d.b("utils.arrayFirst",d.a.qb),d.b("utils.arrayFilter",d.a.ta),d.b("utils.arrayGetDistinctValues",d.a.rb),d.b("utils.arrayIndexOf",d.a.m),d.b("utils.arrayMap",d.a.Da),d.b("utils.arrayPushAll",d.a.ga),d.b("utils.arrayRemoveItem",d.a.ua),d.b("utils.extend",d.a.extend),d.b("utils.fieldsIncludedWithJsonPost",d.a.vb),d.b("utils.getFormFields",d.a.xb),d.b("utils.peekObservable",d.a.Xa),d.b("utils.postJson",d.a.qc),d.b("utils.parseJson",d.a.pc),d.b("utils.registerEventHandler",d.a.n),d.b("utils.stringifyJson",d.a.eb),d.b("utils.range",d.a.sc),d.b("utils.toggleDomNodeCssClass",d.a.Ba),d.b("utils.triggerEvent",d.a.oa),d.b("utils.unwrapObservable",d.a.c),d.b("utils.objectForEach",d.a.G),d.b("utils.addOrRemoveItem",d.a.ea),d.b("unwrap",d.a.c),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this,r=Array.prototype.slice.call(arguments);return e=r.shift(),function(){return t.apply(e,r.concat(Array.prototype.slice.call(arguments)))}}),d.a.e=new function(){function t(t,o){var a=t[i];if(!a||"null"===a||!n[a]){if(!o)return e;a=t[i]="ko"+r++,n[a]={}}return n[a]}var r=0,i="__ko__"+(new Date).getTime(),n={};return{get:function(r,i){var n=t(r,!1);return n===e?e:n[i]},set:function(r,i,n){(n!==e||t(r,!1)!==e)&&(t(r,!0)[i]=n)},clear:function(e){var t=e[i];return t?(delete n[t],e[i]=null,!0):!1},F:function(){return r++ +i}}},d.b("utils.domData",d.a.e),d.b("utils.domData.clear",d.a.e.clear),d.a.w=new function(){function t(t,r){var n=d.a.e.get(t,i);return n===e&&r&&(n=[],d.a.e.set(t,i,n)),n}function r(e){var i=t(e,!1);if(i)for(var i=i.slice(0),n=0;ni;i++)r(t[i])}return e},removeNode:function(e){d.R(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){a&&"function"==typeof a.cleanData&&a.cleanData([e])}}},d.R=d.a.w.R,d.removeNode=d.a.w.removeNode,d.b("cleanNode",d.R),d.b("removeNode",d.removeNode),d.b("utils.domNodeDisposal",d.a.w),d.b("utils.domNodeDisposal.addDisposeCallback",d.a.w.da),d.b("utils.domNodeDisposal.removeDisposeCallback",d.a.w.Kb),function(){d.a.ba=function(e){var t;if(a){if(a.parseHTML)t=a.parseHTML(e)||[];else if((t=a.clean([e]))&&t[0]){for(e=t[0];e.parentNode&&11!==e.parentNode.nodeType;)e=e.parentNode;e.parentNode&&e.parentNode.removeChild(e)}}else{var r=d.a.cb(e).toLowerCase();for(t=n.createElement("div"),r=r.match(/^<(thead|tbody|tfoot)/)&&[1,"","
"]||!r.indexOf("",""]||(!r.indexOf("",""]||[0,"",""],e="ignored
"+r[1]+e+r[2]+"
","function"==typeof i.innerShiv?t.appendChild(i.innerShiv(e)):t.innerHTML=e;r[0]--;)t=t.lastChild;t=d.a.S(t.lastChild.childNodes)}return t},d.a.$a=function(t,r){if(d.a.Ka(t),r=d.a.c(r),null!==r&&r!==e)if("string"!=typeof r&&(r=r.toString()),a)a(t).html(r);else for(var i=d.a.ba(r),n=0;ni;i++)t(n[i],r)}var r={};return{Ua:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var t=(0|4294967296*(1+Math.random())).toString(16).substring(1)+(0|4294967296*(1+Math.random())).toString(16).substring(1);return r[t]=e,""},Rb:function(t,i){var n=r[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,i||[]),!0}finally{delete r[t]}},Sb:function(e,r){var i=[];t(e,i);for(var n=0,o=i.length;o>n;n++){var a=i[n].bc,s=[a];r&&d.a.ga(s,r),d.D.Rb(i[n].mc,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},Gb:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),d.b("memoization",d.D),d.b("memoization.memoize",d.D.Ua),d.b("memoization.unmemoize",d.D.Rb),d.b("memoization.parseMemoText",d.D.Gb),d.b("memoization.unmemoizeDomNodeAndDescendants",d.D.Sb),d.La={throttle:function(e,t){e.throttleEvaluation=t;var r=null;return d.j({read:e,write:function(i){clearTimeout(r),r=setTimeout(function(){e(i)},t)}})},rateLimit:function(e,t){var r,i,n;"number"==typeof t?r=t:(r=t.timeout,i=t.method),n="notifyWhenChangesStop"==i?c:u,e.Ta(function(e){return n(e,r)})},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var m={undefined:1,"boolean":1,number:1,string:1};d.b("extenders",d.La),d.Pb=function(e,t,r){this.target=e,this.wa=t,this.ac=r,this.Cb=!1,d.A(this,"dispose",this.K)},d.Pb.prototype.K=function(){this.Cb=!0,this.ac()},d.P=function(){d.a.Aa(this,d.P.fn),this.M={}};var p="change",f={U:function(e,t,r){var i=this;r=r||p;var n=new d.Pb(i,t?e.bind(t):e,function(){d.a.ua(i.M[r],n),i.nb&&i.nb()});return i.va&&i.va(r),i.M[r]||(i.M[r]=[]),i.M[r].push(n),n},notifySubscribers:function(e,t){if(t=t||p,this.Ab(t))try{d.k.Ea();for(var r,i=this.M[t].slice(0),n=0;r=i[n];++n)r.Cb||r.wa(e)}finally{d.k.end()}},Ta:function(e){var t,r,i,n=this,o=d.C(n);n.qa||(n.qa=n.notifySubscribers,n.notifySubscribers=function(e,t){t&&t!==p?"beforeChange"===t?n.kb(e):n.qa(e,t):n.lb(e)});var a=e(function(){o&&i===n&&(i=n()),t=!1,n.Pa(r,i)&&n.qa(r=i)});n.lb=function(e){t=!0,i=e,a()},n.kb=function(e){t||(r=e,n.qa(e,"beforeChange"))}},Ab:function(e){return this.M[e]&&this.M[e].length},yb:function(){var e=0;return d.a.G(this.M,function(t,r){e+=r.length}),e},Pa:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},extend:function(e){var t=this;return e&&d.a.G(e,function(e,r){var i=d.La[e];"function"==typeof i&&(t=i(t,r)||t)}),t}};d.A(f,"subscribe",f.U),d.A(f,"extend",f.extend),d.A(f,"getSubscriptionsCount",f.yb),d.a.xa&&d.a.za(f,Function.prototype),d.P.fn=f,d.Db=function(e){return null!=e&&"function"==typeof e.U&&"function"==typeof e.notifySubscribers},d.b("subscribable",d.P),d.b("isSubscribable",d.Db),d.Y=d.k=function(){function e(e){i.push(r),r=e}function t(){r=i.pop()}var r,i=[],n=0;return{Ea:e,end:t,Jb:function(e){if(r){if(!d.Db(e))throw Error("Only subscribable things can act as dependencies");r.wa(e,e.Vb||(e.Vb=++n))}},B:function(r,i,n){try{return e(),r.apply(i,n||[])}finally{t()}},la:function(){return r?r.s.la():void 0},ma:function(){return r?r.ma:void 0}}}(),d.b("computedContext",d.Y),d.b("computedContext.getDependenciesCount",d.Y.la),d.b("computedContext.isInitial",d.Y.ma),d.b("computedContext.isSleeping",d.Y.Ac),d.p=function(e){function t(){return 0=0;i--)r(t[i])&&(t[i]._destroy=!0);this.W()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=d.a.m(t,e)}):[]},indexOf:function(e){var t=this();return d.a.m(t,e)},replace:function(e,t){var r=this.indexOf(e);r>=0&&(this.X(),this.v()[r]=t,this.W())}},d.a.u("pop push reverse shift sort splice unshift".split(" "),function(e){d.aa.fn[e]=function(){var t=this.v();return this.X(),this.sb(t,e,arguments),t=t[e].apply(t,arguments),this.W(),t}}),d.a.u(["slice"],function(e){d.aa.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),d.a.xa&&d.a.za(d.aa.fn,d.p.fn),d.b("observableArray",d.aa);var g="arrayChange";d.La.trackArrayChanges=function(e){function t(){if(!r){r=!0;var t=e.notifySubscribers;e.notifySubscribers=function(e,r){return r&&r!==p||++n,t.apply(this,arguments)};var o=[].concat(e.v()||[]);i=null,e.U(function(t){if(t=[].concat(t||[]),e.Ab(g)){var r;(!i||n>1)&&(i=d.a.Fa(o,t,{sparse:!0})),r=i,r.length&&e.notifySubscribers(r,g)}o=t,i=null,n=0})}}if(!e.sb){var r=!1,i=null,n=0,o=e.U;e.U=e.subscribe=function(e,r,i){return i===g&&t(),o.apply(this,arguments)},e.sb=function(e,t,o){function a(e,t,r){return s[s.length]={status:e,value:t,index:r}}if(r&&!n){var s=[],l=e.length,u=o.length,c=0;switch(t){case"push":c=l;case"unshift":for(t=0;u>t;t++)a("added",o[t],c+t);break;case"pop":c=l-1;case"shift":l&&a("deleted",e[c],c);break;case"splice":t=Math.min(Math.max(0,0>o[0]?l+o[0]:o[0]),l);for(var l=1===u?l:Math.min(t+(o[1]||0),l),u=t+u-2,c=Math.max(l,u),h=[],m=[],p=2;c>t;++t,++p)l>t&&m.push(a("deleted",e[t],t)),u>t&&h.push(a("added",o[p],t));d.a.wb(m,h);break;default:return}i=s}}}},d.s=d.j=function(t,r,i){function n(){d.a.G(T,function(e,t){t.K()}),T={}}function o(){n(),x=0,v=!0,m=!1}function a(){var e=l.throttleEvaluation;e&&e>=0?(clearTimeout(P),P=setTimeout(s,e)):l.ib?l.ib():s()}function s(t){if(p){if(_)throw Error("A 'pure' computed must not be called recursively")}else if(!v){if(E&&E()){if(!f)return b(),void 0}else f=!1;if(p=!0,y)try{var i={};d.k.Ea({wa:function(e,t){i[t]||(i[t]=1,++x)},s:l,ma:e}),x=0,h=g.call(r)}finally{d.k.end(),p=!1}else try{var n=T,o=x;d.k.Ea({wa:function(e,t){v||(o&&n[t]?(T[t]=n[t],++x,delete n[t],--o):T[t]||(T[t]=e.U(a),++x))},s:l,ma:_?e:!x}),T={},x=0;try{var s=r?g.call(r):g()}finally{d.k.end(),o&&d.a.G(n,function(e,t){t.K()}),m=!1}l.Pa(h,s)&&(l.notifySubscribers(h,"beforeChange"),h=s,!0!==t&&l.notifySubscribers(h))}finally{p=!1}x||b()}}function l(){if(00}var h,m=!0,p=!1,f=!1,v=!1,g=t,_=!1,y=!1;if(g&&"object"==typeof g?(i=g,g=i.read):(i=i||{},g||(g=i.read)),"function"!=typeof g)throw Error("Pass a function that returns the value of the ko.computed");var C=i.write,w=i.disposeWhenNodeIsRemoved||i.o||null,S=i.disposeWhen||i.Ia,E=S,b=o,T={},x=0,P=null;r||(r=i.owner),d.P.call(l),d.a.Aa(l,d.j.fn),l.v=u,l.la=function(){return x},l.hc="function"==typeof i.write,l.K=function(){b()},l.Z=c;var A=l.Ta;return l.Ta=function(e){A.call(l,e),l.ib=function(){l.kb(h),m=!0,l.lb(l)}},i.pure?(y=_=!0,l.va=function(){y&&(y=!1,s(!0))},l.nb=function(){l.yb()||(n(),y=m=!0)}):i.deferEvaluation&&(l.va=function(){u(),delete l.va}),d.A(l,"peek",l.v),d.A(l,"dispose",l.K),d.A(l,"isActive",l.Z),d.A(l,"getDependenciesCount",l.la),w&&(f=!0,w.nodeType&&(E=function(){return!d.a.Ja(w)||S&&S()})),y||i.deferEvaluation||s(),w&&c()&&w.nodeType&&(b=function(){d.a.w.Kb(w,b),o()},d.a.w.da(w,b)),l},d.jc=function(e){return d.Ma(e,d.j)},f=d.p.rc,d.j[f]=d.p,d.j.fn={equalityComparer:l},d.j.fn[f]=d.j,d.a.xa&&d.a.za(d.j.fn,d.P.fn),d.b("dependentObservable",d.j),d.b("computed",d.j),d.b("isComputed",d.jc),d.Ib=function(e,t){return"function"==typeof e?d.s(e,t,{pure:!0}):(e=d.a.extend({},e),e.pure=!0,d.s(e,t))},d.b("pureComputed",d.Ib),function(){function t(n,o,a){if(a=a||new i,n=o(n),"object"!=typeof n||null===n||n===e||n instanceof Date||n instanceof String||n instanceof Number||n instanceof Boolean)return n;var s=n instanceof Array?[]:{};return a.save(n,s),r(n,function(r){var i=o(n[r]);switch(typeof i){case"boolean":case"number":case"string":case"function":s[r]=i;break;case"object":case"undefined":var l=a.get(i);s[r]=l!==e?l:t(i,o,a)}}),s}function r(e,t){if(e instanceof Array){for(var r=0;rt;t++)e=e();return e})},d.toJSON=function(e,t,r){return e=d.Qb(e),d.a.eb(e,t,r)},i.prototype={save:function(e,t){var r=d.a.m(this.keys,e);r>=0?this.hb[r]=t:(this.keys.push(e),this.hb.push(t))},get:function(t){return t=d.a.m(this.keys,t),t>=0?this.hb[t]:e}}}(),d.b("toJS",d.Qb),d.b("toJSON",d.toJSON),function(){d.i={q:function(t){switch(d.a.t(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?d.a.e.get(t,d.d.options.Va):7>=d.a.L?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?d.i.q(t.options[t.selectedIndex]):e;default:return t.value}},ca:function(t,r,i){switch(d.a.t(t)){case"option":switch(typeof r){case"string":d.a.e.set(t,d.d.options.Va,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=r;break;default:d.a.e.set(t,d.d.options.Va,r),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof r?r:""}break;case"select":(""===r||null===r)&&(r=e);for(var n,o=-1,a=0,s=t.options.length;s>a;++a)if(n=d.i.q(t.options[a]),n==r||""==n&&r===e){o=a;break}(i||o>=0||r===e&&1=l){t&&a.push(r?{key:t,value:r.join("")}:{unknown:t}),t=r=l=0;continue}}else if(58===h){if(!r)continue}else if(47===h&&c&&1"===n.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};d.f={Q:{},childNodes:function(t){return e(t)?r(t):t.childNodes},ja:function(t){if(e(t)){t=d.f.childNodes(t);for(var r=0,i=t.length;i>r;r++)d.removeNode(t[r])}else d.a.Ka(t)},T:function(t,r){if(e(t)){d.f.ja(t);for(var i=t.nextSibling,n=0,o=r.length;o>n;n++)i.parentNode.insertBefore(r[n],i)}else d.a.T(t,r)},Hb:function(t,r){e(t)?t.parentNode.insertBefore(r,t.nextSibling):t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r)},Bb:function(t,r,i){i?e(t)?t.parentNode.insertBefore(r,i.nextSibling):i.nextSibling?t.insertBefore(r,i.nextSibling):t.appendChild(r):d.f.Hb(t,r)},firstChild:function(r){return e(r)?!r.nextSibling||t(r.nextSibling)?null:r.nextSibling:r.firstChild},nextSibling:function(r){return e(r)&&(r=i(r)),r.nextSibling&&t(r.nextSibling)?null:r.nextSibling},gc:e,xc:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},Fb:function(r){if(l[d.a.t(r)]){var n=r.firstChild;if(n)do if(1===n.nodeType){var o;o=n.firstChild;var a=null;if(o)do if(a)a.push(o);else if(e(o)){var s=i(o,!0);s?o=s:a=[o]}else t(o)&&(a=[o]);while(o=o.nextSibling);if(o=a)for(a=n.nextSibling,s=0;sd.a.L&&(d.g.register=function(e){return function(t){return n.createElement(t),e.apply(this,arguments)}}(d.g.register),n.createDocumentFragment=function(e){return function(){var t,r=e(),i=d.g.Ub;for(t in i)i.hasOwnProperty(t)&&r.createElement(t);return r}}(n.createDocumentFragment))}(),function(){var e=0;d.d.component={init:function(t,r,i,n,o){function a(){var e=s&&s.dispose;"function"==typeof e&&e.call(s),l=null}var s,l;return d.a.w.da(t,a),d.s(function(){var i,n,u=d.a.c(r());if("string"==typeof u?i=u:(i=d.a.c(u.name),n=d.a.c(u.params)),!i)throw Error("No component name specified");var c=l=++e;d.g.get(i,function(e){if(l===c){if(a(),!e)throw Error("Unknown component '"+i+"'");var r=e.template;if(!r)throw Error("Component '"+i+"' has no template");r=d.a.ia(r),d.f.T(t,r);var r=n,u=e.createViewModel;e=u?u.call(e,r,{element:t}):r,r=o.createChildContext(e),s=e,d.Ca(r,t)}})},null,{o:t}),{controlsDescendantBindings:!0}}},d.f.Q.component=!0}();var _={"class":"className","for":"htmlFor"};d.d.attr={update:function(t,r){var i=d.a.c(r())||{};d.a.G(i,function(r,i){i=d.a.c(i);var n=!1===i||null===i||i===e;n&&t.removeAttribute(r),8>=d.a.L&&r in _?(r=_[r],n?t.removeAttribute(r):t[r]=i):n||t.setAttribute(r,i.toString()),"name"===r&&d.a.Mb(t,n?"":i.toString())})}},function(){d.d.checked={after:["value","attr"],init:function(t,r,i){function n(){var e=t.checked,n=h?a():e;if(!d.Y.ma()&&(!l||e)){var o=d.k.B(r);u?c!==n?(e&&(d.a.ea(o,n,!0),d.a.ea(o,c,!1)),c=n):d.a.ea(o,n,e):d.h.pa(o,i,"checked",n,!0)}}function o(){var e=d.a.c(r());t.checked=u?0<=d.a.m(e,a()):s?e:a()===e}var a=d.Ib(function(){return i.has("checkedValue")?d.a.c(i.get("checkedValue")):i.has("value")?d.a.c(i.get("value")):t.value}),s="checkbox"==t.type,l="radio"==t.type;if(s||l){var u=s&&d.a.c(r())instanceof Array,c=u?a():e,h=l||u;l&&!t.name&&d.d.uniqueName.init(t,function(){return!0}),d.s(n,null,{o:t}),d.a.n(t,"click",n),d.s(o,null,{o:t})}}},d.h.V.checked=!0,d.d.checkedValue={update:function(e,t){e.value=d.a.c(t())}}}(),d.d.css={update:function(e,t){var r=d.a.c(t());"object"==typeof r?d.a.G(r,function(t,r){r=d.a.c(r),d.a.Ba(e,t,r)}):(r=String(r||""),d.a.Ba(e,e.__ko__cssValue,!1),e.__ko__cssValue=r,d.a.Ba(e,r,!0))}},d.d.enable={update:function(e,t){var r=d.a.c(t());r&&e.disabled?e.removeAttribute("disabled"):r||e.disabled||(e.disabled=!0)}},d.d.disable={update:function(e,t){d.d.enable.update(e,function(){return!d.a.c(t())})}},d.d.event={init:function(e,t,r,i,n){var o=t()||{};d.a.G(o,function(o){"string"==typeof o&&d.a.n(e,o,function(e){var a,s=t()[o];if(s){try{var l=d.a.S(arguments);i=n.$data,l.unshift(i),a=s.apply(i,l)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===r.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},d.d.foreach={Eb:function(e){return function(){var t=e(),r=d.a.Xa(t);return r&&"number"!=typeof r.length?(d.a.c(t),{foreach:r.data,as:r.as,includeDestroyed:r.includeDestroyed,afterAdd:r.afterAdd,beforeRemove:r.beforeRemove,afterRender:r.afterRender,beforeMove:r.beforeMove,afterMove:r.afterMove,templateEngine:d.O.Oa}):{foreach:t,templateEngine:d.O.Oa}}},init:function(e,t){return d.d.template.init(e,d.d.foreach.Eb(t))},update:function(e,t,r,i,n){return d.d.template.update(e,d.d.foreach.Eb(t),r,i,n)}},d.h.ha.foreach=!1,d.f.Q.foreach=!0,d.d.hasfocus={init:function(e,t,r){function i(i){e.__ko_hasfocusUpdating=!0;var n=e.ownerDocument;if("activeElement"in n){var o;try{o=n.activeElement}catch(a){o=n.body}i=o===e}n=t(),d.h.pa(n,r,"hasfocus",i,!0),e.__ko_hasfocusLastValue=i,e.__ko_hasfocusUpdating=!1}var n=i.bind(null,!0),o=i.bind(null,!1);d.a.n(e,"focus",n),d.a.n(e,"focusin",n),d.a.n(e,"blur",o),d.a.n(e,"focusout",o)},update:function(e,t){var r=!!d.a.c(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===r||(r?e.focus():e.blur(),d.k.B(d.a.oa,null,[e,r?"focusin":"focusout"]))}},d.h.V.hasfocus=!0,d.d.hasFocus=d.d.hasfocus,d.h.V.hasFocus=!0,d.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){d.a.$a(e,t())}},h("if"),h("ifnot",!1,!0),h("with",!0,!1,function(e,t){return e.createChildContext(t)});var y={};d.d.options={init:function(e){if("select"!==d.a.t(e))throw Error("options binding applies only to SELECT elements");for(;0d.a.L)var s=d.a.e.F(),l=d.a.e.F(),u=function(e){var t=this.activeElement;(t=t&&d.a.e.get(t,l))&&t(e)},c=function(e,t){var r=e.ownerDocument;d.a.e.get(r,s)||(d.a.e.set(r,s,!0),d.a.n(r,"selectionchange",u)),d.a.e.set(e,l,t)};d.d.textInput={init:function(t,i,n){function s(e,r){d.a.n(t,e,r)}function l(){var r=d.a.c(i());(null===r||r===e)&&(r=""),p!==e&&r===p?setTimeout(l,4):t.value!==r&&(f=r,t.value=r)}function u(){m||(p=t.value,m=setTimeout(h,4))}function h(){clearTimeout(m),p=m=e;var r=t.value;f!==r&&(f=r,d.h.pa(i(),n,"textInput",r))}var m,p,f=t.value;10>d.a.L?(s("propertychange",function(e){"value"===e.propertyName&&h()}),8==d.a.L&&(s("keyup",h),s("keydown",h)),8<=d.a.L&&(c(t,h),s("dragend",u))):(s("input",h),5>o&&"textarea"===d.a.t(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),d.s(l,null,{o:t})}},d.h.V.textInput=!0,d.d.textinput={preprocess:function(e,t,r){r("textInput",e)}}}(),d.d.uniqueName={init:function(e,t){if(t()){var r="ko_unique_"+ ++d.d.uniqueName.Zb;d.a.Mb(e,r)}}},d.d.uniqueName.Zb=0,d.d.value={after:["options","foreach"],init:function(e,t,r){if("input"!=e.tagName.toLowerCase()||"checkbox"!=e.type&&"radio"!=e.type){var i=["change"],n=r.get("valueUpdate"),o=!1,a=null;n&&("string"==typeof n&&(n=[n]),d.a.ga(i,n),i=d.a.rb(i));var s=function(){a=null,o=!1;var i=t(),n=d.i.q(e);d.h.pa(i,r,"value",n)};!d.a.L||"input"!=e.tagName.toLowerCase()||"text"!=e.type||"off"==e.autocomplete||e.form&&"off"==e.form.autocomplete||-1!=d.a.m(i,"propertychange")||(d.a.n(e,"propertychange",function(){o=!0}),d.a.n(e,"focus",function(){o=!1}),d.a.n(e,"blur",function(){o&&s()})),d.a.u(i,function(t){var r=s;d.a.vc(t,"after")&&(r=function(){a=d.i.q(e),setTimeout(s,0)},t=t.substring(5)),d.a.n(e,t,r)});var l=function(){var i=d.a.c(t()),n=d.i.q(e);if(null!==a&&i===a)setTimeout(l,0);else if(i!==n)if("select"===d.a.t(e)){var o=r.get("valueAllowUnset"),n=function(){d.i.ca(e,i,o)};n(),o||i===d.i.q(e)?setTimeout(n,0):d.k.B(d.a.oa,null,[e,"change"])}else d.i.ca(e,i)};d.s(l,null,{o:e})}else d.ra(e,{checkedValue:t})},update:function(){}},d.h.V.value=!0,d.d.visible={update:function(e,t){var r=d.a.c(t()),i="none"!=e.style.display;r&&!i?e.style.display="":!r&&i&&(e.style.display="none")}},function(e){d.d[e]={init:function(t,r,i,n,o){return d.d.event.init.call(this,t,function(){var t={};return t[e]=r(),t},i,n,o)}}}("click"),d.H=function(){},d.H.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},d.H.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},d.H.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){t=t||n;var r=t.getElementById(e);if(!r)throw Error("Cannot find template with ID "+e);return new d.r.l(r)}if(1==e.nodeType||8==e.nodeType)return new d.r.fa(e);throw Error("Unknown template type: "+e)},d.H.prototype.renderTemplate=function(e,t,r,i){return e=this.makeTemplateSource(e,i),this.renderTemplateSource(e,t,r)},d.H.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(e,t).data("isRewritten")},d.H.prototype.rewriteTemplate=function(e,t,r){e=this.makeTemplateSource(e,r),t=t(e.text()),e.text(t),e.data("isRewritten",!0)},d.b("templateEngine",d.H),d.fb=function(){function e(e,t,r,i){e=d.h.Wa(e);for(var n=d.h.ha,o=0;o","#comment",n)})},Xb:function(e,t){return d.D.Ua(function(r,i){var n=r.nextSibling;n&&n.nodeName.toLowerCase()===t&&d.ra(n,e,i)})}}}(),d.b("__tr_ambtns",d.fb.Xb),function(){d.r={},d.r.l=function(e){this.l=e},d.r.l.prototype.text=function(){var e=d.a.t(this.l),e="script"===e?"text":"textarea"===e?"value":"innerHTML";if(0==arguments.length)return this.l[e];var t=arguments[0];"innerHTML"===e?d.a.$a(this.l,t):this.l[e]=t};var t=d.a.e.F()+"_";d.r.l.prototype.data=function(e){return 1===arguments.length?d.a.e.get(this.l,t+e):(d.a.e.set(this.l,t+e,arguments[1]),void 0)};var r=d.a.e.F();d.r.fa=function(e){this.l=e},d.r.fa.prototype=new d.r.l,d.r.fa.prototype.text=function(){if(0==arguments.length){var t=d.a.e.get(this.l,r)||{};return t.gb===e&&t.Ga&&(t.gb=t.Ga.innerHTML),t.gb}d.a.e.set(this.l,r,{gb:arguments[0]})},d.r.l.prototype.nodes=function(){return 0==arguments.length?(d.a.e.get(this.l,r)||{}).Ga:(d.a.e.set(this.l,r,{Ga:arguments[0]}),void 0)},d.b("templateSources",d.r),d.b("templateSources.domElement",d.r.l),d.b("templateSources.anonymousTemplate",d.r.fa)}(),function(){function t(e,t,r){var i;for(t=d.f.nextSibling(t);e&&(i=e)!==t;)e=d.f.nextSibling(i),r(i,e)}function r(e,r){if(e.length){var i=e[0],n=e[e.length-1],o=i.parentNode,a=d.J.instance,s=a.preprocessNode;if(s){if(t(i,n,function(e,t){var r=e.previousSibling,o=s.call(a,e);o&&(e===i&&(i=o[0]||t),e===n&&(n=o[o.length-1]||r))}),e.length=0,!i)return;i===n?e.push(i):(e.push(i,n),d.a.ka(e,o))}t(i,n,function(e){1!==e.nodeType&&8!==e.nodeType||d.pb(r,e)}),t(i,n,function(e){1!==e.nodeType&&8!==e.nodeType||d.D.Sb(e,[r])}),d.a.ka(e,o)}}function i(e){return e.nodeType?e:0i)&&(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),i=o=0;break}i+=o}}},d.a.Fa=function(){function e(e,t,r,i,n){var o,a,s,l,u,c=Math.min,h=Math.max,m=[],p=e.length,f=t.length,v=f-p||1,g=p+f+1;for(o=0;p>=o;o++)for(l=s,m.push(s=[]),u=c(f,o+v),a=h(0,o-1);u>=a;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=[],v=[],o=p,a=f;o||a;)f=m[o][a]-1,a&&f===m[o][a-1]?h.push(c[c.length]={status:r,value:t[--a],index:a}):o&&f===m[o-1][a]?v.push(c[c.length]={status:i,value:e[--o],index:o}):(--a,--o,n.sparse||c.push({status:"retained",value:t[a]}));return d.a.wb(h,v,10*p),c.reverse()}return function(t,r,i){return i="boolean"==typeof i?{dontLimitMoves:i}:i||{},t=t||[],r=r||[],t.length<=r.length?e(t,r,"added","deleted",i):e(r,t,"deleted","added",i)}}(),d.b("utils.compareArrays",d.a.Fa),function(){function t(t,r,i,n,o){var a=[],s=d.j(function(){var e=r(i,o,d.a.ka(a,t))||[];0r;r++)t[r]&&d.a.u(t[r].$,function(i){e(i,r,t[r].sa)})}n=n||[],a=a||{};var c=d.a.e.get(i,r)===e,h=d.a.e.get(i,r)||[],m=d.a.Da(h,function(e){return e.sa}),p=d.a.Fa(m,n,a.dontLimitMoves),f=[],v=0,g=0,_=[],y=[];n=[];for(var C,w,S,E=[],m=[],b=0;w=p[b];b++)switch(S=w.moved,w.status){case"deleted":S===e&&(C=h[v],C.j&&C.j.K(),_.push.apply(_,d.a.ka(C.$,i)),a.beforeRemove&&(n[b]=C,y.push(C))),v++;break;case"retained":l(b,v++);break;case"added":S!==e?l(b,S):(C={sa:w.value,Na:d.p(g++)},f.push(C),y.push(C),c||(m[b]=C))}u(a.beforeMove,E),d.a.u(_,a.beforeRemove?d.R:d.removeNode);for(var T,b=0,c=d.f.firstChild(i);C=y[b];b++){for(C.$||d.a.extend(C,t(i,o,C.sa,s,C.Na)),v=0;p=C.$[v];c=p.nextSibling,T=p,v++)p!==c&&d.f.Bb(i,p,T);!C.ic&&s&&(s(C.sa,C.$,C.Na),C.ic=!0)}u(a.beforeRemove,n),u(a.afterMove,E),u(a.afterAdd,m),d.a.e.set(i,r,f)}}(),d.b("utils.setDomNodeChildrenFromArrayMapping",d.a.Za),d.O=function(){this.allowTemplateRewriting=!1},d.O.prototype=new d.H,d.O.prototype.renderTemplateSource=function(e){var t=(9>d.a.L?0:e.nodes)?e.nodes():null;return t?d.a.S(t.cloneNode(!0).childNodes):(e=e.text(),d.a.ba(e))},d.O.Oa=new d.O,d.ab(d.O.Oa),d.b("nativeTemplateEngine",d.O),function(){d.Sa=function(){var e=this.kc=function(){if(!a||!a.tmpl)return 0;try{if(0<=a.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(t,r,i){if(i=i||{},2>e)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var o=t.data("precompiled");return o||(o=t.text()||"",o=a.template(null,"{{ko_with $item.koBindingContext}}"+o+"{{/ko_with}}"),t.data("precompiled",o)),t=[r.$data],r=a.extend({koBindingContext:r},i.templateOptions),r=a.tmpl(o,t,r),r.appendTo(n.createElement("div")),a.fragments={},r},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){n.write("")},e>0&&(a.tmpl.tag.ko_code={open:"__.push($1 || '');"},a.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},d.Sa.prototype=new d.H;var e=new d.Sa;0i;++i)t.appendChild(l(e.children[i]))}else 0===r.indexOf("xlink:")?t.setAttributeNS(g,r.substring(6),e[r]):"textContent"===r?t.textContent=e[r]:t.setAttribute(r,e[r]);return t}function u(e,t,r){var i=document.createElementNS(v,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");var n=document.createElementNS(v,"tspan");return n.textContent=r,i.appendChild(n),i}function c(e,t,r){e.setAttribute("transform","translate(100,100) rotate("+r+")"),t.setAttribute("transform","rotate("+r+")")}function h(e,t){var r=t.alpha,i=1-r;return x.red=e.red*i+t.red*r,x.green=e.green*i+t.green*r,x.blue=e.blue*i+t.blue*r,x.toCssColorString()}function d(e,t,r){var i={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":r},{tagName:"title",textContent:""}]};return l(i)}function m(e,t,r){var i={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":r},{tagName:"title",textContent:""}]};return l(i)}function p(e,t){var r=e._viewModel,i=r.shuttleRingDragging;if(!i||f===e)if("mousedown"===t.type||i&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||i&&"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),!i&&(n>u.right||nu.bottom))return;var c=e._shuttleRingPointer.getBoundingClientRect(),h=n-a-u.left,d=o-s-u.top,m=180*Math.atan2(d,h)/Math.PI+90;m>180&&(m-=360);var p=r.shuttleRingAngle;i||nc.left&&o>c.top&&om?r.slower():m>p&&r.faster(),t.preventDefault()}else e===f&&(f=void 0),r.shuttleRingDragging=!1}var f,v="http://www.w3.org/2000/svg",g="http://www.w3.org/1999/xlink",_=e.fromCssColorString("rgba(247,250,255,0.384)"),y=e.fromCssColorString("rgba(143,191,255,0.216)"),C=e.fromCssColorString("rgba(153,197,255,0.098)"),w=e.fromCssColorString("rgba(255,255,255,0.086)"),S=e.fromCssColorString("rgba(255,255,255,0.267)"),E=e.fromCssColorString("rgba(255,255,255,0)"),b=e.fromCssColorString("rgba(66,67,68,0.3)"),T=e.fromCssColorString("rgba(0,0,0,0.5)"),x=new e,P=function(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;var r=this;this._clickFunction=function(){var e=r._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)]};P.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,r=e.length;r>t;t++)e[t].dispose();i(this)},P.prototype.isDestroyed=function(){return!1},P.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e)return this.svgElement.setAttribute("class","cesium-animation-buttonDisabled"),void 0;if(this._toggled)return this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"),void 0;this.svgElement.setAttribute("class","cesium-animation-rectButton")}},P.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")))},P.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};var A=function(e,t){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 i=document.createElement("div");i.className="cesium-animation-theme",i.innerHTML='
',this._theme=i,this._themeNormal=i.childNodes[0],this._themeHover=i.childNodes[1],this._themeSelect=i.childNodes[2],this._themeDisabled=i.childNodes[3],this._themeKnob=i.childNodes[4],this._themePointer=i.childNodes[5],this._themeSwoosh=i.childNodes[6],this._themeSwooshHover=i.childNodes[7];var n=document.createElementNS(v,"svg:svg");this._svgNode=n,n.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",g);var s=document.createElementNS(v,"g");this._topG=s,this._realtimeSVG=new P(m(3,4,"#animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new P(d(44,99,"#animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new P(d(124,99,"#animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new P(d(84,99,"#animation_pathPause"),t.pauseViewModel);var h=document.createElementNS(v,"g");h.appendChild(this._realtimeSVG.svgElement),h.appendChild(this._playReverseSVG.svgElement),h.appendChild(this._playForwardSVG.svgElement),h.appendChild(this._pauseSVG.svgElement);var f=l({tagName:"circle","class":"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=f;var _=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=_,this._shuttleRingPointer=l({tagName:"use","class":"cesium-animation-shuttleRingPointer","xlink:href":"#animation_pathPointer"});var y=l({tagName:"g",transform:"translate(100,100)"});this._knobOuter=l({tagName:"circle","class":"cesium-animation-knobOuter",cx:0,cy:0,r:71});var C=61,w=l({tagName:"circle","class":"cesium-animation-knobInner",cx:0,cy:0,r:C});this._knobDate=u(0,-24,""),this._knobTime=u(0,-7,""),this._knobStatus=u(0,-41,"");var S=l({tagName:"circle","class":"cesium-animation-blank",cx:0,cy:0,r:C}),E=document.createElementNS(v,"g");E.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(i),s.appendChild(E),s.appendChild(y),s.appendChild(h),E.appendChild(f),E.appendChild(_),E.appendChild(this._shuttleRingPointer),y.appendChild(this._knobOuter),y.appendChild(w),y.appendChild(this._knobDate),y.appendChild(this._knobTime),y.appendChild(this._knobStatus),y.appendChild(S),n.appendChild(s),e.appendChild(n); -var b=this,T=function(e){p(b,e)};this._mouseCallback=T,f.addEventListener("mousedown",T,!0),f.addEventListener("touchstart",T,!0),_.addEventListener("mousedown",T,!0),_.addEventListener("touchstart",T,!0),document.addEventListener("mousemove",T,!0),document.addEventListener("touchmove",T,!0),document.addEventListener("mouseup",T,!0),document.addEventListener("touchend",T,!0),this._shuttleRingPointer.addEventListener("mousedown",T,!0),this._shuttleRingPointer.addEventListener("touchstart",T,!0),this._knobOuter.addEventListener("mousedown",T,!0),this._knobOuter.addEventListener("touchstart",T,!0);var x,A=this._knobTime.childNodes[0],M=this._knobDate.childNodes[0],D=this._knobStatus.childNodes[0];this._subscriptions=[a(t.pauseViewModel,"toggled",function(e){x!==e&&(x=e,x?b._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):b._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),a(t,"shuttleRingAngle",function(e){c(b._shuttleRingPointer,b._knobOuter,e)}),a(t,"dateLabel",function(e){M.textContent!==e&&(M.textContent=e)}),a(t,"timeLabel",function(e){A.textContent!==e&&(A.textContent=e)}),a(t,"multiplierLabel",function(e){D.textContent!==e&&(D.textContent=e)})],this.applyThemeChanges(),this.resize()};return r(A.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),A.prototype.isDestroyed=function(){return!1},A.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),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,r=0,n=t.length;n>r;r++)t[r].dispose();return i(this)},A.prototype.resize=function(){var e=this._container.clientWidth,t=this._container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){var r=this._svgNode,i=200,n=132,o=e,a=t;0===e&&0===t?(o=i,a=n):0===e?(a=t,o=i*(t/n)):0===t&&(o=e,a=n*(e/i));var s=o/i,l=a/n;r.style.cssText="width: "+o+"px; height: "+a+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",r.setAttribute("width",o),r.setAttribute("height",a),r.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}},A.prototype.applyThemeChanges=function(){var e=s(this._themeNormal),r=s(this._themeHover),i=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,_)},{tagName:"stop",offset:"12%","stop-color":h(e,y)},{tagName:"stop",offset:"46%","stop-color":h(e,C)},{tagName:"stop",offset:"81%","stop-color":h(e,w)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(r,_)},{tagName:"stop",offset:"12%","stop-color":h(r,y)},{tagName:"stop",offset:"46%","stop-color":h(r,C)},{tagName:"stop",offset:"81%","stop-color":h(r,w)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(i,_)},{tagName:"stop",offset:"12%","stop-color":h(i,y)},{tagName:"stop",offset:"46%","stop-color":h(i,C)},{tagName:"stop",offset:"81%","stop-color":h(i,w)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(n,S)},{tagName:"stop",offset:"75%","stop-color":h(n,E)}]},{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,T)},{tagName:"stop",offset:"100%","stop-color":h(a,T)}]},{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,_)},{tagName:"stop",offset:"60%","stop-color":h(o,b)},{tagName:"stop",offset:"85%","stop-color":h(o,y)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,b)},{tagName:"stop",offset:"60%","stop-color":h(o,_)},{tagName:"stop",offset:"85%","stop-color":h(o,w)}]},{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},A}),r("Widgets/createCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../ThirdParty/knockout"],function(e,t,r,i,n,o){"use strict";var a=function(t,i){function a(){var e,r={args:arguments,cancel:!1};return s.raiseEvent(r),r.cancel||(e=t.apply(null,arguments),l.raiseEvent(e)),e}i=e(i,!0);var s=new n,l=new n;return a.canExecute=i,o.track(a,["canExecute"]),r(a,{beforeExecute:{value:s},afterExecute:{value:l}}),a};return a}),r("Widgets/ToggleButtonViewModel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../ThirdParty/knockout"],function(e,t,r,i,n){"use strict";var o=function(t,r){this._command=t,r=e(r,e.EMPTY_OBJECT),this.toggled=e(r.toggled,!1),this.tooltip=e(r.tooltip,""),n.track(this,["toggled","tooltip"])};return r(o.prototype,{command:{get:function(){return this._command}}}),o}),r("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,r,i,n,o,a,s,l,u,c){"use strict";function h(e){e.clockStep===r.SYSTEM_CLOCK&&(e.clockStep=r.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=1)}function d(e){h(e),e.shouldAnimate=!0}function m(e,t){return e-t}function p(t,r){var i=e(r,t,m);return 0>i?~i:i}function f(e,t){if(Math.abs(e)<=_)return e/_;var r,i,n=_,o=y,a=0;return e>0?(r=Math.log(t[t.length-1]),i=(r-a)/(o-n),Math.exp(a+i*(e-n))):(r=Math.log(-t[0]),i=(r-a)/(o-n),-Math.exp(a+i*(Math.abs(e)-n)))}function v(e,t,i){if(i.clockStep===r.SYSTEM_CLOCK)return _;if(Math.abs(e)<=1)return e*_;var n,o,a=_,s=y,l=0;return e>0?(n=Math.log(t[t.length-1]),o=(n-l)/(s-a),(Math.log(e)-l)/o+a):(n=Math.log(-t[0]),o=(n-l)/(s-a),-((Math.log(Math.abs(e))-l)/o+a))}var g=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],_=15,y=105,C=function(e){var i=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=C.defaultDateFormatter,this._timeFormatter=C.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,s.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(C.defaultTicks),this.timeLabel=void 0,s.defineProperty(this,"timeLabel",function(){return i._timeFormatter(i._clockViewModel.currentTime,i)}),this.dateLabel=void 0,s.defineProperty(this,"dateLabel",function(){return i._dateFormatter(i._clockViewModel.currentTime,i)}),this.multiplierLabel=void 0,s.defineProperty(this,"multiplierLabel",function(){var e=i._clockViewModel;if(e.clockStep===r.SYSTEM_CLOCK)return"Today";var t=e.multiplier;return 0===t%1?t.toFixed(0)+"x":t.toFixed(3).replace(/0{0,3}$/,"")+"x"}),this.shuttleRingAngle=void 0,s.defineProperty(this,"shuttleRingAngle",{get:function(){return v(e.multiplier,i._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,y),-y);var t=i._allShuttleRingTicks,n=i._clockViewModel;if(n.clockStep=r.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)===y)return n.multiplier=e>0?t[t.length-1]:t[0],void 0;var o=f(e,t);if(i.snapToTicks)o=t[p(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=0|Math.round(o/l)*l}else a>_?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=i._clockViewModel,r=e.clockRange;if(i.shuttleRingDragging||r===t.UNBOUNDED)return!0;var n=e.multiplier,o=e.currentTime,s=e.startTime,l=!1;if(r===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)&&0>n}return l||(e.shouldAnimate=!1),l}),this._isSystemTimeAvailable=void 0,s.defineProperty(this,"_isSystemTimeAvailable",function(){var e=i._clockViewModel,r=e.clockRange;if(r===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 i._clockViewModel.shouldAnimate&&(i._canAnimate||i.shuttleRingDragging)});var n=u(function(){var e=i._clockViewModel;e.shouldAnimate?(h(e),e.shouldAnimate=!1):i._canAnimate&&d(e)});this._pauseViewModel=new c(n,{toggled:s.computed(function(){return!i._isAnimating}),tooltip:"Pause"});var o=u(function(){var e=i._clockViewModel;h(e);var t=e.multiplier;t>0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new c(o,{toggled:s.computed(function(){return i._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});var l=u(function(){var e=i._clockViewModel;h(e);var t=e.multiplier;0>t&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new c(l,{toggled:s.computed(function(){return i._isAnimating&&e.multiplier>0&&e.clockStep!==r.SYSTEM_CLOCK}),tooltip:"Play Forward"});var m=u(function(){var e=i._clockViewModel;e.clockStep=r.SYSTEM_CLOCK,e.multiplier=1,e.shouldAnimate=!0},s.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new c(m,{toggled:s.computed(function(){return e.shouldAnimate&&e.clockStep===r.SYSTEM_CLOCK}),tooltip:s.computed(function(){return i._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=u(function(){var e=i._clockViewModel;h(e);var t=i._allShuttleRingTicks,r=e.multiplier,n=p(r,t)-1;n>=0&&(e.multiplier=t[n])}),this._faster=u(function(){var e=i._clockViewModel;h(e);var t=i._allShuttleRingTicks,r=e.multiplier,n=p(r,t)+1;nt;++t)i=e[t],n.hasOwnProperty(i)||(n[i]=!0,o.push(i));o.sort(m);var a=[];for(r=o.length,t=r-1;t>=0;--t)i=o[t],0!==i&&a.push(-i);Array.prototype.push.apply(a,o),this._allShuttleRingTicks=a},n(C.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}}}),C._maxShuttleRingAngle=y,C._realtimeShuttleRingAngle=_,C}),r("Widgets/BaseLayerPicker/BaseLayerPickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EllipsoidTerrainProvider","../../Core/isArray","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(r){r=e(r,e.EMPTY_OBJECT);var i=r.globe,l=e(r.imageryProviderViewModels,[]),u=e(r.terrainProviderViewModels,[]);this._globe=i,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,r=this.selectedTerrain,i=t(e)?e.name:void 0,n=t(r)?r.name:void 0;return t(i)&&t(n)?i+"\n"+n:t(i)?i: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 this.dropDownVisible=!1,void 0;var r,i=this._currentImageryProviders,n=i.length,a=this._globe.imageryLayers;for(r=0;n>r;r++)for(var s=a.length,l=0;s>l;l++){var u=a.get(l);if(u.imageryProvider===i[r]){a.remove(u);break}}if(t(e)){var h=e.creationCommand();if(o(h)){var d=h.length;for(r=d-1;r>=0;r--)a.addImageryProvider(h[r],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 this.dropDownVisible=!1,void 0;var r;t(e)&&(r=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(r instanceof n),this._globe.terrainProvider=r,h(e),this.dropDownVisible=!1}});var d=this;this._toggleDropDown=s(function(){d.dropDownVisible=!d.dropDownVisible}),this.selectedImagery=e(r.selectedImageryProviderViewModel,l[0]),this.selectedTerrain=e(r.selectedTerrainProviderViewModel,u[0])};return r(l.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),l}),r("Widgets/BaseLayerPicker/BaseLayerPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./BaseLayerPickerViewModel"],function(e,t,r,i,n,o,a){"use strict";var s=function(e,t){e=o(e);var r=new a(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);var s=document.createElement("img");s.setAttribute("draggable","false"),s.className="cesium-baseLayerPicker-selected",s.setAttribute("data-bind","attr: { src: buttonImageUrl }"),i.appendChild(s);var l=document.createElement("div");l.className="cesium-baseLayerPicker-dropDown",l.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(l);var u=document.createElement("div");u.className="cesium-baseLayerPicker-sectionTitle",u.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),u.innerHTML="Imagery",l.appendChild(u);var c=document.createElement("div");c.className="cesium-baseLayerPicker-choices",c.setAttribute("data-bind","foreach: imageryProviderViewModels"),l.appendChild(c);var h=document.createElement("div");h.className="cesium-baseLayerPicker-item",h.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedImagery = $data; }'),c.appendChild(h);var d=document.createElement("img");d.className="cesium-baseLayerPicker-itemIcon",d.setAttribute("data-bind","attr: { src: iconUrl }"),d.setAttribute("draggable","false"),h.appendChild(d);var m=document.createElement("div");m.className="cesium-baseLayerPicker-itemLabel",m.setAttribute("data-bind","text: name"),h.appendChild(m);var p=document.createElement("div");p.className="cesium-baseLayerPicker-sectionTitle",p.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),p.innerHTML="Terrain",l.appendChild(p);var f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: terrainProviderViewModels"),l.appendChild(f);var v=document.createElement("div");v.className="cesium-baseLayerPicker-item",v.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedTerrain = $data; }'),f.appendChild(v);var g=document.createElement("img");g.className="cesium-baseLayerPicker-itemIcon",g.setAttribute("data-bind","attr: { src: iconUrl }"),g.setAttribute("draggable","false"),v.appendChild(g);var _=document.createElement("div");_.className="cesium-baseLayerPicker-itemLabel",_.setAttribute("data-bind","text: name"),v.appendChild(_),n.applyBindings(r,i),n.applyBindings(r,l),this._viewModel=r,this._container=e,this._element=i,this._dropPanel=l,this._closeDropDown=function(e){i.contains(e.target)||l.contains(e.target)||(r.dropDownVisible=!1)},document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0)};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 document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0),n.cleanNode(this._element),n.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),r(this)},s}),r("Widgets/BaseLayerPicker/ProviderViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n){"use strict";var o=function(t){var r=t.creationFunction;e(r.canExecute)||(r=n(r)),this._creationCommand=r,this.name=t.name,this.tooltip=t.tooltip,this.iconUrl=t.iconUrl,i.track(this,["name","tooltip","iconUrl"])};return t(o.prototype,{creationCommand:{get:function(){return this._creationCommand}}}),o}),r("Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels",["../../Core/buildModuleUrl","../../Scene/ArcGisMapServerImageryProvider","../../Scene/BingMapsImageryProvider","../../Scene/BingMapsStyle","../../Scene/OpenStreetMapImageryProvider","../../Scene/TileMapServiceImageryProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(){var s=[];return s.push(new a({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 r({url:"//dev.virtualearth.net",mapStyle:i.AERIAL})}})),s.push(new a({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 r({url:"//dev.virtualearth.net",mapStyle:i.AERIAL_WITH_LABELS})}})),s.push(new a({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 r({url:"//dev.virtualearth.net",mapStyle:i.ROAD})}})),s.push(new a({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:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"})}})),s.push(new a({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:"//services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"})}})),s.push(new a({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:"//services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/"})}})),s.push(new a({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 new n({url:"//a.tile.openstreetmap.org/"})}})),s.push(new a({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 new n({url:"//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."})}})),s.push(new a({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 new n({url:"//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."})}})),s.push(new a({name:"MapQuest Open­Street­Map",iconUrl:e("Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",creationFunction:function(){return new n({url:"//otile1-s.mqcdn.com/tiles/1.0.0/osm/"})}})),s.push(new a({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 new o({url:"//cesiumjs.org/blackmarble",maximumLevel:8,credit:"Black Marble imagery courtesy NASA Earth Observatory"})}})),s.push(new a({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 new o({url:e("Assets/Textures/NaturalEarthII")})}})),s}return s}),r("Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels",["../../Core/buildModuleUrl","../../Core/CesiumTerrainProvider","../../Core/EllipsoidTerrainProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,r,i){"use strict";function n(){var n=[];return n.push(new i({name:"WGS84 Ellipsoid",iconUrl:e("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",creationFunction:function(){return new r}})),n.push(new i({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:"//cesiumjs.org/stk-terrain/tilesets/world/tiles"})}})),n.push(new i({name:"Small Terrain heightmaps with water",iconUrl:e("Widgets/Images/TerrainProviders/STK.png"),tooltip:"Medium-resolution, heightmap-based terrain for the entire globe. This tileset also includes a water mask. Free for use on the Internet.\nhttp://www.agi.com",creationFunction:function(){return new t({url:"//cesiumjs.org/smallterrain",credit:"Terrain data courtesy Analytical Graphics, Inc."})}})),n}return n}),r("Widgets/CesiumInspector/CesiumInspectorViewModel",["../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Rectangle","../../Scene/DebugModelMatrixPrimitive","../../Scene/PerformanceDisplay","../../Scene/TileCoordinatesImageryProvider","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s,l,u){"use strict"; -function c(e){var r;if(t(e)){r="Command Statistics";var i=e.commandsInFrustums;for(var n in i)if(i.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 ")}r+="
    "+i[n]+" in frustum "+o}r+="
Total: "+e.totalCommands}return r}var h=new e(.15,.15,.15,.75),d=function(e,r){var i=this,c=e.canvas;this._scene=e,this._canvas=c,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=r;var d=this._scene.globe;d.depthTestAgainstTerrain=!0,this.frustums=!1,this.performance=!1,this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!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="+",l.track(this,["filterTile","suspendUpdates","dropDownVisible","frustums","frustumStatisticText","pickTileActive","pickPrimitiveActive","hasPickedPrimitive","hasPickedTile","tileText","generalVisible","generalSwitchText","primitivesVisible","primitivesSwitchText","terrainVisible","terrainSwitchText"]),this._toggleDropDown=u(function(){i.dropDownVisible=!i.dropDownVisible}),this._toggleGeneral=u(function(){i.generalVisible=!i.generalVisible,i.generalSwitchText=i.generalVisible?"-":"+"}),this._togglePrimitives=u(function(){i.primitivesVisible=!i.primitivesVisible,i.primitivesSwitchText=i.primitivesVisible?"-":"+"}),this._toggleTerrain=u(function(){i.terrainVisible=!i.terrainVisible,i.terrainSwitchText=i.terrainVisible?"-":"+"}),this._showFrustums=u(function(){return i._scene.debugShowFrustums=i.frustums?!0:!1,!0}),this._showPerformance=u(function(){return i.performance?i._performanceDisplay=new a({container:i._performanceContainer,backgroundColor:h,font:"12px arial,sans-serif"}):i._performanceContainer.innerHTML="",!0}),this._showPrimitiveBoundingSphere=u(function(){return i._primitive.debugShowBoundingVolume=i.primitiveBoundingSphere,!0}),this._showPrimitiveReferenceFrame=u(function(){if(i.primitiveReferenceFrame){var e=i._primitive.modelMatrix;i._modelMatrixPrimitive=new o({modelMatrix:e}),i._scene.primitives.add(i._modelMatrixPrimitive)}else t(i._modelMatrixPrimitive)&&(i._scene.primitives.remove(i._modelMatrixPrimitive),i._modelMatrixPrimitive=void 0);return!0}),this._doFilterPrimitive=u(function(){return i._scene.debugCommandFilter=i.filterPrimitive?function(e){return t(i._modelMatrixPrimitive)&&e.owner===i._modelMatrixPrimitive._primitive?!0:t(i._primitive)?e.owner===i._primitive||e.owner===i._primitive._billboardCollection||e.owner.primitive===i._primitive:!1}:void 0,!0}),this._showWireframe=u(function(){return d._surface.tileProvider._debug.wireframe=i.wireframe,!0}),this._doSuspendUpdates=u(function(){return d._surface._debug.suspendLodUpdate=i.suspendUpdates,i.suspendUpdates||(i.filterTile=!1),!0});var m;this._showTileCoordinates=u(function(){return i.tileCoordinates&&!t(m)?m=e.imageryLayers.addImageryProvider(new s({tilingScheme:e.terrainProvider.tilingScheme})):!i.tileCoordinates&&t(m)&&(e.imageryLayers.remove(m),m=void 0),!0}),this._showTileBoundingSphere=u(function(){return d._surface.tileProvider._debug.boundingSphereTile=i.tileBoundingSphere?i._tile:void 0,!0}),this._doFilterTile=u(function(){return i.filterTile?(i.suspendUpdates=!0,i.doSuspendUpdates(),d._surface._tilesToRender=[],t(i._tile)&&d._surface._tilesToRender.push(i._tile)):(i.suspendUpdates=!1,i.doSuspendUpdates()),!0});var p=function(e){i._canvas.removeEventListener("mousedown",p,!1),i.pickPrimitiveActive=!1;var r=i._scene.pick({x:e.clientX,y:e.clientY});t(r)&&(i.primitive=t(r.collection)?r.collection:r.primitive)};this._pickPrimitive=u(function(){i.pickPrimitiveActive=!i.pickPrimitiveActive,i.pickPrimitiveActive?i._canvas.addEventListener("mousedown",p,!1):i._canvas.removeEventListener("mousedown",p,!1)});var f=function(e){var r,o=d.ellipsoid,a=i._scene.camera.pickEllipsoid({x:e.clientX,y:e.clientY},o);if(t(a))for(var s=o.cartesianToCartographic(a),l=d._surface.tileProvider._tilesToRenderByTextureCount,u=0;!r&&un&&(e.resize(),e.render(),e._lastFrameTime=a-s%n),d(t)}else e.resize(),e.render(),d(t)}catch(l){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){var u="An error occurred while rendering. Rendering has stopped.";e.showErrorPanel(u,void 0,l)}}else e._renderLoopRunning=!1}e._renderLoopRunning=!0,e._lastFrameTime=h(),d(t)}function T(e){var t=e._canvas,r=t.clientWidth,i=t.clientHeight,o=n(window.devicePixelRatio,1)*e._resolutionScale;e._canvasWidth=r,e._canvasHeight=i,r*=o,i*=o,t.width=r,t.height=i,e._canRender=0!==r&&0!==i}function x(e){var t=e._canvas,r=t.width,i=t.height;if(0!==r&&0!==i){var n=e._scene.camera.frustum;o(n.aspectRatio)?n.aspectRatio=r/i:(n.top=n.right*(i/r),n.bottom=-n.top)}}var P="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAAaCAYAAABikagwAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB9wGGRQyF371QVsAABOHSURBVGje7Vp5cFTHmf91v2Nm3owGnYMuEEJCOBiEjDlsDMYQjGMOOwmXcWxiLywpJ9iuTXZd612corJssFOxi8LerXizxEGUvWsivNxxHHCQ8WYBYSFzmUMCCXQjaUajOd/V+4f6Kc14kI/KZv/xq+p6M/PmO15/9/c1wa0vwpcMQAHgBuAFoPG7mz8jAGwASQBxADFhJQGYACwAjK+vrr/AJQ8jVMqfuwH4AGQByAaQnTNqXGHWqHGFbq8/g1BJsgw9GQ12Bds/qWsxEvEeAEEAfQDCAKKCgPGVcP//BOsIVQHgAZAJIACgsHTqvDvK7150T2bR2DFaZm6W4slwUypR20yaiUg4OtDbcaP36rlPPt6/7f2B3q5mAB0AeriAE18J9y93kVu4X4W73BwAhQBK5v/gZ98ZVXXvDG92IJMx569MQDEoK0tPmOHu1s4L7799sH7vtvcAXAPQCaCfu2qLu+7h+Eh3sS8Bcyt48iVgPos2+4J7jS+BIx2etDBSynfH/Xq46y0CUL70n3/zXMmUuXepWoZHFCQhFIQARCBFJYV6/Nn+QHnVBH9Ovq/51JFWADpfJhcqEzyDcx9ukTTr/xr2VnDpng0nuHR0h1u3wvWF6EspgBIAFYAfQAGAsuU/rfm7kePvvJ0QiTj6QSgBISS9ujEGSikkxaXklIwfK8uK2Xru2HVurWKspZyezGmmWwp/LqVsupPQub4grPQ5YIejKQvPJAGflLLJSBGmxPEqKXhU4XdJEBq7BR5Z+L+DKx3MTTHWEaybx9WCud/btCJQMeX2Qevk+NPoks0YPArF/RUj0NyXxOmO2CAy1a1OmL9yUVfTmatXTx52EildYFQVNlgRmBR1xQJgCBbPBAVUhcw8lTObLz0FVk4RIEmJJyJNZzFBiCTFBRL+f50rriFUATRFiZSU/XYEAw6X5LlIUghZqXvl5p8pfycRZsgjymlKGw1Adm7JbRUVs785nwGghP5pp9mfFMOxWstmuC3gwdcrRqA/buJUWwyKRMAYgydrZNZt9337623njn+ixyN9nAmdM5nBvYOPfxc3mnEmTQ4T5VZv8hfz8aUKnocJd5tvVhxAhOMADzNefleFjRUFa/D/xzi8LQhIEpTG4VXnNBzlZYISufk7juCfqaAoLkHYcZ6HBAEM8O+ObJz3HcFDpJfDJwWYfiHMMTklviocKHv6I3+zRFLdKhEEatmALBFIBIibNhQ6KFyJEjT2JHDoUj/a+nVIVIBhBGOnzptWXzhmTFfT2TZBOH4AgSeeeGJqRUVFqdfr9btcLnVQXwapmqZpJZPJRCgUCh47duzie++9dwWAXl5enrlp06bF0WhUM01TYYwRrmg2vzNKqS3Lsunz+Yy6urpTP//5z09blkVLSkryVq9ePT03NzegqqqbUnqTGyOEMNM0k319fX2///3vz9bW1l4DYD700EPFy5Ytm65pmvbBBx9c2rp166Wnnnqq7MEHH5zAGIu8/vrr+w8ePPgJVwrRO2gAcg8cOLA2mUx62tvbB9avX39s+fLlo++///5JXNiwbXugpqam9tChQ2cEj6NzuQwlsi+//PKSzMzMQtu2qcfjMZqbm09v2LDht4J3sQEQOU2Jo8mKKzt7VEU5lSgFBi3PZkBZrgv3lGbCo1Jc7I7iSGN40JcQgoGkhXdO94ESQJEoGI+1k/M9mDKqQHEv++akl186e45rNAAE3njjjccWLFhwfyAQyJEkiabGbcc7JJNJva2trX3Lli3vvPbaa+eKi4uLV6xY8d10cf5TcZ8x5OXl5b366qs9lFLtrbfeWldVVXW7pmkuxhjS0SSEIJlMGitXrrz2/PPPv1lTU3NtypQp0x955JG/kmVZdrlcR7du3WrOnTt33pIlS+YDwNGjR68ePHiwjVtukm+wI9ichQsXPgUAHR0d3evXr78xc+bMu9asWbOQUjpENz8/v/jQoUP/IiiH40UzAeQvW7Zs1rp16/7a5/NpDr/19fWlGzZsOM4tNsphkc5iPaXTvl6uuDUvY4MZLwNQ4Ffw+LR8+KQQTCuJSQUFcMsEe88FoSkSKCFwyWSISQbg9pEefHdGAJHIdUydVjFecL3K448/Pm3hwoUPBAKBHFGIlmU5pRCRpMGEze12q2PHjh2zatWqeTt37gwODAxkOQIJhUJ6Y2Njn6IojFJqE0KYsGyPx0POnTvXnUgkfGvXrr1j5syZU7iFsKampv5YLBZ34GzbJgAwatSo7MzMTE95eXnZT37yk0dramr+PRQKZSQSCdPn88nBYNADID8UCmkAYBiGGQ6Hna6cksbdZliWZUuSRKPRKAAUBINBfywWM30+n+yEtenTp9+5YsWKGTt37oxwz+a44RwARc8+++xSr9eriQrY398v8311CUncTTHN0Q7Vl1OQJymq4iBwyxQPT8qDVwri1d1/i8ttp/AP39mOBeMn41pQx9mOGFSZ3qT52ZqMR6aMRGvXKfzbgX9Ea3PnSLEdOWXKlK/5/X4/AFy8ePHG6tWr90QikS5VVaOEEIsxRhljngcffLBi8+bNjxBCUFJSMrKkpMRvGIbboXP27Nn+2bNn/3cgEIgSQmKEEAOARQixKKVxRVEioVAoYtu2dMcdd4x24Hbv3t3+ox/96ONoNBqklMa4ppNkMinNnz8///nnn6/y+Xw0mUxaANy6rrsdl28YhguAX9d1F98jwn9TUjJkJ5N1DWV0ti0ByDAMw+PsbzQatX0+Hy0oKMhcvnz5nP3791+IxWJRIUaPfO655+ZVVlaOA4BoNGprmkZ5uJJThZouKyYAqOrWVEKoE7cwszQDlQUK3jr8S5y++iEIIXh55/fwylOH8e3KHHSEdfQnLFBuRbJEsLQyF27Sh3eO/iuudV+EaSuqkJF6MjMzs9xutwIAv/rVr06eOHHiEwCtPBHQOaPaxYsXLxcXF8cKCwtzOzo6+ltbW4OFhYU+h2nDMAgAqbu7W8xkLSEBcsos1bbtocZIIBBQs7Ky5Pb2dkvXdV1wfaipqemsqak5yF1bFABljNEU4Sj87nia1LKHCJWGLLh6AkDhiksAoLq6um/VqlWZWVlZ8gMPPHDHwoULK2tqasJcYJ7y8vKyb33rW/f4/X43YwybNm26vnnz5pIUb0tvVe44maSVjEfizDJtmwFlOS4srczGiQvv4ncnd4ASAkIo+mN92LLrB/j7Vb/GQxOz8Z/1PTDsQXc6p3QEqopU7Dr6S5y8fAiKpCKhs6SQSUqyLKsO4d7e3j4AvbxD1csFQQF4EolEaP369TVCFjuiqKiogG8w5s6dm8sY++ZwcfbZZ5/dvHXr1isnT55scVz+rFmz8urr6xc4Ls22bZZIJExd181oNGr09PREDx06dPmFF144Ho/HTVGIjiE4guECoyl1LYTPcppGEAghDAAikUjixRdfbHnppZfKfD6fa82aNfMOHz7cHgwGbwBwr1ix4u677rqrgsfU4I4dO66lCPZTXSkqpOaMa60e7mjuosw0RmYoWHf3SLT3NOKt91+CbsZBeOlDCcX5luP4rw9fw4wSH+4p9cMlU3xtpAfLJmej/vIR7PnjLyDRwXeKhoxubokWAOYkDXxTLE5brB11oTZMCrWoNQgymJwZhsHC4bAZjUaNaDRqxGIx3VnxeDzJky8TQGLHjh3n9u3bd6ytrS3U2dkZ6e3tjfX398cHBgYS8XjcIIQQr9frKioq8ldWVhb88Ic/vHfbtm3zAXhs25aHUx7uEt1COeXEXM3JfAWLvWnSxRhLbNu2rampqSlMCME3vvGNyXPmzKkCUFZeXn776tWr72WMwbZtvPDCCx+5XK6wo6BcOdhwQ4Chuu/KR39onDGS9T80u9ivkgiqD/0UbT2NcKvelMaEhXfrqlGaPwEPT5qH0lwvqopcaOtpxPb3/gmGmYBEFRBC0HUlfp67tQQALxMKYsaYU+tlcSadNN8NIOO+++4bnZ2d7Q+Hw+zIkSNJxtiQ9TQ1NUW3bNnSmJWVlZBlWaeUWs5SVTUxYsSIRF1dXScAwzTN2MMPP7w3Pz//ZFVVVUFubq7L6/VKmqZRl8ulKIriVlVVmz59ev6cOXMCLpeLLliwYDyAOpGm08SglA659mQy6eHTrwiPtRYXbi6vP2/yjI61AoDL5Ur09vZ2bt++/ezGjRvvppSSjRs3Lti9e/fvnnzyyfHjx48fyRjDwYMHL9TW1jYWFhZ6xfIs3UhUTlPQRwGE9Gv/c/ba9YGi2rPv0FONf/iUUB3Lj8SDqD60GYtmdGBcYSVOnL+K39b9Gp19zVDkwZzBSpLY9Qv9Z3lKHgOgmaYZd9zg1KlTS994441L3G3lcD6oo/1btmxZFwgEctrb27vWrFlzwLIs2cmKW1pa4q+//vp1AbchdIKiPGZHAJDFixcHpk+ffnsoFNLefvvt3ra2Nl0YSDhdt4zy8vLwsWPHsl0ul6ooigSACuEZXKBJwzAMxhhUVZW8Xm8uH5hQ3mCwOf95VVVVYx03yQVhUEpNQbBxADfefPPN6NKlS8dUVlYWVlZW5r344osz1q1bV8IYQzAYjFVXV5+IxWIdkiTlpfDCUgcC6Sw2CqBvw4ZN+7/9d+Wzo1avT5HU9N1tMpj4dfU14z/efxletx9xPYpIPAhVccO2bVBKcf189I/h3mSLkBi5b9y40RWLxZJer9f12GOPTa6oqMjq6enpJYQYlFLGyx21tLQ0MGnSpDGEECQSCZMQIjuNCF6aqI8++mheVlZWJrdYkzcoLEVREj6fL1FfX39x165dzfPnzy/7/ve/v1LXdWvlypVde/bsuRKLxQyn1LEsS2aMeebNm1fs8/lkxhgsy7IAJBRF0Yc2TZZ1AANNTU0djoJt2rRpzqxZs/K6urq6JUnSCSHMMAxZ07SsxYsXV1JKCWMMAwMDMQBhVVWTjtU6gr1y5Yq1d+/ej8aNG5eraZr6zDPPjPV4PBJjDLW1ted27dr1MYCYqqpDcpMkyRIaEyydxToxNgagr7e3t+XEe0rNxPkjnvhTznNr4Sb0KBL6YO9BovJQnRXptTqaPgr9wTLsDgAhTkOurq4+unz58vs1TRvl9/vVuXPnljHGxgqxw2GcEjLYJLlw4cKV06dPd06bNo04+MePH+/ftm3bNNG1iW5KVVVl//79ew4cONC8d+/ey88884ysKIp85513jpo8eXJh2pHX4EUIITh58uRFAN1utzvHcb0ejycGoKuurk5vbW29u7i4ODB69OisJ5988i4xxDhsKIoiEUJgmqZ94MCBOgBdmqaVODxrmhbhiaP+4x//+N2lS5dOmjBhwhiPxyMBQFdXV191dfX7tm23AdBdLtdQzFYUxWmb3iRcmqbh7vQfOz9+v/PdjvP6kcHuE288MJZWuM4Smw1mgkQvHw/v6Wga+BjADY53AEDfmTNnLq9du/Znp06datB13RA3ROwGmaZphcPhgX379v326aefftO27Tafz9fJGGOmadqMMSbLMpEkiaZbjDFommYQQsK1tbWNr7zyymvhcLifEIJbwRBCmGVZ1vHjxz9atGjRLwA0Z2dndzpdHb/fHwTQcuLEiYann3761fPnz3+i67pBCCGUUkoIofwjpZQS27ZZd3f3ja1bt1Zv3LhxL4CrmZmZPYQQkxCCjIyMEIB2AG0Amrdv3/6beDweNwzD1nXdPHXq1Indu3cf48+7MjIyupw98ng8EW4wCWH4kHbQLgsnJ4oAlN332Ji1hbeps6lEaLohQLrhQCJi9zcei77TcLh9H4CrALp4rLN5LBvBE4scAP6JEyfmBQIBL6VUopSCMcYGBgYSly5dCvX19YW5QkQAmD6fz3PvvfeWxmIxr2EYHqFXPBRrKKWWJEmG1+uNtbW1dTU0NNzgz7wA/OXl5bkFBQV+XsYQwVpZMpk0jh8/3snpRQCYo0aN8k6YMCHX5XLRa9euBRsaGnr4Jnp458c7ceLEbK/X6xL5MQzDbGhoCNq2HeO4YgBYWVmZv6KiIkdVVbS0tHQ3NDR0CsORrDlz5oyllHoYY3p9ff31cDjczeGhaVrGkiVLSg3DkLu7u/s+/PDDFn4UKeJYLhnmAJvGs9QCAKOnLMhfNHqSNl/LlHOpTORbWa4et2ORXqv1wgf9NVfO9B7nTYcuPvlICq02t9CJ8ggjOJomodOF0ZQtHNvxCC08pBnbmcIhO53jdA7mpXaKUkOSWGoxYaaKlIa7IozT0uET+XDGehDGhhBGb6bTmBHezeb8OyNPCPQk/ptzeHConCSfcZDNI1hWQXaBVl5254hZmSPVce4MKUdxEQ+VJMnUbcNIWJFoyOzoa02eOX2k+yg/79TFNWkgZchOUobe4vA63WzUEmpYsa+dCoM0Izgz5aQkTUOPpGvUpKFJBaUR8Q03cLdT8NkppyEgPGOCYcnCiNASsn2SwrstDA2Gxnbkc5xSdHGrcmaBWYoqZ+YUe4pcXuqXJCobupWIhaze3vZohzAfdOaKN2mSwPxwR0ZSZ6uptZoIN9yxFCYIiqV5v3THStgwNNPhvtXxFgzDP9K8q52Cj6ZRNnaLffoUDfI5zhVLgrvxCN0Ux5URYXYYF84Wf2qqf4uDV591ZuiLHir7c8F+mZOU5M+Iazg8n3mYjnxORkV3I6dxg6KrMQW3Yaexlq+uv8D1v2IL+t4z3B/NAAAAAElFTkSuQmCC",A=function(e,a){e=S(e),a=n(a,{});var s=document.createElement("div");s.className="cesium-widget",e.appendChild(s);var l=document.createElement("canvas");l.oncontextmenu=function(){return!1},l.onselectstart=function(){return!1},s.appendChild(l);var c=document.createElement("div");c.className="cesium-widget-credits";var h=o(a.creditContainer)?S(a.creditContainer):s;h.appendChild(c),this._element=s,this._container=e,this._canvas=l,this._canvasWidth=0,this._canvasHeight=0,this._creditContainer=c,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=n(a.showRenderLoopErrors,!0),this._resolutionScale=1,this._forceResize=!1,this._clock=o(a.clock)?a.clock:new r,this._lastFrameTime=void 0,T(this);try{var d=new g({canvas:l,contextOptions:a.contextOptions,creditContainer:c,mapProjection:a.mapProjection,orderIndependentTranslucency:a.orderIndependentTranslucency,scene3DOnly:n(a.scene3DOnly,!1)});this._scene=d,d.camera.constrainedAxis=t.UNIT_Z,x(this);var b=u.WGS84,A=d.frameState.creditDisplay,M=new i("Cesium",P,"http://cesiumjs.org/");A.addDefaultCredit(M);var D=new f(b);this._globe=D,d.globe=D;var I=a.skyBox;o(I)||(I=new C({sources:{positiveX:E("px"),negativeX:E("mx"),positiveY:E("py"),negativeY:E("my"),positiveZ:E("pz"),negativeZ:E("mz")}})),d.skyBox=I,d.skyAtmosphere=new y(b),d.sun=new w,d.moon=new v;var O=a.imageryProvider;o(O)||(O=new p({url:"//dev.virtualearth.net"})),O!==!1&&d.imageryLayers.addImageryProvider(O),o(a.terrainProvider)&&(d.terrainProvider=a.terrainProvider),this._screenSpaceEventHandler=new m(l),o(a.sceneMode)&&(a.sceneMode===_.SCENE2D&&this._scene.morphTo2D(0),a.sceneMode===_.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 R=this;d.renderError.addEventListener(function(e,t){if(R._useDefaultRenderLoop=!1,R._renderLoopRunning=!1,R._showRenderLoopErrors){var r="An error occurred while rendering. Rendering has stopped.";R.showErrorPanel(r,void 0,t)}})}catch(L){var N="Error constructing CesiumWidget.",F='Visit http://get.webgl.org 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:';throw this.showErrorPanel(N,F,L),L}};return a(A.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}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){if(0>=e)throw new l("targetFrameRate must be greater than 0.");this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&b(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){if(0>=e)throw new l("resolutionScale must be greater than 0.");this._resolutionScale=e,this._forceResize=!0}}}),A.prototype.showErrorPanel=function(e,t,r){var i=this._element,n=document.createElement("div");n.className="cesium-widget-errorPanel";var a=document.createElement("div");a.className="cesium-widget-errorPanel-content",n.appendChild(a);var s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),a.appendChild(s);var l=document.createElement("div");l.className="cesium-widget-errorPanel-scroll",a.appendChild(l);var u=function(){l.style.maxHeight=Math.max(Math.round(.9*i.clientHeight-100),30)+"px"};if(u(),o(window.addEventListener)&&window.addEventListener("resize",u,!1),o(t)){var h=document.createElement("div");h.className="cesium-widget-errorPanel-message",h.innerHTML="

"+t+"

",l.appendChild(h)}var d="(no error details available)";o(r)&&(d=c(r));var m=document.createElement("div");m.className="cesium-widget-errorPanel-message",m.appendChild(document.createTextNode(d)),l.appendChild(m);var p=document.createElement("div");p.className="cesium-widget-errorPanel-buttonPanel",a.appendChild(p);var f=document.createElement("button");f.setAttribute("type","button"),f.className="cesium-button",f.appendChild(document.createTextNode("OK")),f.onclick=function(){o(u)&&o(window.removeEventListener)&&window.removeEventListener("resize",u,!1),i.removeChild(n)},p.appendChild(f),i.appendChild(n),console.error(e+"\n"+t+"\n"+d)},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),s(this)},A.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,r=e.clientHeight;(this._forceResize||this._canvasWidth!==t||this._canvasHeight!==r)&&(this._forceResize=!1,T(this),x(this))},A.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}},A}),r("Widgets/ClockViewModel",["../Core/Clock","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/EventHelper","../Core/JulianDate","../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";var s=function(r){t(r)||(r=new e),this._clock=r,this._eventHelper=new n,this._eventHelper.add(r.onTick,this.synchronize,this);var i=a.observable(r.startTime);i.equalityComparer=o.equals,this.systemTime=a.observable(o.now()),this.systemTime.equalityComparer=o.equals,a.track(this,["systemTime"]),this.startTime=void 0,a.defineProperty(this,"startTime",{get:i,set:function(e){i(e),r.startTime=e}});var s=a.observable(r.stopTime);s.equalityComparer=o.equals,this.stopTime=void 0,a.defineProperty(this,"stopTime",{get:s,set:function(e){r.stopTime=e,s(e)}});var l=a.observable(r.currentTime);l.equalityComparer=o.equals,this.currentTime=void 0,a.defineProperty(this,"currentTime",{get:l,set:function(e){r.currentTime=e,l(e)}});var u=a.observable(r.multiplier);this.multiplier=void 0,a.defineProperty(this,"multiplier",{get:u,set:function(e){r.multiplier=e,u(e)}});var c=a.observable(r.clockStep);c.equalityComparer=function(e,t){return e===t},this.clockStep=void 0,a.defineProperty(this,"clockStep",{get:c,set:function(e){c(e),r.clockStep=e}});var h=a.observable(r.clockRange);h.equalityComparer=function(e,t){return e===t},this.clockRange=void 0,a.defineProperty(this,"clockRange",{get:h,set:function(e){h(e),r.clockRange=e}});var d=a.observable(r.canAnimate);this.canAnimate=void 0,a.defineProperty(this,"canAnimate",{get:d,set:function(e){d(e),r.canAnimate=e}});var m=a.observable(r.shouldAnimate);this.shouldAnimate=void 0,a.defineProperty(this,"shouldAnimate",{get:m,set:function(e){m(e),r.shouldAnimate=e -}})};return r(s.prototype,{clock:{get:function(){return this._clock}}}),s.prototype.synchronize=function(){var e=this._clock,t=e.startTime,r=e.stopTime,i=e.currentTime,n=e.multiplier,a=e.clockStep,s=e.clockRange,l=e.canAnimate,u=e.shouldAnimate;this.systemTime=o.now(),this.startTime=t,this.stopTime=r,this.currentTime=i,this.multiplier=n,this.clockStep=a,this.clockRange=s,this.canAnimate=l,this.shouldAnimate=u},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){this._eventHelper.removeAll(),i(this)},s}),r("Widgets/Command",["../Core/DeveloperError"],function(e){"use strict";var t=function(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,e.throwInstantiationError()};return t}),r("Widgets/FullscreenButton/FullscreenButtonViewModel",["../../Core/defaultValue","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a){"use strict";var s=function(t){var r=this,i=o.observable(n.fullscreen),s=o.observable(n.enabled);this.isFullscreen=void 0,o.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,o.defineProperty(this,"isFullscreenEnabled",{get:function(){return s()},set:function(e){s(e&&n.enabled)}}),this.tooltip=void 0,o.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=a(function(){n.fullscreen?n.exitFullscreen():n.requestFullscreen(r._fullscreenElement)},o.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=e(t,document.body),this._callback=function(){i(n.fullscreen)},document.addEventListener(n.changeEventName,this._callback)};return t(s.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){document.removeEventListener(n.changeEventName,this._callback),r(this)},s}),r("Widgets/FullscreenButton/FullscreenButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./FullscreenButtonViewModel"],function(e,t,r,i,n,o,a){"use strict";var s="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",l="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",u=function(e,t){e=o(e);var r=new a(t);r._exitFullScreenPath=l,r._enterFullScreenPath=s;var i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),n.applyBindings(r,i),this._container=e,this._viewModel=r,this._element=i};return t(u.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),r(this)},u}),r("Widgets/Geocoder/GeocoderViewModel",["../../Core/BingMapsApi","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/jsonp","../../Core/Matrix4","../../Core/Rectangle","../../ThirdParty/knockout","../../ThirdParty/when","../createCommand"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(e){var t=e.searchText;if(!/^\s*$/.test(t)){e._isSearchInProgress=!0;var i=o(e._url+"REST/v1/Locations",{parameters:{query:t,key:e._key},callbackParameterName:"jsonp"}),n=e._geocodeInProgress=u(i,function(t){if(!n.cancel){if(e._isSearchInProgress=!1,0===t.resourceSets.length)return e.searchText=e._searchText+" (not found)",void 0;var i=t.resourceSets[0];if(0===i.resources.length)return e.searchText=e._searchText+" (not found)",void 0;var o=i.resources[0];e._searchText=o.name;var l=o.bbox,u=l[0],c=l[1],h=l[2],d=l[3],m=s.fromDegrees(c,u,d,h),p=e._scene.camera,f=p.getRectangleCameraCoordinates(m);r(f)&&e._scene.camera.flyTo({destination:f,duration:e._flightDuration,endTransform:a.IDENTITY,convert:!1})}},function(){n.cancel||(e._isSearchInProgress=!1,e.searchText=e._searchText+" (error)")})}}function d(e){e._isSearchInProgress=!1,r(e._geocodeInProgress)&&(e._geocodeInProgress.cancel=!0,e._geocodeInProgress=void 0)}var m=function(r){this._url=t(r.url,"//dev.virtualearth.net/"),this._url.length>0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._key=e.getKey(r.key),this._scene=r.scene,this._flightDuration=t(r.flightDuration,1.5),this._searchText="",this._isSearchInProgress=!1,this._geocodeInProgress=void 0;var i=this;this._searchCommand=c(function(){i.isSearchInProgress?d(i):h(i)}),l.track(this,["_searchText","_isSearchInProgress"]),this.isSearchInProgress=void 0,l.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,l.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,l.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})};return i(m.prototype,{url:{get:function(){return this._url}},key:{get:function(){return this._key}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}}}),m}),r("Widgets/Geocoder/Geocoder",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./GeocoderViewModel"],function(e,t,r,i,n,o,a){"use strict";var s="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",l="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",u=function(e){var t=o(e.container),r=new a(e);r._startSearchPath=s,r._stopSearchPath=l;var i=document.createElement("form");i.setAttribute("data-bind","submit: search");var u=document.createElement("input");u.type="search",u.className="cesium-geocoder-input",u.setAttribute("placeholder","Enter an address or landmark..."),u.setAttribute("data-bind",'value: searchText,valueUpdate: "afterkeydown",disable: isSearchInProgress,css: { "cesium-geocoder-input-wide" : searchText.length > 0 }'),i.appendChild(u);var c=document.createElement("span");c.className="cesium-geocoder-searchButton",c.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(c),t.appendChild(i),n.applyBindings(r,i),this._container=t,this._viewModel=r,this._form=i,this._onInputBegin=function(e){t.contains(e.target)||u.blur()},this._onInputEnd=function(e){t.contains(e.target)&&u.focus()},document.addEventListener("mousedown",this._onInputBegin,!0),document.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),document.addEventListener("touchend",this._onInputEnd,!0)};return t(u.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return document.removeEventListener("mousedown",this._onInputBegin,!0),document.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),document.removeEventListener("touchend",this._onInputEnd,!0),n.cleanNode(this._form),this._container.removeChild(this._form),r(this)},u}),r("Widgets/HomeButton/HomeButtonViewModel",["../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Matrix4","../../Core/Rectangle","../../Scene/Camera","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function h(t,i){var n=t.mode;r(t)&&n===l.MORPHING&&t.completeMorph();var u,c,h;if(n===l.SCENE2D)t.camera.flyToRectangle({destination:a.MAX_VALUE,duration:i,endTransform:o.IDENTITY});else if(n===l.SCENE3D){var d=t.camera.getRectangleCameraCoordinates(s.DEFAULT_VIEW_RECTANGLE),m=e.magnitude(d);m+=m*s.DEFAULT_VIEW_FACTOR,e.normalize(d,d),e.multiplyByScalar(d,m,d),u=e.normalize(d,new e),e.negate(u,u),c=e.cross(u,e.UNIT_Z,new e),h=e.cross(c,u,new e),t.camera.flyTo({destination:d,direction:u,up:h,duration:i,endTransform:o.IDENTITY})}else if(n===l.COLUMBUS_VIEW){var p=t.globe.ellipsoid.maximumRadius,f=new e(0,-1,1);f=e.multiplyByScalar(e.normalize(f,f),5*p,f),u=new e,u=e.normalize(e.subtract(e.ZERO,f,u),u),c=e.cross(u,e.UNIT_Z,new e),h=e.cross(c,u,new e),t.camera.flyTo({destination:f,duration:i,up:h,direction:u,endTransform:o.IDENTITY,convert:!1})}}var d=function(e,r){r=t(r,1.5),this._scene=e,this._duration=r;var i=this;this._command=c(function(){h(i._scene,i._duration)}),this.tooltip="View Home",u.track(this,["tooltip"])};return i(d.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}}}),d}),r("Widgets/HomeButton/HomeButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./HomeButtonViewModel"],function(e,t,r,i,n,o,a){"use strict";var s=function(e,t,r){e=o(e);var i=new a(t,r);i._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(i,s),this._container=e,this._viewModel=i,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),r(this)},s}),r("Widgets/InfoBox/InfoBoxViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/Event","../../Core/formatError","../../Core/TaskProcessor","../../ThirdParty/knockout","../../ThirdParty/when"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){return t(d)||(d=new o("sanitizeHtml",1/0)),d.scheduleTask(e)}var u="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",c="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",h=function(){this._sanitizer=void 0,this._descriptionRawHtml="",this._descriptionSanitizedHtml="",this._cameraClicked=new i,this._closeClicked=new i,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.loadingIndicatorHtml='
',a.track(this,["showInfo","titleText","_descriptionRawHtml","_descriptionSanitizedHtml","maxHeight","enableCamera","isCameraTracking"]),this.descriptionRawHtml=void 0,a.defineProperty(this,"descriptionRawHtml",{get:function(){return this._descriptionRawHtml},set:function(e){if(this._descriptionRawHtml!==e){this._descriptionRawHtml=e,this._descriptionSanitizedHtml=this.loadingIndicatorHtml;var t=this;s(this.sanitizer(e),function(r){t._descriptionRawHtml===e&&(t._descriptionSanitizedHtml=r)}).otherwise(function(e){console.log("An error occurred while sanitizing HTML: "+n(e))})}}}),this.descriptionSanitizedHtml=void 0,a.defineProperty(this,"descriptionSanitizedHtml",{get:function(){return this._descriptionSanitizedHtml}}),this.cameraIconPath=void 0,a.defineProperty(this,"cameraIconPath",{get:function(){return this.enableCamera||this.isCameraTracking?u:c}}),a.defineProperty(this,"_bodyless",{get:function(){return!this._descriptionSanitizedHtml}})};h.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"};var d;return h.defaultSanitizer=l,r(h.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}},sanitizer:{get:function(){return e(this._sanitizer,h.defaultSanitizer)},set:function(e){this._sanitizer=e;var t=this._descriptionRawHtml;this._descriptionRawHtml="",this.descriptionRawHtml=t}}}),h}),r("Widgets/InfoBox/InfoBox",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./InfoBoxViewModel"],function(e,t,r,i,n,o,a){"use strict";var s=function(e){e=o(e),this._container=e;var t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t),this._element=t;var r=document.createElement("div");r.className="cesium-infoBox-title",r.setAttribute("data-bind","text: titleText"),t.appendChild(r);var i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);var s=document.createElement("button");s.type="button",s.className="cesium-infoBox-close",s.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(); }"),s.innerHTML="×",t.appendChild(s);var l=document.createElement("div");l.className="cesium-infoBox-body",t.appendChild(l);var u=document.createElement("div");u.className="cesium-infoBox-description",u.setAttribute("data-bind","html: descriptionSanitizedHtml,style : { maxHeight : maxHeightOffset(40) }"),l.appendChild(u);var c=new a;this._viewModel=c,n.applyBindings(this._viewModel,t)};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),r(this)},s}),r("Widgets/NavigationHelpButton/NavigationHelpButtonViewModel",["../../Core/defineProperties","../../ThirdParty/knockout","../createCommand"],function(e,t,r){"use strict";var i=function(){this.showInstructions=!1;var e=this;this._command=r(function(){e.showInstructions=!e.showInstructions}),this._showClick=r(function(){e._touch=!1}),this._showTouch=r(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",t.track(this,["tooltip","showInstructions","_touch"])};return e(i.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}}),i}),r("Widgets/NavigationHelpButton/NavigationHelpButton",["../../Core/buildModuleUrl","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./NavigationHelpButtonViewModel"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(r){var i=s(r.container),n=new l,o=t(r.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 u=document.createElement("span");u.className="cesium-navigationHelpButton-wrapper",i.appendChild(u);var c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",c.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),u.appendChild(c);var h=document.createElement("div");h.className="cesium-navigation-help",h.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),u.appendChild(h);var d=document.createElement("button");d.className="cesium-navigation-button cesium-navigation-button-left",d.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",d.appendChild(m),d.appendChild(document.createTextNode("Mouse"));var p=document.createElement("button");p.className="cesium-navigation-button cesium-navigation-button-right",p.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');var f=document.createElement("img");f.src=e("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",p.appendChild(f),p.appendChild(document.createTextNode("Touch")),h.appendChild(d),h.appendChild(p);var v=document.createElement("div");v.className="cesium-click-navigation-help cesium-navigation-help-instructions",v.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),v.innerHTML='
Pan view
Left click + drag
Zoom view
Right click + drag, or
Mouse wheel scroll
Rotate view
Middle click + drag, or
CTRL + Left click + drag
',h.appendChild(v);var g=document.createElement("div");g.className="cesium-touch-navigation-help cesium-navigation-help-instructions",g.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),g.innerHTML='
Pan view
One finger drag
Zoom view
Two finger pinch
Tilt view
Two finger drag, same direction
Rotate view
Two finger drag, opposite direction
',h.appendChild(g),a.applyBindings(n,u),this._container=i,this._viewModel=n,this._wrapper=u,this._closeInstructions=function(e){u.contains(e.target)||(n.showInstructions=!1)},document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0)};return i(u.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0),a.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),n(this)},u}),r("Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Scene/FrameRateMonitor","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(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 r=this;this._dismissMessage=s(function(){r.showingLowFrameRateMessage=!1,r.lowFrameRateMessageDismissed=!0});var i=o.fromScene(t.scene);this._unsubscribeLowFrameRate=i.lowFrameRate.addEventListener(function(){r.lowFrameRateMessageDismissed||(r.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=i.nominalFrameRate.addEventListener(function(){r.showingLowFrameRateMessage=!1})};return r(l.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),l.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),i(this)},l}),r("Widgets/PerformanceWatchdog/PerformanceWatchdog",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./PerformanceWatchdogViewModel"],function(e,t,r,i,n,o,a){"use strict";var s=function(e){var t=o(e.container),r=new a(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.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"),i.appendChild(s);var l=document.createElement("div");l.className="cesium-performance-watchdog-message",l.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(l),t.appendChild(i),n.applyBindings(r,i),this._container=t,this._viewModel=r,this._element=i};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),r(this)},s}),r("Widgets/SceneModePicker/SceneModePickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s,l){"use strict";var u=function(t,r){this._scene=t;var i=this,n=function(e,t,r){i.sceneMode=r,i.dropDownVisible=!1};this._eventHelper=new o,this._eventHelper.add(t.morphStart,n),this._duration=e(r,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=i.sceneMode;return e===a.SCENE2D?i.tooltip2D:e===a.SCENE3D?i.tooltip3D:i.tooltipColumbusView}),this._toggleDropDown=l(function(){i.dropDownVisible=!i.dropDownVisible}),this._morphTo2D=l(function(){t.morphTo2D(i._duration)}),this._morphTo3D=l(function(){t.morphTo3D(i._duration)}),this._morphToColumbusView=l(function(){t.morphToColumbusView(i._duration)}),this._sceneMode=a};return r(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(),i(this)},u}),r("Widgets/SceneModePicker/SceneModePicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./SceneModePickerViewModel"],function(e,t,r,i,n,o,a){"use strict";var s="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",l="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",u="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",c=function(e,t,r){e=o(e); -var i=new a(t,r);i._globePath=s,i._flatMapPath=l,i._columbusViewPath=u;var c=document.createElement("span");c.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(c);var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button",h.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'),h.innerHTML='',c.appendChild(h);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",d.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 }'),c.appendChild(d);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 }'),c.appendChild(m);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.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 }'),c.appendChild(p),n.applyBindings(i,c),this._viewModel=i,this._container=e,this._wrapper=c,this._closeDropDown=function(e){c.contains(e.target)||(i.dropDownVisible=!1)},document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0)};return t(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 this._viewModel.destroy(),document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0),n.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),r(this)},c}),r("Widgets/SelectionIndicator/SelectionIndicatorViewModel",["../../Core/Cartesian2","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EasingFunction","../../Scene/SceneTransforms","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a,s){"use strict";var l=new e,u="-1000px",c=function(e,i,n){this._scene=e,this._screenPositionX=u,this._screenPositionY=u,this._tweens=e.tweens,this._container=t(n,document.body),this._selectionIndicatorElement=i,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&&r(this.position)}}),s.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(t,r){return a.wgs84ToWindowCoordinates(e,t,r)}};return c.prototype.update=function(){if(this.showSelection&&r(this.position)){var e=this.computeScreenSpacePosition(this.position,l);if(r(e)){var t=this._container,i=t.parentNode.clientWidth,n=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,a=.5*o;e.x=Math.min(Math.max(e.x,-o),i+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=u,this._screenPositionY=u}},c.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},c.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},i(c.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}}),c}),r("Widgets/SelectionIndicator/SelectionIndicator",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./SelectionIndicatorViewModel"],function(e,t,r,i,n,o,a){"use strict";var s=function(e,t){e=o(e),this._container=e;var r=document.createElement("div");r.className="cesium-selection-wrapper",r.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(r),this._element=r;var i="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(i,"svg:svg");l.setAttribute("width",160),l.setAttribute("height",160),l.setAttribute("viewBox","0 0 160 160");var u=document.createElementNS(i,"g");u.setAttribute("transform","translate(80,80)"),l.appendChild(u);var c=document.createElementNS(i,"path");c.setAttribute("data-bind","attr: { transform: _transform }"),c.setAttribute("d",s),u.appendChild(c),r.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),r(this)},s}),r("Widgets/Timeline/TimelineHighlightRange",["../../Core/defaultValue","../../Core/JulianDate"],function(e,t){"use strict";function r(t,r,i){this._color=t,this._height=r,this._base=e(i,0)}return r.prototype.getHeight=function(){return this._height},r.prototype.getBase=function(){return this._base},r.prototype.getStartTime=function(){return this._start},r.prototype.getStopTime=function(){return this._stop},r.prototype.setRange=function(e,t){this._start=e,this._stop=t},r.prototype.render=function(e){var r="";if(this._start&&this._stop&&this._color){var i=t.secondsDifference(this._start,e.epochJulian),n=Math.round(e.timeBarWidth*e.getAlpha(i)),o=t.secondsDifference(this._stop,e.epochJulian),a=Math.round(e.timeBarWidth*e.getAlpha(o))-n;0>n&&(a+=n,n=0),n+a>e.timeBarWidth&&(a=e.timeBarWidth-n),a>0&&(r='')}return r},r}),r("Widgets/Timeline/TimelineTrack",["../../Core/Color","../../Core/defined","../../Core/JulianDate"],function(e,t,r){"use strict";function i(t,r,i,n){this.interval=t,this.height=r,this.color=i||new e(.5,.5,.5,1),this.backgroundColor=n||new e(0,0,0,0)}return i.prototype.render=function(e,i){var n=this.interval.start,o=this.interval.stop,a=i.startJulian,s=r.addSeconds(i.startJulian,i.duration,new r);if(r.lessThan(n,a)&&r.greaterThan(o,s))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,i.y,i.timeBarWidth,this.height);else if(r.lessThanOrEquals(n,s)&&r.greaterThanOrEquals(o,a)){var l,u,c;for(l=0;le?"0"+e.toString():e.toString()}function u(e){return function(t){e._mouseMode!==g.touchOnly&&(0===t.button?(e._mouseMode=g.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,e._mouseMode=2===t.button?g.zoom:g.slide)),t.preventDefault()}}function c(e){return function(){e._mouseMode=g.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0px 0px"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function h(e){return function(t){var r;if(e._mouseMode===g.scrub){t.preventDefault();var i=t.clientX-e._topDiv.getBoundingClientRect().left;0>i?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===g.slide){if(r=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==r){var o=r*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(n.addSeconds(e._startJulian,o,new n),n.addSeconds(e._endJulian,o,new n))}}else e._mouseMode===g.zoom&&(r=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==r&&e.zoomFrom(Math.pow(1.01,r)))}}function d(e){return function(t){var r=t.wheelDeltaY||t.wheelDelta||-t.detail;v=Math.max(Math.min(Math.abs(r),v),1),r/=v,e.zoomFrom(Math.pow(1.05,-r))}}function m(e){return function(t){var r,i,o=t.touches.length,a=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=g.touchOnly,1===o?(r=n.secondsDifference(e._scrubJulian,e._startJulian),i=Math.round(r*e._topDiv.clientWidth/e._timeBarSecondsSpan+a),Math.abs(t.touches[0].clientX-i)<50?(e._touchMode=_.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=1===o?"-16px 0":"0 0")):(e._touchMode=_.singleTap,e._touchState.centerX=t.touches[0].clientX-a)):2===o?(e._touchMode=_.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=_.ignore}}function p(e){return function(t){var r=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===_.singleTap?(e._touchMode=_.scrub,e._handleTouchMove(t)):e._touchMode===_.scrub&&e._handleTouchMove(t),e._mouseMode=g.touchOnly,1!==r?e._touchMode=r>0?_.ignore:_.none:e._touchMode===_.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function f(e){return function(r){var i,o,a,s,l,u,c=1,h=e._topDiv.getBoundingClientRect().left;e._touchMode===_.singleTap&&(e._touchMode=_.slideZoom),e._mouseMode=g.touchOnly,e._touchMode===_.scrub?(r.preventDefault(),1===r.changedTouches.length&&(o=r.changedTouches[0].clientX-h,o>=0&&o<=e._topDiv.clientWidth&&e._setTimeBarTime(o,o*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===_.slideZoom&&(a=r.touches.length,2===a?(s=.5*(r.touches[0].clientX+r.touches[1].clientX)-h,l=Math.abs(r.touches[0].clientX-r.touches[1].clientX)):1===a&&(s=r.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)):(i=e._touchState.centerX-s,u=n.addSeconds(e._startJulian,i*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 v=1e12,g={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},_={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},y=[.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],C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],w=function(e,t){e=o(e),this.container=e;var r=document.createElement("div");r.className="cesium-timeline-main",e.appendChild(r),this._topDiv=r,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=g.none,this._touchMode=_.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='
',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=u(this),this._onMouseUp=c(this),this._onMouseMove=h(this),this._onMouseWheel=d(this),this._onTouchStart=m(this),this._onTouchMove=f(this),this._onTouchEnd=p(this);var i=this._timeBarEle;document.addEventListener("mouseup",this._onMouseUp,!1),document.addEventListener("mousemove",this._onMouseMove,!1),i.addEventListener("mousedown",this._onMouseDown,!1),i.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),i.addEventListener("mousewheel",this._onMouseWheel,!1),i.addEventListener("touchstart",this._onTouchStart,!1),i.addEventListener("touchmove",this._onTouchMove,!1),i.addEventListener("touchend",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()};return w.prototype.addEventListener=function(e,t,r){this._topDiv.addEventListener(e,t,r)},w.prototype.removeEventListener=function(e,t,r){this._topDiv.removeEventListener(e,t,r)},w.prototype.isDestroyed=function(){return!1},w.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),this.container.removeChild(this._topDiv),r(this)},w.prototype.addHighlightRange=function(e,t,r){var i=new a(e,t,r);return this._highlightRanges.push(i),this.resize(),i},w.prototype.addTrack=function(e,t,r,i){var n=new s(e,t,r,i);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},w.prototype.zoomTo=function(t,r){if(this._startJulian=t,this._endJulian=r,this._timeBarSecondsSpan=n.secondsDifference(r,t),this._clock&&this._clock.clockRange!==e.UNBOUNDED){var i=this._clock.startTime,o=this._clock.stopTime,a=n.secondsDifference(o,i),s=n.secondsDifference(i,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=i,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian)):0>l&&(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)},w.prototype.zoomFrom=function(e){var t=n.secondsDifference(this._scrubJulian,this._startJulian);e>1||0>t||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var r=this._timeBarSecondsSpan-t;this.zoomTo(n.addSeconds(this._startJulian,t-t*e,new n),n.addSeconds(this._endJulian,r*e-r,new n))},w.prototype.makeLabel=function(e){var t=n.toGregorianDate(e),r=t.millisecond,i=" UTC";if(r>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(r).toString();i.length<3;)i="0"+i;i="."+i}return C[t.month-1]+" "+t.day+" "+t.year+" "+l(t.hour)+":"+l(t.minute)+":"+l(t.second)+i},w.prototype.smallestTicInPixels=7,w.prototype._makeTics=function(){function e(e){return Math.floor(S/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function r(e){return(e-S)/v}function i(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,m=31536e6,p=1e-10,f=0,v=this._timeBarSecondsSpan;d>v?(v=d,this._timeBarSecondsSpan=d,this._endJulian=n.addSeconds(this._startJulian,d,new n)):v>m&&(v=m,this._timeBarSecondsSpan=m,this._endJulian=n.addSeconds(this._startJulian,m,new n));var g=this._timeBarEle.clientWidth;10>g&&(g=10);var _,C=this._startJulian,w=Math.min(1e-5*(v/g),.4);_=v>31536e4?n.fromIso8601(n.toDate(C).toISOString().substring(0,2)+"00-01-01T00:00:00Z"):v>31536e3?n.fromIso8601(n.toDate(C).toISOString().substring(0,3)+"0-01-01T00:00:00Z"):v>86400?n.fromIso8601(n.toDate(C).toISOString().substring(0,4)+"-01-01T00:00:00Z"):n.fromIso8601(n.toDate(C).toISOString().substring(0,10)+"T00:00:00Z");var S=n.secondsDifference(this._startJulian,n.addSeconds(_,w,new n)),E=S+v;this._epochJulian=_,this._rulerEle.innerHTML=this.makeLabel(n.addSeconds(this._endJulian,-d,new n));var b=this._rulerEle.offsetWidth+20;30>b&&(b=180);var T=f;f-=p;var x={startTime:S,startJulian:C,epochJulian:_,duration:v,timeBarWidth:g,getAlpha:r};this._highlightRanges.forEach(function(e){h+=e.render(x)});var P=0,A=0,M=0,D=b/g;D>1&&(D=1),D*=this._timeBarSecondsSpan;var I,O=-1,R=-1,L=y.length;for(I=0;L>I;++I){var N=y[I];if(++O,P=N,N>D&&N>f)break;0>R&&g*(N/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(R=O)}if(O>0){for(;O>0;)if(--O,Math.abs(i(P,y[O]))<1e-5){y[O]>=f&&(A=y[O]);break}if(R>=0)for(;O>R;){if(Math.abs(i(A,y[R]))<1e-5&&y[R]>=f){M=y[R];break}++R}}f=T,f>p&&1e-5>M&&Math.abs(f-P)>p&&(M=f,P+p>=f&&(A=0));var F,B=-999999;if(g*(M/this._timeBarSecondsSpan)>=3)for(o=e(M);E>=o;o=t(o,M))h+='';if(g*(A/this._timeBarSecondsSpan)>=3)for(o=e(A);E>=o;o=t(o,A))h+='';if(g*(P/this._timeBarSecondsSpan)>=2){this._mainTicSpan=P,E+=P,o=e(P);for(var z=n.computeTaiMinusUtc(_);E>=o;){var V=n.addSeconds(C,o-S,new n);if(P>2.1){var k=n.computeTaiMinusUtc(V);Math.abs(k-z)>.1&&(o+=k-z,V=n.addSeconds(C,o-S,new n))}var U=Math.round(g*r(o)),W=this.makeLabel(V);this._rulerEle.innerHTML=W,F=this._rulerEle.offsetWidth,10>F&&(F=b);var G=U-(F/2-1);G>B?(B=G+F+5,h+=''+''+W+""):h+='',o=t(o,P)}}else this._mainTicSpan=-1;h+='',a.innerHTML=h,this._scrubElement=a.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),x.y=0,this._trackList.forEach(function(e){e.render(c._context,x),x.y+=e.height})},w.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e=this._scrubElement;if(t(this._scrubElement)){var r=n.secondsDifference(this._scrubJulian,this._startJulian),i=Math.round(r*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==i&&(this._lastXPos=i,e.style.left=i-8+"px",this._needleEle.style.left=i+"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)))},w.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=n.addSeconds(this._startJulian,t,new n),this._scrubElement){var r=e-8;this._scrubElement.style.left=r.toString()+"px",this._needleEle.style.left=e.toString()+"px"}var i=document.createEvent("Event");i.initEvent("settime",!0,!0),i.clientX=e,i.timeSeconds=t,i.timeJulian=this._scrubJulian,i.clock=this._clock,this._topDiv.dispatchEvent(i)},w.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 r=1;this._trackList.forEach(function(e){r+=e.height}),this._trackListEle.style.height=r.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=r,this._makeTics(),this._lastWidth=e,this._lastHeight=t}},w}),r("Widgets/Viewer/Viewer",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../DataSources/DataSourceCollection","../../DataSources/DataSourceDisplay","../../ThirdParty/knockout","../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"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S,E,b,T){"use strict";function x(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function P(e){var r=e._container,i=r.clientWidth,n=r.clientHeight,o=t(e._animation),a=t(e._timeline);if(i!==e._lastWidth||n!==e._lastHeight){var s=n-125,l=e._baseLayerPickerDropDown;t(l)&&(l.style.maxHeight=s+"px"),t(e._infoBox)&&(e._infoBox.viewModel.maxHeight=s);var u,c=e._timeline,h=0,d=0,m=0;if(o&&"hidden"!==window.getComputedStyle(e._animation.container).visibility){var p=e._lastWidth;u=e._animation.container,i>900?(h=169,900>=p&&(u.style.width="169px",u.style.height="112px",e._animation.resize())):i>=600?(h=136,(600>p||p>900)&&(u.style.width="136px",u.style.height="90px",e._animation.resize())):(h=106,(p>600||0===p)&&(u.style.width="106px",u.style.height="70px",e._animation.resize())),d=h+5}if(a&&"hidden"!==window.getComputedStyle(e._timeline.container).visibility){var f=e._fullscreenButton,v=c.container,g=v.style;m=v.clientHeight+3,g.left=h+"px",t(f)&&(g.right=f.container.clientWidth+"px"),c.resize()}e._bottomContainer.style.left=d+"px",e._bottomContainer.style.bottom=m+"px",e._lastWidth=i,e._lastHeight=n}}var A=function(r,i){function A(e){if(t(e)){var r=e.clock;t(r)&&(r.getValue(z),t(at)&&(at.updateFromClock(),at.zoomTo(r.startTime,r.stopTime)))}}r=_(r),i=e(i,e.EMPTY_OBJECT);var M=!t(i.baseLayerPicker)||i.baseLayerPicker!==!1,D=document.createElement("div");D.className="cesium-viewer",r.appendChild(D);var I=document.createElement("div");I.className="cesium-viewer-cesiumWidgetContainer",D.appendChild(I);var O=document.createElement("div");O.className="cesium-viewer-bottom",D.appendChild(O);var R=e(i.scene3DOnly,!1),L=new p(I,{terrainProvider:i.terrainProvider,imageryProvider:M?!1:i.imageryProvider,clock:i.clock,skyBox:i.skyBox,sceneMode:i.sceneMode,mapProjection:i.mapProjection,orderIndependentTranslucency:i.orderIndependentTranslucency,contextOptions:i.contextOptions,useDefaultRenderLoop:i.useDefaultRenderLoop,targetFrameRate:i.targetFrameRate,showRenderLoopErrors:i.showRenderLoopErrors,creditContainer:t(i.creditContainer)?i.creditContainer:O,scene3DOnly:R}),N=i.dataSources,F=!1;t(N)||(N=new a,F=!0);var B=new s({scene:L.scene,dataSourceCollection:N}),z=L.clock,V=new f(z),k=new o,U=this;k.add(z.onTick,function(e){var t=B.update(e.currentTime);U._allowDataSourcesToSuspendAnimation&&(V.canAnimate=t)});var W;if(!t(i.selectionIndicator)||i.selectionIndicator!==!1){var G=document.createElement("div");G.className="cesium-viewer-selectionIndicatorContainer",D.appendChild(G),W=new E(G,L.scene)}var H;if(!t(i.infoBox)||i.infoBox!==!1){var q=document.createElement("div");q.className="cesium-viewer-infoBoxContainer",D.appendChild(q),H=new C(q)}var j=document.createElement("div");j.className="cesium-viewer-toolbar",D.appendChild(j);var Y;if(!t(i.geocoder)||i.geocoder!==!1){var X=document.createElement("div");X.className="cesium-viewer-geocoderContainer",j.appendChild(X),Y=new g({container:X,scene:L.scene})}var Z;if(t(i.homeButton)&&i.homeButton===!1||(Z=new y(j,L.scene),t(Y)&&k.add(Z.viewModel.command.afterExecute,function(){var e=Y.viewModel;e.searchText="",e.isSearchInProgress&&e.search()})),i.sceneModePicker===!0&&R)throw new n("options.sceneModePicker is not available when options.scene3DOnly is set to true.");var Q;R||t(i.sceneModePicker)&&i.sceneModePicker===!1||(Q=new S(j,L.scene));var J;if(M){var K=e(i.imageryProviderViewModels,d()),$=e(i.terrainProviderViewModels,m());J=new h(j,{globe:L.scene.globe,imageryProviderViewModels:K,selectedImageryProviderViewModel:i.selectedImageryProviderViewModel,terrainProviderViewModels:$,selectedTerrainProviderViewModel:i.selectedTerrainProviderViewModel});var et=j.getElementsByClassName("cesium-baseLayerPicker-dropDown");this._baseLayerPickerDropDown=et[0]}var tt;if(!t(i.navigationHelpButton)||i.navigationHelpButton!==!1){var rt=!0;if(t(window.localStorage)){var it=window.localStorage.getItem("cesium-hasSeenNavHelp");t(it)&&Boolean(it)?rt=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}tt=new w({container:j,instructionsInitiallyVisible:e(i.navigationInstructionsInitiallyVisible,rt)})}var nt;if(!t(i.animation)||i.animation!==!1){var ot=document.createElement("div");ot.className="cesium-viewer-animationContainer",D.appendChild(ot),nt=new u(ot,new c(V))}var at;if(!t(i.timeline)||i.timeline!==!1){var st=document.createElement("div");st.className="cesium-viewer-timelineContainer",D.appendChild(st),at=new T(st,z),at.addEventListener("settime",x,!1),at.zoomTo(z.startTime,z.stopTime)}var lt;if(t(i.fullscreenButton)&&i.fullscreenButton===!1)t(at)&&(at.container.style.right=0);else{var ut=document.createElement("div");ut.className="cesium-viewer-fullscreenContainer",D.appendChild(ut),lt=new v(ut,i.fullscreenElement),this._fullscreenSubscription=b(lt.viewModel,"isFullscreenEnabled",function(e){ut.style.display=e?"block":"none",t(at)&&(at.container.style.right=ut.clientWidth+"px",at.resize())})}this.clockTrackedDataSource=void 0,l.track(this,["clockTrackedDataSource"]),this._dataSourceChangedListeners={},this._knockoutSubscriptions=[];var ct=e(i.automaticallyTrackDataSourceClocks,!0);this._knockoutSubscriptions.push(b(this,"clockTrackedDataSource",function(e){A(e)}));var ht=function(e){U.clockTrackedDataSource===e&&A(e)},dt=function(e,t){ct&&(U.clockTrackedDataSource=t);var r=t.entities.id,i=k.add(t.changedEvent,ht);U._dataSourceChangedListeners[r]=i},mt=function(e,t){var r=U.clockTrackedDataSource===t,i=t.entities.id;if(U._dataSourceChangedListeners[i](),U._dataSourceChangedListeners[i]=void 0,r){var n=e.length;U.clockTrackedDataSource=ct&&n>0?e.get(n-1):void 0}};k.add(N.dataSourceAdded,dt),k.add(N.dataSourceRemoved,mt),this._container=r,this._bottomContainer=O,this._element=D,this._cesiumWidget=L,this._selectionIndicator=W,this._infoBox=H,this._dataSourceCollection=N,this._destroyDataSourceCollection=F,this._dataSourceDisplay=B,this._clockViewModel=V,this._toolbar=j,this._homeButton=Z,this._sceneModePicker=Q,this._baseLayerPicker=J,this._animation=nt,this._timeline=at,this._fullscreenButton=lt,this._geocoder=Y,this._eventHelper=k,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,L.scene.preRender.addEventListener(function(){P(U)})};return r(A.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}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},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}},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}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}}}),A.prototype.extend=function(e,t){e(this,t) -},A.prototype.resize=function(){var e=this._cesiumWidget;e.resize(),P(this)},A.prototype.forceResize=function(){this._lastWidth=0,this.resize()},A.prototype.render=function(){this._cesiumWidget.render()},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e,r=this._knockoutSubscriptions.length;for(e=0;r>e;e++)this._knockoutSubscriptions[e].dispose();return this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),t(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),t(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),t(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),t(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),t(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),t(this._timeline)&&(this._timeline.removeEventListener("settime",x,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),t(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),t(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),t(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()),i(this)},A}),r("Widgets/Viewer/viewerCesiumInspectorMixin",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../CesiumInspector/CesiumInspector"],function(e,t,r,i){"use strict";var n=function(n){if(!e(n))throw new r("viewer is required.");var o=document.createElement("div");o.className="cesium-viewer-cesiumInspectorContainer",n.container.appendChild(o);var a=new i(o,n.scene);t(n,{cesiumInspector:{get:function(){return a}}}),n.scene.postRender.addEventListener(function(){n.cesiumInspector.viewModel.update()})};return n}),r("Widgets/Viewer/viewerDragDropMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/wrapFunction","../../DataSources/CzmlDataSource","../../DataSources/GeoJsonDataSource","../getElement"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){e.stopPropagation(),e.preventDefault()}function c(e,r){var i=e;t(i)&&(i.removeEventListener("drop",r,!1),i.removeEventListener("dragenter",u,!1),i.removeEventListener("dragover",u,!1),i.removeEventListener("dragexit",u,!1))}function h(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",u,!1),e.addEventListener("dragover",u,!1),e.addEventListener("dragexit",u,!1)}function d(e,r){return function(i){var n=r.name;try{var o,l;if(/\.czml$/i.test(n))o=new a(n),o.load(JSON.parse(i.target.result),n);else{if(!(/\.geojson$/i.test(n)||/\.json$/i.test(n)||/\.topojson$/i.test(n)))return e.dropError.raiseEvent(e,n,"Unrecognized file: "+n),void 0;o=new s(n),l=o.load(JSON.parse(i.target.result),n)}e.dataSources.add(o),t(l)&&l.otherwise(function(t){e.dropError.raiseEvent(e,n,t)})}catch(u){e.dropError.raiseEvent(e,n,u)}}}function m(e,t){return function(r){e.dropError.raiseEvent(e,t.name,r.target.error)}}var p=function(t,i){function a(e){u(e),f&&t.dataSources.removeAll();for(var r=e.dataTransfer.files,i=r.length,n=0;i>n;n++){var o=r[n],a=new FileReader;a.onload=d(t,o),a.onerror=m(t,o),a.readAsText(o)}}i=e(i,e.EMPTY_OBJECT);var s=!0,p=new n,f=e(i.clearOnDrop,!0),v=e(i.dropTarget,t.container);v=l(v),r(t,{dropTarget:{get:function(){return v},set:function(e){c(v,a),v=e,h(v,a)}},dropEnabled:{get:function(){return s},set:function(e){e!==s&&(e?h(v,a):c(v,a),s=e)}},dropError:{get:function(){return p}},clearOnDrop:{get:function(){return f},set:function(e){f=e}}}),h(v,a),t.destroy=o(t,t.destroy,function(){t.dropEnabled=!1}),t._handleDrop=a};return p}),r("Widgets/Viewer/viewerEntityMixin",["../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/DeveloperError","../../Core/EventHelper","../../Core/Event","../../Core/ScreenSpaceEventType","../../Core/wrapFunction","../../DataSources/ConstantPositionProperty","../../DataSources/Entity","../../DataSources/EntityView","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../subscribeAndEvaluate"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p){"use strict";function f(e,t){var i=e.scene,n=i.camera.getPickRay(t),o=i.imageryLayers.pickImageryLayerFeatures(n,i);if(r(o)){var a=new u("Loading...");return a.description={getValue:function(){return"Loading feature information..."}},m(o,function(t){if(e.selectedEntity===a){if(!r(t)||0===t.length)return e.selectedEntity=v(),void 0;var i=t[0],n=new u(i.name);if(n.description={getValue:function(){return i.description}},r(i.position)){var o=e.scene.globe.ellipsoid.cartographicToCartesian(i.position,_);n.position=new l(o)}e.selectedEntity=n}},function(){if(e.selectedEntity===a){var t=new u("None");t.description={getValue:function(){return"No features found."}},e.selectedEntity=v()}}),a}}function v(){var e=new u("None");return e.description={getValue:function(){return"No features found."}},e}var g=function(e){function i(){e.trackedEntity=e.selectedEntity}function l(){e.trackedEntity=void 0}function m(){e.selectedEntity=void 0}function v(){e.trackedEntity=void 0,e.selectedEntity=void 0}function g(i){var n=i.currentTime;r(T)&&T.update(n);var o=e.selectedEntity,a=r(o)&&D;if(a){var s,l=r(M)?M.position:void 0,u=!1;o.isAvailable(n)&&r(o.position)&&(s=o.position.getValue(n,l),u=r(s)&&e.trackedEntity!==e.selectedEntity),r(M)&&(M.position=s),r(P)&&(P.enableCamera=u,P.isCameraTracking=e.trackedEntity===e.selectedEntity,P.descriptionRawHtml=r(o.description)?t(o.description.getValue(n),""):"")}r(M)&&(M.showSelection=a,M.update()),r(P)&&(P.showInfo=a)}function _(i){var n=e.scene.pick(i.position);if(r(n)){var o=t(n.id,n.primitive.id);if(o instanceof u)return o}return f(e,i.position)}function y(t){r(t)&&r(t.position)&&(e.trackedEntity=t)}function C(e){var t=_(e);r(t)&&y(t)}function w(t){var r=e.selectedEntity;e.selectedEntity=_(t),e.eventSelector.raiseEvent(e.selectedEntity,r)}function S(t,r,i){for(var n=i.length,o=0;n>o;o++){var a=i[o];e.trackedEntity===a&&e.homeButton.viewModel.command(),e.selectedEntity===a&&(e.selectedEntity=void 0)}}function E(e,t){var r=t.entities;r.collectionChanged.addEventListener(S)}function b(t,i){var n=i.entities;n.collectionChanged.removeEventListener(S),r(e.trackedEntity)&&n.getById(e.trackedEntity.id)===e.trackedEntity&&e.homeButton.viewModel.command(),r(e.selectedEntity)&&n.getById(e.selectedEntity.id)===e.selectedEntity&&(e.selectedEntity=void 0)}var T,x=e.infoBox,P=r(x)?x.viewModel:void 0,A=e.selectionIndicator,M=r(A)?A.viewModel:void 0,D=r(x)||r(A),I=new n,O=new o;e.eventSelector=O,r(P)&&(I.add(P.cameraClicked,i),I.add(P.closeClicked,m)),I.add(e.clock.onTick,g),r(e.homeButton)&&I.add(e.homeButton.viewModel.command.beforeExecute,l),r(e.geocoder)&&I.add(e.geocoder.viewModel.search.beforeExecute,v);for(var R=e.dataSources,L=R.length,N=0;L>N;N++)E(R,R.get(N));I.add(e.dataSources.dataSourceAdded,E),I.add(e.dataSources.dataSourceRemoved,b),e.screenSpaceEventHandler.setInputAction(w,a.LEFT_CLICK),e.screenSpaceEventHandler.setInputAction(C,a.LEFT_DOUBLE_CLICK),e.trackedEntity=void 0,e.selectedEntity=void 0,d.track(e,["trackedEntity","selectedEntity"]);var F=[];F.push(p(e,"trackedEntity",function(t){var i=e.scene,n=i.mode,o=r(t);(n===h.COLUMBUS_VIEW||n===h.SCENE2D)&&(i.screenSpaceCameraController.enableTranslate=!o),(n===h.COLUMBUS_VIEW||n===h.SCENE3D)&&(i.screenSpaceCameraController.enableTilt=!o),T=o&&r(t.position)?new c(t,i,e.scene.globe.ellipsoid):void 0})),F.push(p(e,"selectedEntity",function(e){r(e)?(r(P)&&(P.titleText=r(e.name)?e.name:e.id),r(M)&&M.animateAppear()):r(M)&&M.animateDepart()})),e.destroy=s(e,e.destroy,function(){I.removeAll();var t;for(t=0;tt;t++)b(r,r.get(t))})},_=new e;return g}),r("Widgets/Viewer/viewerPerformanceWatchdogMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../PerformanceWatchdog/PerformanceWatchdog"],function(e,t,r,i,n){"use strict";var o=function(o,a){if(!t(o))throw new i("viewer is required.");a=e(a,e.EMPTY_OBJECT);var s=new n({scene:o.scene,container:o.bottomContainer,lowFrameRateMessage:a.lowFrameRateMessage});r(o,{performanceWatchdog:{get:function(){return s}}})};return o}),r("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";var i=function(i){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=i(l.parameters,o)}catch(u){a.error=u instanceof Error?{name:u.name,message:u.message,stack:u.stack}:u}t(n)||(n=e(self.webkitPostMessage,self.postMessage)),l.canTransferArrayBuffer||(o.length=0);try{n(a,o)}catch(u){a.result=void 0,a.error="postMessage failed with error: "+r(u)+"\n with responseMessage: "+JSON.stringify(a),n(a)}}};return i}),r("Cesium",["./Core/ArcGisImageServerTerrainProvider","./Core/AssociativeArray","./Core/AttributeCompression","./Core/AxisAlignedBoundingBox","./Core/BingMapsApi","./Core/BoundingRectangle","./Core/BoundingSphere","./Core/BoxGeometry","./Core/BoxOutlineGeometry","./Core/Cartesian2","./Core/Cartesian3","./Core/Cartesian4","./Core/Cartographic","./Core/CatmullRomSpline","./Core/CesiumTerrainProvider","./Core/CircleGeometry","./Core/CircleOutlineGeometry","./Core/Clock","./Core/ClockRange","./Core/ClockStep","./Core/Color","./Core/ColorGeometryInstanceAttribute","./Core/ComponentDatatype","./Core/CornerType","./Core/CorridorGeometry","./Core/CorridorGeometryLibrary","./Core/CorridorOutlineGeometry","./Core/Credit","./Core/CubicRealPolynomial","./Core/CylinderGeometry","./Core/CylinderGeometryLibrary","./Core/CylinderOutlineGeometry","./Core/DefaultProxy","./Core/DeveloperError","./Core/EarthOrientationParameters","./Core/EarthOrientationParametersSample","./Core/EasingFunction","./Core/EllipseGeometry","./Core/EllipseGeometryLibrary","./Core/EllipseOutlineGeometry","./Core/Ellipsoid","./Core/EllipsoidGeodesic","./Core/EllipsoidGeometry","./Core/EllipsoidOutlineGeometry","./Core/EllipsoidTangentPlane","./Core/EllipsoidTerrainProvider","./Core/EllipsoidalOccluder","./Core/EncodedCartesian3","./Core/Event","./Core/EventHelper","./Core/ExtrapolationType","./Core/FeatureDetection","./Core/Fullscreen","./Core/GeographicProjection","./Core/GeographicTilingScheme","./Core/Geometry","./Core/GeometryAttribute","./Core/GeometryAttributes","./Core/GeometryInstance","./Core/GeometryInstanceAttribute","./Core/GeometryPipeline","./Core/GeometryType","./Core/GregorianDate","./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/IntersectionTests","./Core/Intersections2D","./Core/Interval","./Core/Iso8601","./Core/JulianDate","./Core/KeyboardEventModifier","./Core/LagrangePolynomialApproximation","./Core/LeapSecond","./Core/LinearApproximation","./Core/LinearSpline","./Core/MapProjection","./Core/Math","./Core/Matrix2","./Core/Matrix3","./Core/Matrix4","./Core/NearFarScalar","./Core/ObjectOrientedBoundingBox","./Core/Occluder","./Core/Packable","./Core/PackableForInterpolation","./Core/PinBuilder","./Core/PixelFormat","./Core/Plane","./Core/PolygonGeometry","./Core/PolygonGeometryLibrary","./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/Queue","./Core/Ray","./Core/Rectangle","./Core/RectangleGeometry","./Core/RectangleGeometryLibrary","./Core/RectangleOutlineGeometry","./Core/ReferenceFrame","./Core/RequestErrorEvent","./Core/RuntimeError","./Core/ScreenSpaceEventHandler","./Core/ScreenSpaceEventType","./Core/ShowGeometryInstanceAttribute","./Core/Simon1994PlanetaryPositions","./Core/SimplePolylineGeometry","./Core/SphereGeometry","./Core/SphereOutlineGeometry","./Core/Spherical","./Core/Spline","./Core/TaskProcessor","./Core/TerrainData","./Core/TerrainMesh","./Core/TerrainProvider","./Core/TileProviderError","./Core/TilingScheme","./Core/TimeConstants","./Core/TimeInterval","./Core/TimeIntervalCollection","./Core/TimeStandard","./Core/Tipsify","./Core/Transforms","./Core/TridiagonalSystemSolver","./Core/VRTheWorldTerrainProvider","./Core/VertexFormat","./Core/Visibility","./Core/WallGeometry","./Core/WallGeometryLibrary","./Core/WallOutlineGeometry","./Core/WebMercatorProjection","./Core/WebMercatorTilingScheme","./Core/WindingOrder","./Core/appendForwardSlash","./Core/barycentricCoordinates","./Core/binarySearch","./Core/buildModuleUrl","./Core/cancelAnimationFrame","./Core/clone","./Core/combine","./Core/createGuid","./Core/defaultValue","./Core/defineProperties","./Core/defined","./Core/deprecationWarning","./Core/destroyObject","./Core/formatError","./Core/freezeObject","./Core/getFilenameFromUri","./Core/getImagePixels","./Core/getTimestamp","./Core/isArray","./Core/isCrossOriginUrl","./Core/isLeapYear","./Core/jsonp","./Core/loadArrayBuffer","./Core/loadBlob","./Core/loadImage","./Core/loadImageViaBlob","./Core/loadJson","./Core/loadText","./Core/loadWithXhr","./Core/loadXML","./Core/mergeSort","./Core/objectToQuery","./Core/parseResponseHeaders","./Core/pointInsideTriangle","./Core/queryToObject","./Core/requestAnimationFrame","./Core/sampleTerrain","./Core/subdivideArray","./Core/throttleRequestByServer","./Core/wrapFunction","./Core/writeTextToCanvas","./DataSources/BillboardGraphics","./DataSources/BillboardVisualizer","./DataSources/ColorMaterialProperty","./DataSources/CompositeEntityCollection","./DataSources/CompositeMaterialProperty","./DataSources/CompositePositionProperty","./DataSources/CompositeProperty","./DataSources/ConstantPositionProperty","./DataSources/ConstantProperty","./DataSources/CylinderGeometryUpdater","./DataSources/CylinderGraphics","./DataSources/CzmlDataSource","./DataSources/DataSource","./DataSources/DataSourceClock","./DataSources/DataSourceCollection","./DataSources/DataSourceDisplay","./DataSources/DynamicGeometryUpdater","./DataSources/EllipseGeometryUpdater","./DataSources/EllipseGraphics","./DataSources/EllipsoidGeometryUpdater","./DataSources/EllipsoidGraphics","./DataSources/Entity","./DataSources/EntityCollection","./DataSources/EntityView","./DataSources/GeoJsonDataSource","./DataSources/GeometryUpdater","./DataSources/GeometryVisualizer","./DataSources/GridMaterialProperty","./DataSources/ImageMaterialProperty","./DataSources/LabelGraphics","./DataSources/LabelVisualizer","./DataSources/MaterialProperty","./DataSources/ModelGraphics","./DataSources/ModelVisualizer","./DataSources/PathGraphics","./DataSources/PathVisualizer","./DataSources/PointGraphics","./DataSources/PointVisualizer","./DataSources/PolygonGeometryUpdater","./DataSources/PolygonGraphics","./DataSources/PolylineGeometryUpdater","./DataSources/PolylineGlowMaterialProperty","./DataSources/PolylineGraphics","./DataSources/PolylineOutlineMaterialProperty","./DataSources/PositionProperty","./DataSources/PositionPropertyArray","./DataSources/Property","./DataSources/PropertyArray","./DataSources/RectangleGeometryUpdater","./DataSources/RectangleGraphics","./DataSources/ReferenceProperty","./DataSources/SampledPositionProperty","./DataSources/SampledProperty","./DataSources/StaticGeometryColorBatch","./DataSources/StaticGeometryPerMaterialBatch","./DataSources/StaticOutlineGeometryBatch","./DataSources/StripeMaterialProperty","./DataSources/StripeOrientation","./DataSources/TimeIntervalCollectionPositionProperty","./DataSources/TimeIntervalCollectionProperty","./DataSources/Visualizer","./DataSources/WallGeometryUpdater","./DataSources/WallGraphics","./DataSources/createMaterialPropertyDescriptor","./DataSources/createPropertyDescriptor","./Renderer/AutomaticUniforms","./Renderer/Buffer","./Renderer/BufferUsage","./Renderer/ClearCommand","./Renderer/Context","./Renderer/CubeMap","./Renderer/CubeMapFace","./Renderer/DrawCommand","./Renderer/Framebuffer","./Renderer/MipmapHint","./Renderer/PassState","./Renderer/PickFramebuffer","./Renderer/PixelDatatype","./Renderer/RenderState","./Renderer/Renderbuffer","./Renderer/RenderbufferFormat","./Renderer/ShaderCache","./Renderer/ShaderProgram","./Renderer/ShaderSource","./Renderer/Texture","./Renderer/TextureMagnificationFilter","./Renderer/TextureMinificationFilter","./Renderer/TextureWrap","./Renderer/UniformState","./Renderer/VertexArray","./Renderer/VertexArrayFacade","./Renderer/loadCubeMap","./Scene/Appearance","./Scene/ArcGisMapServerImageryProvider","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/BlendEquation","./Scene/BlendFunction","./Scene/BlendingState","./Scene/Camera","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/CreditDisplay","./Scene/CullFace","./Scene/CullingVolume","./Scene/DebugAppearance","./Scene/DebugModelMatrixPrimitive","./Scene/DepthFunction","./Scene/DiscardMissingTileImagePolicy","./Scene/EllipsoidPrimitive","./Scene/EllipsoidSurfaceAppearance","./Scene/FXAA","./Scene/FrameRateMonitor","./Scene/FrameState","./Scene/FrustumCommands","./Scene/Globe","./Scene/GlobeSurfaceShaderSet","./Scene/GlobeSurfaceTile","./Scene/GlobeSurfaceTileProvider","./Scene/GoogleEarthImageryProvider","./Scene/GridImageryProvider","./Scene/HorizontalOrigin","./Scene/Imagery","./Scene/ImageryLayer","./Scene/ImageryLayerCollection","./Scene/ImageryLayerFeatureInfo","./Scene/ImageryProvider","./Scene/ImageryState","./Scene/Label","./Scene/LabelCollection","./Scene/LabelStyle","./Scene/Material","./Scene/MaterialAppearance","./Scene/Model","./Scene/ModelAnimation","./Scene/ModelAnimationCache","./Scene/ModelAnimationCollection","./Scene/ModelAnimationLoop","./Scene/ModelAnimationState","./Scene/ModelMaterial","./Scene/ModelMesh","./Scene/ModelNode","./Scene/Moon","./Scene/NeverTileDiscardPolicy","./Scene/OIT","./Scene/OpenStreetMapImageryProvider","./Scene/OrthographicFrustum","./Scene/Pass","./Scene/PerInstanceColorAppearance","./Scene/PerformanceDisplay","./Scene/PerspectiveFrustum","./Scene/PerspectiveOffCenterFrustum","./Scene/Polygon","./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/RectanglePrimitive","./Scene/Scene","./Scene/SceneMode","./Scene/SceneTransforms","./Scene/SceneTransitioner","./Scene/ScreenSpaceCameraController","./Scene/SingleTileImageryProvider","./Scene/SkyAtmosphere","./Scene/SkyBox","./Scene/StencilFunction","./Scene/StencilOperation","./Scene/Sun","./Scene/SunPostProcess","./Scene/TerrainState","./Scene/TextureAtlas","./Scene/TileCoordinatesImageryProvider","./Scene/TileDiscardPolicy","./Scene/TileImagery","./Scene/TileMapServiceImageryProvider","./Scene/TileReplacementQueue","./Scene/TileState","./Scene/TileTerrain","./Scene/TweenCollection","./Scene/VerticalOrigin","./Scene/ViewportQuad","./Scene/WebMapServiceImageryProvider","./Scene/WebMapTileServiceImageryProvider","./Scene/createTangentSpaceDebugPrimitive","./Scene/getModelAccessor","./Scene/terrainAttributeLocations","./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/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/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/RGBToXYZ","./Shaders/Builtin/Functions/XYZToRGB","./Shaders/Builtin/Functions/alphaWeight","./Shaders/Builtin/Functions/antialias","./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/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/modelToWindowCoordinates","./Shaders/Builtin/Functions/multiplyWithColorBalance","./Shaders/Builtin/Functions/octDecode","./Shaders/Builtin/Functions/phong","./Shaders/Builtin/Functions/pointAlongRay","./Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval","./Shaders/Builtin/Functions/saturation","./Shaders/Builtin/Functions/signNotZero","./Shaders/Builtin/Functions/tangentToEyeSpaceMatrix","./Shaders/Builtin/Functions/translateRelativeToEye","./Shaders/Builtin/Functions/translucentPhong","./Shaders/Builtin/Functions/transpose","./Shaders/Builtin/Functions/windowToEyeCoordinates","./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/CompositeOITFS","./Shaders/EllipsoidFS","./Shaders/EllipsoidVS","./Shaders/GlobeFS","./Shaders/GlobeFSDepth","./Shaders/GlobeFSPole","./Shaders/GlobeVS","./Shaders/GlobeVSDepth","./Shaders/GlobeVSPole","./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/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/SkyAtmosphereFS","./Shaders/SkyAtmosphereVS","./Shaders/SkyBoxFS","./Shaders/SkyBoxVS","./Shaders/SunFS","./Shaders/SunTextureFS","./Shaders/SunVS","./Shaders/ViewportQuadFS","./Shaders/ViewportQuadVS","./ThirdParty/Tween","./ThirdParty/Uri","./ThirdParty/gltfDefaults","./ThirdParty/knockout-3.2.0","./ThirdParty/knockout-es5","./ThirdParty/knockout","./ThirdParty/measureText","./ThirdParty/mersenne-twister","./ThirdParty/sprintf","./ThirdParty/topojson","./ThirdParty/when","./Widgets/Animation/Animation","./Widgets/Animation/AnimationViewModel","./Widgets/BaseLayerPicker/BaseLayerPicker","./Widgets/BaseLayerPicker/BaseLayerPickerViewModel","./Widgets/BaseLayerPicker/ProviderViewModel","./Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels","./Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels","./Widgets/CesiumInspector/CesiumInspector","./Widgets/CesiumInspector/CesiumInspectorViewModel","./Widgets/CesiumWidget/CesiumWidget","./Widgets/ClockViewModel","./Widgets/Command","./Widgets/FullscreenButton/FullscreenButton","./Widgets/FullscreenButton/FullscreenButtonViewModel","./Widgets/Geocoder/Geocoder","./Widgets/Geocoder/GeocoderViewModel","./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/SvgPathBindingHandler","./Widgets/Timeline/Timeline","./Widgets/Timeline/TimelineHighlightRange","./Widgets/Timeline/TimelineTrack","./Widgets/ToggleButtonViewModel","./Widgets/Viewer/Viewer","./Widgets/Viewer/viewerCesiumInspectorMixin","./Widgets/Viewer/viewerDragDropMixin","./Widgets/Viewer/viewerEntityMixin","./Widgets/Viewer/viewerPerformanceWatchdogMixin","./Widgets/createCommand","./Widgets/getElement","./Widgets/subscribeAndEvaluate","./Workers/createTaskProcessorWorker"],function(e,t,r,i,n,o,a,s,l,u,c,h,d,m,p,f,v,g,_,y,C,w,S,E,b,T,x,P,A,M,D,I,O,R,L,N,F,B,z,V,k,U,W,G,H,q,j,Y,X,Z,Q,J,K,$,et,tt,rt,it,nt,ot,at,st,lt,ut,ct,ht,dt,mt,pt,ft,vt,gt,_t,yt,Ct,wt,St,Et,bt,Tt,xt,Pt,At,Mt,Dt,It,Ot,Rt,Lt,Nt,Ft,Bt,zt,Vt,kt,Ut,Wt,Gt,Ht,qt,jt,Yt,Xt,Zt,Qt,Jt,Kt,$t,er,tr,rr,ir,nr,or,ar,sr,lr,ur,cr,hr,dr,mr,pr,fr,vr,gr,_r,yr,Cr,wr,Sr,Er,br,Tr,xr,Pr,Ar,Mr,Dr,Ir,Or,Rr,Lr,Nr,Fr,Br,zr,Vr,kr,Ur,Wr,Gr,Hr,qr,jr,Yr,Xr,Zr,Qr,Jr,Kr,$r,ei,ti,ri,ii,ni,oi,ai,si,li,ui,ci,hi,di,mi,pi,fi,vi,gi,_i,yi,Ci,wi,Si,Ei,bi,Ti,xi,Pi,Ai,Mi,Di,Ii,Oi,Ri,Li,Ni,Fi,Bi,zi,Vi,ki,Ui,Wi,Gi,Hi,qi,ji,Yi,Xi,Zi,Qi,Ji,Ki,$i,en,tn,rn,nn,on,an,sn,ln,un,cn,hn,dn,mn,pn,fn,vn,gn,_n,yn,Cn,wn,Sn,En,bn,Tn,xn,Pn,An,Mn,Dn,In,On,Rn,Ln,Nn,Fn,Bn,zn,Vn,kn,Un,Wn,Gn,Hn,qn,jn,Yn,Xn,Zn,Qn,Jn,Kn,$n,eo,to,ro,io,no,oo,ao,so,lo,uo,co,ho,mo,po,fo,vo,go,_o,yo,Co,wo,So,Eo,bo,To,xo,Po,Ao,Mo,Do,Io,Oo,Ro,Lo,No,Fo,Bo,zo,Vo,ko,Uo,Wo,Go,Ho,qo,jo,Yo,Xo,Zo,Qo,Jo,Ko,$o,ea,ta,ra,ia,na,oa,aa,sa,la,ua,ca,ha,da,ma,pa,fa,va,ga,_a,ya,Ca,wa,Sa,Ea,ba,Ta,xa,Pa,Aa,Ma,Da,Ia,Oa,Ra,La,Na,Fa,Ba,za,Va,ka,Ua,Wa,Ga,Ha,qa,ja,Ya,Xa,Za,Qa,Ja,Ka,$a,es,ts,rs,is,ns,os,as,ss,ls,us,cs,hs,ds,ms,ps,fs,vs,gs,_s,ys,Cs,ws,Ss,Es,bs,Ts,xs,Ps,As,Ms,Ds,Is,Os,Rs,Ls,Ns,Fs,Bs,zs,Vs,ks,Us,Ws,Gs,Hs,qs,js,Ys,Xs,Zs,Qs,Js,Ks,$s,el,tl,rl,il,nl,ol,al,sl,ll,ul,cl,hl,dl,ml,pl,fl,vl,gl,_l,yl,Cl,wl,Sl,El,bl,Tl,xl,Pl,Al,Ml,Dl,Il,Ol,Rl,Ll,Nl,Fl,Bl,zl,Vl,kl,Ul,Wl,Gl,Hl,ql,jl,Yl,Xl,Zl,Ql,Jl,Kl,$l,eu,tu,ru,iu,nu,ou,au,su,lu,uu,cu,hu,du,mu,pu,fu,vu,gu,_u,yu,Cu,wu,Su,Eu,bu,Tu,xu,Pu,Au,Mu,Du,Iu,Ou,Ru,Lu,Nu,Fu,Bu,zu,Vu,ku,Uu,Wu,Gu,Hu,qu,ju,Yu,Xu,Zu,Qu,Ju,Ku,$u,ec,tc,rc,ic,nc,oc,ac,sc,lc,uc,cc,hc,dc,mc,pc,fc,vc,gc,_c,yc,Cc,wc,Sc,Ec,bc,Tc,xc,Pc,Ac,Mc,Dc,Ic,Oc,Rc,Lc,Nc,Fc){"use strict";var Bc={VERSION:"1.3",_shaders:{}};return Bc.ArcGisImageServerTerrainProvider=e,Bc.AssociativeArray=t,Bc.AttributeCompression=r,Bc.AxisAlignedBoundingBox=i,Bc.BingMapsApi=n,Bc.BoundingRectangle=o,Bc.BoundingSphere=a,Bc.BoxGeometry=s,Bc.BoxOutlineGeometry=l,Bc.Cartesian2=u,Bc.Cartesian3=c,Bc.Cartesian4=h,Bc.Cartographic=d,Bc.CatmullRomSpline=m,Bc.CesiumTerrainProvider=p,Bc.CircleGeometry=f,Bc.CircleOutlineGeometry=v,Bc.Clock=g,Bc.ClockRange=_,Bc.ClockStep=y,Bc.Color=C,Bc.ColorGeometryInstanceAttribute=w,Bc.ComponentDatatype=S,Bc.CornerType=E,Bc.CorridorGeometry=b,Bc.CorridorGeometryLibrary=T,Bc.CorridorOutlineGeometry=x,Bc.Credit=P,Bc.CubicRealPolynomial=A,Bc.CylinderGeometry=M,Bc.CylinderGeometryLibrary=D,Bc.CylinderOutlineGeometry=I,Bc.DefaultProxy=O,Bc.DeveloperError=R,Bc.EarthOrientationParameters=L,Bc.EarthOrientationParametersSample=N,Bc.EasingFunction=F,Bc.EllipseGeometry=B,Bc.EllipseGeometryLibrary=z,Bc.EllipseOutlineGeometry=V,Bc.Ellipsoid=k,Bc.EllipsoidGeodesic=U,Bc.EllipsoidGeometry=W,Bc.EllipsoidOutlineGeometry=G,Bc.EllipsoidTangentPlane=H,Bc.EllipsoidTerrainProvider=q,Bc.EllipsoidalOccluder=j,Bc.EncodedCartesian3=Y,Bc.Event=X,Bc.EventHelper=Z,Bc.ExtrapolationType=Q,Bc.FeatureDetection=J,Bc.Fullscreen=K,Bc.GeographicProjection=$,Bc.GeographicTilingScheme=et,Bc.Geometry=tt,Bc.GeometryAttribute=rt,Bc.GeometryAttributes=it,Bc.GeometryInstance=nt,Bc.GeometryInstanceAttribute=ot,Bc.GeometryPipeline=at,Bc.GeometryType=st,Bc.GregorianDate=lt,Bc.HeightmapTerrainData=ut,Bc.HeightmapTessellator=ct,Bc.HermitePolynomialApproximation=ht,Bc.HermiteSpline=dt,Bc.Iau2000Orientation=mt,Bc.Iau2006XysData=pt,Bc.Iau2006XysSample=ft,Bc.IauOrientationAxes=vt,Bc.IauOrientationParameters=gt,Bc.IndexDatatype=_t,Bc.InterpolationAlgorithm=yt,Bc.Intersect=Ct,Bc.IntersectionTests=wt,Bc.Intersections2D=St,Bc.Interval=Et,Bc.Iso8601=bt,Bc.JulianDate=Tt,Bc.KeyboardEventModifier=xt,Bc.LagrangePolynomialApproximation=Pt,Bc.LeapSecond=At,Bc.LinearApproximation=Mt,Bc.LinearSpline=Dt,Bc.MapProjection=It,Bc.Math=Ot,Bc.Matrix2=Rt,Bc.Matrix3=Lt,Bc.Matrix4=Nt,Bc.NearFarScalar=Ft,Bc.ObjectOrientedBoundingBox=Bt,Bc.Occluder=zt,Bc.Packable=Vt,Bc.PackableForInterpolation=kt,Bc.PinBuilder=Ut,Bc.PixelFormat=Wt,Bc.Plane=Gt,Bc.PolygonGeometry=Ht,Bc.PolygonGeometryLibrary=qt,Bc.PolygonOutlineGeometry=jt,Bc.PolygonPipeline=Yt,Bc.PolylineGeometry=Xt,Bc.PolylinePipeline=Zt,Bc.PolylineVolumeGeometry=Qt,Bc.PolylineVolumeGeometryLibrary=Jt,Bc.PolylineVolumeOutlineGeometry=Kt,Bc.PrimitiveType=$t,Bc.QuadraticRealPolynomial=er,Bc.QuantizedMeshTerrainData=tr,Bc.QuarticRealPolynomial=rr,Bc.Quaternion=ir,Bc.QuaternionSpline=nr,Bc.Queue=or,Bc.Ray=ar,Bc.Rectangle=sr,Bc.RectangleGeometry=lr,Bc.RectangleGeometryLibrary=ur,Bc.RectangleOutlineGeometry=cr,Bc.ReferenceFrame=hr,Bc.RequestErrorEvent=dr,Bc.RuntimeError=mr,Bc.ScreenSpaceEventHandler=pr,Bc.ScreenSpaceEventType=fr,Bc.ShowGeometryInstanceAttribute=vr,Bc.Simon1994PlanetaryPositions=gr,Bc.SimplePolylineGeometry=_r,Bc.SphereGeometry=yr,Bc.SphereOutlineGeometry=Cr,Bc.Spherical=wr,Bc.Spline=Sr,Bc.TaskProcessor=Er,Bc.TerrainData=br,Bc.TerrainMesh=Tr,Bc.TerrainProvider=xr,Bc.TileProviderError=Pr,Bc.TilingScheme=Ar,Bc.TimeConstants=Mr,Bc.TimeInterval=Dr,Bc.TimeIntervalCollection=Ir,Bc.TimeStandard=Or,Bc.Tipsify=Rr,Bc.Transforms=Lr,Bc.TridiagonalSystemSolver=Nr,Bc.VRTheWorldTerrainProvider=Fr,Bc.VertexFormat=Br,Bc.Visibility=zr,Bc.WallGeometry=Vr,Bc.WallGeometryLibrary=kr,Bc.WallOutlineGeometry=Ur,Bc.WebMercatorProjection=Wr,Bc.WebMercatorTilingScheme=Gr,Bc.WindingOrder=Hr,Bc.appendForwardSlash=qr,Bc.barycentricCoordinates=jr,Bc.binarySearch=Yr,Bc.buildModuleUrl=Xr,Bc.cancelAnimationFrame=Zr,Bc.clone=Qr,Bc.combine=Jr,Bc.createGuid=Kr,Bc.defaultValue=$r,Bc.defineProperties=ei,Bc.defined=ti,Bc.deprecationWarning=ri,Bc.destroyObject=ii,Bc.formatError=ni,Bc.freezeObject=oi,Bc.getFilenameFromUri=ai,Bc.getImagePixels=si,Bc.getTimestamp=li,Bc.isArray=ui,Bc.isCrossOriginUrl=ci,Bc.isLeapYear=hi,Bc.jsonp=di,Bc.loadArrayBuffer=mi,Bc.loadBlob=pi,Bc.loadImage=fi,Bc.loadImageViaBlob=vi,Bc.loadJson=gi,Bc.loadText=_i,Bc.loadWithXhr=yi,Bc.loadXML=Ci,Bc.mergeSort=wi,Bc.objectToQuery=Si,Bc.parseResponseHeaders=Ei,Bc.pointInsideTriangle=bi,Bc.queryToObject=Ti,Bc.requestAnimationFrame=xi,Bc.sampleTerrain=Pi,Bc.subdivideArray=Ai,Bc.throttleRequestByServer=Mi,Bc.wrapFunction=Di,Bc.writeTextToCanvas=Ii,Bc.BillboardGraphics=Oi,Bc.BillboardVisualizer=Ri,Bc.ColorMaterialProperty=Li,Bc.CompositeEntityCollection=Ni,Bc.CompositeMaterialProperty=Fi,Bc.CompositePositionProperty=Bi,Bc.CompositeProperty=zi,Bc.ConstantPositionProperty=Vi,Bc.ConstantProperty=ki,Bc.CylinderGeometryUpdater=Ui,Bc.CylinderGraphics=Wi,Bc.CzmlDataSource=Gi,Bc.DataSource=Hi,Bc.DataSourceClock=qi,Bc.DataSourceCollection=ji,Bc.DataSourceDisplay=Yi,Bc.DynamicGeometryUpdater=Xi,Bc.EllipseGeometryUpdater=Zi,Bc.EllipseGraphics=Qi,Bc.EllipsoidGeometryUpdater=Ji,Bc.EllipsoidGraphics=Ki,Bc.Entity=$i,Bc.EntityCollection=en,Bc.EntityView=tn,Bc.GeoJsonDataSource=rn,Bc.GeometryUpdater=nn,Bc.GeometryVisualizer=on,Bc.GridMaterialProperty=an,Bc.ImageMaterialProperty=sn,Bc.LabelGraphics=ln,Bc.LabelVisualizer=un,Bc.MaterialProperty=cn,Bc.ModelGraphics=hn,Bc.ModelVisualizer=dn,Bc.PathGraphics=mn,Bc.PathVisualizer=pn,Bc.PointGraphics=fn,Bc.PointVisualizer=vn,Bc.PolygonGeometryUpdater=gn,Bc.PolygonGraphics=_n,Bc.PolylineGeometryUpdater=yn,Bc.PolylineGlowMaterialProperty=Cn,Bc.PolylineGraphics=wn,Bc.PolylineOutlineMaterialProperty=Sn,Bc.PositionProperty=En,Bc.PositionPropertyArray=bn,Bc.Property=Tn,Bc.PropertyArray=xn,Bc.RectangleGeometryUpdater=Pn,Bc.RectangleGraphics=An,Bc.ReferenceProperty=Mn,Bc.SampledPositionProperty=Dn,Bc.SampledProperty=In,Bc.StaticGeometryColorBatch=On,Bc.StaticGeometryPerMaterialBatch=Rn,Bc.StaticOutlineGeometryBatch=Ln,Bc.StripeMaterialProperty=Nn,Bc.StripeOrientation=Fn,Bc.TimeIntervalCollectionPositionProperty=Bn,Bc.TimeIntervalCollectionProperty=zn,Bc.Visualizer=Vn,Bc.WallGeometryUpdater=kn,Bc.WallGraphics=Un,Bc.createMaterialPropertyDescriptor=Wn,Bc.createPropertyDescriptor=Gn,Bc.AutomaticUniforms=Hn,Bc.Buffer=qn,Bc.BufferUsage=jn,Bc.ClearCommand=Yn,Bc.Context=Xn,Bc.CubeMap=Zn,Bc.CubeMapFace=Qn,Bc.DrawCommand=Jn,Bc.Framebuffer=Kn,Bc.MipmapHint=$n,Bc.PassState=eo,Bc.PickFramebuffer=to,Bc.PixelDatatype=ro,Bc.RenderState=io,Bc.Renderbuffer=no,Bc.RenderbufferFormat=oo,Bc.ShaderCache=ao,Bc.ShaderProgram=so,Bc.ShaderSource=lo,Bc.Texture=uo,Bc.TextureMagnificationFilter=co,Bc.TextureMinificationFilter=ho,Bc.TextureWrap=mo,Bc.UniformState=po,Bc.VertexArray=fo,Bc.VertexArrayFacade=vo,Bc.loadCubeMap=go,Bc.Appearance=_o,Bc.ArcGisMapServerImageryProvider=yo,Bc.Billboard=Co,Bc.BillboardCollection=wo,Bc.BingMapsImageryProvider=So,Bc.BingMapsStyle=Eo,Bc.BlendEquation=bo,Bc.BlendFunction=To,Bc.BlendingState=xo,Bc.Camera=Po,Bc.CameraEventAggregator=Ao,Bc.CameraEventType=Mo,Bc.CameraFlightPath=Do,Bc.CreditDisplay=Io,Bc.CullFace=Oo,Bc.CullingVolume=Ro,Bc.DebugAppearance=Lo,Bc.DebugModelMatrixPrimitive=No,Bc.DepthFunction=Fo,Bc.DiscardMissingTileImagePolicy=Bo,Bc.EllipsoidPrimitive=zo,Bc.EllipsoidSurfaceAppearance=Vo,Bc.FXAA=ko,Bc.FrameRateMonitor=Uo,Bc.FrameState=Wo,Bc.FrustumCommands=Go,Bc.Globe=Ho,Bc.GlobeSurfaceShaderSet=qo,Bc.GlobeSurfaceTile=jo,Bc.GlobeSurfaceTileProvider=Yo,Bc.GoogleEarthImageryProvider=Xo,Bc.GridImageryProvider=Zo,Bc.HorizontalOrigin=Qo,Bc.Imagery=Jo,Bc.ImageryLayer=Ko,Bc.ImageryLayerCollection=$o,Bc.ImageryLayerFeatureInfo=ea,Bc.ImageryProvider=ta,Bc.ImageryState=ra,Bc.Label=ia,Bc.LabelCollection=na,Bc.LabelStyle=oa,Bc.Material=aa,Bc.MaterialAppearance=sa,Bc.Model=la,Bc.ModelAnimation=ua,Bc.ModelAnimationCache=ca,Bc.ModelAnimationCollection=ha,Bc.ModelAnimationLoop=da,Bc.ModelAnimationState=ma,Bc.ModelMaterial=pa,Bc.ModelMesh=fa,Bc.ModelNode=va,Bc.Moon=ga,Bc.NeverTileDiscardPolicy=_a,Bc.OIT=ya,Bc.OpenStreetMapImageryProvider=Ca,Bc.OrthographicFrustum=wa,Bc.Pass=Sa,Bc.PerInstanceColorAppearance=Ea,Bc.PerformanceDisplay=ba,Bc.PerspectiveFrustum=Ta,Bc.PerspectiveOffCenterFrustum=xa,Bc.Polygon=Pa,Bc.Polyline=Aa,Bc.PolylineCollection=Ma,Bc.PolylineColorAppearance=Da,Bc.PolylineMaterialAppearance=Ia,Bc.Primitive=Oa,Bc.PrimitiveCollection=Ra,Bc.PrimitivePipeline=La,Bc.PrimitiveState=Na,Bc.QuadtreeOccluders=Fa,Bc.QuadtreePrimitive=Ba,Bc.QuadtreeTile=za,Bc.QuadtreeTileLoadState=Va,Bc.QuadtreeTileProvider=ka,Bc.RectanglePrimitive=Ua,Bc.Scene=Wa,Bc.SceneMode=Ga,Bc.SceneTransforms=Ha,Bc.SceneTransitioner=qa,Bc.ScreenSpaceCameraController=ja,Bc.SingleTileImageryProvider=Ya,Bc.SkyAtmosphere=Xa,Bc.SkyBox=Za,Bc.StencilFunction=Qa,Bc.StencilOperation=Ja,Bc.Sun=Ka,Bc.SunPostProcess=$a,Bc.TerrainState=es,Bc.TextureAtlas=ts,Bc.TileCoordinatesImageryProvider=rs,Bc.TileDiscardPolicy=is,Bc.TileImagery=ns,Bc.TileMapServiceImageryProvider=os,Bc.TileReplacementQueue=as,Bc.TileState=ss,Bc.TileTerrain=ls,Bc.TweenCollection=us,Bc.VerticalOrigin=cs,Bc.ViewportQuad=hs,Bc.WebMapServiceImageryProvider=ds,Bc.WebMapTileServiceImageryProvider=ms,Bc.createTangentSpaceDebugPrimitive=ps,Bc.getModelAccessor=fs,Bc.terrainAttributeLocations=vs,Bc._shaders.AdjustTranslucentFS=gs,Bc._shaders.AllMaterialAppearanceFS=_s,Bc._shaders.AllMaterialAppearanceVS=ys,Bc._shaders.BasicMaterialAppearanceFS=Cs,Bc._shaders.BasicMaterialAppearanceVS=ws,Bc._shaders.EllipsoidSurfaceAppearanceFS=Ss,Bc._shaders.EllipsoidSurfaceAppearanceVS=Es,Bc._shaders.PerInstanceColorAppearanceFS=bs,Bc._shaders.PerInstanceColorAppearanceVS=Ts,Bc._shaders.PerInstanceFlatColorAppearanceFS=xs,Bc._shaders.PerInstanceFlatColorAppearanceVS=Ps,Bc._shaders.PolylineColorAppearanceVS=As,Bc._shaders.PolylineMaterialAppearanceVS=Ms,Bc._shaders.TexturedMaterialAppearanceFS=Ds,Bc._shaders.TexturedMaterialAppearanceVS=Is,Bc._shaders.BillboardCollectionFS=Os,Bc._shaders.BillboardCollectionVS=Rs,Bc._shaders.degreesPerRadian=Ls,Bc._shaders.depthRange=Ns,Bc._shaders.epsilon1=Fs,Bc._shaders.epsilon2=Bs,Bc._shaders.epsilon3=zs,Bc._shaders.epsilon4=Vs,Bc._shaders.epsilon5=ks,Bc._shaders.epsilon6=Us,Bc._shaders.epsilon7=Ws,Bc._shaders.infinity=Gs,Bc._shaders.oneOverPi=Hs,Bc._shaders.oneOverTwoPi=qs,Bc._shaders.pi=js,Bc._shaders.piOverFour=Ys,Bc._shaders.piOverSix=Xs,Bc._shaders.piOverThree=Zs,Bc._shaders.piOverTwo=Qs,Bc._shaders.radiansPerDegree=Js,Bc._shaders.sceneMode2D=Ks,Bc._shaders.sceneMode3D=$s,Bc._shaders.sceneModeColumbusView=el,Bc._shaders.sceneModeMorphing=tl,Bc._shaders.solarRadius=rl,Bc._shaders.threePiOver2=il,Bc._shaders.twoPi=nl,Bc._shaders.webMercatorMaxLatitude=ol,Bc._shaders.CzmBuiltins=al,Bc._shaders.RGBToXYZ=sl,Bc._shaders.XYZToRGB=ll,Bc._shaders.alphaWeight=ul,Bc._shaders.antialias=cl,Bc._shaders.columbusViewMorph=hl,Bc._shaders.computePosition=dl,Bc._shaders.cosineAndSine=ml,Bc._shaders.decompressTextureCoordinates=pl,Bc._shaders.eastNorthUpToEyeCoordinates=fl,Bc._shaders.ellipsoidContainsPoint=vl,Bc._shaders.ellipsoidNew=gl,Bc._shaders.ellipsoidWgs84TextureCoordinates=_l,Bc._shaders.equalsEpsilon=yl,Bc._shaders.eyeOffset=Cl,Bc._shaders.eyeToWindowCoordinates=wl,Bc._shaders.geodeticSurfaceNormal=Sl,Bc._shaders.getDefaultMaterial=El,Bc._shaders.getLambertDiffuse=bl,Bc._shaders.getSpecular=Tl,Bc._shaders.getWaterNoise=xl,Bc._shaders.getWgs84EllipsoidEC=Pl,Bc._shaders.hue=Al,Bc._shaders.isEmpty=Ml,Bc._shaders.isFull=Dl,Bc._shaders.latitudeToWebMercatorFraction=Il,Bc._shaders.luminance=Ol,Bc._shaders.modelToWindowCoordinates=Rl,Bc._shaders.multiplyWithColorBalance=Ll,Bc._shaders.octDecode=Nl,Bc._shaders.phong=Fl,Bc._shaders.pointAlongRay=Bl,Bc._shaders.rayEllipsoidIntersectionInterval=zl,Bc._shaders.saturation=Vl,Bc._shaders.signNotZero=kl,Bc._shaders.tangentToEyeSpaceMatrix=Ul,Bc._shaders.translateRelativeToEye=Wl,Bc._shaders.translucentPhong=Gl,Bc._shaders.transpose=Hl,Bc._shaders.windowToEyeCoordinates=ql,Bc._shaders.depthRangeStruct=jl,Bc._shaders.ellipsoid=Yl,Bc._shaders.material=Xl,Bc._shaders.materialInput=Zl,Bc._shaders.ray=Ql,Bc._shaders.raySegment=Jl,Bc._shaders.CompositeOITFS=Kl,Bc._shaders.EllipsoidFS=$l,Bc._shaders.EllipsoidVS=eu,Bc._shaders.GlobeFS=tu,Bc._shaders.GlobeFSDepth=ru,Bc._shaders.GlobeFSPole=iu,Bc._shaders.GlobeVS=nu,Bc._shaders.GlobeVSDepth=ou,Bc._shaders.GlobeVSPole=au,Bc._shaders.BumpMapMaterial=su,Bc._shaders.CheckerboardMaterial=lu,Bc._shaders.DotMaterial=uu,Bc._shaders.FadeMaterial=cu,Bc._shaders.GridMaterial=hu,Bc._shaders.NormalMapMaterial=du,Bc._shaders.PolylineArrowMaterial=mu,Bc._shaders.PolylineGlowMaterial=pu,Bc._shaders.PolylineOutlineMaterial=fu,Bc._shaders.RimLightingMaterial=vu,Bc._shaders.StripeMaterial=gu,Bc._shaders.Water=_u,Bc._shaders.PolylineCommon=yu,Bc._shaders.PolylineFS=Cu,Bc._shaders.PolylineVS=wu,Bc._shaders.AdditiveBlend=Su,Bc._shaders.BrightPass=Eu,Bc._shaders.FXAA=bu,Bc._shaders.GaussianBlur1D=Tu,Bc._shaders.PassThrough=xu,Bc._shaders.ReprojectWebMercatorFS=Pu,Bc._shaders.ReprojectWebMercatorVS=Au,Bc._shaders.SkyAtmosphereFS=Mu,Bc._shaders.SkyAtmosphereVS=Du,Bc._shaders.SkyBoxFS=Iu,Bc._shaders.SkyBoxVS=Ou,Bc._shaders.SunFS=Ru,Bc._shaders.SunTextureFS=Lu,Bc._shaders.SunVS=Nu,Bc._shaders.ViewportQuadFS=Fu,Bc._shaders.ViewportQuadVS=Bu,Bc.Tween=zu,Bc.Uri=Vu,Bc.gltfDefaults=ku,Bc["knockout-3.2.0"]=Uu,Bc["knockout-es5"]=Wu,Bc.knockout=Gu,Bc.measureText=Hu,Bc["mersenne-twister"]=qu,Bc.sprintf=ju,Bc.topojson=Yu,Bc.when=Xu,Bc.Animation=Zu,Bc.AnimationViewModel=Qu,Bc.BaseLayerPicker=Ju,Bc.BaseLayerPickerViewModel=Ku,Bc.ProviderViewModel=$u,Bc.createDefaultImageryProviderViewModels=ec,Bc.createDefaultTerrainProviderViewModels=tc,Bc.CesiumInspector=rc,Bc.CesiumInspectorViewModel=ic,Bc.CesiumWidget=nc,Bc.ClockViewModel=oc,Bc.Command=ac,Bc.FullscreenButton=sc,Bc.FullscreenButtonViewModel=lc,Bc.Geocoder=uc,Bc.GeocoderViewModel=cc,Bc.HomeButton=hc,Bc.HomeButtonViewModel=dc,Bc.InfoBox=mc,Bc.InfoBoxViewModel=pc,Bc.NavigationHelpButton=fc,Bc.NavigationHelpButtonViewModel=vc,Bc.PerformanceWatchdog=gc,Bc.PerformanceWatchdogViewModel=_c,Bc.SceneModePicker=yc,Bc.SceneModePickerViewModel=Cc,Bc.SelectionIndicator=wc,Bc.SelectionIndicatorViewModel=Sc,Bc.SvgPathBindingHandler=Ec,Bc.Timeline=bc,Bc.TimelineHighlightRange=Tc,Bc.TimelineTrack=xc,Bc.ToggleButtonViewModel=Pc,Bc.Viewer=Ac,Bc.viewerCesiumInspectorMixin=Mc,Bc.viewerDragDropMixin=Dc,Bc.viewerEntityMixin=Ic,Bc.viewerPerformanceWatchdogMixin=Oc,Bc.createCommand=Rc,Bc.getElement=Lc,Bc.subscribeAndEvaluate=Nc,Bc.createTaskProcessorWorker=Fc,Bc -}),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 +/** + * @license + * NoSleep.js v0.5.0 - git.io/vfn01 + * Rich Tibbett + * MIT license + **/ + +!function(){var e,t,i;!function(r){function n(e,t){return C.call(e,t)}function o(e,t){var i,r,n,o,a,s,l,u,c,h,d,p=t&&t.split("/"),m=_.map,f=m&&m["*"]||{};if(e&&"."===e.charAt(0))if(t){for(e=e.split("/"),a=e.length-1,_.nodeIdCompat&&S.test(e[a])&&(e[a]=e[a].replace(S,"")),e=p.slice(0,p.length-1).concat(e),c=0;c0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((p||f)&&m){for(i=e.split("/"),c=i.length;c>0;c-=1){if(r=i.slice(0,c).join("/"),p)for(h=p.length;h>0;h-=1)if(n=m[p.slice(0,h).join("/")],n&&(n=n[r])){o=n,s=c;break}if(o)break;!l&&f&&f[r]&&(l=f[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=E.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),p.apply(r,i.concat([e,t]))}}function s(e){return function(t){return o(t,e)}}function l(e){return function(t){v[e]=t}}function u(e){if(n(g,e)){var t=g[e];delete g[e],y[e]=!0,d.apply(r,t)}if(!n(v,e)&&!n(y,e))throw new Error("No "+e);return v[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 function(){return _&&_.config&&_.config[e]||{}}}var d,p,m,f,v={},g={},_={},y={},C=Object.prototype.hasOwnProperty,E=[].slice,S=/\.js$/;m=function(e,t){var i,r=c(e),n=r[0];return e=r[1],n&&(n=o(n,t),i=u(n)),n?e=i&&i.normalize?i.normalize(e,s(t)):o(e,t):(e=o(e,t),r=c(e),n=r[0],e=r[1],n&&(i=u(n))),{f:n?n+"!"+e:e,n:e,pr:n,p:i}},f={require:function(e){return a(e)},exports:function(e){var t=v[e];return"undefined"!=typeof t?t:v[e]={}},module:function(e){return{id:e,uri:"",exports:v[e],config:h(e)}}},d=function(e,t,i,o){var s,c,h,d,p,_,C=[],E=typeof i;if(o=o||e,"undefined"===E||"function"===E){for(t=!t.length&&i.length?["require","exports","module"]:t,p=0;p>>0,u=Math.max(0,Math.min(i,_)),h=[],c=_-u+1,d=[],p=a(),u)for(v=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;++y)y in t&&e(t[y],l,s,v);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 v(1,arguments),d(e,_).then(t,i,r)}function h(){return d(arguments,_)}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;n>l;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 v(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 _(e){return e}var y,C,E;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(E,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(E,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(;n>o;++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}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(i){t=i.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),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("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>>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:0>e?-1:0},n.signNotZero=function(e){return 0>e?-1:1},n.toSNorm=function(e){return Math.round(255*(.5*n.clamp(e,-1,1)+.5))},n.fromSNorm=function(e){return n.clamp(e,0,255)/255*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.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 n>=o||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;e>=r;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n){"use strict";function o(t,i,r){this.x=e(t,0),this.y=e(i,0),this.z=e(r,0)}o.fromSpherical=function(i,r){t(r)||(r=new o);var n=i.clock,a=i.cone,s=e(i.magnitude,1),l=s*Math.sin(a);return r.x=l*Math.cos(n),r.y=l*Math.sin(n),r.z=s*Math.cos(a),r},o.fromElements=function(e,i,r,n){return t(n)?(n.x=e,n.y=i,n.z=r,n):new o(e,i,r)},o.clone=function(e,i){return t(e)?t(i)?(i.x=e.x,i.y=e.y,i.z=e.z,i):new o(e.x,e.y,e.z):void 0},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,i,r){r=e(r,0),i[r++]=t.x,i[r++]=t.y,i[r]=t.z},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},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,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},o.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},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 a=new o;o.distance=function(e,t){return o.subtract(e,t,a),o.magnitude(a)},o.distanceSquared=function(e,t){return o.subtract(e,t,a),o.magnitudeSquared(a)},o.normalize=function(e,t){var i=o.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.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},o.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},o.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},o.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i},o.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i},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,i,r){return o.multiplyByScalar(t,i,s),r=o.multiplyByScalar(e,1-i,r),o.add(s,r,r)};var l=new o,u=new o;o.angleBetween=function(e,t){o.normalize(e,l),o.normalize(t,u);var i=o.dot(l,u),r=o.magnitude(o.cross(l,u,l));return Math.atan2(r,i)};var c=new o;o.mostOrthogonalAxis=function(e,t){var i=o.normalize(e,c);return o.abs(i,i),t=i.x<=i.y?i.x<=i.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):i.y<=i.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,i){return e===i||t(e)&&t(i)&&e.x===i.x&&e.y===i.y&&e.z===i.z},o.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]},o.equalsEpsilon=function(e,i,r,o){return e===i||t(e)&&t(i)&&n.equalsEpsilon(e.x,i.x,r,o)&&n.equalsEpsilon(e.y,i.y,r,o)&&n.equalsEpsilon(e.z,i.z,r,o)},o.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},o.fromDegrees=function(e,t,i,r,a){var s=n.toRadians(e),l=n.toRadians(t);return o.fromRadians(s,l,i,r,a)};var h=new o,d=new o,p=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(i,r,n,a,s){n=e(n,0);var l=t(a)?a.radiiSquared:p,u=Math.cos(r);h.x=u*Math.cos(i),h.y=u*Math.sin(i),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(l,h,d);var c=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,c,d),h=o.multiplyByScalar(h,n,h),t(s)||(s=new o),o.add(d,h,s)},o.fromDegreesArray=function(e,t,i){for(var r=new Array(e.length),a=0;aa;a+=2){var s=e[a],l=e[a+1];r[a/2]=o.fromRadians(s,l,0,i,r[a/2])}return r},o.fromDegreesArrayHeights=function(e,t,i){for(var r=new Array(e.length),a=0;aa;a+=3){var s=e[a],l=e[a+1],u=e[a+2];r[a/3]=o.fromRadians(s,l,u,i,r[a/3])}return r},o.ZERO=r(new o(0,0,0)),o.UNIT_X=r(new o(1,0,0)),o.UNIT_Y=r(new o(0,1,0)),o.UNIT_Z=r(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,i){return o.equalsEpsilon(this,e,t,i)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),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,v=c*c*p*p,g=h*h*m*m,_=d*d*f*f,y=v+g+_,C=Math.sqrt(1/y),E=e.multiplyByScalar(i,C,o);if(l>y)return isFinite(C)?e.clone(E,u):void 0;var S=s.x,w=s.y,T=s.z,x=a;x.x=E.x*S*2,x.y=E.y*w*2,x.z=E.z*T*2;var b,A,P,I,M,D,R,O,N,L,F,B=(1-C)*e.magnitude(i)/(.5*e.magnitude(x)),V=0;do{B-=V,P=1/(1+B*S),I=1/(1+B*w),M=1/(1+B*T),D=P*P,R=I*I,O=M*M,N=D*P,L=R*I,F=O*M,b=v*D+g*R+_*O-1,A=v*N*S+g*L*w+_*F*T;var k=-2*A;V=b/k}while(Math.abs(b)>r.EPSILON12);return t(u)?(u.x=c*P,u.y=h*I,u.z=d*M,u):new e(c*P,h*I,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,v=i(r)?r._centerToleranceSquared:p,g=a(t,m,f,v,u);if(i(g)){var _=e.multiplyComponents(t,f,l);_=e.normalize(_,_);var y=e.subtract(t,g,c),C=Math.atan2(_.y,_.x),E=Math.asin(_.z),S=o.sign(e.dot(y,t))*e.magnitude(y);return i(n)?(n.longitude=C,n.latitude=E,n.height=S,n):new s(C,E,S)}},s.clone=function(e,t){return i(e)?i(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new s(e.longitude,e.latitude,e.height):void 0},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}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,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){n=i(n,0),e.pack(t._radii,r,n)},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;i>n;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;i>n;++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}),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;ot;t++){var o=i[t];e(o)&&i[t].apply(r[t],arguments)}var a=this._toRemove;for(n=a.length,t=0;n>t;t++){var s=a[t];i.splice(s,1),r.splice(s,1)}a.length=0,this._insideRaiseEvent=!1},r}),i("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n){"use strict";function o(t,i){this.x=e(t,0),this.y=e(i,0)}o.fromElements=function(e,i,r){return t(r)?(r.x=e,r.y=i,r):new o(e,i)},o.clone=function(e,i){return t(e)?t(i)?(i.x=e.x,i.y=e.y,i):new o(e.x,e.y):void 0},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(t,i,r){r=e(r,0),i[r++]=t.x,i[r]=t.y},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},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,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i},o.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,t){return o.subtract(e,t,a),o.magnitude(a)},o.distanceSquared=function(e,t){return o.subtract(e,t,a),o.magnitudeSquared(a)},o.normalize=function(e,t){var i=o.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i},o.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i},o.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i},o.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i},o.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i},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,i,r){return o.multiplyByScalar(t,i,s),r=o.multiplyByScalar(e,1-i,r),o.add(s,r,r)};var l=new o,u=new o;o.angleBetween=function(e,t){return o.normalize(e,l),o.normalize(t,u),n.acosClamped(o.dot(l,u))};var c=new o;return o.mostOrthogonalAxis=function(e,t){var i=o.normalize(e,c);return o.abs(i,i),t=i.x<=i.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,i){return e===i||t(e)&&t(i)&&e.x===i.x&&e.y===i.y},o.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]},o.equalsEpsilon=function(e,i,r,o){return e===i||t(e)&&t(i)&&n.equalsEpsilon(e.x,i.x,r,o)&&n.equalsEpsilon(e.y,i.y,r,o)},o.ZERO=r(new o(0,0)),o.UNIT_X=r(new o(1,0)),o.UNIT_Y=r(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,i){return o.equalsEpsilon(this,e,t,i)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),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","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,i,r,n){this.west=t(e,0),this.south=t(i,0),this.east=t(r,0),this.north=t(n,0)}r(l.prototype,{width:{get:function(){return l.computeWidth(this)}},height:{get:function(){return l.computeHeight(this)}}}),l.packedLength=4,l.pack=function(e,i,r){r=t(r,0),i[r++]=e.west,i[r++]=e.south,i[r++]=e.east,i[r]=e.north},l.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new l),n.west=e[r++],n.south=e[r++],n.east=e[r++],n.north=e[r],n},l.computeWidth=function(e){var t=e.east,i=e.west;return i>t&&(t+=s.TWO_PI),t-i},l.computeHeight=function(e){return e.north-e.south},l.fromDegrees=function(e,r,n,o,a){return e=s.toRadians(t(e,0)),r=s.toRadians(t(r,0)),n=s.toRadians(t(n,0)),o=s.toRadians(t(o,0)),i(a)?(a.west=e,a.south=r,a.east=n,a.north=o,a):new l(e,r,n,o)},l.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,h=0,d=e.length;d>h;h++){var p=e[h];r=Math.min(r,p.longitude),n=Math.max(n,p.longitude),u=Math.min(u,p.latitude),c=Math.max(c,p.latitude);var m=p.longitude>=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.clone=function(e,t){return i(e)?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):void 0},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;o>n&&(n+=s.TWO_PI);var a=s.negativePiToPi(.5*(o+n)),l=.5*(t.south+t.north);return i(r)?(r.longitude=a,r.latitude=l,r.height=0,r):new e(a,l)},l.intersection=function(e,t,r){var n=e.east,o=e.west,a=t.east,u=t.west;o>n&&a>0?n+=s.TWO_PI:u>a&&n>0&&(a+=s.TWO_PI),o>n&&0>u?u+=s.TWO_PI:u>a&&0>o&&(o+=s.TWO_PI);var c=s.negativePiToPi(Math.max(o,u)),h=s.negativePiToPi(Math.min(n,a));if(!((e.west=h)){var d=Math.max(e.south,t.south),p=Math.min(e.north,t.north);if(!(d>=p))return i(r)?(r.west=c,r.south=d,r.east=h,r.north=p,r):new l(c,d,h,p)}},l.union=function(e,t,r){return i(r)||(r=new l),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.east),r.north=Math.max(e.north,t.north),r},l.expand=function(e,t,r){return i(r)||(r=new l),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},l.contains=function(e,t){var i=t.longitude,r=t.latitude,n=e.west,o=e.east;return n>o&&(o+=s.TWO_PI,0>i&&(i+=s.TWO_PI)),(i>n||s.equalsEpsilon(i,n,s.EPSILON14))&&(o>i||s.equalsEpsilon(i,o,s.EPSILON14))&&r>=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++,0>h?f.latitude=h:d>0?f.latitude=d:f.latitude=0;for(var v=1;8>v;++v)f.longitude=-Math.PI+v*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;h>d;d++){var p=t[d],m=p.x,f=p.y,v=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(v,s),c=Math.max(v,c)}var g=r.minimum;g.x=n,g.y=a,g.z=s;var _=r.maximum;_.x=l,_.y=u,_.z=c;var y=e.add(g,_,r.center);return e.multiplyByScalar(y,.5,y),r},o.clone=function(t,r){return i(t)?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):void 0},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:0>l+s?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","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(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 s(e){for(var t=0,i=0;9>i;++i){var r=e[i];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,i=0;3>i;++i){var r=e[a.getElementIndex(p[i],d[i])];t+=2*r*r}return Math.sqrt(t)}function u(e,t){for(var i=o.EPSILON15,r=0,n=1,s=0;3>s;++s){var l=Math.abs(e[a.getElementIndex(p[s],d[s])]);l>r&&(n=s,r=l)}var u=1,c=0,h=d[n],m=p[n];if(Math.abs(e[a.getElementIndex(m,h)])>i){var f,v=e[a.getElementIndex(m,m)],g=e[a.getElementIndex(h,h)],_=e[a.getElementIndex(m,h)],y=(v-g)/2/_;f=0>y?-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=a.clone(a.IDENTITY,t),t[a.getElementIndex(h,h)]=t[a.getElementIndex(m,m)]=u,t[a.getElementIndex(m,h)]=c,t[a.getElementIndex(h,m)]=-c,t}a.packedLength=9,a.pack=function(e,i,r){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]},a.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new a),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},a.clone=function(e,t){return i(e)?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 a(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},a.fromArray=function(e,r,n){return r=t(r,0),i(n)||(n=new a),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},a.fromColumnMajorArray=function(e,t){return a.clone(e,t)},a.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 a(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},a.fromQuaternion=function(e,t){var r=e.x*e.x,n=e.x*e.y,o=e.x*e.z,s=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),v=2*(o+c),g=2*(n+d),_=-r+l-h+p,y=2*(u-s),C=2*(o-c),E=2*(u+s),S=-r-l+h+p;return i(t)?(t[0]=m,t[1]=g,t[2]=C,t[3]=f,t[4]=_,t[5]=E,t[6]=v,t[7]=y,t[8]=S,t):new a(m,f,v,g,_,y,C,E,S)},a.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 a(e.x,0,0,0,e.y,0,0,0,e.z)},a.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 a(e,0,0,0,e,0,0,0,e)},a.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 a(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},a.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 a(1,0,0,0,r,-n,0,n,r)},a.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 a(r,0,n,0,1,0,-n,0,r)},a.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 a(r,-n,0,n,r,0,0,0,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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},a.getElementIndex=function(e,t){return 3*e+t},a.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},a.setColumn=function(e,t,i,r){r=a.clone(e,r);var n=3*t;return r[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r},a.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},a.setRow=function(e,t,i,r){return r=a.clone(e,r),r[t]=i.x,r[t+3]=i.y,r[t+6]=i.z,r};var c=new e;a.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],t[2],c)),i.y=e.magnitude(e.fromElements(t[3],t[4],t[5],c)),i.z=e.magnitude(e.fromElements(t[6],t[7],t[8],c)),i};var h=new e;a.getMaximumScale=function(t){return a.getScale(t,h),e.maximumComponent(h)},a.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},a.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},a.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},a.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},a.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},a.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},a.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},a.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 d=[1,0,0],p=[2,2,1],m=new a,f=new a;return a.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,n=10,c=0,h=0;i(t)||(t={});for(var d=t.unitary=a.clone(a.IDENTITY,t.unitary),p=t.diagonal=a.clone(e,t.diagonal),v=r*s(p);n>h&&l(p)>v;)u(p,m),a.transpose(m,f),a.multiply(p,m,p),a.multiply(f,p,p),a.multiply(d,m,d),++c>2&&(++h,c=0);return t},a.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},a.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)},a.inverse=function(e,t){var i=e[0],n=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],d=e[7],p=e[8],m=a.determinant(e);if(Math.abs(m)<=o.EPSILON15)throw new r("matrix is not invertible");t[0]=u*p-d*c,t[1]=d*s-n*p,t[2]=n*c-u*s,t[3]=h*c-l*p,t[4]=i*p-h*s,t[5]=l*s-i*c,t[6]=l*d-h*u,t[7]=h*n-i*d,t[8]=i*u-l*n;var f=1/m;return a.multiplyByScalar(t,f,t)},a.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]},a.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},a.IDENTITY=n(new a(1,0,0,0,1,0,0,0,1)),a.ZERO=n(new a(0,0,0,0,0,0,0,0,0)),a.COLUMN0ROW0=0,a.COLUMN0ROW1=1,a.COLUMN0ROW2=2,a.COLUMN1ROW0=3,a.COLUMN1ROW1=4,a.COLUMN1ROW2=5,a.COLUMN2ROW0=6,a.COLUMN2ROW1=7,a.COLUMN2ROW2=8,a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.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]},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},a}),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){return t(e)?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):void 0},o.packedLength=4,o.pack=function(t,i,r){r=e(r,0),i[r++]=t.x,i[r++]=t.y,i[r++]=t.z,i[r]=t.w},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.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,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},o.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},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,t){return o.subtract(e,t,a),o.magnitude(a)},o.distanceSquared=function(e,t){return o.subtract(e,t,a),o.magnitudeSquared(a)},o.normalize=function(e,t){var i=o.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t.w=e.w/i,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,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},o.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},o.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},o.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},o.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},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,i,r){return o.multiplyByScalar(t,i,s),r=o.multiplyByScalar(e,1-i,r),o.add(s,r,r)};var l=new o;return o.mostOrthogonalAxis=function(e,t){var i=o.normalize(e,l);return o.abs(i,i),t=i.x<=i.y?i.x<=i.z?i.x<=i.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):i.z<=i.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):i.y<=i.z?i.y<=i.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):i.z<=i.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,i){return e===i||t(e)&&t(i)&&e.x===i.x&&e.y===i.y&&e.z===i.z&&e.w===i.w},o.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]},o.equalsEpsilon=function(e,i,r,o){return e===i||t(e)&&t(i)&&n.equalsEpsilon(e.x,i.x,r,o)&&n.equalsEpsilon(e.y,i.y,r,o)&&n.equalsEpsilon(e.z,i.z,r,o)&&n.equalsEpsilon(e.w,i.w,r,o)},o.ZERO=r(new o(0,0,0,0)),o.UNIT_X=r(new o(1,0,0,0)),o.UNIT_Y=r(new o(0,1,0,0)),o.UNIT_Z=r(new o(0,0,1,0)),o.UNIT_W=r(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,i){return o.equalsEpsilon(this,e,t,i)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),i("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(i){t=i.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),i("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,r,n,o,a,s,l,u,c,h,d,p,m,f,v){this[0]=i(e,0),this[1]=i(o,0),this[2]=i(u,0),this[3]=i(p,0),this[4]=i(t,0),this[5]=i(a,0),this[6]=i(c,0),this[7]=i(m,0),this[8]=i(r,0),this[9]=i(s,0),this[10]=i(h,0),this[11]=i(f,0),this[12]=i(n,0),this[13]=i(l,0),this[14]=i(d,0),this[15]=i(v,0)}u.packedLength=16,u.pack=function(e,t,r){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[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]},u.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new u),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},u.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new u(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]):void 0},u.fromArray=u.unpack,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[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 u(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])},u.fromRotationTranslation=function(t,n,o){return n=i(n,e.ZERO),r(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]=n.x,o[13]=n.y,o[14]=n.z,o[15]=1,o):new u(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)},u.fromTranslationQuaternionRotationScale=function(e,t,i,n){r(n)||(n=new u);var o=i.x,a=i.y,s=i.z,l=t.x*t.x,c=t.x*t.y,h=t.x*t.z,d=t.x*t.w,p=t.y*t.y,m=t.y*t.z,f=t.y*t.w,v=t.z*t.z,g=t.z*t.w,_=t.w*t.w,y=l-p-v+_,C=2*(c-g),E=2*(h+f),S=2*(c+g),w=-l+p-v+_,T=2*(m-d),x=2*(h-f),b=2*(m+d),A=-l-p+v+_;return n[0]=y*o,n[1]=S*o,n[2]=x*o,n[3]=0,n[4]=C*a,n[5]=w*a,n[6]=b*a,n[7]=0,n[8]=E*s,n[9]=T*s,n[10]=A*s,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},u.fromTranslationRotationScale=function(e,t){return u.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},u.fromTranslation=function(e,t){return u.fromRotationTranslation(s.IDENTITY,e,t)},u.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 u(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},u.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 u(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var c=new e,h=new e,d=new e;u.fromCamera=function(t,i){var n=t.eye,o=t.target,a=t.up;e.normalize(e.subtract(o,n,c),c),e.normalize(e.cross(c,a,h),h),e.normalize(e.cross(h,c,d),d);var s=h.x,l=h.y,p=h.z,m=c.x,f=c.y,v=c.z,g=d.x,_=d.y,y=d.z,C=n.x,E=n.y,S=n.z,w=s*-C+l*-E+p*-S,T=g*-C+_*-E+y*-S,x=m*C+f*E+v*S;return r(i)?(i[0]=s,i[1]=g,i[2]=-m,i[3]=0,i[4]=l,i[5]=_,i[6]=-f,i[7]=0,i[8]=p,i[9]=y,i[10]=-v,i[11]=0,i[12]=w,i[13]=T,i[14]=x,i[15]=1,i):new u(s,l,p,w,g,_,y,T,-m,-f,-v,x,0,0,0,1)},u.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},u.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},u.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},u.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},u.computeViewportTransformation=function(e,t,r,n){e=i(e,i.EMPTY_OBJECT);var o=i(e.x,0),a=i(e.y,0),s=i(e.width,0),l=i(e.height,0);t=i(t,0),r=i(r,1);var u=.5*s,c=.5*l,h=.5*(r-t),d=u,p=c,m=h,f=o+u,v=a+c,g=t+h,_=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]=v,n[14]=g,n[15]=_,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[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]]},u.getElementIndex=function(e,t){return 4*e+t},u.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},u.setColumn=function(e,t,i,r){r=u.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},u.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},u.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},u.setRow=function(e,t,i,r){return r=u.clone(e,r),r[t]=i.x,r[t+4]=i.y,r[t+8]=i.z,r[t+12]=i.w,r};var p=new e;u.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],t[2],p)),i.y=e.magnitude(e.fromElements(t[4],t[5],t[6],p)),i.z=e.magnitude(e.fromElements(t[8],t[9],t[10],p)),i};var m=new e;u.getMaximumScale=function(t){return u.getScale(t,m),e.maximumComponent(m)},u.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],v=e[13],g=e[14],_=e[15],y=t[0],C=t[1],E=t[2],S=t[3],w=t[4],T=t[5],x=t[6],b=t[7],A=t[8],P=t[9],I=t[10],M=t[11],D=t[12],R=t[13],O=t[14],N=t[15],L=r*y+s*C+h*E+f*S,F=n*y+l*C+d*E+v*S,B=o*y+u*C+p*E+g*S,V=a*y+c*C+m*E+_*S,k=r*w+s*T+h*x+f*b,z=n*w+l*T+d*x+v*b,U=o*w+u*T+p*x+g*b,G=a*w+c*T+m*x+_*b,W=r*A+s*P+h*I+f*M,H=n*A+l*P+d*I+v*M,q=o*A+u*P+p*I+g*M,j=a*A+c*P+m*I+_*M,Y=r*D+s*R+h*O+f*N,X=n*D+l*R+d*O+v*N,Z=o*D+u*R+p*O+g*N,K=a*D+c*R+m*O+_*N;return i[0]=L,i[1]=F,i[2]=B,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},u.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},u.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},u.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],v=t[1],g=t[2],_=t[4],y=t[5],C=t[6],E=t[8],S=t[9],w=t[10],T=t[12],x=t[13],b=t[14],A=r*f+a*v+u*g,P=n*f+s*v+c*g,I=o*f+l*v+h*g,M=r*_+a*y+u*C,D=n*_+s*y+c*C,R=o*_+l*y+h*C,O=r*E+a*S+u*w,N=n*E+s*S+c*w,L=o*E+l*S+h*w,F=r*T+a*x+u*b+d,B=n*T+s*x+c*b+p,V=o*T+l*x+h*b+m;return i[0]=A,i[1]=P,i[2]=I,i[3]=0,i[4]=M,i[5]=D,i[6]=R,i[7]=0,i[8]=O,i[9]=N,i[10]=L,i[11]=0,i[12]=F,i[13]=B,i[14]=V,i[15]=1,i},u.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],v=t[4],g=t[5],_=t[6],y=t[7],C=t[8],E=r*d+a*p+u*m,S=n*d+s*p+c*m,w=o*d+l*p+h*m,T=r*f+a*v+u*g,x=n*f+s*v+c*g,b=o*f+l*v+h*g,A=r*_+a*y+u*C,P=n*_+s*y+c*C,I=o*_+l*y+h*C;return i[0]=E,i[1]=S,i[2]=w,i[3]=0,i[4]=T,i[5]=x,i[6]=b,i[7]=0,i[8]=A,i[9]=P,i[10]=I,i[11]=0,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},u.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 f=new e;u.multiplyByUniformScale=function(e,t,i){return f.x=t,f.y=t,f.z=t,u.multiplyByScale(e,f,i)},u.multiplyByScale=function(e,t,i){var r=t.x,n=t.y,o=t.z;return 1===r&&1===n&&1===o?u.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)},u.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},u.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},u.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},u.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},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[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},u.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},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[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},u.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]},u.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&&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},u.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},u.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 s,g=new s,_=new t,y=new t(0,0,0,1);return u.inverse=function(e,i){if(s.equalsEpsilon(u.getRotation(e,v),g,a.EPSILON7)&&t.equals(u.getRow(e,3,_),y))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],c=e[12],h=e[1],d=e[5],p=e[9],m=e[13],f=e[2],C=e[6],E=e[10],S=e[14],w=e[3],T=e[7],x=e[11],b=e[15],A=E*b,P=S*x,I=C*b,M=S*T,D=C*x,R=E*T,O=f*b,N=S*w,L=f*x,F=E*w,B=f*T,V=C*w,k=A*d+M*p+D*m-(P*d+I*p+R*m),z=P*h+O*p+F*m-(A*h+N*p+L*m),U=I*h+N*d+B*m-(M*h+O*d+V*m),G=R*h+L*d+V*p-(D*h+F*d+B*p),W=P*n+I*o+R*c-(A*n+M*o+D*c),H=A*r+N*o+L*c-(P*r+O*o+F*c),q=M*r+O*n+V*c-(I*r+N*n+B*c),j=D*r+F*n+B*o-(R*r+L*n+V*o);A=o*m,P=c*p,I=n*m,M=c*d,D=n*p,R=o*d,O=r*m,N=c*h,L=r*p,F=o*h,B=r*d,V=n*h;var Y=A*T+M*x+D*b-(P*T+I*x+R*b),X=P*w+O*x+F*b-(A*w+N*x+L*b),Z=I*w+N*T+B*b-(M*w+O*T+V*b),K=R*w+L*T+V*x-(D*w+F*T+B*x),Q=I*E+R*S+P*C-(D*S+A*C+M*E),J=L*S+A*f+N*E-(O*E+F*S+P*f),$=O*C+V*S+M*f-(B*S+I*f+N*C),ee=B*E+D*f+F*C-(L*C+V*E+R*f),te=r*k+n*z+o*U+c*G;if(Math.abs(te)d;d++){e.clone(t[d],n);var b=n.x,A=n.y,P=n.z;bl.x&&e.clone(n,l),Au.y&&e.clone(n,u),Pc.z&&e.clone(n,c)}var I=e.magnitudeSquared(e.subtract(l,o,E)),M=e.magnitudeSquared(e.subtract(u,a,E)),D=e.magnitudeSquared(e.subtract(c,s,E)),R=o,O=l,N=I;M>N&&(N=M,R=a,O=u),D>N&&(N=D,R=s,O=c);var L=S;L.x=.5*(R.x+O.x),L.y=.5*(R.y+O.y),L.z=.5*(R.z+O.z);var F=e.magnitudeSquared(e.subtract(O,L,E)),B=Math.sqrt(F),V=w;V.x=o.x,V.y=a.y,V.z=s.z;var k=T;k.x=l.x,k.y=u.y,k.z=c.z;var z=e.multiplyByScalar(e.add(V,k,E),.5,x),U=0;for(d=0;h>d;d++){e.clone(t[d],n);var G=e.magnitude(e.subtract(n,z,E));G>U&&(U=G);var W=e.magnitudeSquared(e.subtract(n,L,E));if(W>F){var H=Math.sqrt(W);B=.5*(B+H),F=B*B;var q=H-B;L.x=(B*L.x+q*n.x)/H,L.y=(B*L.y+q*n.y)/H,L.z=(B*L.z+q*n.z)/H}}return U>B?(e.clone(L,i.center), +i.radius=B):(e.clone(z,i.center),i.radius=U),i};var b=new a,A=new e,P=new e,I=new t,M=new t;p.fromRectangle2D=function(e,t,i){return p.fromRectangleWithHeights2D(e,t,0,0,i)},p.fromRectangleWithHeights2D=function(t,n,o,a,s){if(r(s)||(s=new p),!r(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;n=i(n,b),d.southwest(t,I),I.height=o,d.northeast(t,M),M.height=a;var l=n.project(I,A),u=n.project(M,P),c=u.x-l.x,h=u.y-l.y,m=u.z-l.z;s.radius=.5*Math.sqrt(c*c+h*h+m*m);var f=s.center;return f.x=l.x+.5*c,f.y=l.y+.5*h,f.z=l.z+.5*m,s};var D=[];p.fromRectangle3D=function(e,t,n,a){t=i(t,o.WGS84),n=i(n,0);var s;return r(e)&&(s=d.subsample(e,t,n,D)),p.fromPoints(s,a)},p.fromVertices=function(t,n,o,a){if(r(a)||(a=new p),!r(t)||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;n=i(n,e.ZERO),o=i(o,3);var s=C;s.x=t[0]+n.x,s.y=t[1]+n.y,s.z=t[2]+n.z;for(var l=e.clone(s,m),u=e.clone(s,f),c=e.clone(s,v),h=e.clone(s,g),d=e.clone(s,_),b=e.clone(s,y),A=t.length,P=0;A>P;P+=o){var I=t[P]+n.x,M=t[P+1]+n.y,D=t[P+2]+n.z;s.x=I,s.y=M,s.z=D,Ih.x&&e.clone(s,h),Md.y&&e.clone(s,d),Db.z&&e.clone(s,b)}var R=e.magnitudeSquared(e.subtract(h,l,E)),O=e.magnitudeSquared(e.subtract(d,u,E)),N=e.magnitudeSquared(e.subtract(b,c,E)),L=l,F=h,B=R;O>B&&(B=O,L=u,F=d),N>B&&(B=N,L=c,F=b);var V=S;V.x=.5*(L.x+F.x),V.y=.5*(L.y+F.y),V.z=.5*(L.z+F.z);var k=e.magnitudeSquared(e.subtract(F,V,E)),z=Math.sqrt(k),U=w;U.x=l.x,U.y=u.y,U.z=c.z;var G=T;G.x=h.x,G.y=d.y,G.z=b.z;var W=e.multiplyByScalar(e.add(U,G,E),.5,x),H=0;for(P=0;A>P;P+=o){s.x=t[P]+n.x,s.y=t[P+1]+n.y,s.z=t[P+2]+n.z;var q=e.magnitude(e.subtract(s,W,E));q>H&&(H=q);var j=e.magnitudeSquared(e.subtract(s,V,E));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 H>z?(e.clone(V,a.center),a.radius=z):(e.clone(W,a.center),a.radius=H),a},p.fromEncodedCartesianVertices=function(t,i,n){if(r(n)||(n=new p),!r(t)||!r(i)||t.length!==i.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var o=C;o.x=t[0]+i[0],o.y=t[1]+i[1],o.z=t[2]+i[2];for(var a=e.clone(o,m),s=e.clone(o,f),l=e.clone(o,v),u=e.clone(o,g),c=e.clone(o,_),h=e.clone(o,y),d=t.length,b=0;d>b;b+=3){var A=t[b]+i[b],P=t[b+1]+i[b+1],I=t[b+2]+i[b+2];o.x=A,o.y=P,o.z=I,Au.x&&e.clone(o,u),Pc.y&&e.clone(o,c),Ih.z&&e.clone(o,h)}var M=e.magnitudeSquared(e.subtract(u,a,E)),D=e.magnitudeSquared(e.subtract(c,s,E)),R=e.magnitudeSquared(e.subtract(h,l,E)),O=a,N=u,L=M;D>L&&(L=D,O=s,N=c),R>L&&(L=R,O=l,N=h);var F=S;F.x=.5*(O.x+N.x),F.y=.5*(O.y+N.y),F.z=.5*(O.z+N.z);var B=e.magnitudeSquared(e.subtract(N,F,E)),V=Math.sqrt(B),k=w;k.x=a.x,k.y=s.y,k.z=l.z;var z=T;z.x=u.x,z.y=c.y,z.z=h.z;var U=e.multiplyByScalar(e.add(k,z,E),.5,x),G=0;for(b=0;d>b;b+=3){o.x=t[b]+i[b],o.y=t[b+1]+i[b+1],o.z=t[b+2]+i[b+2];var W=e.magnitude(e.subtract(o,U,E));W>G&&(G=W);var H=e.magnitudeSquared(e.subtract(o,F,E));if(H>B){var q=Math.sqrt(H);V=.5*(V+q),B=V*V;var j=q-V;F.x=(V*F.x+j*o.x)/q,F.y=(V*F.y+j*o.y)/q,F.z=(V*F.z+j*o.z)/q}}return G>V?(e.clone(F,n.center),n.radius=V):(e.clone(U,n.center),n.radius=G),n},p.fromCornerPoints=function(t,i,n){r(n)||(n=new p);var o=n.center;return e.add(t,i,o),e.multiplyByScalar(o,.5,o),n.radius=e.distance(o,i),n},p.fromEllipsoid=function(t,i){return r(i)||(i=new p),e.clone(e.ZERO,i.center),i.radius=t.maximumRadius,i};var R=new e;p.fromBoundingSpheres=function(t,i){if(r(i)||(i=new p),!r(t)||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var n=t.length;if(1===n)return p.clone(t[0],i);if(2===n)return p.union(t[0],t[1],i);for(var o=[],a=0;n>a;a++)o.push(t[a].center);i=p.fromPoints(o,i);var s=i.center,l=i.radius;for(a=0;n>a;a++){var u=t[a];l=Math.max(l,e.distance(s,u.center,R)+u.radius)}return i.radius=l,i};var O=new e,N=new e,L=new e;p.fromOrientedBoundingBox=function(t,i){r(i)||(i=new p);var n=t.halfAxes,o=u.getColumn(n,0,O),a=u.getColumn(n,1,N),s=u.getColumn(n,2,L),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},p.clone=function(t,i){return r(t)?r(i)?(i.center=e.clone(t.center,i.center),i.radius=t.radius,i):new p(t.center,t.radius):void 0},p.packedLength=4,p.pack=function(e,t,r){r=i(r,0);var n=e.center;t[r++]=n.x,t[r++]=n.y,t[r++]=n.z,t[r]=e.radius},p.unpack=function(e,t,n){t=i(t,0),r(n)||(n=new p);var o=n.center;return o.x=e[t++],o.y=e[t++],o.z=e[t++],n.radius=e[t],n};var F=new e,B=new e;p.union=function(t,i,n){r(n)||(n=new p);var o=t.center,a=t.radius,s=i.center,l=i.radius,u=e.subtract(s,o,F),c=e.magnitude(u);if(a>=c+l)return t.clone(n),n;if(l>=c+a)return i.clone(n),n;var h=.5*(a+c+l),d=e.multiplyByScalar(u,(-a+h)/c,B);return e.add(d,o,d),e.clone(d,n.center),n.radius=h,n};var V=new e;p.expand=function(t,i,r){r=p.clone(t,r);var n=e.magnitude(e.subtract(i,r.center,V));return n>r.radius&&(r.radius=n),r},p.intersectPlane=function(t,i){var r=t.center,n=t.radius,o=i.normal,a=e.dot(o,r)+i.distance;return-n>a?s.OUTSIDE:n>a?s.INTERSECTING:s.INSIDE},p.transform=function(e,t,i){return r(i)||(i=new p),i.center=c.multiplyByPoint(t,e.center,i.center),i.radius=c.getMaximumScale(t)*e.radius,i};var k=new e;p.distanceSquaredTo=function(t,i){var r=e.subtract(t.center,i,k);return e.magnitudeSquared(r)-t.radius*t.radius},p.transformWithoutScale=function(e,t,i){return r(i)||(i=new p),i.center=c.multiplyByPoint(t,e.center,i.center),i.radius=e.radius,i};var z=new e;p.computePlaneDistances=function(t,i,n,o){r(o)||(o=new l);var a=e.subtract(t.center,i,z),s=e.dot(n,a);return o.start=s-t.radius,o.stop=s+t.radius,o};for(var U=new e,G=new e,W=new e,H=new e,q=new e,j=new t,Y=new Array(8),X=0;8>X;++X)Y[X]=new e;var Z=new a;return p.projectTo2D=function(t,r,n){r=i(r,Z);var o=r.ellipsoid,a=t.center,s=t.radius,l=o.geodeticSurfaceNormal(a,U),u=e.cross(e.UNIT_Z,l,G);e.normalize(u,u);var c=e.cross(l,u,W);e.normalize(c,c),e.multiplyByScalar(l,s,l),e.multiplyByScalar(c,s,c),e.multiplyByScalar(u,s,u);var h=e.negate(c,q),d=e.negate(u,H),m=Y,f=m[0];e.add(l,c,f),e.add(f,u,f),f=m[1],e.add(l,c,f),e.add(f,d,f),f=m[2],e.add(l,h,f),e.add(f,d,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,d,f),f=m[6],e.add(l,h,f),e.add(f,d,f),f=m[7],e.add(l,h,f),e.add(f,u,f);for(var v=m.length,g=0;v>g;++g){var _=m[g];e.add(a,_,_);var y=o.cartesianToCartographic(_,j);r.project(y,_)}n=p.fromPoints(m,n),a=n.center;var C=a.x,E=a.y,S=a.z;return a.x=S,a.y=C,a.z=E,n},p.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},p.equals=function(t,i){return t===i||r(t)&&r(i)&&e.equals(t.center,i.center)&&t.radius===i.radius},p.prototype.intersectPlane=function(e){return p.intersectPlane(this,e)},p.prototype.distanceSquaredTo=function(e){return p.distanceSquaredTo(this,e)},p.prototype.computePlaneDistances=function(e,t,i){return p.computePlaneDistances(this,e,t,i)},p.prototype.isOccluded=function(e){return p.isOccluded(this,e)},p.prototype.equals=function(e){return p.equals(this,e)},p.prototype.clone=function(e){return p.clone(this,e)},p}),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){return 0>=i||i===1/0||i!==i?void 0:t.multiplyByScalar(e,i,r)}function c(e,i){return e.transformPositionToScaledSpace(i,v),t.normalize(v,v)}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=0>r?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;d>h;++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,v=n.length;v>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)},s.prototype.computeHorizonCullingPointFromPoints=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;d>h;++h){var p=l(o,i[h],a);s=Math.max(s,p)}return u(a,s,n)};var p=[];s.prototype.computeHorizonCullingPointFromRectangle=function(i,r,n){var o=a.subsample(i,r,0,p),s=e.fromPoints(o);return t.magnitude(s.center)<.1*r.minimumRadius?void 0:this.computeHorizonCullingPoint(s.center,o,n)};var m=new t,f=new t,v=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)))a&&a/ss&&s/ao)return[];var l=Math.sqrt(o);return[-l,l]}if(0===n)return o=-r/e,0>o?[o,0]:[0,o];var u=r*r,c=4*e*n,h=i(u,-c,t.EPSILON14);if(0>h)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,v=s*u-p,g=4*m*v-f*f;if(0>g){var _,y,C;d*h>=c*p?(_=a,y=m,C=-2*s*m+a*f):(_=u,y=v,C=-u*f+2*l*v);var E=0>C?-1:1,S=-E*Math.abs(_)*Math.sqrt(-g);o=-C+S;var w=o/2,T=0>w?-Math.pow(-w,1/3):Math.pow(w,1/3),x=o===S?-T:-y/T;return n=0>=y?T+x:-C/(T*T+x*x+y),d*h>=c*p?[(n-s)/a]:[-u/(n+l)]}var b=m,A=-2*s*m+a*f,P=v,I=-u*f+2*l*v,M=Math.sqrt(g),D=Math.sqrt(3)/2,R=Math.abs(Math.atan2(a*M,-A)/3);n=2*Math.sqrt(-b);var O=Math.cos(R);o=n*O;var N=n*(-O/2-D*Math.sin(R)),L=o+N>2*s?o-s:N-s,F=a,B=L/F;R=Math.abs(Math.atan2(u*M,-I)/3),n=2*Math.sqrt(-P),O=Math.cos(R),o=n*O,N=n*(-O/2-D*Math.sin(R));var V=-u,k=2*l>o+N?o+l:N+l,z=V/k,U=F*k,G=-L*k-F*V,W=L*V,H=(l*G-s*W)/(-s*G+l*U);return H>=B?z>=B?z>=H?[B,H,z]:[B,z,H]:[z,B,H]:z>=B?[H,B,z]:z>=H?[H,z,B]:[z,H,B]}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=0>s?-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,0>s?[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 _=Math.sqrt(v),y=Math.sqrt(g);return[d-y,d-_,d+_,d+y]}if(v>=0&&0>g)return f=Math.sqrt(v),[d-f,d+f];if(0>v&&g>=0)return f=Math.sqrt(g),[d-f,d+f]}return[]}if(p>0){var C=Math.sqrt(p),E=(l+p-u/C)/2,S=(l+p+u/C)/2,w=r.computeRealRoots(1,C,E),T=r.computeRealRoots(1,-C,S);return 0!==w.length?(w[0]+=d,w[1]+=d,0!==T.length?(T[0]+=d,T[1]+=d,w[1]<=T[0]?[w[0],w[1],T[0],T[1]]:T[1]<=w[0]?[T[0],T[1],w[0],w[1]]:w[0]>=T[0]&&w[1]<=T[1]?[T[0],w[0],w[1],T[1]]:T[0]>=w[0]&&T[1]<=w[1]?[w[0],T[0],T[1],w[1]]:w[0]>T[0]&&w[0]0){var m,f,v=p[0],g=n-v,_=g*g,y=t/2,C=g/2,E=_-4*a,S=_+4*Math.abs(a),w=u-4*v,T=u+4*Math.abs(v);if(0>v||w*S>E*T){var x=Math.sqrt(w);m=x/2,f=0===x?0:(t*C-o)/x}else{var b=Math.sqrt(E);m=0===b?0:(t*C-o)/b,f=b/2}var A,P;0===y&&0===m?(A=0,P=0):i.sign(y)===i.sign(m)?(A=y+m,P=v/A):(P=y-m,A=v/P);var I,M;0===C&&0===f?(I=0,M=0):i.sign(C)===i.sign(f)?(I=C+f,M=a/I):(M=C-f,I=a/M);var D=r.computeRealRoots(1,A,I),R=r.computeRealRoots(1,P,M);if(0!==D.length)return 0!==R.length?D[1]<=R[0]?[D[0],D[1],R[0],R[1]]:R[1]<=D[0]?[R[0],R[1],D[0],D[1]]:D[0]>=R[0]&&D[1]<=R[1]?[R[0],D[0],D[1],R[1]]:R[0]>=D[0]&&R[1]<=D[1]?[D[0],R[0],R[1],D[1]]:D[0]>R[0]&&D[0]u?1:0;switch(p+=0>c?p+1:p,p+=0>h?p+1:p,p+=0>d?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","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,r,n,a,s){s=i(s,!1);var l,u,c,h,d,p=t.origin,m=t.direction,f=e.subtract(n,r,v),E=e.subtract(a,r,g),S=e.cross(m,E,_),w=e.dot(f,S);if(s){if(wc||c>w)return;if(u=e.cross(l,f,C),h=e.dot(m,u),0>h||c+h>w)return;d=e.dot(E,u)/w}else{if(Math.abs(w)c||c>1)return;if(u=e.cross(l,f,C),h=e.dot(m,u)*T,0>h||c+h>1)return;d=e.dot(E,u)*T}return d}function h(e,t,i,r){var n=t*t-4*e*i;if(!(0>n)){if(n>0){var o=1/(2*e),a=Math.sqrt(n),s=(-t+a)*o,l=(-t-a)*o;return l>s?(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={});var o=t.origin,a=t.direction,s=i.center,l=i.radius*i.radius,u=e.subtract(o,s,_),c=e.dot(a,a),d=2*e.dot(a,u),p=e.magnitudeSquared(u)-l,m=h(c,d,p,S);return r(m)?(n.start=m.root0,n.stop=m.root1,n):void 0}function p(e,t,i){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))N;++N){var L,F=c[N],B=F*F,V=Math.max(1-B,0),k=Math.sqrt(V);L=o.sign(m)===o.sign(v)?p(m*B+v,f*F,o.EPSILON12):o.sign(v)===o.sign(f*F)?p(m*B,f*F+v,o.EPSILON12):p(m*B+f*F,v,o.EPSILON12);var z=p(g*F,_,o.EPSILON15),U=L*z;0>U?y.push(new e(n,u*F,u*k)):U>0?y.push(new e(n,u*F,u*-k)):0!==k?(y.push(new e(n,u*F,u*-k)),y.push(new e(n,u*F,u*k)),++N):y.push(new e(n,u*F,u*k))}return y}var f={};f.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)c))return n=e.multiplyByScalar(s,c,n),e.add(a,n,n)}};var v=new e,g=new e,_=new e,y=new e,C=new e;f.rayTriangle=function(t,i,n,o,a,s){var l=c(t,i,n,o,a);if(r(l)&&!(0>l))return r(s)||(s=new e),e.multiplyByScalar(t.direction,l,s),e.add(t.origin,s,s)};var E=new u;f.lineSegmentTriangle=function(t,i,n,o,a,s,l){var u=E;e.clone(t,u.origin),e.subtract(i,t,u.direction),e.normalize(u.direction,u.direction);var h=c(u,n,o,a,s);return!r(h)||0>h||h>e.distance(t,i)?void 0:(r(l)||(l=new e),e.multiplyByScalar(u.direction,h,l),e.add(u.origin,l,l))};var S={root0:0,root1:0};f.raySphere=function(e,t,i){return i=d(e,t,i),!r(i)||i.stop<0?void 0:(i.start=Math.max(i.start,0),i)};var w=new u;f.lineSegmentSphere=function(t,i,n,o){var a=w,s=e.subtract(i,t,a.direction),l=e.magnitude(s);return e.normalize(s,s),o=d(a,n,o),!r(o)||o.stop<0||o.start>l?void 0:(o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,l),o)};var T=new e,x=new e;f.rayEllipsoid=function(t,i){var r,n,o,a,s,l=i.oneOverRadii,u=e.multiplyComponents(l,t.origin,T),c=e.multiplyComponents(l,t.direction,x),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,o>p)return;if(p>o){a=d*d-o,s=-d+Math.sqrt(a);var m=s/n,f=r/s;return f>m?{start:m,stop:f}:{start:f,stop:m}}var v=Math.sqrt(r/n);return{start:v,stop:v}}return 1>h?(r=h-1,n=e.magnitudeSquared(c),o=n*r,a=d*d-o,s=-d+Math.sqrt(a),{start:0,stop:s/n}):0>d?(n=e.magnitudeSquared(c),{start:0,stop:-d/n}):void 0};var b=new e,A=new e,P=new e,I=new e,M=new e,D=new a,R=new a,O=new a,N=new a,L=new a,F=new a,B=new a,V=new e,k=new e,z=new t;f.grazingAltitudeLocation=function(t,i){var n=t.origin,s=t.direction,l=i.geodeticSurfaceNormal(n,b);if(e.dot(s,l)>=0)return n;var u=r(this.rayEllipsoid(t,i)),c=i.transformPositionToScaledSpace(s,b),h=e.normalize(c,c),d=e.mostOrthogonalAxis(c,I),p=e.normalize(e.cross(d,h,A),A),f=e.normalize(e.cross(h,p,P),P),v=D;v[0]=h.x,v[1]=h.y,v[2]=h.z,v[3]=p.x,v[4]=p.y,v[5]=p.z,v[6]=f.x,v[7]=f.y,v[8]=f.z;var g=a.transpose(v,R),_=a.fromScale(i.radii,O),y=a.fromScale(i.oneOverRadii,N),C=L;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 E,S,w=a.multiply(a.multiply(g,y,F),C,F),T=a.multiply(a.multiply(w,_,B),v,B),x=a.multiplyByVector(w,n,M),U=m(T,e.negate(x,b),0,0,1),G=U.length;if(G>0){for(var W=e.clone(e.ZERO,k),H=Number.NEGATIVE_INFINITY,q=0;G>q;++q){E=a.multiplyByVector(_,a.multiplyByVector(v,U[q],V),V);var j=e.normalize(e.subtract(E,n,I),I),Y=e.dot(j,s);Y>H&&(H=Y,W=e.clone(E,W))}var X=i.cartesianToCartographic(W,z);return H=o.clamp(H,0,1),S=e.magnitude(e.subtract(W,n,I))*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,a){r(a)||(a=new e);var s=e.subtract(i,t,U),l=n.normal,u=e.dot(l,s);if(!(Math.abs(u)h||h>1))return e.multiplyByScalar(s,h,a),e.add(t,a,a),a}},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/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t,i){for(var r,n,o=0,a=e.length-1;a>=o;)if(r=~~((o+a)/2),n=i(e[r],t),0>n)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,v,g;if("%%"==e)return"%";for(var _=!1,y="",C=!1,E=!1,S=" ",w=l.length,T=0;l&&w>T;T++)switch(l.charAt(T)){case" ":y=" ";break;case"+":y="+";break;case"-":_=!0;break;case"'":S=l.charAt(T+1);break;case"0":C=!0;break;case"#":E=!0}if(u=u?"*"==u?+t[i++]:"*"==u.charAt(0)?+t[u.slice(1,-1)]:+u:0,0>u&&(u=-u,_=!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),_,u,h,C,S);case"c":return s(String.fromCharCode(+g),_,u,h,C);case"b":return a(g,2,E,_,u,h,C);case"o":return a(g,8,E,_,u,h,C);case"x":return a(g,16,E,_,u,h,C);case"X":return a(g,16,E,_,u,h,C).toUpperCase();case"u":return a(g,10,E,_,u,h,C);case"i":case"d":return p=+g||0,p=Math.round(p-p%1),m=0>p?"-":y,g=m+n(String(Math.abs(p)),h,"0",!1),o(g,m,_,u,C);case"e":case"E":case"f":case"F":case"g":case"G":return p=+g,m=0>p?"-":y,f=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],v=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],g=m+Math.abs(p)[f](h),o(g,m,_,u,C)[v]();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);0>r&&(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(0>n&&(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):1>=o?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,0>t&&(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,0>r&&(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 v=new o,g=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,y=new s,C=/^(\d{4})$/,E=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,w=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,T=/^(\d{4})-?(\d{2})-?(\d{2})$/,x=/([Z+\-])?(\d{2})?:?(\d{2})?$/,b=/^(\d{2})(\.\d+)?/.source+x.source,A=/^(\d{2}):?(\d{2})(\.\d+)?/.source+x.source,P=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+x.source,I="Invalid ISO 8601 date.";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,o,s,l=e.split("T"),c=1,d=1,v=0,y=0,x=0,M=0,D=l[0],R=l[1];if(!r(D))throw new n(I);var O;if(l=D.match(T),null!==l){if(O=D.split("-").length-1,O>0&&2!==O)throw new n(I);i=+l[1],c=+l[2],d=+l[3]}else if(l=D.match(E),null!==l)i=+l[1],c=+l[2];else if(l=D.match(C),null!==l)i=+l[1];else{var N;if(l=D.match(S),null!==l){if(i=+l[1],N=+l[2],s=a(i),1>N||s&&N>366||!s&&N>365)throw new n(I)}else{if(l=D.match(w),null===l)throw new n(I);i=+l[1];var L=+l[2],F=+l[3]||0;if(O=D.split("-").length-1,O>0&&(!r(l[3])&&1!==O||r(l[3])&&2!==O))throw new n(I);var B=new Date(Date.UTC(i,0,4));N=7*L+F-B.getUTCDay()-3}o=new Date(Date.UTC(i,0,1)),o.setUTCDate(N),c=o.getUTCMonth()+1,d=o.getUTCDate()}if(s=a(i),1>c||c>12||1>d||(2!==c||!s)&&d>g[c-1]||s&&2===c&&d>_)throw new n(I);var V;if(r(R)){if(l=R.match(P),null!==l){if(O=R.split(":").length-1,O>0&&2!==O&&3!==O)throw new n(I);v=+l[1],y=+l[2],x=+l[3],M=1e3*+(l[4]||0),V=5}else if(l=R.match(A),null!==l){if(O=R.split(":").length-1,O>2)throw new n(I);v=+l[1],y=+l[2],x=60*+(l[3]||0),V=4}else{if(l=R.match(b),null===l)throw new n(I);v=+l[1],y=60*+(l[2]||0),V=3}if(y>=60||x>=61||v>24||24===v&&(y>0||x>0||M>0))throw new n(I);var k=l[V],z=+l[V+1],U=+(l[V+2]||0);switch(k){case"+":v-=z,y-=U;break;case"-":v+=z,y+=U;break;case"Z":break;default:y+=new Date(Date.UTC(i,c-1,d,v,y)).getTimezoneOffset()}}else y+=new Date(i,c-1,d).getTimezoneOffset();var G=60===x;for(G&&x--;y>=60;)y-=60,v++;for(;v>=24;)v-=24,d++;for(o=s&&2===c?_:g[c-1];d>o;)d-=o,c++,c>12&&(c-=12,i++),o=s&&2===c?_:g[c-1];for(;0>y;)y+=60,v--;for(;0>v;)v+=24,d--;for(;1>d;)c--,1>c&&(c+=12,i--),o=s&&2===c?_:g[c-1],d+=o;var W=m(i,c,d,v,y,x,M);return r(t)?(p(W[0],W[1],t),h(t)):t=new f(W[0],W[1],u.UTC),G&&f.addSeconds(t,1,t),t},f.now=function(e){return f.fromDate(new Date,e)};var M=new f(0,0,u.TAI);return f.toGregorianDate=function(e,t){var i=!1,n=d(e,M);r(n)||(f.addSeconds(e,-1,M),n=d(M,M),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 v=p+2-12*u|0,g=100*(c-49)+h+u|0,_=s/l.SECONDS_PER_HOUR|0,y=s-_*l.SECONDS_PER_HOUR,C=y/l.SECONDS_PER_MINUTE|0;y-=C*l.SECONDS_PER_MINUTE;var E=0|y,S=(y-E)/l.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),i&&(E+=1),r(t)?(t.year=g,t.month=v,t.day=m,t.hour=_,t.minute=C,t.second=E,t.millisecond=S,t.isLeapSecond=i,t):new o(g,v,m,_,C,E,S,i)},f.toDate=function(e){var t=f.toGregorianDate(e,v),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){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new f(e.dayNumber,e.secondsOfDay,u.TAI):void 0},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 0>r&&(r=~r,--r,0>r&&(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)], +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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,i,r,n,o){"use strict";function a(i){i=t(i,t.EMPTY_OBJECT);var r=i.responseType,n=t(i.method,"GET"),o=i.data,s=i.headers,l=i.overrideMimeType,u=i.withCredentials;return e(i.url,function(t){var i=e.defer();return a.load(t,r,n,o,s,i,l,u),i.promise})}function s(e,t){var i=decodeURIComponent(t);return e?atob(i):i}function l(e,t){for(var i=s(e,t),r=new ArrayBuffer(i.length),n=new Uint8Array(r),o=0;o=200&&m.status<300?i(m.response)?l.resolve(m.response):i(m.responseXML)&&m.responseXML.hasChildNodes()?l.resolve(m.responseXML):i(m.responseText)?l.resolve(m.responseText):l.reject(new o("unknown XMLHttpRequest response type.")):l.reject(new n(m.status,m.response,m.getAllResponseHeaders()))},m.onerror=function(e){l.reject(new n)},m.send(a)},a.defaultLoad=a.load,a}),i("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";function i(i,r){return e({url:i,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return i}),i("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,i,r){"use strict";function n(i,n){return t(n)||(n={}),t(n.headers)?t(n.headers.Accept)||(n.headers=e(n.headers),n.headers.Accept=o.Accept):n.headers=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(0>n||0>o||0>l||0>u||0>d||0>m||0>f)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var v=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 _,y=e._addNewLeapSeconds,C=0,E=v.length;E>C;C+=e._columnCount){var S=v[C+n],w=v[C+f],T=S+c.MODIFIED_JULIAN_DATE_DIFFERENCE,x=new a(T,w,h.TAI);if(g.push(x),y){if(w!==_&&r(_)){var b=a.leapSeconds,A=t(b,x,p);if(0>A){var P=new s(x,w);b.splice(~A,0,P)}}_=w}}}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 v(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],_=g-m;if(_>.5||-.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=v(h,i[d+e._xPoleWanderRadiansColumn],i[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=v(h,i[d+e._yPoleWanderRadiansColumn],i[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=v(h,i[d+e._xCelestialPoleOffsetRadiansColumn],i[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=v(h,i[d+e._yCelestialPoleOffsetRadiansColumn],i[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=v(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 v=t(o,e,a.compare,this._dateColumn);return v>=0?(vl&&(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("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/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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","require"],function(e,t,i,r,n){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,i=e.length;i>t;++t){var r=e[t].getAttribute("src"),n=p.exec(r);if(null!==n)return n[1]}}function a(){if(t(c))return c;var n;if(n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),!t(n))throw new i("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return c=new e(r(n))}function s(e){return n.toUrl("../"+e)}function l(t){return new e(t).resolve(a()).toString()}function u(e){t(h)||(h=t(n.toUrl)?s:l),t(d)||(d=document.createElement("a"));var i=h(e);return d.href=i,d.href=d.href,d.href}var c,h,d,p=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return u._cesiumScriptRegex=p,u.setBaseUrl=function(t){c=new e(t).resolve(new e(document.location.href))},u}),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;t>=l;++l){r[l]=a,n[l]=l*this._stepSizeDays;for(var u=0;t>=u;++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;l>s;++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;0>s&&(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;d>=m;++m)p.push(c(this,m));return e.all(p)},l.prototype.computeXysRadians=function(e,t,i){var o=u(this,e,t);if(!(0>o)){var a=o/this._stepSizeDays|0;if(!(a>=this._totalSamples)){var s=this._interpolationOrder,l=a-(s/2|0);0>l&&(l=0);var h=l+s;h>=this._totalSamples&&(h=this._totalSamples-1,l=h-s,0>l&&(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,v=o-l*this._stepSizeDays,g=this._work,_=this._denominators,y=this._coef,C=this._xTable;for(m=0;s>=m;++m)g[m]=v-C[m];for(m=0;s>=m;++m){for(y[m]=1,f=0;s>=f;++f)f!==m&&(y[m]*=g[f]);y[m]*=_[m];var E=3*(l+m);i.x+=y[m]*p[E++],i.y+=y[m]*p[E++],i.s+=y[m]*p[E]}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(){return n.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return n.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return n.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return n.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return n.supportsFullscreen()?null!==n.element:void 0}}}),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;s>a;++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",e(document[n])?r.fullscreenEnabled=n:(n=l+"FullScreenEnabled",e(document[n])&&(r.fullscreenEnabled=n)),n=l+"FullscreenElement",e(document[n])?r.fullscreenElement=n:(n=l+"FullScreenElement",e(document[n])&&(r.fullscreenElement=n)),n=l+"fullscreenchange",e(document["on"+n])&&("ms"===l&&(n="MSFullscreenChange"),r.fullscreenchange=n),n=l+"fullscreenerror",e(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;r>i;++i)t[i]=parseInt(t[i],10);return t}function n(){if(!t(y)){y=!1;var e=/ Chrome\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(y=!0,C=r(e[1]))}return y}function o(){return n()&&C}function a(){if(!t(E)&&(E=!1,!n()&&/ Safari\/[\.0-9]+/.test(_.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(E=!0,S=r(e[1]))}return E}function s(){return a()&&S}function l(){if(!t(w)){w=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(_.userAgent);null!==e&&(w=!0,T=r(e[1]),T.isNightly=!!e[2])}return w}function u(){return l()&&T}function c(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===_.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(_.userAgent),null!==e&&(x=!0,b=r(e[1]))):"Netscape"===_.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(_.userAgent),null!==e&&(x=!0,b=r(e[1])))}return x}function h(){return c()&&b}function d(){if(!t(A)){A=!1;var e=/Firefox\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(A=!0,P=r(e[1]))}return A}function p(){return t(I)||(I=/Windows/i.test(_.appVersion)),I}function m(){return d()&&P}function f(){return t(M)||(M="undefined"!=typeof PointerEvent&&(!t(_.pointerEnabled)||_.pointerEnabled)),M}function v(){if(!t(R)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var i=e.style.imageRendering;R=t(i)&&""!==i,R&&(D=i)}return R}function g(){return v()?D:void 0}var _;_="undefined"!=typeof navigator?navigator:{};var y,C,E,S,w,T,x,b,A,P,I,M,D,R,O={isChrome:n,chromeVersion:o,isSafari:a,safariVersion:s,isWebkit:l,webkitVersion:u,isInternetExplorer:c,internetExplorerVersion:h,isFirefox:d,firefoxVersion:m,isWindows:p,hardwareConcurrency:e(_.hardwareConcurrency,3),supportsPointerEvents:f,supportsImageRenderingPixelated:v,imageRenderingValue:g};return O.supportsFullscreen=function(){return i.supportsFullscreen()},O.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},O.supportsWebWorkers=function(){return"undefined"!=typeof Worker},O}),i("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,i,r,n){this.x=t(e,0),this.y=t(i,0),this.z=t(r,0),this.w=t(n,0)}var u=new e;l.fromAxisAngle=function(t,r,n){var o=r/2,a=Math.sin(o);u=e.normalize(t,u);var s=u.x*a,c=u.y*a,h=u.z*a,d=Math.cos(o);return i(n)?(n.x=s,n.y=c,n.z=h,n.w=d,n):new l(s,c,h,d)};var c=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var r,n,o,a,u,d=e[s.COLUMN0ROW0],p=e[s.COLUMN1ROW1],m=e[s.COLUMN2ROW2],f=d+p+m;if(f>0)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 v=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(_,_)]-e[s.getElementIndex(y,y)]+1);var C=h;C[g]=.5*r,r=.5/r,u=(e[s.getElementIndex(y,_)]-e[s.getElementIndex(_,y)])*r,C[_]=(e[s.getElementIndex(_,g)]+e[s.getElementIndex(g,_)])*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,v=new l,g=new l;l.packedLength=4,l.pack=function(e,i,r){r=t(r,0),i[r++]=e.x,i[r++]=e.y,i[r++]=e.z,i[r]=e.w},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;o>n;n++){var a=3*n;l.unpack(e,4*(t+n),f),l.multiply(f,g,f),f.w<0&&l.negate(f,f),l.computeAxis(f,p);var s=l.computeAngle(f);r[a]=p.x*s,r[a+1]=p.y*s,r[a+2]=p.z*s}},l.unpackInterpolationResult=function(t,r,n,o,a){i(a)||(a=new l),e.fromArray(t,0,m);var s=e.magnitude(m);return l.unpack(r,4*o,v),0===s?l.clone(l.IDENTITY,f):l.fromAxisAngle(m,s,f),l.multiply(f,v,a)},l.clone=function(e,t){return i(e)?i(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w):void 0},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var i=1/l.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},l.inverse=function(e,t){var i=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/i,t)},l.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},l.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},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.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},l.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},l.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},l.computeAxis=function(e,t){var i=e.w;if(Math.abs(i-1)n&&(n=-n,o=y=l.negate(t,y)),1-nR;++R){var O=R+1,N=2*O+1;P[R]=1/(O*N),I[R]=O/N}return P[7]=A/136,I[7]=8*A/17,l.fastSlerp=function(e,t,i,r){var n,o=l.dot(e,t);o>=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-I[h])*a,D[h]=(P[h]*c-I[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+D[0]*(1+D[1]*(1+D[2]*(1+D[3]*(1+D[4]*(1+D[5]*(1+D[6]*(1+D[7])))))))),m=l.multiplyByScalar(e,p,b);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,T),s=l.fastSlerp(i,r,n,x);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","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./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,v,g){"use strict";var _={},y=new i,C=new i,E=new i;_.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 f(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var s=y,l=C,c=E;return t=n(t,u.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,c),o(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.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 f(l.x,c.x,s.x,e.x,l.y,c.y,s.y,e.y,l.z,c.z,s.z,e.z,0,0,0,1)};var S=new i,w=new i,T=new i;_.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 f(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var s=S,l=w,c=T;return t=n(t,u.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.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 f(c.x,l.x,-s.x,e.x,c.y,l.y,-s.y,e.y,c.z,l.z,-s.z,e.z,0,0,0,1)},_.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 f(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var s=y,l=C,c=E;return t=n(t,u.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,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]=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 f(c.x,s.x,l.x,e.x,c.y,s.y,l.y,e.y,c.z,s.z,l.z,e.z,0,0,0,1)};var x=new v,b=new i(1,1,1),A=new f;_.headingPitchRollToFixedFrame=function(e,t,r,n,o,a){var s=v.fromHeadingPitchRoll(t,r,n,x),l=f.fromTranslationQuaternionRotationScale(i.ZERO,s,b,A);return a=_.eastNorthUpToFixedFrame(e,o,a),f.multiply(a,l,a)};var P=new f,I=new m;_.headingPitchRollQuaternion=function(e,t,i,r,n,o){var a=_.headingPitchRollToFixedFrame(e,t,i,r,n,P),s=f.getRotation(a,I);return v.fromRotationMatrix(s,o)};var M=24110.54841,D=8640184.812866,R=.093104,O=-62e-7,N=1.1772758384668e-19,L=72921158553e-15,F=p.TWO_PI/86400,B=new d;_.computeTemeToPseudoFixedMatrix=function(e,t){B=d.addSeconds(e,-d.computeTaiMinusUtc(e),B);var i,r=B.dayNumber,n=B.secondsOfDay,a=r-2451545;i=n>=43200?(a+.5)/g.DAYS_PER_JULIAN_CENTURY:(a-.5)/g.DAYS_PER_JULIAN_CENTURY;var s=M+i*(D+i*(R+i*O)),l=s*F%p.TWO_PI,u=L+N*(r-2451545.5),c=(n+.5*g.SECONDS_PER_DAY)%g.SECONDS_PER_DAY,h=l+u*c,f=Math.cos(h),v=Math.sin(h);return o(t)?(t[0]=f,t[1]=-v,t[2]=0,t[3]=v,t[4]=f,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(f,v,0,-v,f,0,0,0,1)},_.iau2006XysData=new c,_.earthOrientationParameters=s.NONE;var V=32.184,k=2451545;_.preloadIcrfFixed=function(t){var i=t.start.dayNumber,r=t.start.secondsOfDay+V,n=t.stop.dayNumber,o=t.stop.secondsOfDay+V,a=_.iau2006XysData.preload(i,r,n,o),s=_.earthOrientationParameters.getPromiseToLoad();return e.all([a,s])},_.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new m);var i=_.computeFixedToIcrfMatrix(e,t);if(o(i))return m.transpose(i,t)};var z=new h(0,0,0),U=new l(0,0,0,0,0,0),G=new m,W=new m;_.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new m);var i=_.earthOrientationParameters.compute(e,U);if(o(i)){var r=e.dayNumber,n=e.secondsOfDay+V,a=_.iau2006XysData.computeXysRadians(r,n,z);if(o(a)){var s=a.x+i.xPoleOffset,l=a.y+i.yPoleOffset,u=1/(1+Math.sqrt(1-s*s-l*l)),c=G;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=m.fromRotationZ(-a.s,W),f=m.multiply(c,h,G),v=e.dayNumber,y=e.secondsOfDay-d.computeTaiMinusUtc(e)+i.ut1MinusUtc,C=v-2451545,E=y/g.SECONDS_PER_DAY,S=.779057273264+E+.00273781191135448*(C+E);S=S%1*p.TWO_PI;var w=m.fromRotationZ(S,W),T=m.multiply(f,w,G),x=Math.cos(i.xPoleWander),b=Math.cos(i.yPoleWander),A=Math.sin(i.xPoleWander),P=Math.sin(i.yPoleWander),I=r-k+n/g.SECONDS_PER_DAY;I/=36525;var M=-47e-6*I*p.RADIANS_PER_DEGREE/3600,D=Math.cos(M),R=Math.sin(M),O=W;return O[0]=x*D,O[1]=x*R,O[2]=A,O[3]=-b*R+P*A*D,O[4]=b*D+P*A*R,O[5]=-P*x,O[6]=-P*R-b*A*D,O[7]=P*D-b*A*R,O[8]=b*x,m.multiply(T,O,t)}}};var H=new r;_.pointToWindowCoordinates=function(e,t,i,r){return r=_.pointToGLWindowCoordinates(e,t,i,r),r.y=2*t[5]-r.y,r},_.pointToGLWindowCoordinates=function(e,i,n,a){o(a)||(a=new t);var s=H;return f.multiplyByVector(e,r.fromElements(n.x,n.y,n.z,1,s),s),r.multiplyByScalar(s,1/s.w,s),f.multiplyByVector(i,s,s),t.fromCartesian4(s,a)};var q=new i,j=new i,Y=new i;return _.rotationMatrixFromPositionVelocity=function(e,t,r,a){var s=n(r,u.WGS84).geodeticSurfaceNormal(e,q),l=i.cross(t,s,j);i.equalsEpsilon(l,i.ZERO,p.EPSILON6)&&(l=i.clone(i.UNIT_X,l));var c=i.cross(l,t,Y);return i.cross(t,c,l),i.negate(l,l),o(a)||(a=new m),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=l.x,a[4]=l.y,a[5]=l.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a},_}),i("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix3","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e,t){t=n(t,l.WGS84),e=t.scaleToGeodeticSurface(e);var r=m.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=i.fromCartesian4(h.getColumn(r,0,v)),this._yAxis=i.fromCartesian4(h.getColumn(r,1,v));var o=i.fromCartesian4(h.getColumn(r,2,v));this._plane=d.fromPointNormal(e,o)}var v=new r;a(f.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 g=new e;f.fromPoints=function(t,i){var r=e.fromPoints(t,g);return new f(r.center,i)};var _=new p,y=new i;f.prototype.projectPointOntoPlane=function(e,r){var n=_;n.origin=e,i.normalize(e,n.direction);var a=u.rayPlane(n,this._plane,y);if(o(a)||(i.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,y)),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)}},f.prototype.projectPointsOntoPlane=function(e,t){o(t)||(t=[]);for(var i=0,r=e.length,n=0;r>n;n++){var a=this.projectPointOntoPlane(e[n],t[i]);o(a)&&(t[i]=a,i++)}return t.length=i,t},f.prototype.projectPointToNearestOnPlane=function(e,r){ +o(r)||(r=new t);var n=_;n.origin=e,i.clone(this._plane.normal,n.direction);var a=u.rayPlane(n,this._plane,y);o(a)||(i.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,y));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},f.prototype.projectPointsToNearestOnPlane=function(e,t){o(t)||(t=[]);var i=e.length;t.length=i;for(var r=0;i>r;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var C=new i;return f.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=C,c=0;r>c;++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},f}),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 v(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,_=new i,y=new i,C=new i,E=new i,S=new d,w={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;n>r;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,v=0;for(r=0;n>r;r++)l=i.subtract(e[r],a,_),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,v+=l.z*l.z;u*=s,c*=s,h*=s,p*=s,m*=s,v*=s;var T=S;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]=v;var x=d.computeEigenDecomposition(T,w),b=d.transpose(x.unitary,t.halfAxes);l=i.subtract(e[0],a,_);var A=d.multiplyByVector(b,l,y),P=i.clone(A,C),I=i.clone(A,E);for(r=1;n>r;r++)l=i.subtract(e[r],a,l),d.multiplyByVector(b,l,A),i.minimumByComponent(I,A,I),i.maximumByComponent(P,A,P);var M=i.add(I,P,y);i.multiplyByScalar(M,.5,M),d.multiplyByVector(b,M,M),i.add(a,M,t.center);var D=i.subtract(P,I,y);return i.multiplyByScalar(D,.5,D),d.multiplyByScale(t.halfAxes,D,t.halfAxes),t};var T=new i,x=new i,b=new r,A=new i,P=[new r,new r,new r,new r,new r,new r,new r,new r],I=[new i,new i,new i,new i,new i,new i,new i,new i],M=[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,b),u=r.cartographicToCartesian(a,A),c=new l(u,r),h=c.plane,d=P[0],f=P[1],g=P[2],_=P[3],y=P[4],C=P[5],E=P[6],S=P[7],w=a.longitude,T=e.south<0&&e.north>0?0:a.latitude;E.latitude=C.latitude=y.latitude=e.south,S.latitude=_.latitude=T,d.latitude=f.latitude=g.latitude=e.north,E.longitude=S.longitude=d.longitude=e.west,C.longitude=f.longitude=w,y.longitude=_.longitude=g.longitude=e.east,g.height=f.height=d.height=S.height=E.height=C.height=y.height=_.height=i,r.cartographicArrayToCartesianArray(P,I),c.projectPointsToNearestOnPlane(I,M);var x=Math.min(M[6].x,M[7].x,M[0].x),D=Math.max(M[2].x,M[3].x,M[4].x),R=Math.min(M[4].y,M[5].y,M[6].y),O=Math.max(M[0].y,M[1].y,M[2].y);g.height=d.height=y.height=E.height=t,r.cartographicArrayToCartesianArray(P,I);var N=Math.min(p.getPointDistance(h,I[0]),p.getPointDistance(h,I[2]),p.getPointDistance(h,I[4]),p.getPointDistance(h,I[6])),L=i;return v(c,x,D,R,O,N,L,o)},f.clone=function(e,t){return o(e)?o(t)?(i.clone(e.center,t.center),d.clone(e.halfAxes,t.halfAxes),t):new f(e.center,e.halfAxes):void 0},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-c>=h?u.OUTSIDE:h>=c?u.INSIDE:u.INTERSECTING};var D=new i,R=new i,O=new i,N=new i;f.distanceSquaredTo=function(e,t){var r=i.subtract(t,e.center,T),n=e.halfAxes,o=d.getColumn(n,0,D),a=d.getColumn(n,1,R),s=d.getColumn(n,2,O),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=N;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 L=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,D),p=d.getColumn(u,1,R),m=d.getColumn(u,2,O),f=i.add(h,p,L);i.add(f,m,f),i.add(f,l,f);var v=i.subtract(f,t,F),g=i.dot(r,v);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,v),g=i.dot(r,v),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,v),g=i.dot(r,v),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,v),g=i.dot(r,v),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,v),g=i.dot(r,v),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,v),g=i.dot(r,v),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,v),g=i.dot(r,v),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,v),g=i.dot(r,v),a=Math.min(g,a),s=Math.max(g,s),n.start=a,n.stop=s,n};var B=new e;return f.isOccluded=function(t,i){var r=e.fromOrientedBoundingBox(t,B);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.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var i=t.x,r=t.y;t.x=(1-Math.abs(r))*n.signNotZero(i),t.y=(1-Math.abs(i))*n.signNotZero(r)}return t.x=n.toSNorm(t.x),t.y=n.toSNorm(t.y),t},o.octDecode=function(e,i,r){if(r.x=n.fromSNorm(e),r.y=n.fromSNorm(i),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){var o=r.x;r.x=(1-Math.abs(r.y))*n.signNotZero(o),r.y=(1-Math.abs(o))*n.signNotZero(r.y)}return t.normalize(r,r)},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=1===e.x?4095:4096*e.x|0,i=1===e.y?4095:4096*e.y|0;return 4096*t+i},o.decompressTextureCoordinates=function(e,t){var i=e/4096;return t.x=Math.floor(i)/4096,t.y=i-Math.floor(i),t},o}),i("Renderer/WebGLConstants",["../Core/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",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,i,r,n,o){"use strict";if(!n.supportsTypedArrays())return{};var a={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return i(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(e,i,n,o){switch(n=t(n,0),o=t(o,(i.byteLength-n)/a.getSizeInBytes(e)),e){case a.BYTE:return new Int8Array(i,n,o);case a.UNSIGNED_BYTE:return new Uint8Array(i,n,o);case a.SHORT:return new Int16Array(i,n,o);case a.UNSIGNED_SHORT:return new Uint16Array(i,n,o);case a.FLOAT:return new Float32Array(i,n,o);case a.DOUBLE:return new Float64Array(i,n,o);default:throw new r("componentDatatype is not a valid value.")}},o(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","./defined","./Math","./Matrix3","./Matrix4","./TerrainQuantization"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,r,o,a){var u,d,v,g;if(n(e)&&n(t)&&n(r)&&n(o)){var _=e.minimum,y=e.maximum,C=i.subtract(y,_,h),E=r-t,S=Math.max(i.maximumComponent(C),E);u=f-1>S?l.BITS12:l.NONE,d=e.center,v=s.inverseTransformation(o,new s);var w=i.negate(_,c);s.multiply(s.fromTranslation(w,p),v,v);var T=c;T.x=1/C.x,T.y=1/C.y,T.z=1/C.z,s.multiply(s.fromScale(T,p),v,v),g=s.clone(o),s.setTranslation(g,i.ZERO,g),o=s.clone(o,new s);var x=s.fromTranslation(_,p),b=s.fromScale(C,m),A=s.multiply(x,b,p);s.multiply(o,A,o),s.multiply(g,A,g)}this.quantization=u,this.minimumHeight=t,this.maximumHeight=r,this.center=d,this.toScaledENU=v,this.fromScaledENU=o,this.matrix=g,this.hasVertexNormals=a}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,a,u,h,p){var m=u.x,f=u.y;if(this.quantization===l.BITS12){a=s.multiplyByPoint(this.toScaledENU,a,c),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 v=this.maximumHeight-this.minimumHeight,g=o.clamp((h-this.minimumHeight)/v,0,1);t.fromElements(a.x,a.y,d);var _=e.compressTextureCoordinates(d);t.fromElements(a.z,g,d);var y=e.compressTextureCoordinates(d);t.fromElements(m,f,d);var C=e.compressTextureCoordinates(d);r[n++]=_,r[n++]=y,r[n++]=C}else i.subtract(a,this.center,c),r[n++]=c.x,r[n++]=c.y,r[n++]=c.z,r[n++]=h,r[n++]=m,r[n++]=f;return this.hasVertexNormals&&(r[n++]=e.octPackFloat(p)),n},u.prototype.decodePosition=function(t,r,o){if(n(o)||(o=new i),r*=this.getStride(),this.quantization===l.BITS12){var a=e.decompressTextureCoordinates(t[r],d);o.x=a.x,o.y=a.y;var u=e.decompressTextureCoordinates(t[r+1],d);return o.z=u.x,s.multiplyByPoint(this.fromScaledENU,o,o)}return o.x=t[r],o.y=t[r+1],o.z=t[r+2],i.add(o,this.center,o)},u.prototype.decodeTextureCoordinates=function(i,r,o){return n(o)||(o=new t),r*=this.getStride(),this.quantization===l.BITS12?e.decompressTextureCoordinates(i[r+2],o):t.fromElements(i[r+4],i[r+5],o)},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.hasVertexNormals&&++e,e};var v={position3DAndHeight:0,textureCoordAndEncodedNormals:1},g={compressed:0};return u.prototype.getAttributes=function(e){var t=r.FLOAT;if(this.quantization===l.NONE){var i=r.getSizeInBytes(t),n=4,o=this.hasVertexNormals?3:2,a=(this.hasVertexNormals?7:6)*i;return[{index:v.position3DAndHeight,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:n,offsetInBytes:0,strideInBytes:a},{index:v.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:o,offsetInBytes:n*i,strideInBytes:a}]}var s=3;return s+=this.hasVertexNormals?1:0,[{index:g.compressed,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:s}]},u.prototype.getAttributeLocations=function(){return this.quantization===l.NONE?v:g},u.clone=function(e,t){return n(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},u}),i("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";var v={};v.DEFAULT_STRUCTURE=u({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var g=new r,_=new h,y=new r,C=new r;return v.computeVertices=function(a){var u,E,S,w,T=Math.cos,x=Math.sin,b=Math.sqrt,A=Math.atan,P=Math.exp,I=c.PI_OVER_TWO,M=c.toRadians,D=a.heightmap,R=a.width,O=a.height,N=a.skirtHeight,L=n(a.isGeographic,!0),F=n(a.ellipsoid,s.WGS84),B=1/F.maximumRadius,V=a.nativeRectangle,k=a.rectangle;o(k)?(u=k.west,E=k.south,S=k.east,w=k.north):L?(u=M(V.west),E=M(V.south),S=M(V.east),w=M(V.north)):(u=V.west*B,E=I-2*A(P(-V.south*B)),S=V.east*B,w=I-2*A(P(-V.north*B)));var z=n(a.relativeToCenter,r.ZERO),U=n(a.exaggeration,1),G=n(a.structure,v.DEFAULT_STRUCTURE),W=n(G.heightScale,v.DEFAULT_STRUCTURE.heightScale),H=n(G.heightOffset,v.DEFAULT_STRUCTURE.heightOffset),q=n(G.elementsPerHeight,v.DEFAULT_STRUCTURE.elementsPerHeight),j=n(G.stride,v.DEFAULT_STRUCTURE.stride),Y=n(G.elementMultiplier,v.DEFAULT_STRUCTURE.elementMultiplier),X=n(G.isBigEndian,v.DEFAULT_STRUCTURE.isBigEndian),Z=p.computeWidth(V)/(R-1),K=p.computeHeight(V)/(O-1),Q=F.radiiSquared,J=Q.x,$=Q.y,ee=Q.z,te=65536,ie=-65536,re=f.eastNorthUpToFixedFrame(z,F),ne=h.inverseTransformation(re,_),oe=y;oe.x=Number.POSITIVE_INFINITY,oe.y=Number.POSITIVE_INFINITY,oe.z=Number.POSITIVE_INFINITY;var ae=C;ae.x=Number.NEGATIVE_INFINITY,ae.y=Number.NEGATIVE_INFINITY,ae.z=Number.NEGATIVE_INFINITY;var se=Number.POSITIVE_INFINITY,le=R+(N>0?2:0),ue=O+(N>0?2:0),ce=le*ue,he=new Array(ce),de=new Array(ce),pe=new Array(ce),me=0,fe=O,ve=0,ge=R;N>0&&(--me,++fe,--ve,++ge);for(var _e=0,ye=me;fe>ye;++ye){var Ce=ye;0>Ce&&(Ce=0),Ce>=O&&(Ce=O-1);var Ee=V.north-K*Ce;Ee=L?M(Ee):I-2*A(P(-Ee*B));var Se=T(Ee),we=x(Ee),Te=ee*we,xe=(Ee-E)/(w-E);xe=c.clamp(xe,0,1);for(var be=ve;ge>be;++be){var Ae=be;0>Ae&&(Ae=0),Ae>=R&&(Ae=R-1);var Pe=V.west+Z*Ae;L?Pe=M(Pe):Pe*=B;var Ie,Me=Ce*(R*j)+Ae*j;if(1===q)Ie=D[Me];else{Ie=0;var De;if(X)for(De=0;q>De;++De)Ie=Ie*Y+D[Me+De];else for(De=q-1;De>=0;--De)Ie=Ie*Y+D[Me+De]}Ie=(Ie*W+H)*U,ie=Math.max(ie,Ie),te=Math.min(te,Ie),(be!==Ae||ye!==Ce)&&(Ie-=N);var Re=Se*T(Pe),Oe=Se*x(Pe),Ne=J*Re,Le=$*Oe,Fe=b(Ne*Re+Le*Oe+Te*we),Be=1/Fe,Ve=Ne*Be,ke=Le*Be,ze=Te*Be,Ue=new r;Ue.x=Ve+Re*Ie,Ue.y=ke+Oe*Ie,Ue.z=ze+we*Ie,he[_e]=Ue,de[_e]=Ie;var Ge=(Pe-u)/(S-u);Ge=c.clamp(Ge,0,1),pe[_e]=new i(Ge,xe),_e++,h.multiplyByPoint(ne,Ue,g),r.minimumByComponent(g,oe,oe),r.maximumByComponent(g,ae,ae),se=Math.min(se,Ie)}}var We,He=t.fromPoints(he);o(k)&&k.widthJe;++Je)Qe=Ze.encode(Ke,Qe,he[Je],pe[Je],de[Je]);return{vertices:Ke,maximumHeight:ie,minimumHeight:te,encoding:Ze,boundingSphere3D:He,orientedBoundingBox:We,occludeePointInScaledSpace:qe}},v}),i("Core/destroyObject",["./defaultValue","./DeveloperError"],function(e,t){"use strict";function i(){return!0}function r(r,n){function o(){throw new t(n)}n=e(n,"This object was destroyed, i.e., destroy() was called.");for(var a in r)"function"==typeof r[a]&&(r[a]=o);r.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/Uri","../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./destroyObject","./DeveloperError","./getAbsoluteUri","./isCrossOriginUrl","./RuntimeError","require"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(){if(!n(v._canTransferArrayBuffer)){var e=new Worker(p("Workers/transferTypedArrayTest.js"));e.postMessage=r(e.webkitPostMessage,e.postMessage);var i=99,o=new Int8Array([i]);try{e.postMessage({array:o},[o.buffer])}catch(a){return v._canTransferArrayBuffer=!1,v._canTransferArrayBuffer}var s=t.defer();e.onmessage=function(t){var r=t.data.array,o=n(r)&&r[0]===i;s.resolve(o),e.terminate(),v._canTransferArrayBuffer=o},v._canTransferArrayBuffer=s.promise}return v._canTransferArrayBuffer}function d(e,t){--e._activeTasks;var i=t.id;if(n(i)){var r=e._deferreds,o=r[i];if(n(t.error)){var s=t.error;"RuntimeError"===s.name?(s=new u(t.error.message),s.stack=t.error.stack):"DeveloperError"===s.name&&(s=new a(t.error.message),s.stack=t.error.stack),o.reject(s)}else o.resolve(t.result);delete r[i]}}function p(e){var t=i(e);if(l(t)){var r,n='importScripts("'+t+'");';try{r=new Blob([n],{type:"application/javascript"})}catch(o){var a=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,s=new a;s.append(n),r=s.getBlob("application/javascript")}var u=window.URL||window.webkitURL;t=u.createObjectURL(r)}return t}function m(){ +return n(g)||(g=p("Workers/cesiumWorkerBootstrapper.js")),g}function f(e){var t=new Worker(m());t.postMessage=r(t.webkitPostMessage,t.postMessage);var o={loaderConfig:{},workerModule:v._workerModulePrefix+e._workerName};return n(v._loaderConfig)?o.loaderConfig=v._loaderConfig:n(c.toUrl)?o.loaderConfig.baseUrl=s("..",i("Workers/cesiumWorkerBootstrapper.js")):o.loaderConfig.paths={Workers:i("Workers")},t.postMessage(o),t.onmessage=function(t){d(e,t.data)},t}function v(e,t){this._workerName=e,this._maximumActiveTasks=r(t,5),this._activeTasks=0,this._deferreds={},this._nextID=0}var g,_=[];return v.prototype.scheduleTask=function(e,i){if(n(this._worker)||(this._worker=f(this)),!(this._activeTasks>=this._maximumActiveTasks)){++this._activeTasks;var r=this;return t(h(),function(o){n(i)?o||(i.length=0):i=_;var a=r._nextID++,s=t.defer();return r._deferreds[a]=s,r._worker.postMessage({id:a,parameters:e,canTransferArrayBuffer:o},i),s.promise})}},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return n(this._worker)&&this._worker.terminate(),o(this)},v._defaultWorkerModulePrefix="Workers/",v._workerModulePrefix=v._defaultWorkerModulePrefix,v._loaderConfig=void 0,v._canTransferArrayBuffer=void 0,v}),i("Core/TerrainMesh",["../Core/defaultValue"],function(e){"use strict";function t(t,i,r,n,o,a,s,l,u,c){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}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;i-1>l;++l){for(var u=0;t-1>u;++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 _=c-d,y=h-m;m=s-1-m,f=s-1-f;var C=g(e,t,i,r,n,m*a+d),E=g(e,t,i,r,n,m*a+p),S=g(e,t,i,r,n,f*a+d),w=g(e,t,i,r,n,f*a+p);return v(_,y,C,E,S,w)}function f(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);n>0&&(c+=1,h+=1,a+=2,s+=2);var d=n>0?a-1:a,p=0|c,m=p+1;m>=d&&(m=a-1,p=a-2);var f=n>0?s-1:s,g=0|h,_=g+1;_>=f&&(_=s-1,g=s-2);var y=c-p,C=h-g;g=s-1-g,_=s-1-_;var E=(t.decodeHeight(e,g*a+p)-i)/r,S=(t.decodeHeight(e,g*a+m)-i)/r,w=(t.decodeHeight(e,_*a+p)-i)/r,T=(t.decodeHeight(e,_*a+m)-i)/r;return v(y,C,E,S,w,T)}function v(e,t,i,r,n,o){return e>t?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;t>a;++a)s=s*i+e[o+a];else for(a=t-1;a>=0;--a)s=s*i+e[o+a];return s}function _(e,t,i,r,n,o,a,s){a*=n;var l;if(o)for(l=0;t>l;++l)e[a+l]=s/r,s-=e[a+l]*r,r/=i;else for(l=t-1;l>=0;--l)e[a+l]=s/r,s-=e[a+l]*r,r/=i}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 v=p.cartographicToCartesian(l.center(f)),g=this._structure,_=d.getEstimatedLevelZeroGeometricErrorForAHeightmap(p,this._width,r.getNumberOfXTilesAtLevel(0)),C=_/(1<I;++I)for(var M=s.lerp(S.north,S.south,I/(c-1)),D=0;u>D;++D){var R=s.lerp(S.west,S.east,D/(u-1)),O=f(y,C,w,T,d,E,u,c,R,M);_(v,x,b,P,m,A,I*u+D,O)}return new p({buffer:v,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?void 0:(o[l]=u+1,t(a(e,s),function(e){return o[l]--,e}).otherwise(function(e){return o[l]--,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},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 v=m(p,h);if(r(v)){var g=this;return e(v,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<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,v,g,_;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),v=t.dot(h,p),g=t.dot(d,d),_=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),v=e.dot(h,p),g=e.dot(d,d),_=e.dot(d,p));var y=1/(m*g-f*f);return c.y=(g*v-f*_)*y,c.z=(m*_-f*v)*y,c.x=1-c.y-c.z,c}var o=new t,a=new t,s=new t;return n}),i("Core/BingMapsApi",["./defined"],function(e){"use strict";var t={};t.defaultKey=void 0;var i=!1;return t.getKey=function(r){return e(r)?r:e(t.defaultKey)?t.defaultKey:(i||(console.log("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."),i=!0),"Aj1ony_-Typ-KjG9SJWiKSHY23U1KmK7yAmZa9lDmuF2osXWkcZ22VPsqmCt0TCt")},t}),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.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;i>u;u++){var c=e[u],h=c.x,d=c.y;n=Math.min(h,n),a=Math.max(h,a),o=Math.min(d,o),s=Math.max(d,s)}return t.x=n,t.y=o,t.width=a-n,t.height=s-o,t};var u=new o,c=new t,h=new t;return l.fromRectangle=function(t,n,o){if(r(o)||(o=new l),!r(t))return o.x=0,o.y=0,o.width=0,o.height=0,o;n=i(n,u);var a=n.project(s.southwest(t,c)),d=n.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){return r(e)?r(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):void 0},l.union=function(e,t,i){r(i)||(i=new l);var n=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=n,i.y=o,i.width=a-n,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:0>r&&(i.width-=r,i.x=t.x),n>i.height?i.height=n:0>n&&(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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"use strict";var i={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(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 t(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=void 0}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 o=e.attributes[n],a=o.values.length/o.componentsPerAttribute;if(r!==a&&-1!==r)throw new i("All attribute lists must have the same number of attributes.");r=a}return r},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){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},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){return t(e)?(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):void 0},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){if(!n(e))throw new o("boundingBox is required.");return new h({minimum:e.minimum,maximum:e.maximum})},h.fromAxisAlignedBoundingBox=function(e){if(!n(e))throw new o("boundingBox is required.");return new h({minimum:e.minimum,maximum:e.maximum})},h.packedLength=2*t.packedLength+c.packedLength,h.pack=function(e,i,n){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)};var p=new t,m=new t,f=new c,v={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(v)},h.createGeometry=function(r){var n,o,c=r._minimum,h=r._maximum,p=r._vertexFormat,m=new l;if(p.position&&(p.st||p.normal||p.binormal||p.tangent)){if(p.position&&(o=new Float64Array(72),o[0]=c.x,o[1]=c.y,o[2]=h.z,o[3]=h.x,o[4]=c.y,o[5]=h.z,o[6]=h.x,o[7]=h.y,o[8]=h.z,o[9]=c.x,o[10]=h.y,o[11]=h.z,o[12]=c.x,o[13]=c.y,o[14]=c.z,o[15]=h.x,o[16]=c.y,o[17]=c.z,o[18]=h.x,o[19]=h.y,o[20]=c.z,o[21]=c.x,o[22]=h.y,o[23]=c.z,o[24]=h.x,o[25]=c.y,o[26]=c.z,o[27]=h.x,o[28]=h.y,o[29]=c.z,o[30]=h.x,o[31]=h.y,o[32]=h.z,o[33]=h.x,o[34]=c.y,o[35]=h.z,o[36]=c.x,o[37]=c.y,o[38]=c.z,o[39]=c.x,o[40]=h.y,o[41]=c.z,o[42]=c.x,o[43]=h.y,o[44]=h.z,o[45]=c.x,o[46]=c.y,o[47]=h.z,o[48]=c.x,o[49]=h.y,o[50]=c.z,o[51]=h.x,o[52]=h.y,o[53]=c.z,o[54]=h.x,o[55]=h.y,o[56]=h.z,o[57]=c.x,o[58]=h.y,o[59]=h.z,o[60]=c.x,o[61]=c.y,o[62]=c.z,o[63]=h.x,o[64]=c.y,o[65]=c.z,o[66]=h.x,o[67]=c.y,o[68]=h.z,o[69]=c.x,o[70]=c.y,o[71]=h.z,m.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:o})),p.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(p.st){var v=new Float32Array(48);v[0]=0,v[1]=0,v[2]=1,v[3]=0,v[4]=1,v[5]=1,v[6]=0,v[7]=1,v[8]=1,v[9]=0,v[10]=0,v[11]=0,v[12]=0,v[13]=1,v[14]=1,v[15]=1,v[16]=0,v[17]=0,v[18]=1,v[19]=0,v[20]=1,v[21]=1,v[22]=0,v[23]=1,v[24]=1,v[25]=0,v[26]=0,v[27]=0,v[28]=0,v[29]=1,v[30]=1,v[31]=1,v[32]=1,v[33]=0,v[34]=0,v[35]=0,v[36]=0,v[37]=1,v[38]=1,v[39]=1,v[40]=0,v[41]=0,v[42]=1,v[43]=0,v[44]=1,v[45]=1,v[46]=0,v[47]=1,m.st=new s({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:v})}if(p.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(p.binormal){var _=new Float32Array(72);_[0]=0,_[1]=1,_[2]=0,_[3]=0,_[4]=1,_[5]=0,_[6]=0,_[7]=1,_[8]=0,_[9]=0,_[10]=1,_[11]=0,_[12]=0,_[13]=1,_[14]=0,_[15]=0,_[16]=1,_[17]=0,_[18]=0,_[19]=1,_[20]=0,_[21]=0,_[22]=1,_[23]=0,_[24]=0,_[25]=0,_[26]=1,_[27]=0,_[28]=0,_[29]=1,_[30]=0,_[31]=0,_[32]=1,_[33]=0,_[34]=0,_[35]=1,_[36]=0,_[37]=0,_[38]=1,_[39]=0,_[40]=0,_[41]=1,_[42]=0,_[43]=0,_[44]=1,_[45]=0,_[46]=0,_[47]=1,_[48]=0,_[49]=0,_[50]=1,_[51]=0,_[52]=0,_[53]=1,_[54]=0,_[55]=0,_[56]=1,_[57]=0,_[58]=0,_[59]=1,_[60]=0,_[61]=0,_[62]=1,_[63]=0,_[64]=0,_[65]=1,_[66]=0,_[67]=0,_[68]=1,_[69]=0,_[70]=0,_[71]=1,m.binormal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:_})}n=new Uint16Array(36),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else o=new Float64Array(24),o[0]=c.x,o[1]=c.y,o[2]=c.z,o[3]=h.x,o[4]=c.y,o[5]=c.z,o[6]=h.x,o[7]=h.y,o[8]=c.z,o[9]=c.x,o[10]=h.y,o[11]=c.z,o[12]=c.x,o[13]=c.y,o[14]=h.z,o[15]=h.x,o[16]=c.y,o[17]=h.z,o[18]=h.x,o[19]=h.y,o[20]=h.z,o[21]=c.x,o[22]=h.y,o[23]=h.z,m.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:o}),n=new Uint16Array(36),n[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;var y=t.subtract(h,c,d),C=.5*t.magnitude(y);return new a({attributes:m,indices:n,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){if(!n(e))throw new o("boundingBox is required.");return new c({minimum:e.minimum,maximum:e.maximum})},c.packedLength=2*t.packedLength,c.pack=function(e,i,n){n=r(n,0),t.pack(e._min,i,n),t.pack(e._max,i,n+t.packedLength)};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,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;n>r&&!e(i);)i=window[t[r]+"CancelAnimationFrame"],e(i)||(i=window[t[r]+"CancelRequestAnimationFrame"]),++r;e(i)||(i=clearTimeout)}(),t}}),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(n>i+1&&ti+2&&t=0&&t>=r[i-1])return i-1;var o;if(t>r[i])for(o=i;n-1>o&&!(t>=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=v;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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n){"use strict";var o={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===o.UNSIGNED_BYTE||e===o.UNSIGNED_SHORT||e===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,i,r){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,i,r):new Uint16Array(t,i,r)},r(o)}),i("Core/definedNotNull",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),i("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./definedNotNull","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(n,o,a){a=t(a,!0),n instanceof e||(n=new e(n)),o instanceof e||(o=new e(o)),r(o.authority)&&!r(o.scheme)&&("undefined"!=typeof document&&i(document.location)&&i(document.location.href)?o.scheme=new e(document.location.href).scheme:o.scheme=n.scheme);var s=n;o.isAbsolute()&&(s=o);var l="";r(s.scheme)&&(l+=s.scheme+":"),r(s.authority)&&(l+="//"+s.authority,""!==s.path&&(l=l.replace(/\/?$/,"/"),s.path=s.path.replace(/^\/?/g,""))),l+=s===n?a?n.path.replace(/\/?$/,"/")+o.path.replace(/^\/?/g,""):n.path+o.path:o.path;var u=r(n.query),c=r(o.query);u&&c?l+="?"+n.query+"&"+o.query:u&&!c?l+="?"+n.query:!u&&c&&(l+="?"+o.query);var h=r(o.fragment);return r(n.fragment)&&!h?l+="#"+n.fragment:h&&(l+="#"+o.fragment),l}return o}),i("Core/loadArrayBuffer",["./loadWithXhr","./defined"],function(e,t){"use strict";function i(i,r){return e({url:i,responseType:"arraybuffer",headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return i}),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=e>r,l=e>n,u=e>o):(s=r>e,l=n>e,u=o>e);var c,h,d,p,m,f,v=s+l+u;return 1===v?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===v?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!==v&&(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),v=r-u,g=i-l,_=(p*g+d*v)*f,y=(-m*g+h*v)*f,C=1-_-y;return t(c)?(c.x=_,c.y=y,c.z=C,c):new e(_,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=v(e.westIndices,t,r),this._southIndices=v(e.southIndices,i,r),this._eastIndices=v(e.eastIndices,t,r),this._northIndices=v(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 v(e,t,i){y.length=e.length;for(var r=!1,n=0,o=e.length;o>n;++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;l>s;s+=3){var c=a[s],h=a[s+1],d=a[s+2],p=o.decodeTextureCoordinates(n,c,T),m=o.decodeTextureCoordinates(n,h,x),f=o.decodeTextureCoordinates(n,d,b),v=u.computeBarycentricCoordinates(t,i,p.x,p.y,m.x,m.y,f.x,f.y,w);if(v.x>=-1e-15&&v.y>=-1e-15&&v.z>=-1e-15){var g=o.decodeHeight(n,c),_=o.decodeHeight(n,h),y=o.decodeHeight(n,d);return v.x*g+v.y*_+v.z*y}}}function _(e,t,i){for(var r=e._uValues,n=e._vValues,o=e._heightValues,a=e._indices,s=0,l=a.length;l>s;s+=3){var h=a[s],d=a[s+1],p=a[s+2],m=r[h],f=r[d],v=r[p],g=n[h],_=n[d],y=n[p],C=u.computeBarycentricCoordinates(t,i,m,g,f,_,v,y,w);if(C.x>=-1e-15&&C.y>=-1e-15&&C.z>=-1e-15){var E=C.x*o[h]+C.y*o[d]+C.z*o[p];return c.lerp(e._minimumHeight,e._maximumHeight,E/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,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,s=e.maximumHeight,u=n(e.boundingSphere,d._boundingSphere),c=n(e.orientedBoundingBox,d._orientedBoundingBox),h=n(e.occludeePointInScaledSpace,d._horizonOcclusionPoint),f=e.vertexStride,v=p.clone(e.encoding);return d._skirtIndex=e.skirtIndex,d._vertexCountWithoutSkirts=d._quantizedVertices.length/3,d._mesh=new m(o,r,i,a,s,u,h,f,c,v),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 E=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,v=2*a===c,g=i.ellipsoid,_=i.tileXYToRectangle(u,c,d),y=E.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:v,childRectangle:_,ellipsoid:g});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,w=v?.5*C:this._southSkirtHeight,T=m?this._eastSkirtHeight:.5*C,x=v?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:w,eastSkirtHeight:T,northSkirtHeight:x,childTileMask:0,createdByUpsampling:!0})})}}};var S=32767,w=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):_(this,r,n)};var T=new i,x=new i,b=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","./Matrix3","./OrientedBoundingBox","./QuantizedMeshTerrainData","./RuntimeError","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w){"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=w.handleError(m,v,v._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,v,v._errorEvent,i,void 0,void 0,void 0,l));if("heightmap-1.0"===t.format)v._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1},v._hasWaterMask=!0,v._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,v,v._errorEvent,i,void 0,void 0,void 0,l));v._tileUrlTemplates=t.tiles;for(var r=0;r>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,g=Uint16Array.BYTES_PER_ELEMENT*f,C=3,E=Uint16Array.BYTES_PER_ELEMENT,S=E*C,w=new DataView(t),T=new r(w.getFloat64(u,!0),w.getFloat64(u+8,!0),w.getFloat64(u+16,!0));u+=p;var x=w.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var b=w.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var A=new i(new r(w.getFloat64(u,!0),w.getFloat64(u+8,!0),w.getFloat64(u+16,!0)),w.getFloat64(u+p,!0));u+=m;var I=new r(w.getFloat64(u,!0),w.getFloat64(u+8,!0),w.getFloat64(u+16,!0));u+=p;var D=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var R=new Uint16Array(t,u,3*D);u+=D*g,D>65536&&(E=Uint32Array.BYTES_PER_ELEMENT,S=E*C);var O,N=R.subarray(0,D),L=R.subarray(D,2*D),F=R.subarray(2*D,3*D),B=0,V=0,k=0;for(O=0;D>O;++O)B+=l(N[O]),V+=l(L[O]),k+=l(F[O]),N[O]=B,L[O]=V,F[O]=k;u%E!==0&&(u+=E-u%E);var z=w.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var U=d.createTypedArrayFromArrayBuffer(D,t,u,z*C);u+=z*S;var G=0;for(O=0;O=n.length)return 0;var a=n[o],s=0;return s|=I(a,2*i,2*r)?1:0,s|=I(a,2*i+1,2*r)?2:0,s|=I(a,2*i,2*r+1)?4:0,s|=I(a,2*i+1,2*r+1)?8:0}function I(e,t,i){for(var r=0,n=e.length;n>r;++r){var o=e[r];if(t>=o.startX&&t<=o.endX&&i>=o.startY&&i<=o.endY)return!0}return!1}var M={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 v=this;return t(p,function(t){return a(v._heightmapStructure)?b(v,t,r,e,i,c):A(v,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}}}),T.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 I(n,e,a)}},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,v){var g=t+n;e.multiplyByScalar(c,Math.cos(g),a),e.multiplyByScalar(o,Math.sin(g),s),e.add(a,s,a);var _=Math.cos(t);_*=_;var y=Math.sin(t);y*=y;var C=d/Math.sqrt(p*_+h*y),E=C/m;return r.fromAxisAngle(a,E,l),i.fromQuaternion(l,u),i.multiplyByVector(u,f,v),e.normalize(v,v),e.multiplyByScalar(v,m,v),v}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;u>f;f+=3){var v=f+1,g=f+2,_=e.fromArray(t,f,c);n.scaleToGeodeticSurface(_,_);var y=e.clone(_,h),C=n.geodeticSurfaceNormal(_,p),E=e.multiplyByScalar(C,o,d);e.add(_,E,_),r&&(e.multiplyByScalar(C,a,E),e.add(y,E,y),l[f+m]=y.x,l[v+m]=y.y,l[g+m]=y.z),l[f]=_.x,l[v]=_.y,l[g]=_.z}return l};var m=new e,f=new e,v=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,_=s*s,y=s*a,C=e.magnitude(u),E=e.normalize(u,m),S=e.cross(e.UNIT_Z,u,f);S=e.normalize(S,S);var w=e.cross(E,S,v),T=1+Math.ceil(t.PI_OVER_TWO/p),x=t.PI_OVER_TWO/(T-1),b=t.PI_OVER_TWO-T*x;0>b&&(T-=Math.ceil(Math.abs(b)/x));var A,P,I,M,D,R=2*(T*(T+2)),O=r?new Array(3*R):void 0,N=0,L=c,F=h,B=4*T*3,V=B-1,k=0,z=o?new Array(B):void 0;for(b=t.PI_OVER_TWO,L=n(b,l,w,S,g,y,_,C,E,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),b=t.PI_OVER_TWO-x,A=1;T+1>A;++A){if(L=n(b,l,w,S,g,y,_,C,E,L),F=n(Math.PI-b,l,w,S,g,y,_,C,E,F),r){for(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,I=2*A+2,P=1;I-1>P;++P)M=P/(I-1),D=e.lerp(L,F,M,d),O[N++]=D.x,O[N++]=D.y,O[N++]=D.z;O[N++]=F.x,O[N++]=F.y,O[N++]=F.z}o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x,z[k++]=F.x,z[k++]=F.y,z[k++]=F.z),b=t.PI_OVER_TWO-(A+1)*x}for(A=T;A>1;--A){if(b=t.PI_OVER_TWO-(A-1)*x,L=n(-b,l,w,S,g,y,_,C,E,L),F=n(b+Math.PI,l,w,S,g,y,_,C,E,F),r){for(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,I=2*(A-1)+2,P=1;I-1>P;++P)M=P/(I-1),D=e.lerp(L,F,M,d),O[N++]=D.x,O[N++]=D.y,O[N++]=D.z;O[N++]=F.x,O[N++]=F.y,O[N++]=F.z}o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x,z[k++]=F.x,z[k++]=F.y,z[k++]=F.z)}b=t.PI_OVER_TWO,L=n(-b,l,w,S,g,y,_,C,E,L);var U={};return r&&(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,U.positions=O,U.numPts=T),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/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];a>s;)l>n&&(n=l),++s,l=r[s]}for(var u=[],c=0;n+1>c;c++)u[c]=0;for(var h=o+1,d=0;a>d;++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(;r>o;){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;hc||-1===c)&&(c=l,u=d)),++h}return-1===u?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(;p>h;)d>c&&(c=d),++h,d=a[h];if(-1===c)return 0;++c}for(var m=[],f=0;c>f;f++)m[f]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};h=0;for(var v=0;p>h;)m[a[h]].vertexTriangles.push(v),++m[a[h]].numLiveTriangles,m[a[h+1]].vertexTriangles.push(v),++m[a[h+1]].numLiveTriangles,m[a[h+2]].vertexTriangles.push(v),++m[a[h+2]].numLiveTriangles,++v,h+=3;var g=0,_=l+1;o=1;var y,C,E=[],S=[],w=0,T=[],x=u/3,b=[];for(f=0;x>f;f++)b[f]=!1;for(var A,P;-1!==g;){E=[],C=m[g],P=C.vertexTriangles.length;for(var I=0;P>I;++I)if(v=C.vertexTriangles[I],!b[v]){b[v]=!0,h=v+v+v;for(var M=0;3>M;++M)A=a[h],E.push(A),S.push(A),T[w]=A,++w,y=m[A],--y.numLiveTriangles,_-y.timeStamp>l&&(y.timeStamp=_,++_),++h}g=n(a,l,E,m,_,S,c)}return T},r}),i("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryInstance","./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,v,g,_,y,C,E,S,w,T,x){"use strict";function b(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;t>o;o+=3,n+=6)b(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);b(r,0,e[0],e[1],e[2]);for(var n=6,o=3;t>o;++o,n+=6)b(r,n,e[o-1],e[o],e[o-2]);return r}return new Uint16Array}function I(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;t>a;++a,o+=6)b(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 m({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function D(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;oo;o+=3)n.unpack(i,o,oe),S.multiplyByPoint(e,oe,oe),n.pack(oe,i,o)}function O(e,t){if(u(t))for(var i=t.values,r=i.length,o=0;r>o;o+=3)n.unpack(i,o,oe),E.multiplyByVector(e,oe,oe),oe=n.normalize(oe,oe),n.pack(oe,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;r>h;++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 m({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,m=(e[0].modelMatrix,u(e[0][t].indices)),f=e[0][t].primitiveType,v=N(e,t);for(r in v)if(v.hasOwnProperty(r))for(l=v[r].values,s=0,o=0;d>o;++o)for(c=e[o][t].attributes[r].values,h=c.length,a=0;h>a;++a)l[s++]=c[a];var _;if(m){var y=0;for(o=0;d>o;++o)y+=e[o][t].indices.length;var C=p.computeNumberOfVertices(new p({attributes:v,primitiveType:T.POINTS})),E=g.createTypedArray(C,y),S=0,w=0;for(o=0;d>o;++o){var x=e[o][t].indices,b=x.length;for(s=0;b>s;++s)E[S++]=w+x[s];w+=p.computeNumberOfVertices(e[o][t])}_=E}var A,P=new n,I=0;for(o=0;d>o;++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;d>o;++o){A=e[o][t].boundingSphere;var M=n.magnitude(n.subtract(A.center,P,le))+A.radius;M>I&&(I=M)}return new p({attributes:v,indices:_,primitiveType:f,boundingSphere:u(P)?new i(P,I):void 0})}function F(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),i=g.createTypedArray(t,t),r=0;t>r;++r)i[r]=r;return e.indices=i,e}function B(e){var t=p.computeNumberOfVertices(e),i=g.createTypedArray(t,3*(t-2));i[0]=1,i[1]=0,i[2]=2;for(var r=3,n=3;t>n;++n)i[r++]=n-1,i[r++]=0,i[r++]=n;return e.indices=i,e.primitiveType=T.TRIANGLES,e}function V(e){var t=p.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;t-1>n;n+=2)i[r++]=n,i[r++]=n-1,i[r++]=n+1,t>n+2&&(i[r++]=n,i[r++]=n+1,i[r++]=n+2);return e.indices=i,e.primitiveType=T.TRIANGLES,e}function k(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),i=g.createTypedArray(t,t),r=0;t>r;++r)i[r]=r;return e.indices=i,e}function z(e){var t=p.computeNumberOfVertices(e),i=g.createTypedArray(t,2*(t-1));i[0]=0,i[1]=1;for(var r=2,n=2;t>n;++n)i[r++]=n-1,i[r++]=n;return e.indices=i,e.primitiveType=T.LINES,e}function U(e){var t=p.computeNumberOfVertices(e),i=g.createTypedArray(t,2*t);i[0]=0,i[1]=1;for(var r=2,n=2;t>n;++n)i[r++]=n-1,i[r++]=n;return i[r++]=t-1,i[r]=0,e.indices=i,e.primitiveType=T.LINES,e}function G(e){switch(e.primitiveType){case T.TRIANGLE_FAN:return B(e);case T.TRIANGLE_STRIP:return V(e);case T.TRIANGLES:return F(e);case T.LINE_STRIP:return z(e);case T.LINE_LOOP:return U(e);case T.LINES:return k(e)}return e}function W(e,t){Math.abs(e.y)o?n>a?C.sign(e.y):C.sign(i.y):o>a?C.sign(t.y):C.sign(i.y);var s=0>r;W(e,s),W(t,s),W(i,s)}function q(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),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=xe.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,r?(q(e,t,Ee,we),q(e,i,Se,Te),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(q(t,i,Ee,we),q(t,e,Se,Te),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(q(i,e,Ee,we),q(i,t,Se,Te),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,we),q(i,t,Se,Te),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(q(t,i,Ee,we),q(t,e,Se,Te),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(q(e,t,Ee,we),q(e,i,Se,Te),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=xe.positions;return l[0]=e,l[1]=t,l[2]=i,l.length=3,(1===a||2===a)&&(l[3]=Ee,l[4]=Se,l[5]=we,l[6]=Te,l.length=7),xe}}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=p.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 m({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return new p({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){if(u(l)||u(c)||u(h)||u(d)){var f=n.fromArray(s,3*e,be),v=n.fromArray(s,3*i,Ae),g=n.fromArray(s,3*o,Pe),_=t(a,f,v,g,Ie);if(u(l)){var y=n.fromArray(l,3*e,be),C=n.fromArray(l,3*i,Ae),E=n.fromArray(l,3*o,Pe);n.multiplyByScalar(y,_.x,y),n.multiplyByScalar(C,_.y,C),n.multiplyByScalar(E,_.z,E);var S=n.add(y,C,y);n.add(S,E,S),n.normalize(S,S),n.pack(S,p.normal.values,3*m)}if(u(c)){var w=n.fromArray(c,3*e,be),T=n.fromArray(c,3*i,Ae),x=n.fromArray(c,3*o,Pe);n.multiplyByScalar(w,_.x,w),n.multiplyByScalar(T,_.y,T),n.multiplyByScalar(x,_.z,x);var b=n.add(w,T,w);n.add(b,x,b),n.normalize(b,b),n.pack(b,p.binormal.values,3*m)}if(u(h)){var A=n.fromArray(h,3*e,be),P=n.fromArray(h,3*i,Ae),I=n.fromArray(h,3*o,Pe);n.multiplyByScalar(A,_.x,A),n.multiplyByScalar(P,_.y,P),n.multiplyByScalar(I,_.z,I);var M=n.add(A,P,A);n.add(M,I,M),n.normalize(M,M),n.pack(M,p.tangent.values,3*m)}if(u(d)){var D=r.fromArray(d,2*e,Me),R=r.fromArray(d,2*i,De),O=r.fromArray(d,2*o,Re);r.multiplyByScalar(D,_.x,D),r.multiplyByScalar(R,_.y,R),r.multiplyByScalar(O,_.z,O);var N=r.add(D,R,D);r.add(N,O,N),r.pack(N,p.st.values,2*m)}}}function Q(e,t,i,r,n,o){var a=e.position.values.length/3;if(-1!==n){var s=r[n],l=i[s];return-1===l?(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.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,v=X(s),g=X(s),_=[];_.length=c.length/3;var y=[];for(y.length=c.length/3,a=0;a<_.length;++a)_[a]=-1,y[a]=-1;var C=f.length;for(a=0;C>a;a+=3){ +var E=f[a],S=f[a+1],w=f[a+2],T=n.fromArray(c,3*E),x=n.fromArray(c,3*S),b=n.fromArray(c,3*w),A=j(T,x,b);if(u(A)&&A.positions.length>3)for(var P=A.positions,I=A.indices,M=I.length,D=0;M>D;++D){var R=I[D],O=P[R];O.y<0?(t=g.attributes,i=g.indices,r=_):(t=v.attributes,i=v.indices,r=y),o=Q(t,i,r,f,3>R?a+R:-1,O),K(E,S,w,O,c,h,d,p,m,t,o)}else u(A)&&(T=A.positions[0],x=A.positions[1],b=A.positions[2]),T.y<0?(t=g.attributes,i=g.indices,r=_):(t=v.attributes,i=v.indices,r=y),o=Q(t,i,r,f,a,T),K(E,S,w,T,c,h,d,p,m,t,o),o=Q(t,i,r,f,a+1,x),K(E,S,w,x,c,h,d,p,m,t,o),o=Q(t,i,r,f,a+2,b),K(E,S,w,b,c,h,d,p,m,t,o)}Z(e,g,v)}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;tt;t+=2){var p=a[t],m=a[t+1],f=n.fromArray(o,3*p,be),v=n.fromArray(o,3*m,Ae);Math.abs(f.y)t;t+=4){var E=t,S=t+1,w=t+2,T=t+3,x=n.fromArray(c,3*E,Ve),b=n.fromArray(c,3*S,ke),A=n.fromArray(c,3*w,ze),P=n.fromArray(c,3*T,Ue);Math.abs(x.y)i;++i)I.prevPosition.values.push(h[i]);for(I.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),D.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),i=3*w;3*w+6>i;++i)D.prevPosition.values.push(h[i]);for(i=3*E;3*E+6>i;++i)I.nextPosition.values.push(d[i]);for(I.nextPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),D.nextPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),i=3*w;3*w+6>i;++i)D.nextPosition.values.push(d[i]);var F=r.fromArray(p,2*E,Fe),B=Math.abs(F.y);I.expandAndWidth.values.push(-1,B,1,B),I.expandAndWidth.values.push(-1,-B,1,-B),D.expandAndWidth.values.push(-1,B,1,B),D.expandAndWidth.values.push(-1,-B,1,-B);var V=n.magnitudeSquared(n.subtract(O,x,Ue));if(V/=n.magnitudeSquared(n.subtract(A,x,Ue)),u(f)){var k=o.fromArray(f,4*E,qe),z=o.fromArray(f,4*w,qe),U=C.lerp(k.x,z.x,V),G=C.lerp(k.y,z.y,V),W=C.lerp(k.z,z.z,V),H=C.lerp(k.w,z.w,V);for(i=4*E;4*E+8>i;++i)I.color.values.push(f[i]);for(I.color.values.push(U,G,W,H),I.color.values.push(U,G,W,H),D.color.values.push(U,G,W,H),D.color.values.push(U,G,W,H),i=4*w;4*w+8>i;++i)D.color.values.push(f[i])}if(u(m)){var q=r.fromArray(m,2*E,Fe),j=r.fromArray(m,2*(t+3),Be),Y=C.lerp(q.x,j.x,V);for(i=2*E;2*E+4>i;++i)I.st.values.push(m[i]);for(I.st.values.push(Y,q.y),I.st.values.push(Y,j.y),D.st.values.push(Y,q.y),D.st.values.push(Y,j.y),i=2*w;2*w+4>i;++i)D.st.values.push(m[i])}a=I.position.values.length/3-4,M.push(a,a+2,a+1),M.push(a+1,a+2,a+3),a=D.position.values.length/3-4,R.push(a,a+2,a+1),R.push(a+1,a+2,a+3)}else{var K,Q;for(x.y<0?(K=g.attributes,Q=g.indices):(K=v.attributes,Q=v.indices),K.position.values.push(x.x,x.y,x.z),K.position.values.push(b.x,b.y,b.z),K.position.values.push(A.x,A.y,A.z),K.position.values.push(P.x,P.y,P.z),i=3*t;3*t+12>i;++i)K.prevPosition.values.push(h[i]),K.nextPosition.values.push(d[i]);for(i=2*t;2*t+8>i;++i)K.expandAndWidth.values.push(p[i]),u(m)&&K.st.values.push(m[i]);if(u(f))for(i=4*t;4*t+16>i;++i)K.color.values.push(f[i]);a=K.position.values.length/3-4,Q.push(a,a+2,a+1),Q.push(a+1,a+2,a+3)}}Z(e,g,v)}var te={};te.toWireframe=function(e){var t=e.indices;if(u(t)){switch(e.primitiveType){case T.TRIANGLES:e.indices=A(t);break;case T.TRIANGLE_STRIP:e.indices=P(t);break;case T.TRIANGLE_FAN:e.indices=I(t);break;default:throw new c("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=T.LINES}return e},te.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;a>d;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 f,v=e.boundingSphere;return u(v)&&(f=new i(v.center,v.radius+r)),new p({attributes:{position:new m({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:c})},primitiveType:T.LINES,boundingSphere:f})},te.createAttributeLocations=function(e){var t,i=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],r=e.attributes,n={},o=0,a=i.length;for(t=0;a>t;++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},te.reorderForPreVertexCache=function(e){var t=p.computeNumberOfVertices(e),i=e.indices;if(u(i)){for(var r=new Int32Array(t),n=0;t>n;n++)r[n]=-1;for(var o,a=i,l=a.length,c=g.createTypedArray(t,l),h=0,d=0,m=0;l>h;)o=r[a[h]],-1!==o?c[d]=o:(o=a[h],r[o]=m,c[d]=m,++m),++h,++d;e.indices=c;var f=e.attributes;for(var v in f)if(f.hasOwnProperty(v)&&u(f[v])&&u(f[v].values)){for(var _=f[v],y=_.values,C=0,E=_.componentsPerAttribute,S=s.createTypedArray(_.componentDatatype,m*E);t>C;){var w=r[C];if(-1!==w)for(n=0;E>n;n++)S[E*w+n]=y[E*C+n];++C}_.values=S}}return e},te.reorderForPostVertexCache=function(e,t){var i=e.indices;if(e.primitiveType===T.TRIANGLES&&u(i)){for(var r=i.length,n=0,o=0;r>o;o++)i[o]>n&&(n=i[o]);e.indices=x.tipsify({indices:i,maximumIndex:n,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],i=p.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===T.TRIANGLES?r=3:e.primitiveType===T.LINES?r=2:e.primitiveType===T.POINTS&&(r=1);for(var h=0;c>h;h+=r){for(var d=0;r>d;++d){var m=l[h+d],f=n[m];u(f)||(f=a++,n[m]=f,D(s,e.attributes,m)),o.push(f)}a+r>=C.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=M(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,h=a.values,p=new Float64Array(h.length),f=0,v=0;vc;++c)h.encode(o[c],ne),l[c]=ne.high,u[c]=ne.low;var d=n.componentsPerAttribute;return e.attributes[i]=new m({componentDatatype:s.FLOAT,componentsPerAttribute:d,values:l}),e.attributes[r]=new m({componentDatatype:s.FLOAT,componentsPerAttribute:d,values:u}),delete e.attributes[t],e};var oe=new n,ae=new S,se=new E;te.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.binormal)||u(r.tangent))&&(S.inverse(t,ae),S.transpose(ae,ae),S.getRotation(ae,se),O(se,r.normal),O(se,r.binormal),O(se,r.tangent));var n=e.geometry.boundingSphere;return u(n)&&(e.geometry.boundingSphere=i.transform(n,t,n)),e.modelMatrix=S.clone(S.IDENTITY),e};var le=new n;te.combineInstances=function(e){for(var t=[],i=[],r=e.length,n=0;r>n;++n){var o=e[n];u(o.geometry)?t.push(o):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 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;o>h;h++)l[h]={indexOffset:0,count:0,currentCount:0};var d=0;for(h=0;a>h;h+=3){var p=t[h],f=t[h+1],v=t[h+2],g=3*p,_=3*f,y=3*v;ce.x=r[g],ce.y=r[g+1],ce.z=r[g+2],he.x=r[_],he.y=r[_+1],he.z=r[_+2],de.x=r[y],de.y=r[y+1],de.z=r[y+2],l[p].count++,l[f].count++,l[v].count++,n.subtract(he,ce,he),n.subtract(de,ce,de),u[d]=n.cross(he,de,new n),d++}var C=0;for(h=0;o>h;h++)l[h].indexOffset+=C,C+=l[h].count;d=0;var E;for(h=0;a>h;h+=3){E=l[t[h]];var S=E.indexOffset+E.currentCount;c[S]=d,E.currentCount++,E=l[t[h+1]],S=E.indexOffset+E.currentCount,c[S]=d,E.currentCount++,E=l[t[h+2]],S=E.indexOffset+E.currentCount,c[S]=d,E.currentCount++,d++}var w=new Float32Array(3*o);for(h=0;o>h;h++){var T=3*h;if(E=l[h],E.count>0){for(n.clone(n.ZERO,ue),d=0;dc;c+=3){var f=t[c],v=t[c+1],g=t[c+2];h=3*f,d=3*v,p=3*g;var _=2*f,y=2*v,C=2*g,E=i[h],S=i[h+1],w=i[h+2],T=o[_],x=o[_+1],b=o[y+1]-x,A=o[C+1]-x,P=1/((o[y]-T)*A-(o[C]-T)*b),I=(A*(i[d]-E)-b*(i[p]-E))*P,M=(A*(i[d+1]-S)-b*(i[p+1]-S))*P,D=(A*(i[d+2]-w)-b*(i[p+2]-w))*P;u[h]+=I,u[h+1]+=M,u[h+2]+=D,u[d]+=I,u[d+1]+=M,u[d+2]+=D,u[p]+=I,u[p+1]+=M,u[p+2]+=D}var R=new Float32Array(3*a),O=new Float32Array(3*a);for(c=0;a>c;c++){h=3*c,d=h+1,p=h+2;var N=n.fromArray(r,h,pe),L=n.fromArray(u,h,fe),F=n.dot(N,L);n.multiplyByScalar(N,F,me),n.normalize(n.subtract(L,me,L),L),O[h]=L.x,O[d]=L.y,O[p]=L.z,n.normalize(n.cross(N,L,L),L),R[h]=L.x,R[d]=L.y,R[p]=L.z}return e.attributes.tangent=new m({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:O}),e.attributes.binormal=new m({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:R}),e};var ve=new r,ge=new n,_e=new n,ye=new n;te.compressVertices=function(t){var i=t.attributes.normal,o=t.attributes.st;if(!u(i)&&!u(o))return t;var a,l,c,h,d=t.attributes.tangent,p=t.attributes.binormal;u(i)&&(a=i.values),u(o)&&(l=o.values),u(d)&&(c=d.values),p&&(h=p.values);var f=u(a)?a.length:l.length,v=u(a)?3:2,g=f/v,_=g,y=u(l)&&u(a)?2:1;y+=u(c)||u(h)?1:0,_*=y;for(var C=new Float32Array(_),E=0,S=0;g>S;++S){u(l)&&(r.fromArray(l,2*S,ve),C[E++]=e.compressTextureCoordinates(ve));var w=3*S;u(a)&&u(c)&&u(h)?(n.fromArray(a,w,ge),n.fromArray(c,w,_e),n.fromArray(h,w,ye),e.octPack(ge,_e,ye,ve),C[E++]=ve.x,C[E++]=ve.y):(u(a)&&(n.fromArray(a,w,ge),C[E++]=e.octEncodeFloat(ge)),u(c)&&(n.fromArray(c,w,ge),C[E++]=e.octEncodeFloat(ge)),u(h)&&(n.fromArray(h,w,ge),C[E++]=e.octEncodeFloat(ge)))}return t.attributes.compressedAttributes=new m({componentDatatype:s.FLOAT,componentsPerAttribute:y,values:C}),u(a)&&delete t.attributes.normal,u(l)&&delete t.attributes.st,u(c)&&delete t.attributes.tangent,u(h)&&delete t.attributes.binormal,t};var Ce=new n,Ee=new n,Se=new n,we=new n,Te=new n,xe={positions:new Array(7),indices:new Array(9)},be=new n,Ae=new n,Pe=new n,Ie=new n,Me=new r,De=new r,Re=new r,Oe=w.fromPointNormal(n.ZERO,n.UNIT_Y),Ne=new n,Le=new n,Fe=new r,Be=new r,Ve=new n,ke=new n,ze=new n,Ue=new n,Ge=new n,We=new n,He=new n,qe=new o;return te.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,w.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==v.NONE)switch(t.geometryType){case v.POLYLINES:ee(e);break;case v.TRIANGLES:J(e);break;case v.LINES:$(e)}else G(t),t.primitiveType===T.TRIANGLES?J(e):t.primitiveType===T.LINES&&$(e);return e},te}),i("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E){"use strict";function S(e,r,o){var a=r.vertexFormat,s=r.center,u=r.semiMajorAxis,h=r.semiMinorAxis,m=r.ellipsoid,f=r.stRotation,v=o?e.length/3*2:e.length/3,g=a.st?new Float32Array(2*v):void 0,y=a.normal?new Float32Array(3*v):void 0,E=a.tangent?new Float32Array(3*v):void 0,S=a.binormal?new Float32Array(3*v):void 0,w=0,T=F,x=B,b=V,A=new c(m),P=A.project(m.cartesianToCartographic(s,k),z),R=m.scaleToGeodeticSurface(s,I);m.geodeticSurfaceNormal(R,R);for(var W=C.fromAxisAngle(R,f,L),H=_.fromQuaternion(W,N),q=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,U),j=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,G),Y=e.length,X=o?Y:0,Z=X/3*2,K=0;Y>K;K+=3){var Q=K+1,J=K+2,$=i.fromArray(e,K,I);if(a.st){var ee=_.multiplyByVector(H,$,M),te=A.project(m.cartesianToCartographic(ee,k),D);i.subtract(te,P,te),O.x=(te.x+u)/(2*u),O.y=(te.y+h)/(2*h),q.x=Math.min(O.x,q.x),q.y=Math.min(O.y,q.y),j.x=Math.max(O.x,j.x),j.y=Math.max(O.y,j.y),o&&(g[w+Z]=O.x,g[w+1+Z]=O.y),g[w++]=O.x,g[w++]=O.y}T=m.geodeticSurfaceNormal($,T),(a.normal||a.tangent||a.binormal)&&((a.tangent||a.binormal)&&(x=i.normalize(i.cross(i.UNIT_Z,T,x),x),_.multiplyByVector(H,x,x)),a.normal&&(y[K]=T.x,y[Q]=T.y,y[J]=T.z,o&&(y[K+X]=-T.x,y[Q+X]=-T.y,y[J+X]=-T.z)),a.tangent&&(E[K]=x.x,E[Q]=x.y,E[J]=x.z,o&&(E[K+X]=-x.x,E[Q+X]=-x.y,E[J+X]=-x.z)),a.binormal&&(b=i.normalize(i.cross(T,x,b),b),S[K]=b.x,S[Q]=b.y,S[J]=b.z,o&&(S[K+X]=b.x,S[Q+X]=b.y,S[J+X]=b.z)))}if(a.st){Y=g.length;for(var ie=0;Y>ie;ie+=2)g[ie]=(g[ie]-q.x)/(j.x-q.x),g[ie+1]=(g[ie+1]-q.y)/(j.y-q.y)}var re=new p;if(a.position){var ne=l.raisePositionsToHeight(e,r,o);re.position=new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:ne})}return a.st&&(re.st=new d({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:g})),a.normal&&(re.normal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:y})),a.tangent&&(re.tangent=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E})),a.binormal&&(re.binormal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),re}function w(e){var t,i,r,n,o,a=new Array(12*(e*(e+1))-6),s=0;for(t=0,r=1,n=0;3>n;n++)a[s++]=r++,a[s++]=t,a[s++]=r;for(n=2;e+1>n;++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;i-1>o;++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;i-1>n;++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;i-1>o;++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;3>n;n++)a[s++]=t++,a[s++]=t,a[s++]=r;return a}function T(t){var r=t.center;W=i.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(r,W),t.height,W),W=i.add(r,W,W);var n=new e(W,t.semiMajorAxis),o=l.computeEllipsePositions(t,!0,!1),a=o.positions,s=o.numPts,u=S(a,t,!1),c=w(s);return c=v.createTypedArray(a.length/3,c),{boundingSphere:n,attributes:u,indices:c}}function x(e,r){var o=r.vertexFormat,a=r.center,s=r.semiMajorAxis,l=r.semiMinorAxis,u=r.ellipsoid,h=r.height,m=r.extrudedHeight,f=r.stRotation,v=e.length/3*2,g=new Float64Array(3*v),y=o.st?new Float32Array(2*v):void 0,E=o.normal?new Float32Array(3*v):void 0,S=o.tangent?new Float32Array(3*v):void 0,w=o.binormal?new Float32Array(3*v):void 0,T=0,x=F,b=B,A=V,P=new c(u),W=P.project(u.cartesianToCartographic(a,k),z),H=u.scaleToGeodeticSurface(a,I);u.geodeticSurfaceNormal(H,H);for(var q=C.fromAxisAngle(H,f,L),j=_.fromQuaternion(q,N),Y=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,U),X=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,G),Z=e.length,K=Z/3*2,Q=0;Z>Q;Q+=3){var J,$=Q+1,ee=Q+2,te=i.fromArray(e,Q,I);if(o.st){var ie=_.multiplyByVector(j,te,M),re=P.project(u.cartesianToCartographic(ie,k),D);i.subtract(re,W,re),O.x=(re.x+s)/(2*s),O.y=(re.y+l)/(2*l),Y.x=Math.min(O.x,Y.x),Y.y=Math.min(O.y,Y.y),X.x=Math.max(O.x,X.x),X.y=Math.max(O.y,X.y),y[T+K]=O.x,y[T+1+K]=O.y,y[T++]=O.x,y[T++]=O.y}te=u.scaleToGeodeticSurface(te,te),J=i.clone(te,M),x=u.geodeticSurfaceNormal(te,x);var ne=i.multiplyByScalar(x,h,R);if(te=i.add(te,ne,te),ne=i.multiplyByScalar(x,m,ne),J=i.add(J,ne,J),o.position&&(g[Q+Z]=J.x,g[$+Z]=J.y,g[ee+Z]=J.z,g[Q]=te.x,g[$]=te.y,g[ee]=te.z),o.normal||o.tangent||o.binormal){A=i.clone(x,A);var oe=i.fromArray(e,(Q+3)%Z,R);i.subtract(oe,te,oe);var ae=i.subtract(J,te,D);x=i.normalize(i.cross(ae,oe,x),x),o.normal&&(E[Q]=x.x,E[$]=x.y,E[ee]=x.z,E[Q+Z]=x.x,E[$+Z]=x.y,E[ee+Z]=x.z),o.tangent&&(b=i.normalize(i.cross(A,x,b),b),S[Q]=b.x,S[$]=b.y,S[ee]=b.z,S[Q+Z]=b.x,S[Q+1+Z]=b.y,S[Q+2+Z]=b.z),o.binormal&&(w[Q]=A.x,w[$]=A.y,w[ee]=A.z,w[Q+Z]=A.x,w[$+Z]=A.y,w[ee+Z]=A.z)}}if(o.st){Z=y.length;for(var se=0;Z>se;se+=2)y[se]=(y[se]-Y.x)/(X.x-Y.x),y[se+1]=(y[se+1]-Y.y)/(X.y-Y.y)}var le=new p;return o.position&&(le.position=new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:g})),o.st&&(le.st=new d({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:y})),o.normal&&(le.normal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E})),o.tangent&&(le.tangent=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),o.binormal&&(le.binormal=new d({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:w})),le}function b(e){for(var t=e.length/3,i=v.createTypedArray(t,6*t),r=0,n=0;t>n;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 A(t){var r=t.center,n=t.ellipsoid,o=t.semiMajorAxis,a=i.multiplyByScalar(n.geodeticSurfaceNormal(r,I),t.height,I);H.center=i.add(r,a,H.center),H.radius=o,a=i.multiplyByScalar(n.geodeticSurfaceNormal(r,a),t.extrudedHeight,a),q.center=i.add(r,a,q.center),q.radius=o;var s=l.computeEllipsePositions(t,!0,!0),u=s.positions,c=s.numPts,d=s.outerPositions,p=e.union(H,q),g=S(u,t,!0),_=w(c),C=_.length;_.length=2*C;for(var E=u.length/3,T=0;C>T;T+=3)_[T+C]=_[T+2]+E,_[T+1+C]=_[T+1]+E,_[T+2+C]=_[T]+E;var A=v.createTypedArray(2*E/3,_),P=new h({attributes:g,indices:A,primitiveType:y.TRIANGLES}),M=x(d,t);_=b(d);var D=v.createTypedArray(2*d.length/3,_),R=new h({attributes:M,indices:D,primitiveType:y.TRIANGLES}),O=f.combineInstances([new m({geometry:P}),new m({geometry:R})]);return{boundingSphere:p,attributes:O[0].attributes,indices:O[0].indices}}function P(e){e=o(e,o.EMPTY_OBJECT);var t=e.center,r=o(e.ellipsoid,u.WGS84),n=e.semiMajorAxis,s=e.semiMinorAxis,l=o(e.granularity,g.RADIANS_PER_DEGREE),c=o(e.height,0),h=e.extrudedHeight,d=a(h)&&Math.abs(c-h)>1,p=o(e.vertexFormat,E.DEFAULT);this._center=i.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=u.clone(r),this._rotation=o(e.rotation,0),this._stRotation=o(e.stRotation,0),this._height=c,this._granularity=l,this._vertexFormat=E.clone(p),this._extrudedHeight=o(h,c),this._extrude=d,this._workerName="createEllipseGeometry"}var I=new i,M=new i,D=new i,R=new i,O=new t,N=new _,L=new C,F=new i,B=new i,V=new i,k=new r,z=new i,U=new t,G=new t,W=new i,H=new e,q=new e;P.packedLength=i.packedLength+u.packedLength+E.packedLength+8,P.pack=function(e,t,r){r=o(r,0),i.pack(e._center,t,r),r+=i.packedLength,u.pack(e._ellipsoid,t,r),r+=u.packedLength,E.pack(e._vertexFormat,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};var j=new i,Y=new u,X=new E,Z={center:j,ellipsoid:Y,vertexFormat:X,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0};return P.unpack=function(e,t,r){t=o(t,0);var n=i.unpack(e,t,j);t+=i.packedLength;var s=u.unpack(e,t,Y);t+=u.packedLength;var l=E.unpack(e,t,X);t+=E.packedLength;var c=e[t++],h=e[t++],d=e[t++],p=e[t++],m=e[t++],f=e[t++],v=e[t++],g=1===e[t];return a(r)?(r._center=i.clone(n,r._center),r._ellipsoid=u.clone(s,r._ellipsoid),r._vertexFormat=E.clone(l,r._vertexFormat),r._semiMajorAxis=c,r._semiMinorAxis=h,r._rotation=d,r._stRotation=p,r._height=m,r._granularity=f,r._extrudedHeight=v,r._extrude=g,r):(Z.height=m,Z.extrudedHeight=v,Z.granularity=f,Z.stRotation=p,Z.rotation=d,Z.semiMajorAxis=c,Z.semiMinorAxis=h,new P(Z))},P.createGeometry=function(e){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=A(i)):t=T(i),new h({attributes:t.attributes,indices:t.indices,primitiveType:y.TRIANGLES,boundingSphere:t.boundingSphere})},P.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new P({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:n,stRotation:e._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:E.POSITION_ONLY})},P}),i("Core/CircleGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipseGeometry","./Ellipsoid","./Math","./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 n(r),this._workerName="createCircleGeometry"}l.packedLength=n.packedLength,l.pack=function(e,t,i){n.pack(e._ellipseGeometry,t,i)};var u=new n({center:new e,semiMajorAxis:1,semiMinorAxis:1}),c={center:new e,radius:void 0,ellipsoid:o.clone(o.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,a){var h=n.unpack(t,r,u);return c.center=e.clone(h._center,c.center),c.ellipsoid=o.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(a)?(c.semiMajorAxis=h._semiMajorAxis,c.semiMinorAxis=h._semiMinorAxis,a._ellipseGeometry=new n(c),a):(c.radius=h._semiMajorAxis,new l(c))},l.createGeometry=function(e){return n.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})},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;_=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(n,_),r.height,_),_=t.add(n,_,_);for(var o=new e(_,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;d>f;++f)p[m++]=f,p[m++]=(f+1)%d;return{boundingSphere:o,attributes:l,indices:p}}function f(n){var o=r(n.numberOfVerticalLines,16);o=Math.max(o,0);var s=n.center,l=n.ellipsoid,d=n.semiMajorAxis,p=t.multiplyByScalar(l.geodeticSurfaceNormal(s,g),n.height,g);y.center=t.add(s,p,y.center),y.radius=d,p=t.multiplyByScalar(l.geodeticSurfaceNormal(s,p),n.extrudedHeight,p),C.center=t.add(s,p,C.center),C.radius=d;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 v=e.union(y,C),_=m.length/3,E=h.createTypedArray(_,2*_+2*o);_/=2;var S,w=0;for(S=0;_>S;++S)E[w++]=S,E[w++]=(S+1)%_,E[w++]=S+_,E[w++]=(S+1)%_+_;var T;if(o>0){var x=Math.min(o,_);T=Math.round(_/x)}var b=Math.min(T*o,_);if(o>0)for(S=0;b>S;S+=T)E[w++]=S,E[w++]=S+_;return{boundingSphere:v,attributes:f,indices:E}}function v(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,_=new t,y=new e,C=new e;v.packedLength=t.packedLength+s.packedLength+9,v.pack=function(e,i,o){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};var E=new t,S=new s,w={center:E,ellipsoid:S,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return v.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,E);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++],_=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=_,o):(w.height=d,w.extrudedHeight=m?f:void 0,w.granularity=p,w.rotation=h,w.semiMajorAxis=u,w.semiMinorAxis=c,w.numberOfVerticalLines=_,new v(w))},v.createGeometry=function(e){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})},v}),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){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","./DeveloperError","./Event","./getTimestamp","./JulianDate"],function(e,t,i,r,n,o,a,s){"use strict";function l(n){n=i(n,i.EMPTY_OBJECT);var l=n.startTime,u=!r(l),c=n.stopTime,h=!r(c),d=n.currentTime,p=!r(d);u&&h&&p?(d=s.now(),l=s.clone(d),c=s.addDays(d,1,new s)):u&&h?(l=s.clone(d),c=s.addDays(d,1,new s)):u&&p?(l=s.addDays(c,-1,new s),d=s.clone(l)):p&&h?(d=s.clone(l),c=s.addDays(l,1,new s)):p?d=s.clone(l):h?c=s.addDays(d,1,new s):u&&(l=s.clone(d)),this.startTime=l,this.stopTime=c,this.currentTime=d,this.multiplier=i(n.multiplier,1),this.clockStep=i(n.clockStep,t.SYSTEM_CLOCK_MULTIPLIER),this.clockRange=i(n.clockRange,e.UNBOUNDED),this.canAnimate=i(n.canAnimate,!0),this.shouldAnimate=i(n.shouldAnimate,!0),this.onTick=new o,this._lastSystemTime=a()}return l.prototype.tick=function(){var i=a(),r=s.clone(this.currentTime),n=this.startTime,o=this.stopTime,l=this.multiplier;if(this.canAnimate&&this.shouldAnimate)if(this.clockStep===t.SYSTEM_CLOCK)r=s.now(r);else{if(this.clockStep===t.TICK_DEPENDENT)r=s.addSeconds(r,l,r);else{var u=i-this._lastSystemTime;r=s.addSeconds(r,l*(u/1e3),r)}if(this.clockRange===e.CLAMPED)s.lessThan(r,n)?r=s.clone(n,r):s.greaterThan(r,o)&&(r=s.clone(o,r));else if(this.clockRange===e.LOOP_STOP)for(s.lessThan(r,n)&&(r=s.clone(n,r));s.greaterThan(r,o);)r=s.addSeconds(n,s.secondsDifference(r,o),r)}return this.currentTime=r,this._lastSystemTime=i,this.onTick.raiseEvent(this),r},l}),i("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,t,i){return 0>i&&(i+=1),i>1&&(i-=1),1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?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){return u[0]=e,s.fromBytes(c[0],c[1],c[2],c[3])},s.fromHsl=function(t,i,r,n){t=e(t,0)%1,i=e(i,0),r=e(r,0),n=e(n,1);var o=r,l=r,u=r;if(0!==i){var c;c=.5>r?r*(1+i):r+i-r*i;var h=2*r-c;o=a(h,c,t+1/3),l=a(h,c,t),u=a(h,c,t-1/3)}return new s(o,l,u,n)},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 v=e(i.minimumAlpha,0),g=e(i.maximumAlpha,1);f=v+o.nextRandomNumber()*(g-v)}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){var r=s[i.toUpperCase()];if(t(r))return s.clone(r);var n=h.exec(i);return null!==n?new s(parseInt(n[1],16)/15,parseInt(n[2],16)/15,parseInt(n[3],16)/15):(n=d.exec(i),null!==n?new s(parseInt(n[1],16)/255,parseInt(n[2],16)/255,parseInt(n[3],16)/255):(n=p.exec(i),null!==n?new s(parseFloat(n[1])/("%"===n[1].substr(-1)?100:255),parseFloat(n[2])/("%"===n[2].substr(-1)?100:255),parseFloat(n[3])/("%"===n[3].substr(-1)?100:255),parseFloat(e(n[4],"1.0"))):(n=m.exec(i),null!==n?s.fromHsl(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,parseFloat(e(n[4],"1.0"))):void 0)))},s.packedLength=4,s.pack=function(t,i,r){r=e(r,0),i[r++]=t.red,i[r++]=t.green,i[r++]=t.blue,i[r]=t.alpha},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){return t(e)?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):void 0},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.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/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/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,v=f*f,g=v*f,_=v*v,y=1+f-3*v/4+5*g/4-175*_/64,C=1-f+15*v/8-35*g/8,E=1-3*f+35*v/4,S=1-5*f,w=y*c-C*Math.sin(2*c)*f/2-E*Math.sin(4*c)*v/16-S*Math.sin(6*c)*g/48-5*Math.sin(8*c)*_/512,T=e._constants;T.a=i,T.b=r,T.f=n,T.cosineHeading=o,T.sineHeading=a,T.tanU=s,T.cosineU=l,T.sineU=u,T.sigma=c,T.sineAlpha=h,T.sineSquaredAlpha=d,T.cosineSquaredAlpha=p,T.cosineAlpha=m,T.u2Over4=f,T.u4Over16=v,T.u6Over64=g,T.u8Over256=_,T.a0=y,T.a1=C,T.a2=E,T.a3=S,T.distanceRatio=w}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,v=Math.atan((1-m)*Math.tan(n)),g=Math.atan((1-m)*Math.tan(a)),_=Math.cos(v),y=Math.sin(v),C=Math.cos(g),E=Math.sin(g),S=_*C,w=_*E,T=y*E,x=y*C,b=f,A=s.TWO_PI,P=Math.cos(b),I=Math.sin(b);do{P=Math.cos(b),I=Math.sin(b);var M=w-x*P;h=Math.sqrt(C*C*I*I+M*M),u=T+S*P,l=Math.atan2(h,u);var D;0===h?(D=0,d=1):(D=S*I/h,d=1-D*D),A=b,p=u-2*T/d,isNaN(p)&&(p=0),b=f+c(m,D,d,l,h,u,p)}while(Math.abs(b-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,F=N*h*(p+N*(u*(2*L-1)-N*p*(4*h*h-3)*(4*L-3)/6)/4),B=i*O*(l-F),V=Math.atan2(C*I,w-x*P),k=Math.atan2(_*I,w*P-x);e._distance=B,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,v=n.u8Over256,g=n.u2Over4,_=n.u6Over64,y=n.u4Over16,C=2*f*v*a/3+o*(1-g+7*y/4-15*_/4+579*v/64-(y-15*_/4+187*v/16)*a-(5*_/4-115*v/16)*s-29*v*l/16)+(g/2-y+71*_/32-85*v/16)*u+(5*y/16-5*_/4+383*v/96)*h-m*((_-11*v/2)*u+5*v*h/2)+(29*_/96-29*v/16)*d+539*v*p/1536,E=Math.asin(Math.sin(C)*n.cosineAlpha),S=Math.atan(n.a/n.b*Math.tan(E));C-=n.sigma;var w=Math.cos(2*n.sigma+C),T=Math.sin(C),x=Math.cos(C),b=n.cosineU*x,A=n.sineU*T,P=Math.atan2(T*n.sineHeading,b-A*n.cosineHeading),I=P-c(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,T,x,w);return r(i)?(i.longitude=this._start.longitude+I,i.latitude=S,i.height=0,i):new t(this._start.longitude+I,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=T;r.length=e;var n;if(t===i){for(n=0;e>n;n++)r[n]=t;return r}var o=i-t,a=o/e;for(n=0;e>n;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,I),h=m.numberOfPoints(t,i,r),p=n.cartesianToCartographic(u,x),f=n.cartesianToCartographic(c,b),v=d(h,o,a);M.setEndPoints(p,f);var g=M.surfaceDistance/h,_=l;p.height=o;var y=n.cartographicToCartesian(p,A);e.pack(y,s,_),_+=3;for(var C=1;h>C;C++){var E=M.interpolateUsingSurfaceDistance(C*g,b);E.height=v[C],y=n.cartographicToCartesian(E,A),e.pack(y,s,_),_+=3}return _}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;i>n;n++){var o=e[n];r[n]=t.cartesianToCartographic(o,f).height}return r};var v=new c,g=new e,_=new e,y=new h(e.ZERO,0),C=new e,E=new h(e.ZERO,0),S=new e,w=new e,T=[],x=new t,b=new t,A=new e,P=new e,I=new e,M=new a;m.wrapLongitude=function(t,n){var o=[],a=[];if(r(t)&&t.length>0){n=i(n,c.IDENTITY);var l=c.inverseTransformation(n,v),u=c.multiplyByPoint(l,e.ZERO,g),d=c.multiplyByPointAsVector(l,e.UNIT_Y,_),p=h.fromPointNormal(u,d,y),m=c.multiplyByPointAsVector(l,e.UNIT_X,C),f=h.fromPointNormal(u,m,E),T=1;o.push(e.clone(t[0]));for(var x=o[0],b=t.length,A=1;b>A;++A){var P=t[A];if(h.getPointDistance(f,x)<0||h.getPointDistance(f,P)<0){var I=s.lineSegmentPlane(x,P,p,S);if(r(I)){var M=e.multiplyByScalar(d,5e-9,w);h.getPointDistance(p,x)<0&&e.negate(M,M),o.push(e.add(I,M,new e)),a.push(T+1),e.negate(M,M),o.push(e.add(I,M,new e)),T=1}}o.push(e.clone(t[A])),T++,x=P}a.push(T)}return{positions:o,lengths:a}};var D=u.EPSILON10;return m.removeDuplicates=function(t){var i=t.length;if(2>i)return t;var r,n,o;for(r=1;i>r&&(n=t[r-1],o=t[r],!e.equalsEpsilon(n,o,D));++r);if(r===i)return t;for(var a=t.slice(0,r);i>r;++r)o=t[r],e.equalsEpsilon(n,o,D)||(a.push(e.clone(o)),n=o);return 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);if(1>a)return[];if(1===a){var h=s.scaleToGeodeticSurface(n[0],P);if(0!==c){var d=s.geodeticSurfaceNormal(h,A);e.multiplyByScalar(d,c,d),e.add(h,d,h)}return[h.x,h.y,h.z]}var f=t.minDistance;if(!r(f)){var v=i(t.granularity,u.RADIANS_PER_DEGREE);f=u.chordLength(v,s.maximumRadius)}var g,_=0;for(g=0;a-1>g;g++)_+=m.numberOfPoints(n[g],n[g+1],f);var y=3*(_+1),C=new Array(y),E=0,S=l(c);for(g=0;a-1>g;g++){var w=n[g],b=n[g+1],I=S?c[g]:c,M=S?c[g+1]:c;E=p(w,b,f,s,I,M,C,E)}T.length=0;var D=n[a-1],R=s.cartesianToCartographic(D,x);R.height=S?c[a-1]:c;var O=s.cartographicToCartesian(R,A);return e.pack(O,C,y-3),C},m.generateCartesianArc=function(t){for(var i=m.generateArc(t),r=i.length/3,n=new Array(r),o=0;r>o;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;ro;o++)c[o]=i;return c.push(r),c}var h=r-i,d=h/u;for(o=1;u>o;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);B=s.fromRotationZ(f,B),U.z=a,L=l.multiplyTransformation(L,l.fromRotationTranslation(B,U,F),L);var v=V;v[0]=u;for(var g=0;c>g;g++)for(var _=0;_l;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 _(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;i>s;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 v,g=t.angleBetween(t.subtract(i,e,M),t.subtract(r,e,D)),_=o===n.BEVELED?0:Math.ceil(g/a.toRadians(5));v=l?s.fromQuaternion(c.fromAxisAngle(t.negate(e,M),g/(_+1),W),q):s.fromQuaternion(c.fromAxisAngle(e,g/(_+1),W),q);var y,C;if(i=t.clone(i,H),_>0)for(var E=m?2:1,S=0;_>S;S++)i=s.multiplyByVector(v,i,i),y=t.subtract(i,e,M),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,D),h=f(C,y,d,h,u,p,1,E);else y=t.subtract(i,e,M),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,D),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,D),h=f(C,y,d,h,u,p,1,1);return h}var C=[new t,new t],E=new t,S=new t,w=new t,T=new t,x=new t,b=new t,A=new t,P=new t,I=new t,M=new t,D=new t,R={},O=new r,N=new t(-1,0,0),L=new l,F=new l,B=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;i>o;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,D=s?g(i,r):_(i,r),O=s?_(i,r):void 0,N=r.height/2,L=r.width/2,F=e.length,B=[],V=s?[]:void 0,k=E,z=S,U=w,G=T,W=x,H=b,q=A,j=P,Y=I,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;F-1>ie;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}),B=v(te,j,D,B,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,B,D,$+N,s):(U=t.negate(U,U),B=f(K,U,D,B,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}),B=v(te,j,D,B,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,B,D,$+N,s):B=f(K,U,D,B,l,$+N,se,re),Y=t.clone(q,Y)),z=t.negate(k,z)}else B=f(Y,j,D,B,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}),B=v(te,j,D,B,l,ee,1),s&&(V=f(K,j,O,V,l,$+N,1,1)),F=B.length;var ue=s?F+V.length:F,ce=new Float64Array(ue);return ce.set(B),s&&ce.set(V,F),ce},R}),i("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./isArray","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(i,r,a,s,u){var c=e.angleBetween(e.subtract(r,i,f),e.subtract(a,i,v)),h=s===t.BEVELED?1:Math.ceil(c/n.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 m;m=u?o.fromQuaternion(l.fromAxisAngle(e.negate(i,f),c/h,M),D):o.fromQuaternion(l.fromAxisAngle(i,c/h,M),D);var g=0;r=e.clone(r,f);for(var _=0;h>_;_++)r=o.multiplyByVector(m,r,r),p[g++]=r.x,p[g++]=r.y,p[g++]=r.z;return p}function c(i){var r=C,n=E,o=S,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=u(r,n,o,t.ROUNDED,!1),l=i.length-1,c=i[l-1];a=i[l],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=u(r,n,o,t.ROUNDED,!1);return[s,h]}function h(t,i,r,n){var o=f;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 d(t,i,r,n){for(var o=new Array(t.length),a=new Array(t.length),s=e.multiplyByScalar(i,r,f),l=e.negate(s,v),u=0,c=t.length-1,h=0;hY;Y++){_=l.geodeticSurfaceNormal(H,_),q=o[Y+1],M=e.normalize(e.subtract(q,H,M),M),L=e.normalize(e.add(M,D,L),L);var K=e.multiplyByScalar(_,e.dot(M,_),R);e.subtract(M,K,K),e.normalize(K,K);var Q=e.multiplyByScalar(_,e.dot(D,_),O);e.subtract(D,Q,Q),e.normalize(Q,Q);var J=!n.equalsEpsilon(Math.abs(e.dot(K,Q)),1,n.EPSILON7);if(J){L=e.cross(L,_,L),L=e.cross(_,L,L),L=e.normalize(L,L);var $=m/Math.max(.25,e.magnitude(e.cross(L,D,f))),ee=s.angleIsGreaterThanPi(M,D,H,l);L=e.multiplyByScalar(L,$,L),ee?(V=e.add(H,L,V),z=e.add(V,e.multiplyByScalar(N,m,z),z),k=e.add(V,e.multiplyByScalar(N,2*m,k),k),y[0]=e.clone(B,y[0]),y[1]=e.clone(z,y[1]),j=a.generateArc({positions:y,granularity:r,ellipsoid:l}),U=d(j,N,m,U),g&&(G.push(N.x,N.y,N.z),W.push(_.x,_.y,_.z)),F=e.clone(k,F),N=e.normalize(e.cross(_,M,N),N),k=e.add(V,e.multiplyByScalar(N,2*m,k),k),B=e.add(V,e.multiplyByScalar(N,m,B),B),v===t.ROUNDED||v===t.BEVELED?X.push({leftPositions:u(V,F,k,v,ee)}):X.push({leftPositions:h(H,e.negate(L,L),k,ee)})):(k=e.add(H,L,k),z=e.add(k,e.negate(e.multiplyByScalar(N,m,z),z),z),V=e.add(k,e.negate(e.multiplyByScalar(N,2*m,V),V),V),y[0]=e.clone(B,y[0]),y[1]=e.clone(z,y[1]),j=a.generateArc({positions:y,granularity:r,ellipsoid:l}),U=d(j,N,m,U),g&&(G.push(N.x,N.y,N.z),W.push(_.x,_.y,_.z)),F=e.clone(V,F),N=e.normalize(e.cross(_,M,N),N),V=e.add(k,e.negate(e.multiplyByScalar(N,2*m,V),V),V),B=e.add(k,e.negate(e.multiplyByScalar(N,m,B),B),B),v===t.ROUNDED||v===t.BEVELED?X.push({rightPositions:u(k,F,V,v,ee)}):X.push({rightPositions:h(H,L,V,ee)})),D=e.negate(M,D)}H=q}_=l.geodeticSurfaceNormal(H,_),y[0]=e.clone(B,y[0]),y[1]=e.clone(H,y[1]),j=a.generateArc({positions:y,granularity:r,ellipsoid:l}),U=d(j,N,m,U),g&&(G.push(N.x,N.y,N.z),W.push(_.x,_.y,_.z));var te;return v===t.ROUNDED&&(te=c(U)),{positions:U,corners:X,lefts:G,normals:W,endPositions:te}};var N=new e,L=new e;return m.scaleToGeodeticHeight=function(t,i,n,o){var a=t.length,s=r(o)?o:new Array(t.length);s.length=t.length;for(var l=i,u=0;a>u;u+=3){var c=n.scaleToGeodeticSurface(e.fromArray(t,u,L),L),h=N;0!==i&&(h=n.geodeticSurfaceNormal(c,h),h=e.multiplyByScalar(h,l,h),c=e.add(c,h,c)),s[u]=c.x,s[u+1]=c.y,s[u+2]=c.z}return s},m}),i("Core/CorridorGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v){"use strict";function g(e,i,r,o,a,s){var l=e.normals,u=e.tangents,c=e.binormals,h=t.normalize(t.cross(r,i,I),I);s.normal&&n.addAttribute(l,i,o,a),s.binormal&&n.addAttribute(c,r,o,a),s.tangent&&n.addAttribute(u,h,o,a)}function _(e,r,o){var s,l,u,m=e.positions,f=e.corners,v=e.endPositions,_=e.lefts,y=e.normals,C=new h,E=0,S=0,A=0;for(l=0;ll;l++)k=t.fromArray($,3*(K-1-l),k),V=t.fromArray($,3*(K+l),V),n.addAttribute(U,V,j),n.addAttribute(U,k,void 0,Y),g(q,X,Z,j,Y,r),L=j/3,B=L+1,N=(Y-2)/3,F=N-1,Q[J++]=N,Q[J++]=L,Q[J++]=F,Q[J++]=F,Q[J++]=L,Q[J++]=B,j+=3,Y-=3}var ee=0,te=0,ie=m[ee++],re=m[ee++];U.set(ie,j),U.set(re,Y-re.length+1),Z=t.fromArray(_,te,Z);var ne,oe;for(u=re.length-3,l=0;u>l;l+=3)ne=o.geodeticSurfaceNormal(t.fromArray(ie,l,I),I),oe=o.geodeticSurfaceNormal(t.fromArray(re,u-l,M),M),X=t.normalize(t.add(ne,oe,X),X),g(q,X,Z,j,Y,r),L=j/3,B=L+1,N=(Y-2)/3,F=N-1,Q[J++]=N,Q[J++]=L,Q[J++]=F,Q[J++]=F,Q[J++]=L,Q[J++]=B,j+=3,Y-=3;for(ne=o.geodeticSurfaceNormal(t.fromArray(ie,u,I),I),oe=o.geodeticSurfaceNormal(t.fromArray(re,u,M),M),X=t.normalize(t.add(ne,oe,X),X),te+=3,l=0;ll;l++)k=t.fromArray(me,3*(R-l-1),k),V=t.fromArray(me,3*l,V),n.addAttribute(U,k,void 0,Y),n.addAttribute(U,V,j),g(q,X,Z,j,Y,r),B=j/3,L=B-1,F=(Y-2)/3,N=F+1,Q[J++]=N,Q[J++]=L,Q[J++]=F,Q[J++]=F,Q[J++]=L,Q[J++]=B,j+=3,Y-=3}if(C.position=new c({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:U}),r.st){var fe,ve,ge=new Float32Array(z/3*2),_e=0;if(O){E/=3,S/=3;var ye=Math.PI/(R+1);ve=1/(E-R+1),fe=1/(S-R+1);var Ce,Ee=R/2;for(l=Ee+1;R+1>l;l++)Ce=p.PI_OVER_TWO+ye*l,ge[_e++]=fe*(1+Math.cos(Ce)),ge[_e++]=.5*(1+Math.sin(Ce));for(l=1;S-R+1>l;l++)ge[_e++]=l*fe,ge[_e++]=0;for(l=R;l>Ee;l--)Ce=p.PI_OVER_TWO-l*ye,ge[_e++]=1-fe*(1+Math.cos(Ce)),ge[_e++]=.5*(1+Math.sin(Ce));for(l=Ee;l>0;l--)Ce=p.PI_OVER_TWO-ye*l,ge[_e++]=1-ve*(1+Math.cos(Ce)),ge[_e++]=.5*(1+Math.sin(Ce));for(l=E-R;l>0;l--)ge[_e++]=l*ve,ge[_e++]=1;for(l=1;Ee+1>l;l++)Ce=p.PI_OVER_TWO+ye*l,ge[_e++]=ve*(1+Math.cos(Ce)),ge[_e++]=.5*(1+Math.sin(Ce))}else{for(E/=3,S/=3,ve=1/(E-1),fe=1/(S-1),l=0;S>l;l++)ge[_e++]=l*fe,ge[_e++]=0;for(l=E;l>0;l--)ge[_e++]=(l-1)*ve,ge[_e++]=1}C.st=new c({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:ge})}return r.normal&&(C.normal=new c({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:q.normals})),r.tangent&&(C.tangent=new c({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:q.tangents})),r.binormal&&(C.binormal=new c({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:q.binormals})),{attributes:C,indices:Q}}function y(e,i){if(!(i.normal||i.binormal||i.tangent||i.st))return e;var r,o,a=e.position.values;(i.normal||i.binormal)&&(r=e.normal.values,o=e.binormal.values);var s,l=e.position.values.length/18,u=3*l,c=2*l,h=2*u;if(i.normal||i.binormal||i.tangent){var d=i.normal?new Float32Array(6*u):void 0,p=i.binormal?new Float32Array(6*u):void 0,m=i.tangent?new Float32Array(6*u):void 0,f=w,v=T,g=x,_=b,y=A,C=P,E=h;for(s=0;u>s;s+=3){var S=E+h;f=t.fromArray(a,s,f),v=t.fromArray(a,s+u,v),g=t.fromArray(a,(s+3)%u,g),v=t.subtract(v,f,v),g=t.subtract(g,f,g),_=t.normalize(t.cross(v,g,_),_),i.normal&&(n.addAttribute(d,_,S),n.addAttribute(d,_,S+3),n.addAttribute(d,_,E),n.addAttribute(d,_,E+3)),(i.tangent||i.binormal)&&(C=t.fromArray(r,s,C),i.binormal&&(n.addAttribute(p,C,S),n.addAttribute(p,C,S+3),n.addAttribute(p,C,E),n.addAttribute(p,C,E+3)),i.tangent&&(y=t.normalize(t.cross(C,_,y),y),n.addAttribute(m,y,S),n.addAttribute(m,y,S+3),n.addAttribute(m,y,E),n.addAttribute(m,y,E+3))),E+=6}if(i.normal){for(d.set(r),s=0;u>s;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(i.binormal?(p.set(o),p.set(o,u),e.binormal.values=p):e.binormal=void 0,i.tangent){var I=e.tangent.values;m.set(I),m.set(I,u),e.tangent.values=m}}if(i.st){var M=e.st.values,D=new Float32Array(6*c);D.set(M),D.set(M,c);for(var R=2*c,O=0;2>O;O++){for(D[R++]=M[0],D[R++]=M[1],s=2;c>s;s+=2){var N=M[s],L=M[s+1];D[R++]=N,D[R++]=L,D[R++]=N,D[R++]=L}D[R++]=M[0],D[R++]=M[1]}e.st.values=D}return e}function C(e,t,i){i[t++]=e[0],i[t++]=e[1],i[t++]=e[2];for(var r=3;rE;E+=3){var b=c[E],A=c[E+1],P=c[E+2];T[x++]=P+p,T[x++]=A+p,T[x++]=b+p}u=y(u,t);var I,M,D,R;for(E=0;w>E;E+=2)I=E+w,M=I+w,D=I+1,R=M+1,T[x++]=I,T[x++]=M,T[x++]=D,T[x++]=D,T[x++]=M,T[x++]=R;return{attributes:u,indices:T}}function S(e){e=o(e,o.EMPTY_OBJECT);var i=e.positions,n=e.width;this._positions=i,this._ellipsoid=l.clone(o(e.ellipsoid,l.WGS84)),this._vertexFormat=v.clone(o(e.vertexFormat,v.DEFAULT)),this._width=n,this._height=o(e.height,0),this._extrudedHeight=o(e.extrudedHeight,this._height),this._cornerType=o(e.cornerType,r.ROUNDED),this._granularity=o(e.granularity,p.RADIANS_PER_DEGREE),this._workerName="createCorridorGeometry",this.packedLength=1+i.length*t.packedLength+l.packedLength+v.packedLength+5}var w=new t,T=new t,x=new t,b=new t,A=new t,P=new t,I=new t,M=new t;S.pack=function(e,i,r){r=o(r,0);var n=e._positions,a=n.length;i[r++]=a;for(var s=0;a>s;++s,r+=t.packedLength)t.pack(n[s],i,r);l.pack(e._ellipsoid,i,r),r+=l.packedLength,v.pack(e._vertexFormat,i,r),r+=v.packedLength,i[r++]=e._width,i[r++]=e._height,i[r++]=e._extrudedHeight,i[r++]=e._cornerType,i[r]=e._granularity};var D=l.clone(l.UNIT_SPHERE),R=new v,O={positions:void 0,ellipsoid:D,vertexFormat:R,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return S.unpack=function(e,i,r){i=o(i,0);for(var n=e[i++],s=new Array(n),u=0;n>u;++u,i+=t.packedLength)s[u]=t.unpack(e,i);var c=l.unpack(e,i,D);i+=l.packedLength;var h=v.unpack(e,i,R);i+=v.packedLength;var d=e[i++],p=e[i++],m=e[i++],f=e[i++],g=e[i];return a(r)?(r._positions=s,r._ellipsoid=l.clone(c,r._ellipsoid),r._vertexFormat=v.clone(h,r._vertexFormat),r._width=d,r._height=p,r._extrudedHeight=m,r._cornerType=f,r._granularity=g,r):(O.positions=s,O.width=d,O.height=p,O.extrudedHeight=m,O.cornerType=f,O.granularity=g,new S(O))},S.createGeometry=function(t){var i=t._positions,r=t._height,o=t._extrudedHeight,a=r!==o,s=m.removeDuplicates(i);if(!(s.length<2)){var l,c=t._ellipsoid,h=t._vertexFormat,d={ellipsoid:c,positions:s,width:t._width,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!0};if(a){var p=Math.max(r,o);o=Math.min(r,o),r=p,d.height=r,d.extrudedHeight=o,l=E(d,h)}else{var v=n.computePositions(d);l=_(v,h,c),l.attributes.position.values=n.scaleToGeodeticHeight(l.attributes.position.values,r,c,l.attributes.position.values)}var g=l.attributes,y=e.fromVertices(g.position.values,void 0,3);return h.position||(l.attributes.position.values=void 0),new u({attributes:g,indices:l.indices,primitiveType:f.TRIANGLES,boundingSphere:y})}},S.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new S({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:n,granularity:r,extrudedHeight:o,height:a,vertexFormat:v.POSITION_ONLY})},S}),i("Core/CorridorOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./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,f){"use strict";function v(e,o){var s,l,u,p=[],m=e.positions,f=e.corners,v=e.endPositions,g=new h,_=0,S=0,w=0;for(l=0;ll;l++)R=t.fromArray(z,3*(B-1-l),R),D=t.fromArray(z,3*(B+l),D),n.addAttribute(N,D,L),n.addAttribute(N,R,void 0,F),P=L/3,M=P+1,A=(F-2)/3,I=A-1,V[k++]=A,V[k++]=I,V[k++]=P,V[k++]=M,L+=3,F-=3}var U=0,G=m[U++],W=m[U++];for(N.set(G,L),N.set(W,F-W.length+1),u=W.length-3,p.push(L/3,(F-2)/3),l=0;u>l;l+=3)P=L/3,M=P+1,A=(F-2)/3,I=A-1,V[k++]=A,V[k++]=I,V[k++]=P,V[k++]=M,L+=3,F-=3;for(l=0;ll;l++)R=t.fromArray(Z,3*(x-l-1),R),D=t.fromArray(Z,3*l,D),n.addAttribute(N,R,void 0,F),n.addAttribute(N,D,L),M=L/3,P=M-1,I=(F-2)/3,A=I+1,V[k++]=A,V[k++]=I,V[k++]=P,V[k++]=M,L+=3,F-=3;p.push(L/3)}else p.push(L/3,(F-2)/3);return V[k++]=L/3,V[k++]=(F-2)/3,g.position=new c({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:N}),{attributes:g,indices:V,wallIndices:p}}function g(e){var t=e.ellipsoid,i=n.computePositions(e),r=v(i,e.cornerType),o=r.wallIndices,a=e.height,s=e.extrudedHeight,l=r.attributes,u=r.indices,c=l.position.values,h=c.length,p=new Float64Array(h);p.set(c);var m=new Float64Array(2*h);c=n.scaleToGeodeticHeight(c,a,t,c),p=n.scaleToGeodeticHeight(p,s,t,p),m.set(c),m.set(p,h),l.position.values=m,h/=3;var f,g=u.length,_=d.createTypedArray(m.length/3,2*(g+o.length));_.set(u);var y=g;for(f=0;g>f;f+=2){var C=u[f],E=u[f+1];_[y++]=C+h,_[y++]=E+h}var S,w;for(f=0;fs;++s,r+=t.packedLength)t.pack(n[s],i,r);l.pack(e._ellipsoid,i,r),r+=l.packedLength,i[r++]=e._width,i[r++]=e._height,i[r++]=e._extrudedHeight,i[r++]=e._cornerType,i[r]=e._granularity};var S=l.clone(l.UNIT_SPHERE),w={positions:void 0,ellipsoid:S,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return _.unpack=function(e,i,r){i=o(i,0);for(var n=e[i++],s=new Array(n),u=0;n>u;++u,i+=t.packedLength)s[u]=t.unpack(e,i);var c=l.unpack(e,i,S);i+=l.packedLength;var h=e[i++],d=e[i++],p=e[i++],m=e[i++],f=e[i];return a(r)?(r._positions=s,r._ellipsoid=l.clone(c,r._ellipsoid),r._width=h,r._height=d,r._extrudedHeight=p,r._cornerType=m,r._granularity=f,r):(w.positions=s,w.width=h,w.height=d,w.extrudedHeight=p,w.cornerType=m,w.granularity=f,new _(w))},_.createGeometry=function(t){var i=t._positions,r=t._height,o=t._extrudedHeight,a=r!==o,s=m.removeDuplicates(i);if(!(s.length<2)){var l,c=t._ellipsoid,h={ellipsoid:c,positions:s,width:t._width,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!1};if(a){var d=Math.max(r,o);o=Math.min(r,o),r=d,h.height=r,h.extrudedHeight=o,l=g(h)}else{var p=n.computePositions(h);l=v(p,h.cornerType),l.attributes.position.values=n.scaleToGeodeticHeight(l.attributes.position.values,r,c,l.attributes.position.values)}var _=l.attributes,y=e.fromVertices(_.position.values,void 0,3);return new u({attributes:_,indices:l.indices,primitiveType:f.LINES,boundingSphere: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;n>a;a++){var v=a/n*e.TWO_PI,g=Math.cos(v),_=Math.sin(v),y=g*r,C=_*r,E=g*i,S=_*i;h[p+m]=y,h[p+m+1]=C,h[p+m+2]=l,h[p+f]=E,h[p+f+1]=S,h[p+f+2]=s,p+=3,o&&(h[d++]=y,h[d++]=C,h[d++]=l,h[d++]=E,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 v=new t,g=new i,_=new i,y=new i,C=new i;f.packedLength=m.packedLength+4,f.pack=function(e,t,i){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};var E=new m,S={vertexFormat:E,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,E);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,s=o._length,m=o._topRadius,f=o._bottomRadius,E=o._vertexFormat,S=o._slices,w=S+S,T=S+w,x=w+w,b=n.computePositions(s,m,f,S,!0),A=E.st?new Float32Array(2*x):void 0,P=E.normal?new Float32Array(3*x):void 0,I=E.tangent?new Float32Array(3*x):void 0,M=E.binormal?new Float32Array(3*x):void 0,D=E.normal||E.tangent||E.binormal;if(D){var R=E.tangent||E.binormal,O=0,N=0,L=0,F=g;F.z=0;var B=y,V=_;for(a=0;S>a;a++){var k=a/S*d.TWO_PI,z=Math.cos(k),U=Math.sin(k);D&&(F.x=z,F.y=U,R&&(B=i.normalize(i.cross(i.UNIT_Z,F,B),B)),E.normal&&(P[O++]=z,P[O++]=U,P[O++]=0,P[O++]=z,P[O++]=U,P[O++]=0),E.tangent&&(I[N++]=B.x,I[N++]=B.y,I[N++]=B.z,I[N++]=B.x,I[N++]=B.y,I[N++]=B.z),E.binormal&&(V=i.normalize(i.cross(F,B,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(a=0;S>a;a++)E.normal&&(P[O++]=0,P[O++]=0,P[O++]=-1),E.tangent&&(I[N++]=1,I[N++]=0,I[N++]=0),E.binormal&&(M[L++]=0,M[L++]=-1,M[L++]=0);for(a=0;S>a;a++)E.normal&&(P[O++]=0,P[O++]=0,P[O++]=1),E.tangent&&(I[N++]=1,I[N++]=0,I[N++]=0),E.binormal&&(M[L++]=0,M[L++]=1,M[L++]=0)}var G=12*S-12,W=h.createTypedArray(x,G),H=0,q=0;for(a=0;S-1>a;a++)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++]=w-2,W[H++]=0,W[H++]=1,W[H++]=w-2,W[H++]=1,W[H++]=w-1,a=1;S-1>a;a++)W[H++]=w+a+1,W[H++]=w+a,W[H++]=w;for(a=1;S-1>a;a++)W[H++]=T,W[H++]=T+a,W[H++]=T+a+1;var j=0;if(E.st){var Y=Math.max(m,f);for(a=0;x>a;a++){var X=i.fromArray(b,3*a,C);A[j++]=(X.x+Y)/(2*Y),A[j++]=(X.y+Y)/(2*Y)}}var Z=new c;E.position&&(Z.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:b})),E.normal&&(Z.normal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:P})),E.tangent&&(Z.tangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:I})),E.binormal&&(Z.binormal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:M})),E.st&&(Z.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:A})),v.x=.5*s,v.y=Math.max(f,m);var K=new e(i.ZERO,t.magnitude(v));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){i=o(i,0),t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i++]=e._slices,t[i]=e._numberOfVerticalLines};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,s=o._length,p=o._topRadius,f=o._bottomRadius,v=o._slices,g=o._numberOfVerticalLines,_=2*v,y=n.computePositions(s,p,f,v,!1),C=2*v;if(g>0){var E=Math.min(g,v);a=Math.round(v/E),C+=E}for(var S=h.createTypedArray(_,2*C),w=0,T=0;v-1>T;T++)S[w++]=T,S[w++]=T+1,S[w++]=T+v,S[w++]=T+1+v;if(S[w++]=v-1,S[w++]=0,S[w++]=v+v-1,S[w++]=v,g>0)for(T=0;v>T;T+=a)S[w++]=T,S[w++]=T+v;var x=new c;x.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:y}),m.x=.5*s,m.y=Math.max(f,p);var b=new e(i.ZERO,t.magnitude(m));return new l({attributes:x,indices:S,primitiveType:d.LINES,boundingSphere:b})},p}),i("Core/DefaultProxy",[],function(){"use strict";function e(e){this.proxy=e}return e.prototype.getURL=function(e){return this.proxy+"?"+encodeURIComponent(e)},e}),i("Core/deprecationWarning",["./defined","./DeveloperError"],function(e,t){"use strict";function i(t,i){e(r[t])||(r[t]=!0,console.log(i))}var r={};return i}),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);-1!==i&&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();ie;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 v=e,this},this.onUpdate=function(e){return _=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(d>e)return!0;g===!1&&(null!==v&&v.call(i),g=!0);var u=(e-d)/a;u=u>1?1:u;var C=p(u);for(t in n){var E=r[t]||0,S=n[t];S instanceof Array?i[t]=m(S,C):("string"==typeof S&&(S=E+parseFloat(S,10)),"number"==typeof S&&(i[t]=E+(S-E)*C))}if(null!==_&&_.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 w=o[t];o[t]=n[t],n[t]=w}r[t]=o[t]}return l&&(c=!c),d=e+h,!0}null!==y&&y.call(i);for(var T=0,x=f.length;x>T;T++)f[T].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||1>i?(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||1>i?(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||1>i?(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 1/2.75>e?7.5625*e*e:2/2.75>e?7.5625*(e-=1.5/2.75)*e+.75:2.5/2.75>e?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(t){return.5>t?.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 0>i?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;o>=r;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]?(0>i&&(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)):0>i?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[o+1>r?r:o+1],t[o+2>r?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,E),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 v=new i,g=new i,_=new i,y=new i,C=new i,E=new i(1,1,1),S=Math.cos,w=Math.sin;f.packedLength=i.packedLength+m.packedLength+2,f.pack=function(e,t,r){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};var T=new i,x=new m,b={radii:T,vertexFormat:x,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(e,t,r){t=n(t,0);var a=i.unpack(e,t,T);t+=i.packedLength;var s=m.unpack(e,t,x);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):(b.stackPartitions=l,b.slicePartitions=u,new f(b))},f.createGeometry=function(n){var o,a,m=n._radii,f=s.fromCartesian3(m),E=n._vertexFormat,T=n._slicePartitions+1,x=n._stackPartitions+1,b=x*T,A=new Float64Array(3*b),P=6*(T-1)*(x-1),I=h.createTypedArray(b,P),M=E.normal?new Float32Array(3*b):void 0,D=E.tangent?new Float32Array(3*b):void 0,R=E.binormal?new Float32Array(3*b):void 0,O=E.st?new Float32Array(2*b):void 0,N=new Array(T),L=new Array(T),F=0;for(o=0;T>o;o++){var B=d.TWO_PI*o/(T-1);N[o]=S(B),L[o]=w(B),A[F++]=0,A[F++]=0,A[F++]=m.z}for(o=1;x-1>o;o++){var V=Math.PI*o/(x-1),k=w(V),z=m.x*k,U=m.y*k,G=m.z*S(V);for(a=0;T>a;a++)A[F++]=N[a]*z,A[F++]=L[a]*U,A[F++]=G}for(o=0;T>o;o++)A[F++]=0,A[F++]=0,A[F++]=-m.z;var W=new c;E.position&&(W.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:A}));var H=0,q=0,j=0,Y=0;if(E.st||E.normal||E.tangent||E.binormal){for(o=0;b>o;o++){var X=i.fromArray(A,3*o,v),Z=f.geodeticSurfaceNormal(X,g);if(E.st){var K=t.negate(Z,C);t.magnitude(K)A.length&&(F=3*(o-T*Math.floor(.5*x))),i.fromArray(A,F,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(E.normal&&(M[q++]=Z.x,M[q++]=Z.y,M[q++]=Z.z),E.tangent||E.binormal){var Q=_;if(T>o||o>b-T-1?(i.cross(i.UNIT_X,Z,Q),i.normalize(Q,Q)):(i.cross(i.UNIT_Z,Z,Q),i.normalize(Q,Q)),E.tangent&&(D[j++]=Q.x,D[j++]=Q.y,D[j++]=Q.z),E.binormal){var J=i.cross(Z,Q,y);i.normalize(J,J),R[Y++]=J.x,R[Y++]=J.y,R[Y++]=J.z}}}E.st&&(W.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:O})),E.normal&&(W.normal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:M})),E.tangent&&(W.tangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:D})),E.binormal&&(W.binormal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R}))}for(F=0,o=0;x>o;o++){var $=o*T,ee=(o+1)*T;for(a=0;T-1>a;a++)I[F++]=ee+a,I[F++]=ee+a+1,I[F++]=$+a+1,I[F++]=ee+a,I[F++]=$+a+1,I[F++]=$+a}return new l({attributes:W,indices:I,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,v=Math.sin;p.packedLength=t.packedLength+3,p.pack=function(e,i,n){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};var g=new t,_={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):(_.stackPartitions=s,_.slicePartitions=l,_.subdivisions=u,new p(_))},p.createGeometry=function(t){var r,n,o,p,m,g,_=t._radii,y=a.fromCartesian3(_),C=t._stackPartitions,E=t._slicePartitions,S=t._subdivisions,w=S*(C+E-1),T=w-E+2,x=new Float64Array(3*T),b=c.createTypedArray(T,2*w),A=0,P=new Array(S),I=new Array(S);for(r=0;S>r;r++)o=h.TWO_PI*r/S,P[r]=f(o),I[r]=v(o);for(r=1;C>r;r++)for(p=Math.PI*r/C,m=f(p),g=v(p),n=0;S>n;n++)x[A++]=_.x*P[n]*g,x[A++]=_.y*I[n]*g,x[A++]=_.z*m;for(P.length=E,I.length=E,r=0;E>r;r++)o=h.TWO_PI*r/E,P[r]=f(o),I[r]=v(o);for(x[A++]=0,x[A++]=0,x[A++]=_.z,r=1;S>r;r++)for(p=Math.PI*r/S,m=f(p),g=v(p),n=0;E>n;n++)x[A++]=_.x*P[n]*g,x[A++]=_.y*I[n]*g,x[A++]=_.z*m;for(x[A++]=0,x[A++]=0,x[A++]=-_.z,A=0,r=0;C-1>r;++r){var M=r*S;for(n=0;S-1>n;++n)b[A++]=M+n,b[A++]=M+n+1;b[A++]=M+S-1,b[A++]=M}var D=S*(C-1);for(n=1;E+1>n;++n)b[A++]=D,b[A++]=D+n;for(r=0;S-2>r;++r){var R=r*E+1+D,O=(r+1)*E+1+D;for(n=0;E-1>n;++n)b[A++]=O+n,b[A++]=R+n;b[A++]=O+E-1,b[A++]=R+E-1}var N=x.length/3-1;for(n=N-1;n>N-E-1;--n)b[A++]=N,b[A++]=n;var L=new u({position:new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:x})});return new s({attributes:L,indices:b,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<t;++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/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","./definedNotNull","./DeveloperError"],function(e,t,i){"use strict";function r(i,r){var n="",o=i.lastIndexOf("/");return-1!==o&&(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-1!==n&&(r=r.substr(n+1)),n=r.lastIndexOf("."),r=-1===n?"":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-1!==n&&(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;i>r;++r)t+=String.fromCharCode(e[r]);return t},"undefined"!=typeof TextDecoder?r.decode=r.decodeWithTextDecoder:r.decode=r.decodeWithFromCharCode,r}),i("Core/getMagic",["../Core/defaultValue","../Core/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){return t(e)?(t(r)||(r=new i),r.heading=e.heading,r.pitch=e.pitch,r.range=e.range,r):void 0},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;o>l;l++){for(s=!1,u=0;ul;l++){for(s=!1,u=0;ud;d++){var p=Math.floor(d*h);for(s=0;c>s;s++)l=t[s]*o*(a+1)+d,e[p+s]=n[l];for(var m=1;c>m;m++){var f=0,v=Math.floor(m*(1-m)/2)+c*m,g=!1;for(s=0;c-m>s;s++){var _,y,C=i[t[s]],E=i[t[s+m]];if(0>=E-C)l=t[s]*o*(a+1)+o*m+d,_=n[l],y=_/r.factorial(m),e[p+v+f]=y,f++;else{var S=Math.floor((m-1)*(2-m)/2)+c*(m-1);_=e[p+S+s+1]-e[p+S+s],y=_/(E-C),e[p+v+f]=y,f++}g=g||0!==_}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;o>l;l++){s[l]=0;var v=new Array(m);for(f[l]=v,u=0;m>u;u++)v[u]=[]}var g=m,_=new Array(g);for(l=0;g>l;l++)_[l]=l;var y=m-1;for(h=0;o>h;h++){for(u=0;g>u;u++)p=_[u]*o+h,f[h][0].push(r[p]);for(l=1;g>l;l++){var C=!1;for(u=0;g-l>u;u++){var E,S=i[_[u]],w=i[_[u+l]];0>=w-S?(p=_[u]*o+o*l+h,E=r[p],f[h][l].push(E/a(l))):(E=f[h][l-1][u+1]-f[h][l-1][u],f[h][l].push(E/(w-S))),C=C||0!==E}C||(y=l-1)}}for(c=0,d=0;d>=c;c++)for(l=c;y>=l;l++){var T=n(e,_,i,c,l,[]);for(h=0;o>h;h++){var x=f[h][l][0];s[h+c*o]+=x*T}}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;h>d;d++)c[d]=0;for(var p=i.length,m=new Array(p*(s+1)),f=0;p>f;f++)for(var v=0;s+1>v;v++)m[f*(s+1)+v]=f;for(var g=m.length,_=l,y=o(_,m,i,r,a,s),C=[],E=g*(g+1)/2,S=Math.min(y,u),w=0;S>=w;w++)for(f=w;y>=f;f++){C.length=0;for(var T=n(e,m,i,w,f,C),x=Math.floor(f*(1-f)/2)+g*f,b=0;a>b;b++){var A=Math.floor(b*E),P=_[A+x];c[b+w*a]+=P*T}}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,v=1.7484877,g=-.1589763,_=.0036096,y=.1643573,C=12.9590088,E=new i;return o.ComputeMoon=function(o,S){e(o)||(o=i.now()),E=i.addSeconds(o,a,E);var w=i.totalDays(E)-s,T=w/n.DAYS_PER_JULIAN_CENTURY,x=(125.045+l*w)*r.RADIANS_PER_DEGREE,b=(250.089+u*w)*r.RADIANS_PER_DEGREE,A=(260.008+c*w)*r.RADIANS_PER_DEGREE,P=(176.625+h*w)*r.RADIANS_PER_DEGREE,I=(357.529+d*w)*r.RADIANS_PER_DEGREE,M=(311.589+p*w)*r.RADIANS_PER_DEGREE,D=(134.963+m*w)*r.RADIANS_PER_DEGREE,R=(276.617+f*w)*r.RADIANS_PER_DEGREE,O=(34.226+v*w)*r.RADIANS_PER_DEGREE,N=(15.134+g*w)*r.RADIANS_PER_DEGREE,L=(119.743+_*w)*r.RADIANS_PER_DEGREE,F=(239.961+y*w)*r.RADIANS_PER_DEGREE,B=(25.053+C*w)*r.RADIANS_PER_DEGREE,V=Math.sin(x),k=Math.sin(b),z=Math.sin(A),U=Math.sin(P),G=Math.sin(I),W=Math.sin(M),H=Math.sin(D),q=Math.sin(R),j=Math.sin(O),Y=Math.sin(N),X=Math.sin(L),Z=Math.sin(F),K=Math.sin(B),Q=Math.cos(x),J=Math.cos(b),$=Math.cos(A),ee=Math.cos(P),te=Math.cos(I),ie=Math.cos(M),re=Math.cos(D),ne=Math.cos(R),oe=Math.cos(O),ae=Math.cos(N),se=Math.cos(L),le=Math.cos(F),ue=Math.cos(B),ce=(269.9949+.0031*T-3.8787*V-.1204*k+.07*z-.0172*U+.0072*W-.0052*Y+.0043*K)*r.RADIANS_PER_DEGREE,he=(66.5392+.013*T+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*w-1.4e-12*w*w+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*w)+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*v+.0052*ae*g+.004*se*_+.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),v=o.multiply(f,c,c);return v},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 0>e||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){return t(e)?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):void 0},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,v=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&&v||!o.equals(c,l)&&v,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:0>i&&0>r},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;n>a;a++)o[a]=0;for(a=0;l>a;a++){var u=1;for(s=0;l>s;s++)if(s!==a){var c=i[a]-i[s];u*=(t-i[s])/c}for(s=0;n>s;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;n>a;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","./defined"],function(e,t){"use strict";function i(i,r){return e({url:i,responseType:"blob",headers:t(r)?r.headers:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return i}),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,{allowCrossOrigin:!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,o){return n.test(r)?i(r):t(r,o).then(function(t){var r=window.URL.createObjectURL(t);return i(r,{allowCrossOrigin:!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(t){return!1}}();return o?r:i}),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;s>a;++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;a>o;++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(t){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/loadXML",["./loadWithXhr","./defined"],function(e,t){"use strict";function i(i,r){return e({url:i,responseType:"document",headers:t(r)?r.headers:void 0,overrideMimeType:"text/xml",withCredentials:t(r)?r.withCredentials:void 0})}return i}),i("Core/MapboxApi",["./defined"],function(e){"use strict";var t={};t.defaultAccessToken=void 0;var i=!1;return t.getAccessToken=function(r){return e(r)?r:e(t.defaultAccessToken)?t.defaultAccessToken:(i||(console.log("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."),i=!0),"pk.eyJ1IjoiYW5hbHl0aWNhbGdyYXBoaWNzIiwiYSI6IjA2YzBjOTM3YzFlYzljYmQ5NDAxZWI1Y2ZjNzZlM2E1In0.vDZL2SPFEpi_f7ziAIP_yw")},t}),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","./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r,n){"use strict";function o(e,i,r,n){this[0]=t(e,0),this[1]=t(r,0),this[2]=t(i,0),this[3]=t(n,0)}o.packedLength=4,o.pack=function(e,i,r){r=t(r,0),i[r++]=e[0],i[r++]=e[1],i[r++]=e[2],i[r++]=e[3]},o.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new o),n[0]=e[r++],n[1]=e[r++],n[2]=e[r++],n[3]=e[r++],n},o.clone=function(e,t){return i(e)?i(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]):void 0},o.fromArray=function(e,r,n){return r=t(r,0),i(n)||(n=new o),n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n},o.fromColumnMajorArray=function(e,t){return o.clone(e,t)},o.fromRowMajorArray=function(e,t){return i(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 i(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 i(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),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t):new o(r,-n,n,r)},o.toArray=function(e,t){return i(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,i){var r=2*t,n=e[r],o=e[r+1];return i.x=n,i.y=o,i},o.setColumn=function(e,t,i,r){r=o.clone(e,r);var n=2*t;return r[n]=i.x,r[n+1]=i.y,r},o.getRow=function(e,t,i){var r=e[t],n=e[t+2];return i.x=r,i.y=n,i},o.setRow=function(e,t,i,r){return r=o.clone(e,r),r[t]=i.x,r[t+2]=i.y,r};var a=new e;o.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],a)),i.y=e.magnitude(e.fromElements(t[2],t[3],a)),i};var s=new e;return o.getMaximumScale=function(t){return o.getScale(t,s),e.maximumComponent(s)},o.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},o.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},o.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},o.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},o.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},o.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},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 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},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||i(e)&&i(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},o.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]},o.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},o.IDENTITY=n(new o(1,0,0,1)),o.ZERO=n(new o(0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN1ROW0=2,o.COLUMN1ROW1=3,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}),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;c>l;++l)d[l]=e[r+l];for(u=0;h>u;++u)p[u]=e[n+u+1];l=0,u=0;for(var m=r;s>=m;++m){var f=d[l],v=p[u];c>l&&(u>=h||t(f,v,i)<=0)?(e[m]=f,++l):h>u&&(e[m]=v,++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){return t(e)?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):void 0},r.packedLength=4,r.pack=function(t,i,r){r=e(r,0),i[r++]=t.near,i[r++]=t.nearValue,i[r++]=t.far,i[r]=t.farValue},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){if(!r(e))throw new o("occluderBoundingSphere is required.");if(!r(i))throw new o("camera position is required.");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)):!1;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?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+l>a)}return!0}return!1};var m=new t;c.prototype.computeVisibility=function(e){if(!r(e))throw new o("occludeeBS is required.");var i=t.clone(e.center),n=e.radius;if(n>this._occluderRadius)return u.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var a=t.subtract(i,this._occluderPosition,m),s=this._occluderRadius-n,l=t.magnitudeSquared(a);if(s=l-s*s,s>0){s=Math.sqrt(s)+this._horizonDistance,a=t.subtract(i,this._cameraPosition,a);var c=t.magnitudeSquared(a);return c>s*s+n*n?u.NONE:(s=this._occluderRadius+n,s=l-s*s,s>0?(s=Math.sqrt(s)+this._horizonDistance,s*s+n*n>c?u.FULL:u.PARTIAL):(a=t.subtract(i,this._horizonPlanePosition,a),t.dot(a,this._horizonPlaneNormal)>-n?u.PARTIAL:u.FULL))}}return u.NONE};var f=new t;c.computeOccludeePoint=function(e,i,r){var n=t.clone(i),a=t.clone(e.center),s=e.radius,l=r.length;if(t.equals(a,i))throw new o("occludeePosition must be different than occluderBoundingSphere.center");var u=t.normalize(t.subtract(n,a,f),f),h=-t.dot(u,a),d=c._anyRotationVector(a,u,h),p=c._horizonToPlaneNormalDotProduct(e,u,h,d,r[0]);if(p){for(var m,v=1;l>v;++v){if(m=c._horizonToPlaneNormalDotProduct(e,u,h,d,r[v]),!m)return;p>m&&(p=m)}if(!(.0017453283658983088>p)){var g=s/p;return t.add(a,t.multiplyByScalar(u,g,f),f)}}};var v=[];c.computeOccludeePointFromRectangle=function(r,n){n=i(n,a.WGS84);var o=l.subsample(r,n,0,v),s=e.fromPoints(o),u=t.ZERO;return t.equals(u,s.center)?void 0: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 _=new t;c._rotationVector=function(e,i,r,n,o){var a=t.subtract(n,e,_);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,E=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,E),c=t.magnitudeSquared(u),h=l*l;if(h>c)return!1;var d=c-h,p=Math.sqrt(d),m=Math.sqrt(c),f=1/m,v=p*f,g=v*p;u=t.normalize(u,u);var _=t.add(a,t.multiplyByScalar(u,g,S),S),w=Math.sqrt(d-g*g),T=this._rotationVector(s,i,r,a,n),x=t.fromElements(T.x*T.x*u.x+(T.x*T.y-T.z)*u.y+(T.x*T.z+T.y)*u.z,(T.x*T.y+T.z)*u.x+T.y*T.y*u.y+(T.y*T.z-T.x)*u.z,(T.x*T.z-T.y)*u.x+(T.y*T.z+T.x)*u.y+T.z*T.z*u.z,y);x=t.normalize(x,x);var b=t.multiplyByScalar(x,w,y);T=t.normalize(t.subtract(t.add(_,b,E),s,E),E);var A=t.dot(i,T);T=t.normalize(t.subtract(t.subtract(_,b,T),s,T),T);var P=t.dot(i,T);return P>A?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=!/\S/.test(i);o.fontsize=s;var u=document.createElement("div");u.style.position="absolute",u.style.opacity=0,u.style.font=s+"px "+a,u.innerHTML=i+"
"+i,document.body.appendChild(u),o.leading=1.2*s;var c=e(u,"height");if(c=c.replace("px",""),c>=2*s&&(o.leading=c/2|0),document.body.removeChild(u),l)o.ascent=0,o.descent=0,o.bounds={minx:0,maxx:o.width,miny:0,maxy:0},o.height=0;else{var h=document.createElement("canvas"),d=100;h.width=o.width+d,h.height=3*s,h.style.opacity=1,h.style.fontFamily=a,h.style.fontSize=s;var p=h.getContext("2d");p.font=s+"px "+a;var m=h.width,f=h.height,v=f/2;p.fillStyle="white",p.fillRect(-1,-1,m+2,f+2),r&&(p.strokeStyle="black",p.lineWidth=t.lineWidth,p.strokeText(i,d/2,v)),n&&(p.fillStyle="black",p.fillText(i,d/2,v));for(var g=p.getImageData(0,0,m,f).data,_=0,y=4*m,C=g.length;++_0&&255===g[_];);var S=_/y|0;for(_=0;C>_&&255===g[_];)_+=y,_>=C&&(_=_-C+4);var w=_%y/4|0,T=1;for(_=C-3;_>=0&&255===g[_];)_-=y,0>_&&(_=C-3-4*T++);var x=_%y/4+1|0;o.ascent=v-E,o.descent=S-v,o.bounds={minx:w-d/2,maxx:x-d/2,miny:0,maxy:S-E},o.height=1+(S-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=document.createElement("canvas");h.width=1,h.height=1,h.style.font=s;var d=h.getContext("2d");r(a)||(r(d.imageSmoothingEnabled)?a="imageSmoothingEnabled":r(d.mozImageSmoothingEnabled)?a="mozImageSmoothingEnabled":r(d.webkitImageSmoothingEnabled)?a="webkitImageSmoothingEnabled":r(d.msImageSmoothingEnabled)&&(a="msImageSmoothingEnabled")),d.font=s,d.lineJoin="round",d.lineWidth=c,d[a]=!1,d.textBaseline=i(o.textBaseline,"bottom"),h.style.visibility="hidden",document.body.appendChild(h);var p=e(d,n,l,u);p.computedWidth=Math.max(p.width,p.bounds.maxx-p.bounds.minx),h.dimensions=p,document.body.removeChild(h),h.style.visibility="";var m=p.height-p.ascent;h.width=p.computedWidth,h.height=p.height;var f=h.height-m;if(d.font=s,d.lineJoin="round",d.lineWidth=c,d[a]=!1,l){var v=i(o.strokeColor,t.BLACK);d.strokeStyle=v.toCssColorString(),d.strokeText(n,0,f)}if(u){var g=i(o.fillColor,t.WHITE);d.fillStyle=g.toCssColorString(),d.fillText(n,0,f)}return h}}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",["../Core/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(){return 0!==this._length?this._array[this._offset]:void 0},t.prototype.contains=function(e){return-1!==this._array.indexOf(e)},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/WindingOrder",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"use strict";var i={CLOCKWISE:e.CW,COUNTER_CLOCKWISE:e.CCW,validate:function(e){return e===i.CLOCKWISE||e===i.COUNTER_CLOCKWISE}};return t(i)}),i("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PolylinePipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function v(t,i,r){var n=e.subtract(i,t,F),o=e.subtract(r,i,B);return n.x*o.y-n.y*o.x>=0}function g(e){for(var t=e[0].x,i=0,r=0;rt&&(t=e[r].x,i=r);return i}function _(e){for(var t=e[0][0].x,i=0,r=0;rt&&(t=n,i=r)}return i}function y(e){for(var t=[],i=0;ic&&(c=n[h].x);c+=c-u;var d=new t(c,i.y,0);for(h=0;h=i.x||m.x>=i.x)&&(p.y>=i.y&&m.y<=i.y||p.y<=i.y&&m.y>=i.y)){var f=(m.y-p.y)*(d.x-i.x)-(m.x-p.x)*(d.y-i.y);if(0!==f){f=1/f;var v=((m.x-p.x)*(i.y-p.y)-(m.y-p.y)*(i.x-p.x))*f,_=((d.x-i.x)*(i.y-p.y)-(d.y-i.y)*(i.x-p.x))*f;if(v>=0&&1>=v&&_>=0&&1>=_){var y=new e(i.x+v*(d.x-i.x),i.y+v*(d.y-i.y)),C=e.subtract(y,i,V);f=e.magnitudeSquared(C),a>f&&(l=y,a=f,o[0]=h,o[1]=(h+1)%n.length)}}}}return l}function S(t,i){var r=_(i),n=i[r],o=g(n),a=n[o],s=[],l=E(a,t,s),u=C(t,l);if(-1!==u)return u;var d=e.magnitudeSquared(e.subtract(t[s[0]],a,k)),p=e.magnitudeSquared(e.subtract(t[s[1]],a,k)),m=p>d?t[s[0]]:t[s[1]],f=y(t),v=f.indexOf(m);-1!==v&&f.splice(v,1);for(var S=[],w=0;w0){var b=e.fromElements(1,0,k);for(w=0;wI&&(x=I,m=S[w])}}}return t.indexOf(m)}function w(e,i,r){for(var n=ee.computeWindingOrder2D(e),o=0;of?0>p&&m>0?U:G:f>0?p>0&&0>m?G:U:void 0}function M(e,t,i){return(e>t||e>i)&&(t>e||i>e)||t===i&&t===e}function D(t,i,r,n){var o=e.subtract(r,t,Y),a=i.x*n.y-i.y*n.x,s=a*a,l=e.magnitudeSquared(i),u=e.magnitudeSquared(n);if(s>j*l*u){var c=(o.x*n.y-o.y*n.x)/a;return e.add(t,e.multiplyByScalar(i,c,Y),Y)}}function R(t,i,r){for(var o=e.subtract(i,t,X),a=r.length,s=0;a>s;s++){var l=r[s].position,u=r[c.mod(s+1,a)].position;if(!(e.equals(t,l)||e.equals(i,u)||e.equals(t,u)||e.equals(i,l))){var h=e.subtract(u,l,Z),d=D(t,o,l,h);if(n(d)&&!(e.equals(d,t)||e.equals(d,i)||e.equals(d,l)||e.equals(d,u))){var p=d.x,m=d.y,f=M(p,t.x,i.x)&&M(m,t.y,i.y)&&M(p,l.x,u.x)&&M(m,l.y,u.y);if(f)return!0}}}return!1}function O(t,i,r){var n=I(t,i,r);if(n>=0)return n;var o=I(i,t,r);return o>=0?o:n!==U||o!==U||R(r[t].position,r[i].position,r)||e.equals(r[t].position,r[i].position)?Q:K}function N(e){return 0===x(1,2,0,e)}function L(e){var t=e.length;if(3===t)return N(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new o("Invalid polygon: must have at least three vertices.");for(var i,r,n=0,a=10*e.length,s=Q;K>s&&n++e.length-2;)r=T(e.length);if(i>r){var l=i;i=r,r=l}s=O(i,r,e)}if(s===K){var u=e.splice(i,r-i+1,e[i],e[r]);return L(e).concat(L(u))}return s>=0?(e.splice(s,1),L(e)):[]}var F=new e,B=new e,V=new e,k=new e(1,0),z=new e,U=-1,G=-2,W=new t,H=new t,q=new t,j=c.EPSILON14,Y=new e,X=new e,Z=new e,K=-1,Q=-2,J=new t,$=new t,ee={};ee.removeDuplicates=function(e){var i=d.removeDuplicates(e);return t.equals(i[0],i[i.length-1])?i.slice(1):i},ee.computeArea2D=function(e){for(var t=e.length,i=0,r=t-1,n=0;t>n;r=n++){var o=e[r],a=e[n];i+=o.x*a.y-a.x*o.y}return.5*i},ee.computeWindingOrder2D=function(e){var t=ee.computeArea2D(e);return t>0?f.COUNTER_CLOCKWISE:f.CLOCKWISE},ee.triangulate=function(e){for(var t=e.length,i=[],r=0;t>r;++r)i[r]={position:e[r],index:r};return L(i)};var te=new t,ie=new t,re=new t,ne=new t,oe=new t,ae=new t,se=new t;return ee.computeSubdivision=function(e,o,a,s){s=r(s,c.RADIANS_PER_DEGREE);var h,d=a.slice(0),m=o.length,f=new Array(3*m),v=0;for(h=0;m>h;h++){var g=o[h];f[v++]=g.x,f[v++]=g.y,f[v++]=g.z}for(var _=[],y={},C=e.maximumRadius,E=c.chordLength(s,C),S=E*E;d.length>0;){var w,T,x=d.pop(),b=d.pop(),A=d.pop(),P=t.fromArray(f,3*A,te),I=t.fromArray(f,3*b,ie),M=t.fromArray(f,3*x,re),D=t.multiplyByScalar(t.normalize(P,ne),C,ne),R=t.multiplyByScalar(t.normalize(I,oe),C,oe),O=t.multiplyByScalar(t.normalize(M,ae),C,ae),N=t.magnitudeSquared(t.subtract(D,R,se)),L=t.magnitudeSquared(t.subtract(R,O,se)),F=t.magnitudeSquared(t.subtract(O,D,se)),B=Math.max(N,L,F);B>S?N===B?(w=Math.min(A,b)+" "+Math.max(A,b),h=y[w],n(h)||(T=t.add(P,I,se),t.multiplyByScalar(T,.5,T),f.push(T.x,T.y,T.z),h=f.length/3-1,y[w]=h),d.push(A,h,x),d.push(h,b,x)):L===B?(w=Math.min(b,x)+" "+Math.max(b,x),h=y[w],n(h)||(T=t.add(I,M,se),t.multiplyByScalar(T,.5,T),f.push(T.x,T.y,T.z),h=f.length/3-1,y[w]=h),d.push(b,h,A),d.push(h,x,A)):F===B&&(w=Math.min(x,A)+" "+Math.max(x,A),h=y[w],n(h)||(T=t.add(M,P,se),t.multiplyByScalar(T,.5,T),f.push(T.x,T.y,T.z),h=f.length/3-1,y[w]=h),d.push(x,h,b),d.push(h,A,b)):(_.push(A),_.push(b),_.push(x))}return new l({attributes:{position:new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:f})},indices:_,primitiveType:p.TRIANGLES})},ee.scaleToGeodeticHeight=function(e,i,o,s){o=r(o,a.WGS84);var l=J,u=$;if(i=r(i,0),s=r(s,!0),n(e)&&n(e.attributes)&&n(e.attributes.position))for(var c=e.attributes.position.values,h=c.length,d=0;h>d;d+=3)t.fromArray(c,d,u),s&&(u=o.scaleToGeodeticSurface(u,u)),0!==i&&(l=o.geodeticSurfaceNormal(u,l),t.multiplyByScalar(l,i,l),t.add(u,l,u)),c[d]=u.x,c[d+1]=u.y,c[d+2]=u.z;return e},ee.eliminateHoles=function(e,i,n){n=r(n,a.WGS84);for(var o=[],s=0;s0;)c=w(c,o,n);return c},ee}),i("Core/PolygonGeometryLibrary",["./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(t,i,r,n){return e.subtract(i,t,g),e.multiplyByScalar(g,r/n,g),e.add(t,g,g),[g.x,g.y,g.z]}var v={};v.computeHierarchyPackedLength=function(t){for(var i=0,n=[t];n.length>0;){var o=n.pop();if(r(o)){i+=2;var a=o.positions,s=o.holes;if(r(a)&&(i+=a.length*e.packedLength),r(s))for(var l=s.length,u=0;l>u;++u)n.push(s[u])}}return i},v.packPolygonHierarchy=function(t,i,n){for(var o=[t];o.length>0;){var a=o.pop();if(r(a)){var s=a.positions,l=a.holes;if(i[n++]=r(s)?s.length:0,i[n++]=r(l)?l.length:0,r(s))for(var u=s.length,c=0;u>c;++c,n+=3)e.pack(s[c],i,n);if(r(l))for(var h=l.length,d=0;h>d;++d)o.push(l[d])}}return n},v.unpackPolygonHierarchy=function(t,i){for(var r=t[i++],n=t[i++],o=new Array(r),a=n>0?new Array(n):void 0,s=0;r>s;++s,i+=e.packedLength)o[s]=e.unpack(t,i);for(var l=0;n>l;++l)a[l]=v.unpackPolygonHierarchy(t,i),i=a[l].startingIndex,delete a[l].startingIndex;return{positions:o,holes:a,startingIndex:i}};var g=new e;v.subdivideLineCount=function(t,i,r){var n=e.distance(t,i),o=n/r,a=Math.max(0,Math.ceil(Math.log(o)/Math.log(2)));return Math.pow(2,a)},v.subdivideLine=function(t,i,n,o){var a=v.subdivideLineCount(t,i,n),s=e.distance(t,i),l=s/a;r(o)||(o=[]);var u=o;u.length=3*a;for(var c=0,h=0;a>h;h++){var d=f(t,i,h*l,s);u[c++]=d[0],u[c++]=d[1],u[c++]=d[2]}return u};var _=new e,y=new e,C=new e,E=new e;v.scaleToGeodeticHeightExtruded=function(t,o,a,s,l){s=i(s,n.WGS84);var u=_,c=y,h=C,d=E;if(r(t)&&r(t.attributes)&&r(t.attributes.position))for(var p=t.attributes.position.values,m=p.length/2,f=0;m>f;f+=3)e.fromArray(p,f,h),s.geodeticSurfaceNormal(h,u),d=s.scaleToGeodeticSurface(h,d),c=e.multiplyByScalar(u,a,c),c=e.add(d,c,c),p[f+m]=c.x,p[f+1+m]=c.y,p[f+2+m]=c.z,l&&(d=e.clone(h,d)),c=e.multiplyByScalar(u,o,c),c=e.add(d,c,c),p[f]=c.x,p[f+1]=c.y,p[f+2]=c.z;return t},v.polygonsFromHierarchy=function(e){var t=[],i=[],n=new p;for(n.enqueue(e);0!==n.length;){var o=n.dequeue(),a=o.positions,s=o.holes;if(a=h.removeDuplicates(a),!(a.length<3)){for(var l=r(s)?s.length:0,u=[],c=0;l>c;c++){var d=s[c];if(d.positions=h.removeDuplicates(d.positions),!(d.positions.length<3)){u.push(d.positions);var m=0;r(d.holes)&&(m=d.holes.length);for(var f=0;m>f;f++)n.enqueue(d.holes[f])}}i.push({outerRing:a,holes:u});var v=u.length>0?h.eliminateHoles(a,u):a;t.push(v)}}return{hierarchy:i,polygons:t}};var S=[];v.createGeometryFromPositions=function(e,i,r,n){var l=o.fromPoints(i,e),u=l.projectPointsOntoPlane(i,S),c=h.computeWindingOrder2D(u);c===m.CLOCKWISE&&(u.reverse(),i=i.slice().reverse());var p=h.triangulate(u);if(p.length<3&&(p=[0,1,2]),n){for(var f=i.length,v=new Array(3*f),g=0,_=0;f>_;_++){var y=i[_];v[g++]=y.x,v[g++]=y.y,v[g++]=y.z}return new a({attributes:{position:new s({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:v})},indices:p,primitiveType:d.TRIANGLES})}return h.computeSubdivision(e,i,p,r)};var w=[],T=new e,x=new e;return v.computeWallGeometry=function(i,r,n,o){var h,p,m,f,g,_=i.length,y=0;if(o)for(p=3*_*2,h=new Array(2*p),m=0;_>m;m++)f=i[m],g=i[(m+1)%_],h[y]=h[y+p]=f.x,++y,h[y]=h[y+p]=f.y,++y,h[y]=h[y+p]=f.z,++y,h[y]=h[y+p]=g.x,++y,h[y]=h[y+p]=g.y,++y,h[y]=h[y+p]=g.z,++y;else{var C=c.chordLength(n,r.maximumRadius),E=0;for(m=0;_>m;m++)E+=v.subdivideLineCount(i[m],i[(m+1)%_],C);for(p=3*(E+_),h=new Array(2*p),m=0;_>m;m++){f=i[m],g=i[(m+1)%_];for(var S=v.subdivideLine(f,g,C,w),b=S.length,A=0;b>A;++A,++y)h[y]=S[A],h[y+p]=S[A];h[y]=g.x,h[y+p]=g.x,++y,h[y]=g.y,h[y+p]=g.y,++y,h[y]=g.z,h[y+p]=g.z,++y}}_=h.length;var P=u.createTypedArray(_/3,_-6*i.length),I=0;for(_/=6,m=0;_>m;m++){var M=m,D=M+1,R=M+_,O=R+1;f=e.fromArray(h,3*M,T),g=e.fromArray(h,3*D,x),e.equalsEpsilon(f,g,c.EPSILON14)||(P[I++]=M,P[I++]=R,P[I++]=D,P[I++]=D,P[I++]=R,P[I++]=O)}return new a({attributes:new l({position:new s({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:h})}),indices:P,primitiveType:d.TRIANGLES})},v}),i("Core/PolygonGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./Quaternion","./VertexFormat","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S){"use strict";function w(e,t,i,n){for(var o=C.fromAxisAngle(e._plane.normal,i,I),s=g.fromQuaternion(o,M),l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,d=t.length,p=0;d>p;++p){var m=r.clone(t[p],P);g.multiplyByVector(s,m,m);var f=e.projectPointOntoPlane(m,A);a(f)&&(l=Math.min(l,f.x),u=Math.max(u,f.x),c=Math.min(c,f.y),h=Math.max(h,f.y))}return n.x=l,n.y=c,n.width=u-l,n.height=h-c,n}function T(e,t,o,a,s,l,c){if(e.st||e.normal||e.tangent||e.binormal){var d=u.fromPoints(o,a),p=w(d,o,s,D),m=V;m.x=p.x,m.y=p.y;var f=t.attributes.position.values,_=f.length,y=e.st?new Float32Array(2*(_/3)):void 0,E=e.normal?new Float32Array(_):void 0,S=e.tangent?new Float32Array(_):void 0,T=e.binormal?new Float32Array(_):void 0,x=0,b=0,A=O,P=N,I=L,M=!0,W=C.fromAxisAngle(d._plane.normal,s,U),H=g.fromQuaternion(W,G),q=_/2,j=_/3;l&&(_/=2);for(var Y=0;_>Y;Y+=3){var X=r.fromArray(f,Y,z);if(e.st){var Z=g.multiplyByVector(H,X,R);Z=a.scaleToGeodeticSurface(Z,Z);var K=d.projectPointOntoPlane(Z,k);i.subtract(K,m,K),l&&(y[x+j]=K.x/p.width,y[x+1+j]=K.y/p.height),y[x]=K.x/p.width,y[x+1]=K.y/p.height,x+=2}if(e.normal||e.tangent||e.binormal){var Q=b+1,J=b+2;if(c){if(_>Y+3){var $=r.fromArray(f,Y+3,F);if(M){var ee=r.fromArray(f,Y+_,B);r.subtract($,X,$),r.subtract(ee,X,ee),A=r.normalize(r.cross(ee,$,A),A),M=!1}r.equalsEpsilon($,X,v.EPSILON10)&&(M=!0)}(e.tangent||e.binormal)&&(I=a.geodeticSurfaceNormal(X,I),e.tangent&&(P=r.normalize(r.cross(I,A,P),P)))}else A=a.geodeticSurfaceNormal(X,A),(e.tangent||e.binormal)&&(P=r.cross(r.UNIT_Z,A,P),P=r.normalize(g.multiplyByVector(H,P,P),P),e.binormal&&(I=r.normalize(r.cross(A,P,I),I)));e.normal&&(l&&!c?(E[b+q]=-A.x,E[Q+q]=-A.y,E[J+q]=-A.z):(E[b+q]=A.x,E[Q+q]=A.y,E[J+q]=A.z),E[b]=A.x,E[Q]=A.y,E[J]=A.z),e.tangent&&(l&&!c?(S[b+q]=-P.x,S[Q+q]=-P.y,S[J+q]=-P.z):(S[b+q]=P.x,S[Q+q]=P.y,S[J+q]=P.z),S[b]=P.x,S[Q]=P.y,S[J]=P.z),e.binormal&&(l&&(T[b+q]=I.x,T[Q+q]=I.y,T[J+q]=I.z),T[b]=I.x,T[Q]=I.y,T[J]=I.z),b+=3}}e.st&&(t.attributes.st=new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:y})),e.normal&&(t.attributes.normal=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E})),e.tangent&&(t.attributes.tangent=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),e.binormal&&(t.attributes.binormal=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:T}))}return t}function x(e,t,i,r,o){var a=_.createGeometryFromPositions(e,t,i,o),s=a.attributes.position.values,l=a.indices,m=s.concat(s),v=m.length/3,g=f.createTypedArray(v,2*l.length);g.set(l);var C,E=l.length,w=v/2;for(C=0;E>C;C+=3){var T=g[C]+w,x=g[C+1]+w,b=g[C+2]+w;g[C+E]=b,g[C+1+E]=x,g[C+2+E]=T}var A=new c({attributes:new d({position:new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:m})}),indices:g,primitiveType:a.primitiveType}),P={topAndBottom:new p({geometry:A}),walls:[]},I=r.outerRing,M=u.fromPoints(I,e),D=M.projectPointsOntoPlane(I,W),R=y.computeWindingOrder2D(D);R===S.CLOCKWISE&&(I=I.slice().reverse());var O=_.computeWallGeometry(I,e,i,o);P.walls.push(new p({geometry:O}));var N=r.holes;for(C=0;Cy;y++){var T=i[y],x=i[(y+1)%C];g[E++]=T.x,g[E++]=T.y,g[E++]=T.z,g[E++]=x.x,g[E++]=x.y,g[E++]=x.z}else{var b=0;for(y=0;C>y;y++)b+=m.subdivideLineCount(i[y],i[(y+1)%C],r);for(g=new Float64Array(3*b),y=0;C>y;y++)for(var A=m.subdivideLine(i[y],i[(y+1)%C],r,w),P=A.length,I=0;P>I;++I)g[E++]=A[I]}C=g.length/3;var M=2*C,D=d.createTypedArray(C,M);for(E=0,y=0;C-1>y;y++)D[E++]=y,D[E++]=y+1;return D[E++]=C-1,D[E++]=0,new c({geometry:new s({attributes:new u({position:new l({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:g})}),indices:D,primitiveType:v.LINES})})}function C(e,i,r,n){var o=a.fromPoints(i,e),h=o.projectPointsOntoPlane(i,S),p=f.computeWindingOrder2D(h);p===_.CLOCKWISE&&(h.reverse(),i=i.slice().reverse());var g,y,C=i.length,E=new Array(C),T=0;if(n)for(g=new Float64Array(2*C*3*2),y=0;C>y;++y){E[y]=T/3;var x=i[y],b=i[(y+1)%C];g[T++]=x.x,g[T++]=x.y,g[T++]=x.z,g[T++]=b.x,g[T++]=b.y,g[T++]=b.z}else{var A=0;for(y=0;C>y;y++)A+=m.subdivideLineCount(i[y],i[(y+1)%C],r);for(g=new Float64Array(3*A*2),y=0;C>y;++y){E[y]=T/3;for(var P=m.subdivideLine(i[y],i[(y+1)%C],r,w),I=P.length,M=0;I>M;++M)g[T++]=P[M]}}C=g.length/6;var D=E.length,R=2*(2*C+D),O=d.createTypedArray(C,R);for(T=0,y=0;C>y;++y)O[T++]=y,O[T++]=(y+1)%C,O[T++]=y+C,O[T++]=(y+1)%C+C;for(y=0;D>y;y++){var N=E[y];O[T++]=N,O[T++]=N+C}return new c({geometry:new s({attributes:new u({position:new l({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:g})}),indices:O,primitiveType:v.LINES})})}function E(e){var t=e.polygonHierarchy,n=i(e.ellipsoid,o.WGS84),a=i(e.granularity,p.RADIANS_PER_DEGREE),s=i(e.height,0),l=i(e.perPositionHeight,!1),u=e.extrudedHeight,c=r(u);if(c&&!l){var h=u;u=Math.min(h,s),s=Math.max(h,s)}this._ellipsoid=o.clone(n),this._granularity=a,this._height=s,this._extrudedHeight=i(u,0),this._extrude=c,this._polygonHierarchy=t,this._perPositionHeight=l,this._workerName="createPolygonOutlineGeometry",this.packedLength=m.computeHierarchyPackedLength(t)+o.packedLength+6}var S=[],w=[];E.pack=function(e,t,r){r=i(r,0),r=m.packPolygonHierarchy(e._polygonHierarchy,t,r),o.pack(e._ellipsoid,t,r),r+=o.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};var T=o.clone(o.UNIT_SPHERE),x={polygonHierarchy:{}};return E.unpack=function(e,t,n){t=i(t,0);var a=m.unpackPolygonHierarchy(e,t);t=a.startingIndex,delete a.startingIndex;var s=o.unpack(e,t,T);t+=o.packedLength;var l=e[t++],u=e[t++],c=e[t++],h=1===e[t++],d=1===e[t++],p=e[t++];return r(n)||(n=new E(x)),n._polygonHierarchy=a,n._ellipsoid=o.clone(s,n._ellipsoid),n._height=l,n._extrudedHeight=u,n._granularity=c,n._extrude=h,n._perPositionHeight=d,n.packedLength=p,n},E.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 E(t)},E.createGeometry=function(t){var i=t._ellipsoid,n=t._granularity,o=t._height,a=t._extrudedHeight,l=t._extrude,u=t._polygonHierarchy,c=t._perPositionHeight,d=[],v=new g;v.enqueue(u);for(var _;0!==v.length;){var E=v.dequeue(),S=E.positions;if(S=f.removeDuplicates(S),!(S.length<3)){var w=E.holes?E.holes.length:0;for(_=0;w>_;_++){var T=E.holes[_];if(T.positions=f.removeDuplicates(T.positions),!(T.positions.length<3)){d.push(T.positions);var x=0;r(T.holes)&&(x=T.holes.length);for(var b=0;x>b;b++)v.enqueue(T.holes[b])}}d.push(S)}}if(0!==d.length){var A,P=[],I=p.chordLength(n,i.maximumRadius);if(l)for(_=0;_s;s++)a[s]=i.clone(r);return a}var v=(d-l)/o,g=(p-u)/o,_=(m-c)/o,C=(f-h)/o;for(s=0;o>s;s++)a[s]=new i(l+s*v,u+s*g,c+s*_,h+s*C);return a}function _(e){e=n(e,n.EMPTY_OBJECT);var r=e.positions,a=e.colors,l=n(e.width,1),u=n(e.colorsPerVertex,!1);this._positions=r,this._colors=a,this._width=l,this._colorsPerVertex=u,this._vertexFormat=v.clone(n(e.vertexFormat,v.DEFAULT)),this._followSurface=n(e.followSurface,!0),this._granularity=n(e.granularity,p.RADIANS_PER_DEGREE),this._ellipsoid=s.clone(n(e.ellipsoid,s.WGS84)),this._workerName="createPolylineGeometry";var c=1+r.length*t.packedLength;c+=o(a)?1+a.length*i.packedLength:1,this.packedLength=c+s.packedLength+v.packedLength+4}var y=[];_.pack=function(e,r,a){a=n(a,0);var l,u=e._positions,c=u.length;for(r[a++]=c,l=0;c>l;++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;c>l;++l,a+=i.packedLength)i.pack(h[l],r,a);s.pack(e._ellipsoid,r,a),a+=s.packedLength,v.pack(e._vertexFormat,r,a),a+=v.packedLength,r[a++]=e._width,r[a++]=e._colorsPerVertex?1:0,r[a++]=e._followSurface?1:0,r[a]=e._granularity};var C=s.clone(s.UNIT_SPHERE),E=new v,S={positions:void 0,colors:void 0,ellipsoid:C,vertexFormat:E,width:void 0,colorsPerVertex:void 0,followSurface:void 0,granularity:void 0};_.unpack=function(e,r,a){r=n(r,0);var l,u=e[r++],c=new Array(u);for(l=0;u>l;++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;u>l;++l,r+=i.packedLength)h[l]=i.unpack(e,r);var d=s.unpack(e,r,C);r+=s.packedLength;var p=v.unpack(e,r,E);r+=v.packedLength;var m=e[r++],f=1===e[r++],g=1===e[r++],y=e[r];return o(a)?(a._positions=c,a._colors=h,a._ellipsoid=s.clone(d,a._ellipsoid),a._vertexFormat=v.clone(p,a._vertexFormat),a._width=m,a._colorsPerVertex=f,a._followSurface=g,a._granularity=y,a):(S.positions=c,S.colors=h,S.width=m,S.colorsPerVertex=f,S.followSurface=g,S.granularity=y,new _(S))};var w=new t,T=new t,x=new t,b=new t;return _.createGeometry=function(n){var a,s,v,_=n._width,C=n._vertexFormat,E=n._colors,S=n._colorsPerVertex,A=n._followSurface,P=n._granularity,I=n._ellipsoid,M=p.chordLength(P,I.maximumRadius),D=m.removeDuplicates(n._positions),R=D.length;if(!(2>R)){if(A){var O=m.extractHeights(D,I);if(o(E)){var N=1;for(a=0;R-1>a;++a)N+=m.numberOfPoints(D[a],D[a+1],M);var L=new Array(N),F=0;for(a=0;R-1>a;++a){var B=D[a],V=D[a+1],k=E[a],z=m.numberOfPoints(B,V,M);if(S&&N>a){var U=E[a+1],G=g(B,V,k,U,z),W=G.length;for(s=0;W>s;++s)L[F++]=G[s]}else for(s=0;z>s;++s)L[F++]=i.clone(k)}L[F]=i.clone(E[E.length-1]),E=L,y.length=0}D=m.generateCartesianArc({positions:D,minDistance:M,ellipsoid:I,height:O})}R=D.length;var H,q=4*R-4,j=new Float64Array(3*q),Y=new Float64Array(3*q),X=new Float64Array(3*q),Z=new Float32Array(2*q),K=C.st?new Float32Array(2*q):void 0,Q=o(E)?new Uint8Array(4*q):void 0,J=0,$=0,ee=0,te=0;for(s=0;R>s;++s){0===s?(H=w,t.subtract(D[0],D[1],H),t.add(D[0],H,H)):H=D[s-1],t.clone(H,x),t.clone(D[s],T),s===R-1?(H=w,t.subtract(D[R-1],D[R-2],H),t.add(D[R-1],H,H)):H=D[s+1],t.clone(H,b);var ie,re;o(Q)&&(ie=0===s||S?E[s]:E[s-1],s!==R-1&&(re=E[s]));var ne=0===s?2:0,oe=s===R-1?2:4;for(v=ne;oe>v;++v){t.pack(T,j,J),t.pack(x,Y,J),t.pack(b,X,J),J+=3;var ae=0>v-2?-1:1;if(Z[$++]=2*(v%2)-1,Z[$++]=ae*_,C.st&&(K[ee++]=s/(R-1),K[ee++]=Math.max(Z[$-2],0)),o(Q)){var se=2>v?ie:re;Q[te++]=i.floatToByte(se.red),Q[te++]=i.floatToByte(se.green),Q[te++]=i.floatToByte(se.blue),Q[te++]=i.floatToByte(se.alpha)}}}var le=new c;le.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:j}),le.prevPosition=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:Y}),le.nextPosition=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:X}),le.expandAndWidth=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:Z}),C.st&&(le.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:K})),o(Q)&&(le.color=new u({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:Q,normalize:!0}));var ue=d.createTypedArray(q,6*R-6),ce=0,he=0,de=R-1;for(s=0;de>s;++s)ue[he++]=ce,ue[he++]=ce+2,ue[he++]=ce+1,ue[he++]=ce+1,ue[he++]=ce+2,ue[he++]=ce+3,ce+=4;return new l({attributes:le,indices:ue,primitiveType:f.TRIANGLES,boundingSphere:e.fromPoints(D),geometryType:h.POLYLINES})}},_}),i("Core/PolylineVolumeGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./VertexFormat","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E){"use strict";function S(e,i,r,o){var a=new d;o.position&&(a.position=new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:e}));var s,l,u,f,g,_,C=i.length,E=e.length/3,S=(E-2*C)/(2*C),w=v.triangulate(i),T=(S-1)*C*6+2*w.length,x=m.createTypedArray(E,T),b=2*C,A=0;for(s=0;S-1>s;s++){for(l=0;C-1>l;l++)u=2*l+s*C*2,_=u+b,f=u+1,g=f+b,x[A++]=f,x[A++]=u,x[A++]=g,x[A++]=g,x[A++]=u,x[A++]=_;u=2*C-2+s*C*2,f=u+1,g=f+b,_=u+b,x[A++]=f,x[A++]=u,x[A++]=g,x[A++]=g,x[A++]=u,x[A++]=_}if(o.st||o.tangent||o.binormal){var P,I,M=new Float32Array(2*E),D=1/(S-1),R=1/r.height,O=r.height/2,N=0;for(s=0;S>s;s++){for(P=s*D,I=R*(i[0].y+O),M[N++]=P,M[N++]=I,l=1;C>l;l++)I=R*(i[l].y+O),M[N++]=P,M[N++]=I,M[N++]=P,M[N++]=I;I=R*(i[0].y+O),M[N++]=P,M[N++]=I}for(l=0;C>l;l++)P=0,I=R*(i[l].y+O),M[N++]=P,M[N++]=I;for(l=0;C>l;l++)P=(S-1)*D,I=R*(i[l].y+O),M[N++]=P,M[N++]=I;a.st=new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:new Float32Array(M)})}var L=E-2*C;for(s=0;so;++o,n+=r.packedLength)r.pack(s[o],t,n);var c=e._shape;for(l=c.length,t[n++]=l,o=0;l>o;++o,n+=i.packedLength)i.pack(c[o],t,n);u.pack(e._ellipsoid,t,n),n+=u.packedLength,C.pack(e._vertexFormat,t,n),n+=C.packedLength,t[n++]=e._cornerType,t[n]=e._granularity};var T=u.clone(u.UNIT_SPHERE),x=new C,b={polylinePositions:void 0,shapePositions:void 0,ellipsoid:T,vertexFormat:x,cornerType:void 0,granularity:void 0};w.unpack=function(e,t,n){t=a(t,0);var o,l=e[t++],c=new Array(l);for(o=0;l>o;++o,t+=r.packedLength)c[o]=r.unpack(e,t);l=e[t++];var h=new Array(l);for(o=0;l>o;++o,t+=i.packedLength)h[o]=i.unpack(e,t);var d=u.unpack(e,t,T);t+=u.packedLength;var p=C.unpack(e,t,x);t+=C.packedLength;var m=e[t++],f=e[t];return s(n)?(n._positions=c,n._shape=h,n._ellipsoid=u.clone(d,n._ellipsoid),n._vertexFormat=C.clone(p,n._vertexFormat),n._cornerType=m,n._granularity=f,n):(b.polylinePositions=c,b.shapePositions=h,b.cornerType=m,b.granularity=f,new w(b))};var A=new e;return w.createGeometry=function(t){var i=t._positions,r=g.removeDuplicates(i),n=t._shape;if(n=_.removeDuplicatesFromShape(n),!(r.length<2||n.length<3)){v.computeWindingOrder2D(n)===E.CLOCKWISE&&n.reverse();var o=e.fromPoints(n,A),a=_.computePositions(r,n,o,t,!0);return S(a,n,o,t._vertexFormat)}},w}),i("Core/PolylineVolumeOutlineGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y){"use strict";function C(e,i){var r=new d;r.position=new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:e});var o,a,s=i.length,l=r.position.values.length/3,u=e.length/3,m=u/s,f=p.createTypedArray(l,2*s*(m+1)),v=0;o=0;var g=o*s;for(a=0;s-1>a;a++)f[v++]=a+g,f[v++]=a+g+1;for(f[v++]=s-1+g,f[v++]=g,o=m-1,g=o*s,a=0;s-1>a;a++)f[v++]=a+g,f[v++]=a+g+1;for(f[v++]=s-1+g,f[v++]=g,o=0;m-1>o;o++){var y=s*o,C=y+s;for(a=0;s>a;a++)f[v++]=a+y,f[v++]=a+C}var E=new c({attributes:r,indices:p.createTypedArray(l,f),boundingSphere:t.fromVertices(e),primitiveType:_.LINES});return E}function E(e){e=a(e,a.EMPTY_OBJECT);var t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=u.clone(a(e.ellipsoid,u.WGS84)),this._cornerType=a(e.cornerType,o.ROUNDED),this._granularity=a(e.granularity,m.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var s=1+t.length*r.packedLength;s+=1+n.length*i.packedLength,this.packedLength=s+u.packedLength+2}E.pack=function(e,t,n){n=a(n,0);var o,s=e._positions,l=s.length;for(t[n++]=l,o=0;l>o;++o,n+=r.packedLength)r.pack(s[o],t,n);var c=e._shape;for(l=c.length,t[n++]=l,o=0;l>o;++o,n+=i.packedLength)i.pack(c[o],t,n);u.pack(e._ellipsoid,t,n),n+=u.packedLength,t[n++]=e._cornerType,t[n]=e._granularity};var S=u.clone(u.UNIT_SPHERE),w={polylinePositions:void 0,shapePositions:void 0,ellipsoid:S,height:void 0,cornerType:void 0,granularity:void 0};E.unpack=function(e,t,n){t=a(t,0);var o,l=e[t++],c=new Array(l);for(o=0;l>o;++o,t+=r.packedLength)c[o]=r.unpack(e,t);l=e[t++];var h=new Array(l);for(o=0;l>o;++o,t+=i.packedLength)h[o]=i.unpack(e,t);var d=u.unpack(e,t,S);t+=u.packedLength;var p=e[t++],m=e[t];return s(n)?(n._positions=c,n._shape=h,n._ellipsoid=u.clone(d,n._ellipsoid),n._cornerType=p,n._granularity=m,n):(w.polylinePositions=c,w.shapePositions=h,w.cornerType=p,w.granularity=m,new E(w))};var T=new e;return E.createGeometry=function(t){var i=t._positions,r=v.removeDuplicates(i),n=t._shape;if(n=g.removeDuplicatesFromShape(n),!(r.length<2||n.length<3)){f.computeWindingOrder2D(n)===y.CLOCKWISE&&n.reverse();var o=e.fromPoints(n,T),a=g.computePositions(r,n,o,t,!1);return C(a,n)}},E}),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;o-1>s;++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";var l=Math.cos,u=Math.sin,c=Math.sqrt,h={};h.computePosition=function(e,t,r,n,o){var s=e.ellipsoid.radiiSquared,h=e.nwCorner,d=e.rectangle,p=h.latitude-e.granYCos*t+r*e.granXSin,m=l(p),f=u(p),v=s.z*f,g=h.longitude+t*e.granYSin+r*e.granXCos,_=m*l(g),y=m*u(g),C=s.x*_,E=s.y*y,S=c(C*_+E*y+v*f);n.x=C/S,n.y=E/S,n.z=v/S,i(e.vertexFormat)&&e.vertexFormat.st&&(o.x=(g-d.west)*e.lonScalar-.5,o.y=(p-d.south)*e.latScalar-.5,a.multiplyByVector(e.textureMatrix,o,o),o.x+=.5,o.y+=.5)};var d=new a,p=new e,m=new t,f=new e,v=new n;return h.computeOptions=function(t,n,l){var u,c,h,g,_,y=t._granularity,C=t._ellipsoid,E=t._surfaceHeight,S=t._rotation,w=t._extrudedHeight,T=n.east,x=n.west,b=n.north,A=n.south,P=b-A;x>T?(_=o.TWO_PI-x+T,u=Math.ceil(_/y)+1,c=Math.ceil(P/y)+1,h=_/(u-1),g=P/(c-1)):(_=T-x,u=Math.ceil(_/y)+1,c=Math.ceil(P/y)+1,h=_/(u-1),g=P/(c-1)),l=s.northwest(n,l);var I=s.center(n,m),M=g,D=h,R=0,O=0;if(i(S)){var N=Math.cos(S);M*=N,D*=N;var L=Math.sin(S);R=g*L,O=h*L,p=v.project(l,p),f=v.project(I,f),p=e.subtract(p,f,p);var F=a.fromRotation(S,d);p=a.multiplyByVector(F,p,p),p=e.add(p,f,p),l=v.unproject(p,l);var B=l.latitude,V=B+(u-1)*O,k=B-M*(c-1),z=B-M*(c-1)+(u-1)*O;b=Math.max(B,V,k,z),A=Math.min(B,V,k,z);var U=l.longitude,G=U+(u-1)*D,W=U+(c-1)*R,H=U+(c-1)*R+(u-1)*D;if(T=Math.max(U,G,W,H),x=Math.min(U,G,W,H),b<-o.PI_OVER_TWO||b>o.PI_OVER_TWO||A<-o.PI_OVER_TWO||A>o.PI_OVER_TWO)throw new r("Rotated rectangle is invalid. It crosses over either the north or south pole.");n.north=b,n.south=A,n.east=T,n.west=x}return{granYCos:M,granYSin:R,granXCos:D,granXSin:O,ellipsoid:C,width:u,height:c,surfaceHeight:E,extrudedHeight:w,nwCorner:l,rectangle:n}},h}),i("Core/RectangleGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./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,v,g,_,y,C,E,S,w){"use strict";function T(e,t){var i=new u({attributes:new h,primitiveType:y.TRIANGLES});return i.attributes.position=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(i.attributes.normal=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(i.attributes.tangent=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.binormal&&(i.attributes.binormal=new c({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.binormals})),i}function x(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.binormal?new Float32Array(o):void 0,u=0,c=L,h=N,d=O,p=0;o>p;p+=3){var m=i.fromArray(e,p,R),f=u+1,v=u+2;(t.normal||t.tangent||t.binormal)&&(d=r.geodeticSurfaceNormal(m,d),(t.tangent||t.binormal)&&(i.cross(i.UNIT_Z,d,h),g.multiplyByVector(n,h,h),i.normalize(h,h),t.binormal&&i.normalize(i.cross(d,h,c),c)),t.normal&&(a[u]=d.x,a[f]=d.y,a[v]=d.z),t.tangent&&(s[u]=h.x,s[f]=h.y,s[v]=h.z),t.binormal&&(l[u]=c.x,l[f]=c.y,l[v]=c.z)),u+=3}return T(t,{positions:e,normals:a,tangents:s,binormals:l})}function b(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.binormal?new Float32Array(n):void 0,l=0,u=0,c=0,h=!0,d=L,p=N,m=O,v=0;n>v;v+=6){var g=i.fromArray(e,v,R);if(t.normal||t.tangent||t.binormal){var _=i.fromArray(e,(v+6)%n,z);if(h){var y=i.fromArray(e,(v+3)%n,U);i.subtract(_,g,_),i.subtract(y,g,y),m=i.normalize(i.cross(y,_,m),m),h=!1}i.equalsEpsilon(_,g,f.EPSILON10)&&(h=!0),(t.tangent||t.binormal)&&(d=r.geodeticSurfaceNormal(g,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.binormal&&(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 T(t,{positions:e,normals:o,tangents:a,binormals:s})}function A(e){for(var t=e.vertexFormat,i=e.ellipsoid,r=e.size,o=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,h=0,d=R,p=B,f=Number.MAX_VALUE,v=Number.MAX_VALUE,g=Number.MIN_VALUE,_=Number.MIN_VALUE,y=0;o>y;++y)for(var C=0;a>C;++C)S.computePosition(e,y,C,d,p),s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,t.st&&(l[h++]=p.x,l[h++]=p.y,f=Math.min(f,p.x),v=Math.min(v,p.y),g=Math.max(g,p.x),_=Math.max(_,p.y));if(t.st&&(0>f||0>v||g>1||_>1))for(var E=0;EI;++I){for(var M=0;a-1>M;++M){var D=A,O=D+a,N=O+1,L=D+1;b[P++]=D,b[P++]=O,b[P++]=L,b[P++]=L,b[P++]=O,b[P++]=N,++A}++A}return w.indices=b,t.st&&(w.attributes.st=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:l})),w}function P(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 M(e){var t,r=e.vertexFormat,o=e.surfaceHeight,a=e.extrudedHeight,s=Math.min(a,o),l=Math.max(a,o),u=e.height,h=e.width,v=e.ellipsoid,g=A(e);if(f.equalsEpsilon(s,l,f.EPSILON10))return g;g=_.scaleToGeodeticHeight(g,l,v,!1);var y=new Float64Array(g.attributes.position.values),C=y.length,E=2*C,S=new Float64Array(E);S.set(y),g=_.scaleToGeodeticHeight(g,s,v);var w=g.attributes.position.values;S.set(w,C),g.attributes.position.values=S;var T,x=r.normal?new Float32Array(E):void 0,M=r.tangent?new Float32Array(E):void 0,D=r.binormal?new Float32Array(E):void 0,R=r.st?new Float32Array(E/3*2):void 0;if(r.normal){var O=g.attributes.normal.values;for(x.set(O),t=0;C>t;t++)O[t]=-O[t];x.set(O,C),g.attributes.normal.values=x}if(r.tangent){var N=g.attributes.tangent.values;for(M.set(N),t=0;C>t;t++)N[t]=-N[t];M.set(N,C),g.attributes.tangent.values=M}if(r.binormal){var L=g.attributes.binormal.values;D.set(L),D.set(L,C),g.attributes.binormal.values=D}r.st&&(T=g.attributes.st.values,R.set(T),R.set(T,C/3*2),g.attributes.st.values=R);var F=g.indices,B=F.length,V=C/3,k=m.createTypedArray(E/3,2*B);for(k.set(F),t=0;B>t;t+=3)k[t+B]=F[t+2]+V,k[t+1+B]=F[t+1]+V,k[t+2+B]=F[t]+V;g.indices=k;var G=2*h+2*u-4,W=2*(G+4),H=new Float64Array(3*W),q=r.st?new Float32Array(2*W):void 0,j=0,Y=0,X=h*u;for(t=0;X>t;t+=h)H=P(H,j,3*t,y,w),j+=6,r.st&&(q=I(q,Y,2*t,T),Y+=4);for(t=X-h;X>t;t++)H=P(H,j,3*t,y,w),j+=6,r.st&&(q=I(q,Y,2*t,T),Y+=4);for(t=X-1;t>0;t-=h)H=P(H,j,3*t,y,w),j+=6,r.st&&(q=I(q,Y,2*t,T),Y+=4);for(t=h-1;t>=0;t--)H=P(H,j,3*t,y,w),j+=6,r.st&&(q=I(q,Y,2*t,T),Y+=4);var Z=b(H,r,v);r.st&&(Z.attributes.st=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:q}));var K,Q,J,$,ee=m.createTypedArray(W,6*G);C=H.length/3;var te=0;for(t=0;C-1>t;t+=2){K=t,$=(K+2)%C;var ie=i.fromArray(H,3*K,z),re=i.fromArray(H,3*$,U);i.equalsEpsilon(ie,re,f.EPSILON10)||(Q=(K+1)%C,J=(Q+2)%C,ee[te++]=K,ee[te++]=Q,ee[te++]=$,ee[te++]=$,ee[te++]=Q,ee[te++]=J)}return Z.indices=ee,Z=p.combineInstances([new d({geometry:g}),new d({geometry:Z})]),Z[0]}function D(e){e=o(e,o.EMPTY_OBJECT);var t=e.rectangle,i=o(e.granularity,f.RADIANS_PER_DEGREE),r=o(e.ellipsoid,l.WGS84),n=o(e.height,0),s=o(e.rotation,0),u=o(e.stRotation,0),c=o(e.vertexFormat,w.DEFAULT),h=e.extrudedHeight,d=a(h),p=o(e.closeTop,!0),m=o(e.closeBottom,!0);this._rectangle=t,this._granularity=i,this._ellipsoid=l.clone(r),this._surfaceHeight=n,this._rotation=s,this._stRotation=u,this._vertexFormat=w.clone(c),this._extrudedHeight=o(h,0),this._extrude=d,this._closeTop=p,this._closeBottom=m,this._workerName="createRectangleGeometry"}var R=new i,O=new i,N=new i,L=new i,F=new E,B=new t,V=new e,k=new e,z=new i,U=new i;D.packedLength=E.packedLength+l.packedLength+w.packedLength+8,D.pack=function(e,t,i){i=o(i,0),E.pack(e._rectangle,t,i),i+=E.packedLength,l.pack(e._ellipsoid,t,i),i+=l.packedLength,w.pack(e._vertexFormat,t,i),i+=w.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};var G=new E,W=l.clone(l.UNIT_SPHERE),H=new w,q={rectangle:G,ellipsoid:W,vertexFormat:H,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,closeTop:void 0,closeBottom:void 0};D.unpack=function(e,t,i){t=o(t,0);var r=E.unpack(e,t,G);t+=E.packedLength;var n=l.unpack(e,t,W);t+=l.packedLength;var s=w.unpack(e,t,H);t+=w.packedLength;var u=e[t++],c=e[t++],h=e[t++],d=e[t++],p=e[t++],m=1===e[t++],f=1===e[t++],v=1===e[t];return a(i)?(i._rectangle=E.clone(r,i._rectangle),i._ellipsoid=l.clone(n,i._ellipsoid),i._vertexFormat=w.clone(s,i._vertexFormat),i._granularity=u,i._surfaceHeight=c,i._rotation=h,i._stRotation=d,i._extrudedHeight=m?p:void 0,i._extrude=m,i._closeTop=f,i._closeBottom=v,i):(q.granularity=u,q.height=c,q.rotation=h,q.stRotation=d,q.extrudedHeight=m?p:void 0,q.closeTop=f,q.closeBottom=v,new D(q))};var j=new v,Y=new g,X=new r,Z=new C,K=new r;return D.createGeometry=function(t){var r=E.clone(t._rectangle,F),n=t._ellipsoid,o=t._surfaceHeight,s=t._extrude,l=t._extrudedHeight,c=t._stRotation,d=t._vertexFormat,p=S.computeOptions(t,r,X),m=j,f=Y;if(a(c)){v.fromRotation(-c,m);var y=E.center(r,K),w=n.cartographicToCartesian(y,z);i.normalize(w,w),C.fromAxisAngle(w,-c,Z),g.fromQuaternion(Z,f)}else v.clone(v.IDENTITY,m),g.clone(g.IDENTITY,f);p.lonScalar=1/r.width,p.latScalar=1/r.height,p.vertexFormat=d,p.textureMatrix=m,p.tangentRotationMatrix=f,p.size=p.width*p.height;var T,x;if(r=t._rectangle,s){T=M(p);var b=e.fromRectangle3D(r,n,o,k),P=e.fromRectangle3D(r,n,l,V);x=e.union(b,P)}else T=A(p),T=_.scaleToGeodeticHeight(T,o,n,!1),x=e.fromRectangle3D(r,n,o);return d.position||delete T.attributes.position,new u({attributes:new h(T.attributes),indices:T.indices,primitiveType:T.primitiveType,boundingSphere:x})},D.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new D({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:n,stRotation:e._stRotation,granularity:r,extrudedHeight:a,height:o,closeTop:!0,closeBottom:!0,vertexFormat:w.POSITION_ONLY})},D}),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,v){"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;o>t;t++)v.computePosition(e,d,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=o-1,d=1;n>d;d++)v.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--)v.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--)v.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),_=0,y=0;yC;C++)_[y++]=C,_[y++]=C+1,_[y++]=C+c,_[y++]=C+c+1;return _[y++]=c-1,_[y++]=0,_[y++]=c+c-1,_[y++]=c,_[y++]=0,_[y++]=c,_[y++]=l-1,_[y++]=c+l-1,_[y++]=l+s-2,_[y++]=l+s-2+c,_[y++]=2*l+s-3,_[y++]=2*l+s-3+c,a.indices=_,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,E=new e,S=new t,w=new f;y.packedLength=f.packedLength+s.packedLength+5,y.pack=function(e,t,i){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)};var T=new f,x=s.clone(s.UNIT_SPHERE),b={rectangle:T,ellipsoid:x,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,T);t+=f.packedLength;var a=s.unpack(e,t,x);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):(b.granularity=l,b.height=u,b.rotation=c,b.extrudedHeight=h?d:void 0,new y(b))};var A=new i;return y.createGeometry=function(t){var i=f.clone(t._rectangle,w),r=t._ellipsoid,n=t._surfaceHeight,a=t._extrudedHeight,s=v.computeOptions(t,i,A);s.size=2*s.width+2*s.height-4;var u,c;if(i=t._rectangle,o(a)){u=_(s);var h=e.fromRectangle3D(i,r,n,E),d=e.fromRectangle3D(i,r,a,C);c=e.union(h,d)}else u=g(s),u=p.scaleToGeodeticHeight(u,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;o>n&&!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/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;n0?-120*t.detail:t.wheelDelta;if(r(i)){var o=h(t),a=e.getInputAction(l.WHEEL,o);r(a)&&(a(i),t.preventDefault())}}function C(e,i){e._seenAnyTouchEvents=!0;var r,n,o,a=i.changedTouches,s=a.length,l=e._positions;for(r=0;s>r;++r)n=a[r],o=n.identifier,l.set(o,u(e,n,new t));S(e,i);var c=e._previousPositions;for(r=0;s>r;++r)n=a[r],o=n.identifier,c.set(o,t.clone(l.get(o)))}function E(e,t){e._seenAnyTouchEvents=!0;var i,r,n,o=t.changedTouches,a=o.length,s=e._positions;for(i=0;a>i;++i)r=o[i],n=r.identifier,s.remove(n);S(e,t);var l=e._previousPositions;for(i=0;a>i;++i)r=o[i],n=r.identifier,l.remove(n)}function S(e,i){var n,o,a=h(i),s=e._positions,u=e._previousPositions,c=s.length;if(1!==c&&e._buttonDown===I.LEFT&&(e._buttonDown=void 0,n=e.getInputAction(l.LEFT_UP,a),r(n)&&(t.clone(e._primaryPosition,B.position),n(B)),0===c&&(o=e.getInputAction(l.LEFT_CLICK,a),r(o)))){var d=e._primaryStartPosition,p=u.values[0],m=d.x-p.x,f=d.y-p.y,v=Math.sqrt(m*m+f*f);vn;++n){o=s[n],a=o.identifier;var h=c.get(a);r(h)&&u(e,o,h)}T(e,i);var d=e._previousPositions;for(n=0;l>n;++n)o=s[n],a=o.identifier,t.clone(c.get(a),d.get(a))}function T(e,i){var n,o=h(i),a=e._positions,s=e._previousPositions,u=a.length;if(1===u&&e._buttonDown===I.LEFT){var c=a.values[0];t.clone(c,e._primaryPosition);var d=e._primaryPreviousPosition;n=e.getInputAction(l.MOUSE_MOVE,o),r(n)&&(t.clone(d,k.startPosition),t.clone(c,k.endPosition),n(k)),t.clone(c,d),i.preventDefault()}else if(2===u&&e._isPinching&&(n=e.getInputAction(l.PINCH_MOVE,o),r(n))){var p=a.values[0],m=a.values[1],f=s.values[0],v=s.values[1],g=m.x-p.x,_=m.y-p.y,y=.25*Math.sqrt(g*g+_*_),C=v.x-f.x,E=v.y-f.y,S=.25*Math.sqrt(C*C+E*E),w=.125*(m.y+p.y),T=.125*(v.y+f.y),x=Math.atan2(_,g),b=Math.atan2(E,C);t.fromElements(0,S,z.distance.startPosition),t.fromElements(0,y,z.distance.endPosition),t.fromElements(b,T,z.angleAndHeight.startPosition),t.fromElements(x,w,z.angleAndHeight.endPosition),n(z)}}function x(e,i){if(i.target.setPointerCapture(i.pointerId),"touch"===i.pointerType){var r=e._positions,n=i.pointerId;r.set(n,u(e,i,new t)),S(e,i);var o=e._previousPositions;o.set(n,t.clone(r.get(n)))}else f(e,i)}function b(e,t){if("touch"===t.pointerType){var i=e._positions,r=t.pointerId;i.remove(r),S(e,t);var n=e._previousPositions;n.remove(r)}else v(e,t)}function A(e,i){if("touch"===i.pointerType){var r=e._positions,n=i.pointerId;u(e,i,r.get(n)),T(e,i);var o=e._previousPositions;t.clone(r.get(n),o.get(n))}else g(e,i)}function P(r){this._inputEvents={},this._buttonDown=void 0,this._isPinching=!1,this._seenAnyTouchEvents=!1,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),p(this)}var I={LEFT:0,MIDDLE:1,RIGHT:2},M={position:new t},D={position:new t},R={position:new t},O={startPosition:new t,endPosition:new t},N={position:new t},L={position:new t},F={position1:new t,position2:new t},B={position:new t},V={position:new t},k={startPosition:new t,endPosition:new t},z={distance:{startPosition:new t,endPosition:new t},angleAndHeight:{startPosition:new t,endPosition:new t}};return P.prototype.setInputAction=function(e,t,i){var r=c(t,i);this._inputEvents[r]=e},P.prototype.getInputAction=function(e,t){var i=c(e,t);return this._inputEvents[i]},P.prototype.removeInputAction=function(e,t){var i=c(e,t);delete this._inputEvents[i]},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){return m(this),n(this)},P}),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)-E;return t=r.addSeconds(t,l(i),t)}function c(r,a,s,l,u,c,p,m){if(0>s&&(s=-s,u+=n.PI),0>s||s>n.PI)throw new i("The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.");var v=r*(1-a),g=l-u,_=u,y=d(c-l,a),C=h(a,0);if("Hyperbolic"===C&&Math.abs(n.negativePiToPi(y))>=Math.acos(-1/a))throw new i("The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.");f(g,s,_,I);var E=v*(1+a),S=Math.cos(y),w=Math.sin(y),T=1+a*S;if(T<=n.Epsilon10)throw new i("elements cannot be converted to cartesian");var x=E/T;return t(m)?(m.x=x*S,m.y=x*w,m.z=0):m=new e(x*S,x*w,0),o.multiplyByVector(I,m,m)}function h(e,t){if(0>e)throw new i("eccentricity cannot be negative.");return t>=e?"Circular":1-t>e?"Elliptical":1+t>=e?"Parabolic":"Hyperbolic"}function d(e,t){if(0>t||t>=1)throw new i("eccentricity out of range.");var r=p(e,t);return m(r,t)}function p(e,t){if(0>t||t>=1)throw new i("eccentricity out of range.");var r=Math.floor(e/n.TWO_PI);e-=r*n.TWO_PI;var o,a=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),s=Number.MAX_VALUE;for(o=0;M>o&&Math.abs(s-a)>D;++o){s=a;var l=s-t*Math.sin(s)-e,u=1-t*Math.cos(s);a=s-l/u}if(o>=M)throw new i("Kepler equation did not converge");return s=a+r*n.TWO_PI}function m(e,t){if(0>t||t>=1)throw new i("eccentricity out of range.");var r=Math.floor(e/n.TWO_PI);e-=r*n.TWO_PI;var o=Math.cos(e)-t,a=Math.sin(e)*Math.sqrt(1-t*t),s=Math.atan2(a,o);return s=n.zeroToTwoPi(s),0>e&&(s-=n.TWO_PI),s+=r*n.TWO_PI}function f(e,r,a,s){if(0>r||r>n.PI)throw new i("inclination out of range");var l=Math.cos(e),u=Math.sin(e),c=Math.cos(r),h=Math.sin(r),d=Math.cos(a),p=Math.sin(a);return t(s)?(s[0]=d*l-p*u*c,s[1]=p*l+d*u*c,s[2]=u*h,s[3]=-d*u-p*l*c,s[4]=-p*u+d*l*c,s[5]=l*h,s[6]=p*h,s[7]=-d*h,s[8]=c):s=new o(d*l-p*u*c,-d*u-p*l*c,p*h,p*l+d*u*c,-p*u+d*l*c,-d*h,u*h,l*h,c),s}function v(e,t){u(e,Ie);var i=Ie.dayNumber-S.dayNumber+(Ie.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*r,o=R+W*Math.cos(L*n)+Q*Math.sin(L*n)+H*Math.cos(F*n)+J*Math.sin(F*n)+q*Math.cos(B*n)+$*Math.sin(B*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)+Z*Math.cos(U*n)+re*Math.sin(U*n)+K*Math.cos(G*n)+ne*Math.sin(G*n),s=O+N*r+pe*Math.cos(oe*n)+Ee*Math.sin(oe*n)+me*Math.cos(ae*n)+Se*Math.sin(ae*n)+fe*Math.cos(se*n)+we*Math.sin(se*n)+ve*Math.cos(le*n)+Te*Math.sin(le*n)+ge*Math.cos(ue*n)+xe*Math.sin(ue*n)+_e*Math.cos(ce*n)+be*Math.sin(ce*n)+ye*Math.cos(he*n)+Ae*Math.sin(he*n)+Ce*Math.cos(de*n)+Pe*Math.sin(de*n),l=.0167086342-.0004203654*r,h=102.93734808*b+11612.3529*A*r,d=469.97289*A*r,p=174.87317577*b-8679.27034*A*r;return c(o,l,d,h,p,s,T,t)}function g(e,t){u(e,Ie);var i=Ie.dayNumber-S.dayNumber+(Ie.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,v=125.04455501*b,g=-6967919.3631*r+6.3602*n+.007625*o-3586e-8*s,_=218.31664563*b,y=1732559343.4847*r-6.391*n+.006588*o-3169e-8*s,C=297.85019547*b+A*(1602961601.209*r-6.3706*n+.006593*o-3169e-8*s),E=93.27209062*b+A*(1739527262.8478*r-12.7512*n-.001037*o+417e-8*s),T=134.96340251*b+A*(1717915923.2178*r+31.8792*n+.051635*o-2447e-7*s),P=357.52910918*b+A*(129596581.0481*r-.5532*n+136e-6*o-1149e-8*s),I=310.17137918*b-A*(6967051.436*r+6.2068*n+.007618*o-3219e-8*s),M=2*C,D=4*C,R=6*C,O=2*T,N=3*T,L=4*T,F=2*E; +l+=3400.4*Math.cos(M)-635.6*Math.cos(M-T)-235.6*Math.cos(T)+218.1*Math.cos(M-P)+181*Math.cos(M+T),h+=.014216*Math.cos(M-T)+.008551*Math.cos(M-O)-.001383*Math.cos(T)+.001356*Math.cos(M+T)-.001147*Math.cos(D-N)-914e-6*Math.cos(D-O)+869e-6*Math.cos(M-P-T)-627e-6*Math.cos(M)-394e-6*Math.cos(D-L)+282e-6*Math.cos(M-P-O)-279e-6*Math.cos(C-T)-236e-6*Math.cos(O)+231e-6*Math.cos(D)+229e-6*Math.cos(R-L)-201e-6*Math.cos(O-F),p+=486.26*Math.cos(M-F)-40.13*Math.cos(M)+37.51*Math.cos(F)+25.73*Math.cos(O-F)+19.97*Math.cos(M-P-F),f+=-55609*Math.sin(M-T)-34711*Math.sin(M-O)-9792*Math.sin(T)+9385*Math.sin(D-N)+7505*Math.sin(D-O)+5318*Math.sin(M+T)+3484*Math.sin(D-L)-3417*Math.sin(M-P-T)-2530*Math.sin(R-L)-2376*Math.sin(M)-2075*Math.sin(M-N)-1883*Math.sin(O)-1736*Math.sin(R-5*T)+1626*Math.sin(P)-1370*Math.sin(R-N),g+=-5392*Math.sin(M-F)-540*Math.sin(P)-441*Math.sin(M)+423*Math.sin(F)-288*Math.sin(O-F),y+=-3332.9*Math.sin(M)+1197.4*Math.sin(M-T)-662.5*Math.sin(P)+396.3*Math.sin(T)-218*Math.sin(M-P);var B=2*I,V=3*I;p+=46.997*Math.cos(I)*r-.614*Math.cos(M-F+I)*r+.614*Math.cos(M-F-I)*r-.0297*Math.cos(B)*n-.0335*Math.cos(I)*n+.0012*Math.cos(M-F+B)*n-16e-5*Math.cos(I)*o+4e-5*Math.cos(V)*o+4e-5*Math.cos(B)*o;var k=2.116*Math.sin(I)*r-.111*Math.sin(M-F-I)*r-.0015*Math.sin(I)*n;f+=k,y+=k,g+=-520.77*Math.sin(I)*r+13.66*Math.sin(M-F+I)*r+1.12*Math.sin(M-I)*r-1.06*Math.sin(F-I)*r+.66*Math.sin(B)*n+.371*Math.sin(I)*n-.035*Math.sin(M-F+B)*n-.015*Math.sin(M-F+I)*n+.0014*Math.sin(I)*o-.0011*Math.sin(V)*o-9e-4*Math.sin(B)*o,l*=x;var z=d+p*A,U=m+f*A,G=_+y*A,W=v+g*A;return c(l,h,z,U,W,G,w,t)}function _(t,i){return i=g(t,i),e.multiplyByScalar(i,De,i)}var y={},C=32.184,E=2451545,S=new r(2451545,0,s.TAI),w=398600435e6,T=1.012300034*w*328900.56,x=1e3,b=n.RADIANS_PER_DEGREE,A=n.RADIANS_PER_ARCSECOND,P=14959787e4,I=new o,M=50,D=n.EPSILON8,R=1.0000010178*P,O=100.46645683*b,N=1295977422.83429*A,L=16002,F=21863,B=32004,V=10931,k=14529,z=16368,U=15318,G=32794,W=64e-7*P,H=-152*1e-7*P,q=62e-7*P,j=-8e-7*P,Y=32e-7*P,X=-41*1e-7*P,Z=19e-7*P,K=-11*1e-7*P,Q=-150*1e-7*P,J=-46*1e-7*P,$=68*1e-7*P,ee=54e-7*P,te=14e-7*P,ie=24e-7*P,re=-28*1e-7*P,ne=22e-7*P,oe=10,ae=16002,se=21863,le=10931,ue=1473,ce=32004,he=4387,de=73,pe=-325*1e-7,me=-322*1e-7,fe=-79*1e-7,ve=232*1e-7,ge=-52*1e-7,_e=97e-7,ye=55e-7,Ce=-41*1e-7,Ee=-105*1e-7,Se=-137*1e-7,we=258e-7,Te=35e-7,xe=-116*1e-7,be=-88*1e-7,Ae=-112*1e-7,Pe=-80*1e-7,Ie=new r(0,0,s.TAI),Me=.012300034,De=Me/(Me+1)*-1,Re=new o(1.0000000000000002,5.619723173785822e-16,4.690511510146299e-19,-5.154129427414611e-16,.9174820620691819,-.39777715593191376,-2.23970096136568e-16,.39777715593191376,.9174820620691819),Oe=new e;return y.computeSunPositionInEarthInertialFrame=function(i,n){return t(i)||(i=r.now()),t(n)||(n=new e),Oe=v(i,Oe),n=e.negate(Oe,n),_(i,Oe),e.subtract(n,Oe,n),o.multiplyByVector(Re,n,n),n},y.computeMoonPositionInEarthInertialFrame=function(e,i){return t(e)||(e=r.now()),i=g(e,i),o.multiplyByVector(Re,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,v=n.green,g=n.blue,_=n.alpha;if(i.equals(r,n)){for(l=0;u>l;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=(v-h)/u,E=(g-d)/u,S=(_-m)/u,w=s;for(l=0;u>l;l++)a[w++]=i.floatToByte(c+l*y),a[w++]=i.floatToByte(h+l*C),a[w++]=i.floatToByte(d+l*E),a[w++]=i.floatToByte(m+l*S);return w}function v(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}v.pack=function(e,r,a){a=n(a,0);var l,u=e._positions,c=u.length;for(r[a++]=c,l=0;c>l;++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;c>l;++l,a+=i.packedLength)i.pack(h[l],r,a);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},v.unpack=function(e,r,a){r=n(r,0);var l,u=e[r++],c=new Array(u);for(l=0;u>l;++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;u>l;++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 v({positions:c,colors:h,ellipsoid:d,colorsPerVertex:p,followSurface:m,granularity:f})};var g=new Array(2),_=new Array(2),y={positions:g,height:_,ellipsoid:void 0,minDistance:void 0};return v.createGeometry=function(n){var a,s,v,C,E,S=n._positions,w=n._colors,T=n._colorsPerVertex,x=n._followSurface,b=n._granularity,A=n._ellipsoid,P=d.chordLength(b,A.maximumRadius),I=o(w)&&!T,M=S.length,D=0;if(x){var R=p.extractHeights(S,A),O=y;if(O.minDistance=P,O.ellipsoid=A,I){var N=0;for(a=0;M-1>a;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=_;var L=0;for(a=0;M-1>a;++a){g[0]=S[a],g[1]=S[a+1],_[0]=R[a],_[1]=R[a+1];var F=p.generateArc(O);if(o(w)){var B=F.length/3;E=w[a];for(var V=0;B>V;++V)C[L++]=i.floatToByte(E.red),C[L++]=i.floatToByte(E.green),C[L++]=i.floatToByte(E.blue),C[L++]=i.floatToByte(E.alpha)}s.set(F,D),D+=F.length}}else if(O.positions=S,O.height=R,s=new Float64Array(p.generateArc(O)),o(w)){for(C=new Uint8Array(s.length/3*4),a=0;M-1>a;++a){var k=S[a],z=S[a+1],U=w[a],G=w[a+1];D=f(k,z,U,G,P,C,D)}var W=w[M-1];C[D++]=i.floatToByte(W.red),C[D++]=i.floatToByte(W.green),C[D++]=i.floatToByte(W.blue),C[D++]=i.floatToByte(W.alpha)}}else{v=I?2*M-2:M,s=new Float64Array(3*v),C=o(w)?new Uint8Array(4*v):void 0;var H=0,q=0;for(a=0;M>a;++a){var j=S[a];if(I&&a>0&&(t.pack(j,s,H),H+=3,E=w[a-1],C[q++]=i.floatToByte(E.red),C[q++]=i.floatToByte(E.green),C[q++]=i.floatToByte(E.blue),C[q++]=i.floatToByte(E.alpha)),I&&a===M-1)break;t.pack(j,s,H),H+=3,o(w)&&(E=w[a],C[q++]=i.floatToByte(E.red),C[q++]=i.floatToByte(E.green),C[q++]=i.floatToByte(E.blue),C[q++]=i.floatToByte(E.alpha))}}var Y=new c;Y.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:s}),o(w)&&(Y.color=new u({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:C,normalize:!0})),v=s.length/3;var X=2*(v-1),Z=h.createTypedArray(v,X),K=0;for(a=0;v-1>a;++a)Z[K++]=a,Z[K++]=a+1;return new l({attributes:Y,indices:Z,primitiveType:m.LINES,boundingSphere:e.fromPoints(S)})},v}),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){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){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){return t(e)?t(i)?(i.clock=e.clock,i.cone=e.cone,i.magnitude=e.magnitude,i):new r(e.clock,e.cone,e.magnitude):void 0},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;r>n;){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){throw new t("This type should not be instantiated directly. Instead, use WebMercatorTilingScheme or GeographicTilingScheme.")}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;t>r;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?!1: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?!1: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;n>o;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-1l;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),0>o?o=~o:o>0&&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);0>n&&(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(nh&&(h=d-h),l=h):l=h>d?d:0>h?0:h;var m=o?e(this.tolerance,1):.001;Math.abs(l-p)>m&&(this._seeking=!0,r.currentTime=l)}},l}),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,v,g){"use strict";function _(e,t){this.rectangle=e,this.maxLevel=t}function y(n){function u(e){var t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"!==t)return void c("SRS "+t+" is not supported.");C._tilingScheme=new l({ellipsoid:E});var i=e.getElementsByTagName("TileFormat")[0];C._heightmapWidth=parseInt(i.getAttribute("width"),10),C._heightmapHeight=parseInt(i.getAttribute("height"),10),C._levelZeroMaximumGeometricError=f.getEstimatedLevelZeroGeometricErrorForAHeightmap(E,Math.min(C._heightmapWidth,C._heightmapHeight),C._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=n.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0};var v=n.credit;"string"==typeof v&&(v=new t(v)),this._credit=v,this._tilingScheme=void 0,this._rectangles=[];var y,C=this,E=i(n.ellipsoid,a.WGS84);h()}function C(e,t,i,n){for(var o=e._tilingScheme,a=e._rectangles,s=o.tileXYToRectangle(t,i,n),l=0,u=0;ua)return{positions:r};var s=t(o),u=t(n),c=new Array(a),p=new Array(a),m=new Array(a),f=r[0];c[0]=f;var v=i.cartesianToCartographic(f,h);u&&(v.height=n[0]),p[0]=v.height,s?m[0]=o[0]:m[0]=0;for(var g=1,_=1;a>_;++_){var y=r[_],C=i.cartesianToCartographic(y,d);u&&(C.height=n[_]),l(v,C)?v.height=3){var v=r.fromPoints(t,e),g=v.projectPointsOntoPlane(t);o.computeWindingOrder2D(g)===s.CLOCKWISE&&(t.reverse(),i.reverse(),l.reverse())}var _,y,C=t.length,E=n.chordLength(c,e.maximumRadius),S=f;if(S.minDistance=E,S.ellipsoid=e,h){var w,T=0;for(w=0;C-1>w;w++)T+=a.numberOfPoints(t[w],t[w+1],E)+1;_=new Float64Array(3*T),y=new Float64Array(3*T);var x=p,b=m;S.positions=x,S.height=b;var A=0;for(w=0;C-1>w;w++){x[0]=t[w],x[1]=t[w+1],b[0]=i[w],b[1]=i[w+1];var P=a.generateArc(S);_.set(P,A),b[0]=l[w],b[1]=l[w+1],y.set(a.generateArc(S),A),A+=P.length}}else S.positions=t,S.height=i,_=new Float64Array(a.generateArc(S)),S.height=l,y=new Float64Array(a.generateArc(S));return{bottomPositions:y,topPositions:_}}},c}),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 v=new t,g=new t,_=new t,y=new t,C=new t,E=new t,S=new t,w=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;u>s;++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;u>s;++s)i[o++]=c[s];var h=e._maximumHeights;if(u=n(h)?h.length:0,i[o++]=u,n(h))for(s=0;u>s;++s)i[o++]=h[s];a.pack(e._ellipsoid,i,o),o+=a.packedLength,p.pack(e._vertexFormat,i,o),o+=p.packedLength,i[o]=e._granularity};var T=a.clone(a.UNIT_SPHERE),x=new p,b={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:T,vertexFormat:x,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;l>s;++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;l>s;++s)c[s]=e[i++];l=e[i++];var h;if(l>0)for(h=new Array(l),s=0;l>s;++s)h[s]=e[i++];var d=a.unpack(e,i,T);i+=a.packedLength;var m=p.unpack(e,i,x);i+=p.packedLength;var v=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=v,o):(b.positions=u,b.minimumHeights=c,b.maximumHeights=h,b.granularity=v,new f(b))},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;c>h;++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,T=r._granularity,x=r._ellipsoid,b=m.computePositions(x,o,p,a,T,!0);if(n(b)){var A=b.bottomPositions,P=b.topPositions,I=P.length,M=2*I,D=f.position?new Float64Array(M):void 0,R=f.normal?new Float32Array(M):void 0,O=f.tangent?new Float32Array(M):void 0,N=f.binormal?new Float32Array(M):void 0,L=f.st?new Float32Array(M/3*2):void 0,F=0,B=0,V=0,k=0,z=0,U=w,G=S,W=E,H=!0;I/=3;var q,j=0,Y=1/(I-o.length+1);for(q=0;I>q;++q){var X=3*q,Z=t.fromArray(P,X,v),K=t.fromArray(A,X,g);if(f.position&&(D[F++]=K.x,D[F++]=K.y,D[F++]=K.z,D[F++]=Z.x,D[F++]=Z.y,D[F++]=Z.z),f.st&&(L[z++]=j,L[z++]=0,L[z++]=j,L[z++]=1),f.normal||f.tangent||f.binormal){var Q,J=t.clone(t.ZERO,C),$=x.scaleToGeodeticSurface(t.fromArray(P,X,g),g);if(I>q+1&&(Q=x.scaleToGeodeticSurface(t.fromArray(P,X+3,_),_),J=t.fromArray(P,X+3,C)),H){var ee=t.subtract(J,Z,y),te=t.subtract($,Z,v);U=t.normalize(t.cross(te,ee,U),U),H=!1}t.equalsEpsilon(Q,$,h.EPSILON10)?H=!0:(j+=Y,f.tangent&&(G=t.normalize(t.subtract(Q,$,G),G)),f.binormal&&(W=t.normalize(t.cross(U,G,W),W))),f.normal&&(R[B++]=U.x,R[B++]=U.y,R[B++]=U.z,R[B++]=U.x,R[B++]=U.y,R[B++]=U.z),f.tangent&&(O[k++]=G.x,O[k++]=G.y,O[k++]=G.z,O[k++]=G.x,O[k++]=G.y,O[k++]=G.z),f.binormal&&(N[V++]=W.x,N[V++]=W.y,N[V++]=W.z,N[V++]=W.x,N[V++]=W.y,N[V++]=W.z)}}var ie=new u;f.position&&(ie.position=new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:D})),f.normal&&(ie.normal=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:R})),f.tangent&&(ie.tangent=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:O})),f.binormal&&(ie.binormal=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:N})),f.st&&(ie.st=new l({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:L}));var re=M/3;M-=6;var ne=c.createTypedArray(re,M),oe=0;for(q=0;re-2>q;q+=2){var ae=q,se=q+2,le=t.fromArray(D,3*ae,v),ue=t.fromArray(D,3*se,g);if(!t.equalsEpsilon(le,ue,h.EPSILON10)){var ce=q+1,he=q+3;ne[oe++]=ce,ne[oe++]=ae,ne[oe++]=he,ne[oe++]=he,ne[oe++]=ae,ne[oe++]=se}}return new s({attributes:ie,indices:ne,primitiveType:d.TRIANGLES,boundingSphere:new e.fromVertices(D)})}},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,v=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;u>s;++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;u>s;++s)i[o++]=c[s];var h=e._maximumHeights;if(u=n(h)?h.length:0,i[o++]=u,n(h))for(s=0;u>s;++s)i[o++]=h[s];a.pack(e._ellipsoid,i,o),o+=a.packedLength,i[o]=e._granularity};var g=a.clone(a.UNIT_SPHERE),_={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;l>s;++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;l>s;++s)c[s]=e[i++];l=e[i++];var h;if(l>0)for(h=new Array(l),s=0;l>s;++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):(_.positions=u,_.minimumHeights=c,_.maximumHeights=h,_.granularity=p,new m(_))},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;c>h;++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,_=r._ellipsoid,y=p.computePositions(_,o,m,a,g,!1); +if(n(y)){var C=y.bottomPositions,E=y.topPositions,S=E.length,w=2*S,T=new Float64Array(w),x=0;S/=3;var b;for(b=0;S>b;++b){var A=3*b,P=t.fromArray(E,A,f),I=t.fromArray(C,A,v);T[x++]=I.x,T[x++]=I.y,T[x++]=I.z,T[x++]=P.x,T[x++]=P.y,T[x++]=P.z}var M=new u({position:new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:T})}),D=w/3;w=2*D-4+D;var R=c.createTypedArray(D,w),O=0;for(b=0;D-2>b;b+=2){var N=b,L=b+2,F=t.fromArray(T,3*N,f),B=t.fromArray(T,3*L,v);if(!t.equalsEpsilon(F,B,h.EPSILON10)){var V=b+1,k=b+3;R[O++]=V,R[O++]=N,R[O++]=V,R[O++]=k,R[O++]=N,R[O++]=L}}return R[O++]=D-2,R[O++]=D-1,new s({attributes:M,indices:R,primitiveType:d.LINES,boundingSphere:new e.fromVertices(T)})}},m}),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/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<=s&&(g=s-1);var _=v/d|0;return _>=l&&(_=l-1),i(n)?(n.x=g,n.y=_,n):new e(g,_)}},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/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event"],function(e,t,i,r,n){"use strict";function o(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new n,this.setValue(e)}return i(o.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),o.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},o.prototype.setValue=function(e){var i=this._value;if(i!==e){var r=t(e),n=r&&"function"==typeof e.clone,o=r&&"function"==typeof e.equals;this._hasClone=n,this._hasEquals=o;var a=!o||!e.equals(i);a&&(this._value=n?e.clone():e,this._definitionChanged.raiseEvent(this))}},o.prototype.equals=function(e){return this===e||e instanceof o&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},o}),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._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._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"),pixelOffset:o("pixelOffset"),show:o("show"),width:o("width"),height:o("height"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),sizeInMeters:o("sizeInMeters")}),a.prototype.clone=function(e){return t(e)?(e.color=this._color,e.eyeOffset=this._eyeOffset,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):new a(this)},a.prototype.merge=function(t){this.color=e(this._color,t.color),this.eyeOffset=e(this._eyeOffset,t.eyeOffset),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)},a}),i("Renderer/BufferUsage",["../Core/freezeObject","./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/Buffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/IndexDatatype","./BufferUsage","./WebGLConstants"],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:s.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),a=new l({context:t,bufferTarget:s.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),u=a.sizeInBytes/n;return i(a,{indexDatatype:{get:function(){return r}},bytesPerIndex:{get:function(){return n}},numberOfIndices:{get:function(){return u}}}),a},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/DrawCommand",["../Core/defaultValue","../Core/PrimitiveType"],function(e,t){"use strict";function i(i){i=e(i,e.EMPTY_OBJECT),this.boundingVolume=i.boundingVolume,this.orientedBoundingBox=i.orientedBoundingBox,this.cull=e(i.cull,!0),this.modelMatrix=i.modelMatrix,this.primitiveType=e(i.primitiveType,t.TRIANGLES),this.vertexArray=i.vertexArray,this.count=i.count,this.offset=e(i.offset,0),this.instanceCount=e(i.instanceCount,0),this.shaderProgram=i.shaderProgram,this.uniformMap=i.uniformMap,this.renderState=i.renderState,this.framebuffer=i.framebuffer,this.pass=i.pass,this.executeInClosestFrustum=e(i.executeInClosestFrustum,!1),this.owner=i.owner,this.debugShowBoundingVolume=e(i.debugShowBoundingVolume,!1),this.debugOverlappingFrustums=0,this.oit=void 0}return i.prototype.execute=function(e,t,i,r){e.draw(this,t,i,r)},i}),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/RenderState",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/RuntimeError","../Core/WindingOrder","./ContextLimits","./WebGLConstants"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(n){var o=i(n,{}),s=i(o.cull,{}),u=i(o.polygonOffset,{}),c=i(o.scissorTest,{}),h=i(c.rectangle,{}),d=i(o.depthRange,{}),p=i(o.depthTest,{}),m=i(o.colorMask,{}),f=i(o.blending,{}),v=i(f.color,{}),g=i(o.stencilTest,{}),_=i(g.frontOperation,{}),y=i(g.backOperation,{}),C=i(o.sampleCoverage,{}),E=o.viewport;this.frontFace=i(o.frontFace,a.COUNTER_CLOCKWISE),this.cull={enabled:i(s.enabled,!1),face:i(s.face,l.BACK)},this.lineWidth=i(o.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,l.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(o.depthMask,!0),this.stencilMask=i(o.stencilMask,-1),this.blending={enabled:i(f.enabled,!1),color:new t(i(v.red,0),i(v.green,0),i(v.blue,0),i(v.alpha,0)),equationRgb:i(f.equationRgb,l.FUNC_ADD),equationAlpha:i(f.equationAlpha,l.FUNC_ADD),functionSourceRgb:i(f.functionSourceRgb,l.ONE),functionSourceAlpha:i(f.functionSourceAlpha,l.ONE),functionDestinationRgb:i(f.functionDestinationRgb,l.ZERO),functionDestinationAlpha:i(f.functionDestinationAlpha,l.ZERO)},this.stencilTest={enabled:i(g.enabled,!1),frontFunction:i(g.frontFunction,l.ALWAYS),backFunction:i(g.backFunction,l.ALWAYS),reference:i(g.reference,0),mask:i(g.mask,-1),frontOperation:{fail:i(_.fail,l.KEEP),zFail:i(_.zFail,l.KEEP),zPass:i(_.zPass,l.KEEP)},backOperation:{fail:i(y.fail,l.KEEP),zFail:i(y.zFail,l.KEEP),zPass:i(y.zPass,l.KEEP)}},this.sampleCoverage={enabled:i(C.enabled,!1),value:i(C.value,1),invert:i(C.invert,!1)},this.viewport=r(E)?new e(E.x,E.y,E.width,E.height):void 0,this.id=0,this._applyFunctions=[]}function c(e,t,i){i?e.enable(t):e.disable(t)}function h(e,t){e.frontFace(t.frontFace)}function d(e,t){var i=t.cull,r=i.enabled;c(e,e.CULL_FACE,r),r&&e.cullFace(i.face)}function p(e,t){e.lineWidth(t.lineWidth)}function m(e,t){var i=t.polygonOffset,r=i.enabled;c(e,e.POLYGON_OFFSET_FILL,r),r&&e.polygonOffset(i.factor,i.units)}function f(e,t,i){var n=t.scissorTest,o=r(i.scissorTest)?i.scissorTest.enabled:n.enabled;if(c(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 v(e,t){var i=t.depthRange;e.depthRange(i.near,i.far)}function g(e,t){var i=t.depthTest,r=i.enabled;c(e,e.DEPTH_TEST,r),r&&e.depthFunc(i.func)}function _(e,t){var i=t.colorMask;e.colorMask(i.red,i.green,i.blue,i.alpha)}function y(e,t){e.depthMask(t.depthMask)}function C(e,t){e.stencilMask(t.stencilMask)}function E(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function S(e,t,i){var n=t.blending,o=r(i.blendingEnabled)?i.blendingEnabled:n.enabled;c(e,e.BLEND,o),o&&(E(e,n.color),e.blendEquationSeparate(n.equationRgb,n.equationAlpha),e.blendFuncSeparate(n.functionSourceRgb,n.functionDestinationRgb,n.functionSourceAlpha,n.functionDestinationAlpha))}function w(e,t){var i=t.stencilTest,r=i.enabled;if(c(e,e.STENCIL_TEST,r),r){var n=i.frontFunction,o=i.backFunction,a=i.reference,s=i.mask;e.stencilFunc(i.frontFunction,i.reference,i.mask),e.stencilFuncSeparate(e.BACK,o,a,s),e.stencilFuncSeparate(e.FRONT,n,a,s);var l=i.frontOperation,u=l.fail,h=l.zFail,d=l.zPass;e.stencilOpSeparate(e.FRONT,u,h,d);var p=i.backOperation,m=p.fail,f=p.zFail,v=p.zPass;e.stencilOpSeparate(e.BACK,m,f,v)}}function T(e,t){var i=t.sampleCoverage,r=i.enabled;c(e,e.SAMPLE_COVERAGE,r),r&&e.sampleCoverage(i.value,i.invert)}function x(e,t,n){var o=i(t.viewport,n.viewport);r(o)||(o=I,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 b(e,t){var i=[];return e.frontFace!==t.frontFace&&i.push(h),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&i.push(d),e.lineWidth!==t.lineWidth&&i.push(p),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&i.push(m),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&i.push(v),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&i.push(g),(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(_),e.depthMask!==t.depthMask&&i.push(y),e.stencilMask!==t.stencilMask&&i.push(C),(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(w),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&i.push(T),i}var A=0,P={};u.fromCache=function(e){var t=JSON.stringify(e),i=P[t];if(r(i))return++i.referenceCount,i.state;var n=new u(e),o=JSON.stringify(n);return i=P[o],r(i)||(n.id=A++,i={referenceCount:0,state:n},P[o]=i),++i.referenceCount,P[t]={referenceCount:1,state:i.state},i.state},u.removeFromCache=function(e){var t=new u(e),i=JSON.stringify(t),n=P[i],o=JSON.stringify(e),a=P[o];r(a)&&(--a.referenceCount,0===a.referenceCount&&(delete P[o],r(n)&&--n.referenceCount)),r(n)&&0===n.referenceCount&&delete P[i]},u.getCache=function(){return P},u.clearCache=function(){P={}};var I=new e;return u.apply=function(e,t,i){h(e,t),d(e,t),p(e,t),m(e,t),v(e,t),g(e,t),_(e,t),y(e,t),C(e,t),w(e,t),T(e,t),f(e,t,i),S(e,t,i),x(e,t,i)},u.partialApply=function(e,t,i,n,o,a){if(t!==i){var s=i._applyFunctions[t.id];r(s)||(s=b(t,i),i._applyFunctions[t.id]=s);for(var l=s.length,u=0;l>u;++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)&&f(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)&&S(e,i,o),(t!==i||n.context!==o.context)&&x(e,i,o)},u.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}},u}),i("Renderer/AutomaticUniforms",["../Core/Cartesian3","../Core/Matrix4","./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_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}})};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 v(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 _(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 E(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 v(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 _(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 E(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;if(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));else{ +if(!n(e.x))throw new o('Invalid vec3 value for uniform "'+this._activethis.name+'".');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;if(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));else{if(!n(e.x))throw new o('Invalid vec4 value for uniform "'+this._activethis.name+'".');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},v.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))},_.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))},E.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/defineProperties","../Core/DeveloperError","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,t,i,r){switch(t.type){case e.FLOAT:return new d(e,t,i,r);case e.FLOAT_VEC2:return new p(e,t,i,r);case e.FLOAT_VEC3:return new m(e,t,i,r);case e.FLOAT_VEC4:return new f(e,t,i,r);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new v(e,t,i,r);case e.INT:case e.BOOL:return new g(e,t,i,r);case e.INT_VEC2:case e.BOOL_VEC2:return new _(e,t,i,r);case e.INT_VEC3:case e.BOOL_VEC3:return new y(e,t,i,r);case e.INT_VEC4:case e.BOOL_VEC4:return new C(e,t,i,r);case e.FLOAT_MAT2:return new E(e,t,i,r);case e.FLOAT_MAT3:return new S(e,t,i,r);case e.FLOAT_MAT4:return new w(e,t,i,r);default:throw new c("Unrecognized uniform type: "+t.type+' for uniform "'+i+'".')}}function d(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 p(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 m(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 f(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 v(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 g(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 _(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 y(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 C(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 E(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 S(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 w(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 d.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0;t>n;++n){var o=e[n];o!==i[n]&&(i[n]=o,r=!0)}r&&this._gl.uniform1fv(this._location,i)},p.prototype.set=function(){for(var t=this.value,i=t.length,r=this._value,n=!1,o=0,a=0;i>a;++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)},m.prototype.set=function(){for(var e=this.value,i=e.length,r=this._value,o=!1,s=0,l=0;i>l;++l){var u=e[l];if(n(u.red))(u.red!==r[s]||u.green!==r[s+1]||u.blue!==r[s+2])&&(r[s]=u.red,r[s+1]=u.green,r[s+2]=u.blue,o=!0);else{if(!n(u.x))throw new a("Invalid vec3 value.");t.equalsArray(u,r,s)||(t.pack(u,r,s),o=!0)}s+=3}o&&this._gl.uniform3fv(this._location,r)},f.prototype.set=function(){for(var e=this.value,t=e.length,o=this._value,s=!1,l=0,u=0;t>u;++u){var c=e[u];if(n(c.red))r.equalsArray(c,o,l)||(r.pack(c,o,l),s=!0);else{if(!n(c.x))throw new a("Invalid vec4 value.");i.equalsArray(c,o,l)||(i.pack(c,o,l),s=!0)}l+=4}s&&this._gl.uniform4fv(this._location,o)},v.prototype.set=function(){for(var e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,i=this.value,r=i.length,n=0;r>n;++n){var o=i[n];e.activeTexture(t+n),e.bindTexture(o._target,o._texture)}},v.prototype._setSampler=function(e){this.textureUnitIndex=e;for(var t=this._locations,i=t.length,r=0;i>r;++r){var n=e+r;this._gl.uniform1i(t[r],n)}return e+i},g.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0;t>n;++n){var o=e[n];o!==i[n]&&(i[n]=o,r=!0)}r&&this._gl.uniform1iv(this._location,i)},_.prototype.set=function(){for(var t=this.value,i=t.length,r=this._value,n=!1,o=0,a=0;i>a;++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)},y.prototype.set=function(){for(var e=this.value,i=e.length,r=this._value,n=!1,o=0,a=0;i>a;++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)},C.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,n=!1,o=0,a=0;t>a;++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)},E.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;t>o;++o){var a=e[o];s.equalsArray(a,i,n)||(s.pack(a,i,n),r=!0),n+=4}r&&this._gl.uniformMatrix2fv(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;t>o;++o){var a=e[o];l.equalsArray(a,i,n)||(l.pack(a,i,n),r=!0),n+=9}r&&this._gl.uniformMatrix3fv(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;t>o;++o){var a=e[o];u.equalsArray(a,i,n)||(u.pack(a,i,n),r=!0),n+=16}r&&this._gl.uniformMatrix4fv(this._location,!1,i)},h}),i("Renderer/ShaderProgram",["../Core/defaultValue","../Core/defined","../Core/definedNotNull","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/RuntimeError","./AutomaticUniforms","./ContextLimits","./createUniform","./createUniformArray"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){var t=p(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=C++}function d(e){var t=[],r=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(i(r))for(var n=r.length,o=0;n>o;o++){var a=r[o].trim(),s=a.slice(a.lastIndexOf(" ")+1);t.push(s)}return t}function p(e,t){var i={};if(!l.highpFloatSupported||!l.highpIntSupported){var r,n,o,a,s=d(e),u=d(t),c=s.length,h=u.length;for(r=0;c>r;r++)for(n=0;h>n;n++)if(s[r]===u[n]){o=s[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 m(e,i){var r=i._vertexShaderText,n=i._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,r),e.compileShader(o);var s=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(s,n),e.compileShader(s);var l=e.createProgram();e.attachShader(l,o),e.attachShader(l,s),e.deleteShader(o),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(E+"Fragment shader compile log: "+h),t(d)){var p=d.getTranslatedShaderSource(s);""!==p?console.error(E+"Translated fragment shader source:\n"+p):console.error(E+"Fragment shader translation failed.")}throw e.deleteProgram(l),new a("Fragment shader failed to compile. Compile log: "+h)}if(!e.getShaderParameter(o,e.COMPILE_STATUS)){if(h=e.getShaderInfoLog(o),console.error(E+"Vertex shader compile log: "+h),t(d)){var m=d.getTranslatedShaderSource(o);""!==m?console.error(E+"Translated vertex shader source:\n"+m):console.error(E+"Vertex shader translation failed.")}throw e.deleteProgram(l),new a("Vertex shader failed to compile. Compile log: "+h)}throw h=e.getProgramInfoLog(l),console.error(E+"Shader program link log: "+h),t(d)&&(console.error(E+"Translated vertex shader source:\n"+d.getTranslatedShaderSource(o)),console.error(E+"Translated fragment shader source:\n"+d.getTranslatedShaderSource(s))),e.deleteProgram(l),new a("Program failed to link. Link log: "+h)}var f=i._logShaderCompilation;return f&&(h=e.getShaderInfoLog(o),t(h)&&h.length>0&&console.log(E+"Vertex shader compile log: "+h)),f&&(h=e.getShaderInfoLog(s),t(h)&&h.length>0&&console.log(E+"Fragment shader compile log: "+h)),f&&(h=e.getProgramInfoLog(l),t(h)&&h.length>0&&console.log(E+"Shader program link log: "+h)),l}function f(e,t,i){for(var r={},n=0;i>n;++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 v(e,i){for(var r={},n=[],o=[],a=e.getProgramParameter(i,e.ACTIVE_UNIFORMS),s=0;a>s;++s){var l=e.getActiveUniform(i,s),h="[0]",d=-1!==l.name.indexOf(h,l.name.length-h.length)?l.name.slice(0,l.name.length-3):l.name;if(0!==d.indexOf("gl_"))if(l.name.indexOf("[")<0){var p=e.getUniformLocation(i,d);if(null!==p){var m=u(e,l,d,p);r[d]=m,n.push(m),m._setSampler&&o.push(m)}}else{var f,v,g,_,y=d.indexOf("[");if(y>=0){if(f=r[d.slice(0,y)],!t(f))continue;v=f._locations,v.length<=1&&(g=f.value,_=e.getUniformLocation(i,d),null!==_&&(v.push(_),g.push(e.getUniform(i,_))))}else{v=[];for(var C=0;Co;++o)r=i[o]._setSampler(r);return e.useProgram(null),r}function y(e){if(!t(e._program)){var i=e._gl,r=m(i,e,e._debugShaders),n=i.getProgramParameter(r,i.ACTIVE_ATTRIBUTES),o=v(i,r),a=g(e,o.uniformsByName);e._program=r,e._numberOfVertexAttributes=n,e._vertexAttributes=f(i,r,n),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=_(i,r,o.samplerUniforms)}}var C=0;h.fromCache=function(t){return t=e(t,e.EMPTY_OBJECT),t.context.shaderCache.getShaderProgram(t)},h.replaceCache=function(t){return t=e(t,e.EMPTY_OBJECT),t.context.shaderCache.replaceShaderProgram(t)},r(h.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return y(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return y(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return y(this),this._uniformsByName}}});var E="[Cesium WebGL] ";return h.prototype._bind=function(){y(this),this._gl.useProgram(this._program)},h.prototype._setUniforms=function(e,i,r){var n,a;if(t(e)){var s=this._manualUniforms;for(n=s.length,a=0;n>a;++a){var l=s[a];l.value=e[l.name]()}}var u=this._automaticUniforms;for(n=u.length,a=0;n>a;++a){var c=u[a];c.uniform.value=c.automaticUniform.getValue(i)}var h=this._uniforms;for(n=h.length,a=0;n>a;++a)h[a].set();if(r){var d=this._gl,p=this._program;if(d.validateProgram(p),!d.getProgramParameter(p,d.VALIDATE_STATUS))throw new o("Program validation failed. Program info log: "+d.getProgramInfoLog(p))}},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},h.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),n(this)},h}),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/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/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/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 stx = floor(temp) / 4096.0;\nfloat sty = temp - floor(temp);\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, shininess);\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, 160581375.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/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 / 160581375.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/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","./Functions/alphaWeight","./Functions/antialias","./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/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,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,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,ve,ge,_e,ye,Ce,Ee){"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_pi:d,czm_piOverFour:p,czm_piOverSix:m,czm_piOverThree:f,czm_piOverTwo:v,czm_radiansPerDegree:g,czm_sceneMode2D:_,czm_sceneMode3D:y,czm_sceneModeColumbusView:C,czm_sceneModeMorphing:E,czm_solarRadius:S,czm_threePiOver2:w,czm_twoPi:T,czm_webMercatorMaxLatitude:x,czm_depthRangeStruct:b,czm_ellipsoid:A,czm_material:P,czm_materialInput:I,czm_ray:M,czm_raySegment:D,czm_alphaWeight:R,czm_antialias:O,czm_columbusViewMorph:N,czm_computePosition:L,czm_cosineAndSine:F,czm_decompressTextureCoordinates:B,czm_eastNorthUpToEyeCoordinates:V,czm_ellipsoidContainsPoint:k,czm_ellipsoidNew:z,czm_ellipsoidWgs84TextureCoordinates:U,czm_equalsEpsilon:G,czm_eyeOffset:W,czm_eyeToWindowCoordinates:H,czm_fog:q,czm_geodeticSurfaceNormal:j,czm_getDefaultMaterial:Y,czm_getLambertDiffuse:X,czm_getSpecular:Z,czm_getWaterNoise:K,czm_getWgs84EllipsoidEC:Q,czm_hue:J,czm_isEmpty:$,czm_isFull:ee,czm_latitudeToWebMercatorFraction:te,czm_luminance:ie,czm_metersPerPixel:re,czm_modelToWindowCoordinates:ne,czm_multiplyWithColorBalance:oe,czm_nearFarScalar:ae,czm_octDecode:se,czm_packDepth:le,czm_phong:ue,czm_pointAlongRay:ce,czm_rayEllipsoidIntersectionInterval:he,czm_RGBToXYZ:de,czm_saturation:pe,czm_signNotZero:me,czm_tangentToEyeSpaceMatrix:fe,czm_translateRelativeToEye:ve,czm_translucentPhong:ge,czm_transpose:_e,czm_unpackDepth:ye,czm_windowToEyeCoordinates:Ce,czm_XYZToRGB:Ee}}),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;t>r;++r)i+="\n";return i})}function a(e,i,r){for(var n,a=0;a0;){var n=e.pop();r.push(n),0===n.requiredBy.length&&t.push(n)}for(;t.length>0;){var o=t.shift();e.push(o);for(var a=0;a=0;--n)r=r+t[n].glslSource+"\n";return r.replace(i.glslSource,"")}function c(e,r){var n,a,s="",l=e.sources;if(t(l))for(n=0,a=l.length;a>n;++n)s+="\n#line 0\n"+l[n];s=o(s);var c;s=s.replace(/#version\s+(.*?)\n/gm,function(e,r){if(t(c)&&c!==r)throw new i("inconsistent versions found: "+c+" and "+r);return c=r,"\n"}),s=s.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");var d=e.pickColorQualifier;t(d)&&(s=h.createPickFragmentShaderSource(s,d));var p="";t(c)&&(p="#version "+c),r&&(p+="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n\n");var m=e.defines;if(t(m))for(n=0,a=m.length;a>n;++n){var f=m[n];0!==f.length&&(p+="#define "+f+"\n")}return e.includeBuiltIns&&(p+=u(s)),p+="\n#line 0\n",p+=s}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))}return 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}),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;nn;++n)p(u,s[n],n,o);for(d=u.length,n=0;d>n;++n){var f=u[n];if(i(f.vertexBuffer)&&0===f.instanceDivisor){var v=f.strideInBytes||f.componentsPerAttribute*e.getSizeInBytes(f.componentDatatype);c=f.vertexBuffer.sizeInBytes/v;break}}for(n=0;d>n;++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 v(e){return e.values.length/e.componentsPerAttribute}function g(t){return e.getSizeInBytes(t.componentDatatype)*t.componentsPerAttribute}function _(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=v(t[a[0]]),r=1;l>r;++r){var c=v(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;l>r;++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,_=new ArrayBuffer(f),y={};for(r=0;l>r;++r){n=a[r];var C=e.getSizeInBytes(t[n].componentDatatype);y[n]={pointer:e.createTypedArray(t[n].componentDatatype,_),index:d[n]/C,strideInComponentType:h/C}}for(r=0;s>r;++r)for(var E=0;l>E;++E){n=a[E],o=t[n];for(var S=o.values,w=y[n],T=w.pointer,x=o.componentsPerAttribute,b=0;x>b;++b)T[w.index+b]=S[r*x+b];w.index+=w.strideInComponentType}return{buffer:_,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;s>r;++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;a>r;++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),v=t(r.attributeLocations,t.EMPTY_OBJECT),g=t(r.interleave,!1),y=r.vertexArrayAttributes,C=i(y)?y:[],E=p.attributes;if(g){var S=_(E);if(i(S)){u=c.createVertexBuffer({context:d,typedArray:S.buffer,usage:m});var w=S.offsetsInBytes,T=S.vertexSizeInBytes;for(n in E)E.hasOwnProperty(n)&&i(E[n])&&(o=E[n],i(o.values)?C.push({index:v[n],vertexBuffer:u,componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,offsetInBytes:w[n],strideInBytes:T}):C.push({index:v[n],value:o.value,componentDatatype:o.componentDatatype,normalize:o.normalize}))}}else for(n in E)if(E.hasOwnProperty(n)&&i(E[n])){o=E[n];var x=o.componentDatatype;x===e.DOUBLE&&(x=e.FLOAT),u=void 0,i(o.values)&&(u=c.createVertexBuffer({context:d,typedArray:e.createTypedArray(x,o.values),usage:m})),C.push({index:v[n],vertexBuffer:u,value:o.value,componentDatatype:x,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize})}var b,A=p.indices;return i(A)&&(b=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:b})},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;rf;++f){var v=l[f];v.vertexBuffer?d.push(v):(h=v.usage,c=p[h],i(c)||(c=p[h]=[]),c.push(v))}this._allBuffers=[];for(h in p)if(p.hasOwnProperty(h)){c=p[h],c.sort(s);var g=u._vertexSizeInBytes(c),_=c[0].usage,y={vertexSizeInBytes:g,vertexBuffer:void 0,usage:_,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.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;r>n;++n)t[n].va.destroy();e.va=void 0}}u._verifyAttributes=function(i){for(var r=[],o=0;on;++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;o>a;++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;r>i;++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;s>l;++l)o[l]=a[l];for(var u=t.arrayViews,c=u.length,h=0;c>h;++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;r>n;++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;n>r;++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;p>m;++m){var f=[];for(r=0,n=s.length;n>r;++r){t=s[r];var v=m*(t.vertexSizeInBytes*(o.SIXTY_FOUR_KILOBYTES-1));u._appendAttributes(f,t,v,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;o>a;++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;n>r;++r)h(i[r],e,t)},u.prototype.endSubCommits=function(){for(var e=this._allBuffers,t=0,i=e.length;i>t;++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;i>t;++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;\nif (color.a == 0.0)\n{\ndiscard;\n}\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;\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, float rotation, bool sizeInMeters)\n{\nvec2 halfSize = imageSize * scale * czm_resolutionScale;\nhalfSize *= ((direction * 2.0) - 1.0);\nif (sizeInMeters)\n{\npositionEC.xy += halfSize;\n}\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nif (sizeInMeters)\n{\npositionWC.xy += (origin * abs(halfSize)) / czm_metersPerPixel(positionEC);\n}\nelse\n{\npositionWC.xy += (origin * abs(halfSize));\n}\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nif (!all(equal(alignedAxis, vec3(0.0))) || rotation != 0.0)\n{\nfloat angle = rotation;\nif (!all(equal(alignedAxis, vec3(0.0))))\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{\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));\n#else\nvec3 alignedAxis = vec3(0.0);\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 = (temp - floor(temp)) * SHIFT_LEFT8 > 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)\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 CLAMPED_TO_GROUND\npositionEC.z *= 0.995;\norigin.y = 1.0;\n#endif\nvec4 positionWC = computePositionWindowCoordinates(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, 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/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/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/SceneTransforms",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/Math","../Core/Matrix4","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u){"use strict";var c={},h=new r(0,0,0,1),d=new r,p=new l;c.wgs84ToWindowCoordinates=function(e,t,i){var n=c.computeActualWgs84Position(e.frameState,t,h);if(o(n)){var a=e.camera,s=l.multiply(a.frustum.projectionMatrix,a.viewMatrix,p);if(l.multiplyByVector(s,r.fromElements(n.x,n.y,n.z,1,d),d),!(d.z<0&&e.mode!==u.SCENE2D))return i=c.clipToGLWindowCoordinates(e,d,i),i.y=e.canvas.clientHeight-i.y,i}},c.wgs84ToDrawingBufferCoordinates=function(e,t,i){var n=c.computeActualWgs84Position(e.frameState,t,h);if(o(n)){var a=e.camera,s=l.multiply(a.frustum.projectionMatrix,a.viewMatrix,p);if(l.multiplyByVector(s,r.fromElements(n.x,n.y,n.z,1,d),d),!(d.z<0&&e.mode!==u.SCENE2D))return c.clipToDrawingBufferCoordinates(e,d,i)}};var m=new i,f=new n;c.computeActualWgs84Position=function(e,t,r){var n=e.mode;if(n===u.SCENE3D)return i.clone(t,r);var a=e.mapProjection,l=a.ellipsoid.cartesianToCartographic(t,f);if(o(l)){if(a.project(l,m),n===u.COLUMBUS_VIEW)return i.fromElements(m.z,m.x,m.y,r);if(n===u.SCENE2D)return i.fromElements(0,m.x,m.y,r);var c=e.morphTime;return i.fromElements(s.lerp(m.z,t.x,c),s.lerp(m.x,t.y,c),s.lerp(m.y,t.z,c),r)}};var v=new i,g=new i,_=new e,y=new l;c.clipToGLWindowCoordinates=function(e,r,n){var o=e.canvas;return i.divideByScalar(r,r.w,v),_.width=o.clientWidth,_.height=o.clientHeight,l.computeViewportTransformation(_,0,1,y),l.multiplyByPoint(y,v,g),t.fromCartesian3(g,n)},c.clipToDrawingBufferCoordinates=function(r,n,o){return i.divideByScalar(n,n.w,v),e.clone(r._passState.viewport,_),l.computeViewportTransformation(_,0,1,y),l.multiplyByPoint(y,v,g),t.fromCartesian3(g,o)},c.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 C=new r,E=new r;return c.drawingBufferToWgs84Coordinates=function(e,t,n,o){var a=e.context,s=a.uniformState,u=e._passState.viewport,c=r.clone(r.UNIT_W,C);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,E),d=1/h.w;return i.multiplyByScalar(h,d,h),i.fromCartesian4(h,o)},c}),i("Scene/VerticalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,BOTTOM:1,TOP:-1};return e(t)}),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/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,v,g){"use strict";function _(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._verticalOrigin=s(e.verticalOrigin,g.CENTER),this._horizontalOrigin=s(e.horizontalOrigin,m.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._heightReference=s(e.heightReference,p.NONE),this._sizeInMeters=s(e.sizeInMeters,!1),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=f.SCENE3D,this._updateClamping()}function y(e,t){var i=e._billboardCollection;l(i)&&(i._updateBillboard(e,t),e._dirty=!0)}var C=_.SHOW_INDEX=0,E=_.POSITION_INDEX=1,S=_.PIXEL_OFFSET_INDEX=2,w=_.EYE_OFFSET_INDEX=3,T=_.HORIZONTAL_ORIGIN_INDEX=4,x=_.VERTICAL_ORIGIN_INDEX=5,b=_.SCALE_INDEX=6,A=_.IMAGE_INDEX_INDEX=7,P=_.COLOR_INDEX=8,I=_.ROTATION_INDEX=9,M=_.ALIGNED_AXIS_INDEX=10,D=_.SCALE_BY_DISTANCE_INDEX=11,R=_.TRANSLUCENCY_BY_DISTANCE_INDEX=12,O=_.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13;_.NUMBER_OF_PROPERTIES=14,u(_.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,y(this,C))}},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(),y(this,E))}},heightReference:{get:function(){return this._heightReference},set:function(e){var t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),y(this,E))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var i=this._pixelOffset;t.equals(i,e)||(t.clone(e,i),y(this,S))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;d.equals(t,e)||(this._scaleByDistance=d.clone(e,t),y(this,D))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;d.equals(t,e)||(this._translucencyByDistance=d.clone(e,t),y(this,R))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;d.equals(t,e)||(this._pixelOffsetScaleByDistance=d.clone(e,t),y(this,O))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;i.equals(t,e)||(i.clone(e,t),y(this,w))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,y(this,T))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,y(this,x))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,y(this,b))}},color:{get:function(){return this._color},set:function(e){var t=this._color;o.equals(t,e)||(o.clone(e,t),y(this,P))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,y(this,I))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;i.equals(t,e)||(i.clone(e,t),y(this,M))}},width:{get:function(){return s(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,y(this,A))}},height:{get:function(){return s(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,y(this,A))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,y(this,P))}},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,y(this,A))}},ready:{get:function(){return-1!==this._imageIndex}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=i.clone(e,this._actualClampedPosition),y(this,E)}}}),_.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},_.prototype._updateClamping=function(){_._updateClamping(this._billboardCollection,this)};var N=new n,L=new i;_._updateClamping=function(e,t){function r(e){if(t._heightReference===p.RELATIVE_TO_GROUND)if(t._mode===f.SCENE3D){var r=s.cartesianToCartographic(e,N);r.height+=v.height,s.cartographicToCartesian(r,e)}else e.x+=v.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,h=o.frameState.mode,d=o.frameState.mapProjection,m=h!==t._mode;if(t._mode=h,(t._heightReference===p.NONE||m)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference!==p.NONE&&l(t._position)){var v=s.cartesianToCartographic(t._position);if(l(v)){l(t._removeCallbackFunc)&&t._removeCallbackFunc(),t._removeCallbackFunc=u.updateHeight(v,r);var g=a.getHeight(v);l(g)&&(n.clone(v,N),N.height=g,t._mode===f.SCENE3D?s.cartographicToCartesian(N,L):(d.project(N,L),i.fromElements(L.z,L.x,L.y,L)),r(L))}}}else if(t._heightReference!==p.NONE)throw new c("Height reference is not supported.")},_.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,y(a,A)}}).otherwise(function(e){console.error("Error loading image for billboard: "+e),a._imageIndexPromise=void 0})}},_.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())},_.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())},_.prototype._setTranslate=function(e){var i=this._translate;t.equals(i,e)||(t.clone(e,i),y(this,S))},_.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition},_.prototype._setActualPosition=function(e){l(this._clampedPosition)||i.clone(e,this._actualPosition),y(this,E)};var F=new r;_._computeActualPosition=function(e,t,i,r){return l(e._clampedPosition)?(i.mode!==e._mode&&e._updateClamping(),e._clampedPosition):i.mode===f.SCENE3D?t:(h.multiplyByPoint(r,t,F),v.computeActualWgs84Position(i,F))};var B=new h,V=new r,k=new i,z=new t,U=new t;_._computeScreenSpacePosition=function(e,n,o,a,s,l){var u=s.camera,c=u.viewMatrix,d=u.frustum.projectionMatrix,p=h.multiplyTransformation(c,e,B),m=h.multiplyByVector(p,r.fromElements(n.x,n.y,n.z,1,V),V),f=i.multiplyComponents(o,i.normalize(m,k),k);m.x+=o.x+f.x,m.y+=o.y+f.y,m.z+=f.z;var g=h.multiplyByVector(d,m,V),_=v.clipToGLWindowCoordinates(s,g,l);a=t.clone(a,U),a.y=-a.y;var y=t.multiplyByScalar(a,s.context.uniformState.resolutionScale,z);return _.x+=y.x,_.y+=y.y,_};var G=new t(0,0);return _.prototype.computeScreenSpacePosition=function(e,i){var r=this._billboardCollection;l(i)||(i=new t),t.clone(this._pixelOffset,G),t.add(G,this._translate,G);var n=r.modelMatrix,o=this._getActualPosition(),a=_._computeScreenSpacePosition(n,o,this._eyeOffset,G,e,i);return a.y=e.canvas.clientHeight-a.y,a},_.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&&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)&&d.equals(this._scaleByDistance,r._scaleByDistance)&&d.equals(this._translucencyByDistance,r._translucencyByDistance)&&d.equals(this._pixelOffsetScaleByDistance,r._pixelOffsetScaleByDistance)},_.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0},_}),i("Scene/BlendEquation",["../Core/freezeObject","../Renderer/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","../Renderer/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/Pass",["../Core/freezeObject"],function(e){"use strict";var t={COMPUTE:0,GLOBE:1,GROUND:2,OPAQUE:3,TRANSLUCENT:4,OVERLAY:5,NUMBER_OF_PASSES:6};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;c>u;++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;c>u;++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;n>e;++e){var o=i[e];t(o)&&o.destroy()}var a=this._colorRenderbuffers;for(n=a.length,e=0;n>e;++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("Renderer/MipmapHint",["../Core/freezeObject","./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/PixelDatatype",["../Core/freezeObject","./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/TextureMagnificationFilter",["../Core/freezeObject","./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","./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","./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/Texture",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","./ContextLimits","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap","./WebGLConstants"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function v(r){r=t(r,t.EMPTY_OBJECT);var n=r.context,a=r.width,l=r.height,u=r.source;i(u)&&(i(a)||(a=t(u.videoWidth,u.width)),i(l)||(l=t(u.videoHeight,u.height)));var d=t(r.pixelFormat,s.RGBA),p=t(r.pixelDatatype,c.UNSIGNED_BYTE),m=d;if(n.webgl2&&(d===s.DEPTH_STENCIL?m=f.DEPTH24_STENCIL8:d===s.DEPTH_COMPONENT&&(p===c.UNSIGNED_SHORT?m=f.DEPTH_COMPONENT16:p===c.UNSIGNED_INT&&(m=f.DEPTH_COMPONENT24))),p===c.FLOAT&&!n.floatingPointTexture)throw new o("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(s.isDepthFormat(d)&&!n.depthTexture)throw new o("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.");var v=r.preMultiplyAlpha||d===s.RGB||d===s.LUMINANCE,g=t(r.flipY,!0),_=n._gl,y=_.TEXTURE_2D,C=_.createTexture();_.activeTexture(_.TEXTURE0),_.bindTexture(y,C),i(u)?(_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL,v),_.pixelStorei(_.UNPACK_FLIP_Y_WEBGL,g),i(u.arrayBufferView)?_.texImage2D(y,0,m,a,l,0,d,p,u.arrayBufferView):i(u.framebuffer)?(u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._bind(),_.copyTexImage2D(y,0,m,u.xOffset,u.yOffset,a,l,0),u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._unBind()):_.texImage2D(y,0,m,d,p,u)):_.texImage2D(y,0,m,a,l,0,d,p,null),_.bindTexture(y,null),this._context=n,this._textureFilterAnisotropic=n._textureFilterAnisotropic,this._textureTarget=y,this._texture=C,this._pixelFormat=d,this._pixelDatatype=p,this._width=a,this._height=l,this._dimensions=new e(a,l),this._preMultiplyAlpha=v,this._flipY=g,this._sampler=void 0,this.sampler=i(r.sampler)?r.sampler:new h}return v.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 v({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(v.prototype,{sampler:{get:function(){return this._sampler},set:function(e){var t=e.minificationFilter,r=e.magnificationFilter,n=t===p.NEAREST_MIPMAP_NEAREST||t===p.NEAREST_MIPMAP_LINEAR||t===p.LINEAR_MIPMAP_NEAREST||t===p.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===c.FLOAT&&(t=n?p.NEAREST_MIPMAP_NEAREST:p.NEAREST,r=d.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}}}),v.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)},v.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)},v.prototype.generateMipmap=function(e){e=t(e,u.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)},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),n(this)},v}),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/RenderState","../Renderer/Texture","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(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 v(e){e=r(e,r.EMPTY_OBJECT);var n=r(e.borderWidthInPixels,1),o=r(e.initialSize,C);this._context=e.context,this._pixelFormat=r(e.pixelFormat,u.RGBA),this._borderWidthInPixels=n,this._textureCoordinates=[],this._guid=i(),this._idHash={},this._texture=new p({context:this._context,width:o.x,height:o.y,pixelFormat:this._pixelFormat}),this._root=new f(new t,new t(o.x,o.y));var a=this,s={u_texture:function(){return a._texture}},l="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n";this._copyCommand=this._context.createViewportQuadCommand(l,{uniformMap:s})}function g(i,r){var o=i._context,a=i.numberOfImages,s=2;if(a>0){var l=i._texture.width,u=i._texture.height,c=s*(l+r.width+i._borderWidthInPixels),m=s*(u+r.height+i._borderWidthInPixels),v=l/c,g=u/m,_=new f(new t(l+i._borderWidthInPixels,0),new t(c,u)),y=new f(new t,new t(c,u),i._root,_),C=new f(new t(0,u+i._borderWidthInPixels),new t(c,m)),E=new f(new t,new t(c,m),y,C);i._root=E;for(var S=0;Ss||0>l)return;if(0===s&&0===l)return i;if(s>l){i.childNode1=new f(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;ui;++i)e[i]&&e[i]._destroy()}function R(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;for(var t=[],i=e._billboards,r=i.length,n=0,o=0;r>n;++n){var a=i[n];a&&(a._index=o++,t.push(a))}e._billboards=t}}function O(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;r>o;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=f.createIndexBuffer({context:e,typedArray:n,usage:v.STATIC_DRAW,indexDatatype:d.UNSIGNED_SHORT}),i.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=i,i}function N(e){var t=e.cache.billboardCollection_indexBufferInstanced;return s(t)?t:(t=f.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:v.STATIC_DRAW,indexDatatype:d.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t,t)}function L(e){var t=e.cache.billboardCollection_vertexBufferInstanced;return s(t)?t:(t=f.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:v.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t,t)}function F(e,t,i,r){var n=[{index:X.positionHighAndScale,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[K]},{index:X.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[K]},{index:X.compressedAttribute0,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[Q]},{index:X.compressedAttribute1,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[se]},{index:X.compressedAttribute2,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[re]},{index:X.eyeOffset,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[J]},{index:X.scaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[ae]},{index:X.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[le]}];r&&n.push({index:X.direction,componentsPerAttribute:2,componentDatatype:o.FLOAT,vertexBuffer:L(e)});var a=r?t:4*t;return new E(e,n,a,r)}function B(e,i,r,n,o){var a,s=n[X.positionHighAndScale],l=n[X.positionLowAndRotation],u=o._getActualPosition();e._mode===P.SCENE3D&&(t.expand(e._baseVolume,u,e._baseVolume),e._boundingVolumeDirty=!0),h.fromCartesian(u,pe);var c=o.scale,d=o.rotation;0!==d&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,c);var p=pe.high,m=pe.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 V(t,i,r,n,o){var a,s=n[X.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,v=o.verticalOrigin,g=o.show;0===o.color.alpha&&(g=!1),t._allHorizontalCenter=t._allHorizontalCenter&&f===b.CENTER,t._allVerticalCenter=t._allVerticalCenter&&v===b.CENTER;var _=0,y=0,C=0,E=0,S=o._imageIndex;if(-1!==S){var w=r[S];_=w.x,y=w.y,C=w.width,E=w.height}var T=_+C,x=y+E,A=Math.floor(p.clamp(u,-fe,fe)+fe)*_e;A+=(f+1)*ye,A+=(v+1)*Ce,A+=(g?1:0)*Ee;var P=Math.floor(p.clamp(c,-fe,fe)+fe)*ge,I=Math.floor(p.clamp(d,-fe,fe)+fe)*ge,M=(p.clamp(m,-fe,fe)+fe)*Se,D=Math.floor(M),R=Math.floor((M-D)*ge);P+=D,I+=R,me.x=_,me.y=y;var O=e.compressTextureCoordinates(me);me.x=T;var N=e.compressTextureCoordinates(me);me.y=x;var L=e.compressTextureCoordinates(me);me.x=_;var F=e.compressTextureCoordinates(me);t._instanced?(a=o._index,s(a,A,P,I,O)):(a=4*o._index,s(a+0,A+we,P,I,O),s(a+1,A+Te,P,I,N),s(a+2,A+xe,P,I,L),s(a+3,A+be,P,I,F))}function k(t,i,n,o,l){var u,c=o[X.compressedAttribute1],h=l.alignedAxis;r.equals(h,r.ZERO)||(t._shaderAlignedAxis=!0);var d=0,m=1,f=1,v=1,g=l.translucencyByDistance;s(g)&&(d=g.near,m=g.nearValue,f=g.far,v=g.farValue,(1!==m||1!==v)&&(t._shaderTranslucencyByDistance=!0));var _=0,y=l._imageIndex;if(-1!==y){var C=n[y];_=C.width}var E=t._textureAtlas.texture.width,S=Math.ceil(.5*a(l.width,E*_));t._maxSize=Math.max(t._maxSize,S);var w=p.clamp(S,0,ve),T=0;Math.abs(r.magnitudeSquared(h)-1)c;++c){var h=i[c],d=h.position,p=T._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 j(e,t){var i=t.mode,r=e._billboards,n=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==P.SCENE3D&&!m.equals(o,e.modelMatrix)?(e._mode=i,m.clone(e.modelMatrix,o),e._createVertexArray=!0,(i===P.SCENE3D||i===P.SCENE2D||i===P.COLUMBUS_VIEW)&&q(e,r,r.length,t,o,!0)):i===P.MORPHING?q(e,r,r.length,t,o,!0):(i===P.SCENE2D||i===P.COLUMBUS_VIEW)&&q(e,n,e._billboardsToUpdateIndex,t,o,!1)}function Y(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 X,Z=T.SHOW_INDEX,K=T.POSITION_INDEX,Q=T.PIXEL_OFFSET_INDEX,J=T.EYE_OFFSET_INDEX,$=T.HORIZONTAL_ORIGIN_INDEX,ee=T.VERTICAL_ORIGIN_INDEX,te=T.SCALE_INDEX,ie=T.IMAGE_INDEX_INDEX,re=T.COLOR_INDEX,ne=T.ROTATION_INDEX,oe=T.ALIGNED_AXIS_INDEX,ae=T.SCALE_BY_DISTANCE_INDEX,se=T.TRANSLUCENCY_BY_DISTANCE_INDEX,le=T.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,ue=T.NUMBER_OF_PROPERTIES,ce={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7},he={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8};l(M.prototype,{length:{get:function(){return R(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}}}),M.prototype.add=function(e){var t=new T(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},M.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},M.prototype.removeAll=function(){D(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},M.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},M.prototype.contains=function(e){return s(e)&&e._billboardCollection===this},M.prototype.get=function(e){return R(this),this._billboards[e]};var de;M.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;ue>r;++r){var n=0===i[r]?v.STATIC_DRAW:v.STREAM_DRAW;t=t||e[r]!==n,e[r]=n}return t};var pe=new h,me=new i,fe=32768,ve=65536,ge=256,_e=128,ye=32,Ce=8,Ee=4,Se=1/256,we=0,Te=2,xe=3,be=1,Ae=[];return M.prototype.update=function(e){R(this);var i=this._billboards,r=i.length,n=e.context;this._instanced=n.instancedArrays,X=this._instanced?he:ce,de=this._instanced?N:O;var o=this._textureAtlas;if(!s(o)){o=this._textureAtlas=new I({context:n});for(var a=0;r>a;++a)i[a]._loadImage()}var l=o.textureCoordinates;if(0!==l.length){j(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 f,v=e.passes,E=v.pick;if(p||!E&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var T=0;ue>T;++T)h[T]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),r>0){this._vaf=F(n,r,this._buffersUsage,this._instanced),f=this._vaf.writers;for(var b=0;r>b;++b){var M=this._billboards[b];M._dirty=!1,H(this,n,l,f,M)}this._vaf.commit(de(n))}this._billboardsToUpdateIndex=0}else if(c>0){var D=Ae;D.length=0,(h[K]||h[ne]||h[te])&&D.push(B),(h[ie]||h[Q]||h[$]||h[ee]||h[Z])&&(D.push(V),this._instanced&&D.push(U)),(h[ie]||h[oe]||h[se])&&D.push(k),(h[ie]||h[re])&&D.push(z),h[J]&&D.push(U),h[ae]&&D.push(G),h[le]&&D.push(W);var L=D.length;if(f=this._vaf.writers,c/r>.1){for(var q=0;c>q;++q){var pe=u[q];pe._dirty=!1;for(var me=0;L>me;++me)D[me](this,n,l,f,pe)}this._vaf.commit(de(n))}else{for(var fe=0;c>fe;++fe){var ve=u[fe];ve._dirty=!1;for(var ge=0;L>ge;++ge)D[ge](this,n,l,f,ve);this._instanced?this._vaf.subCommit(ve._index,1):this._vaf.subCommit(4*ve._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 _e,ye=m.IDENTITY;e.mode===P.SCENE3D?(ye=this.modelMatrix,_e=t.clone(this._baseVolumeWC,this._boundingVolume)):_e=t.clone(this._baseVolume2D,this._boundingVolume),Y(this,e,_e);var Ce,Ee,Se,we,Te,xe,be=e.commandList;if(v.render){var Pe=this._colorCommands;for(s(this._rs)||(this._rs=_.fromCache({depthTest:{enabled:!0},blending:x.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||(we=new C({sources:[w]}),this._instanced&&we.defines.push("INSTANCED"),this._shaderRotation&&we.defines.push("ROTATION"),this._shaderAlignedAxis&&we.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&we.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&we.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&we.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),s(this._scene)&&we.defines.push("CLAMPED_TO_GROUND"),this._sp=y.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:we,fragmentShaderSource:S,attributeLocations:X}),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance),Ce=this._vaf.va,Ee=Ce.length,Pe.length=Ee,xe=0;Ee>xe;++xe)Se=Pe[xe],s(Se)||(Se=Pe[xe]=new g({pass:A.OPAQUE,owner:this})),Se.boundingVolume=_e,Se.modelMatrix=ye,Se.count=Ce[xe].indicesCount,Se.shaderProgram=this._sp,Se.uniformMap=this._uniforms,Se.vertexArray=Ce[xe].va,Se.renderState=this._rs,Se.debugShowBoundingVolume=this.debugShowBoundingVolume,this._instanced&&(Se.count=6,Se.instanceCount=r),be.push(Se)}if(E){var Ie=this._pickCommands;for(s(this._spPick)&&this._shaderRotation===this._compiledShaderRotationPick&&this._shaderAlignedAxis===this._compiledShaderAlignedAxisPick&&this._shaderScaleByDistance===this._compiledShaderScaleByDistancePick&&this._shaderTranslucencyByDistance===this._compiledShaderTranslucencyByDistancePick&&this._shaderPixelOffsetScaleByDistance===this._compiledShaderPixelOffsetScaleByDistancePick||(we=new C({defines:["RENDER_FOR_PICK"],sources:[w]}),this._instanced&&we.defines.push("INSTANCED"),this._shaderRotation&&we.defines.push("ROTATION"),this._shaderAlignedAxis&&we.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&we.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&we.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&we.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),s(this._scene)&&we.defines.push("CLAMPED_TO_GROUND"),Te=new C({defines:["RENDER_FOR_PICK"],sources:[S]}),this._spPick=y.replaceCache({context:n,shaderProgram:this._spPick,vertexShaderSource:we,fragmentShaderSource:Te,attributeLocations:X}),this._compiledShaderRotationPick=this._shaderRotation,this._compiledShaderAlignedAxisPick=this._shaderAlignedAxis,this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistancePick=this._shaderPixelOffsetScaleByDistance),Ce=this._vaf.va,Ee=Ce.length,Ie.length=Ee,xe=0;Ee>xe;++xe)Se=Ie[xe],s(Se)||(Se=Ie[xe]=new g({pass:A.OPAQUE,owner:this})),Se.boundingVolume=_e,Se.modelMatrix=ye,Se.count=Ce[xe].indicesCount,Se.shaderProgram=this._spPick,Se.uniformMap=this._uniforms,Se.vertexArray=Ce[xe].va,Se.renderState=this._rs,this._instanced&&(Se.count=6,Se.instanceCount=r),be.push(Se)}}}},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){return this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),D(this._billboards),u(this)},M}),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","../Core/Iso8601"],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.getValue=r.throwInstantiationError,o.prototype.equals=r.throwInstantiationError,o.equals=function(e,i){return e===i||t(e)&&e.equals(i)},o.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,n=0;r>n;n++)if(!o.equals(e[n],i[n]))return!1;return!0},o.isConstant=function(e){return!t(e)||e.isConstant},o.getValueOrUndefined=function(e,i,r){return t(e)?e.getValue(i,r):void 0},o.getValueOrDefault=function(i,r,n,o){return t(i)?e(i.getValue(r,o),n):n},o.getValueOrClonedDefault=function(e,i,r,n){var o;return t(e)&&(o=e.getValue(i,n)),t(o)||(o=r.clone(o)),o},o}),i("DataSources/BillboardVisualizer",["../Core/AssociativeArray","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/NearFarScalar","../Scene/BillboardCollection","../Scene/HorizontalOrigin","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function f(t,i){i.collectionChanged.addEventListener(f.prototype._onCollectionChanged,this),this._scene=t,this._unusedIndexes=[],this._billboardCollection=void 0,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function v(e,t){if(o(e)){var i=e.billboard;o(i)&&(e.textureValue=void 0,e.billboard=void 0,i.show=!1,i.image=void 0,t.push(i._index))}}var g=n.WHITE,_=r.ZERO,y=i.ZERO,C=1,E=0,S=r.ZERO,w=c.CENTER,T=h.CENTER,x=!1,b=new r,A=new n,P=new r,I=new i,M=new l,D=new l,R=new l,O=new t;return f.prototype.update=function(e){for(var t=this._items.values,i=this._unusedIndexes,r=0,n=t.length;n>r;r++){var a,s=t[r],l=s.entity,c=l._billboard,h=s.billboard,d=l.isShowing&&l.isAvailable(e)&&p.getValueOrDefault(c._show,e,!0);if(d&&(b=p.getValueOrUndefined(l._position,e,b),a=p.getValueOrUndefined(c._image,e),d=o(b)&&o(a)),d){if(!o(h)){var m=this._billboardCollection;o(m)||(m=new u,this._billboardCollection=m,this._scene.primitives.add(m));var f=i.length;h=f>0?m.get(i.pop()):m.add(),h.id=l,h.image=void 0,s.billboard=h}h.show=d,s.textureValue!==a&&(h.image=a,s.textureValue=a),h.position=b,h.color=p.getValueOrDefault(c._color,e,g,A),h.eyeOffset=p.getValueOrDefault(c._eyeOffset,e,_,P),h.pixelOffset=p.getValueOrDefault(c._pixelOffset,e,y,I),h.scale=p.getValueOrDefault(c._scale,e,C),h.rotation=p.getValueOrDefault(c._rotation,e,E),h.alignedAxis=p.getValueOrDefault(c._alignedAxis,e,S),h.horizontalOrigin=p.getValueOrDefault(c._horizontalOrigin,e,w),h.verticalOrigin=p.getValueOrDefault(c._verticalOrigin,e,T),h.width=p.getValueOrUndefined(c._width,e),h.height=p.getValueOrUndefined(c._height,e),h.scaleByDistance=p.getValueOrUndefined(c._scaleByDistance,e,M),h.translucencyByDistance=p.getValueOrUndefined(c._translucencyByDistance,e,D),h.pixelOffsetScaleByDistance=p.getValueOrUndefined(c._pixelOffsetScaleByDistance,e,R),h.sizeInMeters=p.getValueOrDefault(c._sizeInMeters,x);var N=p.getValueOrUndefined(c._imageSubRegion,e,O);o(N)&&h.setImageSubRegion(h._imageId,N)}else v(s,i)}return!0},f.prototype.getBoundingSphere=function(e,t){var i=this._items.get(e.id);return o(i)&&o(i.billboard)?(t.center=r.clone(i.billboard.position,t.center),t.radius=0,d.DONE):d.FAILED},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._entityCollection.collectionChanged.removeEventListener(f.prototype._onCollectionChanged,this),o(this._billboardCollection)&&this._scene.primitives.remove(this._billboardCollection),a(this)},f.prototype._onCollectionChanged=function(e,t,i,r){var n,a,s=this._unusedIndexes,l=this._items;for(n=t.length-1;n>-1;n--)a=t[n],o(a._billboard)&&o(a._position)&&l.set(a.id,new m(a));for(n=r.length-1;n>-1;n--)a=r[n],o(a._billboard)&&o(a._position)?l.contains(a.id)||l.set(a.id,new m(a)):(v(l.get(a.id),s),l.remove(a.id));for(n=i.length-1;n>-1;n--)a=i[n],v(l.get(a.id),s),l.remove(a.id)},f}),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;\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;\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;\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/CullFace",["../Core/freezeObject","../Renderer/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/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/CubeMap",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","./ContextLimits","./CubeMapFace","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(i){function r(e,t){t.arrayBufferView?_.texImage2D(e,0,m,p,p,0,m,f,t.arrayBufferView):_.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),v=i.preMultiplyAlpha||m===a.RGB||m===a.LUMINANCE,g=e(i.flipY,!0),_=s._gl,y=_.TEXTURE_CUBE_MAP,C=_.createTexture();_.activeTexture(_.TEXTURE0),_.bindTexture(y,C),t(u)?(_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL,v),_.pixelStorei(_.UNPACK_FLIP_Y_WEBGL,g),r(_.TEXTURE_CUBE_MAP_POSITIVE_X,u.positiveX),r(_.TEXTURE_CUBE_MAP_NEGATIVE_X,u.negativeX),r(_.TEXTURE_CUBE_MAP_POSITIVE_Y,u.positiveY),r(_.TEXTURE_CUBE_MAP_NEGATIVE_Y,u.negativeY),r(_.TEXTURE_CUBE_MAP_POSITIVE_Z,u.positiveZ),r(_.TEXTURE_CUBE_MAP_NEGATIVE_Z,u.negativeZ)):(_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_X,0,m,p,p,0,m,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_X,0,m,p,p,0,m,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_Y,0,m,p,p,0,m,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,m,p,p,0,m,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_Z,0,m,p,p,0,m,f,null),_.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,m,p,p,0,m,f,null)),_.bindTexture(y,null),this._gl=_,this._textureFilterAnisotropic=s._textureFilterAnisotropic,this._textureTarget=y,this._texture=C,this._pixelFormat=m,this._pixelDatatype=f,this._size=p,this._preMultiplyAlpha=v,this._flipY=g,this._sampler=void 0,this._positiveX=new l(_,C,y,_.TEXTURE_CUBE_MAP_POSITIVE_X,m,f,p,v,g),this._negativeX=new l(_,C,y,_.TEXTURE_CUBE_MAP_NEGATIVE_X,m,f,p,v,g),this._positiveY=new l(_,C,y,_.TEXTURE_CUBE_MAP_POSITIVE_Y,m,f,p,v,g),this._negativeY=new l(_,C,y,_.TEXTURE_CUBE_MAP_NEGATIVE_Y,m,f,p,v,g),this._positiveZ=new l(_,C,y,_.TEXTURE_CUBE_MAP_POSITIVE_Z,m,f,p,v,g),this._negativeZ=new l(_,C,y,_.TEXTURE_CUBE_MAP_NEGATIVE_Z,m,f,p,v,g),this.sampler=new h}return i(f.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}}}),f.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)},f.prototype.isDestroyed=function(){return!1},f.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)},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,v,g,_,y,C,E,S,w,T,x,b,A,P,I){"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,D(e,this),s(this,{type:{value:this.type,writable:!1}}),a(M._uniformList[this.type])||(M._uniformList[this.type]=Object.keys(this._uniforms))}function D(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),F(i),k(i),G(i);var c=0===i._translucentFunctions.length?!0: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=-1!==t.indexOf(n);(r&&!o||!r&&o)&&i(n,t)}}function O(e,t){for(var i="fabric: property name '"+e+"' is not valid. It should be ",r=0;r=2){if(s&&a(c)&&(c!==r.defaultTexture&&c.destroy(),c=void 0),!a(c)||c===r.defaultTexture)return c=new v({context:r,source:o}),void(i._textures[e]=c);c.copyFrom(o)}else a(c)||(i._textures[e]=r.defaultTexture);else{if(o instanceof v&&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?I(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)];I.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=e._strict,r=e._template.uniforms,n=r[t],o=U(n);if(!a(o))throw new u("fabric: uniform '"+t+"' has invalid type.");if("channels"===o){if(0===W(e,t,n,!1)&&i)throw new u("strict: shader source does not use channels '"+t+"'.")}else{if("sampler2D"===o){var s=t+"Dimensions";H(e,s)>0&&(r[s]={type:"ivec3",x:1,y:1},z(e,s))}var l=new RegExp("uniform\\s+"+o+"\\s+"+t+"\\s*;");if(!l.test(e.shaderSource)){var c="uniform "+o+" "+t+";";e.shaderSource=c+e.shaderSource}var h=t+"_"+e._count++;if(1===W(e,t,h)&&i)throw new u("strict: shader source does not use uniform '"+t+"'.");if(e.uniforms[t]=n,"sampler2D"===o)e._uniforms[h]=function(){return e._textures[t]},e._updateFunctions.push(B(t));else if("samplerCube"===o)e._uniforms[h]=function(){return e._textures[t]},e._updateFunctions.push(V(t));else if(-1!==o.indexOf("mat")){var d=new Y[o];e._uniforms[h]=function(){return Y[o].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[h]=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&&4>=r?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)";if(0===W(e,n,l)&&t)throw new u("strict: shader source does not use material '"+n+"'.")}}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;i>r;++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;n>t;++t){var o=r[t];i=o.id;var a=o.image,s=new v({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;n>t;++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;n>t;++t)m[t](this,e);var g=this.materials;for(var _ in g)g.hasOwnProperty(_)&&g[_].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),alpha:1},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).rgb",alpha:"texture2D(image, fract(repeat * materialInput.st)).a * alpha"}},translucent:function(e){return e.uniforms.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:E},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:_},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:b},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<0}}),M.PolylineArrowType="PolylineArrow",M._materialCache.addMaterial(M.PolylineArrowType,{fabric:{type:M.PolylineArrowType,uniforms:{color:new i(1,1,1,1)},source:w},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:T},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:x},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;\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;\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("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function v(e,t,i){var r,n=!i,o=e.length;if(!n&&o>1){var a=e[0].modelMatrix;for(r=1;o>r;++r)if(!m.equals(a,e[r].modelMatrix)){n=!0;break}}if(n)for(r=0;o>r;++r)d.transformToWorldCoordinates(e[r]);else m.multiplyTransformation(t,e[0].modelMatrix,t); +}function g(e,r){var n=e.attributes,o=n.position,a=4*(o.values.length/o.componentsPerAttribute);n.pickColor=new c({componentDatatype:i.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0,values:new Uint8Array(a)});for(var s=t.floatToByte(r.red),l=t.floatToByte(r.green),u=t.floatToByte(r.blue),h=t.floatToByte(r.alpha),d=n.pickColor.values,p=0;a>p;p+=4)d[p]=s,d[p+1]=l,d[p+2]=u,d[p+3]=h}function _(e,t){for(var i=e.length,r=0;i>r;++r){var o=e[r],a=t[r];n(o.geometry)?g(o.geometry,a):(g(o.westHemisphereGeometry,a),g(o.eastHemisphereGeometry,a))}}function y(e){var t,i=e.length,r=[],o=e[0].attributes;for(t in o)if(o.hasOwnProperty(t)){for(var a=o[t],s=!0,l=1;i>l;++l){var u=e[l].attributes[t];if(!n(u)||a.componentDatatype!==u.componentDatatype||a.componentsPerAttribute!==u.componentsPerAttribute||a.normalize!==u.normalize){s=!1;break}}s&&r.push(t)}return r}function C(e,t,r){for(var n=u.computeNumberOfVertices(t),o=r.length,a=0;o>a;++a){for(var s=r[a],l=e[s],h=l.componentDatatype,d=l.value,p=d.length,m=i.createTypedArray(h,n*p),f=0;n>f;++f)m.set(d,f*p);t.attributes[s]=new c({componentDatatype:h,componentsPerAttribute:p,normalize:l.normalize,values:m})}}function E(e,t){for(var i=e.length,r=0;i>r;++r){var o=e[r],a=o.attributes;n(o.geometry)?C(a,o.geometry,t):(C(a,o.westHemisphereGeometry,t),C(a,o.eastHemisphereGeometry,t))}}function S(t){var r,o,a=t.instances,s=t.pickIds,l=t.projection,u=t.elementIndexUintSupported,c=t.scene3DOnly,h=t.allowPicking,p=t.vertexCacheOptimize,m=t.compressVertices,f=t.modelMatrix,g=a.length;a[0].geometry.primitiveType;if(v(a,f,c),!c)for(r=0;g>r;++r)d.splitLongitude(a[r]);h&&_(a,s);var C=y(a);if(E(a,C),p)for(r=0;g>r;++r){var S=a[r];n(S.geometry)?(d.reorderForPostVertexCache(S.geometry),d.reorderForPreVertexCache(S.geometry)):(d.reorderForPostVertexCache(S.westHemisphereGeometry),d.reorderForPreVertexCache(S.westHemisphereGeometry),d.reorderForPostVertexCache(S.eastHemisphereGeometry),d.reorderForPreVertexCache(S.eastHemisphereGeometry))}var w=d.combineInstances(a);for(g=w.length,r=0;g>r;++r){o=w[r];var T,x=o.attributes;if(c)for(T in x)x.hasOwnProperty(T)&&x[T].componentDatatype===i.DOUBLE&&d.encodeAttribute(o,T,T+"3DHigh",T+"3DLow");else for(T in x)if(x.hasOwnProperty(T)&&x[T].componentDatatype===i.DOUBLE){var b=T+"3D",A=T+"2D";d.projectTo2D(o,T,b,A,l),n(o.boundingSphere)&&"position"===T&&(o.boundingSphereCV=e.fromVertices(o.attributes.position2D.values)),d.encodeAttribute(o,b,b+"High",b+"Low"),d.encodeAttribute(o,A,A+"High",A+"Low")}m&&d.compressVertices(o)}if(!u){var P=[];for(g=w.length,r=0;g>r;++r)o=w[r],P=P.concat(d.fitToUnsignedShortIndices(o));w=P}return w}function w(e,t,r){for(var n=[],o=e.attributes,a=r.length,s=0;a>s;++s){var l=r[s],u=o[l],c=u.componentDatatype;c===i.DOUBLE&&(c=i.FLOAT);var h=i.createTypedArray(c,u.values);n.push({index:t[l],componentDatatype:c,componentsPerAttribute:u.componentsPerAttribute,normalize:u.normalize,values:h}),delete o[l]}return n}function T(e,t,i,o,a,s,l,c,h){var d=u.computeNumberOfVertices(t);n(l[e])||(l[e]={boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV});for(var p=o.length,m=0;p>m;++m)for(var f=o[m],v=a[f],g=d;g>0;){for(var _,y=r(h[f],0),C=s[y],E=C.length,S=0;E>S&&(_=C[S],_.index!==v);++S);n(l[e][f])||(l[e][f]={dirty:!1,valid:!0,value:i[f].value,indices:[]});var w,T=_.values.length/_.componentsPerAttribute,x=r(c[f],0);T>x+g?(w=g,l[e][f].indices.push({attribute:_,offset:x,count:w}),c[f]=x+g):(w=T-x,l[e][f].indices.push({attribute:_,offset:x,count:w}),c[f]=0,h[f]=y+1),g-=w}}function x(e,t,i,r,o){var a,s,l,u=[],c=e.length,h={},d={};for(a=0;c>a;++a)s=e[a],l=s.attributes,n(s.geometry)&&T(a,s.geometry,l,o,r,i,u,h,d);for(a=0;c>a;++a)s=e[a],l=s.attributes,n(s.westHemisphereGeometry)&&T(a,s.westHemisphereGeometry,l,o,r,i,u,h,d);for(a=0;c>a;++a)s=e[a],l=s.attributes,n(s.eastHemisphereGeometry)&&T(a,s.eastHemisphereGeometry,l,o,r,i,u,h,d);for(c=t.length,a=0;c>a;++a){s=t[a],l=s.attributes;var p={};u.push(p);for(var m=o.length,f=0;m>f;++f){var v=o[f];p[v]={dirty:!1,valid:!1,value:l[v].value,indices:[]}}}return u}function b(e,t,i,r){var o,a,s,l=r.length-1;if(l>=0){var u=r[l];o=u.offset+u.count,s=u.index,a=i[s].indices.length}else o=0,s=0,a=i[s].indices.length;for(var c=e.length,h=0;c>h;++h){var d=e[h],p=d[t];if(n(p)){var m=p.indices.length;o+m>a&&(o=0,a=i[++s].indices.length),r.push({index:s,offset:o,count:m}),o+=m}}}function A(e,t){var i=[];return b(e,"geometry",t,i),b(e,"westHemisphereGeometry",t,i),b(e,"eastHemisphereGeometry",t,i),i}function P(e,t){var i=e.attributes;for(var r in i)if(i.hasOwnProperty(r)){var o=i[r];n(o)&&n(o.values)&&t.push(o.values.buffer)}n(e.indices)&&t.push(e.indices.buffer)}function I(e,t){for(var i=e.length,r=0;i>r;++r)P(e[r],t)}function M(e,t){for(var i=e.length,r=0;i>r;++r)for(var n=e[r],o=n.length,a=0;o>a;++a)t.push(n[a].values.buffer)}function D(t){for(var i=1,r=t.length,o=0;r>o;o++){var a=t[o];if(++i,n(a)){var s=a.attributes;i+=6+2*e.packedLength+(n(a.indices)?a.indices.length:0);for(var l in s)if(s.hasOwnProperty(l)&&n(s[l])){var u=s[l];i+=5+u.values.length}}}return i}function R(e,t){for(var i=e.length,r=new Uint32Array(e.length),n=0;i>n;++n)r[n]=e[n].toRgba();return t.push(r.buffer),r}function O(e){for(var i=e.length,r=new Array(i),n=0;i>n;n++)r[n]=t.fromRgba(e[n]);return r}function N(e){for(var t=e.length,i=1+17*t,r=0;t>r;r++){var o=e[r].attributes;for(var a in o)if(o.hasOwnProperty(a)&&n(o[a])){var s=o[a];i+=5+s.value.length}}return i}function L(e,t){var i=new Float64Array(N(e)),r={},o=[],a=e.length,s=0;i[s++]=a;for(var l=0;a>l;l++){var u=e[l];m.pack(u.modelMatrix,i,s),s+=m.packedLength;var c=u.attributes,h=[];for(var d in c)c.hasOwnProperty(d)&&n(c[d])&&(h.push(d),n(r[d])||(r[d]=o.length,o.push(d)));i[s++]=h.length;for(var p=0;pc;c++){for(var h=r[t[a++]],d=t[a++],p=t[a++],f=0!==t[a++],v=t[a++],g=i.createTypedArray(d,v),_=0;v>_;_++)g[_]=t[a++];l[h]={componentDatatype:d,componentsPerAttribute:p,normalize:f,value:g}}n[o++]={attributes:l,modelMatrix:s}}return n}function B(t){for(var i=t.length,r=1+i,o=0;i>o;o++){var a=t[o];r+=2,r+=n(a.boundingSphere)?e.packedLength:0,r+=n(a.boundingSphereCV)?e.packedLength:0;for(var s in a)if(a.hasOwnProperty(s)&&n(a[s])&&"boundingSphere"!==s&&"boundingSphereCV"!==s){var l=a[s];r+=4+3*l.indices.length+l.value.length}}return r}function V(t,i){var r=new Float64Array(B(t)),o=[],a=[],s={},l=t.length,u=0;r[u++]=l;for(var c=0;l>c;c++){var h=t[c],d=h.boundingSphere,p=n(d);r[u++]=p?1:0,p&&(e.pack(d,r,u),u+=e.packedLength),d=h.boundingSphereCV,p=n(d),r[u++]=p?1:0,p&&(e.pack(d,r,u),u+=e.packedLength);var m=[];for(var f in h)h.hasOwnProperty(f)&&n(h[f])&&"boundingSphere"!==f&&"boundingSphereCV"!==f&&(m.push(f),n(s[f])||(s[f]=o.length,o.push(f)));r[u++]=m.length;for(var v=0;vE;E++){var S=y[E];r[u++]=S.count,r[u++]=S.offset;var w=a.indexOf(S.attribute);-1===w&&(w=a.length,a.push(S.attribute)),r[u++]=w}r[u++]=_.value.length,r.set(_.value,u),u+=_.value.length}}return i.push(r.buffer),{stringTable:o,packedData:r,attributeTable:a}}function k(t,r){for(var n=t.stringTable,o=t.attributeTable,a=t.packedData,s=new Array(a[0]),l=0,u=1,c=a.length;c>u;){var h={},d=1===a[u++];d&&(h.boundingSphere=e.unpack(a,u),u+=e.packedLength),d=1===a[u++],d&&(h.boundingSphereCV=e.unpack(a,u),u+=e.packedLength);for(var p=a[u++],m=0;p>m;m++){for(var f=n[a[u++]],v=1===a[u++],g=a[u++],_=g>0?new Array(g):void 0,y=0;g>y;y++){var C={};C.count=a[u++],C.offset=a[u++],C.attribute=o[a[u++]],_[y]=C}for(var E=a[u++],S=v?i.createTypedArray(_[0].attribute.componentDatatype,E):new Array(E),w=0;E>w;w++)S[w]=a[u++];h[f]={dirty:!1,valid:v,indices:_,value:S}}s[l++]=h}return s}if(!s.supportsTypedArrays())return{};var z={};return z.combineGeometry=function(e){var t,i,r,o,a,s=e.instances,l=e.invalidInstances;if(s.length>0){t=S(e),i=d.createAttributeLocations(t[0]),o=y(s),r=[],a=t.length;for(var u=0;a>u;++u){var c=t[u];r.push(w(c,i,o))}}o=n(o)?o:y(l);var h,p=x(s,l,r,i,o);return e.createPickOffsets&&n(t)&&(h=A(s,t)),{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:i,vaAttributes:r,vaAttributeLocations:p,validInstancesIndices:e.validInstancesIndices,invalidInstancesIndices:e.invalidInstancesIndices,pickOffsets:h}},z.packCreateGeometryResults=function(t,i){var r=new Float64Array(D(t)),o=[],a={},s=t.length,l=0;r[l++]=s;for(var u=0;s>u;u++){var c=t[u],h=n(c);if(r[l++]=h?1:0,h){r[l++]=c.primitiveType,r[l++]=c.geometryType;var d=n(c.boundingSphere)?1:0;r[l++]=d,d&&e.pack(c.boundingSphere,r,l),l+=e.packedLength;var p=n(c.boundingSphereCV)?1:0;r[l++]=p,p&&e.pack(c.boundingSphereCV,r,l),l+=e.packedLength;var m=c.attributes,f=[];for(var v in m)m.hasOwnProperty(v)&&n(m[v])&&(f.push(v),n(a[v])||(a[v]=o.length,o.push(v)));r[l++]=f.length;for(var g=0;g0&&(r.set(c.indices,l),l+=C)}}return i.push(r.buffer),{stringTable:o,packedData:r}},z.unpackCreateGeometryResults=function(t){for(var r,n=t.stringTable,o=t.packedData,a=new Array(o[0]),s=0,l=1;lr;r++){var x=n[o[l++]],b=o[l++];S=o[l++];var A=0!==o[l++];C=o[l++],E=i.createTypedArray(b,C);for(var P=0;C>P;P++)E[P]=o[l++];w[x]=new c({componentDatatype:b,componentsPerAttribute:S,normalize:A,values:E})}var I;if(C=o[l++],C>0){var M=E.length/S;for(I=p.createTypedArray(M,C),r=0;C>r;r++)I[r]=o[l++]}a[s++]=new u({primitiveType:v,geometryType:g,boundingSphere:m,indices:I,attributes:w})}else a[s++]=void 0}return a},z.packCombineGeometryParameters=function(e,t){for(var i=e.createGeometryResults,r=i.length,n=0;r>n;n++)t.push(i[n].packedData.buffer);var o;return e.allowPicking&&(o=R(e.pickIds,t)),{createGeometryResults:e.createGeometryResults,packedInstances:L(e.instances,t),packedPickIds:o,ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof l,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},z.unpackCombineGeometryParameters=function(e){for(var t=F(e.packedInstances),i=e.allowPicking,r=i?O(e.packedPickIds):void 0,o=e.createGeometryResults,s=o.length,u=0,c=[],h=[],d=[],p=[],v=[],g=0;s>g;g++)for(var _=z.unpackCreateGeometryResults(o[g]),y=_.length,C=0;y>C;C++){var E=_[C],S=t[u];n(E)?(S.geometry=E,c.push(S),d.push(u),i&&v.push(r[u])):(h.push(S),p.push(u)),++u}var w=a.clone(e.ellipsoid),T=e.isGeographic?new l(w):new f(w);return{instances:c,invalidInstances:h,validInstancesIndices:d,invalidInstancesIndices:p,pickIds:v,ellipsoid:w,projection:T,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:m.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},z.packCombineGeometryResults=function(e,t){return n(e.geometries)&&(I(e.geometries,t),M(e.vaAttributes,t)),{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,packedVaAttributeLocations:V(e.vaAttributeLocations,t),modelMatrix:e.modelMatrix,validInstancesIndices:e.validInstancesIndices,invalidInstancesIndices:e.invalidInstancesIndices,pickOffsets:e.pickOffsets}},z.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,perInstanceAttributeLocations:k(e.packedVaAttributeLocations,e.vaAttributes),modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets}},z}),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/Primitive",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/clone","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryInstance","../Core/GeometryInstanceAttribute","../Core/isArray","../Core/Matrix4","../Core/subdivideArray","../Core/TaskProcessor","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../ThirdParty/when","./CullFace","./Pass","./PrimitivePipeline","./PrimitiveState","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O){"use strict";function N(e){e=a(e,a.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.modelMatrix=_.clone(a(e.modelMatrix,_.IDENTITY)),this._modelMatrix=new _,this.show=a(e.show,!0),this._vertexCacheOptimize=a(e.vertexCacheOptimize,!1),this._interleave=a(e.interleave,!1),this._releaseGeometryInstances=a(e.releaseGeometryInstances,!0),this._allowPicking=a(e.allowPicking,!0),this._asynchronous=a(e.asynchronous,!0),this._compressVertices=a(e.compressVertices,!0),this.cull=a(e.cull,!0),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this._modifiedModelView=new _,this._translucent=void 0,this._state=R.READY,this._geometries=[],this._vaAttributes=void 0,this._error=void 0,this._numberOfInstances=0,this._validModelMatrix=!1,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeLocations=void 0,this._perInstanceAttributeCache=[],this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._dirtyAttributes=[],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=P.defer()}function L(e){return new p({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:new e.values.constructor(e.values)})}function F(t){var i=t.attributes,r=new m;for(var n in i)i.hasOwnProperty(n)&&s(i[n])&&(r[n]=L(i[n]));var o;if(s(t.indices)){var a=t.indices;o=new a.constructor(a)}return new d({attributes:r,indices:o,primitiveType:t.primitiveType,boundingSphere:e.clone(t.boundingSphere)})}function B(e){return new v({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,value:new e.value.constructor(e.value)})}function V(e,t){var i=e.attributes,r={};for(var n in i)i.hasOwnProperty(n)&&(r[n]=B(i[n]));return new f({geometry:t,modelMatrix:_.clone(e.modelMatrix),attributes:r,pickPrimitive:e.pickPrimitive,id:e.id})}function k(e,t){if(!e.compressVertices)return t;var i=-1!==t.search(/attribute\s+vec3\s+normal;/g),r=-1!==t.search(/attribute\s+vec2\s+st;/g);if(!i&&!r)return t;var n=-1!==t.search(/attribute\s+vec3\s+tangent;/g),o=-1!==t.search(/attribute\s+vec3\s+binormal;/g),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 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=b.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 z(e,t){e.vertexAttributes}function U(e,t,i){for(var r=[],n=i.length,o=0;n>o;++o){var l={primitive:a(i[o].pickPrimitive,t)};s(i[o].id)&&(l.id=i[o].id);var u=e.createPickId(l);t._pickIds.push(u),r.push(u.color)}return r}function G(e,t){return function(){return e[t]}}function W(e,t){var i,r,n,o,l=e._instanceIds;if(e._state===R.READY){i=g(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var u=e._numberOfInstances=i.length,c=[],h=[];for(n=0;u>n;++n)r=i[n].geometry,l.push(i[n].id),h.push({moduleName:r._workerName,geometry:r});if(!s(ie))for(ie=new Array(re),n=0;re>n;n++)ie[n]=new C("createGeometry",Number.POSITIVE_INFINITY);var d;for(h=y(h,re),n=0;no;++o)d=m[o],r=d.geometry,s(r.constructor.pack)&&(d.offset=p,p+=a(r.constructor.packedLength,r.packedLength));var v;if(p>0){var E=new Float64Array(p);for(v=[E.buffer],o=0;f>o;++o)d=m[o],r=d.geometry,s(r.constructor.pack)&&(r.constructor.pack(r,E,d.offset),d.geometry=E)}c.push(ie[n].scheduleTask({subTasks:h[n]},v))}e._state=R.CREATING,P.all(c,function(t){e._createGeometryResults=t,e._state=R.CREATED}).otherwise(function(i){ee(e,t,R.FAILED,i)})}else if(e._state===R.CREATED){var S=[];i=g(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var w=e.allowPicking,T=t.scene3DOnly,x=t.mapProjection,b=ne.scheduleTask(D.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:i,pickIds:w?U(t.context,e,i):void 0,ellipsoid:x.ellipsoid,projection:x,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:T,allowPicking:w,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},S),S);e._createGeometryResults=void 0,e._state=R.COMBINING,P(b,function(i){var r=D.unpackCombineGeometryResults(i);e._geometries=r.geometries,e._attributeLocations=r.attributeLocations,e._vaAttributes=r.vaAttributes,e._perInstanceAttributeLocations=r.perInstanceAttributeLocations,e.modelMatrix=_.clone(r.modelMatrix,e.modelMatrix),e._validModelMatrix=!_.equals(e.modelMatrix,_.IDENTITY),e._pickOffsets=r.pickOffsets;for(var n=i.validInstancesIndices,o=i.invalidInstancesIndices,a=e._instanceIds,l=new Array(a.length),u=n.length,c=0;u>c;++c)l[c]=a[n[c]];for(var h=o.length,d=0;h>d;++d)l[u+d]=a[o[d]];e._instanceIds=l,s(e._geometries)?e._state=R.COMBINED:ee(e,t,R.FAILED,void 0)}).otherwise(function(i){ee(e,t,R.FAILED,i)})}}function H(e,t){var i,r,n=g(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],o=e._numberOfInstances=n.length,a=new Array(o),l=new Array(o),u=[],c=e._instanceIds,h=0;for(r=0;o>r;r++){i=n[r];var d,p=i.geometry;d=s(p.attributes)&&s(p.primitiveType)?F(p):p.constructor.createGeometry(p),s(d)?(a[h]=d,l[h++]=V(i,d),c.push(i.id)):u.push(i)}a.length=h,l.length=h;var m=e.allowPicking,f=t.scene3DOnly,v=t.mapProjection,y=D.combineGeometry({instances:l,invalidInstances:u,pickIds:m?U(t.context,e,l):void 0,ellipsoid:v.ellipsoid,projection:v,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:f,allowPicking:m,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});for(e._geometries=y.geometries,e._attributeLocations=y.attributeLocations,e._vaAttributes=y.vaAttributes,e._perInstanceAttributeLocations=y.vaAttributeLocations,e.modelMatrix=_.clone(y.modelMatrix,e.modelMatrix),e._validModelMatrix=!_.equals(e.modelMatrix,_.IDENTITY),e._pickOffsets=y.pickOffsets,r=0;rh;++h){for(var d=n[h],p=o[h],m=p.length,f=0;m>f;++f){var v=p[f];v.vertexBuffer=E.createVertexBuffer({context:l,typedArray:v.values,usage:S.DYNAMIC_DRAW}),delete v.values}if(u.push(A.fromGeometry({context:l,geometry:d,attributeLocations:r,bufferUsage:S.STATIC_DRAW,interleave:t._interleave,vertexArrayAttributes:p})),s(t._createBoundingVolumeFunction))t._createBoundingVolumeFunction(i,d);else if(t._boundingSpheres.push(e.clone(d.boundingSphere)),t._boundingSphereWC.push(new e),!a){var g=d.boundingSphereCV.center,_=g.x,y=g.y,C=g.z;g.x=C,g.y=_,g.z=y,t._boundingSphereCV.push(e.clone(d.boundingSphereCV)),t._boundingSphere2D.push(new e),t._boundingSphereMorph.push(new e)}}t._va=u,t._primitiveType=n[0].primitiveType,t.releaseGeometryInstances&&(t.geometryInstances=void 0),t._geometries=void 0,ee(t,i,R.COMPLETE,void 0)}function j(e,t,i,n){var o,a=i.getRenderState();n?(o=r(a,!1),o.cull={enabled:!0,face:I.BACK},e._frontFaceRS=T.fromCache(o),o.cull.face=I.FRONT,e._backFaceRS=T.fromCache(o)):(e._frontFaceRS=T.fromCache(a),e._backFaceRS=e._frontFaceRS),e.allowPicking?n?(o=r(a,!1),o.cull={enabled:!1},e._pickRS=T.fromCache(o)):e._pickRS=e._frontFaceRS:(o=r(a,!1),o.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n?(o.cull={enabled:!1},e._pickRS=T.fromCache(o)):e._pickRS=T.fromCache(o))}function Y(e,t,i){var r=t.context,n=N._modifyShaderPosition(e,i.vertexShaderSource,t.scene3DOnly);n=N._appendShowToShader(e,n),n=k(e,n);var o=i.getFragmentShaderSource(),a=e._attributeLocations;if(e._sp=x.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:a}),z(e._sp,a),e.allowPicking){var s=new b({sources:[o],pickColorQualifier:"varying"});e._pickSP=x.replaceCache({context:r,shaderProgram:e._pickSP,vertexShaderSource:b.createPickVertexShaderSource(n),fragmentShaderSource:s,attributeLocations:a})}else e._pickSP=x.fromCache({context:r,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:a});z(e._pickSP,a)}function X(e,t,i,r,o,a,l){var u=s(i)?i._uniforms:void 0,h={},d=t.uniforms;if(s(d))for(var p in d)if(d.hasOwnProperty(p)){if(s(u)&&s(u[p]))throw new c("Appearance and material have a uniform with the same name: "+p);h[p]=G(d,p)}var m=n(h,u);s(e.rtcCenter)&&(m.u_modifiedModelView=function(){return e._modifiedModelView});var f=r?M.TRANSLUCENT:M.OPAQUE;a.length=e._va.length*(o?2:1),l.length=e._va.length;for(var v=a.length,g=0,_=0,y=0;v>y;++y){var C;o&&(C=a[y],s(C)||(C=a[y]=new w({owner:e,primitiveType:e._primitiveType})),C.vertexArray=e._va[_],C.renderState=e._backFaceRS,C.shaderProgram=e._sp,C.uniformMap=m,C.pass=f,++y),C=a[y],s(C)||(C=a[y]=new w({owner:e,primitiveType:e._primitiveType})),C.vertexArray=e._va[_],C.renderState=e._frontFaceRS,C.shaderProgram=e._sp,C.uniformMap=m,C.pass=f;var E=l[g];s(E)||(E=l[g]=new w({owner:e,primitiveType:e._primitiveType})),E.vertexArray=e._va[_],E.renderState=e._pickRS,E.shaderProgram=e._pickSP,E.uniformMap=m,E.pass=f,++g,++_}}function Z(e){if(0!==e._dirtyAttributes.length){for(var t=e._dirtyAttributes,i=t.length,r=0;i>r;++r){for(var n=t[r],a=n.value,s=n.indices,l=s.length,u=0;l>u;++u){for(var c=s[u],h=c.offset,d=c.count,p=c.attribute,m=p.componentDatatype,f=p.componentsPerAttribute,v=o.createTypedArray(m,d*f),g=0;d>g;++g)v.set(a,g*f);var _=h*f*o.getSizeInBytes(m);p.vertexBuffer.copyFromArrayView(v,_)}n.dirty=!1}t.length=0}}function K(e,t){var i=e.appearance.pixelSize;if(s(i))for(var r=e._boundingSpheres.length,n=0;r>n;++n){var o=e._boundingSpheres[n],a=e._boundingSphereWC[n],l=t.camera.getPixelSize(o,t.context.drawingBufferWidth,t.context.drawingBufferHeight),u=l*i;a.radius=o.radius+u}}function Q(t,i,r,n,o,a,l,u){if(K(t,i),!_.equals(o,t._modelMatrix)){_.clone(o,t._modelMatrix);for(var c=t._boundingSpheres.length,h=0;c>h;++h){var d=t._boundingSpheres[h];s(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])))}}if(s(t.rtcCenter)){var p=i.camera.viewMatrix;_.multiply(p,t._modelMatrix,t._modifiedModelView),_.multiplyByPoint(t._modifiedModelView,t.rtcCenter,oe),_.setTranslation(t._modifiedModelView,oe,t._modifiedModelView)}var m;i.mode===O.SCENE3D?m=t._boundingSphereWC:i.mode===O.COLUMBUS_VIEW?m=t._boundingSphereCV:i.mode===O.SCENE2D&&s(t._boundingSphere2D)?m=t._boundingSphere2D:s(t._boundingSphereMorph)&&(m=t._boundingSphereMorph);var f=i.commandList,v=i.passes;if(v.render)for(var g=r.length,y=0;g>y;++y){var C=u?Math.floor(y/2):y;r[y].modelMatrix=o,r[y].boundingVolume=m[C],r[y].cull=a,r[y].debugShowBoundingVolume=l,f.push(r[y])}if(v.pick)for(var E=n.length,S=0;E>S;++S)n[S].modelMatrix=o,n[S].boundingVolume=m[S],n[S].cull=a,f.push(n[S])}function J(e,t){var i=t[e];return function(){return s(i)&&s(i.value)?t[e].value:i}}function $(e,t,i){return function(r){var n=t[e];n.value=r,!n.dirty&&n.valid&&(i.push(n),n.dirty=!0)}}function ee(e,t,i,r){e._error=r,e._state=i,t.afterRender.push(function(){e._ready=e._state===R.COMPLETE||e._state===R.FAILED,s(r)?e._readyPromise.reject(r):e._readyPromise.resolve(e)})}l(N.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 te=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g;N._modifyShaderPosition=function(e,t,i){for(var r,n="",o="",a="";null!==(r=te.exec(t));){var l=r[1],u="vec4 czm_compute"+l[0].toUpperCase()+l.substr(1)+"()";"vec4 czm_computePosition()"!==u&&(n+=u+";\n"),s(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+=u+"\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+=u+"\n{\n return czm_translateRelativeToEye("+l+"3DHigh, "+l+"3DLow);\n}\n\n":(o+="attribute vec3 "+l+"2DHigh;\nattribute vec3 "+l+"2DLow;\n",a+=u+"\n{\n vec4 p;\n if (czm_morphTime == 1.0)\n {\n p = czm_translateRelativeToEye("+l+"3DHigh, "+l+"3DLow);\n }\n else if (czm_morphTime == 0.0)\n {\n p = czm_translateRelativeToEye("+l+"2DHigh.zxy, "+l+"2DLow.zxy);\n }\n else\n {\n p = czm_columbusViewMorph(\n czm_translateRelativeToEye("+l+"2DHigh.zxy, "+l+"2DLow.zxy),\n czm_translateRelativeToEye("+l+"3DHigh, "+l+"3DLow),\n czm_morphTime);\n }\n return p;\n}\n\n")}return[n,o,t,a].join("\n")},N._appendShowToShader=function(e,t){if(!s(e._attributeLocations.show))return t;var i=b.replaceMain(t,"czm_non_show_main"),r="attribute float show;\nvoid main() \n{ \n czm_non_show_main(); \n gl_Position *= show; \n}";return i+"\n"+r};var ie,re=Math.max(h.hardwareConcurrency-1,1),ne=new C("combineGeometry",Number.POSITIVE_INFINITY),oe=new i;N.prototype.update=function(e){if(!(!s(this.geometryInstances)&&0===this._va.length||s(this.geometryInstances)&&g(this.geometryInstances)&&0===this.geometryInstances.length||!s(this.appearance)||e.mode!==O.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)){if(s(this._error))throw this._error;if(s(this.rtcCenter)&&!e.scene3DOnly)throw new c("RTC rendering is only available for 3D only scenes.");if(this._state!==R.FAILED&&(this._state!==R.COMPLETE&&this._state!==R.COMBINED&&(this.asynchronous?W(this,e):H(this,e)),this._state===R.COMBINED&&q(this,e),this.show&&this._state===R.COMPLETE)){var t=this.appearance,i=t.material,r=!1,n=!1;this._appearance!==t?(this._appearance=t,this._material=i,r=!0,n=!0):this._material!==i&&(this._material=i,n=!0);var o=this._appearance.isTranslucent();this._translucent!==o&&(this._translucent=o,r=!0);var l=e.context;s(this._material)&&this._material.update(l);var u=t.closed&&o;if(r){var h=a(this._createRenderStatesFunction,j);h(this,l,t,u)}if(n){var d=a(this._createShaderProgramFunction,Y);d(this,e,t)}if(r||n){var p=a(this._createCommandsFunction,X);p(this,t,i,o,u,this._colorCommands,this._pickCommands)}Z(this);var m=a(this._updateAndQueueCommandsFunction,Q);m(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)}}};var ae=["boundingSphere","boundingSphereCV"];return N.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,n=r.length,o=0;n>o;++o){var a=(i+o)%n;if(e===r[a]){t=a;break}}if(-1!==t){var u=this._perInstanceAttributeCache[t];if(s(u))return u;var c=this._perInstanceAttributeLocations[t];u={};var h={},d=!1;for(var p in c)if(c.hasOwnProperty(p)){d=!0,h[p]={get:J(p,c)};var m=!0,f=ae;n=f.length;for(var v=0;n>v;++v)if(p===ae[v]){m=!1;break}if(f=this._readOnlyInstanceAttributes,m&&s(f)){n=f.length;for(var g=0;n>g;++g)if(p===f[g]){m=!1;break}}m&&(h[p].set=$(p,c,this._dirtyAttributes))}return d&&l(u,h),this._lastPerInstanceAttributeIndex=t,this._perInstanceAttributeCache[t]=u,u}},N.prototype.isDestroyed=function(){return!1},N.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;e>t;++t)i[t].destroy();this._va=void 0;var r=this._pickIds;for(e=r.length,t=0;e>t;++t)r[t].destroy();return this._pickIds=void 0,this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._perInstanceAttributeLocations=void 0,this._attributeLocations=void 0,this._dirtyAttributes=void 0,u(this)},N}),i("DataSources/ColorMaterialProperty",["../Core/Color","../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){this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=e}return i(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color")}),l.prototype.getType=function(e){return"Color"},l.prototype.getValue=function(i,r){return t(r)||(r={}),r.color=s.getValueOrClonedDefault(this._color,i,e.WHITE,r.color),r},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._color,e._color)},l}),i("DataSources/dynamicGeometryGetBoundingSphere",["../Core/BoundingSphere","../Core/defined","../Core/DeveloperError","./BoundingSphereState"],function(e,t,i,r){ +"use strict";function n(i,n,o,a){var s;return t(n)&&n.show&&n.ready&&(s=n.getGeometryInstanceAttributes(i),t(s)&&t(s.boundingSphere))?(e.transform(s.boundingSphere,n.modelMatrix,a),r.DONE):t(o)&&o.show&&o.ready&&(s=o.getGeometryInstanceAttributes(i),t(s)&&t(s.boundingSphere))?(e.transform(s.boundingSphere,o.modelMatrix,a),r.DONE):t(n)&&!n.ready||t(o)&&!o.ready?r.PENDING:r.FAILED}return n}),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/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";function E(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0}function S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.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._options=new E(e),this._onEntityPropertyChanged(e,"box",e.box,void 0)}function w(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(i.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(i.BLACK),I=new i;return a(S,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),a(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&C.isConstant(this._showProperty)&&C.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)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.prototype.createFillGeometryInstance=function(t){var n,a,s=this._entity,l=s.isAvailable(t),u=new d(l&&s.isShowing&&this._showProperty.getValue(t)&&this._fillProperty.getValue(t));if(this._materialProperty instanceof v){var p=i.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(p=this._materialProperty.color.getValue(t)),a=r.fromColor(p),n={show:u,color:a}}else n={show:u};return new c({id:s,geometry:e.fromDimensions(this._options),modelMatrix:s._getModelMatrix(h.MINIMUM_VALUE),attributes:n})},S.prototype.createOutlineGeometryInstance=function(e){var n=this._entity,o=n.isAvailable(e),a=C.getValueOrDefault(this._outlineColorProperty,e,i.BLACK);return new c({id:n,geometry:t.fromDimensions(this._options),modelMatrix:n._getModelMatrix(h.MINIMUM_VALUE),attributes:{show:new d(o&&n.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(a)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),s(this)},S.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(h.MINIMUM_VALUE):!0,u=a.outline,c=o(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.dimensions,f=e.position,g=a.show;if(!o(d)||!o(f)||o(g)&&g.isConstant&&!g.getValue(h.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var _=n(a.material,T),y=_ instanceof v;this._materialProperty=_,this._fillProperty=n(s,b),this._showProperty=n(g,x),this._showOutlineProperty=n(a.outline,A),this._outlineColorProperty=c?n(a.outlineColor,P):void 0;var E=a.outlineWidth;if(this._fillEnabled=l,this._outlineEnabled=c,f.isConstant&&C.isConstant(e.orientation)&&d.isConstant&&C.isConstant(E)){var S=this._options;S.vertexFormat=y?m.VERTEX_FORMAT:p.MaterialSupport.TEXTURED.vertexFormat,S.dimensions=d.getValue(h.MINIMUM_VALUE,S.dimensions),this._outlineWidth=o(E)?E.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.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)&&C.getValueOrDefault(u.show,n,!0)){var h=this._options,d=l._getModelMatrix(n),v=C.getValueOrUndefined(u.dimensions,n,h.dimensions);if(o(d)&&o(v)){if(h.dimensions=v,C.getValueOrDefault(u.fill,n,!0)){var g=y.getValue(n,s.fillMaterialProperty,this._material);this._material=g;var _=new p({material:g,translucent:g.isTranslucent(),closed:!0});h.vertexFormat=_.vertexFormat,this._primitive=a.add(new f({geometryInstances:new c({id:l,geometry:e.fromDimensions(h),modelMatrix:d}),appearance:_,asynchronous:!1}))}if(C.getValueOrDefault(u.outline,n,!1)){h.vertexFormat=m.VERTEX_FORMAT;var E=C.getValueOrClonedDefault(u.outlineColor,n,i.BLACK,I),S=C.getValueOrDefault(u.outlineWidth,n,1),w=1!==E.alpha;this._outlinePrimitive=a.add(new f({geometryInstances:new c({id:l,geometry:t.fromDimensions(h),modelMatrix:d,attributes:{color:r.fromColor(E)}}),appearance:new m({flat:!0,translucent:w,renderState:{lineWidth:s._scene.clampLineWidth(S)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},S}),i("DataSources/ImageMaterialProperty",["../Core/Cartesian2","../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._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._alpha=void 0,this._alphaSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.alpha=e.alpha}var l=new e(1,1),u=1;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._image)&&a.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:o("image"),repeat:o("repeat"),alpha:o("alpha")}),s.prototype.getType=function(e){return"Image"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.image=a.getValueOrUndefined(this._image,e),t.repeat=a.getValueOrClonedDefault(this._repeat,e,l,t.repeat),t.alpha=a.getValueOrDefault(this._alpha,e,u),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._image,e._image)&&a.equals(this._alpha,e._alpha)&&a.equals(this._repeat,e._repeat)},s}),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._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")}),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):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)},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._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")}),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):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)},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._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")}),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):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)},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._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")}),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):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)},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._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")}),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):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)},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._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=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"),pixelOffset:o("pixelOffset"),scale:o("scale"),show:o("show"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance")}),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.scale=this.scale,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.eyeOffset=this.eyeOffset,e.pixelOffset=this.pixelOffset,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,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.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.pixelOffset=e(this.pixelOffset,t.pixelOffset),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance)},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;n>o;++o){var a=i[o],l=r.indexOf(a);if(-1===l)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;i>t;t++)if(!s.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),c.prototype.hasProperty=function(e){return-1!==this._propertyNames.indexOf(e)},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;o>n;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;a>o;o++){var s=n[o],l=this[s],u=e[s];t(l)||-1!==r.indexOf(s)||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._uri=void 0,this._uriSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=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"),uri:o("uri"),runAnimations:o("runAnimations"),nodeTransformations:o("nodeTransformations",void 0,u)}),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.uri=this.uri,e.runAnimations=this.runAnimations,e.nodeTransformations=this.nodeTransformations,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.uri=e(this.uri,i.uri),this.runAnimations=e(this.runAnimations,i.runAnimations);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._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")}),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):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)},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._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")}),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):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)},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._definitionChanged=new n,this._fill=void 0,this._fillSubscription=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")}),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):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)},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._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")}),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):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)},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._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")}),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):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)},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._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")}),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):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)},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._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")}),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):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)},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,v,g,_,y,C,E,S,w,T,x,b,A,P,I){"use strict";function M(e){return new p(e)}function D(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;r>n;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:v("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:v("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._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",_),ellipsoid:R("ellipsoid",y),label:R("label",C),model:R("model",E),orientation:f("orientation"),path:R("path",S),point:R("point",w),polygon:R("polygon",T),polyline:R("polyline",x),polylineVolume:R("polylineVolume",b),position:D("position"),rectangle:R("rectangle",P),viewFrom:f("viewFrom"),wall:R("wall",I)}),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,v(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;o>a;a++){var s=n[a];if("parent"!==s){var l=this[s],u=e[s];r(l)||-1!==t.indexOf(s)||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,F=new e,B=new u;return O.prototype._getModelMatrix=function(e,t){var i=A.getValueOrUndefined(this._position,e,F);if(r(i)){var n=A.getValueOrUndefined(this._orientation,e,B);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(0===e._suspendCount){var t=e._addedEntities,i=e._removedEntities,r=e._changedEntities;(0!==r.length||0!==t.length||0!==i.length)&&(e._collectionChanged.raiseEvent(e,t.values,i.values,r.values),t.removeAll(),i.removeAll(),r.removeAll())}}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()}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}},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;o>n;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):!1},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):!1},d.prototype.removeAll=function(){for(var e=this._entities,t=e.length,r=e.values,n=this._addedEntities,o=this._removedEntities,a=0;t>a;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;i>r;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,v=f.length,g=e._collectionsCopy,_=g.length,y=e._composite,C=new a(e),E=e._eventHash;for(i=0;_>i;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,E,p,r);for(i=v-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,E,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 w=C.values;for(i=0;ih;h++){var y=r[h];u(this,g,_,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 E=i.length;for(h=0;E>h;h++){var S=i[h];l(this,g,_,S);var w=S.id;for(d=a-1;d>=0;d--)p=n[d].getById(w),t(p)&&(t(f)||(f=c.getById(w),t(f)?s(f):(m.id=w,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&&-1===u.propertyNames.indexOf(i)&&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;s>l;l++){var u=n.get(l);e(u.data)&&-1===a.indexOf(u.data)&&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);return e(r)?r.getValue(t,i):void 0},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);return e(i)?i.getType(t):void 0},a.prototype.getValue=function(t,i){var r=this._composite._intervals.findDataForIntervalContainingDate(t);return e(r)?r.getValue(t,i):void 0},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);return t(n)?n.getValueInReferenceFrame(e,i,r):void 0},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("DataSources/CorridorGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CorridorGeometry","../Core/CorridorOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";function E(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 S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.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._options=new E(e),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}function w(e,t){this._primitives=e, +this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(e.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(e.BLACK),I=new e;return a(S,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),a(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&C.isConstant(this._showProperty)&&C.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)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.prototype.createFillGeometryInstance=function(r){var n,a,s=this._entity,l=s.isAvailable(r),u=new d(l&&s.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r));if(this._materialProperty instanceof v){var h=e.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(h=this._materialProperty.color.getValue(r)),a=t.fromColor(h),n={show:u,color:a}}else n={show:u};return new c({id:s,geometry:new i(this._options),attributes:n})},S.prototype.createOutlineGeometryInstance=function(i){var n=this._entity,o=n.isAvailable(i),a=C.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new c({id:n,geometry:new r(this._options),attributes:{show:new d(o&&n.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(a)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),s(this)},S.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(h.MINIMUM_VALUE):!0,u=a.outline,c=o(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,f=a.show;if(o(f)&&f.isConstant&&!f.getValue(h.MINIMUM_VALUE)||!o(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=n(a.material,T),_=g instanceof v;this._materialProperty=g,this._fillProperty=n(s,b),this._showProperty=n(f,x),this._showOutlineProperty=n(a.outline,A),this._outlineColorProperty=c?n(a.outlineColor,P):void 0;var y=a.height,E=a.extrudedHeight,S=a.granularity,w=a.width,I=a.outlineWidth,M=a.cornerType;if(this._isClosed=o(E),this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&C.isConstant(y)&&C.isConstant(E)&&C.isConstant(S)&&C.isConstant(w)&&C.isConstant(I)&&C.isConstant(M)){var D=this._options;D.vertexFormat=_?m.VERTEX_FORMAT:p.MaterialSupport.TEXTURED.vertexFormat,D.positions=d.getValue(h.MINIMUM_VALUE,D.positions),D.height=o(y)?y.getValue(h.MINIMUM_VALUE):void 0,D.extrudedHeight=o(E)?E.getValue(h.MINIMUM_VALUE):void 0,D.granularity=o(S)?S.getValue(h.MINIMUM_VALUE):void 0,D.width=o(w)?w.getValue(h.MINIMUM_VALUE):void 0,D.cornerType=o(M)?M.getValue(h.MINIMUM_VALUE):void 0,this._outlineWidth=o(I)?I.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.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.corridor;if(l.isShowing&&l.isAvailable(n)&&C.getValueOrDefault(u.show,n,!0)){var h=this._options,d=C.getValueOrUndefined(u.positions,n,h.positions),v=C.getValueOrUndefined(u.width,n);if(o(d)&&o(v)){if(h.positions=d,h.width=v,h.height=C.getValueOrUndefined(u.height,n),h.extrudedHeight=C.getValueOrUndefined(u.extrudedHeight,n),h.granularity=C.getValueOrUndefined(u.granularity,n),h.cornerType=C.getValueOrUndefined(u.cornerType,n),!o(u.fill)||u.fill.getValue(n)){var g=y.getValue(n,s.fillMaterialProperty,this._material);this._material=g;var _=new p({material:g,translucent:g.isTranslucent(),closed:o(h.extrudedHeight)});h.vertexFormat=_.vertexFormat,this._primitive=a.add(new f({geometryInstances:new c({id:l,geometry:new i(h)}),appearance:_,asynchronous:!1}))}if(o(u.outline)&&u.outline.getValue(n)){h.vertexFormat=m.VERTEX_FORMAT;var E=C.getValueOrClonedDefault(u.outlineColor,n,e.BLACK,I),S=C.getValueOrDefault(u.outlineWidth,n,1),w=1!==E.alpha;this._outlinePrimitive=a.add(new f({geometryInstances:new c({id:l,geometry:new r(h),attributes:{color:t.fromColor(E)}}),appearance:new m({flat:!0,translucent:w,renderState:{lineWidth:s._scene.clampLineWidth(S)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},S}),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}}),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("DataSources/CustomDataSource",["../Core/defineProperties","../Core/Event","./DataSource","./EntityCollection"],function(e,t,i,r){"use strict";function n(e){this._name=e,this._clock=void 0,this._changed=new t,this._error=new t,this._isLoading=!1,this._loading=new t,this._entityCollection=new r(this)}return e(n.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){i.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}}}),n}),i("DataSources/CylinderGeometryUpdater",["../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CylinderGeometry","../Core/CylinderOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E){"use strict";function S(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 w(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(w.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new c,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new S(e),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}function T(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new S(t._entity)}var x=new g(t.WHITE),b=new _(!0),A=new _(!0),P=new _(!1),I=new _(t.BLACK),M=new t;return s(w,{perInstanceColorAppearanceType:{value:f},materialAppearanceType:{value:m}}),s(w.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!a(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||!a(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),w.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},w.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},w.prototype.createFillGeometryInstance=function(e){var n,o,s=this._entity,l=s.isAvailable(e),u=new p(l&&s.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e));if(this._materialProperty instanceof g){var c=t.WHITE;a(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(c=this._materialProperty.color.getValue(e)),o=i.fromColor(c),n={show:u,color:o}}else n={show:u};return new h({id:s,geometry:new r(this._options),modelMatrix:s._getModelMatrix(d.MINIMUM_VALUE),attributes:n})},w.prototype.createOutlineGeometryInstance=function(e){var r=this._entity,o=r.isAvailable(e),a=E.getValueOrDefault(this._outlineColorProperty,e,t.BLACK);return new h({id:r,geometry:new n(this._options),modelMatrix:r._getModelMatrix(d.MINIMUM_VALUE),attributes:{show:new p(o&&r.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:i.fromColor(a)}})},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){this._entitySubscription(),l(this)},w.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"position"===t||"orientation"===t||"cylinder"===t){var n=e.cylinder;if(!a(n))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=n.fill,l=a(s)&&s.isConstant?s.getValue(d.MINIMUM_VALUE):!0,u=n.outline,c=a(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=e.position,p=n.length,v=n.topRadius,_=n.bottomRadius,y=n.show;if(a(y)&&y.isConstant&&!y.getValue(d.MINIMUM_VALUE)||!a(h)||!a(p)||!a(v)||!a(_))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var C=o(n.material,x),S=C instanceof g;this._materialProperty=C,this._fillProperty=o(s,A),this._showProperty=o(y,b),this._showOutlineProperty=o(n.outline,P),this._outlineColorProperty=c?o(n.outlineColor,I):void 0;var w=n.slices,T=n.outlineWidth,M=n.numberOfVerticalLines;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&E.isConstant(e.orientation)&&p.isConstant&&v.isConstant&&_.isConstant&&E.isConstant(w)&&E.isConstant(T)&&E.isConstant(M)){var D=this._options;D.vertexFormat=S?f.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,D.length=p.getValue(d.MINIMUM_VALUE),D.topRadius=v.getValue(d.MINIMUM_VALUE),D.bottomRadius=_.getValue(d.MINIMUM_VALUE),D.slices=a(w)?w.getValue(d.MINIMUM_VALUE):void 0,D.numberOfVerticalLines=a(M)?M.getValue(d.MINIMUM_VALUE):void 0,this._outlineWidth=a(T)?T.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},w.prototype.createDynamicUpdater=function(e){return new T(e,this)},T.prototype.update=function(e){var o=this._primitives;o.removeAndDestroy(this._primitive),o.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(e)&&E.getValueOrDefault(u.show,e,!0)){var c=this._options,d=l._getModelMatrix(e),p=E.getValueOrUndefined(u.length,e),g=E.getValueOrUndefined(u.topRadius,e),_=E.getValueOrUndefined(u.bottomRadius,e);if(a(d)&&a(p)&&a(g)&&a(_)){if(c.length=p,c.topRadius=g,c.bottomRadius=_,c.slices=E.getValueOrUndefined(u.slices,e),c.numberOfVerticalLines=E.getValueOrUndefined(u.numberOfVerticalLines,e),E.getValueOrDefault(u.fill,e,!0)){var y=C.getValue(e,s.fillMaterialProperty,this._material);this._material=y;var S=new m({material:y,translucent:y.isTranslucent(),closed:!0});c.vertexFormat=S.vertexFormat,this._primitive=o.add(new v({geometryInstances:new h({id:l,geometry:new r(c),modelMatrix:d}),appearance:S,asynchronous:!1}))}if(E.getValueOrDefault(u.outline,e,!1)){c.vertexFormat=f.VERTEX_FORMAT;var w=E.getValueOrClonedDefault(u.outlineColor,e,t.BLACK,M),T=E.getValueOrDefault(u.outlineWidth,e,1),x=1!==w.alpha;this._outlinePrimitive=o.add(new v({geometryInstances:new h({id:l,geometry:new n(c),modelMatrix:d,attributes:{color:i.fromColor(w)}}),appearance:new f({flat:!0,translucent:x,renderState:{lineWidth:s._scene.clampLineWidth(T)}}),asynchronous:!1}))}}}},T.prototype.getBoundingSphere=function(e,t){return y(e,this._primitive,this._outlinePrimitive,t)},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),l(this)},w}),i("Scene/LabelStyle",["../Core/freezeObject"],function(e){"use strict";var t={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};return e(t)}),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(t){return i(t)||(t=new e),t.startTime=this.startTime,t.stopTime=this.stopTime,t.clockRange=this.clockRange,t.clockStep=this.clockStep,t.multiplier=this.multiplier,t.currentTime=this.currentTime,t},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/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;i>r;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;o>a;){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;r>n;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/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;s>l&&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;sn;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)&&(-1!==r.indexOf(n)?(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){r=e(r,0),i[r]=t},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;l>s;s++){var u=t[i+s];0===s||Math.abs(a-u)o?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;o>r;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,v,g,_=0;_d){for(d=~d,p=d*a,h=void 0,g=r[d];_=0||i(g)&&s.compare(v,g)>=0));){for(m[y++]=v,_+=1,l=0;a>l;l++)f[C++]=o[_],_+=1;h=v}y>0&&(f.length=C,u(n,p,f),m.length=y,u(r,d,m))}else{for(l=0;a>l;l++)_++,n[d*a+l]=o[_];_++}}}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;d>m;m++){var f=r[m];f===Number&&(f=p);var v=f.packedLength;u+=v,c+=t(f.packedInterpolationLength,v),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(0>h){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,v=this._interpolationAlgorithm,g=this._packedInterpolationLength,_=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;var y=Math.min(v.getRequiredDataPoints(this._interpolationDegree,_),o);y!==this._numberOfPoints&&(this._numberOfPoints=y,m.length=y,f.length=y*g)}var C=this._numberOfPoints-1;if(1>C)return;var E=0,S=o-1,w=S-E+1;if(w>=C+1){var T=h-(C/2|0)-1;E>T&&(T=E);var x=T+C;x>S&&(x=S,T=x-C,E>T&&(T=E)),E=T,S=x}for(var b=S-E+1,A=0;b>A;++A)m[A]=s.secondsDifference(n[E+A],n[S]);if(i(u.convertPackedArrayForInterpolation))u.convertPackedArrayForInterpolation(c,E,S,f);else for(var P=0,I=this._packedLength,M=E*I,D=(S+1)*I;D>M;)f[P]=c[M],M++,P++;var R,O=s.secondsDifference(t,n[S]);if(0!==_&&i(v.interpolate)){var N=Math.floor(g/(_+1));R=v.interpolate(O,m,f,N,_,_,this._interpolationResult)}else R=v.interpolateOrderZero(O,m,f,g,this._interpolationResult);return i(u.unpackInterpolationResult)?u.unpackInterpolationResult(R,c,E,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;l>u;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;s>u;u++)if(l.push(e[u]),a.pack(t[u],l,l.length),o)for(var c=r[u],d=n.length,p=0;d>p;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;l>a;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;l>a;a++)if(!s.equals(u[a],c[a]))return!1;var h=this._values,d=e._values;for(a=0;l>a;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;r>s;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){return r=this._property.getValue(e,r),i(r)?s.convertToReferenceFrame(e,r,this._referenceFrame,t,r):void 0},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);return t(n)?s.convertToReferenceFrame(e,n,this._referenceFrame,i,r):void 0},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/CzmlDataSource",["../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/ExtrapolationType","../Core/getAbsoluteUri","../Core/getFilenameFromUri","../Core/HermitePolynomialApproximation","../Core/isArray","../Core/Iso8601","../Core/JulianDate","../Core/LagrangePolynomialApproximation","../Core/LinearApproximation","../Core/loadJson","../Core/Math","../Core/Quaternion","../Core/Rectangle","../Core/ReferenceFrame","../Core/RuntimeError","../Core/Spherical","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/VerticalOrigin","../ThirdParty/Uri","../ThirdParty/when","./BillboardGraphics","./ColorMaterialProperty","./CompositeMaterialProperty","./CompositePositionProperty","./CompositeProperty","./ConstantPositionProperty","./ConstantProperty","./DataSource","./DataSourceClock","./EllipseGraphics","./EllipsoidGraphics","./EntityCollection","./GridMaterialProperty","./ImageMaterialProperty","./LabelGraphics","./ModelGraphics","./NodeTransformationProperty","./PathGraphics","./PointGraphics","./PolygonGraphics","./PolylineGlowMaterialProperty","./PolylineGraphics","./PolylineOutlineMaterialProperty","./PositionPropertyArray","./PropertyBag","./RectangleGraphics","./ReferenceProperty","./Rotation","./SampledPositionProperty","./SampledProperty","./StripeMaterialProperty","./StripeOrientation","./TimeIntervalCollectionPositionProperty","./TimeIntervalCollectionProperty","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,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,ve){"use strict";function ge(e,t){return"#"===t[0]&&(t=ot+t),le.fromString(e,t)}function _e(e){var t=e.rgbaf;if(l(t))return t;var i=e.rgba;if(l(i)){if(i.length===o.length)return[o.byteToFloat(i[0]),o.byteToFloat(i[1]),o.byteToFloat(i[2]),o.byteToFloat(i[3])];var r=i.length;t=new Array(r);for(var n=0;r>n;n+=5)t[n]=i[n],t[n+1]=o.byteToFloat(i[n+1]),t[n+2]=o.byteToFloat(i[n+2]),t[n+3]=o.byteToFloat(i[n+3]),t[n+4]=o.byteToFloat(i[n+4]);return t}}function ye(e,t){var i=s(e.uri,e);return l(t)&&(i=m(i,m(t))),i}function Ce(e){var t=e.wsenDegrees;if(l(t)){for(var i=t.length,r=0;i>r;r++)t[r]=w.toRadians(t[r]);return t}return e.wsen}function Ee(e){if(l(e.cartesian))return e.cartesian;if(l(e.cartesianVelocity))return e.cartesianVelocity;if(l(e.unitCartesian))return e.unitCartesian;var i,r,n,o=e.unitSpherical;if(l(o)){if(r=o.length,2===r)st.clock=o[0],st.cone=o[1],t.fromSpherical(st,at),n=[at.x,at.y,at.z];else{var a=0;for(n=new Array(r/3*4),i=0;r>i;i+=4)n[i]=o[a++],st.clock=o[a++],st.cone=o[a++],t.fromSpherical(st,at),n[i+1]=at.x,n[i+2]=at.y,n[i+3]=at.z}return n}var s=e.cartographicRadians;if(l(s)){if(3===s.length)lt.longitude=s[0],lt.latitude=s[1],lt.height=s[2],h.WGS84.cartographicToCartesian(lt,at),n=[at.x,at.y,at.z];else for(r=s.length,n=new Array(r),i=0;r>i;i+=4)lt.longitude=s[i+1],lt.latitude=s[i+2],lt.height=s[i+3],h.WGS84.cartographicToCartesian(lt,at),n[i]=s[i],n[i+1]=at.x,n[i+2]=at.y,n[i+3]=at.z;return n}var u=e.cartographicDegrees;if(!l(u))throw new A(JSON.stringify(e)+" is not a valid CZML interval.");if(3===u.length)lt.longitude=w.toRadians(u[0]),lt.latitude=w.toRadians(u[1]),lt.height=u[2],h.WGS84.cartographicToCartesian(lt,at),n=[at.x,at.y,at.z];else for(r=u.length,n=new Array(r),i=0;r>i;i+=4)lt.longitude=w.toRadians(u[i+1]),lt.latitude=w.toRadians(u[i+2]),lt.height=u[i+3],h.WGS84.cartographicToCartesian(lt,at),n[i]=u[i],n[i+1]=at.x,n[i+2]=at.y,n[i+3]=at.z;return n}function Se(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 we(e){var t=e.unitQuaternion;if(l(t)){if(4===t.length)return Se(t,0),t;for(var i=1;ih);var g="function"==typeof e.unpack&&e!==ue;if(!d&&!v)return void(f?t[i]=ge(a,r.reference):g?t[i]=new G(e.unpack(p,0)):t[i]=new G(p));var C,E=t[i],S=r.epoch;if(l(S)&&(C=y.fromIso8601(S)),d&&!v)return E instanceof he||(E=new he(e),t[i]=E),E.addSamplesPackedArray(p,C),void xe(r,E);var w;if(!d&&v)return u=u.clone(),f?u.data=ge(a,r.reference):g?u.data=e.unpack(p,0):u.data=p,l(E)||(E=f?new z:new fe,t[i]=E),void(!f&&E instanceof fe?E.intervals.addInterval(u):E instanceof z?(u.data=f?u.data:new G(u.data),E.intervals.addInterval(u)):(w=_.MAXIMUM_INTERVAL.clone(),w.data=E,E=new z,t[i]=E,E.intervals.addInterval(w),u.data=f?u.data:new G(u.data),E.intervals.addInterval(u)));l(E)||(E=new z,t[i]=E),E instanceof z||(w=_.MAXIMUM_INTERVAL.clone(),w.data=E,E=new z,t[i]=E,E.intervals.addInterval(w));var T=E.intervals;w=T.findInterval(u),l(w)&&w.data instanceof he||(w=u.clone(),w.data=new he(e),T.addInterval(w)),w.data.addSamplesPackedArray(p,C),xe(r,w.data)}function Ae(e,t,i,r,n,o,a){if(l(r))if(g(r))for(var s=0,u=r.length;u>s;s++)be(e,t,i,r[s],n,o,a);else be(e,t,i,r,n,o,a)}function Pe(e,i,r,n,o,a){var u,c=r.interval;l(c)?(ht.iso8601=c,u=I.fromIso8601(ht),l(n)&&(u=I.intersect(u,n,ut))):l(n)&&(u=n);var h,d,p,m=!1,f=l(r.cartesianVelocity)?1:0,v=t.packedLength*(f+1),g=l(r.reference),C=l(u)&&!u.equals(_.MAXIMUM_INTERVAL);if(g||(l(r.referenceFrame)&&(h=b[r.referenceFrame]),h=s(h,b.FIXED),d=Ee(r),p=s(d.length,1),m=p>v),!m&&!C)return void(g?e[i]=ge(a,r.reference):e[i]=new U(t.unpack(d),h));var E,S=e[i],w=r.epoch;if(l(w)&&(E=y.fromIso8601(w)),m&&!C)return(!(S instanceof ce)||l(h)&&S.referenceFrame!==h)&&(S=new ce(h,f),e[i]=S),S.addSamplesPackedArray(d,E),void xe(r,S);var T;if(!m&&C)return u=u.clone(),g?u.data=ge(a,r.reference):u.data=t.unpack(d),l(S)||(S=g?new k(h):new me(h),e[i]=S),void(!g&&S instanceof me&&l(h)&&S.referenceFrame===h?S.intervals.addInterval(u):S instanceof k?(u.data=g?u.data:new U(u.data,h),S.intervals.addInterval(u)):(T=_.MAXIMUM_INTERVAL.clone(),T.data=S,S=new k(S.referenceFrame),e[i]=S,S.intervals.addInterval(T),u.data=g?u.data:new U(u.data,h),S.intervals.addInterval(u)));l(S)?S instanceof k||(T=_.MAXIMUM_INTERVAL.clone(),T.data=S,S=new k(S.referenceFrame),e[i]=S,S.intervals.addInterval(T)):(S=new k(h),e[i]=S);var x=S.intervals;T=x.findInterval(u),l(T)&&T.data instanceof ce&&(!l(h)||T.data.referenceFrame===h)||(T=u.clone(),T.data=new ce(h,f),x.addInterval(T)),T.data.addSamplesPackedArray(d,E),xe(r,T.data)}function Ie(e,t,i,r,n,o){if(l(i))if(g(i))for(var a=0,s=i.length;s>a;a++)Pe(e,t,i[a],r,n,o);else Pe(e,t,i,r,n,o)}function Me(t,i,r,n,a,s){var u,c=r.interval;l(c)?(ht.iso8601=c,u=I.fromIso8601(ht),l(n)&&(u=I.intersect(u,n,ut))):l(n)&&(u=n);var h,d,p=t[i];if(l(u)){p instanceof V||(p=new V,t[i]=p);var m=p.intervals;d=m.findInterval({start:u.start,stop:u.stop}),l(d)?h=d.data:(d=u.clone(),m.addInterval(d))}else h=p;var f;l(r.solidColor)?(h instanceof B||(h=new B),f=r.solidColor,Ae(o,h,"color",f.color,void 0,void 0,s)):l(r.grid)?(h instanceof X||(h=new X),f=r.grid,Ae(o,h,"color",f.color,void 0,a,s),Ae(Number,h,"cellAlpha",f.cellAlpha,void 0,a,s),Ae(e,h,"lineThickness",f.lineThickness,void 0,a,s),Ae(e,h,"lineOffset",f.lineOffset,void 0,a,s),Ae(e,h,"lineCount",f.lineCount,void 0,a,s)):l(r.image)?(h instanceof Z||(h=new Z),f=r.image,Ae(Image,h,"image",f.image,void 0,a,s),Ae(e,h,"repeat",f.repeat,void 0,a,s),Ae(Number,h,"alpha",f.alpha,void 0,a,s)):l(r.stripe)?(h instanceof de||(h=new de),f=r.stripe,Ae(pe,h,"orientation",f.orientation,void 0,a,s),Ae(o,h,"evenColor",f.evenColor,void 0,a,s),Ae(o,h,"oddColor",f.oddColor,void 0,a,s),Ae(Number,h,"offset",f.offset,void 0,a,s),Ae(Number,h,"repeat",f.repeat,void 0,a,s)):l(r.polylineOutline)?(h instanceof ne||(h=new ne),f=r.polylineOutline,Ae(o,h,"color",f.color,void 0,a,s),Ae(o,h,"outlineColor",f.outlineColor,void 0,a,s),Ae(Number,h,"outlineWidth",f.outlineWidth,void 0,a,s)):l(r.polylineGlow)&&(h instanceof ie||(h=new ie),f=r.polylineGlow,Ae(o,h,"color",f.color,void 0,a,s),Ae(Number,h,"glowPower",f.glowPower,void 0,a,s)),l(d)?d.data=h:t[i]=h}function De(e,t,i,r,n,o){if(l(i))if(g(i))for(var a=0,s=i.length;s>a;a++)Me(e,t,i[a],r,n,o);else Me(e,t,i,r,n,o)}function Re(e,t,i,r){e.name=s(t.name,e.name)}function Oe(e,t,i,r){var n=t.description;l(n)&&Ae(String,e,"description",n,void 0,r,i)}function Ne(e,t,i,r){var n=t.position;l(n)&&Ie(e,"position",n,void 0,r,i)}function Le(e,i,r,n){var o=i.viewFrom;l(o)&&Ae(t,e,"viewFrom",o,void 0,n,r)}function Fe(e,t,i,r){var n=t.orientation;l(n)&&Ae(T,e,"orientation",n,void 0,r,i)}function Be(e,i,r,n){var o,a,s=r.references;if(l(s)){var u=[];for(o=0,a=s.length;a>o;o++)u.push(ge(n,s[o]));var c=r.interval;if(l(c)){if(c=I.fromIso8601(c),!(e[i]instanceof k)){c.data=new oe(u);var d=new k;d.intervals.addInterval(c),e[i]=d}}else e[i]=new oe(u)}else{var p=[],m=r.cartesian;if(l(m)){for(o=0,a=m.length;a>o;o+=3)p.push(new t(m[o],m[o+1],m[o+2]));r.array=p}else if(m=r.cartographicRadians,l(m)){for(o=0,a=m.length;a>o;o+=3)lt.longitude=m[o],lt.latitude=m[o+1],lt.height=m[o+2],p.push(h.WGS84.cartographicToCartesian(lt));r.array=p}else if(m=r.cartographicDegrees,l(m)){for(o=0,a=m.length;a>o;o+=3)p.push(t.fromDegrees(m[o],m[o+1],m[o+2]));r.array=p}l(r.array)&&Ae(Array,e,i,r,void 0,void 0,n)}}function Ve(e,t,i,r){if(l(i))if(g(i))for(var n=i.length,o=0;n>o;o++)Be(e,t,i[o],r);else Be(e,t,i,r)}function ke(e,t,i,r){var n,o=t.availability;if(l(o)){var a;if(g(o))for(var s=o.length,u=0;s>u;u++)l(a)||(a=new M),ht.iso8601=o[u],n=I.fromIso8601(ht),a.addInterval(n);else ht.iso8601=o,n=I.fromIso8601(ht),a=new M,a.addInterval(n);e.availability=a}}function ze(i,r,n,a){var s=r.billboard;if(l(s)){var u,c=s.interval;l(c)&&(ht.iso8601=c,u=I.fromIso8601(ht));var h=i.billboard;l(h)||(i.billboard=h=new F),Ae(o,h,"color",s.color,u,a,n),Ae(t,h,"eyeOffset",s.eyeOffset,u,a,n),Ae(D,h,"horizontalOrigin",s.horizontalOrigin,u,a,n),Ae(Image,h,"image",s.image,u,a,n),Ae(e,h,"pixelOffset",s.pixelOffset,u,a,n),Ae(Number,h,"scale",s.scale,u,a,n),Ae(ue,h,"rotation",s.rotation,u,a,n),Ae(t,h,"alignedAxis",s.alignedAxis,u,a,n),Ae(Boolean,h,"show",s.show,u,a,n),Ae(O,h,"verticalOrigin",s.verticalOrigin,u,a,n),Ae(Boolean,h,"sizeInMeters",s.sizeInMeters,u,a,n)}}function Ue(e,t){var i=e.version;if(l(i)&&"string"==typeof i){var r=i.split(".");if(2===r.length){if("1"!==r[0])throw new A("Cesium only supports CZML version 1.");t._version=i}}if(!l(t._version))throw new A("CZML version information invalid. It is expected to be a property on the document object in the . version format.");var n=t._documentPacket;l(e.name)&&(n.name=e.name);var o=e.clock;if(l(o)){var a=n.clock;l(a)?(a.interval=s(o.interval,a.interval),a.currentTime=s(o.currentTime,a.currentTime),a.range=s(o.range,a.range),a.step=s(o.step,a.step),a.multiplier=s(o.multiplier,a.multiplier)):n.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function Ge(e,t,i,r){var n=t.ellipse;if(l(n)){var a,s=n.interval;l(s)&&(ht.iso8601=s,a=I.fromIso8601(ht));var u=e.ellipse;l(u)||(e.ellipse=u=new q),Ae(Boolean,u,"show",n.show,a,r,i),Ae(ue,u,"rotation",n.rotation,a,r,i),Ae(Number,u,"semiMajorAxis",n.semiMajorAxis,a,r,i),Ae(Number,u,"semiMinorAxis",n.semiMinorAxis,a,r,i),Ae(Number,u,"height",n.height,a,r,i),Ae(Number,u,"extrudedHeight",n.extrudedHeight,a,r,i),Ae(Number,u,"granularity",n.granularity,a,r,i),Ae(ue,u,"stRotation",n.stRotation,a,r,i),De(u,"material",n.material,a,r,i),Ae(Boolean,u,"fill",n.fill,a,r,i),Ae(Boolean,u,"outline",n.outline,a,r,i),Ae(o,u,"outlineColor",n.outlineColor,a,r,i),Ae(Number,u,"outlineWidth",n.outlineWidth,a,r,i),Ae(Number,u,"numberOfVerticalLines",n.numberOfVerticalLines,a,r,i)}}function We(e,i,r,n){var a=i.ellipsoid;if(l(a)){var s,u=a.interval;l(u)&&(ht.iso8601=u,s=I.fromIso8601(ht));var c=e.ellipsoid;l(c)||(e.ellipsoid=c=new j),Ae(Boolean,c,"show",a.show,s,n,r),Ae(t,c,"radii",a.radii,s,n,r),De(c,"material",a.material,s,n,r),Ae(Boolean,c,"fill",a.fill,s,n,r),Ae(Boolean,c,"outline",a.outline,s,n,r),Ae(o,c,"outlineColor",a.outlineColor,s,n,r),Ae(Number,c,"outlineWidth",a.outlineWidth,s,n,r)}}function He(i,r,n,a){var s=r.label;if(l(s)){var u,c=s.interval;l(c)&&(ht.iso8601=c,u=I.fromIso8601(ht));var h=i.label;l(h)||(i.label=h=new K),Ae(o,h,"fillColor",s.fillColor,u,a,n),Ae(o,h,"outlineColor",s.outlineColor,u,a,n),Ae(Number,h,"outlineWidth",s.outlineWidth,u,a,n),Ae(t,h,"eyeOffset",s.eyeOffset,u,a,n),Ae(D,h,"horizontalOrigin",s.horizontalOrigin,u,a,n),Ae(String,h,"text",s.text,u,a,n),Ae(e,h,"pixelOffset",s.pixelOffset,u,a,n),Ae(Number,h,"scale",s.scale,u,a,n),Ae(Boolean,h,"show",s.show,u,a,n),Ae(O,h,"verticalOrigin",s.verticalOrigin,u,a,n),Ae(String,h,"font",s.font,u,a,n),Ae(R,h,"style",s.style,u,a,n)}}function qe(e,t,i,r){var n=t.model;if(l(n)){var o,a=n.interval;l(a)&&(ht.iso8601=a,o=I.fromIso8601(ht));var s=e.model;l(s)||(e.model=s=new Q),Ae(Boolean,s,"show",n.show,o,r,i),Ae(Number,s,"scale",n.scale,o,r,i),Ae(Number,s,"minimumPixelSize",n.minimumPixelSize,o,r,i),Ae(Boolean,s,"incrementallyLoadTextures",n.incrementallyLoadTextures,o,r,i),Ae(N,s,"uri",n.gltf,o,r,i),Ae(Boolean,s,"runAnimations",n.runAnimations,o,r,i);var u=n.nodeTransformations;if(l(u))if(g(u))for(var c=0,h=u.length;h>c;c++)je(s,u[c],o,r,i);else je(s,u,o,r,i)}}function je(e,i,r,n,o){var a,s=i.interval;l(s)?(ht.iso8601=s,a=I.fromIso8601(ht),l(r)&&(a=I.intersect(a,r,ut))):l(r)&&(a=r);for(var u=e.nodeTransformations,c=Object.keys(i),h=0,d=c.length;d>h;++h){var p=c[h];if("interval"!==p){var m=i[p];if(l(m)){l(u)||(e.nodeTransformations=u=new ae),u.hasProperty(p)||u.addProperty(p);var f=u[p];l(f)||(u[p]=f=new J),Ae(t,f,"translation",m.translation,a,n,o),Ae(T,f,"rotation",m.rotation,a,n,o),Ae(t,f,"scale",m.scale,a,n,o)}}}}function Ye(e,t,i,r){var n=t.path;if(l(n)){var o,a=n.interval;l(a)&&(ht.iso8601=a,o=I.fromIso8601(ht));var s=e.path;l(s)||(e.path=s=new $),Ae(Boolean,s,"show",n.show,o,r,i),Ae(Number,s,"width",n.width,o,r,i),Ae(Number,s,"resolution",n.resolution,o,r,i),Ae(Number,s,"leadTime",n.leadTime,o,r,i),Ae(Number,s,"trailTime",n.trailTime,o,r,i),De(s,"material",n.material,o,r,i)}}function Xe(e,t,i,r){var n=t.point;if(l(n)){var a,s=n.interval;l(s)&&(ht.iso8601=s,a=I.fromIso8601(ht));var u=e.point;l(u)||(e.point=u=new ee),Ae(o,u,"color",n.color,a,r,i),Ae(Number,u,"pixelSize",n.pixelSize,a,r,i),Ae(o,u,"outlineColor",n.outlineColor,a,r,i),Ae(Number,u,"outlineWidth",n.outlineWidth,a,r,i),Ae(Boolean,u,"show",n.show,a,r,i)}}function Ze(e,t,i,r){var n=t.polygon;if(l(n)){var a,s=n.interval;l(s)&&(ht.iso8601=s,a=I.fromIso8601(ht));var u=e.polygon;l(u)||(e.polygon=u=new te),Ae(Boolean,u,"show",n.show,a,r,i),De(u,"material",n.material,a,r,i),Ae(Number,u,"height",n.height,a,r,i),Ae(Number,u,"extrudedHeight",n.extrudedHeight,a,r,i),Ae(Number,u,"granularity",n.granularity,a,r,i),Ae(ue,u,"stRotation",n.stRotation,a,r,i),Ae(Boolean,u,"fill",n.fill,a,r,i),Ae(Boolean,u,"outline",n.outline,a,r,i),Ae(o,u,"outlineColor",n.outlineColor,a,r,i),Ae(Number,u,"outlineWidth",n.outlineWidth,a,r,i),Ae(Boolean,u,"perPositionHeight",n.perPositionHeight,a,r,i),Ve(u,"hierarchy",n.positions,i)}}function Ke(e,t,i,r){var n=t.rectangle;if(l(n)){var a,s=n.interval;l(s)&&(ht.iso8601=s,a=I.fromIso8601(ht));var u=e.rectangle;l(u)||(e.rectangle=u=new se),Ae(Boolean,u,"show",n.show,a,r,i),Ae(x,u,"coordinates",n.coordinates,a,r,i),De(u,"material",n.material,a,r,i),Ae(Number,u,"height",n.height,a,r,i),Ae(Number,u,"extrudedHeight",n.extrudedHeight,a,r,i),Ae(Number,u,"granularity",n.granularity,a,r,i),Ae(ue,u,"rotation",n.rotation,a,r,i),Ae(ue,u,"stRotation",n.stRotation,a,r,i),Ae(Boolean,u,"fill",n.fill,a,r,i),Ae(Boolean,u,"outline",n.outline,a,r,i),Ae(o,u,"outlineColor",n.outlineColor,a,r,i),Ae(Number,u,"outlineWidth",n.outlineWidth,a,r,i),Ae(Boolean,u,"closeBottom",n.closeBottom,a,r,i),Ae(Boolean,u,"closeTop",n.closeTop,a,r,i)}}function Qe(e,t,i,r){var n=t.wall;if(l(n)){var a,s=n.interval;l(s)&&(ht.iso8601=s,a=I.fromIso8601(ht));var u=e.wall;l(u)||(e.wall=u=new ve),Ae(Boolean,u,"show",n.show,a,r,i),De(u,"material",n.material,a,r,i),Ae(Array,u,"minimumHeights",n.minimumHeights,a,r,i),Ae(Array,u,"maximumHeights",n.maximumHeights,a,r,i),Ae(Number,u,"granularity",n.granularity,a,r,i),Ae(Boolean,u,"fill",n.fill,a,r,i),Ae(Boolean,u,"outline",n.outline,a,r,i),Ae(o,u,"outlineColor",n.outlineColor,a,r,i),Ae(Number,u,"outlineWidth",n.outlineWidth,a,r,i),Ve(u,"positions",n.positions,i)}}function Je(e,t,i,r){var n=t.polyline;if(l(n)){var o,a=n.interval;l(a)&&(ht.iso8601=a,o=I.fromIso8601(ht));var s=e.polyline;l(s)||(e.polyline=s=new re),Ae(Boolean,s,"show",n.show,o,r,i),Ae(Number,s,"width",n.width,o,r,i),De(s,"material",n.material,o,r,i),Ae(Boolean,s,"followSurface",n.followSurface,o,r,i),Ae(Number,s,"granularity",n.granularity,o,r,i),Ve(s,"positions",n.positions,i)}}function $e(e,t,i,r,n){var o=e.id;if(l(o)||(o=a()),ot=o,!l(n._version)&&"document"!==o)throw new A("The first CZML packet is required to be the document object.");if(e["delete"]===!0)t.removeById(o);else if("document"===o)Ue(e,n);else{var s=t.getOrCreateEntity(o),u=e.parent;l(u)&&(s.parent=t.getOrCreateEntity(u));for(var c=i.length-1;c>-1;c--)i[c](s,e,t,r)}ot=void 0}function et(e){var t,i=e._documentPacket.clock;if(!l(i)){if(!l(e._clock)){var o=e._entityCollection.computeAvailability();if(!o.start.equals(_.MINIMUM_VALUE)){var a=o.start,u=o.stop,c=y.secondsDifference(u,a),h=Math.round(c/120);return t=new H,t.startTime=y.clone(a),t.stopTime=y.clone(u),t.clockRange=r.LOOP_STOP,t.multiplier=h,t.currentTime=y.clone(a),t.clockStep=n.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}if(l(e._clock)?t=e._clock.clone():(t=new H,t.startTime=_.MINIMUM_VALUE.clone(),t.stopTime=_.MAXIMUM_VALUE.clone(),t.currentTime=_.MINIMUM_VALUE.clone(),t.clockRange=r.LOOP_STOP,t.clockStep=n.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1),l(i.interval)){ht.iso8601=i.interval;var d=I.fromIso8601(ht);t.startTime=d.start,t.stopTime=d.stop}return l(i.currentTime)&&(t.currentTime=y.fromIso8601(i.currentTime)),l(i.range)&&(t.clockRange=s(r[i.range],r.LOOP_STOP)),l(i.step)&&(t.clockStep=s(n[i.step],n.SYSTEM_CLOCK_MULTIPLIER)),l(i.multiplier)&&(t.multiplier=i.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function tt(e,t,i,r){i=s(i,s.EMPTY_OBJECT);var n=t,o=i.sourceUri;return"string"==typeof t&&(n=S(t),o=s(o,t)),W.setLoading(e,!0),L(n,function(t){return it(e,t,o,r)}).otherwise(function(t){return W.setLoading(e,!1),e._error.raiseEvent(e,t),console.log(t),L.reject(t)})}function it(e,t,i,r){W.setLoading(e,!0);var n=e._entityCollection;r&&(e._version=void 0,e._documentPacket=new rt,n.removeAll()),nt._processCzml(t,n,i,void 0,e);var o=et(e),a=e._documentPacket;return l(a.name)&&e._name!==a.name?(e._name=a.name,o=!0):!l(e._name)&&l(i)&&(e._name=f(i),o=!0),W.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function rt(){this.name=void 0,this.clock=void 0}function nt(e){this._name=e,this._changed=new d,this._error=new d,this._isLoading=!1,this._loading=new d,this._clock=void 0,this._documentPacket=new rt,this._version=void 0,this._entityCollection=new Y(this)}var ot,at=new t,st=new P,lt=new i,ut=new I,ct={HERMITE:v,LAGRANGE:C,LINEAR:E},ht={iso8601:void 0};return nt.load=function(e,t){return(new nt).load(e,t)},u(nt.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}}}),nt.updaters=[ze,Ge,We,He,qe,Re,Oe,Ye,Xe,Ze,Je,Ke,Ne,Le,Qe,Fe,ke],nt.prototype.process=function(e,t){return tt(this,e,t,!1)},nt.prototype.load=function(e,t){return tt(this,e,t,!0)},nt.processPacketData=Ae,nt.processPositionPacketData=Ie,nt.processMaterialPacketData=De,nt._processCzml=function(e,t,i,r,n){if(r=l(r)?r:nt.updaters,g(e))for(var o=0,a=e.length;a>o;o++)$e(e[o],t,r,i,n);else $e(e,t,r,i,n)},nt}),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-1!==r?(this._dataSources.splice(r,1),this._dataSourceRemoved.raiseEvent(this,t),i&&"function"==typeof t.destroy&&t.destroy(),!0):!1},s.prototype.removeAll=function(t){t=e(t,!1);for(var i=this._dataSources,r=0,n=i.length;n>r;++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-1!==this.indexOf(e)},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/EllipseGeometry","../Core/EllipseOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";function E(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 S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.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._options=new E(e),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}function w(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(e.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(e.BLACK),I=new e;return n(S,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),n(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.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)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,l=a.isAvailable(i),u=new d(l&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i));if(this._materialProperty instanceof v){var h=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(h=this._materialProperty.color.getValue(i)),o=t.fromColor(h),n={show:u,color:o}}else n={show:u};return new c({id:a,geometry:new s(this._options),attributes:n})},S.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=C.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new c({id:r,geometry:new l(this._options),attributes:{show:new d(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),o(this)},S.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(h.MINIMUM_VALUE):!0,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=this._entity.position,f=a.semiMajorAxis,g=a.semiMinorAxis,_=a.show;if(r(_)&&_.isConstant&&!_.getValue(h.MINIMUM_VALUE)||!r(d)||!r(f)||!r(g))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var y=i(a.material,T),E=y instanceof v;this._materialProperty=y,this._fillProperty=i(s,b),this._showProperty=i(_,x),this._showOutlineProperty=i(a.outline,A),this._outlineColorProperty=c?i(a.outlineColor,P):void 0;var S=a.rotation,w=a.height,I=a.extrudedHeight,M=a.granularity,D=a.stRotation,R=a.outlineWidth,O=a.numberOfVerticalLines;if(this._isClosed=r(I),this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&f.isConstant&&g.isConstant&&C.isConstant(S)&&C.isConstant(w)&&C.isConstant(I)&&C.isConstant(M)&&C.isConstant(D)&&C.isConstant(R)&&C.isConstant(O)){var N=this._options;N.vertexFormat=E?m.VERTEX_FORMAT:p.MaterialSupport.TEXTURED.vertexFormat,N.center=d.getValue(h.MINIMUM_VALUE,N.center),N.semiMajorAxis=f.getValue(h.MINIMUM_VALUE,N.semiMajorAxis),N.semiMinorAxis=g.getValue(h.MINIMUM_VALUE,N.semiMinorAxis),N.rotation=r(S)?S.getValue(h.MINIMUM_VALUE):void 0,N.height=r(w)?w.getValue(h.MINIMUM_VALUE):void 0,N.extrudedHeight=r(I)?I.getValue(h.MINIMUM_VALUE):void 0,N.granularity=r(M)?M.getValue(h.MINIMUM_VALUE):void 0,N.stRotation=r(D)?D.getValue(h.MINIMUM_VALUE):void 0,N.numberOfVerticalLines=r(O)?O.getValue(h.MINIMUM_VALUE):void 0,this._outlineWidth=r(R)?R.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.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,u=a.ellipse;if(a.isShowing&&a.isAvailable(i)&&C.getValueOrDefault(u.show,i,!0)){var h=this._options,d=C.getValueOrUndefined(a.position,i,h.center),v=C.getValueOrUndefined(u.semiMajorAxis,i),g=C.getValueOrUndefined(u.semiMinorAxis,i);if(r(d)&&r(v)&&r(g)){if(h.center=d,h.semiMajorAxis=v,h.semiMinorAxis=g,h.rotation=C.getValueOrUndefined(u.rotation,i),h.height=C.getValueOrUndefined(u.height,i),h.extrudedHeight=C.getValueOrUndefined(u.extrudedHeight,i),h.granularity=C.getValueOrUndefined(u.granularity,i),h.stRotation=C.getValueOrUndefined(u.stRotation,i),h.numberOfVerticalLines=C.getValueOrUndefined(u.numberOfVerticalLines,i),C.getValueOrDefault(u.fill,i,!0)){var _=y.getValue(i,o.fillMaterialProperty,this._material);this._material=_;var E=new p({material:_,translucent:_.isTranslucent(),closed:r(h.extrudedHeight)});h.vertexFormat=E.vertexFormat,this._primitive=n.add(new f({geometryInstances:new c({id:a,geometry:new s(h)}),appearance:E,asynchronous:!1}))}if(C.getValueOrDefault(u.outline,i,!1)){h.vertexFormat=m.VERTEX_FORMAT;var S=C.getValueOrClonedDefault(u.outlineColor,i,e.BLACK,I),w=C.getValueOrDefault(u.outlineWidth,i,1),T=1!==S.alpha;this._outlinePrimitive=n.add(new f({geometryInstances:new c({id:a,geometry:new l(h),attributes:{color:t.fromColor(S)}}),appearance:new m({flat:!0,translucent:T,renderState:{lineWidth:o._scene.clampLineWidth(w)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},S}),i("DataSources/EllipsoidGeometryUpdater",["../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidGeometry","../Core/EllipsoidOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/Matrix4","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/SceneMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w){"use strict";function T(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 x(e,t){this._scene=t,this._entity=e,this._entitySubscription=e.definitionChanged.addEventListener(x.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new c,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new T(e),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}function b(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 T(t._entity),this._modelMatrix=new p,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 A=new y(t.WHITE),P=new C(!0),I=new C(!0),M=new C(!1),D=new C(t.BLACK),R=new e,O=new t,N=new e(1,1,1);return o(x,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:f}}),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)&&w.isConstant(this._showProperty)&&w.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)&&w.isConstant(this._showProperty)&&w.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),x.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},x.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},x.prototype.createFillGeometryInstance=function(e){var r,o,a=this._entity,s=a.isAvailable(e),u=new m(s&&a.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e));if(this._materialProperty instanceof y){var c=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(c=this._materialProperty.color.getValue(e)),o=i.fromColor(c),r={show:u,color:o}}else r={show:u};return new h({id:a,geometry:new l(this._options),modelMatrix:a._getModelMatrix(d.MINIMUM_VALUE),attributes:r})},x.prototype.createOutlineGeometryInstance=function(e){var r=this._entity,n=r.isAvailable(e),o=w.getValueOrDefault(this._outlineColorProperty,e,t.BLACK);return new h({id:r,geometry:new u(this._options),modelMatrix:r._getModelMatrix(d.MINIMUM_VALUE),attributes:{show:new m(n&&r.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:i.fromColor(o)}})},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||"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(d.MINIMUM_VALUE):!0,u=a.outline,c=n(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=e.position,p=a.radii,m=a.show;if(n(m)&&m.isConstant&&!m.getValue(d.MINIMUM_VALUE)||!n(h)||!n(p))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=r(a.material,A),_=g instanceof y;this._materialProperty=g,this._fillProperty=r(s,I),this._showProperty=r(m,P),this._showOutlineProperty=r(a.outline,M),this._outlineColorProperty=c?r(a.outlineColor,D):void 0,this._fillEnabled=l,this._outlineEnabled=c;var C=a.stackPartitions,E=a.slicePartitions,S=a.outlineWidth,T=a.subdivisions;if(h.isConstant&&w.isConstant(e.orientation)&&p.isConstant&&w.isConstant(C)&&w.isConstant(E)&&w.isConstant(S)&&w.isConstant(T)){var x=this._options;x.vertexFormat=_?v.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,x.radii=p.getValue(d.MINIMUM_VALUE,x.radii),x.stackPartitions=n(C)?C.getValue(d.MINIMUM_VALUE):void 0,x.slicePartitions=n(E)?E.getValue(d.MINIMUM_VALUE):void 0,x.subdivisions=n(T)?T.getValue(d.MINIMUM_VALUE):void 0,this._outlineWidth=n(S)?S.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},x.prototype.createDynamicUpdater=function(e){return new b(e,this)},b.prototype.update=function(e){var o=this._entity,a=o.ellipsoid;if(!o.isShowing||!o.isAvailable(e)||!w.getValueOrDefault(a.show,e,!0))return n(this._primitive)&&(this._primitive.show=!1),void(n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var s=w.getValueOrUndefined(a.radii,e,R),c=o._getModelMatrix(e,this._modelMatrix);if(!n(c)||!n(s))return n(this._primitive)&&(this._primitive.show=!1),void(n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var d,y=w.getValueOrDefault(a.fill,e,!0),C=w.getValueOrDefault(a.outline,e,!1),E=w.getValueOrClonedDefault(a.outlineColor,e,t.BLACK,O),T=S.getValue(e,r(a.material,A),this._material);this._material=T;var x=w.getValueOrUndefined(a.stackPartitions,e),b=w.getValueOrUndefined(a.slicePartitions,e),P=w.getValueOrUndefined(a.subdivisions,e),I=w.getValueOrDefault(a.outlineWidth,e,1),M=this._scene.mode,D=M===_.SCENE3D,L=this._options,F=!D||this._lastSceneMode!==M||!n(this._primitive)||L.stackPartitions!==x||L.slicePartitions!==b||L.subdivisions!==P||this._lastOutlineWidth!==I;if(F){var B=this._primitives;B.removeAndDestroy(this._primitive),B.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=M,this._lastOutlineWidth=I,L.stackPartitions=x,L.slicePartitions=b,L.subdivisions=P,L.radii=D?N:s,d=new f({material:T,translucent:T.isTranslucent(),closed:!0}),L.vertexFormat=d.vertexFormat,this._primitive=B.add(new g({geometryInstances:new h({id:o,geometry:new l(L),modelMatrix:D?void 0:c,attributes:{show:new m(y)}}),appearance:d,asynchronous:!1})),L.vertexFormat=v.VERTEX_FORMAT,this._outlinePrimitive=B.add(new g({geometryInstances:new h({id:o,geometry:new u(L),modelMatrix:D?void 0:c,attributes:{show:new m(C),color:i.fromColor(E)}}),appearance:new v({flat:!0,translucent:1!==E.alpha,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(I)}}),asynchronous:!1})),this._lastShow=y,this._lastOutlineShow=C,this._lastOutlineColor=t.clone(E,this._lastOutlineColor)}else if(this._primitive.ready){var V=this._primitive,k=this._outlinePrimitive;V.show=!0,k.show=!0,d=V.appearance,d.material=T;var z=this._attributes;n(z)||(z=V.getGeometryInstanceAttributes(o),this._attributes=z),y!==this._lastShow&&(z.show=m.toValue(y,z.show),this._lastShow=y);var U=this._outlineAttributes;n(U)||(U=k.getGeometryInstanceAttributes(o),this._outlineAttributes=U),C!==this._lastOutlineShow&&(U.show=m.toValue(C,U.show),this._lastOutlineShow=C),t.equals(E,this._lastOutlineColor)||(U.color=i.toValue(E,U.color),t.clone(E,this._lastOutlineColor))}D&&(s.x=Math.max(s.x,.001),s.y=Math.max(s.y,.001),s.z=Math.max(s.z,.001),c=p.multiplyByScale(c,s,c),this._primitive.modelMatrix=c,this._outlinePrimitive.modelMatrix=c)},b.prototype.getBoundingSphere=function(e,t){return E(e,this._primitive,this._outlinePrimitive,t)},b.prototype.isDestroyed=function(){return!1},b.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),a(this)},x}),i("DataSources/StaticGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState"],function(e,t,i,r,n,o,a){"use strict";function s(t,i,r,n){this.translucent=i,this.appearanceType=r,this.closed=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.subscriptions=new e,this.showsUpdated=new e,this.itemsToRemove=[]}function l(e,t,i){this._solidBatch=new s(e,!1,t,i),this._translucentBatch=new s(e,!0,t,i)}var u=new t;return s.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){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)},s.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))}},s.prototype.update=function(e){var a,s,l=!0,c=0,h=this.primitive,d=this.primitives;if(this.createPrimitive){var p=this.geometry.values,m=p.length;if(m>0){for(r(h)&&(r(this.oldPrimitive)?d.remove(h):this.oldPrimitive=h),s=0;m>s;s++){var f=p[s],v=f.attributes;a=this.attributes.get(f.id.id),r(a)&&(r(v.show)&&(v.show.value=a.show),r(v.color)&&(v.color.value=a.color))}h=new o({asynchronous:!0,geometryInstances:p,appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed})}),d.add(h),l=!1}else{r(h)&&(d.remove(h),h=void 0);var g=this.oldPrimitive;r(g)&&(d.remove(g),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=h,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(r(h)&&h.ready){r(this.oldPrimitive)&&(d.remove(this.oldPrimitive),this.oldPrimitive=void 0);var _=this.updatersWithAttributes.values,y=_.length,C=this.waitingOnCreate;for(s=0;y>s;s++){var E=_[s],S=this.geometry.get(E.entity.id);if(a=this.attributes.get(S.id.id),r(a)||(a=h.getGeometryInstanceAttributes(S.id),this.attributes.set(S.id.id,a)),!E.fillMaterialProperty.isConstant||C){var w=E.fillMaterialProperty.color;w.getValue(e,u),t.equals(a._lastColor,u)||(a._lastColor=t.clone(u,a._lastColor),a.color=i.toValue(u,a.color),(this.translucent&&255===a.color[3]||!this.translucent&&255!==a.color[3])&&(this.itemsToRemove[c++]=E))}var T=E.entity.isShowing&&(E.hasConstantFill||E.isFilled(e)),x=1===a.show[0];T!==x&&(a.show=n.toValue(T,a.show))}this.updateShows(h),this.waitingOnCreate=!1}else r(h)&&!h.ready&&(l=!1);return this.itemsToRemove.length=c,l},s.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,o=0;i>o;o++){var a=t[o],s=this.geometry.get(a.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=a.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=n.toValue(u,l.show))}this.showsUpdated.removeAll()},s.prototype.contains=function(e){return this.updaters.contains(e.id)},s.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return a.PENDING;var n=i.getGeometryInstanceAttributes(e);return!r(n)||!r(n.boundingSphere)||r(n.show)&&0===n.show[0]?a.FAILED:(n.boundingSphere.clone(t),a.DONE)},s.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)},l.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)},l.prototype.remove=function(e){this._solidBatch.remove(e)||this._translucentBatch.remove(e)},l.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;o>t;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;a>t;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},l.prototype.getBoundingSphere=function(e,t){return this._solidBatch.contains(e)?this._solidBatch.getBoundingSphere(e,t):this._translucentBatch.contains(e)?this._translucentBatch.getBoundingSphere(e,t):a.FAILED},l.prototype.removeAllPrimitives=function(){this._solidBatch.removeAllPrimitives(),this._translucentBatch.removeAllPrimitives()},l}),i("DataSources/StaticGeometryPerMaterialBatch",["../Core/AssociativeArray","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./MaterialProperty"],function(e,t,i,r,n,o){"use strict";function a(t,i,r,n){this.primitives=t,this.appearanceType=i,this.materialProperty=r,this.closed=n,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(a.prototype.onMaterialChanged,this),this.subscriptions=new e,this.showsUpdated=new e}function s(e,t,i){this._items=[],this._primitives=e,this._appearanceType=t,this._closed=i}return a.prototype.onMaterialChanged=function(){this.invalidated=!0},a.prototype.isMaterial=function(e){var i=this.materialProperty,r=e.fillMaterialProperty;return r===i?!0:t(i)?i.equals(r):!1},a.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){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},a.prototype.remove=function(e){var i=e.entity.id,r=this.updaters.remove(i);if(r){this.geometry.remove(i),this.updatersWithAttributes.remove(i);var n=this.subscriptions.get(i);t(n)&&(n(),this.subscriptions.remove(i))}return this.createPrimitive=r,r},a.prototype.update=function(e){var n,a,s=!0,l=this.primitive,u=this.primitives,c=this.geometry.values;if(this.createPrimitive){var h=c.length;if(h>0){for(t(l)&&(t(this.oldPrimitive)?u.remove(l):this.oldPrimitive=l),a=0;h>a;a++){var d=c[a],p=d.attributes;n=this.attributes.get(d.id.id),t(n)&&(t(p.show)&&(p.show.value=n.show),t(p.color)&&(p.color.value=n.color))}this.material=o.getValue(e,this.materialProperty,this.material),l=new r({asynchronous:!0,geometryInstances:c,appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed})}),u.add(l),s=!1}else{t(l)&&(u.remove(l),l=void 0);var m=this.oldPrimitive;t(m)&&(u.remove(m),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=l,this.createPrimitive=!1}else if(t(l)&&l.ready){t(this.oldPrimitive)&&(u.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=o.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;var f=this.updatersWithAttributes.values,v=f.length;for(a=0;v>a;a++){var g=f[a],_=g.entity,y=this.geometry.get(_.id);n=this.attributes.get(y.id.id),t(n)||(n=l.getGeometryInstanceAttributes(y.id),this.attributes.set(y.id.id,n));var C=_.isShowing&&(g.hasConstantFill||g.isFilled(e)),E=1===n.show[0];C!==E&&(n.show=i.toValue(C,n.show))}this.updateShows(l)}else t(l)&&!l.ready&&(s=!1);return s},a.prototype.updateShows=function(e){for(var r=this.showsUpdated.values,n=r.length,o=0;n>o;o++){var a=r[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=i.toValue(c,u.show))}this.showsUpdated.removeAll()},a.prototype.contains=function(e){return this.updaters.contains(e.id)},a.prototype.getBoundingSphere=function(e,i){var r=this.primitive;if(!r.ready)return n.PENDING;var o=r.getGeometryInstanceAttributes(e);return!t(o)||!t(o.boundingSphere)||t(o.show)&&0===o.show[0]?n.FAILED:(o.boundingSphere.clone(i),n.DONE)},a.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()},s.prototype.add=function(e,t){for(var i=this._items,r=i.length,n=0;r>n;n++){var o=i[n];if(o.isMaterial(t))return void o.add(e,t)}var s=new a(this._primitives,this._appearanceType,t.fillMaterialProperty,this._closed);s.add(e,t),i.push(s)},s.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}}},s.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;a>s;s++)this.add(e,o[s]);n.destroy()}}var l=!0;for(t=0;r>t;t++)l=i[t].update(e)&&l;return l},s.prototype.getBoundingSphere=function(e,t){for(var i=this._items,r=i.length,o=0;r>o;o++){var a=i[o];if(a.contains(e))return a.getBoundingSphere(e,t)}return n.FAILED},s.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;t>i;i++)e[i].destroy();this._items.length=0},s}),i("DataSources/StaticOutlineGeometryBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/ShowGeometryInstanceAttribute","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./BoundingSphereState"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i,r){this.translucent=i,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.width=r,this.subscriptions=new e,this.showsUpdated=new e}function u(t,i){this._primitives=t,this._scene=i,this._solidBatches=new e,this._translucentBatches=new e}l.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){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)},l.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 c=new t;return l.prototype.update=function(e){var s,l,u=!0,h=0,d=this.primitive,p=this.primitives;if(this.createPrimitive){var m=this.geometry.values,f=m.length;if(f>0){for(r(d)&&(r(this.oldPrimitive)?p.remove(d):this.oldPrimitive=d),l=0;f>l;l++){var v=m[l],g=v.attributes;s=this.attributes.get(v.id.id),r(s)&&(r(g.show)&&(g.show.value=s.show),r(g.color)&&(g.color.value=s.color))}d=new a({asynchronous:!0,geometryInstances:m,appearance:new o({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}})}),p.add(d),u=!1}else{r(d)&&(p.remove(d),d=void 0);var _=this.oldPrimitive;r(_)&&(p.remove(_),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=d,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(r(d)&&d.ready){r(this.oldPrimitive)&&(p.remove(this.oldPrimitive),this.oldPrimitive=void 0);var y=this.updatersWithAttributes.values,C=y.length,E=this.waitingOnCreate;for(l=0;C>l;l++){var S=y[l],w=this.geometry.get(S.entity.id);if(s=this.attributes.get(w.id.id),r(s)||(s=d.getGeometryInstanceAttributes(w.id),this.attributes.set(w.id.id,s)),!S.outlineColorProperty.isConstant||E){var T=S.outlineColorProperty;T.getValue(e,c),t.equals(s._lastColor,c)||(s._lastColor=t.clone(c,s._lastColor),s.color=i.toValue(c,s.color),(this.translucent&&255===s.color[3]||!this.translucent&&255!==s.color[3])&&(this.itemsToRemove[h++]=S))}var x=S.entity.isShowing&&(S.hasConstantOutline||S.isOutlineVisible(e)),b=1===s.show[0];x!==b&&(s.show=n.toValue(x,s.show))}this.updateShows(d),this.waitingOnCreate=!1}else r(d)&&!d.ready&&(u=!1);return this.itemsToRemove.length=h,u},l.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,o=0;i>o;o++){var a=t[o],s=this.geometry.get(a.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=a.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=n.toValue(u,l.show))}this.showsUpdated.removeAll()},l.prototype.contains=function(e){return this.updaters.contains(e.id)},l.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return s.PENDING;var n=i.getGeometryInstanceAttributes(e);return!r(n)||!r(n.boundingSphere)||r(n.show)&&0===n.show[0]?s.FAILED:(n.boundingSphere.clone(t),s.DONE)},l.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)},u.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 l(this._primitives,!1,a),i.set(a,n)),n.add(t,o)):(i=this._translucentBatches,n=i.get(a),r(n)||(n=new l(this._primitives,!0,a),i.set(a,n)),n.add(t,o))},u.prototype.remove=function(e){var t,i=this._solidBatches.values,r=i.length;for(t=0;r>t;t++)if(i[t].remove(e))return;var n=this._translucentBatches.values,o=n.length;for(t=0;o>t;t++)if(n[t].remove(e))return},u.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;s>i;i++){n=a[i],c=n.update(e),o=n.itemsToRemove;var d=o.length;if(d>0)for(h=!0,t=0;d>t;t++)r=o[t],n.remove(r),this.add(e,r)}for(i=0;u>i;i++){n=l[i],c=n.update(e),o=n.itemsToRemove;var p=o.length;if(p>0)for(h=!0,t=0;p>t;t++)r=o[t],n.remove(r),this.add(e,r)}}while(h);return c},u.prototype.getBoundingSphere=function(e,t){var i,r=this._solidBatches.values,n=r.length;for(i=0;n>i;i++){var o=r[i];if(o.contains(e))return o.getBoundingSphere(e,t)}var a=this._translucentBatches.values,l=a.length;for(i=0;l>i;i++){var u=a[i];if(u.contains(e))return u.getBoundingSphere(e,t)}return s.FAILED},u.prototype.removeAllPrimitives=function(){var e,t=this._solidBatches.values,i=t.length;for(e=0;i>e;e++)t[e].removeAllPrimitives();var r=this._translucentBatches.values,n=r.length;for(e=0;n>e;e++)r[e].removeAllPrimitives()},u}),i("DataSources/GeometryVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/defined","../Core/destroyObject","../Core/DeveloperError","./BoundingSphereState","./ColorMaterialProperty","./StaticGeometryColorBatch","./StaticGeometryPerMaterialBatch","./StaticOutlineGeometryBatch"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t){this._primitives=t,this._dynamicUpdaters=new e}function h(e,t){for(var i=e._batches,r=i.length,n=0;r>n;n++)i[n].remove(t)}function d(e,t,i){return i.isDynamic?void e._dynamicBatch.add(t,i):(i.outlineEnabled&&e._outlineBatch.add(t,i),void(i.fillEnabled&&(i.isClosed?i.fillMaterialProperty instanceof a?e._closedColorBatch.add(t,i):e._closedMaterialBatch.add(t,i):i.fillMaterialProperty instanceof a?e._openColorBatch.add(t,i):e._openMaterialBatch.add(t,i))))}function p(t,i,r){this._type=t;var n=i.primitives;this._scene=i,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new e,this._removedObjects=new e,this._changedObjects=new e,this._outlineBatch=new u(n,i),this._closedColorBatch=new s(n,t.perInstanceColorAppearanceType,!0),this._closedMaterialBatch=new l(n,t.materialAppearanceType,!0),this._openColorBatch=new s(n,t.perInstanceColorAppearanceType,!1),this._openMaterialBatch=new l(n,t.materialAppearanceType,!1),this._dynamicBatch=new c(n),this._batches=[this._closedColorBatch,this._closedMaterialBatch,this._openColorBatch,this._openMaterialBatch,this._dynamicBatch,this._outlineBatch],this._subscriptions=new e,this._updaters=new e,this._entityCollection=r,r.collectionChanged.addEventListener(p.prototype._onCollectionChanged,this),this._onCollectionChanged(r,r.values,m)}var m=[];c.prototype.add=function(e,t){this._dynamicUpdaters.set(t.entity.id,t.createDynamicUpdater(this._primitives))},c.prototype.remove=function(e){ +var t=e.entity.id,r=this._dynamicUpdaters.get(t);i(r)&&(this._dynamicUpdaters.remove(t),r.destroy())},c.prototype.update=function(e){for(var t=this._dynamicUpdaters.values,i=0,r=t.length;r>i;i++)t[i].update(e);return!0},c.prototype.removeAllPrimitives=function(){for(var e=this._dynamicUpdaters.values,t=0,i=e.length;i>t;t++)e[t].destroy();this._dynamicUpdaters.removeAll()},c.prototype.getBoundingSphere=function(e,t){var r=this._dynamicUpdaters.get(e.id);return i(r)&&i(r.getBoundingSphere)?r.getBoundingSphere(e,t):o.FAILED},p.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?(h(this,n),d(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),h(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),d(this,e,n),this._subscriptions.set(r,n.geometryChanged.addEventListener(p._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var m=!0,f=this._batches,v=f.length;for(t=0;v>t;t++)m=f[t].update(e)&&m;return m};var f=[],v=new t;return p.prototype.getBoundingSphere=function(e,i){for(var r=f,n=v,a=0,s=o.DONE,l=this._batches,u=l.length,c=0;u>c;c++){if(s=l[c].getBoundingSphere(e,n),s===o.PENDING)return o.PENDING;s===o.DONE&&(r[a]=t.clone(n,r[a]),a++)}return 0===a?o.FAILED:(r.length=a,t.fromBoundingSpheres(r,i),o.DONE)},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(p.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();var e,t=this._batches,i=t.length;for(e=0;i>e;e++)t[e].removeAllPrimitives();var n=this._subscriptions.values;for(i=n.length,e=0;i>e;e++)n[e]();return this._subscriptions.removeAll(),r(this)},p._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)},p.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)},p}),i("Scene/Label",["../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/NearFarScalar","./Billboard","./HeightReference","./HorizontalOrigin","./LabelStyle","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function m(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function f(n,o){n=r(n,r.EMPTY_OBJECT),this._text=r(n.text,""),this._show=r(n.show,!0),this._font=r(n.font,"30px sans-serif"),this._fillColor=i.clone(r(n.fillColor,i.WHITE)),this._outlineColor=i.clone(r(n.outlineColor,i.BLACK)),this._outlineWidth=r(n.outlineWidth,1),this._style=r(n.style,h.FILL),this._verticalOrigin=r(n.verticalOrigin,d.BOTTOM),this._horizontalOrigin=r(n.horizontalOrigin,c.LEFT),this._pixelOffset=e.clone(r(n.pixelOffset,e.ZERO)),this._eyeOffset=t.clone(r(n.eyeOffset,t.ZERO)),this._position=t.clone(r(n.position,t.ZERO)),this._scale=r(n.scale,1),this._id=n.id,this._translucencyByDistance=n.translucencyByDistance,this._pixelOffsetScaleByDistance=n.pixelOffsetScaleByDistance,this._heightReference=r(n.heightReference,u.NONE),this._labelCollection=o,this._glyphs=[],this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._updateClamping()}return o(f.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;r>i;i++){var o=t[i];n(o.billboard)&&(o.billboard.show=e)}}}},position:{get:function(){return this._position},set:function(e){var i=this._position;if(!t.equals(i,e))if(t.clone(e,i),this._heightReference===u.NONE)for(var r=this._glyphs,o=0,a=r.length;a>o;o++){var s=r[o];n(s.billboard)&&(s.billboard.position=e)}else this._updateClamping()}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightReference=e,this._updateClamping())}},text:{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e,p(this))}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,p(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){var t=this._fillColor;i.equals(t,e)||(i.clone(e,t),p(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;i.equals(t,e)||(i.clone(e,t),p(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,p(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,p(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(t){var i=this._pixelOffset;if(!e.equals(i,t)){e.clone(t,i);for(var r=this._glyphs,o=0,a=r.length;a>o;o++){var s=r[o];n(s.billboard)&&(s.billboard.pixelOffset=t)}}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;if(!s.equals(t,e)){this._translucencyByDistance=s.clone(e,t);for(var i=this._glyphs,r=0,o=i.length;o>r;r++){var a=i[r];n(a.billboard)&&(a.billboard.translucencyByDistance=e)}}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;if(!s.equals(t,e)){this._pixelOffsetScaleByDistance=s.clone(e,t);for(var i=this._glyphs,r=0,o=i.length;o>r;r++){var a=i[r];n(a.billboard)&&(a.billboard.pixelOffsetScaleByDistance=e)}}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var i=this._eyeOffset;if(!t.equals(i,e)){t.clone(e,i);for(var r=this._glyphs,o=0,a=r.length;a>o;o++){var s=r[o];n(s.billboard)&&(s.billboard.eyeOffset=e)}}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,m(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;r>i;i++){var o=t[i];n(o.billboard)&&(o.billboard.verticalOrigin=e)}m(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;r>i;i++){var o=t[i];n(o.billboard)&&(o.billboard.scale=e)}m(this)}}},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;r>i;i++){var o=t[i];n(o.billboard)&&(o.billboard.id=e)}}}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=t.clone(e,this._actualClampedPosition);for(var i=this._glyphs,r=0,o=i.length;o>r;r++){var a=i[r];n(a.billboard)&&(a.billboard.position=e)}}}}),f.prototype._updateClamping=function(){l._updateClamping(this._labelCollection,this)},f.prototype.computeScreenSpacePosition=function(t,i){n(i)||(i=new e);var r=this._labelCollection,o=r.modelMatrix,a=l._computeActualPosition(this,this._position,t.frameState,o),s=l._computeScreenSpacePosition(o,a,this._eyeOffset,this._pixelOffset,t,i);return s.y=t.canvas.clientHeight-s.y,s},f.prototype.equals=function(r){return this===r||n(r)&&this._show===r._show&&this._scale===r._scale&&this._style===r._style&&this._verticalOrigin===r._verticalOrigin&&this._horizontalOrigin===r._horizontalOrigin&&this._text===r._text&&this._font===r._font&&t.equals(this._position,r._position)&&i.equals(this._fillColor,r._fillColor)&&i.equals(this._outlineColor,r._outlineColor)&&e.equals(this._pixelOffset,r._pixelOffset)&&t.equals(this._eyeOffset,r._eyeOffset)&&s.equals(this._translucencyByDistance,r._translucencyByDistance)&&s.equals(this._pixelOffsetScaleByDistance,r._pixelOffsetScaleByDistance)&&this._id===r._id},f.prototype.isDestroyed=function(){return!1},f}),i("Scene/LabelCollection",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/writeTextToCanvas","./BillboardCollection","./HorizontalOrigin","./Label","./LabelStyle","./TextureAtlas","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function f(e,t,i){this.labelCollection=e,this.index=t,this.dimensions=i}function v(e,t,i,r,n,o,a){return w.font=t,w.fillColor=i,w.strokeColor=r,w.strokeWidth=n,a===p.BOTTOM?w.textBaseline="bottom":a===p.TOP?w.textBaseline="top":w.textBaseline="middle",w.fill=o===h.FILL||o===h.FILL_AND_OUTLINE,w.stroke=o===h.OUTLINE||o===h.FILL_AND_OUTLINE,s(e,w)}function g(e,t){t.textureInfo=void 0,t.dimensions=void 0;var r=t.billboard;i(r)&&(r.show=!1,r.image=void 0,e._spareBillboards.push(r),t.billboard=void 0)}function _(e,t,i,r){e.addImage(t,i).then(function(e,t){r.index=e})}function y(e,t){var r,n,o,a=t._text,s=a.length,l=t._glyphs,c=l.length;if(c>s)for(n=s;c>n;++n)g(e,l[n]);l.length=s;var h=e._glyphTextureCache;for(o=0;s>o;++o){var d=a.charAt(o),p=t._font,y=t._fillColor,C=t._outlineColor,E=t._outlineWidth,S=t._style,w=t._verticalOrigin,T=JSON.stringify([d,p,y.toRgba(),C.toRgba(),E,+S,+w]),x=h[T];if(!i(x)){var b=v(d,p,y,C,E,S,w);x=new f(e,-1,b.dimensions),h[T]=x,b.width>0&&b.height>0&&_(e._textureAtlas,T,b,x)}if(r=l[o],i(r)?-1===x.index?g(e,r):i(r.textureInfo)&&(r.textureInfo=void 0):(r=new m,l[o]=r),r.textureInfo=x,r.dimensions=x.dimensions,-1!==x.index){var A=r.billboard;i(A)||(A=e._spareBillboards.length>0?e._spareBillboards.pop():e._billboardCollection.add({collection:e}),r.billboard=A),A.show=t._show,A.position=t._position,A.eyeOffset=t._eyeOffset,A.pixelOffset=t._pixelOffset,A.horizontalOrigin=u.LEFT,A.verticalOrigin=t._verticalOrigin,A.scale=t._scale,A.pickPrimitive=t,A.id=t._id,A.image=T,A.translucencyByDistance=t._translucencyByDistance,A.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance}}t._repositionAllGlyphs=!0}function C(e,t){var r,n,o=e._glyphs,a=0,s=0,l=0,c=o.length;for(l=0;c>l;++l)r=o[l],n=r.dimensions,a+=n.computedWidth,s=Math.max(s,n.height);var h=e._scale,d=e._horizontalOrigin,m=0;d===u.CENTER?m-=a/2*h:d===u.RIGHT&&(m-=a*h),T.x=m*t,T.y=0;var f=e._verticalOrigin;for(l=0;c>l;++l)r=o[l],n=r.dimensions,f===p.BOTTOM||n.height===s?T.y=-n.descent*h:f===p.TOP?T.y=-(s-n.height)*h-n.descent*h:f===p.CENTER&&(T.y=-(s-n.height)/2*h-n.descent*h),T.y*=t,i(r.billboard)&&r.billboard._setTranslate(T),T.x+=n.computedWidth*h*t}function E(e,t){for(var r=t._glyphs,o=0,a=r.length;a>o;++o)g(e,r[o]);t._labelCollection=void 0,i(t._removeCallbackFunc)&&t._removeCallbackFunc(),n(t)}function S(e){e=t(e,t.EMPTY_OBJECT),this._scene=e.scene,this._textureAtlas=void 0,this._billboardCollection=new l({scene:this._scene}),this._billboardCollection.destroyTextureAtlas=!1,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._resolutionScale=void 0,this.modelMatrix=a.clone(t(e.modelMatrix,a.IDENTITY)),this.debugShowBoundingVolume=t(e.debugShowBoundingVolume,!1)}var w={},T=new e;return r(S.prototype,{length:{get:function(){return this._labels.length}}}),S.prototype.add=function(e){var t=new c(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},S.prototype.remove=function(e){if(i(e)&&e._labelCollection===this){var t=this._labels.indexOf(e);if(-1!==t)return this._labels.splice(t,1),E(this,e),!0}return!1},S.prototype.removeAll=function(){for(var e=this._labels,t=0,i=e.length;i>t;++t)E(this,e[t]);e.length=0},S.prototype.contains=function(e){return i(e)&&e._labelCollection===this},S.prototype.get=function(e){return this._labels[e]},S.prototype.update=function(e){var t=this._billboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume;var r=e.context;i(this._textureAtlas)||(this._textureAtlas=new d({context:r}),t.textureAtlas=this._textureAtlas);var n=r.uniformState,o=n.resolutionScale,a=this._resolutionScale!==o;this._resolutionScale=o;var s;s=a?this._labels:this._labelsToUpdate;for(var l=s.length,u=0;l>u;++u){var c=s[u];if(!c.isDestroyed()){var h=c._glyphs.length;c._rebindAllGlyphs&&(y(this,c),c._rebindAllGlyphs=!1),(a||c._repositionAllGlyphs)&&(C(c,o),c._repositionAllGlyphs=!1);var p=c._glyphs.length-h;this._totalGlyphCount+=p}}this._labelsToUpdate.length=0,t.update(e)},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),n(this)},S}),i("DataSources/LabelVisualizer",["../Core/AssociativeArray","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/NearFarScalar","../Scene/HorizontalOrigin","../Scene/LabelCollection","../Scene/LabelStyle","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e){this.entity=e,this.label=void 0,this.index=void 0}function f(t,i){i.collectionChanged.addEventListener(f.prototype._onCollectionChanged,this),this._scene=t,this._unusedIndexes=[],this._labelCollection=void 0,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function v(e,t){if(n(e)){var i=e.label;n(i)&&(t.push(e.index),i.show=!1,e.label=void 0,e.index=-1)}}var g=1,_="30px sans-serif",y=c.FILL,C=r.WHITE,E=r.BLACK,S=1,w=t.ZERO,T=i.ZERO,x=l.CENTER,b=h.CENTER,A=new i,P=new r,I=new r,M=new i,D=new t,R=new s,O=new s;return f.prototype.update=function(e){for(var t=this._items.values,i=this._unusedIndexes,r=0,o=t.length;o>r;r++){var a,s=t[r],l=s.entity,c=l._label,h=s.label,d=l.isShowing&&l.isAvailable(e)&&p.getValueOrDefault(c._show,e,!0);if(d&&(A=p.getValueOrUndefined(l._position,e,A),a=p.getValueOrUndefined(c._text,e),d=n(A)&&n(a)),d){if(!n(h)){var m=this._labelCollection;n(m)||(m=new u,this._labelCollection=m,this._scene.primitives.add(m));var f=i.length;if(f>0){var N=i.pop();s.index=N,h=m.get(N)}else h=m.add(),s.index=m.length-1;h.id=l,s.label=h}h.show=!0,h.position=A,h.text=a,h.scale=p.getValueOrDefault(c._scale,e,g),h.font=p.getValueOrDefault(c._font,e,_),h.style=p.getValueOrDefault(c._style,e,y),h.fillColor=p.getValueOrDefault(c._fillColor,e,C,P),h.outlineColor=p.getValueOrDefault(c._outlineColor,e,E,I),h.outlineWidth=p.getValueOrDefault(c._outlineWidth,e,S),h.pixelOffset=p.getValueOrDefault(c._pixelOffset,e,w,D),h.eyeOffset=p.getValueOrDefault(c._eyeOffset,e,T,M),h.horizontalOrigin=p.getValueOrDefault(c._horizontalOrigin,e,x),h.verticalOrigin=p.getValueOrDefault(c._verticalOrigin,e,b),h.translucencyByDistance=p.getValueOrUndefined(c._translucencyByDistance,e,R),h.pixelOffsetScaleByDistance=p.getValueOrUndefined(c._pixelOffsetScaleByDistance,e,O)}else v(s,i)}return!0},f.prototype.getBoundingSphere=function(e,t){var r=this._items.get(e.id);return n(r)&&n(r.label)?(t.center=i.clone(r.label.position,t.center),t.radius=0,d.DONE):d.FAILED},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._entityCollection.collectionChanged.removeEventListener(f.prototype._onCollectionChanged,this),n(this._labelCollection)&&this._scene.primitives.remove(this._labelCollection),o(this)},f.prototype._onCollectionChanged=function(e,t,i,r){var o,a,s=this._unusedIndexes,l=this._items;for(o=t.length-1;o>-1;o--)a=t[o],n(a._label)&&n(a._position)&&l.set(a.id,new m(a));for(o=r.length-1;o>-1;o--)a=r[o],n(a._label)&&n(a._position)?l.contains(a.id)||l.set(a.id,new m(a)):(v(l.get(a.id),s),l.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],v(l.get(a.id),s),l.remove(a.id)},f}),i("ThirdParty/gltfDefaults",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/Quaternion","../Renderer/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;-1===s.indexOf("KHR_materials_common")&&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;l>u;++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 v(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 _(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 E(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={}),E(o.states)}}function w(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 T=function(e){return i(e)?(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),v(e),g(e),_(e),y(e),C(e),S(e),w(e),e):void 0};return T}),i("Scene/getModelAccessor",["../Core/ComponentDatatype"],function(e){"use strict";function t(t){var r=t.componentType,n=i[t.type];return{componentsPerAttribute:n,createArrayBufferView:function(t,i,o){return e.createArrayBufferView(r,t,i,n*o)}}}var i={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};return t}),i("Scene/ModelAnimationCache",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/LinearSpline","../Core/Matrix4","../Core/Quaternion","../Core/QuaternionSpline","../Renderer/WebGLConstants","./getModelAccessor"],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,v=d.bufferViews,g=v[r.bufferView],_=r.componentType,y=r.type,C=r.count,E=h.getBuffer(g),S=l(r).createArrayBufferView(E.buffer,E.byteOffset+r.byteOffset,C);if(_===s.FLOAT&&"SCALAR"===y)a=S;else if(_===s.FLOAT&&"VEC3"===y)for(a=new Array(C),u=0;C>u;++u)a[u]=e.fromArray(S,3*u);else if(_===s.FLOAT&&"VEC4"===y)for(a=new Array(C),u=0;C>u;++u){var w=4*u;f?a[u]=o.fromAxisAngle(e.fromArray(S,w,m),S[w+3]):a[u]=o.unpack(S,w)}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],v=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=v.type;"LINEAR"===l.interpolation&&(_===s.FLOAT&&"VEC3"===y?p=new r({times:m,points:g}):_===s.FLOAT&&"VEC4"===y&&(p=new a({times:m,points:g})))}i(e.cacheKey)&&(f[c]=p)}return p};var v={};return u.getSkinInverseBindMatrices=function(e,t){var r=c(e,t),o=v[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),_=l(t).createArrayBufferView(g.buffer,g.byteOffset+t.byteOffset,f);if(o=new Array(f),p===s.FLOAT&&"MAT4"===m)for(var y=0;f>y;++y)o[y]=n.fromArray(_,16*y);v[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;r>n;++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;o>a;++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(-1!==r)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;i>r;++r)this.animationRemoved.raiseEvent(e,t[r])},h.prototype.contains=function(e){return i(e)?-1!==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;n>f;++f){var v=r[f],g=v._runtimeAnimation;i(v._computedStartTime)||(v._computedStartTime=a.addSeconds(t(v.startTime,l),v.delay,new a)),i(v._duration)||(v._duration=g.stopTime*(1/v.speedup));var _=v._computedStartTime,y=v._duration,C=v.stopTime,E=0!==y?a.secondsDifference(l,_)/y:0,S=E>=0,w=S&&(1>=E||v.loop===u.REPEAT||v.loop===u.MIRRORED_REPEAT)&&(!i(C)||a.lessThanOrEquals(l,C));if(w){if(v._state===c.STOPPED&&(v._state=c.ANIMATING,v.start.numberOfListeners>0&&e.afterRender.push(v._raiseStartEvent)),v.loop===u.REPEAT)E-=Math.floor(E);else if(v.loop===u.MIRRORED_REPEAT){var T=Math.floor(E),x=E-T;E=T%2===1?1-x:x}v.reverse&&(E=1-E);var b=E*y*v.speedup;b=s.clamp(b,g.startTime,g.stopTime),d(g,b),v.update.numberOfListeners>0&&(v._updateEventTime=b,e.afterRender.push(v._raiseUpdateEvent)),o=!0}else S&&v._state===c.ANIMATING&&(v._state=c.STOPPED,v.stop.numberOfListeners>0&&e.afterRender.push(v._raiseStopEvent),v.removeOnStop&&m.push(v))}n=m.length;for(var A=0;n>A;++A){var P=m[A];r.splice(r.indexOf(P),1),e.afterRender.push(p(this,h,P))}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","../Renderer/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 v=h.point;n[p+"Color"]={type:i.FLOAT_VEC3,value:v.color},t(h.node)&&(n[p+"Transform"]={node:h.node,semantic:"MODELVIEW",type:i.FLOAT_MAT4}),n[p+"Attenuation"]={type:i.FLOAT_VEC3,value:[v.constantAttenuation,v.linearAttenuation,v.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,v=n.programs,g=a.technique.toUpperCase();t(n.extensions)&&t(n.extensions.KHR_materials_common)&&(u=n.extensions.KHR_materials_common.lights);var _=e(a.jointCount,0),y=_>0,C=a.values,E="precision highp float;\n",S="precision highp float;\n",w=o(m,"technique",c),T=o(f,"vertexShader",h),x=o(f,"fragmentShader",d),b=o(v,"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:_,semantic:"JOINTMATRIX",type:i.FLOAT_MAT4});var I,M=!1;for(var D in C)if(C.hasOwnProperty(D)&&"transparent"!==D&&"doubleSided"!==D){ +var R=s(D,C[D]);I=D.toLowerCase(),M||R!==i.SAMPLER_2D||(M=!0),P[I]={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 F=P[L];N["u_"+L]=L;var B=t(F.count)?"["+F.count+"]":"";F.type!==i.FLOAT_MAT3&&F.type!==i.FLOAT_MAT4||F.useInFragment?(S+="uniform "+r(F.type)+" u_"+L+B+";\n",delete F.useInFragment):E+="uniform "+r(F.type)+" u_"+L+B+";\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},E+="attribute vec3 a_position;\n",E+="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},E+="attribute vec3 a_normal;\n",E+="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",E+="attribute vec2 a_texcoord_0;\n",E+="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},E+="attribute vec4 a_joint;\n",E+="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&&(E+="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?(E+="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")),E+="void main(void) {\n",E+=V,E+="}\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[w]={attributes:k,parameters:P,program:b,states:ee,uniforms:N},f[T]={type:i.VERTEX_SHADER,uri:"",extras:{source:E}},f[x]={type:i.FRAGMENT_SHADER,uri:"",extras:{source:S}};var te=Object.keys(k);return v[b]={attributes:te,fragmentShader:x,vertexShader:T},w}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;o>a;++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;o>s;++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),v=c[f];t(v)||(v=a(e,m,u),c[f]=v),p.values={};var g=m.values;for(var _ in g)if(g.hasOwnProperty(_)){var y=g[_];t(y.value)?p.values[_]=y.value:p.values[_]=y}p.technique=v,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;o>a;++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/defaultValue","../Core/defineProperties","../Core/Matrix4"],function(e,t,i){"use strict";function r(e,t,r,n,o){this._model=e,this._runtimeNode=r,this._name=t.name,this._id=n,this.useMatrix=!1,this._show=!0,this._matrix=i.clone(o)}return t(r.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=i.clone(e,this._matrix),this.useMatrix=!0;var t=this._model;t._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=t._maxDirtyNumber}}}),r.prototype.setMatrix=function(e){i.clone(e,this._matrix)},r}),i("Scene/Model",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/clone","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../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/throttleRequestByServer","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../Renderer/WebGLConstants","../ThirdParty/gltfDefaults","../ThirdParty/Uri","../ThirdParty/when","./getModelAccessor","./ModelAnimationCache","./ModelAnimationCollection","./ModelMaterial","./modelMaterialsCommon","./ModelMesh","./ModelNode","./Pass","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee){"use strict";function te(){this.buffersToCreate=new P,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new P,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new P,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new P,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 ie(e,t){e._cachedGltf=t,e._animationIds=ne(t)}function re(e){this._gltf=K(W(e.gltf)),this._bgltf=e.bgltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}function ne(e){var t=[];if(l(e)&&l(e.gltf)){var i=e.gltf.animations;for(var r in i)i.hasOwnProperty(r)&&t.push(r)}return t}function oe(t){t=s(t,s.EMPTY_OBJECT);var i=t.cacheKey;this._cacheKey=i,this._cachedGltf=void 0,this._releaseGltfJson=s(t.releaseGltfJson,!1),this._animationIds=void 0;var r;if(l(i)&&l(At[i])&&At[i].ready)r=At[i],++r.count;else{var n=t.gltf;if(l(n)){if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),n instanceof Uint8Array){var o=le(n);0!==o.binaryOffset&&(n=n.subarray(o.binaryOffset)),r=new re({gltf:o.glTF,bgltf:n,ready:!0})}else r=new re({gltf:t.gltf,ready:!0});r.count=1,l(i)&&(At[i]=r)}}ie(this,r),this._cache=t.cache,this._shaderOverride=t.shaderOverride,this._basePath=s(t.basePath,"");var a=new H(document.location.href),u=new H(this._basePath);this._baseUri=u.resolve(a),this.show=s(t.show,!0),this.modelMatrix=x.clone(s(t.modelMatrix,x.IDENTITY)),this._modelMatrix=x.clone(this.modelMatrix),this.scale=s(t.scale,1),this._scale=this.scale,this.minimumPixelSize=s(t.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.maximumScale=t.maximumScale,this._maximumScale=this.maximumScale,this.id=t.id,this._id=t.id,this.pickPrimitive=t.pickPrimitive,this._allowPicking=s(t.allowPicking,!0),this._ready=!1,this._readyPromise=q.defer(),this.activeAnimations=new X(this),this._defaultTexture=void 0,this._incrementallyLoadTextures=s(t.incrementallyLoadTextures,!0),this._asynchronous=s(t.asynchronous,!0),this.debugShowBoundingVolume=s(t.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=s(t.debugWireframe,!1),this._debugWireframe=!1,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=s(t.ignoreCommands,!1),this.cull=s(t.cull,!0),this._computedModelMatrix=new x,this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new e,this._state=xt.NEEDS_LOAD,this._loadResources=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._rendererResources={buffers:{},vertexArrays:{},programs:{},pickPrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._loadOptions=t.loadOptions}function ae(e,t,i){return e.subarray(t,t+i)}function se(e){var t=f(e);return"glTF"===t}function le(e){if(!se(e))throw new h("bgltf is not a valid Binary glTF file.");var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=0;i+=Pt,i+=Pt,i+=Pt;var r=t.getUint32(i,!0);i+=Pt+Pt;var n=i,o=n+r,a=v(e,n,r);return{glTF:JSON.parse(a),binaryOffset:o}}function ue(e,t,i){return e._runtime[t][i]}function ce(t){for(var r=t.nodes,n=t.meshes,o=t.accessors,a=t.scenes[t.scene].nodes,s=a.length,u=[],c=new i(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),h=new i(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),d=0;s>d;++d){var p=r[a[d]];for(p._transformToRoot=Ce(p),u.push(p);u.length>0;){p=u.pop();var m=p._transformToRoot,f=p.meshes;if(l(f))for(var v=f.length,g=0;v>g;++g)for(var _=n[f[g]].primitives,y=_.length,C=0;y>C;++C){var E=_[C].attributes.POSITION;if(l(E)){var S=o[E],w=i.fromArray(S.min,0,It),T=i.fromArray(S.max,0,Mt);l(c)&&l(h)&&(x.multiplyByPoint(m,w,w),x.multiplyByPoint(m,T,T),i.minimumByComponent(c,w,c),i.maximumByComponent(h,T,h))}}for(var b=p.children,A=b.length,P=0;A>P;++P){var I=r[b[P]];I._transformToRoot=Ce(I),x.multiplyTransformation(m,I._transformToRoot,I._transformToRoot),u.push(I)}delete p._transformToRoot}}var M=e.fromCornerPoints(c,h);return e.transformWithoutScale(M,wt,M)}function he(e,t,i){return function(){e._state=xt.FAILED,e._readyPromise.reject(new I("Failed to load "+t+": "+i))}}function de(e,t){return function(i){var r=e._loadResources;r.buffers[t]=new Uint8Array(i),--r.pendingBufferLoads}}function pe(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 H(r.uri),a=o.resolve(e._baseUri).toString();_(a).then(de(e,i)).otherwise(he(e,"buffer",a))}}}function me(e){var t=e.gltf.bufferViews;for(var i in t)t.hasOwnProperty(i)&&t[i].target===G.ARRAY_BUFFER&&e._loadResources.buffersToCreate.enqueue(i)}function fe(e,t){return function(i){var r=e._loadResources;r.shaders[t]={source:i,bufferView:void 0},--r.pendingShaderLoads}}function ve(e){var t=e.gltf.shaders;if(!l(e._shaderParser)||!e._shaderParser(t))for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];if(l(r.extras)&&l(r.extras.source))e._loadResources.shaders[i]={source:r.extras.source,bufferView:void 0};else if(l(r.extensions)&&l(r.extensions.KHR_binary_glTF)){var n=r.extensions.KHR_binary_glTF;e._loadResources.shaders[i]={source:void 0,bufferView:n.bufferView}}else{var o;if(e._shaderOverride&&(o=e._shaderOverride(r,i,e.gltf)))++e._loadResources.pendingShaderLoads,fe(e,i)(o);else{++e._loadResources.pendingShaderLoads;var a=new H(r.uri),s=a.resolve(e._baseUri).toString();E(s,e._loadOptions).then(fe(e,i)).otherwise(he(e,"shader",s))}}}}function ge(e){var t=e.gltf.programs;for(var i in t)t.hasOwnProperty(i)&&e._loadResources.programsToCreate.enqueue(i)}function _e(e,t){return function(i){var r=e._loadResources;--r.pendingTextureLoads,r.texturesToCreate.enqueue({id:t,image:i,bufferView:void 0})}}function ye(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(l(n.extensions)&&l(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{var a=void 0,s=new H(n.uri),u=s.resolve(e._baseUri).toString();l(e._cache)&&(a=e._cache.get(u),l(a)&&(++e._loadResources.pendingTextureLoads,a.then(function(t,i){return this._rendererResources.textures[t]=i,i.ref(),--e._loadResources.pendingTextureLoads,i}.bind(e,r),function(e){console.log("error",e)}))),l(a)||(++e._loadResources.pendingTextureLoads,l(e._cache)&&e._cache.reserve(u),y(u).then(_e(e,r)).otherwise(he(e,"image",u)))}}}function Ce(e){return l(e.matrix)?x.fromArray(e.matrix):x.fromTranslationQuaternionRotationScale(i.fromArray(e.translation,0,Dt),A.unpack(e.rotation,0,Rt),i.fromArray(e.scale,0,Ot))}function Ee(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],u={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new x,computedMatrix:new x,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:s.jointName,children:[],parents:[],publicNode:void 0};u.publicNode=new J(e,s,u,a,Ce(s)),t[a]=u,i[s.name]=u,l(s.skin)&&(n.push(a),r.push(u))}e._runtime.nodes=t,e._runtime.nodesByName=i,e._runtime.skinnedNodes=r}function Se(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 Z(e,a,o);t[a.name]=s,i[o]=s}e._runtime.materialsByName=t,e._runtime.materialsById=i}function we(e){var t={},i=e._runtime.materialsById,r=e.gltf.meshes;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];t[o.name]=new Q(o,i,n)}e._runtime.meshesByName=t}function Te(e){e._loadRendererResourcesFromCache||(pe(e),me(e),ve(e),ge(e),ye(e)),Se(e),we(e),Ee(e)}function xe(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=D.createVertexBuffer({context:t,typedArray:i.getBuffer(r),usage:R.STATIC_DRAW});s.vertexArrayDestroyable=!1,o[a]=s}var u=e.gltf.accessors;for(var c in u)if(u.hasOwnProperty(c)){var h=u[c];if(r=n[h.bufferView],r.target===G.ELEMENT_ARRAY_BUFFER&&!l(o[h.bufferView])){var d=D.createIndexBuffer({context:t,typedArray:i.getBuffer(r),usage:R.STATIC_DRAW,indexDatatype:h.componentType});d.vertexArrayDestroyable=!1,o[h.bufferView]=d}}}}function be(e){for(var t={},i=e.length,r=0;i>r;++r)t[e[r]]=r;return t}function Ae(e,t){if(l(t.source))return t.source;var i=e._loadResources,r=e.gltf,n=r.bufferViews[t.bufferView];return v(i.getBuffer(n))}function Pe(e,t,i){return l(i)&&(e=i(e,t)),e}function Ie(e,t,i){var r=t.gltf.programs,n=t._loadResources.shaders,o=r[e],a=be(o.attributes),s=Ae(t,n[o.vertexShader]),u=Ae(t,n[o.fragmentShader]),c=Pe(s,e,t._vertexShaderLoaded),h=Pe(u,e,t._fragmentShaderLoaded),d=o.attributes.length,p=t._precreatedAttributes;if(l(p))for(var m in p)p.hasOwnProperty(m)&&(a[m]=d++);if(t._rendererResources.programs[e]=F.fromCache({context:i,vertexShaderSource:c,fragmentShaderSource:h,attributeLocations:a}),t.allowPicking){var f=Pe(s,e,t._pickVertexShaderLoaded),v=Pe(u,e,t._pickFragmentShaderLoaded);t._pickFragmentShaderLoaded||(v=B.createPickFragmentShaderSource(u,"uniform")),t._rendererResources.pickPrograms[e]=F.fromCache({context:i,vertexShaderSource:f,fragmentShaderSource:v,attributeLocations:a})}}function Me(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(),Ie(i,e,t));else for(;r.programsToCreate.length>0;)i=r.programsToCreate.dequeue(),Ie(i,e,t)}function De(e,t){return function(i){e.texturesToCreate.enqueue({id:t.id,image:i,bufferView:void 0}),--e.pendingBufferViewToImage}}function Re(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=De(t,i),a=he(e,"image","id: "+i.id+", bufferView: "+i.bufferView);C(t.getBuffer(n),i.mimeType).then(o).otherwise(a),++t.pendingBufferViewToImage}}function Oe(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 L({wrapS:a.wrapS,wrapT:a.wrapT,minificationFilter:a.minFilter,magnificationFilter:a.magFilter})}}}function Ne(e,t,i){var r=t.gltf.textures,n=r[e.id],o=t._rendererResources.samplers,a=o[n.sampler],s=a.minificationFilter===k.NEAREST_MIPMAP_NEAREST||a.minificationFilter===k.NEAREST_MIPMAP_LINEAR||a.minificationFilter===k.LINEAR_MIPMAP_NEAREST||a.minificationFilter===k.LINEAR_MIPMAP_LINEAR,u=s||a.wrapS===z.REPEAT||a.wrapS===z.MIRRORED_REPEAT||a.wrapT===z.REPEAT||a.wrapT===z.MIRRORED_REPEAT,c=e.image,h=!S.isPowerOfTwo(c.width)||!S.isPowerOfTwo(c.height);if(u&&h){var d=document.createElement("canvas");d.width=S.nextPowerOfTwo(c.width),d.height=S.nextPowerOfTwo(c.height);var p=d.getContext("2d");p.drawImage(c,0,0,c.width,c.height,0,0,d.width,d.height),c=d}var m;n.target===G.TEXTURE_2D&&(m=new V({context:i,source:c,pixelFormat:n.internalFormat,pixelDatatype:n.type,sampler:a,flipY:!1})),s&&m.generateMipmap(),t._rendererResources.textures[e.id]=m,l(t._cache)&&t._cache.resolve(e.image.src,m)}function Le(e,t){var i,r=e._loadResources;if(e.asynchronous)r.texturesToCreate.length>0&&(i=r.texturesToCreate.dequeue(),Ne(i,e,t));else for(;r.texturesToCreate.length>0;)i=r.texturesToCreate.dequeue(),Ne(i,e,t)}function Fe(e,t){var i=e.gltf,r=i.techniques,n=i.materials,o={},a=r[n[t.material].technique],s=a.parameters,u=a.attributes,c=e._rendererResources.programs[a.program].vertexAttributes;for(var h in c)if(c.hasOwnProperty(h)){var d=u[h],p=c[h].index;if(l(d)){var m=s[d];o[m.semantic]=p}else o[h]=p}return o}function Be(e,t,i){for(var r=e.length,n=0;r>n;++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;u>c;++c)o.push(l[c])}}function Ve(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;s>l;++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,v=0;f>v;++v)p.push(m[v]);for(var g=r[h.skin].jointNames,_=g.length,y=0;_>y;++y){var C=g[y],E=o[Be(p,C,n)];c.joints.push(E)}}}function ke(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];x.equals(l.bindShapeMatrix,x.IDENTITY)||(s=x.clone(l.bindShapeMatrix)),o[a]={inverseBindMatrices:Y.getSkinInverseBindMatrices(e,u),bindShapeMatrix:s}}Ve(e,o)}}function ze(e,t,i,r){return function(n){t[i]=r.evaluate(n,t[i]),t.dirtyNumber=e._maxDirtyNumber}}function Ue(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]=Y.getAnimationParameterValues(e,n[l[h]]));for(var d=Number.MAX_VALUE,p=-Number.MAX_VALUE,m=s.length,f=new Array(m),v=0;m>v;++v){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 E=Y.getAnimationSpline(e,o,a,g.sampler,y,c);f[v]=ze(e,i[_.id],_.path,E)}e._runtime.animations[o]={startTime:d,stopTime:p,channelEvaluators:f}}}}function Ge(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 u in s)if(s.hasOwnProperty(u))for(var c=s[u].primitives,h=c.length,d=0;h>d;++d){var p,m,f,v=c[d],g=Fe(e,v),_=[],y=v.attributes;for(p in y)if(y.hasOwnProperty(p)&&(m=g[p],l(m))){var C=a[y[p]];_.push({index:m,vertexBuffer:r[C.bufferView],componentsPerAttribute:j(C).componentsPerAttribute,componentDatatype:C.componentType,normalize:!1,offsetInBytes:C.byteOffset,strideInBytes:C.byteStride})}var E=e._precreatedAttributes;if(l(E))for(p in E)E.hasOwnProperty(p)&&(m=g[p],l(m)&&(f=E[p],f.index=m,_.push(f)));var S;if(l(v.indices)){var w=a[v.indices];S=r[w.bufferView]}n[u+".primitive."+d]=new U({context:t,attributes:_,indexBuffer:S})}}}function We(e){var t={};t[G.BLEND]=!1,t[G.CULL_FACE]=!1,t[G.DEPTH_TEST]=!1,t[G.POLYGON_OFFSET_FILL]=!1,t[G.SCISSOR_TEST]=!1;var i,r=e.enable,n=r.length;for(i=0;n>i;++i)t[r[i]]=!0;return t}function He(e,t){var i=e._loadResources;if(i.createRenderStates){i.createRenderStates=!1;var r=e._rendererResources.renderStates,n=e.gltf.techniques;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o],u=a.states,c=We(u),h=s(u.functions,s.EMPTY_OBJECT),d=s(h.blendColor,[0,0,0,0]),p=s(h.blendEquationSeparate,[G.FUNC_ADD,G.FUNC_ADD]),m=s(h.blendFuncSeparate,[G.ONE,G.ONE,G.ZERO,G.ZERO]),f=s(h.colorMask,[!0,!0,!0,!0]),v=s(h.depthRange,[0,1]),g=s(h.polygonOffset,[0,0]),_=s(h.scissor,[0,0,0,0]);r[o]=N.fromCache({frontFace:l(h.frontFace)?h.frontFace[0]:G.CCW,cull:{enabled:c[G.CULL_FACE],face:l(h.cullFace)?h.cullFace[0]:G.BACK},lineWidth:l(h.lineWidth)?h.lineWidth[0]:1,polygonOffset:{enabled:c[G.POLYGON_OFFSET_FILL],factor:g[0],units:g[1]},scissorTest:{enabled:c[G.SCISSOR_TEST],rectangle:{x:_[0],y:_[1],width:_[2],height:_[3]}},depthRange:{near:v[0],far:v[1]},depthTest:{enabled:c[G.DEPTH_TEST],func:l(h.depthFunc)?h.depthFunc[0]:G.LESS},colorMask:{red:f[0],green:f[1],blue:f[2],alpha:f[3]},depthMask:l(h.depthMask)?h.depthMask[0]:!0,blending:{enabled:c[G.BLEND],color:{red:d[0],green:d[1],blue:d[2],alpha:d[3]},equationRgb:p[0],equationAlpha:p[1],functionSourceRgb:m[0],functionSourceAlpha:m[1],functionDestinationRgb:m[2],functionDestinationAlpha:m[3]}})}}}function qe(e,t){var i={value:e,clone:function(e,t){return e},func:function(){return i.value}};return i}function je(e,i){var r={value:t.fromArray(e),clone:t.clone,func:function(){return r.value}};return r}function Ye(e,t){var r={value:i.fromArray(e),clone:i.clone,func:function(){return r.value}};return r}function Xe(e,t){var i={value:r.fromArray(e),clone:r.clone,func:function(){return i.value}};return i}function Ze(e,t){var i={value:w.fromColumnMajorArray(e),clone:w.clone,func:function(){return i.value}};return i}function Ke(e,t){var i={value:T.fromColumnMajorArray(e),clone:T.clone,func:function(){return i.value}};return i}function Qe(e,t){var i={value:x.fromColumnMajorArray(e),clone:x.clone,func:function(){return i.value}};return i}function Je(e,t){this._value=void 0,this._textureId=e,this._model=t}function $e(e,t){var i=new Je(e,t);return i.func=function(){return i.value},i}function et(e,t,i,r){var n=t._runtime.nodes[e];return Bt[i](r,t,n)}function tt(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 u,c=n[s],h=c.values,d=o[c.technique],p=d.parameters,m=d.uniforms,f={},v={};for(var g in m)if(m.hasOwnProperty(g)){var _=m[g],y=p[_];if(l(h[_])){var C=Ft[y.type](h[_],e);f[g]=C.func,v[_]=C}else if(l(y.node))f[g]=et(y.node,e,y.semantic,t.uniformState);else if(l(y.semantic))"JOINTMATRIX"!==y.semantic?f[g]=Lt[y.semantic](t.uniformState,e):u=g;else if(l(y.value)){var E=Ft[y.type](y.value,e);f[g]=E.func,v[_]=E}}var S=a[s];S.uniformMap=f,S.values=v,S.jointMatrixUniformName=u}}}function it(e){return function(){return e}}function rt(e){return function(){return e.computedJointMatrices}}function nt(t,r,n,u){for(var c=t._nodeCommands,h=t._pickIds,d=t.allowPicking,p=t._runtime.meshesByName,m=t._rendererResources,f=m.vertexArrays,v=m.programs,_=m.pickPrograms,y=m.renderStates,C=t._uniformMaps,E=t.gltf,S=E.accessors,w=E.meshes,T=E.techniques,b=E.materials,A=r.meshes,P=A.length,I=0;P>I;++I)for(var M=A[I],D=w[M],R=D.primitives,N=R.length,L=0;N>L;++L){var F,B=R[L],V=S[B.indices],k=b[B.material],z=T[k.technique],U=z.program,G=B.attributes.POSITION;if(l(G)){var W=S[G];F=e.fromCornerPoints(i.fromArray(W.min),i.fromArray(W.max))}var H,q,Y=f[M+".primitive."+L];if(l(V))q=V.count,H=V.byteOffset/g.getSizeInBytes(V.componentType);else{var X=S[B.attributes.POSITION];q=X.count;var Z=j(X);H=X.byteOffset/(Z.componentsPerAttribute*a.getSizeInBytes(X.componentType))}var K=C[B.material],Q=K.uniformMap;if(l(K.jointMatrixUniformName)){var J={};J[K.jointMatrixUniformName]=rt(n),Q=o(Q,J)}l(t._uniformMapLoaded)&&(Q=t._uniformMapLoaded(Q,U,n));var ee,te=y[k.technique],ie=te.blending.enabled,re={primitive:s(t.pickPrimitive,t),id:t.id,node:n.publicNode,mesh:p[D.name]},ne=new O({boundingVolume:new e,cull:t.cull,modelMatrix:new x,primitiveType:B.mode,vertexArray:Y,count:q,offset:H,shaderProgram:v[z.program],uniformMap:Q,renderState:te,owner:re,pass:ie?$.TRANSLUCENT:$.OPAQUE});if(d){var oe;if(l(t._pickFragmentShaderLoaded))oe=l(t._pickUniformMapLoaded)?t._pickUniformMapLoaded(Q):o(Q);else{var ae=u.createPickId(re);h.push(ae);var se={czm_pickColor:it(ae.color)};oe=o(Q,se)}ee=new O({boundingVolume:new e,cull:t.cull,modelMatrix:new x,primitiveType:B.mode,vertexArray:Y,count:q,offset:H,shaderProgram:_[z.program],uniformMap:oe,renderState:te,owner:re,pass:ie?$.TRANSLUCENT:$.OPAQUE})}var le={show:!0,boundingSphere:F,command:ne,pickCommand:ee};n.commands.push(le),c.push(le)}}function ot(e,t){var r=e._loadResources;if(r.finishedEverythingButTextureCreation()&&r.createRuntimeNodes){r.createRuntimeNodes=!1;for(var n=[],o=e._runtime.nodes,a=e.gltf,s=a.nodes,u=a.scenes[a.scene],c=u.nodes,h=c.length,d=[],p=0;h>p;++p)for(d.push({parentRuntimeNode:void 0,gltfNode:s[c[p]],id:c[p]});d.length>0;){var m=d.pop(),f=m.parentRuntimeNode,v=m.gltfNode,g=o[m.id];if(0===g.parents.length)if(l(v.matrix))g.matrix=x.fromColumnMajorArray(v.matrix);else{var _=v.rotation;g.translation=i.fromArray(v.translation),g.rotation=A.unpack(_),g.scale=i.fromArray(v.scale)}l(f)?(f.children.push(g),g.parents.push(f)):n.push(g),l(v.meshes)&&nt(e,v,g,t);for(var y=v.children,C=y.length,E=0;C>E;++E)d.push({parentRuntimeNode:g,gltfNode:s[y[E]],id:y[E]})}e._runtime.rootNodes=n,e._runtime.nodes=o}}function at(e,t){var i=t.context;if(e._loadRendererResourcesFromCache){var r=e._rendererResources,n=e._cachedRendererResources;n.assign(r),l(e._precreatedAttributes)&&Ge(e,i)}else xe(e,i),Me(e,i),Oe(e,i),Re(e),Le(e,i);ke(e),Ue(e),e._loadRendererResourcesFromCache||(Ge(e,i),He(e,i)),tt(e,i),ot(e,i)}function st(e,t){var i=e.publicNode,r=i.matrix;i.useMatrix&&l(r)?x.clone(r,t):l(e.matrix)?x.clone(e.matrix,t):(x.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t),i.setMatrix(t))}function lt(t,r,n){for(var o=t._maxDirtyNumber,a=t.allowPicking,s=t._runtime.rootNodes,u=s.length,c=Vt,h=t._computedModelMatrix,d=0;u>d;++d){ +var p=s[d];for(st(p,p.transformToRoot),c.push(p);c.length>0;){p=c.pop();var m=p.transformToRoot,f=p.commands;if(p.dirtyNumber===o||r||n){var v=x.multiplyTransformation(h,m,p.computedMatrix),g=f.length;if(g>0)for(var _=0;g>_;++_){var y=f[_],C=y.command;if(x.clone(v,C.modelMatrix),e.transform(y.boundingSphere,C.modelMatrix,C.boundingVolume),l(t._rtcCenter)&&i.add(t._rtcCenter,C.boundingVolume.center,C.boundingVolume.center),a){var E=y.pickCommand;x.clone(C.modelMatrix,E.modelMatrix),e.clone(C.boundingVolume,E.boundingVolume)}}}for(var S=p.children,w=S.length,T=0;w>T;++T){var b=S[T];b.dirtyNumber=Math.max(b.dirtyNumber,p.dirtyNumber),(b.dirtyNumber===o||n)&&(st(b,b.transformToRoot),x.multiplyTransformation(m,b.transformToRoot,b.transformToRoot)),c.push(b)}}}++t._maxDirtyNumber}function ut(e){for(var t=e._runtime.skinnedNodes,i=t.length,r=0;i>r;++r){var n=t[r];kt=x.inverseTransformation(n.transformToRoot,kt);for(var o=n.computedJointMatrices,a=n.joints,s=n.bindShapeMatrix,u=n.inverseBindMatrices,c=u.length,h=0;c>h;++h)l(o[h])||(o[h]=new x),o[h]=x.multiplyTransformation(kt,a[h].transformToRoot,o[h]),o[h]=x.multiplyTransformation(o[h],u[h],o[h]),l(s)&&(o[h]=x.multiplyTransformation(o[h],s,o[h]))}}function ct(e){for(var t=e._runtime.rootNodes,i=t.length,r=Vt,n=0;i>n;++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;l>u;++u)s[u].show=a;for(var c=o.children,h=c.length,d=0;h>d;++d){var p=c[d];p.computedShow=a&&p.publicNode.show,r.push(p)}}}}function ht(e,t){var i=e.id;if(e._id!==i){e._id=i;for(var r=e._pickIds,n=r.length,o=0;n>o;++o)r[o].object.id=i}}function dt(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?b.LINES:b.TRIANGLES,i=e._nodeCommands,r=i.length,n=0;r>n;++n)i[n].command.primitiveType=t}}function pt(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var t=e.debugShowBoundingVolume,i=e._nodeCommands,r=i.length,n=0;r>n;n++)i[n].command.debugShowBoundingVolume=t}}function mt(e,t,i){return zt.center=e,zt.radius=t,i.camera.getPixelSize(zt,i.context.drawingBufferWidth,i.context.drawingBufferHeight)}function ft(e,t){var r=e.scale;if(0!==e.minimumPixelSize){var n=t.context,o=Math.max(n.drawingBufferWidth,n.drawingBufferHeight),a=e.modelMatrix;Ut.x=a[12],Ut.y=a[13],Ut.z=a[14],l(e._rtcCenter)&&i.add(e._rtcCenter,Ut,Ut);var s=e.boundingSphere.radius,u=mt(Ut,s,t),c=1/u,h=Math.min(c*(2*s),o);hr;++r){var n=t[r];if("CESIUM_RTC"!==n&&"KHR_binary_glTF"!==n&&"KHR_materials_common"!==n)throw new I("Unsupported glTF Extension: "+n)}}function _t(e,t){this.buffers=void 0,this.vertexArrays=void 0,this.programs=void 0,this.pickPrograms=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 yt(e){for(var t in e)e.hasOwnProperty(t)&&(l(e[t].unref)?e[t].unref():e[t].destroy())}function Ct(e){yt(e.buffers),yt(e.vertexArrays),yt(e.programs),yt(e.pickPrograms),yt(e.textures)}function Et(e){for(var t in e)e.hasOwnProperty(t)&&e[t].ref&&e[t].ref()}function St(e){for(var t in e)e.hasOwnProperty(t)&&e[t].unref&&e[t].unref()}if(!d.supportsTypedArrays())return{};var wt=x.fromRotationTranslation(T.fromRotationX(S.PI_OVER_TWO)),Tt=new i,xt={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3},bt="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";te.prototype.getBuffer=function(e){return ae(this.buffers[e.buffer],e.byteOffset,e.byteLength)},te.prototype.finishedPendingBufferLoads=function(){return 0===this.pendingBufferLoads},te.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.buffersToCreate.length},te.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},te.prototype.finishedTextureCreation=function(){var e=0===this.pendingTextureLoads,t=0===this.texturesToCreate.length&&0===this.texturesToCreateFromBufferView.length;return e&&t},te.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},te.prototype.finished=function(){return this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()},u(re.prototype,{gltf:{set:function(e){this._gltf=K(W(e))},get:function(){return this._gltf}},bgltf:{get:function(){return this._bgltf}}}),re.prototype.makeReady=function(e,t){this.gltf=e,this._bgltf=t;for(var i=this.modelsToLoad,r=i.length,n=0;r>n;++n){var o=i[n];o.isDestroyed()||ie(o,this)}this.modelsToLoad=void 0,this.ready=!0};var At={};u(oe.prototype,{gltf:{get:function(){return l(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=x.getScale(this.modelMatrix,Tt),t=l(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale;i.multiplyByScalar(e,t,e);var r=this._scaledBoundingSphere;return r.center=i.multiplyComponents(this._boundingSphere.center,e,r.center),r.radius=i.maximumComponent(e)*this._initialRadius,l(this._rtcCenter)&&i.add(this._rtcCenter,r.center,r.center),r}},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 l(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}}});var Pt=Uint32Array.BYTES_PER_ELEMENT;oe.fromGltf=function(e){var t=e.url,i=new oe(e);return i.loadGltf(t,e),i},oe.prototype.loadGltf=function(e){var t=e.url,i=s(e.cacheKey,p(t));e=n(e),e.basePath=m(t),e.cacheKey=i,this._basePath=e.basePath,this._cacheKey=e.cacheKey;var r=new H(document.location.href),o=new H(this._basePath);this._baseUri=o.resolve(r),e.headers=l(e.headers)?n(e.headers):{},l(e.headers.Accept)||(e.headers.Accept=bt);var a=At[i];return l(a)?a.ready||(++a.count,a.modelsToLoad.push(this)):(a=new re({ready:!1}),a.count=1,a.modelsToLoad.push(this),ie(this,a),At[i]=a,_(t,e.headers).then(function(t){var i=new Uint8Array(t);if(se(i)){var r=le(i);0!==r.binaryOffset&&(i=i.subarray(r.binaryOffset)),a.makeReady(r.glTF,i)}else{var n=v(i),o=JSON.parse(n);e.gltfModifier&&(o=e.gltfModifier(o)),a.makeReady(o)}}).otherwise(he(this,"model",t))),this._readyPromise},oe._gltfCache=At,oe.prototype.getNode=function(e){var t=ue(this,"nodesByName",e);return l(t)?t.publicNode:void 0},oe.prototype.getMesh=function(e){return ue(this,"meshesByName",e)},oe.prototype.getMaterial=function(e){return ue(this,"materialsByName",e)};var It=new i,Mt=new i,Dt=new i,Rt=new A,Ot=new i,Nt=new i,Lt={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 x;return function(){return x.getTranslation(e.model,Nt),i.add(Nt,t._rtcCenter,Nt),x.multiplyByPoint(e.view,Nt,Nt),x.setTranslation(e.modelView,Nt,r)}},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.inverseTranposeModel}},MODELVIEWINVERSETRANSPOSE:function(e,t){return function(){return e.normal}},VIEWPORT:function(e,t){return function(){return e.viewportCartesian4}}};u(Je.prototype,{value:{get:function(){if(!l(this._value)){var e=this._model._rendererResources.textures[this._textureId];if(!l(e))return this._model._defaultTexture;this._value=e}return this._value},set:function(e){this._value=e}}}),Je.prototype.clone=function(e,t){return e},Je.prototype.func=void 0;var Ft={};Ft[G.FLOAT]=qe,Ft[G.FLOAT_VEC2]=je,Ft[G.FLOAT_VEC3]=Ye,Ft[G.FLOAT_VEC4]=Xe,Ft[G.INT]=qe,Ft[G.INT_VEC2]=je,Ft[G.INT_VEC3]=Ye,Ft[G.INT_VEC4]=Xe,Ft[G.BOOL]=qe,Ft[G.BOOL_VEC2]=je,Ft[G.BOOL_VEC3]=Ye,Ft[G.BOOL_VEC4]=Xe,Ft[G.FLOAT_MAT2]=Ze,Ft[G.FLOAT_MAT3]=Ke,Ft[G.FLOAT_MAT4]=Qe,Ft[G.SAMPLER_2D]=$e;var Bt={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 x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r)}},CESIUM_RTC_MODELVIEW:function(e,t,i){var r=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.setTranslation(r,t._rtcCenterEye,r)}},MODELVIEWPROJECTION:function(e,t,i){var r=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.multiply(e._projection,r,r)}},MODELINVERSE:function(e,t,i){var r=new x;return function(){return x.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 x,n=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.inverse(r,n)}},MODELVIEWPROJECTIONINVERSE:function(e,t,i){var r=new x,n=new x;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.multiply(e._projection,r,r),x.inverse(r,n)}},MODELINVERSETRANSPOSE:function(e,t,i){var r=new x,n=new T;return function(){return x.inverse(i.computedMatrix,r),x.getRotation(r,n),T.transpose(n,n)}},MODELVIEWINVERSETRANSPOSE:function(e,t,i){var r=new x,n=new x,o=new T;return function(){return x.multiplyTransformation(e.view,i.computedMatrix,r),x.inverse(r,n),x.getRotation(n,o),T.transpose(o,o)}},VIEWPORT:function(e,t,i){return function(){return e.viewportCartesian4}}},Vt=[],kt=new x,zt=new e,Ut=new i;return _t.prototype.release=function(){return 0===--this.count?(l(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],Ct(this),c(this)):void 0},_t.prototype.init=function(e){this.buffers=e.buffers,Et(this.buffers),this.vertexArrays=e.vertexArrays,Et(this.vertexArrays),this.programs=e.programs,Et(this.programs),this.pickPrograms=e.pickPrograms,Et(this.pickPrograms),this.textures=e.textures,Et(this.textures),this.samplers=e.samplers,Et(this.samplers),this.renderStates=e.renderStates,Et(this.renderStates)},_t.prototype.assign=function(e){e.buffers=this.buffers,refRessource(this.buffers),e.vertexArrays=this.vertexArrays,refRessource(this.vertexArrays),e.programs=this.programs,refRessource(this.programs),e.pickPrograms=this.pickPrograms,refRessource(this.pickPrograms),e.textures=this.textures,refRessource(this.textures),e.samplers=this.samplers,refRessource(this.samplers),e.renderStates=this.renderStates,refRessource(this.renderStates)},oe.prototype.update=function(e){if(e.mode===ee.SCENE3D){var t=e.context;if(this._defaultTexture=t.defaultTexture,this._state===xt.NEEDS_LOAD&&l(this.gltf)){var r,n=this.cacheKey;if(l(n)){t.cache.modelRendererResourceCache=s(t.cache.modelRendererResourceCache,{});var o=t.cache.modelRendererResourceCache;if(r=o[this.cacheKey],l(r)){if(!r.ready)return;++r.count,this._loadRendererResourcesFromCache=!0}else r=new _t(t,n),r.count=1,o[this.cacheKey]=r;this._cachedRendererResources=r}else r=new _t(t),r.count=1,this._cachedRendererResources=r;if(this._state=xt.LOADING,this._boundingSphere=ce(this.gltf),this._initialRadius=this._boundingSphere.radius,gt(this),this._state!==xt.FAILED){var a=this.gltf.extensions;l(a)&&l(a.CESIUM_RTC)&&(this._rtcCenter=i.fromArray(a.CESIUM_RTC.center),this._rtcCenterEye=new i),this._loadResources=new te,Te(this)}}var u=this._loadResources,c=this._incrementallyLoadTextures,h=!1;if(this._state===xt.LOADING&&(at(this,e),(u.finished()||c&&u.finishedEverythingButTextureCreation())&&(this._state=xt.LOADED,h=!0)),l(u)&&this._state===xt.LOADED&&(c&&!h&&at(this,e),u.finished())){this._loadResources=void 0;var d=this._rendererResources,p=this._cachedRendererResources;p.init(d),p.ready=!0,l(this._precreatedAttributes)&&(p.vertexArrays={}),this.releaseGltfJson&&vt(this)}var m=this.show&&0!==this.scale;if(m&&this._state===xt.LOADED||h){var f=this.activeAnimations.update(e)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1,this._dirty=!1;var v=!x.equals(this._modelMatrix,this.modelMatrix)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||0!==this.minimumPixelSize||this._maximumScale!==this.maximumScale;if(v||h){x.clone(this.modelMatrix,this._modelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale;var g=ft(this,e),_=this._computedModelMatrix;x.multiplyByUniformScale(this.modelMatrix,g,_),x.multiplyTransformation(_,wt,_)}(f||v||h)&&(lt(this,v,h),this._dirty=!0,(f||h)&&ut(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,ct(this)),ht(this,t),dt(this),pt(this)}if(h){var y=this;return void e.afterRender.push(function(){y._ready=!0,y._readyPromise.resolve(y)})}if(m&&!this._ignoreCommands){var C,E,S=e.commandList,w=e.passes,T=this._nodeCommands,b=T.length;if(w.render)for(C=0;b>C;++C)E=T[C],E.show&&S.push(E.command);if(w.pick&&this.allowPicking)for(C=0;b>C;++C)E=T[C],E.show&&S.push(E.pickCommand)}}},oe.prototype.isDestroyed=function(){return!1},oe.prototype.destroy=function(){l(this._precreatedAttributes)&&yt(this._rendererResources.vertexArrays);var e=this._rendererResources;St(e.buffers),St(e.vertexArrays),St(e.programs),St(e.pickPrograms),St(e.textures),St(e.samplers),St(e.renderStates),this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release();for(var t=this._pickIds,i=t.length,r=0;i>r;++r)t[r].destroy();return vt(this),c(this)},oe}),i("DataSources/ModelVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Scene/Model","../Scene/ModelAnimationLoop","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,i){i.collectionChanged.addEventListener(c.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 h(e,t,r,n){var o=r[t.id];i(o)&&(n.removeAndDestroy(o.modelPrimitive),delete r[t.id])}function d(e,t){var r=t[e.id];i(r)&&(r.nodeTransformationsScratch={})}function p(e){console.error(e)}var m=1,f=0,v=!0,g=new o,_=new o;return c.prototype.update=function(e){for(var t=this._entitiesToVisualize.values,r=this._modelHash,n=this._primitives,l=0,c=t.length;c>l;l++){var h,d,y=t[l],C=y._model,E=r[y.id],S=y.isShowing&&y.isAvailable(e)&&u.getValueOrDefault(C._show,e,!0);if(S&&(d=y._getModelMatrix(e,g),h=u.getValueOrUndefined(C._uri,e),S=i(d)&&i(h)),S){var w=i(E)?E.modelPrimitive:void 0;if(i(w)&&h===E.uri||(i(w)&&(n.removeAndDestroy(w),delete r[y.id]),w=a.fromGltf({url:h,incrementallyLoadTextures:u.getValueOrDefault(C._incrementallyLoadTextures,e,v)}),w.readyPromise.otherwise(p),w.id=y,n.add(w),E={modelPrimitive:w,uri:h,animationsRunning:!1,nodeTransformationsScratch:{},originalNodeMatrixHash:{}},r[y.id]=E),w.show=!0,w.scale=u.getValueOrDefault(C._scale,e,m),w.minimumPixelSize=u.getValueOrDefault(C._minimumPixelSize,e,f),w.maximumScale=u.getValueOrUndefined(C._maximumScale,e),w.modelMatrix=o.clone(d,w.modelMatrix),w.ready){var T=u.getValueOrDefault(C._runAnimations,e,!0);E.animationsRunning!==T&&(T?w.activeAnimations.addAll({loop:s.REPEAT}):w.activeAnimations.removeAll(),E.animationsRunning=T);var x=u.getValueOrUndefined(C._nodeTransformations,e,E.nodeTransformationsScratch);if(i(x))for(var b=E.originalNodeMatrixHash,A=Object.keys(x),P=0,I=A.length;I>P;++P){var M=A[P],D=x[M];if(i(D)){var R=w.getNode(M);if(i(R)){var O=b[M];i(O)||(O=R.matrix.clone(),b[M]=O);var N=o.fromTranslationRotationScale(D,_);R.matrix=o.multiply(O,N,N)}}}}}else i(E)&&(E.modelPrimitive.show=!1)}return!0},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(c.prototype._onCollectionChanged,this);for(var e=this._entitiesToVisualize.values,t=this._modelHash,i=this._primitives,n=e.length-1;n>-1;n--)h(this,e[n],t,i);return r(this)},c.prototype.getBoundingSphere=function(e,r){var n=this._modelHash[e.id];if(!i(n))return l.FAILED;var o=n.modelPrimitive;return i(o)&&o.show?o.ready?(t.transform(o.boundingSphere,o.modelMatrix,r),l.DONE):l.PENDING:l.FAILED},c.prototype._onCollectionChanged=function(e,t,r,n){var o,a,s=this._entitiesToVisualize,l=this._modelHash,u=this._primitives;for(o=t.length-1;o>-1;o--)a=t[o],i(a._model)&&i(a._position)&&s.set(a.id,a);for(o=n.length-1;o>-1;o--)a=n[o],i(a._model)&&i(a._position)?(d(a,l),s.set(a.id,a)):(h(this,a,l,u),s.remove(a.id));for(o=r.length-1;o>-1;o--)a=r[o],h(this,a,l,u),s.remove(a.id)},c}),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(normalize(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(normalize(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 texCoordExpandWidthAndShow;\nattribute vec4 pickColor;\nvarying vec2 v_st;\nvarying float v_width;\nvarying vec4 czm_pickColor;\nvoid main()\n{\nfloat texCoord = texCoordExpandWidthAndShow.x;\nfloat expandDir = texCoordExpandWidthAndShow.y;\nfloat width = abs(texCoordExpandWidthAndShow.z) + 0.5;\nbool usePrev = texCoordExpandWidthAndShow.z < 0.0;\nfloat show = texCoordExpandWidthAndShow.w;\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}\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/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","../Core/PolylinePipeline","./Material"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(o,a){o=r(o,r.EMPTY_OBJECT),this._show=r(o.show,!0),this._width=r(o.width,1),this._loop=r(o.loop,!1),this._material=o.material,n(this._material)||(this._material=u.fromType(u.ColorType,{color:new i(1,1,1,1)}));var c=o.positions;n(c)||(c=[]),this._positions=c,this._actualPositions=l.removeDuplicates(c),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=c.slice()),this._actualPositions.push(t.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=o.id;var h;n(a)&&(h=s.clone(a.modelMatrix)),this._modelMatrix=h,this._segments=l.wrapLongitude(this._actualPositions,h),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(g),this._polylineCollection=a,this._dirty=!1,this._pickId=void 0,this._boundingVolume=e.fromPoints(this._actualPositions),this._boundingVolumeWC=e.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new e}function h(e,t){++e._propertiesChanged[t];var i=e._polylineCollection;n(i)&&(i._updatePolyline(e,t),e._dirty=!0)}var d=c.SHOW_INDEX=0,p=c.WIDTH_INDEX=1,m=c.POSITION_INDEX=2,f=c.MATERIAL_INDEX=3,v=c.POSITION_SIZE_INDEX=4,g=c.NUMBER_OF_PROPERTIES=5;return o(c.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,h(this,d))}},positions:{get:function(){return this._positions},set:function(i){var r=l.removeDuplicates(i);this._loop&&r.length>2&&(r===i&&(r=i.slice()),r.push(t.clone(r[0]))),(this._actualPositions.length!==r.length||this._actualPositions.length!==this._length)&&h(this,v),this._positions=i,this._actualPositions=r,this._length=r.length,this._boundingVolume=e.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=e.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),h(this,m),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,h(this,f))}},width:{get:function(){return this._width},set:function(e){var t=this._width;e!==t&&(this._width=e,h(this,p))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){var i=this._actualPositions;e?i.length>2&&!t.equals(i[0],i[i.length-1])&&(i.length===this._positions.length&&(this._actualPositions=i=this._positions.slice()),i.push(t.clone(i[0]))):i.length>2&&t.equals(i[0],i[i.length-1])&&(i.length-1===this._positions.length?this._actualPositions=this._positions:i.pop()),this._loop=e,h(this,v)}}},id:{get:function(){return this._id},set:function(e){this._id=e,n(this._pickId)&&(this._pickId.object.id=e)}}}),c.prototype.update=function(){var t=s.IDENTITY;n(this._polylineCollection)&&(t=this._polylineCollection.modelMatrix);var i=this._segments.positions.length,r=this._segments.lengths,o=this._propertiesChanged[m]>0||this._propertiesChanged[v]>0;if((!s.equals(t,this._modelMatrix)||o)&&(this._segments=l.wrapLongitude(this._actualPositions,t),this._boundingVolumeWC=e.transform(this._boundingVolume,t,this._boundingVolumeWC)),this._modelMatrix=t,this._segments.positions.length!==i)h(this,v);else for(var a=r.length,u=0;a>u;++u)if(r[u]!==this._segments.lengths[u]){h(this,v);break}},c.prototype.getPickId=function(e){return n(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId},c.prototype._clean=function(){this._dirty=!1;for(var e=this._propertiesChanged,t=0;g-1>t;++t)e[t]=0},c.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0},c}),i("Scene/PolylineCollection",["../Core/BoundingSphere","../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","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/PolylineCommon","../Shaders/PolylineFS","../Shaders/PolylineVS","./BlendingState","./Material","./Pass","./Polyline","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D){"use strict";function R(e){e=a(e,a.EMPTY_OBJECT),this.modelMatrix=f.clone(a(e.modelMatrix,f.IDENTITY)),this._modelMatrix=f.clone(f.IDENTITY),this.debugShowBoundingVolume=a(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(Q),this._polylines=[],this._polylineBuckets={},this._buffersUsage=[{bufferUsage:_.STATIC_DRAW,frameCount:0},{bufferUsage:_.STATIC_DRAW,frameCount:0},{bufferUsage:_.STATIC_DRAW,frameCount:0}],this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._pickColorBuffer=void 0,this._texCoordExpandWidthAndShowBuffer=void 0}function O(t,i,r,n,o){for(var a=i.context,l=i.commandList,u=r.length,c=0,h=!0,d=t._vertexArrays,p=t.debugShowBoundingVolume,m=d.length,f=0;m>f;++f)for(var v=d[f],g=v.buckets,_=g.length,C=0;_>C;++C){for(var E,S,w,T=g[C],x=T.offset,b=o?T.bucket.shaderProgram:T.bucket.pickShaderProgram,A=T.bucket.polylines,P=A.length,M=0,R=0;P>R;++R){var O=A[R],N=F(O._material);if(N!==E){if(s(E)&&M>0){var L=S.isTranslucent();c>=u?(w=new y({owner:t}),r.push(w)):w=r[c],++c,w.boundingVolume=e.clone($,w.boundingVolume),w.modelMatrix=n,w.shaderProgram=b,w.vertexArray=v.va,w.renderState=L?t._translucentRS:t._opaqueRS,w.pass=L?I.TRANSLUCENT:I.OPAQUE,w.debugShowBoundingVolume=o?p:!1,w.uniformMap=S._uniforms,w.count=M,w.offset=x,x+=M,M=0,h=!0,l.push(w)}S=O._material,S.update(a),E=N}for(var B=O._locatorBuckets,V=B.length,k=0;V>k;++k){var z=B[k];z.locator===T&&(M+=z.count)}var U;i.mode===D.SCENE3D?U=O._boundingVolumeWC:i.mode===D.COLUMBUS_VIEW?U=O._boundingVolume2D:i.mode===D.SCENE2D?s(O._boundingVolume2D)&&(U=e.clone(O._boundingVolume2D,ee),U.center.x=0):s(O._boundingVolumeWC)&&s(O._boundingVolume2D)&&(U=e.union(O._boundingVolumeWC,O._boundingVolume2D,ee)),h?(h=!1,e.clone(U,$)):e.union(U,$,$)}s(E)&&M>0&&(c>=u?(w=new y({owner:t}),r.push(w)):w=r[c],++c,w.boundingVolume=e.clone($,w.boundingVolume),w.modelMatrix=n,w.shaderProgram=b,w.vertexArray=v.va,w.renderState=S.isTranslucent()?t._translucentRS:t._opaqueRS,w.pass=S.isTranslucent()?I.TRANSLUCENT:I.OPAQUE,w.debugShowBoundingVolume=o?p:!1,w.uniformMap=S._uniforms,w.count=M,w.offset=x,h=!0,l.push(w)),E=void 0}r.length=c}function N(e){for(var t=e._buffersUsage,i=!1,r=e._propertiesChanged,n=0;Q-2>n;++n){var o=t[n];r[n]?o.bufferUsage!==_.STREAM_DRAW?(i=!0,o.bufferUsage=_.STREAM_DRAW,o.frameCount=100):o.frameCount=100:o.bufferUsage!==_.STATIC_DRAW&&(0===o.frameCount?(i=!0,o.bufferUsage=_.STATIC_DRAW):o.frameCount--)}return i}function L(e,t,i){e._createVertexArray=!1,z(e),U(e),B(e);var r,n,a=[[]],l=a[0],u=[0],c=0,h=[[]],p=0,f=e._polylineBuckets;for(r in f)f.hasOwnProperty(r)&&(n=f[r],n.updateShader(t),p+=n.lengthOfPositions);if(p>0){var v,y=e._mode,C=new Float32Array(6*p*3),E=new Uint8Array(4*p),S=new Float32Array(4*p),T=0,x=0,b=0;for(r in f)if(f.hasOwnProperty(r)){n=f[r],n.write(C,E,S,T,x,b,t,i),y===D.MORPHING&&(s(v)||(v=new Float32Array(6*p*3)),n.writeForMorph(v,T));var A=n.lengthOfPositions;T+=6*A*3,x+=4*A,b+=4*A,c=n.updateIndices(a,u,h,c)}var P=e._buffersUsage[X].bufferUsage,I=e._buffersUsage[j].bufferUsage,M=e._buffersUsage[Y].bufferUsage,R=I===_.STREAM_DRAW||M===_.STREAM_DRAW?_.STREAM_DRAW:_.STATIC_DRAW;e._positionBuffer=g.createVertexBuffer({context:t,typedArray:C,usage:P});var O;s(v)&&(O=g.createVertexBuffer({context:t,typedArray:v,usage:P})),e._pickColorBuffer=g.createVertexBuffer({context:t,typedArray:E,usage:_.STATIC_DRAW}),e._texCoordExpandWidthAndShowBuffer=g.createVertexBuffer({context:t,typedArray:S,usage:R});for(var N=4*Uint8Array.BYTES_PER_ELEMENT,L=3*Float32Array.BYTES_PER_ELEMENT,F=4*Float32Array.BYTES_PER_ELEMENT,V=0,k=a.length,G=0;k>G;++G)if(l=a[G],l.length>0){var W=new Uint16Array(l),H=g.createIndexBuffer({context:t,typedArray:W,usage:_.STATIC_DRAW,indexDatatype:d.UNSIGNED_SHORT});V+=u[G];var q,Z,K,Q,$=6*(G*(L*m.SIXTY_FOUR_KILOBYTES)-V*L),ee=L+$,ie=L+ee,re=L+ie,ne=L+re,oe=L+ne,ae=G*(N*m.SIXTY_FOUR_KILOBYTES)-V*N,se=G*(F*m.SIXTY_FOUR_KILOBYTES)-V*F,le=[{index:J.position3DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT, +offsetInBytes:$,strideInBytes:6*L},{index:J.position3DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ee,strideInBytes:6*L},{index:J.position2DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:$,strideInBytes:6*L},{index:J.position2DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ee,strideInBytes:6*L},{index:J.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ie,strideInBytes:6*L},{index:J.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:re,strideInBytes:6*L},{index:J.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ie,strideInBytes:6*L},{index:J.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:re,strideInBytes:6*L},{index:J.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ne,strideInBytes:6*L},{index:J.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:oe,strideInBytes:6*L},{index:J.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:ne,strideInBytes:6*L},{index:J.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:o.FLOAT,offsetInBytes:oe,strideInBytes:6*L},{index:J.texCoordExpandWidthAndShow,componentsPerAttribute:4,componentDatatype:o.FLOAT,vertexBuffer:e._texCoordExpandWidthAndShowBuffer,offsetInBytes:se},{index:J.pickColor,componentsPerAttribute:4,componentDatatype:o.UNSIGNED_BYTE,vertexBuffer:e._pickColorBuffer,offsetInBytes:ae,normalize:!0}];y===D.SCENE3D?(q=e._positionBuffer,Z="vertexBuffer",K=te,Q="value"):y===D.SCENE2D||y===D.COLUMBUS_VIEW?(q=te,Z="value",K=e._positionBuffer,Q="vertexBuffer"):(q=O,Z="vertexBuffer",K=e._positionBuffer,Q="vertexBuffer"),le[0][Z]=q,le[1][Z]=q,le[2][Q]=K,le[3][Q]=K,le[4][Z]=q,le[5][Z]=q,le[6][Q]=K,le[7][Q]=K,le[8][Z]=q,le[9][Z]=q,le[10][Q]=K,le[11][Q]=K;var ue=new w({context:t,attributes:le,indexBuffer:H});e._vertexArrays.push({va:ue,buckets:h[G]})}}}function F(e){var t=P._uniformList[e.type],i=t.length;ie.length=2*i;for(var r=0,n=0;i>n;++n){var o=t[n];ie[r]=o,ie[r+1]=e._uniforms[o](),r+=2}return e.type+":"+JSON.stringify(ie)}function B(e){for(var t=e._mode,i=e._modelMatrix,r=e._polylineBuckets={},n=e._polylines,o=n.length,a=0;o>a;++a){var l=n[a];if(l._actualPositions.length>1){l.update();var u=l.material,c=r[u.type];s(c)||(c=r[u.type]=new H(u,t,i)),c.addPolyline(l)}}}function V(e,t){var i=t.mode;e._mode===i&&f.equals(e._modelMatrix,e.modelMatrix)||(e._mode=i,e._modelMatrix=f.clone(e.modelMatrix),e._createVertexArray=!0)}function k(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var t=[],i=e._polylines.length,r=0,n=0;i>r;++r){var o=e._polylines[r];s(o)&&(o._index=n++,t.push(o))}e._polylines=t}}function z(e){for(var t=e._polylines,i=t.length,r=0;i>r;++r)if(s(t[r])){var n=t[r]._bucket;s(n)&&(n.shaderProgram=n.shaderProgram&&n.shaderProgram.destroy())}}function U(e){for(var t=e._vertexArrays.length,i=0;t>i;++i)e._vertexArrays[i].va.destroy();e._vertexArrays.length=0}function G(e){for(var t=e._polylines,i=t.length,r=0;i>r;++r)s(t[r])&&t[r]._destroy()}function W(e,t,i){this.count=e,this.offset=t,this.bucket=i}function H(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 q(e){return t.dot(t.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(v.ORIGIN_ZX_PLANE)===p.INTERSECTING}var j=M.SHOW_INDEX,Y=M.WIDTH_INDEX,X=M.POSITION_INDEX,Z=M.MATERIAL_INDEX,K=M.POSITION_SIZE_INDEX,Q=M.NUMBER_OF_PROPERTIES,J={texCoordExpandWidthAndShow: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,pickColor:13};l(R.prototype,{length:{get:function(){return k(this),this._polylines.length}}}),R.prototype.add=function(e){var t=new M(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,t},R.prototype.remove=function(e){if(this.contains(e)){if(this._polylines[e._index]=void 0,this._polylinesRemoved=!0,this._createVertexArray=!0,s(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},R.prototype.removeAll=function(){z(this),G(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},R.prototype.contains=function(e){return s(e)&&e._polylineCollection===this},R.prototype.get=function(e){return k(this),this._polylines[e]},R.prototype.update=function(e,t){if(k(this),0!==this._polylines.length){V(this,e);var i,r=e.context,n=e.mapProjection,o=this._propertiesChanged;if(this._createVertexArray||N(this))L(this,r,n);else if(this._polylinesUpdated){var a=this._polylinesToUpdate;if(this._mode!==D.SCENE3D)for(var l=a.length,u=0;l>u;++u)i=a[u],i.update();if(o[K]||o[Z])L(this,r,n);else for(var c=a.length,h=this._polylineBuckets,d=0;c>d;++d){i=a[d],o=i._propertiesChanged;var p=i._bucket,m=0;for(var v in h)if(h.hasOwnProperty(v)){if(h[v]===p){(o[X]||o[j]||o[Y])&&p.writeUpdate(m,i,this._positionBuffer,this._texCoordExpandWidthAndShowBuffer,n);break}m+=h[v].lengthOfPositions}i._clean()}a.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(var g=0;Q>g;++g)o[g]=0;var _=f.IDENTITY;e.mode===D.SCENE3D&&(_=this.modelMatrix);var y=e.passes,E=0!==e.morphTime;if(s(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===E||(this._opaqueRS=C.fromCache({depthMask:E,depthTest:{enabled:E}})),s(this._translucentRS)&&this._translucentRS.depthTest.enabled===E||(this._translucentRS=C.fromCache({blending:A.ALPHA_BLEND,depthMask:!E,depthTest:{enabled:E}})),y.render){var S=this._colorCommands;O(this,e,S,_,!0)}if(y.pick){var w=this._pickCommands;O(this,e,w,_,!1)}}};var $=new e,ee=new e;R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){return U(this),z(this),G(this),u(this)};var te=[0,0,0],ie=[];R.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,this._polylinesToUpdate.push(e),++this._propertiesChanged[t]},H.prototype.addPolyline=function(e){var t=this.polylines;t.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},H.prototype.updateShader=function(e){if(!s(this.shaderProgram)){var t=new S({sources:[T,b]}),i=new S({sources:[this.material.shaderSource,x]}),r=new S({sources:i.sources,pickColorQualifier:"varying"});this.shaderProgram=E.fromCache({context:e,vertexShaderSource:t,fragmentShaderSource:i,attributeLocations:J}),this.pickShaderProgram=E.fromCache({context:e,vertexShaderSource:t,fragmentShaderSource:r,attributeLocations:J})}},H.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===D.SCENE3D||!q(e))return t=e._actualPositions.length,4*t-4;var i=0,r=e._segments.lengths;t=r.length;for(var n=0;t>n;++n)i+=4*r[n]-4;return i};var re=new t,ne=new t,oe=new t,ae=new t;H.prototype.write=function(e,i,r,o,a,s,l,u){for(var c=this.mode,d=this.polylines,p=d.length,m=0;p>m;++m)for(var f,v=d[m],g=v.width,_=v.show&&g>0,y=this.getSegments(v,u),C=y.positions,E=y.lengths,S=C.length,w=v.getPickId(l).color,T=0,x=0,b=0;S>b;++b){0===b?v._loop?f=C[S-2]:(f=ae,t.subtract(C[0],C[1],f),t.add(C[0],f,f)):f=C[b-1],ne.x=f.x,ne.y=f.y,ne.z=c!==D.SCENE2D?f.z:0,f=C[b],re.x=f.x,re.y=f.y,re.z=c!==D.SCENE2D?f.z:0,b===S-1?v._loop?f=C[1]:(f=ae,t.subtract(C[S-1],C[S-2],f),t.add(C[S-1],f,f)):f=C[b+1],oe.x=f.x,oe.y=f.y,oe.z=c!==D.SCENE2D?f.z:0;var A=E[T];b===x+A&&(x+=A,++T);for(var P=b-x===0,I=b===x+E[T]-1,M=P?2:0,R=I?2:4,O=M;R>O;++O){h.writeElements(re,e,o),h.writeElements(ne,e,o+6),h.writeElements(oe,e,o+12),i[a]=n.floatToByte(w.red),i[a+1]=n.floatToByte(w.green),i[a+2]=n.floatToByte(w.blue),i[a+3]=n.floatToByte(w.alpha);var N=0>O-2?-1:1;r[s]=b/(S-1),r[s+1]=2*(O%2)-1,r[s+2]=N*g,r[s+3]=_,o+=18,a+=4,s+=4}}};var se=new t,le=new t,ue=new t,ce=new t;H.prototype.writeForMorph=function(e,i){for(var r=this.modelMatrix,n=this.polylines,o=n.length,a=0;o>a;++a)for(var s=n[a],l=s._segments.positions,u=s._segments.lengths,c=l.length,d=0,p=0,m=0;c>m;++m){var v;0===m?s._loop?v=l[c-2]:(v=ce,t.subtract(l[0],l[1],v),t.add(l[0],v,v)):v=l[m-1],v=f.multiplyByPoint(r,v,le);var g,_=f.multiplyByPoint(r,l[m],se);m===c-1?s._loop?g=l[1]:(g=ce,t.subtract(l[c-1],l[c-2],g),t.add(l[c-1],g,g)):g=l[m+1],g=f.multiplyByPoint(r,g,ue);var y=u[d];m===p+y&&(p+=y,++d);for(var C=m-p===0,E=m===p+u[d]-1,S=C?2:0,w=E?2:4,T=S;w>T;++T)h.writeElements(_,e,i),h.writeElements(v,e,i+6),h.writeElements(g,e,i+12),i+=18}};var he=new Array(1);H.prototype.updateIndices=function(e,t,i,r){var n=i.length-1,o=new W(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;c>h;++h){var d=u[h];d._locatorBuckets=[];var p;if(this.mode===D.SCENE3D){p=he;var f=d._actualPositions.length;if(!(f>0))continue;p[0]=f}else p=d._segments.lengths;var v=p.length;if(v>0){for(var g=0,_=0;v>_;++_)for(var y=p[_]-1,C=0;y>C;++C)l+4>=m.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 W(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>=m.SIXTY_FOUR_KILOBYTES-2&&(t.push(0),s=[],e.push(s),l=0,o.count=a,r=0,a=0,o=new W(0,0,this),i[++n]=[o])}d._clean()}return o.count=a,r},H.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,i=0,r=t.length,n=0;r>n;++n){var o=t[n];if(o===e)break;i+=o._actualLength}return i};var de={positions:void 0,lengths:void 0},pe=new Array(1),me=new t,fe=new r;H.prototype.getSegments=function(i,r){var n=i._actualPositions;if(this.mode===D.SCENE3D)return pe[0]=n.length,de.positions=n,de.lengths=pe,de;q(i)&&(n=i._segments.positions);for(var o,a=r.ellipsoid,s=[],l=this.modelMatrix,u=n.length,c=me,h=0;u>h;++h)o=n[h],c=f.multiplyByPoint(l,o,c),s.push(r.project(a.cartesianToCartographic(c,fe)));if(s.length>0){i._boundingVolume2D=e.fromPoints(s,i._boundingVolume2D);var d=i._boundingVolume2D.center;i._boundingVolume2D.center=new t(d.z,d.x,d.y)}return de.positions=s,de.lengths=i._segments.lengths,de};var ve,ge;return H.prototype.writeUpdate=function(e,i,r,n,o){var a=this.mode,l=i._actualLength;if(l){e+=this.getPolylineStartIndex(i);var u=ve,c=ge,d=6*l*3;!s(u)||u.lengthd&&(u=new Float32Array(u.buffer,0,d),c=new Float32Array(c.buffer,0,4*l));var p,m=0,f=0,v=this.getSegments(i,o),g=v.positions,_=v.lengths,y=0,C=0,E=i.width,S=i.show&&E>0;l=g.length;for(var w=0;l>w;++w){0===w?i._loop?p=g[l-2]:(p=ae,t.subtract(g[0],g[1],p),t.add(g[0],p,p)):p=g[w-1],ne.x=p.x,ne.y=p.y,ne.z=a!==D.SCENE2D?p.z:0,p=g[w],re.x=p.x,re.y=p.y,re.z=a!==D.SCENE2D?p.z:0,w===l-1?i._loop?p=g[1]:(p=ae,t.subtract(g[l-1],g[l-2],p),t.add(g[l-1],p,p)):p=g[w+1],oe.x=p.x,oe.y=p.y,oe.z=a!==D.SCENE2D?p.z:0;var T=_[y];w===C+T&&(C+=T,++y);for(var x=w-C===0,b=w===C+_[y]-1,A=x?2:0,P=b?2:4,I=A;P>I;++I){h.writeElements(re,u,m),h.writeElements(ne,u,m+6),h.writeElements(oe,u,m+12);var M=0>I-2?-1:1;c[f]=w/(l-1),c[f+1]=2*(I%2)-1,c[f+2]=M*E,c[f+3]=S,m+=18,f+=4}}r.copyFromArrayView(u,18*Float32Array.BYTES_PER_ELEMENT*e),n.copyFromArrayView(c,4*Float32Array.BYTES_PER_ELEMENT*e)}},R}),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){return e(this._value)?(n=this._value.getValueInReferenceFrame(t,i,n),e(n)?r.WGS84.scaleToGeodeticSurface(n,n):void 0):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,v,g,_,y,C){"use strict";function E(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,v=!i(a)||o.lessThanOrEquals(a,t)||o.greaterThanOrEquals(a,r),g=0,_=n.length,y=n[g],C=r,E=!1;_>g;){if(!v&&o.greaterThanOrEquals(y,a)&&(h=e.getValueInReferenceFrame(a,s,c[d]),i(h)&&(c[d++]=h),v=!0),o.greaterThan(y,t)&&o.lessThan(y,C)&&!y.equals(a)&&(h=e.getValueInReferenceFrame(y,s,c[d]),i(h)&&(c[d++]=h)),_-1>g){if(l>0&&!E){var S=n[g+1],w=o.secondsDifference(S,y);E=w>l,E&&(p=Math.ceil(w/l),m=0,f=w/Math.max(p,2),p=Math.max(p-1,1))}if(E&&p>m){y=o.addSeconds(y,f,new o),m++;continue}}E=!1,g++,y=n[g]}return h=e.getValueInReferenceFrame(r,s,c[d]),i(h)&&(c[d++]=h),d}function w(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 T(e,t,r,n,a,s,l,c){L.start=t,L.stop=r;for(var h=l,d=e.intervals,p=0;p0){var T=S.pop();c=this._polylineCollection.get(T),t.index=T}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=a,t.polyline=c}var x=v.getValueOrDefault(s._resolution,e,D);c.show=!0,c.positions=P(l,r,n,e,this._referenceFrame,x,c.positions.slice()),c.material=f.getValue(e,s._material,c.material),c.width=v.getValueOrDefault(s._width,e,R)},I.prototype.removeObject=function(e){var t=e.polyline;i(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,e.index=void 0)},I.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;a>o;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 I(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 E(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 E(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)&&(s.updater.removeObject(s),l.remove(a.id))},M._subSample=P,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;\nif (color.a < 0.005)\n{\ndiscard;\n}\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;\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)\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\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/PointPrimitive",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","../Core/NearFarScalar","./SceneMode","./SceneTransforms"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e,i){e=n(e,n.EMPTY_OBJECT),this._show=n(e.show,!0),this._position=t.clone(n(e.position,t.ZERO)),this._actualPosition=t.clone(this._position),this._color=r.clone(n(e.color,r.WHITE)),this._outlineColor=r.clone(n(e.outlineColor,r.TRANSPARENT)),this._outlineWidth=n(e.outlineWidth,0),this._pixelSize=n(e.pixelSize,10),this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._id=e.id,this._collection=n(e.collection,i),this._pickId=void 0,this._pointPrimitiveCollection=i,this._dirty=!1,this._index=-1}function p(e,t){var i=e._pointPrimitiveCollection;o(i)&&(i._updatePointPrimitive(e,t),e._dirty=!0)}var m=d.SHOW_INDEX=0,f=d.POSITION_INDEX=1,v=d.COLOR_INDEX=2,g=d.OUTLINE_COLOR_INDEX=3,_=d.OUTLINE_WIDTH_INDEX=4,y=d.PIXEL_SIZE_INDEX=5,C=d.SCALE_BY_DISTANCE_INDEX=6,E=d.TRANSLUCENCY_BY_DISTANCE_INDEX=7;d.NUMBER_OF_PROPERTIES=8,a(d.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,p(this,m))}},position:{get:function(){return this._position},set:function(e){var i=this._position;t.equals(i,e)||(t.clone(e,i),t.clone(e,this._actualPosition),p(this,f))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;u.equals(t,e)||(this._scaleByDistance=u.clone(e,t),p(this,C))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;u.equals(t,e)||(this._translucencyByDistance=u.clone(e,t),p(this,E))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,p(this,y))}},color:{get:function(){return this._color},set:function(e){var t=this._color;r.equals(t,e)||(r.clone(e,t),p(this,v))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;r.equals(t,e)||(r.clone(e,t),p(this,g))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,p(this,_))}},id:{get:function(){return this._id},set:function(e){this._id=e,o(this._pickId)&&(this._pickId.object.id=e)}}}),d.prototype.getPickId=function(e){return o(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},d.prototype._getActualPosition=function(){return this._actualPosition},d.prototype._setActualPosition=function(e){t.clone(e,this._actualPosition),p(this,f)};var S=new i;d._computeActualPosition=function(e,t,i){return t.mode===c.SCENE3D?e:(l.multiplyByPoint(i,e,S),h.computeActualWgs84Position(t,S))};var w=new l,T=new i;return d._computeScreenSpacePosition=function(e,t,r,n){var o=r.camera,a=o.viewMatrix,s=o.frustum.projectionMatrix,u=l.multiplyTransformation(a,e,w),c=l.multiplyByVector(u,i.fromElements(t.x,t.y,t.z,1,T),T),d=l.multiplyByVector(s,c,T),p=h.clipToGLWindowCoordinates(r,d,n);return p},d.prototype.computeScreenSpacePosition=function(t,i){var r=this._pointPrimitiveCollection;o(i)||(i=new e);var n=r.modelMatrix,a=d._computeScreenSpacePosition(n,this._actualPosition,t,i);return a.y=t.canvas.clientHeight-a.y,a},d.prototype.equals=function(e){return this===e||o(e)&&this._id===e._id&&t.equals(this._position,e._position)&&r.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&r.equals(this._outlineColor,e._outlineColor)&&u.equals(this._scaleByDistance,e._scaleByDistance)&&u.equals(this._translucencyByDistance,e._translucencyByDistance)},d.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0},d}),i("Scene/PointPrimitiveCollection",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix4","../Core/PrimitiveType","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/PointPrimitiveCollectionFS","../Shaders/PointPrimitiveCollectionVS","./BlendingState","./Pass","./PointPrimitive","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b){"use strict";function A(t){t=o(t,o.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._propertiesChanged=new Uint32Array(Y),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=d.clone(o(t.modelMatrix,d.IDENTITY)),this._modelMatrix=d.clone(d.IDENTITY),this.debugShowBoundingVolume=o(t.debugShowBoundingVolume,!1),this._mode=b.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW,m.STATIC_DRAW];var i=this;this._uniforms={u_maxTotalPointSize:function(){return i._maxTotalPointSize}}}function P(e){for(var t=e.length,i=0;t>i;++i)e[i]&&e[i]._destroy()}function I(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;for(var t=[],i=e._pointPrimitives,r=i.length,n=0,o=0;r>n;++n){var a=i[n];a&&(a._index=o++,t.push(a))}e._pointPrimitives=t}}function M(e,t,i){return new C(e,[{index:X.positionHighAndSize,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:i[z]},{index:X.positionLowAndShow,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:i[z]},{index:X.compressedAttribute0,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:i[U]},{index:X.compressedAttribute1,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:i[j]},{index:X.scaleByDistance,componentsPerAttribute:4,componentDatatype:n.FLOAT,usage:i[q]}],t)}function D(t,i,r,n){var o=n._index,a=n._getActualPosition();t._mode===b.SCENE3D&&(e.expand(t._baseVolume,a,t._baseVolume),t._boundingVolumeDirty=!0),c.fromCartesian(a,Z);var s=n.pixelSize,l=n.outlineWidth;t._maxPixelSize=Math.max(t._maxPixelSize,s+l);var u=r[X.positionHighAndSize],h=Z.high;u(o,h.x,h.y,h.z,s);var d=r[X.positionLowAndOutline],p=Z.low;d(o,p.x,p.y,p.z,l)}function R(e,t,i,n){var o=n._index,a=n.color,s=n.getPickId(t).color,l=n.outlineColor,u=r.floatToByte(a.red),c=r.floatToByte(a.green),h=r.floatToByte(a.blue),d=u*K+c*Q+h;u=r.floatToByte(l.red),c=r.floatToByte(l.green),h=r.floatToByte(l.blue);var p=u*K+c*Q+h;u=r.floatToByte(s.red),c=r.floatToByte(s.green),h=r.floatToByte(s.blue);var m=u*K+c*Q+h,f=r.floatToByte(a.alpha)*K+r.floatToByte(l.alpha)*Q+r.floatToByte(s.alpha),v=i[X.compressedAttribute0];v(o,d,p,m,f)}function O(e,t,i,r){var n=r._index,o=0,s=1,l=1,u=1,c=r.translucencyByDistance;a(c)&&(o=c.near,s=c.nearValue,l=c.far,u=c.farValue,(1!==s||1!==u)&&(e._shaderTranslucencyByDistance=!0));var d=r.show;0===r.color.alpha&&0===r.outlineColor.alpha&&(d=!1),s=h.clamp(s,0,1),s=1===s?255:255*s|0;var p=(d?1:0)*Q+s;u=h.clamp(u,0,1),u=1===u?255:255*u|0;var m=u,f=i[X.compressedAttribute1];f(n,p,m,o,l)}function N(e,t,i,r){var n=r._index,o=i[X.scaleByDistance],s=0,l=1,u=1,c=1,h=r.scaleByDistance;a(h)&&(s=h.near,l=h.nearValue,u=h.far,c=h.farValue,(1!==l||1!==c)&&(e._shaderScaleByDistance=!0)),o(n,s,l,u,c)}function L(e,t,i,r){D(e,t,i,r),R(e,t,i,r),O(e,t,i,r),N(e,t,i,r)}function F(t,i,r,n,o,s){var l;n.mode===b.SCENE3D?(l=t._baseVolume,t._boundingVolumeDirty=!0):l=t._baseVolume2D;for(var u=[],c=0;r>c;++c){var h=i[c],d=h.position,p=x._computeActualPosition(d,n,o);a(p)&&(h._setActualPosition(p),s?u.push(p):e.expand(l,p,l))}s&&e.fromPoints(u,l)}function B(e,t){var i=t.mode,r=e._pointPrimitives,n=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==b.SCENE3D&&!d.equals(o,e.modelMatrix)?(e._mode=i,d.clone(e.modelMatrix,o),e._createVertexArray=!0,(i===b.SCENE3D||i===b.SCENE2D||i===b.COLUMBUS_VIEW)&&F(e,r,r.length,t,o,!0)):i===b.MORPHING?F(e,r,r.length,t,o,!0):(i===b.SCENE2D||i===b.COLUMBUS_VIEW)&&F(e,n,e._pointPrimitivesToUpdateIndex,t,o,!1); +}function V(e,t,i){var r=t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight),n=r*e._maxPixelSize;i.radius+=n}var k=x.SHOW_INDEX,z=x.POSITION_INDEX,U=x.COLOR_INDEX,G=x.OUTLINE_COLOR_INDEX,W=x.OUTLINE_WIDTH_INDEX,H=x.PIXEL_SIZE_INDEX,q=x.SCALE_BY_DISTANCE_INDEX,j=x.TRANSLUCENCY_BY_DISTANCE_INDEX,Y=x.NUMBER_OF_PROPERTIES,X={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4};s(A.prototype,{length:{get:function(){return I(this),this._pointPrimitives.length}}}),A.prototype.add=function(e){var t=new x(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):!1},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 a(e)&&e._pointPrimitiveCollection===this},A.prototype.get=function(e){return I(this),this._pointPrimitives[e]},A.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;Y>r;++r){var n=0===i[r]?m.STATIC_DRAW:m.STREAM_DRAW;t=t||e[r]!==n,e[r]=n}return t};var Z=new c,K=65536,Q=256,J=[];return A.prototype.update=function(t){I(this),this._maxTotalPointSize=f.maximumAliasedPointSize,B(this,t);var i,r=this._pointPrimitives,n=r.length,o=this._pointPrimitivesToUpdate,s=this._pointPrimitivesToUpdateIndex,l=this._propertiesChanged,u=this._createVertexArray,c=t.context,h=t.passes,m=h.pick;if(u||!m&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var C=0;Y>C;++C)l[C]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=M(c,n,this._buffersUsage),i=this._vaf.writers;for(var x=0;n>x;++x){var A=this._pointPrimitives[x];A._dirty=!1,L(this,c,i,A)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(s>0){var P=J;P.length=0,(l[z]||l[W]||l[H])&&P.push(D),(l[U]||l[G])&&P.push(R),(l[k]||l[j])&&P.push(O),l[q]&&P.push(N);var F=P.length;if(i=this._vaf.writers,s/n>.1){for(var Z=0;s>Z;++Z){var K=o[Z];K._dirty=!1;for(var Q=0;F>Q;++Q)P[Q](this,c,i,K)}this._vaf.commit()}else{for(var $=0;s>$;++$){var ee=o[$];ee._dirty=!1;for(var te=0;F>te;++te)P[te](this,c,i,ee);this._vaf.subCommit(ee._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(s>1.5*n&&(o.length=n),a(this._vaf)&&a(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,e.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var ie,re=d.IDENTITY;t.mode===b.SCENE3D?(re=this.modelMatrix,ie=e.clone(this._baseVolumeWC,this._boundingVolume)):ie=e.clone(this._baseVolume2D,this._boundingVolume),V(this,t,ie);var ne,oe,ae,se,le,ue,ce=t.commandList;if(h.render){var he=this._colorCommands;for(a(this._rs)||(this._rs=g.fromCache({depthTest:{enabled:!0},blending:w.ALPHA_BLEND})),(!a(this._sp)||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance)&&(le=new y({sources:[S]}),this._shaderScaleByDistance&&le.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&le.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._sp=_.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:le,fragmentShaderSource:E,attributeLocations:X}),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance),ne=this._vaf.va,oe=ne.length,he.length=oe,se=0;oe>se;++se)ae=he[se],a(ae)||(ae=he[se]=new v({primitiveType:p.POINTS,pass:T.OPAQUE,owner:this})),ae.boundingVolume=ie,ae.modelMatrix=re,ae.shaderProgram=this._sp,ae.uniformMap=this._uniforms,ae.vertexArray=ne[se].va,ae.renderState=this._rs,ae.debugShowBoundingVolume=this.debugShowBoundingVolume,ce.push(ae)}if(m){var de=this._pickCommands;for((!a(this._spPick)||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistancePick||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistancePick)&&(le=new y({defines:["RENDER_FOR_PICK"],sources:[S]}),this._shaderScaleByDistance&&le.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&le.defines.push("EYE_DISTANCE_TRANSLUCENCY"),ue=new y({defines:["RENDER_FOR_PICK"],sources:[E]}),this._spPick=_.replaceCache({context:c,shaderProgram:this._spPick,vertexShaderSource:le,fragmentShaderSource:ue,attributeLocations:X}),this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance),ne=this._vaf.va,oe=ne.length,de.length=oe,se=0;oe>se;++se)ae=de[se],a(ae)||(ae=de[se]=new v({primitiveType:p.POINTS,pass:T.OPAQUE,owner:this})),ae.boundingVolume=ie,ae.modelMatrix=re,ae.shaderProgram=this._spPick,ae.uniformMap=this._uniforms,ae.vertexArray=ne[se].va,ae.renderState=this._rs,ce.push(ae)}}},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),P(this._pointPrimitives),l(this)},A}),i("DataSources/PointVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/NearFarScalar","../Scene/PointPrimitiveCollection","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){this.entity=e,this.pointPrimitive=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function h(t,i){i.collectionChanged.addEventListener(h.prototype._onCollectionChanged,this),this._scene=t,this._unusedIndexes=[],this._entityCollection=i,this._pointPrimitiveCollection=void 0,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function d(e,t){if(r(e)){var i=e.pointPrimitive;r(i)&&(e.pointPrimitive=void 0,i.show=!1,t.push(i._index))}}var p=i.WHITE,m=i.BLACK,f=0,v=1,g=new i,_=new t,y=new i,C=new a,E=new a;return h.prototype.update=function(e){for(var t=this._items.values,i=this._unusedIndexes,n=0,o=t.length;o>n;n++){var a=t[n],l=a.entity,c=l._point,h=a.pointPrimitive,S=l.isShowing&&l.isAvailable(e)&&u.getValueOrDefault(c._show,e,!0);if(S&&(_=u.getValueOrUndefined(l._position,e,_),S=r(_)),S){if(!r(h)){var w=this._pointPrimitiveCollection;r(w)||(w=new s,this._pointPrimitiveCollection=w,this._scene.primitives.add(w));var T=i.length;h=T>0?w.get(i.pop()):w.add(),h.id=l,a.pointPrimitive=h}h.show=!0,h.position=_,h.scaleByDistance=u.getValueOrUndefined(c._scaleByDistance,e,C),h.translucencyByDistance=u.getValueOrUndefined(c._translucencyByDistance,e,E),h.color=u.getValueOrDefault(c._color,e,p,g),h.outlineColor=u.getValueOrDefault(c._outlineColor,e,m,y),h.outlineWidth=u.getValueOrDefault(c._outlineWidth,e,f),h.pixelSize=u.getValueOrDefault(c._pixelSize,e,v)}else d(a,i)}return!0},h.prototype.getBoundingSphere=function(e,i){var n=this._items.get(e.id);return r(n)&&r(n.pointPrimitive)?(i.center=t.clone(n.pointPrimitive.position,i.center),i.radius=0,l.DONE):l.FAILED},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return this._entityCollection.collectionChanged.removeEventListener(h.prototype._onCollectionChanged,this),r(this._pointPrimitiveCollection)&&this._scene.primitives.remove(this._pointPrimitiveCollection),n(this)},h.prototype._onCollectionChanged=function(e,t,i,n){var o,a,s=this._unusedIndexes,l=this._items;for(o=t.length-1;o>-1;o--)a=t[o],r(a._point)&&r(a._position)&&l.set(a.id,new c(a));for(o=n.length-1;o>-1;o--)a=n[o],r(a._point)&&r(a._position)?l.contains(a.id)||l.set(a.id,new c(a)):(d(l.get(a.id),s),l.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],d(l.get(a.id),s),l.remove(a.id)},h}),i("DataSources/PolygonGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/isArray","../Core/Iso8601","../Core/PolygonGeometry","../Core/PolygonHierarchy","../Core/PolygonOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S){"use strict";function w(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=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._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new w(e),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new w(t._entity)}var b=new _(e.WHITE),A=new y(!0),P=new y(!0),I=new y(!1),M=new y(e.BLACK),D=new e;return n(T,{perInstanceColorAppearanceType:{value:v},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)&&S.isConstant(this._showProperty)&&S.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)&&S.isConstant(this._showProperty)&&S.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},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));if(this._materialProperty instanceof _){var c=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(c=this._materialProperty.color.getValue(i)),o=t.fromColor(c),n={show:u,color:o}}else n={show:u};return new l({id:a,geometry:new h(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=S.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new l({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)}})},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||"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(c.MINIMUM_VALUE):!0,h=a.outline,p=r(h);if(p&&h.isConstant&&(p=h.getValue(c.MINIMUM_VALUE)),!l&&!p)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var m=a.hierarchy,g=a.show;if(r(g)&&g.isConstant&&!g.getValue(c.MINIMUM_VALUE)||!r(m))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var y=i(a.material,b),C=y instanceof _;this._materialProperty=y,this._fillProperty=i(s,P),this._showProperty=i(g,A),this._showOutlineProperty=i(a.outline,I),this._outlineColorProperty=p?i(a.outlineColor,M):void 0;var E=a.height,w=a.extrudedHeight,T=a.granularity,x=a.stRotation,D=a.outlineWidth,R=a.perPositionHeight;if(this._fillEnabled=l,this._outlineEnabled=p,m.isConstant&&S.isConstant(E)&&S.isConstant(w)&&S.isConstant(T)&&S.isConstant(x)&&S.isConstant(D)&&S.isConstant(R)){var O=this._options;O.vertexFormat=C?v.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat;var N=m.getValue(c.MINIMUM_VALUE);u(N)&&(N=new d(N));var L=r(E)?E.getValue(c.MINIMUM_VALUE):void 0,F=r(w)?w.getValue(c.MINIMUM_VALUE):void 0;O.polygonHierarchy=N,O.height=L,O.extrudedHeight=F,O.granularity=r(T)?T.getValue(c.MINIMUM_VALUE):void 0,O.stRotation=r(x)?x.getValue(c.MINIMUM_VALUE):void 0,O.perPositionHeight=r(R)?R.getValue(c.MINIMUM_VALUE):void 0,this._outlineWidth=r(D)?D.getValue(c.MINIMUM_VALUE):1,this._isClosed=r(F)&&F!==L,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.polygon;if(a.isShowing&&a.isAvailable(i)&&S.getValueOrDefault(s.show,i,!0)){var c=this._options,m=S.getValueOrUndefined(s.hierarchy,i);if(r(m)){if(u(m)?c.polygonHierarchy=new d(m):c.polygonHierarchy=m,c.height=S.getValueOrUndefined(s.height,i),c.extrudedHeight=S.getValueOrUndefined(s.extrudedHeight,i),c.granularity=S.getValueOrUndefined(s.granularity,i),c.stRotation=S.getValueOrUndefined(s.stRotation,i),c.perPositionHeight=S.getValueOrUndefined(s.perPositionHeight,i),S.getValueOrDefault(s.fill,i,!0)){var _=E.getValue(i,o.fillMaterialProperty,this._material);this._material=_;var y=new f({material:_,translucent:_.isTranslucent(),closed:r(c.extrudedHeight)&&c.extrudedHeight!==c.height});c.vertexFormat=y.vertexFormat,this._primitive=n.add(new g({geometryInstances:new l({id:a,geometry:new h(c)}),appearance:y,asynchronous:!1}))}if(S.getValueOrDefault(s.outline,i,!1)){c.vertexFormat=v.VERTEX_FORMAT;var C=S.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,D),w=S.getValueOrDefault(s.outlineWidth,i,1),T=1!==C.alpha;this._outlinePrimitive=n.add(new g({geometryInstances:new l({id:a,geometry:new p(c),attributes:{color:t.fromColor(C)}}),appearance:new v({flat:!0,translucent:T,renderState:{lineWidth:o._scene.clampLineWidth(w)}}),asynchronous:!1}))}}}},x.prototype.getBoundingSphere=function(e,t){return C(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("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;\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;\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/Ellipsoid","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineGeometry","../Core/PolylinePipeline","../Core/ShowGeometryInstanceAttribute","../Scene/PolylineCollection","../Scene/PolylineColorAppearance","../Scene/PolylineMaterialAppearance","./BoundingSphereState","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S){"use strict";function w(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 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._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._options=new w(e),this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}function x(e,t){var i=t._scene.id,r=b[i];!n(r)||r.isDestroyed()?(r=new f,b[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=[],I.ellipsoid=t._scene.globe.ellipsoid}var b={},A=new y(t.WHITE),P=new C(!0);o(T,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),o(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&S.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){return!1},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(e){var r,o,a=this._entity,s=a.isAvailable(e),l=new m(s&&a.isShowing&&this._showProperty.getValue(e));if(this._materialProperty instanceof y){var u=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(u=this._materialProperty.color.getValue(e)),r=i.fromColor(u),o={show:l,color:r}}else o={show:l};return new c({id:a,geometry:new d(this._options),attributes:o})},T.prototype.createOutlineGeometryInstance=function(e){},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),a(this)},T.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(h.MINIMUM_VALUE)||!n(s))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var u=r(a.material,A),c=u instanceof y;this._materialProperty=u,this._showProperty=r(l,P),this._fillEnabled=!0;var d=a.width,p=a.followSurface,m=a.granularity;if(s.isConstant&&S.isConstant(d)&&S.isConstant(p)&&S.isConstant(m)){var f=this._options,_=s.getValue(h.MINIMUM_VALUE,f.positions);if(!n(_)||_.length<2)return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));f.vertexFormat=c?v.VERTEX_FORMAT:g.VERTEX_FORMAT,f.positions=_,f.width=n(d)?d.getValue(h.MINIMUM_VALUE):void 0,f.followSurface=n(p)?p.getValue(h.MINIMUM_VALUE):void 0,f.granularity=n(m)?m.getValue(h.MINIMUM_VALUE):void 0,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)};var I={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};return x.prototype.update=function(e){var t=this._geometryUpdater,i=t._entity,r=i.polyline,o=this._line;if(!i.isShowing||!i.isAvailable(e)||!S.getValueOrDefault(r._show,e,!0))return void(o.show=!1);var a=r.positions,s=S.getValueOrUndefined(a,e,this._positions);if(!n(s)||s.length<2)return void(o.show=!1);var l=S.getValueOrDefault(r._followSurface,e,!0);l&&(I.positions=s,I.granularity=S.getValueOrUndefined(r._granularity,e),I.height=p.extractHeights(s,this._geometryUpdater._scene.globe.ellipsoid),s=p.generateCartesianArc(I)),o.show=!0,o.positions=s.slice(),o.material=E.getValue(e,t.fillMaterialProperty,o.material),o.width=S.getValueOrDefault(r._width,e,1)},x.prototype.getBoundingSphere=function(t,i){var r=this._line;return r.show&&r.positions.length>0?(e.fromPoints(r.positions,i),_.DONE):_.FAILED},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._geometryUpdater,t=e._scene.id,i=b[t];i.remove(this._line),0===i.length&&(this._primitives.removeAndDestroy(i),delete b[t]),a(this)},T}),i("DataSources/PolylineVolumeGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineVolumeGeometry","../Core/PolylineVolumeOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";function E(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 S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new E(e),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}function w(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(e.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(e.BLACK),I=new e;return n(S,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),n(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.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)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.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));if(this._materialProperty instanceof v){var h=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(h=this._materialProperty.color.getValue(i)),o=t.fromColor(h),n={show:u,color:o}}else n={show:u};return new l({id:a,geometry:new c(this._options),attributes:n})},S.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=C.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new l({id:r,geometry:new h(this._options),attributes:{show:new d(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),o(this)},S.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(u.MINIMUM_VALUE):!0,c=a.outline,h=r(c);if(h&&c.isConstant&&(h=c.getValue(u.MINIMUM_VALUE)),!l&&!h)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,f=a.shape,g=a.show;if(!r(d)||!r(f)||r(g)&&g.isConstant&&!g.getValue(u.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var _=i(a.material,T),y=_ instanceof v;this._materialProperty=_,this._fillProperty=i(s,b),this._showProperty=i(g,x),this._showOutlineProperty=i(a.outline,A),this._outlineColorProperty=h?i(a.outlineColor,P):void 0;var E=a.granularity,S=a.outlineWidth,w=a.cornerType;if(this._fillEnabled=l,this._outlineEnabled=h,d.isConstant&&f.isConstant&&C.isConstant(E)&&C.isConstant(S)&&C.isConstant(w)){var I=this._options;I.vertexFormat=y?m.VERTEX_FORMAT:p.MaterialSupport.TEXTURED.vertexFormat,I.polylinePositions=d.getValue(u.MINIMUM_VALUE,I.polylinePositions),I.shapePositions=f.getValue(u.MINIMUM_VALUE,I.shape),I.granularity=r(E)?E.getValue(u.MINIMUM_VALUE):void 0,I.cornerType=r(w)?w.getValue(u.MINIMUM_VALUE):void 0,this._outlineWidth=r(S)?S.getValue(u.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.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)&&C.getValueOrDefault(s.show,i,!0)){var u=this._options,d=C.getValueOrUndefined(s.positions,i,u.polylinePositions),v=C.getValueOrUndefined(s.shape,i);if(r(d)&&r(v)){if(u.polylinePositions=d,u.shapePositions=v,u.granularity=C.getValueOrUndefined(s.granularity,i),u.cornerType=C.getValueOrUndefined(s.cornerType,i),!r(s.fill)||s.fill.getValue(i)){var g=y.getValue(i,o.fillMaterialProperty,this._material);this._material=g;var _=new p({material:g,translucent:g.isTranslucent(),closed:!0});u.vertexFormat=_.vertexFormat,this._primitive=n.add(new f({geometryInstances:new l({id:a,geometry:new c(u)}),appearance:_,asynchronous:!1}))}if(r(s.outline)&&s.outline.getValue(i)){u.vertexFormat=m.VERTEX_FORMAT;var E=C.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,I),S=C.getValueOrDefault(s.outlineWidth,i,1),w=1!==E.alpha;this._outlinePrimitive=n.add(new f({geometryInstances:new l({id:a,geometry:new h(u),attributes:{color:t.fromColor(E)}}),appearance:new m({flat:!0,translucent:w,renderState:{lineWidth:o._scene.clampLineWidth(S)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){ +return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},S}),i("DataSources/RectangleGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/RectangleGeometry","../Core/RectangleOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";function E(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 S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new E(e),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}function w(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(e.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(e.BLACK),I=new e;return n(S,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),n(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.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)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.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));if(this._materialProperty instanceof v){var h=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(h=this._materialProperty.color.getValue(i)),o=t.fromColor(h),n={show:u,color:o}}else n={show:u};return new l({id:a,geometry:new c(this._options),attributes:n})},S.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=C.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new l({id:r,geometry:new h(this._options),attributes:{show:new d(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),o(this)},S.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(u.MINIMUM_VALUE):!0,c=a.outline,h=r(c);if(h&&c.isConstant&&(h=c.getValue(u.MINIMUM_VALUE)),!l&&!h)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.coordinates,f=a.show;if(r(f)&&f.isConstant&&!f.getValue(u.MINIMUM_VALUE)||!r(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=i(a.material,T),_=g instanceof v;this._materialProperty=g,this._fillProperty=i(s,b),this._showProperty=i(f,x),this._showOutlineProperty=i(a.outline,A),this._outlineColorProperty=h?i(a.outlineColor,P):void 0;var y=a.height,E=a.extrudedHeight,S=a.granularity,w=a.stRotation,I=a.rotation,M=a.outlineWidth,D=a.closeBottom,R=a.closeTop;if(this._fillEnabled=l,this._outlineEnabled=h,d.isConstant&&C.isConstant(y)&&C.isConstant(E)&&C.isConstant(S)&&C.isConstant(w)&&C.isConstant(I)&&C.isConstant(M)&&C.isConstant(D)&&C.isConstant(R)){var O=this._options;O.vertexFormat=_?m.VERTEX_FORMAT:p.MaterialSupport.TEXTURED.vertexFormat,O.rectangle=d.getValue(u.MINIMUM_VALUE,O.rectangle),O.height=r(y)?y.getValue(u.MINIMUM_VALUE):void 0,O.extrudedHeight=r(E)?E.getValue(u.MINIMUM_VALUE):void 0,O.granularity=r(S)?S.getValue(u.MINIMUM_VALUE):void 0,O.stRotation=r(w)?w.getValue(u.MINIMUM_VALUE):void 0,O.rotation=r(I)?I.getValue(u.MINIMUM_VALUE):void 0,O.closeBottom=r(D)?D.getValue(u.MINIMUM_VALUE):void 0,O.closeTop=r(R)?R.getValue(u.MINIMUM_VALUE):void 0,this._isClosed=r(E)&&r(O.closeTop)&&r(O.closeBottom)&&O.closeTop&&O.closeBottom,this._outlineWidth=r(M)?M.getValue(u.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.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.rectangle;if(a.isShowing&&a.isAvailable(i)&&C.getValueOrDefault(s.show,i,!0)){var u=this._options,d=C.getValueOrUndefined(s.coordinates,i,u.rectangle);if(r(d)){if(u.rectangle=d,u.height=C.getValueOrUndefined(s.height,i),u.extrudedHeight=C.getValueOrUndefined(s.extrudedHeight,i),u.granularity=C.getValueOrUndefined(s.granularity,i),u.stRotation=C.getValueOrUndefined(s.stRotation,i),u.rotation=C.getValueOrUndefined(s.rotation,i),u.closeBottom=C.getValueOrUndefined(s.closeBottom,i),u.closeTop=C.getValueOrUndefined(s.closeTop,i),C.getValueOrDefault(s.fill,i,!0)){var v=y.getValue(i,o.fillMaterialProperty,this._material);this._material=v;var g=new p({material:v,translucent:v.isTranslucent(),closed:r(u.extrudedHeight)});u.vertexFormat=g.vertexFormat,this._primitive=n.add(new f({geometryInstances:new l({id:a,geometry:new c(u)}),appearance:g,asynchronous:!1}))}if(C.getValueOrDefault(s.outline,i,!1)){u.vertexFormat=m.VERTEX_FORMAT;var _=C.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,I),E=C.getValueOrDefault(s.outlineWidth,i,1),S=1!==_.alpha;this._outlinePrimitive=n.add(new f({geometryInstances:new l({id:a,geometry:new h(u),attributes:{color:t.fromColor(_)}}),appearance:new m({flat:!0,translucent:S,renderState:{lineWidth:o._scene.clampLineWidth(E)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},S}),i("DataSources/WallGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Core/WallGeometry","../Core/WallOutlineGeometry","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C){"use strict";function E(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 S(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(S.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new s,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._options=new E(e),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}function w(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var T=new v(e.WHITE),x=new g(!0),b=new g(!0),A=new g(!1),P=new g(e.BLACK),I=new e;return n(S,{perInstanceColorAppearanceType:{value:m},materialAppearanceType:{value:p}}),n(S.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&C.isConstant(this._showProperty)&&C.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)&&C.isConstant(this._showProperty)&&C.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return!1}},geometryChanged:{get:function(){return this._geometryChanged}}}),S.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},S.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},S.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new c(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i));if(this._materialProperty instanceof v){var d=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(d=this._materialProperty.color.getValue(i)),o=t.fromColor(d),n={show:u,color:o}}else n={show:u};return new l({id:a,geometry:new h(this._options),attributes:n})},S.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=C.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new l({id:r,geometry:new d(this._options),attributes:{show:new c(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o)}})},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){this._entitySubscription(),o(this)},S.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(u.MINIMUM_VALUE):!0,c=a.outline,h=r(c);if(h&&c.isConstant&&(h=c.getValue(u.MINIMUM_VALUE)),!l&&!h)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,f=a.show;if(r(f)&&f.isConstant&&!f.getValue(u.MINIMUM_VALUE)||!r(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=i(a.material,T),_=g instanceof v;this._materialProperty=g,this._fillProperty=i(s,b),this._showProperty=i(f,x),this._showOutlineProperty=i(a.outline,A),this._outlineColorProperty=h?i(a.outlineColor,P):void 0;var y=a.minimumHeights,E=a.maximumHeights,S=a.outlineWidth,w=a.granularity;if(this._fillEnabled=l,this._outlineEnabled=h,d.isConstant&&C.isConstant(y)&&C.isConstant(E)&&C.isConstant(S)&&C.isConstant(w)){var I=this._options;I.vertexFormat=_?m.VERTEX_FORMAT:p.MaterialSupport.TEXTURED.vertexFormat,I.positions=d.getValue(u.MINIMUM_VALUE,I.positions),I.minimumHeights=r(y)?y.getValue(u.MINIMUM_VALUE,I.minimumHeights):void 0,I.maximumHeights=r(E)?E.getValue(u.MINIMUM_VALUE,I.maximumHeights):void 0,I.granularity=r(w)?w.getValue(u.MINIMUM_VALUE):void 0,this._outlineWidth=r(S)?S.getValue(u.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},S.prototype.createDynamicUpdater=function(e){return new w(e,this)},w.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)&&C.getValueOrDefault(s.show,i,!0)){var u=this._options,c=C.getValueOrUndefined(s.positions,i,u.positions);if(r(c)){if(u.positions=c,u.minimumHeights=C.getValueOrUndefined(s.minimumHeights,i,u.minimumHeights),u.maximumHeights=C.getValueOrUndefined(s.maximumHeights,i,u.maximumHeights),u.granularity=C.getValueOrUndefined(s.granularity,i),C.getValueOrDefault(s.fill,i,!0)){var v=y.getValue(i,o.fillMaterialProperty,this._material);this._material=v;var g=new p({material:v,translucent:v.isTranslucent(),closed:r(u.extrudedHeight)});u.vertexFormat=g.vertexFormat,this._primitive=n.add(new f({geometryInstances:new l({id:a,geometry:new h(u)}),appearance:g,asynchronous:!1}))}if(C.getValueOrDefault(s.outline,i,!1)){u.vertexFormat=m.VERTEX_FORMAT;var _=C.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,I),E=C.getValueOrDefault(s.outlineWidth,i,1),S=1!==_.alpha;this._outlinePrimitive=n.add(new f({geometryInstances:new l({id:a,geometry:new d(u),attributes:{color:t.fromColor(_)}}),appearance:new m({flat:!0,translucent:S,renderState:{lineWidth:o._scene.clampLineWidth(E)}}),asynchronous:!1}))}}}},w.prototype.getBoundingSphere=function(e,t){return _(e,this._primitive,this._outlinePrimitive,t)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},S}),i("DataSources/DataSourceDisplay",["../Core/BoundingSphere","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EventHelper","./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,v,g,_,y,C,E,S,w,T){"use strict";function x(e){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;o>n;n++)this._onDataSourceAdded(r,r.get(n));var s=new h;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s}x.defaultVisualizersCallback=function(e,t){var i=t.entities;return[new s(e,i),new f(u,e,i),new f(d,e,i),new f(c,e,i),new f(p,e,i),new f(m,e,i),new f(C,e,i),new f(E,e,i),new f(S,e,i),new f(w,e,i),new f(T,e,i),new v(e,i),new g(e,i),new y(e,i),new _(e,i)]},r(x.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}}}),x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._eventHelper.removeAll();for(var e=this._dataSourceCollection,t=0,i=e.length;i>t;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),n(this)},x.prototype.update=function(e){var t,r,n,o,a=!0,s=this._dataSourceCollection,l=s.length;for(t=0;l>t;t++){var u=s.get(t);for(i(u.update)&&(a=u.update(e)&&a),n=u._visualizers,o=n.length,r=0;o>r;r++)a=n[r].update(e)&&a}for(n=this._defaultDataSource._visualizers,o=n.length,r=0;o>r;r++)a=n[r].update(e)&&a;return a};var b=[],A=new e;return x.prototype.getBoundingSphere=function(t,r,n){var o,a,s=this._defaultDataSource;if(!s.entities.contains(t)){s=void 0;var u=this._dataSourceCollection;for(a=u.length,o=0;a>o;o++){var c=u.get(o);if(c.entities.contains(t)){s=c;break}}}if(!i(s))return l.FAILED;var h=b,d=A,p=0,m=l.DONE,f=s._visualizers,v=f.length;for(o=0;v>o;o++){var g=f[o];if(i(g.getBoundingSphere)){if(m=f[o].getBoundingSphere(t,d),!r&&m===l.PENDING)return l.PENDING;m===l.DONE&&(h[p]=e.clone(d,h[p]),p++)}}return 0===p?l.FAILED:(h.length=p,e.fromBoundingSpheres(h,n),l.DONE)},x.prototype._onDataSourceAdded=function(e,t){var i=this._visualizersCallback(this._scene,t);t._visualizers=i},x.prototype._onDataSourceRemoved=function(e,t){for(var i=t._visualizers,r=i.length,n=0;r>n;n++)i[n].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/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../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,p,m){"use strict";function f(e,i,r,o,a,s,l){var d=e.scene.mode,f=a.getValue(s,e._lastCartesian);if(n(f)){var v,I,M,D=!1;if(d===m.SCENE3D){A=u.addSeconds(s,.001,A);var R=a.getValue(A,E);if(n(R)){var O,N=p.computeFixedToIcrfMatrix(s,g),L=p.computeFixedToIcrfMatrix(A,_);n(N)&&n(L)?O=h.transpose(N,y):(O=p.computeTemeToPseudoFixedMatrix(s,y),N=h.transpose(O,g),L=p.computeTemeToPseudoFixedMatrix(A,_),h.transpose(L,L));var F=h.multiplyByVector(N,f,x),B=h.multiplyByVector(L,R,b);t.subtract(F,B,T);var V=1e3*t.magnitude(T),k=3986004418e5,z=-k/(V*V-2*k/t.magnitude(F));0>z||z>P*l.maximumRadius?(v=S,t.normalize(f,v),t.negate(v,v),M=t.clone(t.UNIT_Z,w),I=t.cross(M,v,E),t.magnitude(I)>c.EPSILON7&&(t.normalize(v,v),t.normalize(I,I),M=t.cross(v,I,w),t.normalize(M,M),D=!0)):t.equalsEpsilon(f,R,c.EPSILON7)||(M=S,t.normalize(F,M),t.normalize(B,B),I=t.cross(M,B,w),t.equalsEpsilon(I,t.ZERO,c.EPSILON7)||(v=t.cross(I,M,E),h.multiplyByVector(O,v,v),h.multiplyByVector(O,I,I),h.multiplyByVector(O,M,M),t.normalize(v,v),t.normalize(I,I),t.normalize(M,M),D=!0))}}n(e._boundingSphereOffset)&&t.add(e._boundingSphereOffset,f,f);var U,G,W;o&&(U=t.clone(i.position,T),G=t.clone(i.direction,x),W=t.clone(i.up,b));var H=C;D?(H[0]=v.x,H[1]=v.y,H[2]=v.z,H[3]=0,H[4]=I.x,H[5]=I.y,H[6]=I.z,H[7]=0,H[8]=M.x,H[9]=M.y,H[10]=M.z,H[11]=0,H[12]=f.x,H[13]=f.y,H[14]=f.z,H[15]=0):p.eastNorthUpToFixedFrame(f,l,H),i._setTransform(H),o&&(t.clone(U,i.position),t.clone(G,i.direction),t.clone(W,i.up),t.cross(G,W,i.right))}if(r){var q=d===m.SCENE2D||t.equals(e._offset3D,t.ZERO)?void 0:e._offset3D;i.lookAtTransform(i.transform,q)}}function v(i,n,o,a){this.entity=i,this.scene=n,this.ellipsoid=r(o,s.WGS84),this.boundingSphere=e.clone(a),this._boundingSphereOffset=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new t,this._defaultOffset3D=void 0,this._offset3D=new t}var g=new h,_=new h,y=new h,C=new d,E=new t,S=new t,w=new t,T=new t,x=new t,b=new t,A=new u,P=1.25;o(v,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=t.clone(e,new t)}}}),v.defaultOffset3D=new t(-14e3,3500,3500);var I=new l,M=new t;return v.prototype.update=function(e){var i=this.scene,r=this.entity,o=this.ellipsoid,a=i.mode;if(a!==m.MORPHING){var s=r.position,l=r!==this._lastEntity,u=a!==this._mode,h=this._offset3D,d=i.camera,p=l||u,g=!0;if(l){var _=r.viewFrom,y=n(_),C=this.boundingSphere;if(this._boundingSphereOffset=void 0,!y&&n(C)){var E=i.screenSpaceCameraController;E.minimumZoomDistance=Math.min(E.minimumZoomDistance,.5*C.radius),I.pitch=-c.PI_OVER_FOUR,I.range=0;var S=s.getValue(e,M);if(n(S)){var w=2-1/Math.max(1,t.magnitude(S)/o.maximumRadius);I.pitch*=w}d.viewBoundingSphere(C,I),this._boundingSphereOffset=t.subtract(C.center,r.position.getValue(e),new t),p=!1,g=!1}else y&&n(_.getValue(e,h))||t.clone(v._defaultOffset3D,h)}else u||i.mode===m.MORPHING||this._mode===m.SCENE2D||t.clone(d.position,h);this._lastEntity=r,this._mode=i.mode!==m.MORPHING?i.mode:this._mode,i.mode!==m.MORPHING&&f(this,d,p,g,s,e,o)}},v}),!function(){function e(e,t){function i(t){var i,r=e.arcs[0>t?~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],0>t?[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[0>e?~e:e]=1}),s.push(r)}}var n={},o={},a={},s=[],l=-1;return t.forEach(function(i,r){var n,o=e.arcs[0>i?~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[0>e?~e:e]||s.push([e])}),s}function t(t,i,r){function n(e){var t=0>e?~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;p>d;++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=0>t?~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[0>e?~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[0>e?~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;ue?~e:e],n=0,o=r.length;o>n;++n)t.push(i=r[n].slice()),u(i,n);0>e&&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;n>r;++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=v(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;r>i;){var n=i+r>>>1;e[n]e&&(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;c>h;++h)for(var d=h+1;c>d;++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=v(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;h>c;++c)s=e[c],r(e[c]=[s[0],s[1],1/0],c);for(var c=1,h=e.length-1;h>c;++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;h>c;++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]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(n>o&&m(r[o],s)<0&&(s=r[a=o]),n>i&&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(!(0>=n)){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 v(e){if(!e)return _;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 _;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 _(){}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/definedNotNull","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getFilenameFromUri","../Core/loadJson","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/RuntimeError","../Scene/VerticalOrigin","../ThirdParty/topojson","../ThirdParty/when","./BillboardGraphics","./CallbackProperty","./ColorMaterialProperty","./ConstantPositionProperty","./ConstantProperty","./DataSource","./EntityCollection","./PolygonGraphics","./PolylineGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x){"use strict";function b(t){return e.fromDegrees(t[0],t[1],t[2])}function A(e,t){var i="";for(var r in e)if(e.hasOwnProperty(r)){if(r===t||-1!==ae.indexOf(r))continue;var n=e[r];o(n)&&(i+="object"==typeof n?""+r+""+A(n)+"":""+r+""+n+"")}return i.length>0&&(i=''+i+"
"),i}function P(e,t,i){var r;return function(o,a){return n(r)||(r=e(t,i)),r}}function I(e,t){return new _(P(A,e,t),!0)}function M(e,t,r){var a=e.id;if(o(a)&&"Feature"===e.type){for(var s=2,l=a;n(t.getById(l));)l=a+"_"+s,s++;a=l}else a=i();var u=t.getOrCreateEntity(a),c=e.properties;if(o(c)){u.addProperty("properties"),u.properties=c;var h,d=c.title;if(o(d))u.name=d,h="title";else{var p=Number.MAX_VALUE;for(var m in c)if(c.hasOwnProperty(m)&&c[m]){var f=m.toLowerCase();if(p>1&&"title"===f){p=1,h=m;break}p>2&&"name"===f?(p=2,h=m):p>3&&/title/i.test(m)?(p=3,h=m):p>4&&/name/i.test(m)&&(p=4,h=m)}o(h)&&(u.name=c[h])}var v=c.description;n(v)?null!==v&&(u.description=new E(v)):u.description=r(c,h)}return u}function D(e,t){for(var i=new Array(e.length),r=0;ra;a++)R(e,o[a],void 0,r,n)}function N(e,t,i,r,n){for(var a=i.geometries,s=0,l=a.length;l>s;s++){var u=a[s],c=u.type,h=le[c];if(!o(h))throw new p("Unknown geometry type: "+c);h(e,t,u,r,n)}}function L(e,i,a,s,l){var u=l.markerSymbol,c=l.markerColor,h=l.markerSize,d=i.properties;if(o(d)){var p=d["marker-color"];o(p)&&(c=t.fromCssColorString(p)),h=r(oe[d["marker-size"]],h);var f=d["marker-symbol"];o(f)&&(u=f)}var _;_=n(u)?1===u.length?e._pinBuilder.fromText(u.toUpperCase(),c,h):e._pinBuilder.fromMakiIconId(u,c,h):e._pinBuilder.fromColor(c,h),e._promises.push(v(_,function(t){var r=new g;r.verticalOrigin=new E(m.BOTTOM),r.image=new E(t);var n=M(i,e._entityCollection,l.describe);n.billboard=r,n.position=new C(a(s))}))}function F(e,t,i,r,n){L(e,t,r,i.coordinates,n)}function B(e,t,i,r,n){for(var o=i.coordinates,a=0;aw;w++)S.push(new d(D(a[w],r)));var b=a[0];C.hierarchy=new E(new d(D(b,r),S)),b[0].length>2&&(C.perPositionHeight=new E(!0));var A=M(i,e._entityCollection,s.describe);A.polygon=C}}function G(e,t,i,r,n){U(e,t,r,i.coordinates,n)}function W(e,t,i,r,n){for(var o=i.coordinates,a=0;ao;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;r>i;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();)-1===o(a,i)&&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);-1!==l&&a.splice(l,1)}return this.getAttrs()["class"]=a.join(" "),this},getClass:function(){return this.getAttrs()["class"]||""},hasClass:function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},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(),""].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(nn;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 v=r.processCandidateMatch(e,n,o,a,s,l,u,c,h,d,p,m,f);if(v){var g=t.call(i,v.match);return v.prefixStr+g+v.suffixStr}return e})},processCandidateMatch:function(t,i,r,n,o,a,s,l,u,c,h,d,p){var m,f=l||u,v="",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&&(v=r,t=t.slice(1)),m=new e.match.Twitter({matchedText:t,twitterHandle:n});else if(c){var _=t.replace(/\D/g,"");m=new e.match.Phone({matchedText:t,number:_})}else if(h)d&&(v=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&&(v=y,t=t.slice(1))}m=new e.match.Url({matchedText:t,url:t,protocolUrlMatch:!!s,protocolRelativeMatch:!!f,stripPrefix:this.stripPrefix})}return{prefixStr:v,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(o>n)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)?!1:!0},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)||-1!==e.indexOf("."))},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){return e&&t?!this.hasWordCharAfterProtocolRegex.test(e):!1},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>>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;h+i>a;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(;i2?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*B,n>p?t.readUint8Array(r+p,Math.min(B,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*B,n>h?t.readUint8Array(r+h,Math.min(B,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 v(e,t,n,o,a,s,l,u,c){function h(e,t){a&&!e&&v.append(t)}function d(e){s(e,v.get())}var p,v=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 _(e,t,i,n,o,a,s,l,u){function c(){var r=h*B;n>r?e.readUint8Array(i+r,Math.min(B,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;t127?n[i-128]:String.fromCharCode(i);return r}function C(e){return decodeURIComponent(escape(e))}function E(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(r){}}function w(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(D):(e.filenameLength=t.view.getUint16(i+22,!0),void(e.extraFieldLength=t.view.getUint16(i+24,!0))))}function T(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(I):(w(p,l,4,!1,t),s=p.offset+30+p.filenameLength+p.extraFieldLength,void i.init(function(){0===p.compressionMethod?_(e,i,s,p.compressedSize,a,u,n,c,h):d=v(e,i,s,p.compressedSize,a,u,n,c,h)},h))},c)},{getEntries:function(n){return e.size<22?void t(I):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;s>r;r++){if(a=new i,1347092738!=d.view.getUint32(c))return void t(I);w(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=E(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=E(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 x(e){return unescape(encodeURIComponent(e))}function b(e){var t,i=[];for(t=0;te;e++){for(i=e,t=0;8>t;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(T(e,i))},i)},createWriter:function(e,t,i,r){e.init(function(){t(A(e,i,r))},i)},useWebWorkers:!0};var W;t(i.zip,{workerScriptsPath:{get:function(){return"undefined"==typeof W&&(W=e("ThirdParty/Workers/")),W}}})}(i),i.zip}),i("DataSources/KmlDataSource",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/definedNotNull","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/getAbsoluteUri","../Core/getExtensionFromUri","../Core/getFilenameFromUri","../Core/Iso8601","../Core/JulianDate","../Core/loadBlob","../Core/loadXML","../Core/Math","../Core/NearFarScalar","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/Rectangle","../Core/RuntimeError","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HorizontalOrigin","../Scene/LabelStyle","../ThirdParty/Autolinker","../ThirdParty/Uri","../ThirdParty/when","../ThirdParty/zip","./BillboardGraphics","./CompositePositionProperty","./ConstantPositionProperty","./DataSource","./DataSourceClock","./Entity","./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,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J){"use strict";function $(e){var t=e.slice(0,Math.min(4,e.size)),i=O.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 ee(e){var t=O.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 te(e,t,i,r){t.getData(new N.TextWriter,function(e){i.kml=rt.parseFromString(e,"application/xml"),r.resolve()})}function ie(e,t,i,r){var n=s(it.detectFromFilename(t.filename),"application/octet-stream"); +t.getData(new N.Data64URIWriter(n),function(e){i[t.filename]=e,r.resolve()})}function re(e,t,i,r){for(var n=r.keys,o=new R("."),a=e.querySelectorAll(t),s=0;so;o++)r[n++]=se(t[o]);return r}}}function ue(e,t){if(l(e)){var i=e.getAttribute(t);if(null!==i){var r=parseFloat(i);return isNaN(r)?void 0:r}}}function ce(e,t){if(l(e)){var i=e.getAttribute(t);return null!==i?i:void 0}}function he(e,t,i){if(l(e))for(var r=e.childNodes,n=r.length,o=0;n>o;o++){var a=r[o];if(a.localName===t&&-1!==i.indexOf(a.namespaceURI))return a}}function de(e,t,i){if(l(e)){for(var r=[],n=e.getElementsByTagName(t),o=n.length,a=0;o>a;a++){var s=n[a];s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s)}return r}}function pe(e,t,i){if(!l(e))return[];for(var r=[],n=e.childNodes,o=n.length,a=0;o>a;a++){var s=n[a];s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s)}return r}function me(e,t,i){var r=he(e,t,i);if(l(r)){var n=parseFloat(r.textContent);return isNaN(n)?void 0:n}}function fe(e,t,i){var r=he(e,t,i);return l(r)?r.textContent.trim():void 0}function ve(e,t,i){var r=he(e,t,i);if(l(r)){var n=r.textContent.trim();return"1"===n||/^true$/i.test(n)}}function ge(e,t,i,r){if(l(e)){var n=!1;if(l(r)){var o=r[e];l(o)&&(n=!0,e=o)}return!n&&l(i)&&(e=m(e,m(i)),e=ne(e,t)),e}}function _e(e,t){if(l(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,a=parseInt(e.substring(6,8),16)/255;return t?(a>0?ct.maximumRed=a:ct.red=0,n>0?ct.maximumGreen=n:ct.green=0,r>0?ct.maximumBlue=r:ct.blue=0,ct.alpha=i,o.fromRandom(ct)):new o(a,n,r,i)}}function ye(e,t,i){var r=fe(e,t,i);if(l(r))return _e(r,"random"===fe(e,"colorMode",i))}function Ce(e){var t=he(e,"TimeStamp",ut.kmlgx),i=fe(t,"when",ut.kmlgx);if(l(t)&&l(i)&&0!==i.length){var r=_.fromIso8601(i),n=new P;return n.addInterval(new A({start:r,stop:g.MAXIMUM_VALUE})),n}}function Ee(e){var t=he(e,"TimeSpan",ut.kmlgx);if(l(t)){var i,r=he(t,"begin",ut.kmlgx),n=l(r)?_.fromIso8601(r.textContent):void 0,o=he(t,"end",ut.kmlgx),a=l(o)?_.fromIso8601(o.textContent):void 0;if(l(n)&&l(a)){if(_.lessThan(a,n)){var s=n;n=a,a=s}i=new P,i.addInterval(new A({start:n,stop:a}))}else l(n)?(i=new P,i.addInterval(new A({start:n,stop:g.MAXIMUM_VALUE}))):l(a)&&(i=new P,i.addInterval(new A({start:g.MINIMUM_VALUE,stop:a})));return i}}function Se(){var e=new L;return e.width=ot,e.height=ot,e.scaleByDistance=new S(2414016,1,16093e3,.1),e}function we(){var e=new H;return e.outline=!0,e.outlineColor=o.WHITE,e}function Te(){var e=new G;return e.translucencyByDistance=new S(3e6,1,5e6,0),e.pixelOffset=new t(17,0),e.horizontalOrigin=I.LEFT,e.font="16px sans-serif",e.style=M.FILL_AND_OUTLINE,e}function xe(r,n,o,a,u){var c=me(n,"scale",ut.kml),h=me(n,"heading",ut.kml),d=ye(n,"color",ut.kml),p=he(n,"Icon",ut.kml),m=fe(p,"href",ut.kml),f=ge(m,r._proxy,a,u),v=me(p,"x",ut.gx),g=me(p,"y",ut.gx),_=me(p,"w",ut.gx),y=me(p,"h",ut.gx),C=he(n,"hotSpot",ut.kml),S=ue(C,"x"),w=ue(C,"y"),T=ce(C,"xunits"),x=ce(C,"yunits"),b=o.billboard;l(b)||(b=Se(r),o.billboard=b),b.image=f,b.scale=c,b.color=d,(l(v)||l(g)||l(_)||l(y))&&(b.imageSubRegion=new e(v,g,_,y)),l(h)&&0!==h&&(b.rotation=E.toRadians(-h),b.alignedAxis=i.UNIT_Z),c=s(c,1);var A,P;l(S)&&("pixels"===T?A=-S*c:"insetPixels"===T?A=(S-ot)*c:"fraction"===T&&(A=-ot*c*S),A+=.5*ot*c),l(w)&&("pixels"===x?P=w:"insetPixels"===x?P=-w:"fraction"===x&&(P=w*ot),P-=.5*ot*c),(l(A)||l(P))&&(b.pixelOffset=new t(A,P))}function be(e,t,i,r,n){for(var a=0,u=t.childNodes.length;u>a;a++){var c=t.childNodes.item(a);if("IconStyle"===c.localName)xe(e,c,i,r,n);else if("LabelStyle"===c.localName){var h=i.label;l(h)||(h=Te(),i.label=h),h.scale=s(me(c,"scale",ut.kml),h.scale),h.fillColor=s(ye(c,"color",ut.kml),h.fillColor),h.text=i.name}else if("LineStyle"===c.localName){var d=i.polyline;l(d)||(d=new q,i.polyline=d),d.width=me(c,"width",ut.kml),d.material=ye(c,"color",ut.kml)}else if("PolyStyle"===c.localName){var p=i.polygon;l(p)||(p=we(),i.polygon=p),p.material=s(ye(c,"color",ut.kml),p.material),p.fill=s(ve(c,"fill",ut.kml),p.fill),p.outline=s(ve(c,"outline",ut.kml),p.outline)}else if("BalloonStyle"===c.localName){var m=s(_e(fe(c,"bgColor",ut.kml)),o.WHITE),f=s(_e(fe(c,"textColor",ut.kml)),o.BLACK),v=fe(c,"text",ut.kml);i.addProperty("balloonStyle"),i.balloonStyle={bgColor:m,textColor:f,text:v}}}}function Ae(e,t,i,r,n,o){var a=new z,s=pe(i,"Style",ut.kml),u=s.length;u>0&&be(t,s[u-1],a,n,o);var c=fe(i,"styleUrl",ut.kml);if(l(c)){var h=c,d=r.getById(h);l(d)||(d=r.getById("#"+h)),l(d)&&a.merge(d)}return a}function Pe(e,t,i){return O(C(ne(t,e._proxy)),function(r){return Ie(e,r,i,t,!0)})}function Ie(e,t,i,r,n,o){var a,s,u,c,h=de(t,"Style",ut.kml);if(l(h)){var d=h.length;for(a=0;d>a;a++)c=h[a],s=ce(c,"id"),l(s)&&(s="#"+s,n&&l(r)&&(s=r+s),l(i.getById(s))||(u=new z({id:s}),i.add(u),be(e,c,u,r,o)))}var p=de(t,"StyleMap",ut.kml);if(l(p)){var f=p.length;for(a=0;f>a;a++){var v=p[a];if(s=ce(v,"id"),l(s))for(var g=pe(v,"Pair",ut.kml),_=0;_a;a++){var b=T[a].textContent;if("#"!==b[0]){var A=b.split("#");if(2===A.length){var P=A[0];l(S[P])||(l(r)&&(P=m(P,m(r))),w.push(Pe(e,P,i,r)))}}}return w}function Me(e,t,i){var r=new X(e._entityCollection,t.id,["position"]),n=new K(t.position);t.polyline=l(i.polyline)?i.polyline.clone():new q,t.polyline.positions=new j([r,n])}function De(e,t,i){return"relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t?e:((l(t)&&"clampToGround"!==t||l(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+s(t,i)),new K(e))}function Re(e,t,i){if(l(e)){if("relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t)return e;(l(t)&&"clampToGround"!==t||l(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+s(t,i));for(var r=e.length,n=0;r>n;n++){var o=e[n];d.WGS84.scaleToGeodeticSurface(o,o)}return e}}function Oe(e,i,r){var n=i.label;l(n)||(n=l(r.label)?r.label.clone():Te(),i.label=n),n.text=i.name;var a=i.billboard;if(l(a)||(a=l(r.billboard)?r.billboard.clone():Se(),i.billboard=a),l(a.image)||(a.image=e._pinBuilder.fromColor(o.YELLOW,64)),l(a.scale)){var s=a.scale.getValue();0!==s?n.pixelOffset=new t(16*s+1,0):(n.pixelOffset=void 0,n.horizontalOrigin=void 0)}}function Ne(e,t,i){var r=t.path;l(r)||(r=new W,r.leadTime=0,t.path=r);var n=i.polyline;l(n)&&(r.material=n.material,r.width=n.width)}function Le(e,t,i,r){var n=fe(t,"coordinates",ut.kml),o=fe(t,"altitudeMode",ut.kml),a=fe(t,"altitudeMode",ut.gx),s=ve(t,"extrude",ut.kml),l=se(n);i.position=De(new B(l),o,a),Oe(e,i,r),s&&ae(o,a)&&Me(e,i,r)}function Fe(e,t,i,r){var n=he(t,"coordinates",ut.kml),a=fe(t,"altitudeMode",ut.kml),s=fe(t,"altitudeMode",ut.gx),u=ve(t,"extrude",ut.kml),c=ve(t,"tessellate",ut.kml),h=ae(a,s),d=le(n),p=r.polyline;if(h&&u){var m=new J;i.wall=m,m.positions=d;var f=r.polygon;l(f)&&(m.fill=f.fill,m.outline=f.outline,m.material=f.material),l(p)&&(m.outlineColor=l(p.material)?p.material.color:o.WHITE,m.outlineWidth=p.width)}else p=l(p)?p.clone():new q,i.polyline=p,p.positions=Re(d,a,s),(!c||h)&&(p.followSurface=!1)}function Be(e,t,i,r){var n=he(t,"outerBoundaryIs",ut.kml),a=he(n,"LinearRing",ut.kml),s=he(a,"coordinates",ut.kml),u=le(s),c=ve(t,"extrude",ut.kml),h=fe(t,"altitudeMode",ut.kml),d=fe(t,"altitudeMode",ut.gx),p=ae(h,d),m=l(r.polygon)?r.polygon.clone():we(),f=r.polyline;if(l(f)&&(m.outlineColor=l(f.material)?f.material.color:o.WHITE,m.outlineWidth=f.width),i.polygon=m,p&&(m.perPositionHeight=!0,m.extrudedHeight=c?0:void 0),l(u)){for(var v=new T(u),g=pe(t,"innerBoundaryIs",ut.kml),_=0;_p;p++){var m=se(a[p].textContent);h.push(m),d.push(_.fromIso8601(s[p].textContent))}var f=new Z;f.addSamples(d,h),i.position=De(f,n,o),Oe(e,i,r),Ne(e,i,r),i.availability=new P,s.length>0&&i.availability.addInterval(new A({start:d[0],stop:d[d.length-1]})),u&&l&&Me(e,i,r)}function ke(e,t,i,r,n,o,a,s,l){var u=e[0],c=e[e.length-1],h=new Z;h.addSamples(e,t),i.intervals.addInterval(new A({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:De(h,a,s)})),r.addInterval(new A({start:u,stop:c,isStartIncluded:l,isStopIncluded:l})),n.intervals.addInterval(new A({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:o}))}function ze(e,t,i,r){for(var n,o,a,s=ve(t,"interpolate",ut.gx),u=pe(t,"Track",ut.gx),c=!1,h=new Q,d=new P,p=new F,m=0,f=u.length;f>m;m++){var v=u[m],g=pe(v,"when",ut.kml),y=pe(v,"coord",ut.gx),C=fe(v,"altitudeMode",ut.kml),E=fe(v,"altitudeMode",ut.gx),S=ae(C,E),w=ve(v,"extrude",ut.kml),T=Math.min(y.length,g.length),x=[];n=[];for(var b=0;T>b;b++){var A=se(y[b].textContent);x.push(A),n.push(_.fromIso8601(g[b].textContent))}s&&(l(o)&&ke([o,n[0]],[a,x[0]],p,d,h,!1,"absolute",void 0,!1),o=n[T-1],a=x[x.length-1]),ke(n,x,p,d,h,S&&w,C,E,!0),c=c||S&&w}i.availability=d,i.position=p,Oe(e,i,r),Ne(e,i,r),c&&(Me(e,i,r),i.polyline.show=h)}function Ue(e,t,i,r){for(var n=t.childNodes,o=0,a=n.length;a>o;o++){var s=n.item(o),u=dt[s.localName];if(l(u)){var c=oe(s,e._entityCollection);c.parent=i,c.name=i.name,c.availability=i.availability,c.description=i.description,c.kml=i.kml,u(e,s,c,r)}}}function Ge(e,t){var i=he(e,"ExtendedData",ut.kml);if(l(i)){var r={},n=pe(i,"Data",ut.kml);if(l(n))for(var o=n.length,a=0;o>a;a++){var s=n[a],u=ce(s,"name");l(u)&&(r[u]={displayName:fe(s,"displayName",ut.kml),value:fe(s,"value",ut.kml)})}t.kml.extendedData=r}}function We(e,t,i,r){var n,a,u,c=t.kml,h=c.extendedData,d=fe(e,"description",ut.kml),p=s(t.balloonStyle,i.balloonStyle),m=o.WHITE,f=o.BLACK,v=d;l(p)&&(m=s(p.bgColor,o.WHITE),f=s(p.textColor,o.BLACK),v=s(p.text,d));var g;if(l(v)){if(v=v.replace("$[name]",s(t.name,"")),v=v.replace("$[description]",s(d,"")),v=v.replace("$[address]",s(c.address,"")),v=v.replace("$[Snippet]",s(c.snippet,"")),v=v.replace("$[id]",t.id),v=v.replace("$[geDirections]",""),l(h)){var _=v.match(/\$\[.+?\]/g);if(null!==_)for(n=0;n<_.length;n++){var y=_[n],C=y.substr(2,y.length-3),E=/\/displayName$/.test(C);C=C.replace(/\/displayName$/,""),g=h[C],l(g)&&(g=E?g.displayName:g.value),l(g)&&(v=v.replace(y,s(g,"")))}}}else if(l(h)&&(u=Object.keys(h),u.length>0)){for(v='',n=0;n";v+="
"+s(g.displayName,a)+""+s(g.value,"")+"
"}if(l(v)){v=nt.link(v),ht.innerHTML=v;var S=ht.querySelectorAll("a");for(n=0;n1&&(re(ht,"a","href",r),re(ht,"img","src",r));var w='
",ht.innerHTML="",t.description=w}}function He(e,t,i,r,n,o,a){var u=oe(i,r),c=u.kml,h=Ae(u,e,i,n,o,a),d=fe(i,"name",ut.kml);u.name=d,u.parent=t;var p=Ee(i);l(p)||(p=Ce(i)),u.availability=p;var m=ve(i,"visibility",ut.kml);u.show=s(m,!0);var f=he(i,"author",ut.atom),v=c.author;v.name=fe(f,"name",ut.atom),v.uri=fe(f,"uri",ut.atom),v.email=fe(f,"email",ut.atom);var g=he(i,"link",ut.atom),_=c.link;return _.href=ce(g,"href"),_.hreflang=ce(g,"hreflang"),_.rel=ce(g,"rel"),_.type=ce(g,"type"),_.title=ce(g,"title"),_.length=ce(g,"length"),c.address=fe(i,"address",ut.kml),c.phoneNumber=fe(i,"phoneNumber",ut.kml),c.snippet=fe(i,"Snippet",ut.kml),Ge(i,u),We(i,u,h,a),{entity:u,styleEntity:h}}function qe(e,t,i,r,n,o,a){for(var s=Object.keys(pt),l=s.length,u=0;l>u;u++)for(var c=s[u],h=pt[c],d=i.childNodes,p=d.length,m=0;p>m;m++){var f=d[m];f.localName===c&&-1!==ut.kml.indexOf(f.namespaceURI)&&h(e,t,f,r,n,o,a)}}function je(e,t,i,r,n,o,a){var s=He(e,t,i,r,n,o,a);qe(e,s.entity,i,r,n,o,a)}function Ye(e,t,i,r,n,o,a){for(var s=He(e,t,i,r,n,o,a),u=s.entity,c=s.styleEntity,h=!1,d=i.childNodes,p=0,m=d.length;m>p&&!h;p++){var f=d.item(p),v=dt[f.localName];l(v)&&(v(e,f,u,c),h=!0)}h||(u.merge(c),Oe(e,u,c))}function Xe(e,t,i,r,n,o,a){var s,u=He(e,t,i,r,n,o,a),c=u.entity,h=!1,d=le(he(i,"LatLonQuad",ut.gx));if(l(d))s=we(),s.hierarchy=new T(d),c.polygon=s,h=!0;else{s=new Y,c.rectangle=s;var p=he(i,"LatLonBox",ut.kml);if(l(p)){var m=me(p,"west",ut.kml),f=me(p,"south",ut.kml),v=me(p,"east",ut.kml),g=me(p,"north",ut.kml);l(m)&&(m=E.negativePiToPi(E.toRadians(m))),l(f)&&(f=E.negativePiToPi(E.toRadians(f))),l(v)&&(v=E.negativePiToPi(E.toRadians(v))),l(g)&&(g=E.negativePiToPi(E.toRadians(g))),s.coordinates=new x(m,f,v,g);var _=me(p,"rotation",ut.kml);l(_)&&(s.rotation=E.toRadians(_))}}var y=he(i,"Icon",ut.kml),C=fe(y,"href",ut.kml);l(C)?(h&&console.log("KML - gx:LatLonQuad Icon does not support texture projection."),s.material=ge(C,e._proxy,o,a)):s.material=ye(i,"color",ut.kml);var S=fe(i,"altitudeMode",ut.kml);l(S)?"absolute"===S?s.height=me(i,"altitude",ut.kml):"clampToGround"!==S&&console.log("KML - Unknown altitudeMode: "+S):(S=fe(i,"altitudeMode",ut.gx),"relativeToSeaFloor"===S?(console.log("KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=me(i,"altitude",ut.kml)):"clampToSeaFloor"===S?console.log("KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(S)&&console.log("KML - Unknown altitudeMode: "+S))}function Ze(e,t,i,r,n,o,a){console.log("KML - Unsupported feature: "+i.localName)}function Ke(e,t,i,r,n,o,a){var s=He(e,t,i,r,n,o,a),u=s.entity,c=he(i,"Link",ut.kml);if(l(c)){var h=fe(c,"href",ut.kml);if(l(h)){h=ge(h,void 0,o,a);var d=new et(e._proxy),p=O(d.load(h),function(){for(var t=d.entities.values,i=0;ir;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;n>o;){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;r>n;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/VelocityOrientationProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/JulianDate","../Core/Matrix3","../Core/Quaternion","../Core/Transforms","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e,i){this._position=void 0,this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new a,this.position=e,this.ellipsoid=t(i,o.WGS84)}r(d.prototype,{isConstant:{get:function(){return h.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))}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){var t=this._ellipsoid;t!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var p=new e,m=new e,f=new e,v=new s,g=new l,_=1/60;return d.prototype.getValue=function(t,r){var n=this._position;if(!h.isConstant(n)){var o=n.getValue(t,p),a=n.getValue(s.addSeconds(t,_,v),m);if(i(o)&&(i(a)||(a=o,o=n.getValue(s.addSeconds(t,-_,v),m),i(o)))&&!e.equals(o,a)){var l=e.subtract(a,o,f);return e.normalize(l,l),c.rotationMatrixFromPositionVelocity(o,l,this._ellipsoid,g),u.fromRotationMatrix(g,r)}}},d.prototype.equals=function(e){return this===e||e instanceof d&&h.equals(this._position,e._position)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))},d}),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","../Core/PrimitiveType","../Scene/Pass"],function(e,t,i){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.vertexArray=t.vertexArray,this.fragmentShaderSource=t.fragmentShaderSource,this.shaderProgram=t.shaderProgram,this.uniformMap=t.uniformMap,this.outputTexture=t.outputTexture,this.preExecute=t.preExecute,this.postExecute=t.postExecute,this.persists=e(t.persists,!1),this.pass=i.COMPUTE,this.owner=t.owner}return r.prototype.execute=function(e){e.execute(this)},r}),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/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/GeometryAttribute","../Core/PrimitiveType","../Shaders/ViewportQuadVS","./BufferUsage","./ClearCommand","./DrawCommand","./Framebuffer","./RenderState","./ShaderProgram"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g){"use strict";function _(e){this._context=e}function y(e,t){return new f({context:e,colorTextures:[t],destroyAttachments:!1})}function C(e,t){return g.fromCache({context:e,vertexShaderSource:h,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function E(t,i){return n(S)&&S.viewport.width===t&&S.viewport.height===i||(S=v.fromCache({viewport:new e(0,0,t,i)})),S}var S,w=new m({primitiveType:c.TRIANGLES}),T=new p({color:new t(0,0,0,0)});return _.prototype.execute=function(e){n(e.preExecute)&&e.preExecute(e);var t=e.outputTexture,i=t.width,r=t.height,o=this._context,a=n(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=n(e.shaderProgram)?e.shaderProgram:C(o,e.fragmentShaderSource),l=y(o,t),u=E(i,r),c=e.uniformMap,h=T;h.framebuffer=l,h.renderState=u,h.execute(o);var d=w;d.vertexArray=a,d.renderState=u,d.shaderProgram=s,d.uniformMap=c,d.framebuffer=l,d.execute(o),l.destroy(),e.persists||(s.destroy(),n(e.vertexArray)&&a.destroy()),n(e.postExecute)&&e.postExecute(t)},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return a(this)},_}),i("Renderer/PassState",["../Core/BoundingRectangle"],function(e){"use strict";function t(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}return t}),i("Renderer/RenderbufferFormat",["../Core/freezeObject","./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,v=-1,g=0;u>g;++g){if(p>=-c&&c>=p&&m>=-d&&d>=m){var _=4*((d-m)*n+p+c);h.red=t.byteToFloat(s[_]),h.green=t.byteToFloat(s[_+1]),h.blue=t.byteToFloat(s[_+2]),h.alpha=t.byteToFloat(s[_+3]);var y=a.getObjectByPickColor(h);if(r(y))return y}if(p===m||0>p&&-p===m||p>0&&p===1-m){var C=f;f=-v,v=C}p+=f,m+=v}},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._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._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function v(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._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function _(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 E(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 w(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 T(e){e._modelViewDirty&&(e._modelViewDirty=!1,c.multiplyTransformation(e._view,e._model,e._modelView))}function x(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,c.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function b(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 I(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 D(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 F(e){if(e._normal3DDirty){e._normal3DDirty=!1;var t=e._normal3D;c.getRotation(e.inverseModelView3D,t),u.transpose(t,t)}}function B(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 v=X;v.x=n.y,v.y=n.z,v.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 _=u.unproject(m,K);_.longitude=l.clamp(_.longitude,-Math.PI,Math.PI),_.latitude=l.clamp(_.latitude,-l.PI_OVER_TWO,l.PI_OVER_TWO);var y=u.ellipsoid,C=y.cartographicToCartesian(_,Q),E=d.eastNorthUpToFixedFrame(C,y,J);return c.multiplyByPointAsVector(E,f,f),c.multiplyByPointAsVector(E,v,v),c.multiplyByPointAsVector(E,g,g),o(h)||(h=new c),h[0]=f.x,h[1]=v.x,h[2]=-g.x,h[3]=0,h[4]=f.y,h[5]=v.y,h[6]=-g.y,h[7]=0,h[8]=f.z,h[9]=v.z,h[10]=-g.z,h[11]=0,h[12]=-i.dot(f,C),h[13]=-i.dot(v,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 E(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return E(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._viewProjectionDirty=!0,this._inverseViewProjectionDirty=!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}},inverseTranposeModel:{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 w(this),this._inverseProjectionOIT}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return T(this),this._modelView}},modelView3D:{get:function(){return x(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return D(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return b(this),this._inverseModelView}},inverseModelView3D:{get:function(){return A(this),this._inverseModelView3D}},viewProjection:{get:function(){return P(this),this._viewProjection}},inverseViewProjection:{get:function(){return I(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 F(this),this._normal3D}},inverseNormal:{get:function(){return B(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}}});var W=new u,H=new n;m.prototype.updateFrustum=function(e){g(this,e.projectionMatrix),o(e.infiniteProjectionMatrix)&&_(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.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;f(this,i.viewMatrix),v(this,i.inverseViewMatrix),y(this,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._entireFrustum.x=i.frustum.near,this._entireFrustum.y=i.frustum.far,this.updateFrustum(i.frustum),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/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/Math","../Core/Matrix4","../Core/PrimitiveType","../Core/RuntimeError","../Shaders/ViewportQuadVS","./BufferUsage","./ClearCommand","./ContextLimits","./CubeMap","./DrawCommand","./PassState","./PickFramebuffer","./PixelDatatype","./RenderbufferFormat","./RenderState","./ShaderCache","./ShaderProgram","./Texture","./UniformState","./VertexArray","./WebGLConstants"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R){"use strict";function O(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 N(e,t,i,r){for(var n=O(e,r)+": "+t.name+"(",o=0;or;++r){var n=e.getExtension(t[r]);if(n)return n}}function k(i,a){if("undefined"==typeof WebGLRenderingContext)throw new f("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);var l,u=!1,c="undefined"!=typeof WebGL2RenderingContext,h=!1;if(u&&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 f("The browser supports WebGL, but initialization failed.");this._originalGLContext=l,this._webgl2=h,this._id=r(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new A(this);var d=this._gl=this._originalGLContext;this._redBits=d.getParameter(d.RED_BITS),this._greenBits=d.getParameter(d.GREEN_BITS),this._blueBits=d.getParameter(d.BLUE_BITS),this._alphaBits=d.getParameter(d.ALPHA_BITS),this._depthBits=d.getParameter(d.DEPTH_BITS),this._stencilBits=d.getParameter(d.STENCIL_BITS),y._maximumCombinedTextureImageUnits=d.getParameter(d.MAX_COMBINED_TEXTURE_IMAGE_UNITS),y._maximumCubeMapSize=d.getParameter(d.MAX_CUBE_MAP_TEXTURE_SIZE),y._maximumFragmentUniformVectors=d.getParameter(d.MAX_FRAGMENT_UNIFORM_VECTORS),y._maximumTextureImageUnits=d.getParameter(d.MAX_TEXTURE_IMAGE_UNITS),y._maximumRenderbufferSize=d.getParameter(d.MAX_RENDERBUFFER_SIZE),y._maximumTextureSize=d.getParameter(d.MAX_TEXTURE_SIZE),y._maximumVaryingVectors=d.getParameter(d.MAX_VARYING_VECTORS),y._maximumVertexAttributes=d.getParameter(d.MAX_VERTEX_ATTRIBS),y._maximumVertexTextureImageUnits=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS),y._maximumVertexUniformVectors=d.getParameter(d.MAX_VERTEX_UNIFORM_VECTORS);var p=d.getParameter(d.ALIASED_LINE_WIDTH_RANGE);y._minimumAliasedLineWidth=p[0],y._maximumAliasedLineWidth=p[1];var m=d.getParameter(d.ALIASED_POINT_SIZE_RANGE);y._minimumAliasedPointSize=m[0],y._maximumAliasedPointSize=m[1];var v=d.getParameter(d.MAX_VIEWPORT_DIMS);y._maximumViewportWidth=v[0],y._maximumViewportHeight=v[1];var g=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_FLOAT);y._highpFloatSupported=0!==g.precision;var _=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_INT);y._highpIntSupported=0!==_.rangeMax,this._antialias=d.getContextAttributes().antialias,this._standardDerivatives=!!V(d,["OES_standard_derivatives"]),this._elementIndexUint=!!V(d,["OES_element_index_uint"]),this._depthTexture=!!V(d,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._textureFloat=!!V(d,["OES_texture_float"]),this._fragDepth=!!V(d,["EXT_frag_depth"]),this._debugShaders=V(d,["WEBGL_debug_shaders"]);var C=a.allowTextureFilterAnisotropic?V(d,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=C,y._maximumTextureFilterAnisotropy=o(C)?d.getParameter(C.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;var E,w,T,x,P,I,D,O,N,L;if(h){var F=this;E=function(){return F._gl.createVertexArray()},w=function(e){F._gl.bindVertexArray(e)},T=function(e){F._gl.deleteVertexArray(e)},x=function(e,t,i,r,n){d.drawElementsInstanced(e,t,i,r,n)},P=function(e,t,i,r){d.drawArraysInstanced(e,t,i,r)},I=function(e,t){d.vertexAttribDivisor(e,t)},D=function(e){d.drawBuffers(e)}}else O=V(d,["OES_vertex_array_object"]),o(O)&&(E=function(){return O.createVertexArrayOES()},w=function(e){O.bindVertexArrayOES(e)},T=function(e){O.deleteVertexArrayOES(e)}),N=V(d,["ANGLE_instanced_arrays"]),o(N)&&(x=function(e,t,i,r,n){N.drawElementsInstancedANGLE(e,t,i,r,n)},P=function(e,t,i,r){N.drawArraysInstancedANGLE(e,t,i,r)},I=function(e,t){N.vertexAttribDivisorANGLE(e,t)}),L=V(d,["WEBGL_draw_buffers"]),o(L)&&(D=function(e){L.drawBuffersWEBGL(e)});this.glCreateVertexArray=E,this.glBindVertexArray=w,this.glDeleteVertexArray=T,this.glDrawElementsInstanced=x,this.glDrawArraysInstanced=P,this.glVertexAttribDivisor=I,this.glDrawBuffers=D,this._vertexArrayObject=!!O,this._instancedArrays=!!N,this._drawBuffers=!!L,y._maximumDrawBuffers=this.drawBuffers?d.getParameter(R.MAX_DRAW_BUFFERS):1,y._maximumColorAttachments=this.drawBuffers?d.getParameter(R.MAX_COLOR_ATTACHMENTS):1;var B=d.getParameter(d.COLOR_CLEAR_VALUE);this._clearColor=new t(B[0],B[1],B[2],B[3]),this._clearDepth=d.getParameter(d.DEPTH_CLEAR_VALUE),this._clearStencil=d.getParameter(d.STENCIL_CLEAR_VALUE);var k=new M,z=new S(this),U=b.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;Gr;++r)e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)},k.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 G(this,a),t.readPixels(i,r,n,o,t.RGBA,t.UNSIGNED_BYTE,s),s};var Z={position:0,textureCoordinates:1};return k.prototype.getViewportQuadVertexArray=function(){var e=this.cache.viewportQuad_vertexArray;if(!o(e)){var t=new c({attributes:{position:new h({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new h({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:m.TRIANGLES});e=D.fromGeometry({context:this,geometry:t,attributeLocations:Z,bufferUsage:g.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e},k.prototype.createViewportQuadCommand=function(e,t){return t=n(t,n.EMPTY_OBJECT),new E({vertexArray:this.getViewportQuadVertexArray(),primitiveType:m.TRIANGLES,renderState:t.renderState,shaderProgram:P.fromCache({context:this,vertexShaderSource:v,fragmentShaderSource:e,attributeLocations:Z}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer})},k.prototype.createPickFramebuffer=function(){return new w(this)},k.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]},a(q.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),q.prototype.destroy=function(){delete this._pickObjects[this.key]},k.prototype.createPickId=function(e){++this._nextPickColor[0];var i=this._nextPickColor[0];if(0===i)throw new f("Out of unique Pick IDs.");return this._pickObjects[i]=e,new q(this._pickObjects,i,t.fromRgba(i))},k.prototype.isDestroyed=function(){return!1},k.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)},k}),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(a){function s(e){t(e.blob)&&(u._missingImageByteLength=e.blob.size);var i=r(e);if(a.disableCheckIfAllPixelsAreTransparent){for(var n=!0,o=e.width,s=a.pixelsToCheck,l=0,c=s.length;n&&c>l;++l){var h=s[l],d=4*h.x+h.y*o,p=i[d+3];p>0&&(n=!1)}n&&(i=void 0)}u._missingImagePixels=i,u._isReady=!0}function l(){u._missingImagePixels=void 0,u._isReady=!0}if(a=e(a,e.EMPTY_OBJECT),!t(a.missingImageUrl))throw new i("options.missingImageUrl is required.");if(!t(a.pixelsToCheck))throw new i("options.pixelsToCheck is required.");this._pixelsToCheck=a.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var u=this;o(n(a.missingImageUrl),s,l)}return a.prototype.isReady=function(){return this._isReady},a.prototype.shouldDiscardImage=function(e){if(!this._isReady)throw new i("shouldDiscardImage must not be called before the discard policy is ready.");var n=this._pixelsToCheck,o=this._missingImagePixels;if(!t(o))return!1;if(t(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var a=r(e),s=e.width,l=0,u=n.length;u>l;++l)for(var c=n[l],h=4*c.x+c.y*s,d=0;4>d;++d){var p=h+d;if(a[p]!==o[p])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='';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,{headers:t.headers,withCredentials:t.withCredentials}):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/GeographicProjection","../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,v,g,_,y,C,E,S){"use strict";function w(t){function i(i){var n=i.tileInfo;if(o(n)){if(h._tileWidth=n.rows,h._tileHeight=n.cols,102100===n.spatialReference.wkid||102113===n.spatialReference.wkid)h._tilingScheme=new _({ellipsoid:t.ellipsoid});else{if(4326!==i.tileInfo.spatialReference.wkid){var a="Tile spatial reference WKID "+i.tileInfo.spatialReference.wkid+" is not supported.";return void(u=v.handleError(u,h,h._errorEvent,a,void 0,void 0,void 0,s))}h._tilingScheme=new c({ellipsoid:t.ellipsoid})}if(h._maximumLevel=i.tileInfo.lods.length-1,o(i.fullExtent)){if(o(i.fullExtent.spatialReference)&&o(i.fullExtent.spatialReference.wkid))if(102100===i.fullExtent.spatialReference.wkid||102113===i.fullExtent.spatialReference.wkid){var l=new g,d=l.unproject(new e(i.fullExtent.xmin,i.fullExtent.ymin)),p=l.unproject(new e(i.fullExtent.xmax,i.fullExtent.ymax));h._rectangle=new m(d.longitude,d.latitude,p.longitude,p.latitude)}else{if(4326!==i.fullExtent.spatialReference.wkid){var f="fullExtent.spatialReference WKID "+i.fullExtent.spatialReference.wkid+" is not supported.";return void(u=v.handleError(u,h,h._errorEvent,f,void 0,void 0,void 0,s))}h._rectangle=m.fromDegrees(i.fullExtent.xmin,i.fullExtent.ymin,i.fullExtent.xmax,i.fullExtent.ymax)}}else h._rectangle=h._tilingScheme.rectangle;o(h._tileDiscardPolicy)||(h._tileDiscardPolicy=new C({missingImageUrl:T(h,0,0,h._maximumLevel),pixelsToCheck:[new e(0,0),new e(200,20),new e(20,200),new e(80,110),new e(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),h._useTiles=!0}else h._useTiles=!1;o(i.copyrightText)&&i.copyrightText.length>0&&(h._credit=new r(i.copyrightText)),h._ready=!0,h._readyPromise.resolve(!0),v.handleSuccess(u)}function a(e){var t="An error occurred while accessing "+h._url+".";u=v.handleError(u,h,h._errorEvent,t,void 0,void 0,void 0,s),h._readyPromise.reject(new f(t))}function s(){var e={f:"json"};o(h._token)&&(e.token=h._token);var t=d(h._url,{parameters:e,proxy:h._proxy});y(t,i,a)}t=n(t,{}),this._url=t.url,this._token=t.token,this._tileDiscardPolicy=t.tileDiscardPolicy,this._proxy=t.proxy,this._tileWidth=n(t.tileWidth,256),this._tileHeight=n(t.tileHeight,256),this._maximumLevel=t.maximumLevel,this._tilingScheme=n(t.tilingScheme,new c({ellipsoid:t.ellipsoid})),this._credit=void 0,this._useTiles=n(t.usePreCachedTilesIfAvailable,!0),this._rectangle=n(t.rectangle,this._tilingScheme.rectangle),this._layers=t.layers,this.enablePickFeatures=n(t.enablePickFeatures,!0),this._errorEvent=new l,this._ready=!1,this._readyPromise=y.defer();var u,h=this;this._useTiles?s():(this._ready=!0,this._readyPromise.resolve(!0))}function T(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 c?"&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)&&(-1===n.indexOf("?")&&(n+="?"),"?"!==n[n.length-1]&&(n+="&"),n+="token="+l);var u=e._proxy;return o(u)&&(n=u.getURL(n)),n}return a(w.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}}}),w.prototype.getTileCredits=function(e,t,i){},w.prototype.requestImage=function(e,t,i){var r=T(this,e,t,i);return S.loadImage(this,r)},w.prototype.pickFeatures=function(e,r,n,a,s){if(this.enablePickFeatures){var l,u,d,m=this._tilingScheme.tileXYToNativeRectangle(e,r,n);if(this._tilingScheme instanceof c)l=p.toDegrees(a),u=p.toDegrees(s),d="4326";else{var f=this._tilingScheme.projection.project(new i(a,s,0));l=f.x,u=f.y,d="3857"}var v=this._url+"/identify?f=json&tolerance=2&geometryType=esriGeometryPoint";return v+="&geometry="+l+","+u,v+="&mapExtent="+m.west+","+m.south+","+m.east+","+m.north,v+="&imageDisplay="+this._tileWidth+","+this._tileHeight+",96",v+="&sr="+d,v+="&layers=visible",o(this._layers)&&(v+=":"+this._layers),o(this._token)&&(v+="&token="+this._token),o(this._proxy)&&(v=this._proxy.getURL(v)),h(v).then(function(e){var r=[],n=e.results;if(!o(n))return r;for(var a=0;al;++l){var p=s[l];p.credit=new i(p.attribution);for(var m=p.coverageAreas,f=0,g=p.coverageAreas.length;g>f;++f){var _=m[f],C=_.bbox;_.bbox=new c(u.toRadians(C[1]),u.toRadians(C[0]),u.toRadians(C[3]),u.toRadians(C[2]))}}w._ready=!0,w._readyPromise.resolve(!0),d.handleSuccess(E)}function g(e){var t="An error occurred while accessing "+S+".";E=d.handleError(E,w,w._errorEvent,t,void 0,void 0,void 0,C),w._readyPromise.reject(new h(t))}function C(){var e=l(S,{callbackParameterName:"jsonp",proxy:w._proxy});m(e,a,g)}o=r(o,{}),this._key=e.getKey(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",_._logoData,"http://www.bing.com"),this.defaultGamma=1,(this._mapStyle===f.AERIAL||this._mapStyle===f.AERIAL_WITH_LABELS)&&(this.defaultGamma=1.3),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 E,S=this._url+"/REST/v1/Imagery/Metadata/"+this._mapStyle+"?incl=ImageryProviders&key="+this._key,w=this;C()}function y(e,t,i,r){var o=e._imageUrlTemplate,a=_.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;a>o;++o){for(var s=e[o],l=s.coverageAreas,u=!1,h=0,d=s.coverageAreas.length;!u&&d>h;++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(_.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 E=new c;_.prototype.getTileCredits=function(e,t,i){if(!this._ready)throw new a("getTileCredits must not be called before the imagery provider is ready.");var r=this._tilingScheme.tileXYToRectangle(e,t,i,E);return C(this._attributionList,i,r)},_.prototype.requestImage=function(e,t,i){var r=y(this,e,t,i);return g.loadImage(this,r)},_.prototype.pickFeatures=function(){},_._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==",_.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<=0;--n){var o=1<r;++r){var l=e.intersectPlane(o.fromCartesian4(t[r],s));if(l===n.OUTSIDE)return n.OUTSIDE;l===n.INTERSECTING&&(i=!0)}return i?n.INTERSECTING:n.INSIDE},a.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===a.MASK_OUTSIDE||t===a.MASK_INSIDE)return t;for(var i=a.MASK_INSIDE,r=this.planes,l=0,u=r.length;u>l;++l){var c=31>l?1<l&&0===(t&c))){var h=e.intersectPlane(o.fromCartesian4(r[l],s));if(h===n.OUTSIDE)return a.MASK_OUTSIDE;h===n.INTERSECTING&&(i|=c)}}return i},a.MASK_OUTSIDE=4294967295,a.MASK_INSIDE=0,a.MASK_INDETERMINATE=2147483647,a}),i("Scene/PerspectiveOffCenterFrustum",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(){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 l,this._perspectiveMatrix=new s,this._infinitePerspective=new s}function c(e){var t=e.top,i=e.bottom,r=e.right,n=e.left,o=e.near,a=e.far;(t!==e._top||i!==e._bottom||n!==e._left||r!==e._right||o!==e._near||a!==e._far)&&(e._left=n,e._right=r,e._top=t,e._bottom=i,e._near=o,e._far=a,e._perspectiveMatrix=s.computePerspectiveOffCenter(n,r,i,t,o,a,e._perspectiveMatrix),e._infinitePerspective=s.computeInfinitePerspectiveOffCenter(n,r,i,t,o,e._infinitePerspective))}o(u.prototype,{projectionMatrix:{get:function(){return c(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return c(this),this._infinitePerspective}}});var h=new t,d=new t,p=new t,m=new t;return u.prototype.computeCullingVolume=function(e,r,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,u=this.right,c=this.left,f=this.near,v=this.far,g=t.cross(r,o,h),_=d;t.multiplyByScalar(r,f,_),t.add(e,_,_);var y=p;t.multiplyByScalar(r,v,y),t.add(e,y,y);var C=m;t.multiplyByScalar(g,c,C),t.add(_,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(C,o,C);var E=a[0];return n(E)||(E=a[0]=new i),E.x=C.x,E.y=C.y,E.z=C.z,E.w=-t.dot(C,e),t.multiplyByScalar(g,u,C),t.add(_,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(o,C,C),E=a[1],n(E)||(E=a[1]=new i),E.x=C.x,E.y=C.y,E.z=C.z,E.w=-t.dot(C,e),t.multiplyByScalar(o,l,C),t.add(_,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(g,C,C),E=a[2],n(E)||(E=a[2]=new i),E.x=C.x,E.y=C.y,E.z=C.z,E.w=-t.dot(C,e),t.multiplyByScalar(o,s,C),t.add(_,C,C),t.subtract(C,e,C),t.normalize(C,C),t.cross(C,g,C),E=a[3],n(E)||(E=a[3]=new i),E.x=C.x,E.y=C.y,E.z=C.z,E.w=-t.dot(C,e),E=a[4],n(E)||(E=a[4]=new i),E.x=r.x,E.y=r.y,E.z=r.z,E.w=-t.dot(r,_),t.negate(r,C),E=a[5],n(E)||(E=a[5]=new i),E.x=C.x,E.y=C.y,E.z=C.z,E.w=-t.dot(C,y),this._cullingVolume},u.prototype.getPixelDimensions=function(e,t,i,r){c(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},u.prototype.clone=function(e){return n(e)||(e=new u),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},u.prototype.equals=function(e){return n(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},u}),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)):!1},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,u=a;if(!n(a)){var c=e.position,d=i,p=e.up,m=e.right,f=e.frustum,v=t.subtract(c,d,C),g=t.magnitude(t.multiplyByScalar(p,t.dot(v,p),E)),_=t.magnitude(t.multiplyByScalar(m,t.dot(v,m),E));l=Math.max(r,o),u=Math.min(.2*h(f,g,_),1e9)}if(n(a)&&u>a||u>l){var y=8,S=1e6,w=-Math.pow((u-r)*S,1/y),T=Math.pow((u-o)*S,1/y);return function(e){var t=e*(T-w)+w;return-Math.pow(t,y)/S+u}}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:ts.PI&&(C.longitude+=s.TWO_PI);var S=d(h,n,v.height,C.height,u);return c}function v(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),v=h.frustum.right-h.frustum.left,g=d(h,n,v,n.z,u);return c}function g(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function _(e,t){function i(){"function"==typeof t&&t(),e.enableInputs=!0}return i}var y={},C=new t,E=new t,S=new t,w=new i,T=new i,x=new i,b=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,x),l=d.project(x,b));var E=i.camera,S=o.endTransform;n(S)&&E._setTransform(S);var w=o.duration;n(w)||(w=Math.ceil(t.distance(E.position,l)/1e6)+2,w=Math.min(w,3));var T=r(o.heading,0),A=r(o.pitch,-s.PI_OVER_TWO),P=r(o.roll,0),I=i.screenSpaceCameraController;I.enableInputs=!1;var M=_(I,o.complete),D=_(I,o.cancel),R=E.frustum,O=i.mode===c.SCENE2D;if(O=O&&e.equalsEpsilon(E.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,E.position,s.EPSILON10),O=O&&s.equalsEpsilon(s.negativePiToPi(T),s.negativePiToPi(E.heading),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(A),s.negativePiToPi(E.pitch),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(P),s.negativePiToPi(E.roll),s.EPSILON10))return g(M,D);var N=new Array(4);if(N[c.SCENE2D]=v,N[c.SCENE3D]=f,N[c.COLUMBUS_VIEW]=m,0>=w){var L=function(){var e=N[u](i,1,l,T,A,P,y);e({time:1}),"function"==typeof M&&M()};return g(L,D)}var F=N[u](i,w,l,T,A,P,y);if(!n(C)){var B=E.positionCartographic.height,V=u===c.SCENE3D?p.cartesianToCartographic(l).height:l.z;C=B>V&&B>11500?a.CUBIC_OUT:a.QUINTIC_IN_OUT}return{duration:w,easingFunction:C,startObject:{time:0},stopObject:{time:w},update:F,complete:M,cancel:D}},y}),i("Scene/Camera",["../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/IntersectionTests","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Ray","../Core/Rectangle","../Core/Transforms","./CameraFlightPath","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w){"use strict";function T(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 t,this._position=new t,this._positionWC=new t,this._positionCartographic=new r,this.direction=new t,this._direction=new t,this._directionWC=new t,this.up=new t,this._up=new t,this._upWC=new t,this.right=new t,this._right=new t,this._rightWC=new t,this.frustum=new S,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=m.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumTranslateFactor=1.5,this.maximumZoomFactor=2.5,this._moveStart=new h,this._moveEnd=new h,this._viewMatrix=new v,this._invViewMatrix=new v,x(this),this._mode=w.SCENE3D,this._modeChanged=!0;var i=e.mapProjection;this._projection=i,this._maxCoord=i.project(new r(Math.PI,m.PI_OVER_TWO)),this._max2Dfrustum=void 0,W(this,T.DEFAULT_VIEW_RECTANGLE,this.position,!0);var n=t.magnitude(this.position);n+=n*T.DEFAULT_VIEW_FACTOR,t.normalize(this.position,this.position),t.multiplyByScalar(this.position,n,this.position)}function x(e){var i=e._right,r=e._up,n=e._direction,o=e._position,a=e._viewMatrix;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,o),a[13]=-t.dot(r,o),a[14]=t.dot(n,o),a[15]=1,v.multiply(a,e._actualInvTransform,e._viewMatrix),v.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function b(e){var r=e._projection,n=r.ellipsoid,o=v.getColumn(e._transform,3,ae),a=n.cartesianToCartographic(o,re),s=r.project(a,ne),l=se;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=i.add(v.getColumn(e._transform,0,oe),o,oe);n.cartesianToCartographic(u,a),r.project(a,s);var c=le;c.x=s.z,c.y=s.x,c.z=s.y,c.w=0,t.subtract(c,l,c);var h=i.add(v.getColumn(e._transform,1,oe),o,oe);n.cartesianToCartographic(h,a),r.project(a,s);var d=ue;d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,t.subtract(d,l,d);var p=ce;t.cross(c,d,p),t.normalize(p,p),t.cross(d,p,c),t.normalize(c,c),t.cross(p,c,d),t.normalize(d,d),v.setColumn(e._actualTransform,0,c,e._actualTransform),v.setColumn(e._actualTransform,1,d,e._actualTransform),v.setColumn(e._actualTransform,2,p,e._actualTransform),v.setColumn(e._actualTransform,3,l,e._actualTransform)}function A(e){var r=e._projection,n=r.ellipsoid,o=v.getColumn(e._transform,3,ae),a=n.cartesianToCartographic(o,re),s=r.project(a,ne),l=se;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=i.clone(i.UNIT_X,ce),c=i.add(v.getColumn(e._transform,0,oe),o,oe);n.cartesianToCartographic(c,a),r.project(a,s);var h=le;h.x=s.z,h.y=s.x,h.z=s.y,h.w=0,t.subtract(h,l,h),h.x=0;var d=ue;if(t.magnitudeSquared(h)>m.EPSILON10)t.cross(u,h,d);else{var p=i.add(v.getColumn(e._transform,1,oe),o,oe);n.cartesianToCartographic(p,a),r.project(a,s),d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,t.subtract(d,l,d),d.x=0,t.magnitudeSquared(d)m.EPSILON2){s=t.normalize(s,e._direction),t.clone(s,e.direction);var y=1/t.magnitudeSquared(u),C=t.dot(u,s)*y,E=t.multiplyByScalar(s,C,he);u=t.normalize(t.subtract(u,E,e._up),e._up),t.clone(u,e.up),h=t.cross(s,u,e._right),t.clone(h,e.right)}}(l||p)&&(e._directionWC=v.multiplyByPointAsVector(f,s,e._directionWC)),(c||p)&&(e._upWC=v.multiplyByPointAsVector(f,u,e._upWC)),(d||p)&&(e._rightWC=v.multiplyByPointAsVector(f,h,e._rightWC)),(a||l||c||d||p)&&x(e)}function I(e,t){var i;return i=m.equalsEpsilon(Math.abs(e.z),1,m.EPSILON3)?Math.atan2(t.y,t.x)-m.PI_OVER_TWO:Math.atan2(e.y,e.x)-m.PI_OVER_TWO,m.TWO_PI-m.zeroToTwoPi(i)}function M(e){return m.PI_OVER_TWO-m.acosClamped(e.z)}function D(e,t,i){var r=0;return m.equalsEpsilon(Math.abs(e.z),1,m.EPSILON3)||(r=Math.atan2(-i.z,t.z),r=m.zeroToTwoPi(r+m.TWO_PI)),r}function R(e,i,r,n,o){var a=v.clone(e.transform,_e),s=C.eastNorthUpToFixedFrame(i,e._projection.ellipsoid,ye);e._setTransform(s),t.clone(t.ZERO,e.position);var l=g.fromHeadingPitchRoll(r-m.PI_OVER_TWO,n,o,Ce),u=f.fromQuaternion(l,Ee);f.getColumn(u,0,e.direction),f.getColumn(u,2,e.up),t.cross(e.direction,e.up,e.right),e._setTransform(a); +}function O(e,i,r,n,o,a){var s=v.clone(e.transform,_e);if(e._setTransform(v.IDENTITY),!t.equals(i,e.positionWC)){if(a){var l=e._projection,u=l.ellipsoid.cartesianToCartographic(i,Se);i=l.project(u,ge)}t.clone(i,e.position)}var c=g.fromHeadingPitchRoll(r-m.PI_OVER_TWO,n,o,Ce),h=f.fromQuaternion(c,Ee);f.getColumn(h,0,e.direction),f.getColumn(h,2,e.up),t.cross(e.direction,e.up,e.right),e._setTransform(s)}function N(i,r,n,o){var a=-m.PI_OVER_TWO,s=0,l=v.clone(i.transform,_e);if(i._setTransform(v.IDENTITY),!t.equals(r,i.positionWC)){if(o){var u=i._projection,c=u.ellipsoid.cartesianToCartographic(r,Se);r=u.project(c,ge)}e.clone(r,i.position);var h=.5*-r.z,d=-h,p=i.frustum;if(d>h){var _=p.top/p.right;p.right=d,p.left=h,p.top=p.right*_,p.bottom=-p.top}}var y=g.fromHeadingPitchRoll(n-m.PI_OVER_TWO,a,s,Ce),C=f.fromQuaternion(y,Ee);f.getColumn(C,2,i.up),t.cross(i.direction,i.up,i.right),i._setTransform(l)}function L(e,i,r,n){var o=t.clone(r.direction,we),a=t.clone(r.up,Te);if(e._scene.mode===w.SCENE3D){var s=e._projection.ellipsoid,l=C.eastNorthUpToFixedFrame(i,s,de),u=v.inverseTransformation(l,pe);v.multiplyByPointAsVector(u,o,o),v.multiplyByPointAsVector(u,a,a)}var c=t.cross(o,a,xe);return n.heading=I(o,a),n.pitch=M(o),n.roll=D(o,a,c),n}function F(e,t){var i=e._maxCoord.x*e.maximumTranslateFactor;t.x>i&&(t.x=i),t.x<-i&&(t.x=-i);var r=e._maxCoord.y*e.maximumTranslateFactor;t.y>r&&(t.y=r),t.y<-r&&(t.y=-r)}function B(e,i){var r=e.position,n=t.normalize(r,Re);if(o(e.constrainedAxis)){var a=t.equalsEpsilon(n,e.constrainedAxis,m.EPSILON2),s=t.equalsEpsilon(n,t.negate(e.constrainedAxis,Le),m.EPSILON2);if(a||s)(a&&0>i||s&&i>0)&&e.rotate(e.right,i);else{var l=t.normalize(e.constrainedAxis,Oe),u=t.dot(n,l),c=m.acosClamped(u);i>0&&i>c&&(i=c-m.EPSILON4),u=t.dot(n,t.negate(l,Le)),c=m.acosClamped(u),0>i&&-i>c&&(i=-c+m.EPSILON4);var h=t.cross(l,n,Ne);e.rotate(h,i)}}else e.rotate(e.right,i)}function V(e,t){o(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function k(e,t){var i=e.frustum;t=.5*t;var r=i.right-t,n=i.left+t,o=e._maxCoord.x*e.maximumZoomFactor;r>o&&(r=o,n=-o),n>=r&&(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 z(e,t){e.move(e.direction,t)}function U(e,i,r){i=m.clamp(i,-m.PI_OVER_TWO,m.PI_OVER_TWO),e=m.zeroToTwoPi(e)-m.PI_OVER_TWO;var n=g.fromAxisAngle(t.UNIT_Y,-i,Ve),o=g.fromAxisAngle(t.UNIT_Z,-e,ke),a=g.multiply(o,n,o),s=f.fromQuaternion(a,ze),l=t.clone(t.UNIT_X,Be);return f.multiplyByVector(s,l,l),t.negate(l,l),t.multiplyByScalar(l,r,l),l}function G(e,i,r,n){var o=Math.abs(t.dot(i,r));return o/n-t.dot(e,r)}function W(e,i,r,n){var a=e._projection.ellipsoid,s=n?e:Je,l=i.north,u=i.south,h=i.east,d=i.west;d>h&&(h+=m.TWO_PI);var p,f=.5*(d+h);if(u<-m.PI_OVER_TWO+m.RADIANS_PER_DEGREE&&l>m.PI_OVER_TWO-m.RADIANS_PER_DEGREE)p=0;else{var v=Ge;v.longitude=f,v.latitude=l,v.height=0;var g=We;g.longitude=f,g.latitude=u,g.height=0;var _=Ue;o(_)&&_.ellipsoid===a||(Ue=_=new c(void 0,void 0,a)),_.setEndPoints(v,g),p=_.interpolateUsingFraction(.5,Ge).latitude}var y=Ge;y.longitude=f,y.latitude=p,y.height=0;var C=a.cartographicToCartesian(y,Ke),E=Ge;E.longitude=h,E.latitude=l;var S=a.cartographicToCartesian(E,He);E.longitude=d;var w=a.cartographicToCartesian(E,je);E.longitude=f;var T=a.cartographicToCartesian(E,Xe);E.latitude=u;var x=a.cartographicToCartesian(E,Ze);E.longitude=h;var b=a.cartographicToCartesian(E,Ye);E.longitude=d;var A=a.cartographicToCartesian(E,qe);t.subtract(w,C,w),t.subtract(b,C,b),t.subtract(S,C,S),t.subtract(A,C,A),t.subtract(T,C,T),t.subtract(x,C,x);var P=a.geodeticSurfaceNormal(C,s.direction);t.negate(P,P);var I=t.cross(P,t.UNIT_Z,s.right);t.normalize(I,I);var M=t.cross(I,P,s.up),D=Math.tan(.5*e.frustum.fovy),R=e.frustum.aspectRatio*D,O=Math.max(G(P,M,w,D),G(P,M,b,D),G(P,M,S,D),G(P,M,A,D),G(P,M,T,D),G(P,M,x,D),G(P,I,w,R),G(P,I,b,R),G(P,I,S,R),G(P,I,A,R),G(P,I,T,R),G(P,I,x,R));if(0>u&&l>0){var N=Ge;N.longitude=d,N.latitude=0,N.height=0;var L=a.cartographicToCartesian(N,Qe);t.subtract(L,C,L),O=Math.max(O,G(P,M,L,D),G(P,I,L,R)),N.longitude=h,L=a.cartographicToCartesian(N,Qe),t.subtract(L,C,L),O=Math.max(O,G(P,M,L,D),G(P,I,L,R))}return t.add(C,t.multiplyByScalar(P,-O,Qe),r)}function H(e,t,i){var r=e._projection;t.west>t.east&&(t=y.MAX_VALUE);var n=e._actualTransform,o=e._actualInvTransform,a=$e;a.longitude=t.east,a.latitude=t.north;var s=r.project(a,et);v.multiplyByPoint(n,s,s),v.multiplyByPoint(o,s,s),a.longitude=t.west,a.latitude=t.south;var l=r.project(a,tt);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 q(e,t,i){var r=e._projection;t.west>t.east&&(t=y.MAX_VALUE);var n=it;n.longitude=t.east,n.latitude=t.north;var o=r.project(n,rt);n.longitude=t.west,n.latitude=t.south;var a,s,l=r.project(n,nt),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 j(e,t,i,r){i=n(i,u.WGS84);var o=e.getPickRay(t,ot),a=p.rayEllipsoid(o,i);if(a){var s=a.start>0?a.start:a.stop;return _.getPoint(o,s,r)}}function Y(e,t,i,r){var n=e.getPickRay(t,at),o=n.origin;o.z=0;var a=i.unproject(o);return a.latitude<-m.PI_OVER_TWO||a.latitude>m.PI_OVER_TWO||a.longitude<-Math.PI||a.longitude>Math.PI?void 0:i.ellipsoid.cartographicToCartesian(a,r)}function X(e,i,r,n){var o=e.getPickRay(i,st),a=-o.origin.x/o.direction.x;_.getPoint(o,a,n);var s=r.unproject(new t(n.y,n.z,0));return s.latitude<-m.PI_OVER_TWO||s.latitude>m.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI?void 0:r.ellipsoid.cartographicToCartesian(s,n)}function Z(e,i,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*i.x-1,h=2/a*(a-i.y)-1,d=e.positionWC;t.clone(d,r.origin);var p=t.multiplyByScalar(e.directionWC,u,lt);t.add(d,p,p);var m=t.multiplyByScalar(e.rightWC,c*u*l,ut),f=t.multiplyByScalar(e.upWC,h*u*s,ct),v=t.add(p,m,r.direction);return t.add(v,f,v),t.subtract(v,d,v),t.normalize(v,v),r}function K(e,i,r){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=2/o*i.x-1;s*=.5*(e.frustum.right-e.frustum.left);var l=2/a*(a-i.y)-1;l*=.5*(e.frustum.top-e.frustum.bottom);var u=r.origin;return t.clone(e.position,u),t.multiplyByScalar(e.right,s,ht),t.add(ht,u,u),t.multiplyByScalar(e.up,l,ht),t.add(ht,u,u),t.clone(e.directionWC,r.direction),r}function Q(e,i){var r=e.position,n=r.x<-e._maxCoord.x||r.x>e._maxCoord.x,o=r.y<-e._maxCoord.y||r.y>e._maxCoord.y,a=n||o,s=e.frustum,u=s.top,c=s.bottom,h=s.right,d=s.left,p=e._max2Dfrustum,f=h>e._max2Dfrustum.right;if(a||f){var v=t.clone(r);v.x>e._maxCoord.x?v.x=e._maxCoord.x:v.x<-e._maxCoord.x&&(v.x=-e._maxCoord.x),v.y>e._maxCoord.y?v.y=e._maxCoord.y:v.y<-e._maxCoord.y&&(v.y=-e._maxCoord.y);var g=function(i){a&&(e.position=t.lerp(r,v,i.time,e.position)),f&&(e.frustum.top=m.lerp(u,p.top,i.time),e.frustum.bottom=m.lerp(c,p.bottom,i.time),e.frustum.right=m.lerp(h,p.right,i.time),e.frustum.left=m.lerp(d,p.left,i.time))};return{easingFunction:l.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:i,update:g}}}function J(e,i,r,n,o,a){function s(r){var n=t.lerp(i,u,r.time,new t);e.worldToCameraCoordinatesPoint(n,e.position)}var u=t.clone(i);return r.y>n?u.y-=r.y-n:r.y<-n&&(u.y+=-n-r.y),r.z>o?u.z-=r.z-o:r.z<-o&&(u.z+=-o-r.z),{easingFunction:l.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:s}}function $(e,i){var r=e.position,n=e.direction,o=e.worldToCameraCoordinatesVector(t.UNIT_X,ft),a=-t.dot(o,r)/t.dot(o,n),s=t.add(r,t.multiplyByScalar(n,a,vt),vt);e.cameraToWorldCoordinatesPoint(s,s),r=e.cameraToWorldCoordinatesPoint(e.position,gt);var l=Math.tan(.5*e.frustum.fovy),u=e.frustum.aspectRatio*l,c=t.magnitude(t.subtract(r,s,_t)),h=u*c,d=l*c,p=e._maxCoord.x,m=e._maxCoord.y,f=Math.max(h-p,p),v=Math.max(d-m,m);if(r.z<-f||r.z>f||r.y<-v||r.y>v){var g=s.y<-f||s.y>f,_=s.z<-v||s.z>v;if(g||_)return J(e,r,s,f,v,i)}}function ee(e,t){var i=e.frustum,r=Math.tan(.5*i.fovy),n=i.aspectRatio*r;return Math.max(t/n,t/r)}function te(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 ie(e,t,i){o(i)||(i=d.clone(Et));var r=i.range;if(!o(r)||0===r){var n=t.radius;0===n?i.range=St:i.range=e._mode===w.SCENE2D?te(e,n):ee(e,n)}return i}T.TRANSFORM_2D=new v(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),T.TRANSFORM_2D_INVERSE=v.inverseTransformation(T.TRANSFORM_2D,new v),T.DEFAULT_VIEW_RECTANGLE=y.fromDegrees(-95,-20,-70,90),T.DEFAULT_VIEW_FACTOR=.5;var re=new r,ne=new t,oe=new t,ae=new i,se=new i,le=new i,ue=new i,ce=new i,he=new t,de=new v,pe=new v;a(T.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return P(this),this._invTransform}},viewMatrix:{get:function(){return P(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return P(this),this._invViewMatrix}},positionCartographic:{get:function(){return P(this),this._positionCartographic}},positionWC:{get:function(){return P(this),this._positionWC}},directionWC:{get:function(){return P(this),this._directionWC}},upWC:{get:function(){return P(this),this._upWC}},rightWC:{get:function(){return P(this),this._rightWC}},heading:{get:function(){if(this._mode!==w.MORPHING){var e=this._projection.ellipsoid,t=v.clone(this._transform,de),i=C.eastNorthUpToFixedFrame(this.positionWC,e,pe);this._setTransform(i);var r=I(this.direction,this.up);return this._setTransform(t),r}}},pitch:{get:function(){if(this._mode!==w.MORPHING){var e=this._projection.ellipsoid,t=v.clone(this._transform,de),i=C.eastNorthUpToFixedFrame(this.positionWC,e,pe);this._setTransform(i);var r=M(this.direction);return this._setTransform(t),r}}},roll:{get:function(){if(this._mode!==w.MORPHING){var e=this._projection.ellipsoid,t=v.clone(this._transform,de),i=C.eastNorthUpToFixedFrame(this.positionWC,e,pe);this._setTransform(i);var r=D(this.direction,this.up,this.right);return this._setTransform(t),r}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}}}),T.prototype.update=function(e){var t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==w.MORPHING,t=this._mode===w.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}};var me=new t,fe=new t,ve=new t;T.prototype._setTransform=function(e){var i=t.clone(this.positionWC,me),r=t.clone(this.upWC,fe),n=t.clone(this.directionWC,ve);v.clone(e,this._transform),this._transformChanged=!0,P(this);var o=this._actualInvTransform;v.multiplyByPoint(o,i,this.position),v.multiplyByPointAsVector(o,n,this.direction),v.multiplyByPointAsVector(o,r,this.up),t.cross(this.direction,this.up,this.right),P(this)};var ge=new t,_e=new v,ye=new v,Ce=new g,Ee=new f,Se=new r,we=new t,Te=new t,xe=new t,be={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},endTransform:void 0};T.prototype.setView=function(e){e=n(e,n.EMPTY_OBJECT);var i=n(e.orientation,n.EMPTY_OBJECT),r=this._mode;if(r!==w.MORPHING){o(e.endTransform)&&this._setTransform(e.endTransform);var a=!0,s=n(e.destination,t.clone(this.positionWC,ge));o(s)&&o(s.west)&&(s=this.getRectangleCameraCoordinates(s,ge),a=!1),o(i.direction)&&(i=L(this,s,i,be.orientation));var l=n(i.heading,0),u=n(i.pitch,-m.PI_OVER_TWO),c=n(i.roll,0);r===w.SCENE3D?R(this,s,l,u,c):r===w.SCENE2D?N(this,s,l,a):O(this,s,l,u,c,a)}},T.prototype.worldToCameraCoordinates=function(e,t){return o(t)||(t=new i),P(this),v.multiplyByVector(this._actualInvTransform,e,t)},T.prototype.worldToCameraCoordinatesPoint=function(e,i){return o(i)||(i=new t),P(this),v.multiplyByPoint(this._actualInvTransform,e,i)},T.prototype.worldToCameraCoordinatesVector=function(e,i){return o(i)||(i=new t),P(this),v.multiplyByPointAsVector(this._actualInvTransform,e,i)},T.prototype.cameraToWorldCoordinates=function(e,t){return o(t)||(t=new i),P(this),v.multiplyByVector(this._actualTransform,e,t)},T.prototype.cameraToWorldCoordinatesPoint=function(e,i){return o(i)||(i=new t),P(this),v.multiplyByPoint(this._actualTransform,e,i)},T.prototype.cameraToWorldCoordinatesVector=function(e,i){return o(i)||(i=new t),P(this),v.multiplyByPointAsVector(this._actualTransform,e,i)};var Ae=new t;T.prototype.move=function(e,i){var r=this.position;t.multiplyByScalar(e,i,Ae),t.add(r,Ae,r),this._mode===w.SCENE2D&&F(this,r)},T.prototype.moveForward=function(e){e=n(e,this.defaultMoveAmount),this.move(this.direction,e)},T.prototype.moveBackward=function(e){e=n(e,this.defaultMoveAmount),this.move(this.direction,-e)},T.prototype.moveUp=function(e){e=n(e,this.defaultMoveAmount),this.move(this.up,e)},T.prototype.moveDown=function(e){e=n(e,this.defaultMoveAmount),this.move(this.up,-e)},T.prototype.moveRight=function(e){e=n(e,this.defaultMoveAmount),this.move(this.right,e)},T.prototype.moveLeft=function(e){e=n(e,this.defaultMoveAmount),this.move(this.right,-e)},T.prototype.lookLeft=function(e){e=n(e,this.defaultLookAmount),this.look(this.up,-e)},T.prototype.lookRight=function(e){e=n(e,this.defaultLookAmount),this.look(this.up,e)},T.prototype.lookUp=function(e){e=n(e,this.defaultLookAmount),this.look(this.right,-e)},T.prototype.lookDown=function(e){e=n(e,this.defaultLookAmount),this.look(this.right,e)};var Pe=new g,Ie=new f;T.prototype.look=function(e,t){var i=n(t,this.defaultLookAmount),r=g.fromAxisAngle(e,-i,Pe),o=f.fromQuaternion(r,Ie),a=this.direction,s=this.up,l=this.right;f.multiplyByVector(o,a,a),f.multiplyByVector(o,s,s),f.multiplyByVector(o,l,l)},T.prototype.twistLeft=function(e){e=n(e,this.defaultLookAmount),this.look(this.direction,e)},T.prototype.twistRight=function(e){e=n(e,this.defaultLookAmount),this.look(this.direction,-e)};var Me=new g,De=new f;T.prototype.rotate=function(e,i){var r=n(i,this.defaultRotateAmount),o=g.fromAxisAngle(e,-r,Me),a=f.fromQuaternion(o,De);f.multiplyByVector(a,this.position,this.position),f.multiplyByVector(a,this.direction,this.direction),f.multiplyByVector(a,this.up,this.up),t.cross(this.direction,this.up,this.right),t.cross(this.right,this.direction,this.up)},T.prototype.rotateDown=function(e){e=n(e,this.defaultRotateAmount),B(this,e)},T.prototype.rotateUp=function(e){e=n(e,this.defaultRotateAmount),B(this,-e)};var Re=new t,Oe=new t,Ne=new t,Le=new t;T.prototype.rotateRight=function(e){e=n(e,this.defaultRotateAmount),V(this,-e)},T.prototype.rotateLeft=function(e){e=n(e,this.defaultRotateAmount),V(this,e)},T.prototype.zoomIn=function(e){e=n(e,this.defaultZoomAmount),this._mode===w.SCENE2D?k(this,e):z(this,e)},T.prototype.zoomOut=function(e){e=n(e,this.defaultZoomAmount),this._mode===w.SCENE2D?k(this,-e):z(this,-e)},T.prototype.getMagnitude=function(){return this._mode===w.SCENE3D?t.magnitude(this.position):this._mode===w.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===w.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0};var Fe=new v;T.prototype.lookAt=function(e,t){var i=C.eastNorthUpToFixedFrame(e,u.WGS84,Fe);this.lookAtTransform(i,t)};var Be=new t,Ve=new g,ke=new g,ze=new f;T.prototype.lookAtTransform=function(i,r){if(this._setTransform(i),o(r)){var n;if(n=o(r.heading)?U(r.heading,r.pitch,r.range):r,this._mode===w.SCENE2D){e.clone(e.ZERO,this.position),t.negate(n,this.up),this.up.z=0,t.magnitudeSquared(this.up)0&&n.clientHeight>0){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];return r.valid?r:void 0},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||e===u.PINCH)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/freezeObject","../Core/GeographicTilingScheme","../Core/loadJson","../Core/loadText","../Core/loadWithXhr","../Core/loadXML","../Core/Math","../Core/Rectangle","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E){"use strict";function S(e){this._errorEvent=new u,this._url=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._withCredentials=o(e.withCredentials,void 0),this._headers=o(e.headers,void 0),this.enablePickFeatures=!0,this.reinitialize(e)}function w(e,t,i,r){return re=!1,oe=!1,x(e,e._urlParts,function(n){return n(e,t,i,r)})}function T(e,t,i,r,n,o,a){return re=!1,oe=!1,se=!1,ce=!1,x(e,e._pickFeaturesUrlParts,function(s){return s(e,t,i,r,n,o,a)})}function x(e,t,i){for(var r="",n=0;n=0&&i>u&&(i=u,r=s[l])}a(r)?(i>o&&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 A(e,t,i,r){return t}function P(e,t,i,r){return e.tilingScheme.getNumberOfXTilesAtLevel(r)-t-1}function I(e,t,i,r){return i}function M(e,t,i,r){return e.tilingScheme.getNumberOfYTilesAtLevel(r)-i-1}function D(e,t,i,r){var n=e.maximumLevel;return a(n)&&n>r?n-r-1:r}function R(e,t,i,r){return 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=v.toDegrees(ne.west),ne.south=v.toDegrees(ne.south),ne.east=v.toDegrees(ne.east),ne.north=v.toDegrees(ne.north),re=!0)}function L(e,t,i,r){return N(e,t,i,r),ne.west}function F(e,t,i,r){return N(e,t,i,r),ne.south}function B(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 v.toDegrees(n)}function J(e,t,i,r,n,o,a){return v.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 h)he.x=v.toDegrees(n),he.y=v.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(S.prototype,{url:{get:function(){return this._url}},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}},headers:{get:function(){return this._headers}},withCredentials:{get:function(){return this._withCredentials}}}),S.prototype.reinitialize=function(e){var t=this;t._readyPromise=C(e).then(function(e){t.enablePickFeatures=o(e.enablePickFeatures,t.enablePickFeatures),t._url=e.url,t._pickFeaturesUrl=e.pickFeaturesUrl,t._proxy=e.proxy,t._tileDiscardPolicy=e.tileDiscardPolicy,t._getFeatureInfoFormats=e.getFeatureInfoFormats,t._subdomains=e.subdomains,Array.isArray(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 y({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=b(t._url,pe),t._pickFeaturesUrlParts=b(t._pickFeaturesUrl,me),!0})},S.prototype.getTileCredits=function(e,t,i){},S.prototype.requestImage=function(e,t,i){var r=w(this,e,t,i);return E.loadImage(this,r)},S.prototype.pickFeatures=function(e,t,i,r,n){function o(e,t){return e.callback(t)}function s(){if(l>=u._getFeatureInfoFormats.length)return C([]);var a=u._getFeatureInfoFormats[l],c=T(u,e,t,i,r,n,a.format),h={headers:u.headers,withCredentials:u.withCredentials};return++l,"json"===a.type?d(c,h).then(a.callback).otherwise(s):"xml"===a.type?f(c,h).then(a.callback).otherwise(s):"text"===a.type||"html"===a.type?p(c,h).then(a.callback).otherwise(s):m({url:c,headers:u.headers,withCredentials:u.withCredentials,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}":I,"{z}":R,"{s}":O,"{reverseX}":P,"{-x}":P,"{reverseY}":M,"{-y}":M,"{reverseZ}":D,"{-z}":D,"{westDegrees}":L,"{southDegrees}":F,"{eastDegrees}":B, +"{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,"{-i}":X,"{-j}":Z,"{longitudeDegrees}":Q,"{latitudeDegrees}":J,"{longitudeProjected}":$,"{latitudeProjected}":ee,"{format}":ie});return S}),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(a){a=t(a,{});var u=t(a.url,"//a.tile.openstreetmap.org/");s.test(u)||(u+="/");var c=t(a.fileExtension,"png"),h=new n({ellipsoid:a.ellipsoid}),d=256,p=256,m=t(a.minimumLevel,0),f=a.maximumLevel,v=t(a.rectangle,h.rectangle),g=h.positionToTileXY(r.southwest(v),m),_=h.positionToTileXY(r.northeast(v),m),y=(Math.abs(_.x-g.x)+1)*(Math.abs(_.y-g.y)+1);if(y>4)throw new i("The rectangle and minimumLevel indicate that there are "+y+" tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.");var C=t(a.credit,l);"string"==typeof C&&(C=new e(C));var E=u+"{z}/{x}/{y}."+c;return new o({url:E,proxy:a.proxy,credit:C,tilingScheme:h,tileWidth:d,tileHeight:p,minimumLevel:m,maximumLevel:f,rectangle:v})}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);return 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?new l({asynchronous:!1,geometryInstances:u,appearance:new s({flat:!0,translucent:!1})}):void 0}return u}),i("Scene/createTileMapServiceImageryProvider",["../Core/Cartesian2","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../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,m,f,v){"use strict";function g(i){function o(o){for(var a,c,f,v,E=/tileformat/i,S=/tileset/i,w=/tilesets/i,T=/boundingbox/i,x=/srs/i,b=[],A=o.childNodes[0].childNodes,P=0;Pk.rectangle.east&&(U.east=k.rectangle.east),U.southk.rectangle.north&&(U.north=k.rectangle.north);var Y=k.positionToTileXY(h.southwest(U),L),X=k.positionToTileXY(h.northeast(U),L),Z=(Math.abs(X.x-Y.x)+1)*(Math.abs(X.y-Y.y)+1);Z>4&&(L=0);var K=u(_,R);D.length&&(K=u(K,"."+D)),y.resolve({url:K,tilingScheme:k,rectangle:U,tileWidth:O,tileHeight:N,minimumLevel:L,maximumLevel:F,proxy:i.proxy,tileDiscardPolicy:i.tileDiscardPolicy,credit:i.credit,pickFeaturesUrl:i.pickFeaturesUrl,getFeatureInfoFormats:i.getFeatureInfoFormats})}function a(e){var t=r(i.fileExtension,"png"),o=r(i.tileSchema,"{z}/{x}/{reverseY}"),a=r(i.tileWidth,256),s=r(i.tileHeight,256),l=r(i.minimumLevel,0),c=i.maximumLevel,h=n(i.tilingScheme)?i.tilingScheme:new m({ellipsoid:i.ellipsoid}),d=r(i.rectangle,h.rectangle),p=u(_,o);t.length&&(p=u(p,"."+t)),y.resolve({url:p,tilingScheme:h,rectangle:d,tileWidth:a,tileHeight:s,minimumLevel:l,maximumLevel:c,proxy:i.proxy,tileDiscardPolicy:i.tileDiscardPolicy,credit:i.credit,pickFeaturesUrl:i.pickFeaturesUrl,getFeatureInfoFormats:i.getFeatureInfoFormats})}function s(){var e=u(_,"tilemapresource.xml"),t=i.proxy;n(t)&&(e=t.getURL(e)),f(c(e),o,a)}i=r(i,{});var g,_=i.url,y=f.defer(),C=new v(y.promise);return s(),C}return g}),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;r>n;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= 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/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/EllipsoidFS","../Shaders/EllipsoidVS","./BlendingState","./CullFace","./Material","./Pass","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S){"use strict";function w(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,C.fromType(C.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 T(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=f.fromGeometry({context:e,geometry:n,attributeLocations:x,bufferUsage:c.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=r,r}var x={position:0};return w.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=d.fromCache({cull:{enabled:!0,face:y.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!a&&n.fragmentDepth,blending:a?_.ALPHA_BLEND:void 0})),o(this._va)||(this._va=T(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 f=this._material!==this.material;this._material=this.material,this._material.update(n);var C=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var w,b=this._colorCommand;(f||C||s)&&(w=new m({sources:[this.material.shaderSource,v]}),this.onlySunLighting&&w.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&w.defines.push("WRITE_DEPTH"),this._sp=p.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:g,fragmentShaderSource:w,attributeLocations:x}),b.vertexArray=this._va,b.renderState=this._rs,b.shaderProgram=this._sp,b.uniformMap=r(this._uniforms,this.material._uniforms),b.executeInClosestFrustum=a);var A=t.commandList,P=t.passes;if(P.render&&(b.boundingVolume=this._boundingSphere,b.debugShowBoundingVolume=this.debugShowBoundingVolume,b.modelMatrix=this._computedModelMatrix,b.pass=a?E.TRANSLUCENT:E.OPAQUE,A.push(b)),P.pick){var I=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})),(f||C||!o(this._pickSP))&&(w=new m({sources:[this.material.shaderSource,v],pickColorQualifier:"uniform"}),this.onlySunLighting&&w.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&w.defines.push("WRITE_DEPTH"),this._pickSP=p.replaceCache({context:n,shaderProgram:this._pickSP,vertexShaderSource:g,fragmentShaderSource:w,attributeLocations:x}),I.vertexArray=this._va,I.renderState=this._rs,I.shaderProgram=this._pickSP,I.uniformMap=r(r(this._uniforms,this._pickUniforms),this.material._uniforms),I.executeInClosestFrustum=a),I.boundingVolume=this._boundingSphere,I.modelMatrix=this._computedModelMatrix,I.pass=a?E.TRANSLUCENT:E.OPAQUE,A.push(I)}}},w.prototype.isDestroyed=function(){return!1},w.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)},w}),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;\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(i>d+1&&ed+2&&e=0&&e>=t[d-1])return--d,d;var r;for(r=0;i-2>r&&!(e>=t[r]&&e8e5||n.mode!==r.SCENE3D)return void(n.fog.enabled=!1);var m=d.height,f=o(m),v=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=_/u*c;g=g*(_-y)*1e-6;var C=e.normalize(h.positionWC,p),E=i.clamp(e.dot(h.directionWC,C),0,1);g*=1-E,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=t(document.hidden)?"hidden":t(document.mozHidden)?"mozHidden":t(document.msHidden)?"msHidden":t(document.webkitHidden)?"webkitHidden":void 0;var a=t(document.hidden)?"visibilitychange":t(document.mozHidden)?"mozvisibilitychange":t(document.msHidden)?"msvisibilitychange":t(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.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}return t}),i("Scene/FrustumCommands",["../Core/defaultValue","./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;n>s;++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._depthTexture=void 0,this._depthRenderbuffer=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._depthTexture=e._depthTexture&&e._depthTexture.destroy(),e._depthRenderbuffer=e._depthRenderbuffer&&e._depthRenderbuffer.destroy(),e._fbo=void 0,e._texture=void 0,e._depthTexture=void 0,e._depthRenderbuffer=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._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._texture=new d({context:i,width:n,height:a,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE}),i.depthTexture?this._depthTexture=new d({context:i,width:n,height:a,pixelFormat:o.DEPTH_COMPONENT,pixelDatatype:l.UNSIGNED_SHORT}):this._depthRenderbuffer=new u({context:i,width:n,height:a,format:c.DEPTH_COMPONENT16})),(!r(this._fbo)||f)&&(this._fbo=this._fbo&&this._fbo.destroy(),this._fbo=new s({context:i,colorTextures:[this._texture],depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,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 v=this,g=new t(1/this._texture.width,1/this._texture.height);this._command.uniformMap={u_texture:function(){return v._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/defaultValue","../Core/defined","../Core/definedNotNull","../Core/DeveloperError","../Core/RuntimeError","./ImageryLayerFeatureInfo"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,r){this.type=e,i(t)||("json"===e?t="application/json":"xml"===e?t="text/xml":"html"===e?t="text/html":"text"===e&&(t="text/plain")),this.format=t,i(r)||("json"===e?r=l:"xml"===e?r=u:"html"===e?r=g:"text"===e&&(r=g)),this.callback=r}function l(t){for(var i=[],n=t.features,o=0;o0)for(var o=0;o1&&(t=i[1]);var r=new a;return r.name=t,r.description=e,r.data=e,[r]}}var _="http://www.mapinfo.com/mxp",y="http://www.esri.com/wms",C="http://www.opengis.net/wfs",E="http://www.opengis.net/gml",S=/\s*<\/body>/im,w=//im,T=/([\s\S]*)<\/title>/im;return s}),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];\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 vec2 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, vec2 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 = normalize(czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\nvec3 normalEC = normalize(czm_normal3D * normalMC);\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates * 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\n"}),i("Shaders/GlobeVS",[],function(){"use strict";return"#ifdef QUANTIZATION_BITS12\nattribute vec4 compressed;\n#else\nattribute vec4 position3DAndHeight;\nattribute vec3 textureCoordAndEncodedNormals;\n#endif\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform vec4 u_tileRectangle;\nuniform vec2 u_southAndNorthLatitude;\nuniform vec2 u_southMercatorYAndOneOverHeight;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 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 czm_projection * (u_modifiedModelView * 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 czm_projection * (u_modifiedModelView * 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(0.0, 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(compressed.x);\nvec2 zh = czm_decompressTextureCoordinates(compressed.y);\nvec3 position = vec3(xy, zh.x);\nfloat height = zh.y;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressed.z);\nfloat encodedNormal = compressed.w;\nheight = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;\nposition = (u_scaleAndBias * vec4(position, 1.0)).xyz;\n#else\nvec3 position = position3DAndHeight.xyz;\nfloat height = position3DAndHeight.w;\nvec2 textureCoordinates = textureCoordAndEncodedNormals.xy;\nfloat encodedNormal = textureCoordAndEncodedNormals.z;\n#endif\nvec3 position3DWC = position + u_center3D;\ngl_Position = getPosition(position, height, textureCoordinates);\nv_textureCoordinates = textureCoordinates;\n#if defined(ENABLE_VERTEX_LIGHTING)\nv_positionEC = (czm_modelView3D * vec4(position3DWC, 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)\nv_positionEC = (czm_modelView3D * vec4(position3DWC, 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 getPosition2DMode(position, height, textureCoordinates); }",o="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",a="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }";switch(e){case n.SCENE3D:t=i;break;case n.SCENE2D:t=r;break;case n.COLUMBUS_VIEW:t=o;break;case n.MORPHING:t=a}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,v,g,_,y,C){var E=0,S="",w=n.pickTerrain.mesh.encoding,T=w.quantization;T===i.BITS12&&(E=1,S="QUANTIZATION_BITS12");var x=t.mode,b=x|u<<2|c<<3|h<<4|d<<5|p<<6|m<<7|f<<8|v<<9|g<<10|_<<11|y<<12|C<<13|E<<14,A=n.surfaceShader;if(e(A)&&A.numberOfDayTextures===a&&A.flags===b)return A.shaderProgram;var P=this._shadersByTexturesFlags[a];if(e(P)||(P=this._shadersByTexturesFlags[a]=[]),A=P[b],!e(A)){var I=this.baseVertexShaderSource.clone(),M=this.baseFragmentShaderSource.clone();I.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"),I.defines.push("SHOW_REFLECTIVE_OCEAN")),v&&M.defines.push("SHOW_OCEAN_WAVES"),g&&(_?(I.defines.push("ENABLE_VERTEX_LIGHTING"),M.defines.push("ENABLE_VERTEX_LIGHTING")):(I.defines.push("ENABLE_DAYNIGHT_SHADING"),M.defines.push("ENABLE_DAYNIGHT_SHADING"))),C&&(I.defines.push("FOG"),M.defines.push("FOG"));for(var D=" vec4 computeDayColor(vec4 initialColor, vec2 textureCoordinates)\n {\n vec4 color = initialColor;\n",R=0;a>R;++R)D+=" color = sampleAndBlend(\n color,\n u_dayTextures["+R+"],\n textureCoordinates,\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";D+=" return color;\n }",M.sources.push(D),I.sources.push(s(x)),I.sources.push(l(y));var O=r.fromCache({context:t.context,vertexShaderSource:I,fragmentShaderSource:M,attributeLocations:w.getAttributeLocations()});A=P[b]=new o(a,b,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 v="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:v,attributeLocations:c.getAttributeLocations()})}return m},a.prototype.destroy=function(){var i=this._shadersByTexturesFlags;for(var r in i)if(i.hasOwnProperty(r)){var n=i[r];if(!e(n))continue;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];e(a)&&a.shaderProgram.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),v=e.cross(u,f,h);e.normalize(v,t.southNormal);var g=r.geodeticSurfaceNormalCartographic(a.northwest(i),h),_=e.cross(f,g,h);e.normalize(_,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,v=new e,g=new e(0,-1,0),_=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),v),u.z=u.y,u.y=u.x,u.x=0,c=g,d=e.UNIT_Y,h=_,p=e.UNIT_Z);var m=e.subtract(r,l,y),C=e.dot(m,c),E=e.dot(m,h),S=e.subtract(r,u,y),w=e.dot(S,d),T=e.dot(S,p);C>0?o+=C*C:w>0&&(o+=w*w),E>0?o+=E*E:T>0&&(o+=T*T)}var x;x=t.mode===s.SCENE3D?n.height:r.x;var b=t.mode===s.SCENE3D?this.maximumHeight:0,A=x-b;return A>0&&(o+=A*A),Math.sqrt(o)},u}),i("Scene/TileTerrain",["../Core/BoundingSphere","../Core/Cartesian3","../Core/ComponentDatatype","../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,p){"use strict";function m(e){this.state=d.UNLOADED,this.data=void 0,this.mesh=void 0,this.vertexArray=void 0,this.upsampleDetails=e}function f(e,t,i,n,o){function a(t){e.data=t,e.state=d.RECEIVED}function l(){e.state=d.FAILED;var r="Failed to obtain terrain tile X: "+i+" Y: "+n+" Level: "+o+".";t._requestError=s.handleError(t._requestError,t,t.errorEvent,r,i,n,o,u)}function u(){e.data=t.requestTileGeometry(i,n,o),r(e.data)?(e.state=d.RECEIVING,h(e.data,a,l)):e.state=d.UNLOADED}u()}function v(e,t,i,n,o,a){var s=i.tilingScheme,l=e.data,u=l.createMesh(s,n,o,a,t.terrainExaggeration);r(u)&&(e.state=d.TRANSFORMING,h(u,function(t){e.mesh=t,e.state=d.TRANSFORMED},function(){e.state=d.FAILED}))}function g(e,t,i,n,a,s){var h=e.mesh.vertices,p=l.createVertexBuffer({context:t,typedArray:h,usage:u.STATIC_DRAW}),m=e.mesh.encoding.getAttributes(p),f=e.mesh.indices.indexBuffers||{},v=f[t.id];if(!r(v)||v.isDestroyed()){var g=e.mesh.indices,_=2===g.BYTES_PER_ELEMENT?o.UNSIGNED_SHORT:o.UNSIGNED_INT;v=l.createIndexBuffer({context:t,typedArray:g,usage:u.STATIC_DRAW,indexDatatype:_}),v.vertexArrayDestroyable=!1,v.referenceCount=1,f[t.id]=v,e.mesh.indices.indexBuffers=f}else++v.referenceCount;e.vertexArray=new c({context:t,attributes:m,indexBuffer:v}),e.state=d.READY}return m.prototype.freeResources=function(){if(this.state=d.UNLOADED,this.data=void 0,this.mesh=void 0,r(this.vertexArray)){var e=this.vertexArray.indexBuffer;this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&r(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())}},m.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=a.clone(n.orientedBoundingBox,r.orientedBoundingBox),r.tileBoundingBox=new p({rectangle:i.rectangle,minimumHeight:n.minimumHeight,maximumHeight:n.maximumHeight,ellipsoid:i.tilingScheme.ellipsoid}),i.data.occludeePointInScaledSpace=t.clone(n.occludeePointInScaledSpace,r.occludeePointInScaledSpace),r.freeVertexArray(),r.vertexArray=this.vertexArray,this.vertexArray=void 0},m.prototype.processLoadStateMachine=function(e,t,i,r,n){this.state===d.UNLOADED&&f(this,t,i,r,n),this.state===d.RECEIVED&&v(this,e,t,i,r,n),this.state===d.TRANSFORMED&&g(this,e.context,t,i,r,n)},m.prototype.processUpsampleStateMachine=function(e,t,i,n,o){if(this.state===d.UNLOADED){var a=this.upsampleDetails,s=a.data,l=a.x,u=a.y,c=a.level;if(this.data=s.upsample(t.tilingScheme,l,u,c,i,n,o),!r(this.data))return;this.state=d.RECEIVING;var p=this;h(this.data,function(e){p.data=e,p.state=d.RECEIVED},function(){p.state=d.FAILED})}this.state===d.RECEIVED&&v(this,e,t,i,n,o),this.state===d.TRANSFORMED&&g(this,e.context,t,i,n,o)},m}),i("Scene/GlobeSurfaceTile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/IntersectionTests","../Core/PixelFormat","../Core/Rectangle","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./ImageryState","./QuadtreeTileLoadState","./SceneMode","./TerrainState","./TileBoundingBox","./TileTerrain"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E){"use strict";function S(){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 w(e,i,r,n,a,s){if(e.decodePosition(n,a,s),o(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 T(e,t,i){var r=e.data,n=b(e);o(n)&&(r.upsampledTerrain=new E(n)),I(e,t)&&(r.loadedTerrain=new E);for(var a=0,s=i.length;s>a;++a){var l=i.get(a);l.show&&l._createTileImagerySkeletons(e,t)}}function x(e,t,i){var r=e.data,a=r.loadedTerrain,s=r.upsampledTerrain,l=!1;o(a)&&(a.processLoadStateMachine(t,i,e.x,e.y,e.level),a.state>=y.RECEIVED&&(r.terrainData!==a.data&&(r.terrainData=a.data,D(t.context,r),P(e)),l=!0),a.state===y.READY?(a.publishToTile(e),r.pickTerrain=n(r.loadedTerrain,r.upsampledTerrain),r.loadedTerrain=void 0,r.upsampledTerrain=void 0):a.state===y.FAILED&&(r.loadedTerrain=void 0)),!l&&o(s)&&(s.processUpsampleStateMachine(t,i,e.x,e.y,e.level),s.state>=y.RECEIVED&&r.terrainData!==s.data&&(r.terrainData=s.data,i.hasWaterMask&&R(e),A(e)),s.state===y.READY?(s.publishToTile(e),r.pickTerrain=r.upsampledTerrain,r.upsampledTerrain=void 0):s.state===y.FAILED&&(r.upsampledTerrain=void 0))}function b(e){for(var t=e.parent;o(t)&&o(t.data)&&!o(t.data.terrainData);)t=t.parent;return o(t)&&o(t.data)?{data:t.data.terrainData,x:t.x,y:t.y,level:t.level}:void 0}function A(e){var t=e.data;if(o(e._children))for(var i=0;4>i;++i){var r=e._children[i];if(r.state!==g.START){var n=r.data;if(o(n.terrainData)&&!n.terrainData.wasCreatedByUpsampling())continue;o(n.upsampledTerrain)&&n.upsampledTerrain.freeResources(),n.upsampledTerrain=new E({data:t.terrainData,x:e.x,y:e.y,level:e.level}),r.state=g.LOADING}}}function P(e){var t=e.data;if(o(e.children))for(var i=0;4>i;++i){var r=e.children[i];if(r.state!==g.START){var n=r.data;if(o(n.terrainData)&&!n.terrainData.wasCreatedByUpsampling())continue;o(n.upsampledTerrain)&&n.upsampledTerrain.freeResources(),n.upsampledTerrain=new E({data:t.terrainData,x:e.x,y:e.y,level:e.level}),t.terrainData.isChildAvailable(e.x,e.y,r.x,r.y)&&(o(n.loadedTerrain)||(n.loadedTerrain=new E)),r.state=g.LOADING}}}function I(e,t){var i=t.getTileDataAvailable(e.x,e.y,e.level);if(o(i))return i;var r=e.parent;return o(r)?o(r.data)&&o(r.data.terrainData)?r.data.terrainData.isChildAvailable(r.x,r.y,e.x,e.y):!1:!0}function M(e){var t=e.cache.tile_waterMaskData;if(!o(t)){var i=new d({context:e,pixelFormat:l.LUMINANCE,pixelDatatype:c.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});i.referenceCount=1;var r=new h({wrapS:f.CLAMP_TO_EDGE,wrapT:f.CLAMP_TO_EDGE,minificationFilter:m.LINEAR,magnificationFilter:p.LINEAR});t={allWaterTexture:i,sampler:r,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function D(e,t){var r=t.waterMaskTexture;o(r)&&(--r.referenceCount,0===r.referenceCount&&r.destroy(),t.waterMaskTexture=void 0);var n=t.terrainData.waterMask;if(o(n)){var a,s=M(e),u=n.length;if(1===u){if(0===n[0])return;a=s.allWaterTexture}else{var h=Math.sqrt(u);a=new d({context:e,pixelFormat:l.LUMINANCE,pixelDatatype:c.UNSIGNED_BYTE,source:{width:h,height:h,arrayBufferView:n},sampler:s.sampler}),a.referenceCount=0}++a.referenceCount,t.waterMaskTexture=a,i.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}}function R(e){for(var t=e.data,i=e.parent;o(i)&&!o(i.data.terrainData)||i.data.terrainData.wasCreatedByUpsampling();)i=i.parent;if(o(i)&&o(i.data.waterMaskTexture)){t.waterMaskTexture=i.data.waterMaskTexture,++t.waterMaskTexture.referenceCount;var r=i.rectangle,n=e.rectangle,a=n.width,s=n.height,l=a/r.width,u=s/r.height;t.waterMaskTranslationAndScale.x=l*(n.west-r.west)/a,t.waterMaskTranslationAndScale.y=u*(n.south-r.south)/s,t.waterMaskTranslationAndScale.z=l,t.waterMaskTranslationAndScale.w=u}}a(S.prototype,{eligibleForUnloading:{get:function(){for(var e=this.loadedTerrain,t=o(e)&&(e.state===y.RECEIVING||e.state===y.TRANSFORMING),i=this.upsampledTerrain,r=o(i)&&(i.state===y.RECEIVING||i.state===y.TRANSFORMING),n=!t&&!r,a=this.imagery,s=0,l=a.length;n&&l>s;++s){var u=a[s];n=!o(u.loadingImagery)||u.loadingImagery.state!==v.TRANSITIONING}return n}}});var O=new t,N=new t,L=new t,F=new t;return S.prototype.pick=function(e,i,r,n,a){var l=this.pickTerrain;if(o(l)){var u=l.mesh;if(o(u))for(var c=u.vertices,h=u.indices,d=u.encoding,p=h.length,m=0;p>m;m+=3){var f=h[m],v=h[m+1],g=h[m+2],_=w(d,i,r,c,f,O),y=w(d,i,r,c,v,N),C=w(d,i,r,c,g,L),E=s.rayTriangle(e,_,y,C,n,F);if(o(E))return t.clone(E,a)}}},S.prototype.freeResources=function(){o(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,o(this.loadedTerrain)&&(this.loadedTerrain.freeResources(),this.loadedTerrain=void 0),o(this.upsampledTerrain)&&(this.upsampledTerrain.freeResources(),this.upsampledTerrain=void 0),o(this.pickTerrain)&&(this.pickTerrain.freeResources(),this.pickTerrain=void 0);var e,t,i=this.imagery;for(e=0,t=i.length;t>e;++e)i[e].freeResources();this.imagery.length=0,this.freeVertexArray()},S.prototype.freeVertexArray=function(){var e;o(this.vertexArray)&&(e=this.vertexArray.indexBuffer,this.vertexArray=this.vertexArray.destroy(),!e.isDestroyed()&&o(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())),o(this.wireframeVertexArray)&&(e=this.wireframeVertexArray.indexBuffer,this.wireframeVertexArray=this.wireframeVertexArray.destroy(),!e.isDestroyed()&&o(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy()))},S.processStateMachine=function(e,t,i,r){var n=e.data;o(n)||(n=e.data=new S),e.state===g.START&&(T(e,i,r),e.state=g.LOADING),e.state===g.LOADING&&x(e,t,i);for(var a=o(n.vertexArray),s=!o(n.loadedTerrain)&&!o(n.upsampledTerrain),l=o(n.terrainData)&&n.terrainData.wasCreatedByUpsampling(),u=n.imagery,c=0,h=u.length;h>c;++c){var d=u[c];if(o(d.loadingImagery)){if(d.loadingImagery.state===v.PLACEHOLDER){var p=d.loadingImagery.imageryLayer;if(p.imageryProvider.ready){d.freeResources(),u.splice(c,1),p._createTileImagerySkeletons(e,i,c),--c,h=u.length;continue}l=!1}var m=d.processStateMachine(e,t);s=s&&m,a=a&&(m||o(d.readyImagery)),l=l&&o(d.loadingImagery)&&(d.loadingImagery.state===v.FAILED||d.loadingImagery.state===v.INVALID)}else l=!1}e.upsampledFromParent=l,c===h&&(a&&(e.renderable=!0),s&&(e.state=g.DONE))},S}),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.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(),t(this),0):this.referenceCount},r.prototype.processStateMachine=function(e){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)),this.state===i.TEXTURE_LOADED&&(this.state=i.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this))},r}),i("Scene/TileImagery",["../Core/defined","./ImageryState"],function(e,t){"use strict";function i(e,t){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0}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),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),!1):!0:!1},i}),i("Scene/ImageryLayer",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/FeatureDetection","../Core/GeographicTilingScheme","../Core/IndexDatatype","../Core/Math","../Core/PixelFormat","../Core/PrimitiveType","../Core/Rectangle","../Core/TerrainProvider","../Core/TileProviderError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ClearCommand","../Renderer/ComputeCommand","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/MipmapHint","../Renderer/RenderState","../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,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z){"use strict";function U(e,t){this._imageryProvider=e,t=o(t,{}),this.alpha=o(t.alpha,o(e.defaultAlpha,1)),this.brightness=o(t.brightness,o(e.defaultBrightness,U.DEFAULT_BRIGHTNESS)),this.contrast=o(t.contrast,o(e.defaultContrast,U.DEFAULT_CONTRAST)),this.hue=o(t.hue,o(e.defaultHue,U.DEFAULT_HUE)),this.saturation=o(t.saturation,o(e.defaultSaturation,U.DEFAULT_SATURATION)),this.gamma=o(t.gamma,o(e.defaultGamma,U.DEFAULT_GAMMA)),this.show=o(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=o(t.rectangle,f.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new z(V.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0}function G(e,t,i,r){if(d.isPowerOfTwo(r.width)&&d.isPowerOfTwo(r.height)){var n=t.cache.imageryLayer_mipmapSampler;if(!a(n)){var s=S.maximumTextureFilterAnisotropy;n=t.cache.imageryLayer_mipmapSampler=new A({wrapS:O.CLAMP_TO_EDGE,wrapT:O.CLAMP_TO_EDGE,minificationFilter:R.LINEAR_MIPMAP_LINEAR,magnificationFilter:D.LINEAR,maximumAnisotropy:Math.min(s,o(e._maximumAnisotropy,s))})}r.generateMipmap(x.NICEST),r.sampler=n}else{var l=t.cache.imageryLayer_nonMipmapSampler;a(l)||(l=t.cache.imageryLayer_nonMipmapSampler=new A({wrapS:O.CLAMP_TO_EDGE,wrapT:O.CLAMP_TO_EDGE,minificationFilter:R.LINEAR,magnificationFilter:D.LINEAR})),r.sampler=l}i.state=k.READY}function W(e,t,i){return JSON.stringify([e,t,i])}function H(e,t,i,r){var n=t.cache.imageryLayer_reproject;if(!a(n)){n=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){a(this.framebuffer)&&this.framebuffer.destroy(),a(this.vertexArray)&&this.vertexArray.destroy(),a(this.shaderProgram)&&this.shaderProgram.destroy()}};for(var o=new Float32Array(256),s=0,l=0;64>l;++l){var u=l/63;o[s++]=0,o[s++]=u,o[s++]=1,o[s++]=u}var c={position:0,webMercatorT:1},p=v.getRegularGridIndices(2,64),m=_.createIndexBuffer({context:t,typedArray:p,usage:y.STATIC_DRAW,indexDatatype:h.UNSIGNED_SHORT});n.vertexArray=new N({context:t,attributes:[{index:c.position,vertexBuffer:_.createVertexBuffer({context:t,typedArray:o,usage:y.STATIC_DRAW}),componentsPerAttribute:2},{index:c.webMercatorT,vertexBuffer:_.createVertexBuffer({context:t,sizeInBytes:512,usage:y.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:m});var f=new I({sources:[F]});n.shaderProgram=P.fromCache({context:t,vertexShaderSource:f,fragmentShaderSource:L,attributeLocations:c}),n.sampler=new A({wrapS:O.CLAMP_TO_EDGE,wrapT:O.CLAMP_TO_EDGE,minificationFilter:R.LINEAR,magnificationFilter:D.LINEAR})}i.sampler=n.sampler;var g=i.width,C=i.height;Z.textureDimensions.x=g,Z.textureDimensions.y=C,Z.texture=i;var E=Math.sin(r.south),S=.5*Math.log((1+E)/(1-E));E=Math.sin(r.north);var w=.5*Math.log((1+E)/(1-E)),T=1/(w-S),b=new M({context:t,width:g,height:C,pixelFormat:i.pixelFormat,pixelDatatype:i.pixelDatatype,preMultiplyAlpha:i.preMultiplyAlpha});d.isPowerOfTwo(g)&&d.isPowerOfTwo(C)&&b.generateMipmap(x.NICEST);for(var B=r.south,V=r.north,k=K,z=0,U=0;64>U;++U){var G=U/63,W=d.lerp(B,V,G);E=Math.sin(W);var H=.5*Math.log((1+E)/(1-E)),q=(H-S)*T;k[z++]=q,k[z++]=q}n.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(k),e.shaderProgram=n.shaderProgram,e.outputTexture=b,e.uniformMap=Z,e.vertexArray=n.vertexArray}function q(e,t,i){var r=e._imageryProvider,n=r.tilingScheme,o=n.ellipsoid,a=e._imageryProvider.tilingScheme instanceof c?1:Math.cos(i),s=n.rectangle,l=o.maximumRadius*s.width*a/(r.tileWidth*n.getNumberOfXTilesAtLevel(0)),u=l/t,h=Math.log(u)/Math.log(2),d=Math.round(h);return 0|d}s(U.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),U.DEFAULT_BRIGHTNESS=1,U.DEFAULT_CONTRAST=1,U.DEFAULT_HUE=0,U.DEFAULT_SATURATION=1,U.DEFAULT_GAMMA=1,U.prototype.isBaseLayer=function(){return this._isBaseLayer},U.prototype.isDestroyed=function(){return!1},U.prototype.destroy=function(){return l(this)};var j=new f,Y=new f,X=new f;U.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return f.intersection(e.rectangle,t)})},U.prototype._createTileImagerySkeletons=function(e,t,r){var n=e.data;if(a(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(a(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;var o=this._imageryProvider;if(a(r)||(r=n.imagery.length),!o.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),n.imagery.splice(r,0,this._skeletonPlaceholder),!0;var s=f.intersection(o.rectangle,this._rectangle,j),l=f.intersection(e.rectangle,s,Y);if(!a(l)){if(!this.isBaseLayer())return!1;var u=s,c=e.rectangle;l=Y,c.south>=u.north?l.north=l.south=u.north:c.north<=u.south?l.north=l.south=u.south:(l.south=Math.max(c.south,u.south),l.north=Math.min(c.north,u.north)),c.west>=u.east?l.west=l.east=u.east:c.east<=u.west?l.west=l.east=u.west:(l.west=Math.max(c.west,u.west),l.east=Math.min(c.east,u.east))}var h=0;l.south>0?h=l.south:l.north<0&&(h=l.north);var d=1,p=d*t.getLevelMaximumGeometricError(e.level),m=q(this,p,h);m=Math.max(0,m);var v=o.maximumLevel;if(m>v&&(m=v),a(o.minimumLevel)){var g=o.minimumLevel;g>m&&(m=g)}var _=o.tilingScheme,y=_.positionToTileXY(f.northwest(l),m),C=_.positionToTileXY(f.southeast(l),m),E=e.rectangle.height/512,S=e.rectangle.width/512,w=_.tileXYToRectangle(y.x,y.y,m);Math.abs(w.south-e.rectangle.north)<S&&y.y<C.y&&++y.y,Math.abs(w.east-e.rectangle.west)<E&&y.x<C.x&&++y.x;var T=_.tileXYToRectangle(C.x,C.y,m);Math.abs(T.north-e.rectangle.south)<S&&C.y>y.y&&--C.y,Math.abs(T.west-e.rectangle.east)<E&&C.x>y.x&&--C.x;var x,b,A=e.rectangle,P=_.tileXYToRectangle(y.x,y.y,m),I=f.intersection(P,s,X),M=0,D=1;!this.isBaseLayer()&&Math.abs(I.west-e.rectangle.west)>=E&&(M=Math.min(1,(I.west-A.west)/A.width)),!this.isBaseLayer()&&Math.abs(I.north-e.rectangle.north)>=S&&(D=Math.max(0,(I.north-A.south)/A.height));for(var R=D,O=y.x;O<=C.x;O++){x=M,P=_.tileXYToRectangle(O,y.y,m),I=f.intersection(P,s,X),M=Math.min(1,(I.east-A.west)/A.width),O===C.x&&(this.isBaseLayer()||Math.abs(I.east-e.rectangle.east)<E)&&(M=1),D=R;for(var N=y.y;N<=C.y;N++){b=D,P=_.tileXYToRectangle(O,N,m),I=f.intersection(P,s,X),D=Math.max(0,(I.south-A.south)/A.height),N===C.y&&(this.isBaseLayer()||Math.abs(I.south-e.rectangle.south)<S)&&(D=0);var L=new i(x,D,M,b),F=this.getImageryFromCache(O,N,m,P);n.imagery.splice(r,0,new z(F,L)),++r}}return!0},U.prototype._calculateTextureTranslationAndScale=function(e,t){var r=t.readyImagery.rectangle,n=e.rectangle,o=n.width,a=n.height,s=o/r.width,l=a/r.height;return new i(s*(n.west-r.west)/o,l*(n.south-r.south)/a,s,l)},U.prototype._requestImagery=function(e){function t(t){return a(t)?(e.image=t,e.state=k.RECEIVED,void g.handleSuccess(o._requestImageError)):i()}function i(t){e.state=k.FAILED;var i="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";o._requestImageError=g.handleError(o._requestImageError,n,n.errorEvent,i,e.x,e.y,e.level,r,t)}function r(){e.state=k.TRANSITIONING;var r=n.requestImage(e.x,e.y,e.level);return a(r)?(a(n.getTileCredits)&&(e.credits=n.getTileCredits(e.x,e.y,e.level)),void B(r,t,i)):void(e.state=k.UNLOADED)}var n=this._imageryProvider,o=this;r()},U.prototype._createTexture=function(e,t){var i=this._imageryProvider;if(a(i.tileDiscardPolicy)){var r=i.tileDiscardPolicy;if(a(r)){if(!r.isReady())return void(t.state=k.RECEIVED);if(r.shouldDiscardImage(t.image))return void(t.state=k.INVALID)}}var n=new M({context:e,source:t.image,pixelFormat:i.hasAlphaChannel?p.RGBA:p.RGB});t.texture=n,t.image=void 0,t.state=k.TEXTURE_LOADED},U.prototype._reprojectTexture=function(e,t){var i=t.texture,r=t.rectangle,n=e.context;if(!(this._imageryProvider.tilingScheme instanceof c)&&r.width/i.width>1e-5){var o=this,a=new E({persists:!0,owner:this,preExecute:function(e){H(e,n,i,t.rectangle)},postExecute:function(e){i.destroy(),t.texture=e,G(o,n,t,e)}});e.commandList.push(a)}else G(this,n,t,i)},U.prototype.getImageryFromCache=function(e,t,i,r){var n=W(e,t,i),o=this._imageryCache[n];return a(o)||(o=new V(this,e,t,i,r),this._imageryCache[n]=o),o.addReference(),o},U.prototype.removeImageryFromCache=function(e){var t=W(e.x,e.y,e.level);delete this._imageryCache[t]};var Z={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new t,texture:void 0},K=u.supportsTypedArrays()?new Float32Array(128):void 0;return U}),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/FeatureDetection","../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/RenderState","../Renderer/VertexArray","../Scene/BlendingState","../Scene/DepthFunction","../Scene/Pass","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../ThirdParty/when","./GlobeSurfaceTile","./ImageryLayer","./ImageryState","./QuadtreeTileLoadState","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W){"use strict";function H(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,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(H.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(H.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(H.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(H.prototype._onLayerShownOrHidden,this),this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._pickCommands=[],this._usedDrawCommands=0,this._usedPickCommands=0,this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new o(0,0,.5,1)}function q(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 j(){var e={u_initialColor:function(){return this.initialColor},u_zoomedOutOceanSpecularIntensity:function(){return this.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.oceanNormalMap},u_lightingFadeDistance:function(){return this.lightingFadeDistance},u_center3D:function(){return this.center3D},u_tileRectangle:function(){return this.tileRectangle},u_modifiedModelView:function(){return this.modifiedModelView},u_dayTextures:function(){return this.dayTextures},u_dayTextureTranslationAndScale:function(){return this.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){ +return this.dayTextureTexCoordsRectangle},u_dayTextureAlpha:function(){return this.dayTextureAlpha},u_dayTextureBrightness:function(){return this.dayTextureBrightness},u_dayTextureContrast:function(){return this.dayTextureContrast},u_dayTextureHue:function(){return this.dayTextureHue},u_dayTextureSaturation:function(){return this.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.dayTextureOneOverGamma},u_dayIntensity:function(){return this.dayIntensity},u_southAndNorthLatitude:function(){return this.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.waterMask},u_waterMaskTranslationAndScale:function(){return this.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.minMaxHeight},u_scaleAndBias:function(){return this.scaleAndBias},initialColor:new n(0,0,.5,1),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new i(65e5,9e6),center3D:void 0,modifiedModelView:new y,tileRectangle:new n,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],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 y};return e}function Y(e,t,i){var r=i.data;l(r.wireframeVertexArray)||l(r.terrainData)&&l(r.terrainData._mesh)&&(r.wireframeVertexArray=X(e,r.vertexArray,r.terrainData._mesh))}function X(e,t,i){var r={indices:i.indices,primitiveType:E.TRIANGLES};f.toWireframe(r);var n=r.indices,o=A.createIndexBuffer({context:e,typedArray:n,usage:P.STATIC_DRAW,indexDatatype:v.UNSIGNED_SHORT});return new R({context:e,attributes:t._attributes,indexBuffer:o})}function Z(t,i,a){var s=i.data,u=a.camera.viewMatrix,c=I.maximumTextureImageUnits,h=s.waterMaskTexture,d=t.hasWaterMask&&l(h),p=t.oceanNormalMap,m=d&&l(p),f=t.terrainProvider.ready&&t.terrainProvider.hasVertexNormals,v=a.fog.enabled;d&&--c,m&&--c;var g=s.center,w=s.pickTerrain.mesh.encoding,x=$,A=0,P=0,D=0,R=0,O=!1;if(a.mode!==W.SCENE3D){var N=a.mapProjection,F=N.project(S.southwest(i.rectangle),ie),B=N.project(S.northeast(i.rectangle),re);if(x.x=F.x,x.y=F.y,x.z=B.x,x.w=B.y,a.mode!==W.MORPHING&&(g=ee,g.x=0,g.y=.5*(x.z+x.x),g.z=.5*(x.w+x.y),x.x-=g.y,x.y-=g.z,x.z-=g.y,x.w-=g.z),a.mode===W.SCENE2D&&w.quantization===T.BITS12){var V=1/(Math.pow(2,12)-1)*.5,k=(x.z-x.x)*V,G=(x.w-x.y)*V;x.x-=k,x.y-=G,x.z+=k,x.w+=G}N instanceof b&&(A=i.rectangle.south,P=i.rectangle.north,D=b.geodeticLatitudeToMercatorAngle(A),R=1/(b.geodeticLatitudeToMercatorAngle(P)-D),O=!0)}var H=y.multiplyByPoint(u,g,te);y.setTranslation(u,H,J);var q=s.imagery,X=0,Z=q.length,K=t._renderState,Q=t._blendRenderState,le=K,ue=t._firstPassInitialColor,ce=a.context;l(t._debug.boundingSphereTile)||ae();do{var he,de,pe=0;t._drawCommands.length<=t._usedDrawCommands?(he=new M,he.owner=i,he.cull=!1,he.boundingVolume=new e,he.orientedBoundingBox=void 0,de=j(),t._drawCommands.push(he),t._uniformMaps.push(de)):(he=t._drawCommands[t._usedDrawCommands],de=t._uniformMaps[t._usedDrawCommands]),he.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)),n.clone(ue,de.initialColor),de.oceanNormalMap=p,de.lightingFadeDistance.x=t.lightingFadeOutDistance,de.lightingFadeDistance.y=t.lightingFadeInDistance,de.zoomedOutOceanSpecularIntensity=t.zoomedOutOceanSpecularIntensity,de.center3D=s.center,n.clone(x,de.tileRectangle),de.southAndNorthLatitude.x=A,de.southAndNorthLatitude.y=P,de.southMercatorYAndOneOverHeight.x=D,de.southMercatorYAndOneOverHeight.y=R,y.clone(J,de.modifiedModelView);for(var me=v&&_.fog(i._distance,a.fog.density)>_.EPSILON3,fe=!1,ve=!1,ge=!1,_e=!1,ye=!1,Ce=!1;c>pe&&Z>X;){var Ee=q[X],Se=Ee.readyImagery;if(++X,l(Se)&&Se.state===U.READY&&0!==Se.imageryLayer.alpha){var we=Se.imageryLayer;if(l(Ee.textureTranslationAndScale)||(Ee.textureTranslationAndScale=we._calculateTextureTranslationAndScale(i,Ee)),de.dayTextures[pe]=Se.texture,de.dayTextureTranslationAndScale[pe]=Ee.textureTranslationAndScale,de.dayTextureTexCoordsRectangle[pe]=Ee.textureCoordinateRectangle,de.dayTextureAlpha[pe]=we.alpha,Ce=Ce||1!==de.dayTextureAlpha[pe],de.dayTextureBrightness[pe]=we.brightness,fe=fe||de.dayTextureBrightness[pe]!==z.DEFAULT_BRIGHTNESS,de.dayTextureContrast[pe]=we.contrast,ve=ve||de.dayTextureContrast[pe]!==z.DEFAULT_CONTRAST,de.dayTextureHue[pe]=we.hue,ge=ge||de.dayTextureHue[pe]!==z.DEFAULT_HUE,de.dayTextureSaturation[pe]=we.saturation,_e=_e||de.dayTextureSaturation[pe]!==z.DEFAULT_SATURATION,de.dayTextureOneOverGamma[pe]=1/we.gamma,ye=ye||de.dayTextureOneOverGamma[pe]!==1/z.DEFAULT_GAMMA,l(Se.credits))for(var Te=a.creditDisplay,xe=Se.credits,be=0,Ae=xe.length;Ae>be;++be)Te.addCredit(xe[be]);++pe}}de.dayTextures.length=pe,de.waterMask=h,n.clone(s.waterMaskTranslationAndScale,de.waterMaskTranslationAndScale),de.minMaxHeight.x=w.minimumHeight,de.minMaxHeight.y=w.maximumHeight,y.clone(w.matrix,de.scaleAndBias),he.shaderProgram=t._surfaceShaderSet.getShaderProgram(a,s,pe,fe,ve,ge,_e,ye,Ce,d,m,t.enableLighting,f,O,me),he.renderState=le,he.primitiveType=E.TRIANGLES,he.vertexArray=s.vertexArray,he.uniformMap=de,he.pass=L.GLOBE,t._debug.wireframe&&(Y(ce,t,i),l(s.wireframeVertexArray)&&(he.vertexArray=s.wireframeVertexArray,he.primitiveType=E.LINES));var Pe=he.boundingVolume,Ie=he.orientedBoundingBox;a.mode!==W.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===W.MORPHING&&(Pe=e.union(s.boundingSphere3D,Pe,Pe))):(he.boundingVolume=e.clone(s.boundingSphere3D,Pe),he.orientedBoundingBox=C.clone(s.orientedBoundingBox,Ie)),a.commandList.push(he),le=Q,ue=se}while(Z>X)}function K(e,t,i){var r;e._pickCommands.length<=e._usedPickCommands?(r=new M,r.cull=!1,e._pickCommands.push(r)):r=e._pickCommands[e._usedPickCommands],++e._usedPickCommands;var n=t.owner.data,o=i.projection instanceof b;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=r.orientedBoundingBox,r.pass=t.pass,i.commandList.push(r)}u(H.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())}}}),H.prototype.beginUpdate=function(e){this._imageryLayers._update(),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(q)}));var t,i,r=this._tilesToRenderByTextureCount;for(t=0,i=r.length;i>t;++t){var n=r[t];l(n)&&(n.length=0)}this._usedDrawCommands=0;var o=e.creditDisplay;this._terrainProvider.ready&&l(this._terrainProvider.credit)&&o.addCredit(this._terrainProvider.credit);var a=this._imageryLayers;for(t=0,i=a.length;i>t;++t){var s=a.get(t).imageryProvider;s.ready&&l(s.credit)&&o.addCredit(s.credit)}},H.prototype.endUpdate=function(e){l(this._renderState)||(this._renderState=D.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS}}),this._blendRenderState=D.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;r>i;++i){var n=t[i];if(l(n))for(var o=0,a=n.length;a>o;++o)Z(this,n[o],e)}},H.prototype.updateForPick=function(e){l(this._pickRenderState)||(this._pickRenderState=D.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;r>i;++i)K(this,t[i],e)},H.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},H.prototype.loadTile=function(e,t){k.processStateMachine(t,e,this._terrainProvider,this._imageryLayers)};var Q=new e;H.prototype.computeTileVisibility=function(t,i,n){var o=this.computeDistanceToTile(t,i);if(t._distance=o,i.fog.enabled&&_.fog(o,i.fog.density)>=1)return x.NONE;var a=t.data,u=i.cullingVolume,c=s(a.orientedBoundingBox,a.boundingSphere3D);i.mode!==W.SCENE3D&&(c=Q,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===W.MORPHING&&(c=e.union(a.boundingSphere3D,c,c)));var h=u.computeVisibility(c);if(h===g.OUTSIDE)return x.NONE;if(i.mode===W.SCENE3D){var d=a.occludeePointInScaledSpace;return l(d)?n.ellipsoid.isScaledSpacePointVisible(d)?h:x.NONE:h}return h};var J=new y,$=new n,ee=new r,te=new r,ie=new r,re=new r;H.prototype.showTileThisFrame=function(e,t){for(var i=0,r=e.data.imagery,n=0,o=r.length;o>n;++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},H.prototype.computeDistanceToTile=function(e,t){var i=e.data,r=i.tileBoundingBox;return r.distanceToCamera(t)},H.prototype.isDestroyed=function(){return!1},H.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),c(this)},H.prototype._onLayerAdded=function(e,t){if(e.show){var i=this._terrainProvider;this._quadtree.forEachLoadedTile(function(t){e._createTileImagerySkeletons(t,i)&&(t.state=G.LOADING)}),this._layerOrderChanged=!0}},H.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;a>o;++o){var s=i[o],u=s.loadingImagery;if(l(u)||(u=s.readyImagery),u.imageryLayer===e)-1===r&&(r=o),s.freeResources(),++n;else if(-1!==r)break}-1!==r&&i.splice(r,n)})},H.prototype._onLayerMoved=function(e,t,i){this._layerOrderChanged=!0},H.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 F({translucent:!1,flat:!0}),asynchronous:!1})}var i,n,o=new m({geometry:t.fromDimensions({dimensions:new r(2,2,2)})}),s=new m({geometry:new w({radius:1})}),u=new y;ne=function(t,r){return t===i?n:(ae(),i=t,u=y.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=y.fromTranslation(t.center,u),u=y.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 H}),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-1!==r?(this._layers.splice(r,1),this._update(),this.layerRemoved.raiseEvent(t,r),i&&t.destroy(),!0):!1},c.prototype.removeAll=function(t){t=e(t,!0);for(var i=this._layers,r=0,n=i.length;n>r;r++){var o=i[r];this.layerRemoved.raiseEvent(o,r),t&&o.destroy()}this._layers=[]},c.prototype.contains=function(e){return-1!==this.indexOf(e)},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=[],v=d.length-1;v>=0;--v){var g=d[v],_=g.readyImagery;if(t(_)){var y=_.imageryLayer.imageryProvider;if(t(y.pickFeatures)&&s.contains(_.rectangle,o)){var C=p,E=1/1024;if(C.west=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.x-E),C.east=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.z+E),C.south=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.y-E),C.north=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.w+E),s.contains(C,o)){var S=y.pickFeatures(_.x,_.y,_.level,o.longitude,o.latitude);t(S)&&(m.push(S),f.push(_.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.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;a>o;++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;a>o;++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._children=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}return o.createLevelZeroTiles=function(t){if(!e(t))throw new i("tilingScheme is required.");for(var r=t.getNumberOfXTilesAtLevel(0),n=t.getNumberOfYTilesAtLevel(0),a=new Array(r*n),s=0,l=0;n>l;++l)for(var u=0;r>u;++u)a[s++]=new o({tilingScheme:t,x:u,y:l,level:0});return a},o.prototype._updateCustomData=function(t,i,n){var o,a,s,l=this.customData;if(e(i)&&e(n)){for(o=0;o<n.length;++o){a=n[o];for(var u=0;u<l.length;++u)if(l[u]===a){l.splice(u,1);break}}for(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 c=this._parent;if(e(c)&&this._frameUpdated!==c._frameUpdated){l.length=0,s=this._rectangle;var h=c.customData;for(o=0;o<h.length;++o)a=h[o],r.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=c._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(){if(!e(this._children)){var t=this.tilingScheme,i=this.level+1,r=2*this.x,n=2*this.y;this._children=[new o({tilingScheme:t,x:r,y:n,level:i,parent:this}),new o({tilingScheme:t,x:r+1,y:n,level:i,parent:this}),new o({tilingScheme:t,x:r,y:n+1,level:i,parent:this}),new o({tilingScheme:t,x:r+1,y:n+1,level:i,parent:this})]}return this._children}},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(){if(this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,e(this.data)&&e(this.data.freeResources)&&(this.data.freeResources(),this.data=void 0),e(this._children)){for(var t=0,i=this._children.length;i>t;++t)this._children[t].freeResources();this._children=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,v,g){"use strict";function _(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._tileTraversalQueue=new u,this._tileLoadQueue=[],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=e._debug;if(!i.suspendLodUpdate){var n,o,a=e._tilesToRender;a.length=0;var s=e._tileTraversalQueue;if(s.clear(),i.maxDepth=0,i.tilesVisited=0,i.tilesCulled=0,i.tilesRendered=0,i.tilesWaitingForChildren=0,e._tileLoadQueue.length=0,e._tileReplacementQueue.markStartOfRenderFrame(),!r(e._levelZeroTiles)){if(!e._tileProvider.ready)return;var l=e._tileProvider.tilingScheme;e._levelZeroTiles=m.createLevelZeroTiles(l)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var u,c=e._tileProvider,h=e._occluders,p=e._levelZeroTiles,f=e._addHeightCallbacks,v=e._removeHeightCallbacks,g=t.frameNumber;if(f.length>0||v.length>0){for(n=0,o=p.length;o>n;++n)u=p[n],u._updateCustomData(g,f,v);f.length=0,v.length=0}for(n=0,o=p.length;o>n;++n)u=p[n],e._tileReplacementQueue.markTileRendered(u),u.needsLoading&&x(e,u),u.renderable&&c.computeTileVisibility(u,t,h)!==d.NONE?s.enqueue(u):(++i.tilesCulled,u.renderable||++i.tilesWaitingForChildren);for(;r(u=s.dequeue());)if(++i.tilesVisited,e._tileReplacementQueue.markTileRendered(u),u._updateCustomData(g),u.level>i.maxDepth&&(i.maxDepth=u.level),E(e,t,u)<e.maximumScreenSpaceError)w(e,u);else if(T(e,u)){var _=u.children;for(n=0,o=_.length;o>n;++n)c.computeTileVisibility(_[n],t,h)!==d.NONE?s.enqueue(_[n]):++i.tilesCulled}else w(e,u);C(e),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)}}function C(e){var t=e._tileLoadQueue.length;t!==e._lastTileLoadQueueLength&&(e._tileLoadProgressEvent.raiseEvent(t),e._lastTileLoadQueueLength=t)}function E(e,t,i){if(t.mode===v.SCENE2D)return S(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 S(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 w(e,t){e._tilesToRender.push(t),++e._debug.tilesRendered}function T(e,t){for(var i=!0,r=!0,n=t.children,o=0,a=n.length;a>o;++o){var s=n[o];e._tileReplacementQueue.markTileRendered(s),r=r&&s.upsampledFromParent,i=i&&s.renderable,s.needsLoading&&x(e,s)}return i||++e._debug.tilesWaitingForChildren,i&&!r}function x(e,t){e._tileLoadQueue.push(t)}function b(e,t){var i=e._tileLoadQueue,r=e._tileProvider;if(0!==i.length){t.passes.pick||e._tileReplacementQueue.trimTiles(e.tileCacheSize);for(var n=s(),o=e._loadQueueTimeSlice,a=n+o,l=i.length-1;l>=0;--l){var u=i[l];if(e._tileReplacementQueue.markTileRendered(u),r.loadTile(t,u),s()>=a)break}}}function A(i,n){for(var o=i._tileToUpdateHeights,a=i._tileProvider.terrainProvider,l=s(),u=i._updateHeightsTimeSlice,c=l+u,d=n.mode,p=n.mapProjection,m=p.ellipsoid;o.length>0;){var f=o[o.length-1];f!==i._lastTileUpdated&&(i._lastTileIndex=0);for(var g=f.customData,_=g.length,y=!1,C=i._lastTileIndex;_>C;++C){var E=g[C];if(f.level>E.level){r(E.position)||(E.position=m.cartographicToCartesian(E.positionCartographic)),d===v.SCENE3D?(e.clone(e.ZERO,M.origin),e.normalize(E.position,M.direction)):(t.clone(E.positionCartographic,D),D.height=-11500,p.project(D,R),e.fromElements(R.z,R.x,R.y,R),e.clone(R,M.origin),e.clone(e.UNIT_X,M.direction));var S=f.data.pick(M,d,p,!1,R);r(S)&&E.callback(S),E.level=f.level}else if(f.level===E.level){for(var w,T=f.children,x=T.length,b=0;x>b&&(w=T[b],!h.contains(w.rectangle,E.positionCartographic));++b);var A=a.getTileDataAvailable(w.x,w.y,w.level);(r(A)&&!A||r(parent)&&r(parent.data)&&r(parent.data.terrainData)&&!parent.data.terrainData.isChildAvailable(parent.x,parent.y,w.x,w.y))&&E.removeFunc()}if(s()>=c){y=!0;break}}if(y){i._lastTileUpdated=f,i._lastTileIndex=C;break}o.pop()}}function P(e,t){return e._distance-t._distance}function I(e,t){var i=e._tileProvider,r=e._tilesToRender,n=e._tileToUpdateHeights;r.sort(P);for(var o=0,a=r.length;a>o;++o){var s=r[o];i.showTileThisFrame(s,t),s._frameRendered!==t.frameNumber-1&&n.push(s),s._frameRendered=t.frameNumber}A(e,t)}n(_.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}}}),_.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;a>s;++s){var l=o[s];l.level=0,this._addHeightCallbacks.push(l)}t[i].freeResources()}this._levelZeroTiles=void 0},_.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;r(t);)t.state!==f.START&&e(t),t=t.replacementNext},_.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,i=0,r=t.length;r>i;++i)e(t[i])},_.prototype.updateHeight=function(e,t){var i=this,r={position:void 0,positionCartographic:e,level:-1,callback:t};return r.removeFunc=function(){i._removeHeightCallbacks.push(r)},i._addHeightCallbacks.push(r),r.removeFunc},_.prototype.update=function(e){var t=e.passes;t.render&&(this._tileProvider.beginUpdate(e),y(this,e),b(this,e),I(this,e),this._tileProvider.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&this._tileProvider.updateForPick(e)},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var M=new c,D=new t,R=new e;return _}),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/GeographicProjection","../Core/IntersectionTests","../Core/loadImage","../Core/Ray","../Core/Rectangle","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/GlobeFS","../Shaders/GlobeVS","../Shaders/GroundAtmosphere","../ThirdParty/when","./GlobeSurfaceShaderSet","./GlobeSurfaceTileProvider","./ImageryLayerCollection","./QuadtreePrimitive","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b){"use strict";function A(e){e=n(e,u.WGS84);var i=new c({ellipsoid:e}),r=new T;this._ellipsoid=e,this._imageryLayerCollection=r,this._surfaceShaderSet=new S,this._surfaceShaderSet.baseVertexShaderSource=new v({sources:[C,y]}),this._surfaceShaderSet.baseFragmentShaderSource=new v({sources:[_]}),this._surface=new x({tileProvider:new w({terrainProvider:i,imageryLayers:r,surfaceShaderSet:this._surfaceShaderSet})}),this.terrainProvider=i,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._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=.5}function P(t){return function(i,r){var n=e.distanceSquaredTo(i.pickBoundingSphere,t),o=e.distanceSquaredTo(r.pickBoundingSphere,t);return n-o}}a(A.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}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}}});var I=[],M={start:0,stop:0};A.prototype.pick=function(t,r,n){var a=r.mode,s=r.mapProjection,l=I;l.length=0;var u,c,h=this._surface._tilesToRender,p=h.length;for(c=0;p>c;++c){u=h[c];var m=u.data;if(o(m)){var f=m.pickBoundingSphere;a!==b.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 v=d.raySphere(t,f,M);o(v)&&l.push(m)}}l.sort(P(t.origin));var g;for(p=l.length,c=0;p>c&&(g=l[c].pick(t,r.mode,r.mapProjection,!0,n),!o(g));++c);return g};var D=new i,R=new i,O=new r,N=new m;return A.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(o(t)){var r,n,a=t.length;for(n=0;a>n&&(r=t[n],!f.contains(r.rectangle,e));++n);if(o(r)&&f.contains(r.rectangle,e)){for(;r.renderable;){var s=r.children;for(a=s.length,n=0;a>n&&(r=s[n],!f.contains(r.rectangle,e));++n);}for(;o(r)&&(!o(r.data)||!o(r.data.pickTerrain));)r=r.parent;if(o(r)){var l=this._surface._tileProvider.tilingScheme.ellipsoid,u=l.cartographicToCartesian(e,D),c=N;i.normalize(u,c.direction);var h=r.data.pick(c,void 0,void 0,!1,R);if(o(h))return l.cartesianToCartographic(h,O).height}}}},A.prototype.update=function(e){if(this.show){var t=e.context,i=t.drawingBufferWidth,r=t.drawingBufferHeight;if(0!==i&&0!==r){var n=this._surface,a=n.tileProvider,s=this.terrainProvider,l=this.showWaterEffect&&s.ready&&s.hasWaterMask;if(l&&this.oceanNormalMapUrl!==this._oceanNormalMapUrl){var u=this.oceanNormalMapUrl;if(this._oceanNormalMapUrl=u,o(u)){var c=this;E(p(u),function(e){u===c.oceanNormalMapUrl&&(c._oceanNormalMap=c._oceanNormalMap&&c._oceanNormalMap.destroy(),c._oceanNormalMap=new g({context:t,source:e}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}var h=e.mode,d=e.passes;d.render&&(h===b.SCENE3D?this._zoomedOutOceanSpecularIntensity=.5:this._zoomedOutOceanSpecularIntensity=0,n.maximumScreenSpaceError=this.maximumScreenSpaceError,n.tileCacheSize=this.tileCacheSize,a.terrainProvider=this.terrainProvider,a.lightingFadeOutDistance=this.lightingFadeOutDistance,a.lightingFadeInDistance=this.lightingFadeInDistance,a.zoomedOutOceanSpecularIntensity=this._zoomedOutOceanSpecularIntensity,a.hasWaterMask=l,a.oceanNormalMap=this._oceanNormalMap,a.enableLighting=this.enableLighting,n.update(e)),d.pick&&n.update(e)}}},A.prototype.isDestroyed=function(){return!1},A.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)},A}),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/defineProperties","../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,h){"use strict";function d(){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 p(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 m(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 f(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function v(e,t,i,r){e._colorTexture=new c({context:t,width:i,height:r,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE}),e._depthStencilTexture=new c({context:t,width:i,height:r,pixelFormat:o.DEPTH_STENCIL,pixelDatatype:l.UNSIGNED_INT_24_8}),e._globeDepthTexture=new c({context:t,width:i,height:r,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE})}function g(e,t,i,r){m(e),f(e),v(e,t,i,r),e.framebuffer=new s({context:t,colorTextures:[e._colorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._copyDepthFramebuffer=new s({context:t,colorTextures:[e._globeDepthTexture],destroyAttachments:!1})}function _(e,t,r,n){var o=e._colorTexture,a=!i(o)||o.width!==r||o.height!==n;(!i(e.framebuffer)||a)&&g(e,t,r,n)}function y(r,n,o,s){if(r._viewport.width=o,r._viewport.height=s,i(r._rs)&&e.equals(r._viewport,r._rs.viewport)||(r._rs=u.fromCache({viewport:r._viewport})),!i(r._copyDepthCommand)){var l="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(l,{uniformMap:{u_texture:function(){return r._depthStencilTexture}},owner:r})}r._copyDepthCommand.framebuffer=r._copyDepthFramebuffer,i(r._copyColorCommand)||(r._copyColorCommand=n.createViewportQuadCommand(h,{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 a({color:new t(0,0,0,0),stencil:0,owner:r})),r._clearColorCommand.framebuffer=r.framebuffer}return d.prototype.executeDebugGlobeDepth=function(e,t){p(this,e,t)},d.prototype.update=function(e){var t=e.drawingBufferWidth,i=e.drawingBufferHeight;_(this,e,t,i),y(this,e,t,i),e.uniformState.globeDepthTexture=void 0},d.prototype.executeCopyDepth=function(e,t){i(this._copyDepthCommand)&&(this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},d.prototype.executeCopyColor=function(e,t){i(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},d.prototype.clear=function(e,r,n){var o=this._clearColorCommand;i(o)&&(t.clone(n,o.color),o.execute(e,r))},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){m(this),f(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()),n(this)},d}),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(n){t=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var o,s=0;s<t.layers.length;s++)if(t.layers[s].id===_._channel){o=t.layers[s];break}var d;if(!i(o))throw d="Could not find layer with channel (id) of "+_._channel+".",v=c.handleError(v,_,_._errorEvent,d,void 0,void 0,void 0,f),new u(d);if(!i(o.version))throw d="Could not find a version in channel (id) "+_._channel+".",v=c.handleError(v,_,_._errorEvent,d,void 0,void 0,void 0,f),new u(d);if(_._version=o.version,i(t.projection)&&"flat"===t.projection)_._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 d="Unsupported projection "+t.projection+".",v=c.handleError(v,_,_._errorEvent,d,void 0,void 0,void 0,f),new u(d);_._tilingScheme=new h({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:r.ellipsoid})}_._imageUrlTemplate=_._imageUrlTemplate.replace("{request}",_._requestType).replace("{channel}",_._channel).replace("{version}",_._version),_._ready=!0,_._readyPromise.resolve(!0),c.handleSuccess(v)}function p(e){var t="An error occurred while accessing "+g+".";v=c.handleError(v,_,_._errorEvent,t,void 0,void 0,void 0,f),_._readyPromise.reject(new u(t))}function f(){var e=i(_._proxy)?_._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 v,g=this._url+this._path+"/query?request=Json&vars=geeServerDefs&is2d=t",_=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("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 vec4 color;\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();\ngl_Position = depthClampFarPlane(czm_modelViewProjectionRelativeToEye * position);\n}\n"}),i("Scene/StencilFunction",["../Core/freezeObject","../Renderer/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","../Renderer/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/Cartesian3","../Core/Cartographic","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryInstance","../Core/isArray","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/Rectangle","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Shaders/ShadowVolumeFS","../Shaders/ShadowVolumeVS","../ThirdParty/when","./BlendingState","./DepthFunction","./Pass","./PerInstanceColorAppearance","./Primitive","./SceneMode","./StencilFunction","./StencilOperation"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D){"use strict";function R(e){e=n(e,n.EMPTY_OBJECT),o(e.geometryInstance)&&s("GroundPrimitive.geometryInstance","GroundPrimitive.geometryInstance is deprecated in version 1.18 and will be removed in version 1.20. Please use GroundPrimitive.geometryInstances."),this.geometryInstance=e.geometryInstance,this.geometryInstances=e.geometryInstances,this.show=n(e.show,!0),this.debugShowBoundingVolume=n(e.debugShowBoundingVolume,!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={},this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._readyPromise=w.defer(),this._primitive=void 0;var t,i=new A({flat:!0});o(this.geometryInstances)&&h(this.geometryInstances)&&this.geometryInstances.length>1&&(t=G),this._primitiveOptions={geometryInstances:void 0,appearance:i,vertexCacheOptimize:n(e.vertexCacheOptimize,!1),interleave:n(e.interleave,!1),releaseGeometryInstances:n(e.releaseGeometryInstances,!0),allowPicking:n(e.allowPicking,!0),asynchronous:n(e.asynchronous,!0),compressVertices:n(e.compressVertices,!0),_readOnlyInstanceAttributes:t,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_createPickOffsets:!0}}function O(e,t){var i=t.maximumRadius,r=i/Math.cos(.5*e)-i;return R._maxHeight+r}function N(e,t){return R._minHeight}function L(i,r,n){for(var o=n.attributes.position3DHigh.values,a=n.attributes.position3DLow.values,s=o.length,l=r.mapProjection.ellipsoid,u=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,p=Number.NEGATIVE_INFINITY,m=0;s>m;m+=3){var v=t.unpack(o,m,Y),g=t.unpack(a,m,X),_=t.add(v,g,Z),y=l.cartesianToCartographic(_,K),C=y.latitude,E=y.longitude;u=Math.min(u,C),c=Math.min(c,E),h=Math.max(h,C),p=Math.max(p,E)}var S=Q;if(S.north=h,S.south=u,S.east=p,S.west=c,S.width<d.PI){var w=f.fromRectangle(S,R._maxHeight,R._minOBBHeight,l);i._boundingVolumes.push(w)}else i._boundingVolumes.push(e.fromEncodedCartesianVertices(o,a));if(!r.scene3DOnly){var T=r.mapProjection,x=e.fromRectangleWithHeights2D(S,T,R._maxHeight,R._minOBBHeight);t.fromElements(x.center.z,x.center.x,x.center.y,x.center),i._boundingVolumes2D.push(x)}}function F(e,t,i,r){o(e._rsStencilPreloadPass)||(e._rsStencilPreloadPass=_.fromCache(W),e._rsStencilDepthPass=_.fromCache(H),e._rsColorPass=_.fromCache(q),e._rsPickPass=_.fromCache(j))}function B(e,t,i){if(!o(e._sp)){var r=t.context,n=S;n=P._modifyShaderPosition(e,n,t.scene3DOnly),n=P._appendShowToShader(e._primitive,n);var a=E,s=e._primitive._attributeLocations;if(e._sp=y.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:n,fragmentShaderSource:a,attributeLocations:s}),e._primitive.allowPicking){var l=new C({sources:[a],pickColorQualifier:"varying"});e._spPick=y.replaceCache({context:r,shaderProgram:e._spPick,vertexShaderSource:C.createPickVertexShaderSource(n),fragmentShaderSource:l,attributeLocations:s})}else e._spPick=y.fromCache({context:r,vertexShaderSource:n,fragmentShaderSource:a,attributeLocations:s})}}function V(e,t){var i=e._primitive,r=3*i._va.length;t.length=r;for(var n=0,a=0;r>a;a+=3){var s=i._va[n++],l=t[a];o(l)||(l=t[a]=new g({owner:e,primitiveType:i._primitiveType})),l.vertexArray=s,l.renderState=e._rsStencilPreloadPass,l.shaderProgram=e._sp,l.uniformMap=e._uniformMap,l.pass=b.GROUND,l=t[a+1],o(l)||(l=t[a+1]=new g({owner:e,primitiveType:i._primitiveType})),l.vertexArray=s,l.renderState=e._rsStencilDepthPass,l.shaderProgram=e._sp,l.uniformMap=e._uniformMap,l.pass=b.GROUND,l=t[a+2],o(l)||(l=t[a+2]=new g({owner:e,primitiveType:i._primitiveType})),l.vertexArray=s,l.renderState=e._rsColorPass,l.shaderProgram=e._sp,l.uniformMap=e._uniformMap,l.pass=b.GROUND}}function k(e,t){var i=e._primitive,r=i._pickOffsets,n=3*r.length;t.length=n;for(var a=0,s=0;n>s;s+=3){var l=r[a++],u=l.offset,c=l.count,h=i._va[l.index],d=t[s];o(d)||(d=t[s]=new g({owner:e,primitiveType:i._primitiveType})),d.vertexArray=h,d.offset=u,d.count=c,d.renderState=e._rsStencilPreloadPass,d.shaderProgram=e._sp,d.uniformMap=e._uniformMap,d.pass=b.GROUND,d=t[s+1],o(d)||(d=t[s+1]=new g({owner:e,primitiveType:i._primitiveType})),d.vertexArray=h,d.offset=u,d.count=c,d.renderState=e._rsStencilDepthPass,d.shaderProgram=e._sp,d.uniformMap=e._uniformMap,d.pass=b.GROUND,d=t[s+2],o(d)||(d=t[s+2]=new g({owner:e,primitiveType:i._primitiveType})),d.vertexArray=h,d.offset=u,d.count=c,d.renderState=e._rsPickPass,d.shaderProgram=e._spPick,d.uniformMap=e._uniformMap,d.pass=b.GROUND}}function z(e,t,i,r,n,o,a){V(e,o),k(e,a)}function U(e,t,i,r,n,a,s,l){var u;t.mode===I.SCENE3D?u=e._boundingVolumes:t.mode!==I.SCENE3D&&o(e._boundingVolumes2D)&&(u=e._boundingVolumes2D);var c=t.commandList,h=t.passes;if(h.render)for(var d=i.length,p=0;d>p;++p)i[p].modelMatrix=n,i[p].boundingVolume=u[Math.floor(p/3)],i[p].cull=a,i[p].debugShowBoundingVolume=s,c.push(i[p]);if(h.pick){var m=e._primitive,f=m._pickOffsets,v=3*f.length;r.length=v;for(var g=0,_=0;v>_;_+=3){var y=f[g++],C=u[y.index];r[_].modelMatrix=n,r[_].boundingVolume=C,r[_].cull=a,r[_+1].modelMatrix=n,r[_+1].boundingVolume=C,r[_+1].cull=a,r[_+2].modelMatrix=n,r[_+2].boundingVolume=C,r[_+2].cull=a,c.push(r[_],r[_+1],r[_+2])}}}var G=["color"];a(R.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}}}),R.isSupported=function(e){return e.context.fragmentDepth},R._maxHeight=void 0,R._minHeight=void 0,R._minOBBHeight=void 0,R._maxTerrainHeight=9e3,R._minTerrainHeight=-1e5,R._minOBBTerrainHeight=-11500;var W={colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:M.ALWAYS,frontOperation:{fail:D.KEEP,zFail:D.DECREMENT_WRAP,zPass:D.DECREMENT_WRAP},backFunction:M.ALWAYS,backOperation:{fail:D.KEEP,zFail:D.INCREMENT_WRAP,zPass:D.INCREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1},H={colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:M.ALWAYS,frontOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.INCREMENT_WRAP},backFunction:M.ALWAYS,backOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!0,func:x.LESS_OR_EQUAL},depthMask:!1},q={stencilTest:{enabled:!0,frontFunction:M.NOT_EQUAL,frontOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.DECREMENT_WRAP},backFunction:M.NOT_EQUAL,backOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1,blending:T.ALPHA_BLEND},j={stencilTest:{enabled:!0,frontFunction:M.NOT_EQUAL,frontOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.DECREMENT_WRAP},backFunction:M.NOT_EQUAL,backOperation:{fail:D.KEEP,zFail:D.KEEP,zPass:D.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1},Y=new t,X=new t,Z=new t,K=new i,Q=new v;return R.prototype.update=function(e){var t=e.context;if(t.fragmentDepth&&this.show&&(o(this._primitive)||o(this.geometryInstance)||o(this.geometryInstances))){if(!o(R._maxHeight)){var i=e.terrainExaggeration;R._maxHeight=R._maxTerrainHeight*i,R._minHeight=R._minTerrainHeight*i,R._minOBBHeight=R._minOBBTerrainHeight*i}if(!o(this._primitive)){var r,n,a,s=this._primitiveOptions;if(o(this.geometryInstance))r=this.geometryInstance,n=r.geometry,a=n.constructor,o(a)&&o(a.createShadowVolume)&&(r=new c({geometry:a.createShadowVolume(n,N,O),attributes:r.attributes,id:r.id,pickPrimitive:this})),s.geometryInstances=r;else{for(var l=h(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],u=l.length,d=new Array(u),p=0;u>p;++p)if(r=l[p],n=r.geometry,a=n.constructor,o(a)&&o(a.createShadowVolume)){var m=r.attributes;d[p]=new c({geometry:a.createShadowVolume(n,N,O),attributes:m,id:r.id,pickPrimitive:this})}s.geometryInstances=d}var f=this;s._createBoundingVolumeFunction=function(e,t){L(f,e,t)},s._createRenderStatesFunction=function(e,t,i,r){F(f,t)},s._createShaderProgramFunction=function(e,t,i){B(f,t)},s._createCommandsFunction=function(e,t,i,r,n,o,a){z(f,void 0,void 0,!0,!1,o,a)},s._updateAndQueueCommandsFunction=function(e,t,i,r,n,o,a,s){U(f,t,i,r,n,o,a,s)},this._primitive=new P(s),this._primitive.readyPromise.then(function(e){f._ready=!0,f.releaseGeometryInstances&&(f.geometryInstance=void 0,f.geometryInstances=void 0);var t=e._error;o(t)?f._readyPromise.reject(t):f._readyPromise.resolve(f)})}this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e)}},R.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},R.prototype.isDestroyed=function(){return!1},R.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(), +l(this)},R}),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,"//api.mapbox.com/v4/");this._url=s,this._mapId=n,this._accessToken=o.getAccessToken(r.accessToken);var h=t(r.format,"png");this._format=h.replace(".","");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,i){return c},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,v=new l,g=new t,_=[];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,v);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=_,_.length=0,t.update(e),e.commandList=a,1===_.length?_[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","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/WebGLConstants","../Shaders/AdjustTranslucentFS","../Shaders/CompositeOITFS","./BlendEquation","./BlendFunction"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v){"use strict";function g(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 o({color:new t(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new o({color:new t(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new o({color:new t(0,0,0,0),owner:this}),this._alphaClearCommand=new o({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 _(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function y(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 C(e){_(e),y(e)}function E(e,t,i,r){_(e),e._accumulationTexture=new h({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.FLOAT}),e._revealageTexture=new h({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.FLOAT})}function S(e,t){y(e);var i=d.FRAMEBUFFER_COMPLETE,r=!0;if(e._translucentMRTSupport&&(e._translucentFBO=new a({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new a({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1}),(e._translucentFBO.status!==i||e._adjustTranslucentFBO.status!==i)&&(y(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO=new a({context:t,colorTextures:[e._accumulationTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._alphaFBO=new a({context:t,colorTextures:[e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new a({context:t,colorTextures:[e._accumulationTexture],destroyAttachments:!1}),e._adjustAlphaFBO=new a({context:t,colorTextures:[e._revealageTexture],destroyAttachments:!1});var n=e._translucentFBO.status===i,o=e._alphaFBO.status===i,s=e._adjustTranslucentFBO.status===i,l=e._adjustAlphaFBO.status===i;n&&o&&s&&l||(C(e),e._translucentMultipassSupport=!1,r=!1)}return r}function w(e,t,r,n){var o=r[n.id];if(!i(o)){var a=l.getState(n);a.depthMask=!1,a.blending=t,o=l.fromCache(a),r[n.id]=o}return o}function T(e,t,i){return w(t,O,e._translucentRenderStateCache,i)}function x(e,t,i){return w(t,N,e._translucentRenderStateCache,i)}function b(e,t,i){return w(t,L,e._alphaRenderStateCache,i)}function A(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=c.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,(-1!==n.indexOf("gl_FragData")?"#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=u.fromCache({context:e,vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:l,attributeLocations:s}),r[o]=a}return a}function P(e,t,i){return A(t,i,e._translucentShaderCache,F)}function I(e,t,i){return A(t,i,e._translucentShaderCache,B)}function M(e,t,i){return A(t,i,e._alphaShaderCache,V)}function D(e,t,r,n,o){var a,s,l,u,c=t.context,h=n.framebuffer,d=o.length;n.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(c,n),n.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(c,n);var p=e._opaqueFBO;for(n.framebuffer=e._translucentFBO,u=0;d>u;++u)a=o[u],i(a.oit)&&a.shaderProgram.id===a.oit.shaderProgramId||(a.oit={colorRenderState:x(e,c,a.renderState),alphaRenderState:b(e,c,a.renderState),colorShaderProgram:I(e,c,a.shaderProgram),alphaShaderProgram:M(e,c,a.shaderProgram),shaderProgramId:a.shaderProgram.id}),s=a.oit.colorRenderState,l=a.oit.colorShaderProgram,r(a,t,c,n,s,l,p);for(n.framebuffer=e._alphaFBO,u=0;d>u;++u)a=o[u],s=a.oit.alphaRenderState,l=a.oit.alphaShaderProgram,r(a,t,c,n,s,l,p);n.framebuffer=h}function R(e,t,r,n,o){var a=t.context,s=n.framebuffer,l=o.length;n.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(a,n);var u=e._opaqueFBO;n.framebuffer=e._translucentFBO;for(var c=0;l>c;++c){var h=o[c];i(h.oit)&&h.shaderProgram.id===h.oit.shaderProgramId||(h.oit={translucentRenderState:T(e,a,h.renderState),translucentShaderProgram:P(e,a,h.shaderProgram),shaderProgramId:h.shaderProgram.id});var d=h.oit.translucentRenderState,p=h.oit.translucentShaderProgram;r(h,t,a,n,d,p,u)}n.framebuffer=s}g.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&&E(this,t,n,o),i(this._translucentFBO)&&!s||S(this,t)){var u,h,d=this;i(this._compositeCommand)||(u=new c({sources:[m]}),this._translucentMRTSupport&&u.defines.push("MRT"),h={u_opaque:function(){return d._opaqueTexture},u_accumulation:function(){return d._accumulationTexture},u_revealage:function(){return d._revealageTexture}},this._compositeCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this})),i(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(u=new c({defines:["MRT"],sources:[p]}),h={u_bgColor:function(){return d._translucentMRTClearCommand.color},u_depthTexture:function(){return d._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this})):this._translucentMultipassSupport&&(u=new c({sources:[p]}),h={u_bgColor:function(){return d._translucentMultipassClearCommand.color},u_depthTexture:function(){return d._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this}),h={u_bgColor:function(){return d._alphaClearCommand.color},u_depthTexture:function(){return d._depthStencilTexture}},this._adjustAlphaCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this}))),this._viewport.width=n,this._viewport.height=o,i(this._rs)&&e.equals(this._viewport,this._rs.viewport)||(this._rs=l.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 O={enabled:!0,color:new t(0,0,0,0),equationRgb:f.ADD,equationAlpha:f.ADD,functionSourceRgb:v.ONE,functionDestinationRgb:v.ONE,functionSourceAlpha:v.ZERO,functionDestinationAlpha:v.ONE_MINUS_SOURCE_ALPHA},N={enabled:!0,color:new t(0,0,0,0),equationRgb:f.ADD,equationAlpha:f.ADD,functionSourceRgb:v.ONE,functionDestinationRgb:v.ONE,functionSourceAlpha:v.ONE,functionDestinationAlpha:v.ONE},L={enabled:!0,color:new t(0,0,0,0),equationRgb:f.ADD,equationAlpha:f.ADD,functionSourceRgb:v.ZERO,functionDestinationRgb:v.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:v.ZERO,functionDestinationAlpha:v.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",B=" 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",V=" float ai = czm_gl_FragColor.a;\n gl_FragColor = vec4(ai);\n";return g.prototype.executeCommands=function(e,t,i,r){return this._translucentMRTSupport?void R(this,e,t,i,r):void D(this,e,t,i,r)},g.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},g.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},g.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){C(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)},g}),i("Scene/OpenStreetMapImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/Event","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(i){n("OpenStreetMapImageryProvider","OpenStreetMapImageryProvider is deprecated. It will be removed in Cesium 1.18. Use createOpenStreetMapImageryProvider instead."),i=t(i,{});var r=t(i.url,"//a.tile.openstreetmap.org/");p.test(r)||(r+="/"),this._url=r,this._fileExtension=t(i.fileExtension,"png"),this._proxy=i.proxy,this._tileDiscardPolicy=i.tileDiscardPolicy,this._tilingScheme=new l({ellipsoid:i.ellipsoid}),this._tileWidth=256,this._tileHeight=256,this._minimumLevel=t(i.minimumLevel,0),this._maximumLevel=i.maximumLevel,this._rectangle=t(i.rectangle,this._tilingScheme.rectangle);var c=this._tilingScheme.positionToTileXY(s.southwest(this._rectangle),this._minimumLevel),h=this._tilingScheme.positionToTileXY(s.northeast(this._rectangle),this._minimumLevel),d=(Math.abs(h.x-c.x)+1)*(Math.abs(h.y-c.y)+1);if(d>4)throw new o("The imagery provider's rectangle and minimumLevel indicate that there are "+d+" tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.");this._errorEvent=new a,this._ready=!0,this._readyPromise=u.resolve(!0);var f=t(i.credit,m);"string"==typeof f&&(f=new e(f)),this._credit=f}function d(e,t,r,n){var o=e._url+n+"/"+t+"/"+r+"."+e._fileExtension,a=e._proxy;return i(a)&&(o=a.getURL(o)),o}var p=/\/$/,m=new e("MapQuest, Open Street Map and contributors, CC-BY-SA");return r(h.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}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),h.prototype.getTileCredits=function(e,t,i){},h.prototype.requestImage=function(e,t,i){var r=d(this,e,t,i);return c.loadImage(this,r)},h.prototype.pickFeatures=function(){},h}),i("Scene/OrthographicFrustum",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,i,r,n,o,a,s){"use strict";function l(){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 s,this._orthographicMatrix=new a}function u(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=a.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}n(l.prototype,{projectionMatrix:{get:function(){return u(this),this._orthographicMatrix}}});var c=new t,h=new t,d=new t,p=new t;return l.prototype.computeCullingVolume=function(e,n,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,u=this.right,m=this.left,f=this.near,v=this.far,g=t.cross(n,o,c),_=h;t.multiplyByScalar(n,f,_),t.add(e,_,_);var y=d;t.multiplyByScalar(g,m,y),t.add(_,y,y);var C=a[0];return r(C)||(C=a[0]=new i),C.x=g.x,C.y=g.y,C.z=g.z,C.w=-t.dot(g,y),t.multiplyByScalar(g,u,y),t.add(_,y,y),C=a[1],r(C)||(C=a[1]=new i),C.x=-g.x,C.y=-g.y,C.z=-g.z,C.w=-t.dot(t.negate(g,p),y),t.multiplyByScalar(o,l,y),t.add(_,y,y),C=a[2],r(C)||(C=a[2]=new i),C.x=o.x,C.y=o.y,C.z=o.z,C.w=-t.dot(o,y),t.multiplyByScalar(o,s,y),t.add(_,y,y),C=a[3],r(C)||(C=a[3]=new i),C.x=-o.x,C.y=-o.y,C.z=-o.z,C.w=-t.dot(t.negate(o,p),y),C=a[4],r(C)||(C=a[4]=new i),C.x=n.x,C.y=n.y,C.z=n.z,C.w=-t.dot(n,_),t.multiplyByScalar(n,v,y),t.add(e,y,y),C=a[5],r(C)||(C=a[5]=new i),C.x=-n.x,C.y=-n.y,C.z=-n.z,C.w=-t.dot(t.negate(n,p),y),this._cullingVolume},l.prototype.getPixelDimensions=function(e,t,i,r){u(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},l.prototype.clone=function(e){return r(e)||(e=new l),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},l.prototype.equals=function(e){return r(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},l}),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/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/getTimestamp","../Widgets/getElement"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT);var r=a(e.container);if(!i(r))throw new n("container is required");this._container=r;var o=document.createElement("div");o.className="cesium-performanceDisplay";var s=document.createElement("div");s.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),s.appendChild(this._fpsText);var l=document.createElement("div");l.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),l.appendChild(this._msText),o.appendChild(l),o.appendChild(s),this._container.appendChild(o),this._lastFpsSampleTime=void 0,this._frameCount=0,this._time=void 0,this._fps=0,this._frameTime=0}return s.prototype.update=function(){if(!i(this._time))return this._lastFpsSampleTime=o(),void(this._time=o());var e=this._time,t=o();this._time=t;var r=t-e;this._frameCount++;var n=this._fps,a=t-this._lastFpsSampleTime;a>1e3&&(n=1e3*this._frameCount/a|0,this._lastFpsSampleTime=t,this._frameCount=0),n!==this._fps&&(this._fpsText.nodeValue=n+" FPS",this._fps=n),r!==this._frameTime&&(this._msText.nodeValue=r.toFixed(2)+" MS",this._frameTime=r)},s.prototype.destroy=function(){return r(this)},s}),i("Scene/PickDepth",["../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/PixelFormat","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(){this.framebuffer=void 0,this._depthTexture=void 0,this._textureToCopy=void 0,this._copyDepthCommand=void 0,this._debugPickDepthViewportCommand=void 0}function c(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 h(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function d(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy()}function p(e,t,i,n){e._depthTexture=new s({context:t,width:i,height:n,pixelFormat:r.RGBA,pixelDatatype:o.UNSIGNED_BYTE})}function m(e,t,i,r){h(e),d(e),p(e,t,i,r),e.framebuffer=new n({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function f(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)&&m(t,i,n,o)}function v(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:a.fromCache(),uniformMap:{u_texture:function(){return t._textureToCopy}},owner:t})}t._textureToCopy=r,t._copyDepthCommand.framebuffer=t.framebuffer}return u.prototype.executeDebugPickDepth=function(e,t){c(this,e,t)},u.prototype.update=function(e,t){f(this,e,t),v(this,e,t)},u.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return h(this),d(this),this._copyDepthCommand.shaderProgram=e(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy(),i(this)},u}),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;\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/clone","../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,u){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT),this._vertexShaderSource=r(e.vertexShaderSource,l),this._fragmentShaderSource=r(e.fragmentShaderSource,s),this._renderState=u.getDefaultRenderState(!1,!1,e.renderState),this._pointSize=r(e.pointSize,2),this._highlightColor=n(e.highlightColor)?e.highlightColor:new t,this.material=void 0,this.translucent=r(e.translucent,!1),this.uniforms={highlightColor:this._highlightColor,pointSize:this._pointSize};var o=e.uniforms;this.uniforms=i(this.uniforms,o,!0)}return o(c.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 c.VERTEX_FORMAT}},pixelSize:{get:function(){return this._pointSize}}}),c.VERTEX_FORMAT=a.POSITION_AND_COLOR,c.prototype.getFragmentShaderSource=u.prototype.getFragmentShaderSource,c.prototype.isTranslucent=u.prototype.isTranslucent,c.prototype.getRenderState=u.prototype.getRenderState,c}),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(-1!==t)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;t>i;++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/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/EasingFunction","../Core/Ellipsoid","../Core/Math","../Core/Matrix4","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","./Camera","./OrthographicFrustum","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(i,r){this._scene=i,r=t(r,a.WGS84);var n=r.maximumRadius,o=new e(0,0,2*n),u=new e;u=e.normalize(e.negate(o,u),u);var c=e.clone(e.UNIT_Y),m=l.multiplyByPoint(h.TRANSFORM_2D,o,new e),f=l.multiplyByPointAsVector(h.TRANSFORM_2D,u,new e),v=l.multiplyByPointAsVector(h.TRANSFORM_2D,c,new e),g=new d;g.right=n*Math.PI,g.left=-g.right,g.top=g.right*(i.drawingBufferHeight/i.drawingBufferWidth),g.bottom=-g.top,this._camera2D={position:o,direction:u,up:c,position2D:m,direction2D:f,up2D:v,frustum:g},o=new e(0,-1,1),o=e.multiplyByScalar(e.normalize(o,o),5*n,o),u=new e,u=e.normalize(e.subtract(e.ZERO,o,u),u);var _=new e;_=e.normalize(e.cross(u,e.UNIT_Z,_),_),c=new e,c=e.normalize(e.cross(_,u,c),c),m=l.multiplyByPoint(h.TRANSFORM_2D,o,new e),f=l.multiplyByPointAsVector(h.TRANSFORM_2D,u,new e);var y=l.multiplyByPointAsVector(h.TRANSFORM_2D,_,new e);v=new e,v=e.normalize(e.cross(y,f,v),v),g=new p,g.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,g.fov=s.toRadians(60),this._cameraCV={position:o,direction:u,up:c,position2D:m,direction2D:f,up2D:v,frustum:g},o=new e,o=e.multiplyByScalar(e.normalize(new e(0,-2,1),o),2*n,o),u=new e,u=e.normalize(e.subtract(e.ZERO,o,u),u),_=new e,_=e.normalize(e.cross(u,e.UNIT_Z,_),_),c=new e,c=e.normalize(e.cross(_,u,c),c),this._camera3D={position:o,direction:u,up:c,frustum:g},this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0}function v(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 g(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 _(t,i,r,n){function a(t){u.position=C(c,p,t.time),u.direction=C(h,m,t.time),u.up=C(d,f,t.time),u.right=e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}var s=t._scene,u=s.camera;u._setTransform(l.IDENTITY);var c=u.position,h=u.direction,d=u.up,p=e.clone(t._camera2D.position),m=e.clone(t._camera2D.direction),f=e.clone(t._camera2D.up),v=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a});t._currentTweens.push(v),A(t,s,0,1,i,n)}function y(e,t,i,r){t*=.5;var n=e._scene.camera;n._setTransform(l.IDENTITY),T(e,t,i,function(){n.frustum=e._cameraCV.frustum.clone(),_(e,t,i,r)})}function C(t,i,r){return e.lerp(t,i,r,new e)}function E(t,i,r){function n(t){l.frustum.fov=s.lerp(c,h,t.time);var i=d/Math.tan(.5*l.frustum.fov),r=new e;l.position=e.multiplyByScalar(e.normalize(l.position,r),i,r)}var a=t._scene,l=a.camera,u=l.position,c=l.frustum.fov,h=.5*s.RADIANS_PER_DEGREE,d=e.magnitude(u)*Math.tan(.5*c);l.frustum.far=d/Math.tan(.5*h)+1e7;var p=a.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){l.frustum=t._camera2D.frustum.clone(),r(t)}});t._currentTweens.push(p)}function S(t,i,r,n){function a(t){u.position=C(h,g,t.time),u.direction=C(d,_,t.time),u.up=C(p,y,t.time),u.right=e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}var s=t._scene,u=s.camera;u._setTransform(l.IDENTITY);var c=r.maximumRadius,h=e.clone(u.position),d=e.clone(u.direction),p=e.clone(u.up),m=Math.tan(.5*t._cameraCV.frustum.fovy),f=t._cameraCV.frustum.aspectRatio*m,v=c*Math.PI/f,g=new e;g=e.multiplyByScalar(e.normalize(t._camera2D.position,g),v,g);var _=e.clone(t._camera2D.direction),y=e.clone(t._camera2D.up);i*=.5;var S=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){E(t,i,n)}});t._currentTweens.push(S)}function w(t,i,r,n){function o(){E(t,i,n)}i*=.5;var a=r.maximumRadius,s=Math.tan(.5*t._camera3D.frustum.fovy),l=t._camera3D.frustum.aspectRatio*s,u=a*Math.PI/l,c={},h=new e;c.position2D=e.multiplyByScalar(e.normalize(t._camera2D.position2D,h),u,h),c.direction2D=e.clone(t._camera2D.direction2D),c.up2D=e.clone(t._camera2D.up2D),b(t,i,c,o)}function T(t,i,r,n){function a(e){u.position=C(S,m,e.time),u.frustum.top=s.lerp(f,y.top,e.time),u.frustum.bottom=s.lerp(v,y.bottom,e.time),u.frustum.right=s.lerp(g,y.right,e.time),u.frustum.left=s.lerp(_,y.left,e.time)}var l=t._scene,u=l.camera,c=r.maximumRadius,h=Math.tan(.5*t._cameraCV.frustum.fovy),d=t._cameraCV.frustum.aspectRatio*h,p=c*Math.PI/d,m=new e;m=e.multiplyByScalar(e.normalize(t._camera2D.position,m),p,m);var f=u.frustum.top,v=u.frustum.bottom,g=u.frustum.right,_=u.frustum.left,y=t._camera2D.frustum,E=t._cameraCV.frustum,S=e.clone(u.position),w=(g-_)/(2*c*Math.PI),T=1;w>T&&(w=0);var x=(T-w)*i;if(x<s.EPSILON6){if(e.equalsEpsilon(S,m,s.EPSILON6))return u.position=m,u.frustum=E.clone(),void n(t);x=i,w=0,T=1}var b=l.tweens.add({easingFunction:o.QUARTIC_OUT,duration:x,startObject:{time:w},stopObject:{time:T},update:a,complete:function(){u.frustum=E.clone(),n(t)}});t._currentTweens.push(b)}function x(t,i,r,n){function a(){function r(t){u.position=C(a,h,t.time),u.direction=C(l,d,t.time),u.up=C(c,p,t.time),u.right=e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}var a=e.clone(u.position),l=e.clone(u.direction),c=e.clone(u.up),h=e.clone(t._cameraCV.position),d=e.clone(t._cameraCV.direction),p=e.clone(t._cameraCV.up),m=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:r,complete:function(){n(t)}});t._currentTweens.push(m)}var s=t._scene,u=s.camera;u._setTransform(l.IDENTITY),i*=.5,T(t,i,r,a)}function b(t,i,r,n){function a(t){u.position=C(c,p,t.time),u.direction=C(h,m,t.time),u.up=C(d,f,t.time),u.right=e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}var s=t._scene,u=s.camera;u._setTransform(l.IDENTITY);var c=e.clone(u.position),h=e.clone(u.direction),d=e.clone(u.up),p=e.clone(r.position2D),m=e.clone(r.direction2D),f=e.clone(r.up2D),v=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){u.position=p,u.direction=m,u.up=f,u.right=e.cross(m,f,u.right),e.normalize(u.right,u.right)}});t._currentTweens.push(v),A(t,s,1,0,i,n)}function A(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 P(e){var t=e._scene,i=t.drawingBufferHeight/t.drawingBufferWidth,r=e._camera2D.frustum;r.top=r.right*i,r.bottom=-r.top,i=1/i,r=e._cameraCV.frustum,r.aspectRatio=i,r=e._camera3D.frustum,r.aspectRatio=i;var n=t.camera;switch(t.mode){case m.SCENE3D:n.frustum=e._camera3D.frustum.clone();break;case m.COLUMBUS_VIEW:n.frustum=e._cameraCV.frustum.clone();break;case m.SCENE2D:n.frustum=e._camera2D.frustum.clone()}}function I(t){var r=t._scene;if(r._mode=m.SCENE3D,r.morphTime=m.getMorphTime(m.SCENE3D),g(t),P(t),t._previousMode!==m.MORPHING||t._morphCancelled){t._morphCancelled=!1;var n=r.camera;n.position=e.clone(t._camera3D.position),n.direction=e.clone(t._camera3D.direction),n.up=e.clone(t._camera3D.up),n.right=e.cross(n.direction,n.up,n.right),e.normalize(n.right,n.right)}var o=i(t._completeMorph);t._completeMorph=void 0,r.camera.update(r.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,m.SCENE3D,o)}function M(t){var r=t._scene;r._mode=m.SCENE2D,r.morphTime=m.getMorphTime(m.SCENE2D),g(t),P(t);var n=r.camera;e.clone(t._camera2D.position,n.position),e.clone(t._camera2D.direction,n.direction),e.clone(t._camera2D.up,n.up),e.cross(n.direction,n.up,n.right),e.normalize(n.right,n.right);var o=i(t._completeMorph);t._completeMorph=void 0,r.camera.update(r.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,m.SCENE2D,o)}function D(t){var r=t._scene;if(r._mode=m.COLUMBUS_VIEW,r.morphTime=m.getMorphTime(m.COLUMBUS_VIEW),g(t),P(t),t._previousModeMode!==m.MORPHING||t._morphCancelled){t._morphCancelled=!1;var n=r.camera;e.clone(t._cameraCV.position,n.position),e.clone(t._cameraCV.direction,n.direction),e.clone(t._cameraCV.up,n.up),e.cross(n.direction,n.up,n.right),e.normalize(n.right,n.right)}var o=i(t._completeMorph);t._completeMorph=void 0,r.camera.update(r.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,m.COLUMBUS_VIEW,o)}return f.prototype.completeMorph=function(){i(this._completeMorph)&&this._completeMorph()},f.prototype.morphTo2D=function(e,t){i(this._completeMorph)&&this._completeMorph();var r=this._scene;this._previousMode=r.mode,this._previousMode!==m.SCENE2D&&this._previousMode!==m.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,m.SCENE2D,!0),P(this),r._mode=m.MORPHING,v(this,M),this._previousMode===m.COLUMBUS_VIEW?S(this,e,t,M):w(this,e,t,M),0===e&&i(this._completeMorph)&&this._completeMorph())},f.prototype.morphToColumbusView=function(e,t){i(this._completeMorph)&&this._completeMorph();var r=this._scene;this._previousMode=r.mode,this._previousMode!==m.COLUMBUS_VIEW&&this._previousMode!==m.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,m.COLUMBUS_VIEW,!0),P(this),r._mode=m.MORPHING,v(this,D),this._previousMode===m.SCENE2D?x(this,e,t,D):b(this,e,this._cameraCV,D),0===e&&i(this._completeMorph)&&this._completeMorph())},f.prototype.morphTo3D=function(e,t){i(this._completeMorph)&&this._completeMorph();var r=this._scene;this._previousMode=r.mode,this._previousMode!==m.SCENE3D&&this._previousMode!==m.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,m.SCENE3D,!0),P(this),r._mode=m.MORPHING,v(this,I),this._previousMode===m.SCENE2D?y(this,e,t,I):_(this,e,t,I),0===e&&i(this._completeMorph)&&this._completeMorph())},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return g(this),r(this)},f}),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;t>i;++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-1!==t?(e.tweenjs.stop(),i(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1},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)&&-1!==this._tweens.indexOf(e)},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","./SceneMode","./SceneTransforms","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w){"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 w,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,this._zoomWorldPosition=new t,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(0>e)return 0;var i=25*(1-t);return Math.exp(-i*e)}function b(t){return e.equalsEpsilon(t.startPosition,t.endPosition,d.EPSILON14)}function A(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 v=t.getLastMovement(i,r);if(!o(v)||b(v))return;u.motion.x=.5*(v.endPosition.x-v.startPosition.x),u.motion.y=.5*(v.endPosition.y-v.startPosition.y),u.startPosition=e.clone(v.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 P(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;l>u;++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):1>n&&A(s,d,p,n,r,e,a))}}}function I(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,v=f/i._scene.canvas.clientHeight;v=Math.min(v,i.maximumMovementRatio);var g=m*v;if(!(g>0&&Math.abs(s-c)<1||0>g&&Math.abs(s-h)<1)){c>s-g?g=s-c-1:s-g>h&&(g=s-h);var _,y=i._scene,C=y.camera,w=y.mode;if(o(i._globe)&&(_=w!==E.SCENE2D?L(i,r,ie):C.getPickRay(r,te).origin),!o(_))return void C.zoomIn(g);var T=e.equals(r,i._zoomMouseStart),x=i._zoomingOnVector,b=i._rotatingZoom;T||(i._zoomMouseStart=e.clone(r,i._zoomMouseStart),i._zoomWorldPosition=t.clone(_,i._zoomWorldPosition),x=i._zoomingOnVector=!1,b=i._rotatingZoom=!1);var A=w===E.COLUMBUS_VIEW;if(!T||b){if(w===E.SCENE2D){var P=i._zoomWorldPosition,I=C.position;if(!t.equals(P,I)){var M=t.subtract(P,I,ne);t.normalize(M,M);var D=t.distance(P,I)*g/(.5*C.getMagnitude());C.move(M,.5*D)}}else if(w===E.SCENE3D){var R=t.normalize(C.position,ce);if(C.positionCartographic.height<3e3&&Math.abs(t.dot(C.direction,R))<.6)A=!0;else{var O=y.canvas,N=oe;N.x=O.clientWidth/2,N.y=O.clientHeight/2;var F=L(i,N,ae);if(o(F)){var B=t.normalize(F,se),V=t.normalize(i._zoomWorldPosition,le),k=t.dot(V,B);if(k>0){var z=d.acosClamped(k),U=t.cross(V,B,ue),G=Math.abs(z)>d.toRadians(20)?.75*C.positionCartographic.height:C.positionCartographic.height-g,W=g/G;C.rotate(U,z*W)}}else A=!0}}i._rotatingZoom=!A}if(!T&&A||x){var H,q=S.wgs84ToWindowCoordinates(y,i._zoomWorldPosition,re);H=w!==E.COLUMBUS_VIEW&&e.equals(r,i._zoomMouseStart)&&o(q)?C.getPickRay(q,te):C.getPickRay(r,te);var j=H.direction;w===E.COLUMBUS_VIEW&&t.fromElements(j.y,j.z,j.x,j),C.move(j,g),i._zoomingOnVector=!0}else C.zoomIn(g)}}function M(e,i,r){var n=e._scene,o=n.camera,a=o.getPickRay(r.startPosition,he).origin,s=o.getPickRay(r.endPosition,de).origin,l=t.subtract(a,s,pe),u=t.magnitude(l);u>0&&(t.normalize(l,l),o.move(l,u))}function D(e,t,i){o(i.distance)&&(i=i.distance);var r=e._scene,n=r.camera;I(e,t,i,e._zoomFactor,n.getMagnitude())}function R(t,i,r){if(o(r.angleAndHeight))return void O(t,i,r.angleAndHeight);var n=t._scene,a=n.camera,s=n.canvas,l=s.clientWidth,u=s.clientHeight,c=me;c.x=2/l*r.startPosition.x-1,c.y=2/u*(u-r.startPosition.y)-1,c=e.normalize(c,c);var h=fe;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 O(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 N(e){var t=e._tweens;e._aggregator.anyButtonDown&&t.removeAll();var i=e._scene,r=i.camera;if(t.contains(e._tween)||(m.equals(m.IDENTITY,r.transform)?(P(e,e.enableTranslate,e.translateEventTypes,M,e.inertiaTranslate,"_lastInertiaTranslateMovement"),P(e,e.enableZoom,e.zoomEventTypes,D,e.inertiaZoom,"_lastInertiaZoomMovement"),P(e,e.enableRotate,e.tiltEventTypes,R,e.inertiaSpin,"_lastInertiaTiltMovement")):(P(e,e.enableRotate,e.translateEventTypes,R,e.inertiaSpin,"_lastInertiaSpinMovement"),P(e,e.enableZoom,e.zoomEventTypes,D,e.inertiaZoom,"_lastInertiaZoomMovement"))),!(e._aggregator.anyButtonDown||o(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||o(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||t.contains(e._tween))){var n=r.createCorrectPositionTween(e.bounceAnimationTime);o(n)&&(e._tween=t.add(n))}t.update()}function L(e,i,r){var n=e._scene,a=e._globe,s=n.camera;if(o(a)){var l;n.pickPositionSupported&&(l=n.pickPosition(i,ge));var u=s.getPickRay(i,ve),c=a.pick(u,n,_e),h=o(l)?t.distance(l,s.positionWC):Number.POSITIVE_INFINITY,d=o(c)?t.distance(c,s.positionWC):Number.POSITIVE_INFINITY;return d>h?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 K(i,r,n);if(i._strafing)return void G(i,r,n);var a,s=i._scene,l=s.camera,c=e.clone(n.startPosition,be),h=e.clone(n.endPosition,Ae),p=l.getPickRay(c,ye),m=t.clone(t.ZERO,Te),v=t.UNIT_X;if(l.position.z<i._minimumPickingTerrainHeight&&(a=L(i,c,Ee),o(a)&&(m.x=a.x)),m.x>l.position.z&&o(a))return t.clone(a,i._strafeStartPosition),i._strafing=!0,G(i,r,n),void(i._strafeMousePosition=e.clone(r,i._strafeMousePosition));var g=f.fromPointNormal(m,v,xe);p=l.getPickRay(c,ye);var _=u.rayPlane(p,g,Ee),y=l.getPickRay(h,Ce),C=u.rayPlane(y,g,Se);if(!o(_)||!o(C))return i._looking=!0,K(i,r,n),void e.clone(r,i._translateMousePosition);var E=t.subtract(_,C,we),S=E.x;E.x=E.y,E.y=E.z,E.z=S;var w=t.magnitude(E);w>d.EPSILON6&&(t.normalize(E,E),l.move(E,w))}function B(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 K(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,V(t,i,r)):k(t,i,r)}function V(i,r,n){var a=i._scene,s=a.camera,u=a.canvas,c=Pe;c.x=u.clientWidth/2,c.y=u.clientHeight/2;var h,p=s.getPickRay(c,Ie),f=t.UNIT_X,v=p.origin,g=p.direction,y=t.dot(f,g);if(Math.abs(y)>d.EPSILON6&&(h=-t.dot(f,v)/y),!o(h)||0>=h)return i._looking=!0,K(i,r,n),void e.clone(r,i._tiltCenterMousePosition);var C=t.multiplyByScalar(g,h,Me);t.add(v,C,C);var E=a.mapProjection,S=E.ellipsoid;t.fromElements(C.y,C.z,C.x,C);var w=E.unproject(C,Be);S.cartographicToCartesian(w,C);var T=_.eastNorthUpToFixedFrame(C,S,Re),x=i._globe,b=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var A=m.clone(s.transform,Ve);s._setTransform(T),H(i,r,n,t.UNIT_Z),s._setTransform(A),i._globe=x,i._ellipsoid=b;var P=b.maximumRadius;i._rotateFactor=1/P,i._rotateRateRangeAdjustment=P}function k(i,r,n){var a,s,c=i._ellipsoid,h=i._scene,g=h.camera,y=t.UNIT_X;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,Me);else{if(g.position.z<i._minimumPickingTerrainHeight&&(a=L(i,r,Me)),!o(a)){s=g.getPickRay(r,Ie);var C,E=s.origin,S=s.direction,w=t.dot(y,S);if(Math.abs(w)>d.EPSILON6&&(C=-t.dot(y,E)/w),!o(C)||0>=C)return i._looking=!0,K(i,r,n),void e.clone(r,i._tiltCenterMousePosition);a=t.multiplyByScalar(S,C,Me),t.add(E,a,a)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var T=h.canvas,x=Pe;x.x=T.clientWidth/2,x.y=i._tiltCenterMousePosition.y,s=g.getPickRay(x,Ie);var b=t.clone(t.ZERO,Ne);b.x=a.x;var A=f.fromPointNormal(b,y,Le),P=u.rayPlane(s,A,De),I=g._projection;c=I.ellipsoid,t.fromElements(a.y,a.z,a.x,a);var M=I.unproject(a,Be);c.cartographicToCartesian(M,a);var D,R=_.eastNorthUpToFixedFrame(a,c,Re);o(P)?(t.fromElements(P.y,P.z,P.x,P),M=I.unproject(P,Be),c.cartographicToCartesian(M,P),D=_.eastNorthUpToFixedFrame(P,c,Oe)):D=R;var O=i._globe,N=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var F=t.UNIT_Z,B=m.clone(g.transform,Ve);g._setTransform(R);var V=t.cross(t.UNIT_Z,t.normalize(g.position,Fe),Fe),k=t.dot(g.right,V);if(H(i,r,n,F,!1,!0),g._setTransform(D),0>k){n.startPosition.y>n.endPosition.y&&(F=void 0);var z=g.constrainedAxis;g.constrainedAxis=void 0,H(i,r,n,F,!0,!1),g.constrainedAxis=z}else H(i,r,n,F,!0,!1);if(o(g.constrainedAxis)){var U=t.cross(g.direction,g.constrainedAxis,vt);t.equalsEpsilon(U,t.ZERO,d.EPSILON6)||(t.dot(U,g.right)<0&&t.negate(U,U),t.cross(U,g.direction,g.up),t.cross(g.direction,g.up,g.right),t.normalize(g.up,g.up),t.normalize(g.right,g.right))}g._setTransform(B),i._globe=O,i._ellipsoid=N;var G=N.maximumRadius;i._rotateFactor=1/G,i._rotateRateRangeAdjustment=G;var W=t.clone(g.positionWC,Fe);if(J(i),!t.equals(g.positionWC,W)){g._setTransform(D),g.worldToCameraCoordinatesPoint(W,W);var q=t.magnitudeSquared(W);t.magnitudeSquared(g.position)>q&&(t.normalize(g.position,g.position),t.multiplyByScalar(g.position,Math.sqrt(q),g.position));var j=t.angleBetween(W,g.position),Y=t.cross(W,g.position,W);t.normalize(Y,Y);var X=v.fromAxisAngle(Y,j,ke),Z=p.fromQuaternion(X,ze);p.multiplyByVector(Z,g.direction,g.direction),p.multiplyByVector(Z,g.up,g.up),t.cross(g.direction,g.up,g.right),t.cross(g.right,g.direction,g.up),g._setTransform(B)}}function z(e,i,r){o(r.distance)&&(r=r.distance);var n=e._scene,a=n.camera,s=n.canvas,l=Ue;l.x=s.clientWidth/2,l.y=s.clientHeight/2;var u,c=a.getPickRay(l,Ge);a.position.z<e._minimumPickingTerrainHeight&&(u=L(e,l,We));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)}I(e,i,r,e._zoomFactor,h)}function U(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(),P(e,e.enableTilt,e.tiltEventTypes,B,e.inertiaSpin,"_lastInertiaTiltMovement"),P(e,e.enableTranslate,e.translateEventTypes,F,e.inertiaTranslate,"_lastInertiaTranslateMovement"),P(e,e.enableZoom,e.zoomEventTypes,z,e.inertiaZoom,"_lastInertiaZoomMovement"),P(e,e.enableLook,e.lookEventTypes,K),!(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 P(e,e.enableRotate,e.rotateEventTypes,H,e.inertiaSpin,"_lastInertiaSpinMovement"),P(e,e.enableZoom,e.zoomEventTypes,j,e.inertiaZoom,"_lastInertiaZoomMovement")}function G(e,i,r){var n=e._scene,a=n.camera,s=L(e,r.startPosition,Ke);if(o(s)){var l=r.endPosition,c=a.getPickRay(l,He),h=t.clone(a.direction,Ye);n.mode===E.COLUMBUS_VIEW&&t.fromElements(h.z,h.x,h.y,h);var d=f.fromPointNormal(s,h,qe),p=u.rayPlane(c,d,je);o(p)&&(h=t.subtract(s,p,h),n.mode===E.COLUMBUS_VIEW&&t.fromElements(h.y,h.z,h.x,h),t.add(a.position,h,a.position))}}function W(i,r,n){var a=i._scene,s=a.camera;if(!m.equals(s.transform,m.IDENTITY))return void H(i,r,n);var u,c,h,d,p=i._ellipsoid.geodeticSurfaceNormal(s.position,$e),f=i._ellipsoid.cartesianToCartographic(s.positionWC,Ze).height,v=i._globe,g=!1;if(o(v)&&f<i._minimumPickingTerrainHeight&&(d=L(i,n.startPosition,Ke),o(d))){var _=s.getPickRay(n.startPosition,ve),y=i._ellipsoid.geodeticSurfaceNormal(d);g=Math.abs(t.dot(_.direction,y))<.05,g&&!i._looking&&(i._rotating=!1,i._strafing=!0)}return e.equals(r,i._rotateMousePosition)?void(i._looking?K(i,r,n,p):i._rotating?H(i,r,n):i._strafing?(t.clone(d,i._strafeStartPosition),G(i,r,n)):(u=t.magnitude(i._rotateStartPosition),c=Qe,c.x=c.y=c.z=u,h=l.fromCartesian3(c,Je),q(i,r,n,h))):(i._looking=!1,i._rotating=!1,i._strafing=!1,o(v)&&f<i._minimumPickingTerrainHeight?o(d)?t.magnitude(s.position)<t.magnitude(d)?(t.clone(d,i._strafeStartPosition),i._strafing=!0,G(i,r,n)):(u=t.magnitude(d),c=Qe,c.x=c.y=c.z=u,h=l.fromCartesian3(c,Je),q(i,r,n,h),t.clone(d,i._rotateStartPosition)):(i._looking=!0,K(i,r,n,p)):o(s.pickEllipsoid(n.startPosition,i._ellipsoid,Xe))?(q(i,r,n,i._ellipsoid),t.clone(Xe,i._rotateStartPosition)):f>i._minimumTrackBallHeight?(i._rotating=!0,H(i,r,n)):(i._looking=!0,K(i,r,n,p)),void e.clone(r,i._rotateMousePosition))}function H(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,v=(r.startPosition.y-r.endPosition.y)/h.clientHeight;f=Math.min(f,e.maximumMovementRatio),v=Math.min(v,e.maximumMovementRatio);var g=m*f*Math.PI*2,_=m*v*Math.PI;s||c.rotateRight(g),l||c.rotateUp(_),c.constrainedAxis=d}function q(i,r,n,a){var s=i._scene,l=s.camera,u=e.clone(n.startPosition,at),c=e.clone(n.endPosition,st),h=l.pickEllipsoid(u,a,et),p=l.pickEllipsoid(c,a,tt);if(!o(h)||!o(p))return i._rotating=!0,void H(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,it);t.cross(f,m,f),t.normalize(f,f);var v=t.cross(m,f,rt),g=t.magnitude(h),_=t.dot(m,h),y=Math.acos(_/g),C=t.multiplyByScalar(m,_,nt);t.subtract(h,C,C),t.normalize(C,C);var E=t.magnitude(p),S=t.dot(m,p),w=Math.acos(S/E),T=t.multiplyByScalar(m,S,ot);t.subtract(p,T,T),t.normalize(T,T);var x=Math.acos(t.dot(C,f));t.dot(C,v)<0&&(x=d.TWO_PI-x);var b=Math.acos(t.dot(T,f));t.dot(T,v)<0&&(b=d.TWO_PI-b);var A,P=x-b;A=t.equalsEpsilon(m,l.position,d.EPSILON2)?l.right:t.cross(m,l.position,it);var I,M=t.cross(m,A,it),D=t.dot(M,t.subtract(h,m,rt)),R=t.dot(M,t.subtract(p,m,rt));I=D>0&&R>0?w-y:D>0&&0>=R?t.dot(l.position,m)>0?-y-w:y+w:y-w,l.rotateRight(P),l.rotateUp(I)}else{t.normalize(h,h),t.normalize(p,p);var O=t.dot(h,p),N=t.cross(h,p,it);if(1>O&&!t.equalsEpsilon(N,t.ZERO,d.EPSILON14)){var L=Math.acos(O);l.rotate(N,L)}}}function j(e,i,r){o(r.distance)&&(r=r.distance);var n=e._ellipsoid,a=e._scene,s=a.camera,l=a.canvas,u=Ue;u.x=l.clientWidth/2,u.y=l.clientHeight/2;var c,h=s.getPickRay(u,Ge),d=n.cartesianToCartographic(s.position,ut).height;d<e._minimumPickingTerrainHeight&&(c=L(e,u,We));var p;p=o(c)?t.distance(h.origin,c):d;var m=t.normalize(s.position,lt);I(e,i,r,e._zoomFactor,p,t.dot(m,s.direction))}function Y(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,Et);return void K(t,i,r,s)}var l=t._ellipsoid,u=l.cartesianToCartographic(a.position,Ct);t._tiltOnEllipsoid||u.height>t._minimumCollisionTerrainHeight?(t._tiltOnEllipsoid=!0,X(t,i,r)):Z(t,i,r)}}function X(i,r,n){var a=i._ellipsoid,s=i._scene,c=s.camera,h=.25*i.minimumZoomDistance,p=a.cartesianToCartographic(c.positionWC,St).height;if(!(p-h-1<d.EPSILON3&&n.endPosition.y-n.startPosition.y<0)){var f=s.canvas,v=ct;v.x=f.clientWidth/2,v.y=f.clientHeight/2;var y,C=c.getPickRay(v,ht),E=u.rayEllipsoid(C,a);if(o(E))y=g.getPoint(C,E.start,dt);else{if(!(p>i._minimumTrackBallHeight)){i._looking=!0;var S=i._ellipsoid.geodeticSurfaceNormal(c.position,Et);return K(i,r,n,S),void e.clone(r,i._tiltCenterMousePosition)}var w=u.grazingAltitudeLocation(C,a);if(!o(w))return;var T=a.cartesianToCartographic(w,Ct);T.height=0,y=a.cartographicToCartesian(T,dt)}var x=_.eastNorthUpToFixedFrame(y,a,mt),b=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,gt);c._setTransform(x),H(i,r,n,t.UNIT_Z),c._setTransform(P),i._globe=b,i._ellipsoid=A;var I=A.maximumRadius;i._rotateFactor=1/I,i._rotateRateRangeAdjustment=I}}function Z(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,dt);else{if(a=L(i,r,dt),!o(a)){if(s=y.getPickRay(r,ht),c=u.rayEllipsoid(s,h),!o(c)){var C=h.cartesianToCartographic(y.position,Ct);if(C.height<=i._minimumTrackBallHeight){i._looking=!0;var E=i._ellipsoid.geodeticSurfaceNormal(y.position,Et);K(i,r,n,E),e.clone(r,i._tiltCenterMousePosition)}return}a=g.getPoint(s,c.start,dt)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var S=f.canvas,w=ct;w.x=S.clientWidth/2,w.y=i._tiltCenterMousePosition.y,s=y.getPickRay(w,ht);var T=t.magnitude(a),x=t.fromElements(T,T,T,Qe),b=l.fromCartesian3(x,Je);if(c=u.rayEllipsoid(s,b),o(c)){var A=t.magnitude(s.origin)>T?c.start:c.stop,P=g.getPoint(s,A,pt),I=_.eastNorthUpToFixedFrame(a,h,mt),M=_.eastNorthUpToFixedFrame(P,b,ft),D=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,gt);y._setTransform(I);var F=t.cross(P,y.positionWC,vt),B=t.dot(y.rightWC,F);if(H(i,r,n,O,!1,!0),y._setTransform(M),0>B){n.startPosition.y>n.endPosition.y&&(O=void 0);var V=y.constrainedAxis;y.constrainedAxis=void 0,H(i,r,n,O,!0,!1),y.constrainedAxis=V}else H(i,r,n,O,!0,!1);if(o(y.constrainedAxis)){var k=t.cross(y.direction,y.constrainedAxis,vt); +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=D,i._ellipsoid=R;var z=R.maximumRadius;i._rotateFactor=1/z,i._rotateRateRangeAdjustment=z;var U=t.clone(y.positionWC,vt);if(J(i),!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),q=t.cross(U,y.position,U);t.normalize(q,q);var j=v.fromAxisAngle(q,W,_t),Y=p.fromQuaternion(j,yt);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 K(e,i,r,a){var s=e._scene,l=s.camera,u=wt;u.x=r.startPosition.x,u.y=0;var c=Tt;c.x=r.endPosition.x,c.y=0;var h=l.getPickRay(u,xt).direction,p=l.getPickRay(c,bt).direction,m=0,f=t.dot(h,p);1>f&&(m=Math.acos(f)),m=r.startPosition.x>r.endPosition.x?-m:m;var v=e._horizontalRotationAxis;if(o(a)?l.look(a,-m):o(v)?l.look(v,-m):l.lookLeft(m),u.x=0,u.y=r.startPosition.y,c.x=0,c.y=r.endPosition.y,h=l.getPickRay(u,xt).direction,p=l.getPickRay(c,bt).direction,m=0,f=t.dot(h,p),1>f&&(m=Math.acos(f)),m=r.startPosition.y>r.endPosition.y?-m:m,a=n(a,v),o(a)){var g=l.direction,_=t.negate(a,At),y=t.equalsEpsilon(g,a,d.EPSILON2),C=t.equalsEpsilon(g,_,d.EPSILON2);if(y||C)(y&&0>m||C&&m>0)&&l.look(l.right,-m);else{f=t.dot(g,a);var E=d.acosClamped(f);m>0&&m>E&&(m=E-d.EPSILON4),f=t.dot(g,_),E=d.acosClamped(f),0>m&&-m>E&&(m=-E+d.EPSILON4);var S=t.cross(a,g,Pt);l.look(S,m)}}else l.lookUp(m)}function Q(e){P(e,e.enableRotate,e.rotateEventTypes,W,e.inertiaSpin,"_lastInertiaSpinMovement"),P(e,e.enableZoom,e.zoomEventTypes,j,e.inertiaZoom,"_lastInertiaZoomMovement"),P(e,e.enableTilt,e.tiltEventTypes,Y,e.inertiaSpin,"_lastInertiaTiltMovement"),P(e,e.enableLook,e.lookEventTypes,K)}function J(e){if(e.enableCollisionDetection){var i=e._scene,r=i.mode,n=i.globe;if(o(n)&&r!==E.SCENE2D&&r!==E.MORPHING){var a,s,l=i.camera,u=n.ellipsoid,c=i.mapProjection;m.equals(l.transform,m.IDENTITY)||(a=m.clone(l.transform),s=t.magnitude(l.position),l._setTransform(m.IDENTITY));var h=It;r===E.SCENE3D?u.cartesianToCartographic(l.position,h):c.unproject(l.position,h);var d=!1;if(h.height<e._minimumCollisionTerrainHeight){var p=n.getHeight(h);o(p)&&(p+=e.minimumZoomDistance,h.height<p&&(h.height=p,r===E.SCENE3D?u.cartographicToCartesian(h,l.position):c.project(h,l.position),d=!0))}o(a)&&(l._setTransform(a),d&&(t.normalize(l.position,l.position),t.negate(l.position,l.direction),t.multiplyByScalar(l.position,Math.max(s,e.minimumZoomDistance),l.position),t.normalize(l.direction,l.direction),t.cross(l.direction,l.up,l.right),t.cross(l.right,l.direction,l.up)))}}}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 g,de=new g,pe=new t,me=new e,fe=new e,ve=new g,ge=new t,_e=new t,ye=new g,Ce=new g,Ee=new t,Se=new t,we=new t,Te=new t,xe=new f(t.ZERO,0),be=new e,Ae=new e,Pe=new e,Ie=new g,Me=new t,De=new t,Re=new m,Oe=new m,Ne=new t,Le=new f(t.ZERO,0),Fe=new t,Be=new r,Ve=new m,ke=new v,ze=new p,Ue=new e,Ge=new g,We=new t,He=new g,qe=new f(t.ZERO,0),je=new t,Ye=new t,Xe=new t,Ze=new r,Ke=new t,Qe=new t,Je=new l,$e=new t,et=i.clone(i.UNIT_W),tt=i.clone(i.UNIT_W),it=new t,rt=new t,nt=new t,ot=new t,at=new e,st=new e,lt=new t,ut=new r,ct=new e,ht=new g,dt=new t,pt=new t,mt=new m,ft=new m,vt=new t,gt=new m,_t=new v,yt=new p,Ct=new r,Et=new t,St=new r,wt=new e,Tt=new e,xt=new g,bt=new g,At=new t,Pt=new t,It=new r;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===E.SCENE2D?N(this):r===E.COLUMBUS_VIEW?(this._horizontalRotationAxis=t.UNIT_Z,U(this)):r===E.SCENE3D&&(this._horizontalRotationAxis=void 0,Q(this)),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("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,v,g,_,y,C,E,S){"use strict";function w(){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}w.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)},w.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 T=new e,x=new e,b=new i,A=new t,P=new t,I=new l;return w.prototype.update=function(e){var i=e.context,n=e.viewport,a=i.drawingBufferWidth,p=i.drawingBufferHeight,w=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 D=1,R=2;M={delta:function(){return D},sigma:function(){return R},direction:function(){return 0}},this._blurXCommand=i.createViewportQuadCommand(E,{uniformMap:M,owner:this}),M={delta:function(){return D},sigma:function(){return R},direction:function(){return 1}},this._blurYCommand=i.createViewportQuadCommand(E,{uniformMap:M,owner:this}),M={u_center:function(){return w._uCenter},u_radius:function(){return w._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(O,N),F=x;F.width=L,F.height=L;var B=this._fbo,V=o(B)&&B.getColorTexture(0)||void 0;if(!o(V)||V.width!==a||V.height!==p){B=B&&B.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 _({context:i,width:a,height:p})];B=i.depthTexture?this._fbo=new d({context:i,colorTextures:k,depthTexture:new _({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:v.DEPTH_COMPONENT16})}),this._downSampleFBO1=new d({context:i,colorTextures:[new _({context:i,width:L,height:L})]}),this._downSampleFBO2=new d({context:i,colorTextures:[new _({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:F});this._downSampleCommand.uniformMap.u_texture=function(){return B.getColorTexture(0)},this._downSampleCommand.renderState=z,this._brightPassCommand.uniformMap.u_texture=function(){return w._downSampleFBO1.getColorTexture(0)},this._brightPassCommand.renderState=z,this._blurXCommand.uniformMap.u_texture=function(){return w._downSampleFBO2.getColorTexture(0)},this._blurXCommand.uniformMap.u_step=function(){return w._blurStep},this._blurXCommand.renderState=z,this._blurYCommand.uniformMap.u_texture=function(){return w._downSampleFBO1.getColorTexture(0)},this._blurYCommand.uniformMap.u_step=function(){return w._blurStep},this._blurYCommand.renderState=z;var U=T;U.width=a,U.height=p;var G=g.fromCache({viewport:U});this._blendCommand.uniformMap.u_texture0=function(){return B.getColorTexture(0)},this._blendCommand.uniformMap.u_texture1=function(){return w._downSampleFBO2.getColorTexture(0)},this._blendCommand.renderState=G,this._fullScreenCommand.uniformMap.u_texture=function(){return B.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,I),Z=l.multiplyByPoint(q,H,b),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(F,0,1,I),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},w.prototype.isDestroyed=function(){return!1},w.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)},w}),i("Scene/Scene",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../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","../Renderer/ClearCommand","../Renderer/ComputeEngine","../Renderer/Context","../Renderer/ContextLimits","../Renderer/PassState","../Renderer/ShaderProgram","../Renderer/ShaderSource","./Camera","./CreditDisplay","./CullingVolume","./DepthPlane","./DeviceOrientationCameraController","./Fog","./FrameState","./FrustumCommands","./FXAA","./GlobeDepth","./OIT","./OrthographicFrustum","./Pass","./PerformanceDisplay","./PerInstanceColorAppearance","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./PickDepth","./Primitive","./PrimitiveCollection","./SceneMode","./SceneTransforms","./SceneTransitioner","./ScreenSpaceCameraController","./SunPostProcess","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae){"use strict";function se(t){t=u(t,u.EMPTY_OBJECT);var i=t.canvas,r=t.contextOptions,n=t.creditContainer,o=new M(i,r);c(n)||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0px 0px 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",i.parentNode.appendChild(n)),this._id=l(),this._frameState=new U(o,new F(n)),this._frameState.scene3DOnly=u(t.scene3DOnly,!1);var s=new R(o);s.viewport=new e,s.viewport.x=0,s.viewport.y=0,s.viewport.width=o.drawingBufferWidth,s.viewport.height=o.drawingBufferHeight,this._passState=s,this._canvas=i,this._context=o,this._computeEngine=new I(o),this._globe=void 0,this._primitives=new ee,this._groundPrimitives=new ee,this._tweens=new ae,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._frustumCommandsList=[],this._overlayCommandList=[],this._pickFramebuffer=void 0,this._useOIT=u(t.orderIndependentTranslucency,!0),this._executeOITFunction=void 0;var h;o.depthTexture&&(h=new H);var d;this._useOIT&&c(h)&&(d=new q(o)),this._globeDepth=h,this._depthPlane=new V,this._oit=d,this._fxaa=new W,this._clearColorCommand=new P({color:new a,stencil:0,owner:this}),this._depthClearCommand=new P({depth:1,owner:this}),this._pickDepths=[],this._debugGlobeDepths=[],this._transitioner=new re(this),this._renderError=new f,this._preRender=new f,this._postRender=new f,this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new f,this.morphComplete=new f,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=a.clone(a.BLACK),this._mode=te.SCENE3D,this._mapProjection=c(t.mapProjection)?t.mapProjection:new v,this._transitioner=new re(this,this._mapProjection.ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,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 z,this._terrainExaggeration=u(t.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0;var p=new L(this);this._camera=p,this._cameraClone=L.clone(p),this._screenSpaceCameraController=new ne(this),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!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,g=p.frustum.far,_=Math.ceil(Math.log(g/m)/Math.log(this.farToNearRatio));pe(m,g,this.farToNearRatio,_,this._frustumCommandsList),de(this,0,S.now()),this.initializeFrame()}function le(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 ue(e,t,i){var r=1/Math.max(1,le(e.position,t.position));return n.multiplyByScalar(e.position,r,ze),n.multiplyByScalar(t.position,r,Ue),n.equalsEpsilon(ze,Ue,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 ce(e){var t=e.globe;if(e._mode===te.SCENE3D&&c(t)){var i=t.ellipsoid;return Ge.radius=i.minimumRadius,ke=b.fromBoundingSphere(Ge,e._camera.positionWC,ke)}}function he(e){e.render=!1,e.pick=!1}function de(e,t,i){var r=e._camera,n=e._frameState;n.commandList.length=0,n.mode=e._mode,n.morphTime=e.morphTime,n.mapProjection=e.mapProjection,n.frameNumber=t,n.time=S.clone(i,n.time),n.camera=r,n.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.occluder=ce(e),n.terrainExaggeration=e._terrainExaggeration,he(n.passes)}function pe(e,t,i,r,n){n.length=r;for(var o=0;r>o;++o){var a=Math.max(e,Math.pow(i,o)*e),s=Math.min(t,i*a),l=n[o];c(l)?(l.near=a,l.far=s):l=n[o]=new G(a,s)}}function me(e,t,i){e.debugShowFrustums&&(t.debugOverlappingFrustums=0);for(var r=e._frustumCommandsList,n=r.length,o=0;n>o;++o){var a=r[o],s=a.near,l=a.far;if(!(i.start>l)){if(i.stop<s)break;var u=t instanceof P?Y.OPAQUE:t.pass,h=a.indices[u]++;if(a.commands[u][h]=t,e.debugShowFrustums&&(t.debugOverlappingFrustums|=1<<o),t.executeInClosestFrustum)break}}if(e.debugShowFrustums){var d=e._debugFrustumStatistics.commandsInFrustums;d[t.debugOverlappingFrustums]=c(d[t.debugOverlappingFrustums])?d[t.debugOverlappingFrustums]+1:1,++e._debugFrustumStatistics.totalCommands}}function fe(e,t,i){return c(e)&&(!c(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==C.OUTSIDE&&(!c(i)||!e.boundingVolume.isOccluded(i)))}function ve(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,h=Y.NUMBER_OF_PASSES,d=0;u>d;++d)for(var p=0;h>p;++p)l[d].indices[p]=0;o.length=0,a.length=0;for(var m=Number.MAX_VALUE,f=Number.MIN_VALUE,v=!1,g=t.mode===te.SCENE3D?t.occluder:void 0,_=t.cullingVolume,y=We.planes,C=0;5>C;++C)y[C]=_.planes[C];_=We;var E=e._environmentState;E.isSkyAtmosphereVisible=c(E.skyAtmosphereCommand)&&c(e.globe)&&e.globe._surface._tilesToRender.length>0,E.isSunVisible=fe(E.sunDrawCommand,_,g),E.isMoonVisible=fe(E.moonCommand,_,g);for(var S=s.length,w=0;S>w;++w){var T=s[w],x=T.pass;if(x===Y.COMPUTE)o.push(T);else if(x===Y.OVERLAY)a.push(T);else{var b=T.boundingVolume;if(c(b)){if(!fe(T,_,g))continue;He=b.computePlaneDistances(n,r,He),m=Math.min(m,He.start),f=Math.max(f,He.stop)}else He.start=i.frustum.near,He.stop=i.frustum.far,v=!(T instanceof P);me(e,T,He)}}v?(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));var A=e.farToNearRatio,I=Math.ceil(Math.log(f/m)/Math.log(A));m!==Number.MAX_VALUE&&(I!==u||0!==l.length&&(m<l[0].near||f>l[u-1].far))&&(pe(m,f,A,I,l),ve(e))}function ge(e){var t={},i=e.vertexAttributes;for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r].index);return t}function _e(e,t,i){var r=t.context,n=u(i,e.shaderProgram),o=n.fragmentShaderSource.clone();o.sources=o.sources.map(function(e){return e=N.replaceMain(e,"czm_Debug_main")});var s="void main() \n{ \n czm_Debug_main(); \n";if(t.debugShowCommands){c(e._debugColor)||(e._debugColor=a.fromRandom());var l=e._debugColor;s+=" gl_FragColor.rgb *= vec3("+l.red+", "+l.green+", "+l.blue+"); \n"}if(t.debugShowFrustums){var h=1&e.debugOverlappingFrustums?"1.0":"0.0",d=2&e.debugOverlappingFrustums?"1.0":"0.0",p=4&e.debugOverlappingFrustums?"1.0":"0.0";s+=" gl_FragColor.rgb *= vec3("+h+", "+d+", "+p+"); \n"}s+="}",o.sources.push(s);var m=ge(n);return O.fromCache({context:r,vertexShaderSource:n.vertexShaderSource,fragmentShaderSource:o,attributeLocations:m})}function ye(e,t,i,r,n){if(c(e.shaderProgram)||c(n)){var o=_e(e,t,n);e.execute(t.context,i,r,o),o.destroy()}}function Ce(e,t,r,o,a,l,u){if((!c(t.debugCommandFilter)||t.debugCommandFilter(e))&&(t.debugShowCommands||t.debugShowFrustums?ye(e,t,o,a,l):e.execute(r,o,a,l),e.debugShowBoundingVolume&&c(e.boundingVolume))){var h=t._frameState,d=e.boundingVolume;c(t._debugVolume)&&t._debugVolume.destroy();var p,f=n.clone(d.center);if(h.mode!==te.SCENE3D){f=T.multiplyByPoint(qe,f,f);var v=h.mapProjection,y=v.unproject(f);f=v.ellipsoid.cartographicToCartesian(y)}if(c(d.radius)){var C=d.radius;p=_.toWireframe(m.createGeometry(new m({radii:new n(C,C,C),vertexFormat:Z.FLAT_VERTEX_FORMAT}))),t._debugVolume=new $({geometryInstances:new g({geometry:p,modelMatrix:T.multiplyByTranslation(T.IDENTITY,f,new T),attributes:{color:new s(1,0,0,1)}}),appearance:new Z({flat:!0,translucent:!1}),asynchronous:!1})}else{var E=d.halfAxes;p=_.toWireframe(i.createGeometry(i.fromDimensions({dimensions:new n(2,2,2),vertexFormat:Z.FLAT_VERTEX_FORMAT}))),t._debugVolume=new $({geometryInstances:new g({geometry:p,modelMatrix:T.fromRotationTranslation(E,f,new T),attributes:{color:new s(1,0,0,1)}}),appearance:new Z({flat:!0,translucent:!1}),asynchronous:!1})}var S=h.commandList,w=h.commandList=[];t._debugVolume.update(h);var x;c(u)&&(x=o.framebuffer,o.framebuffer=u),w[0].execute(r,o),c(x)&&(o.framebuffer=x),h.commandList=S}}function Ee(e,t,i){return t.boundingVolume.distanceSquaredTo(i)-e.boundingVolume.distanceSquaredTo(i)}function Se(e,t,i,r){var n=e.context;x(r,Ee,e._camera.positionWC);for(var o=r.length,a=0;o>a;++a)t(r[a],e,n,i)}function we(e,t){var i=e._debugGlobeDepths[t];return!c(i)&&e.context.depthTexture&&(i=new H,e._debugGlobeDepths[t]=i),i}function Te(e,t){var i=e._pickDepths[t];return c(i)||(i=new J,e._pickDepths[t]=i),i}function xe(e,t){var i,r=e._camera,n=e.context,o=n.uniformState;i=c(r.frustum.fov)?r.frustum.clone(je):c(r.frustum.infiniteProjectionMatrix)?r.frustum.clone(Ye):r.frustum.clone(Xe),i.near=r.frustum.near,i.far=r.frustum.far,o.updateFrustum(i);var a=e._environmentState,s=a.skyBoxCommand;if(c(s)&&Ce(s,e,n,t),a.isSkyAtmosphereVisible&&Ce(a.skyAtmosphereCommand,e,n,t),a.isSunVisible&&(a.sunDrawCommand.execute(n,t),e.sunBloom&&!e._useWebVR)){var l;l=a.useGlobeDepthFramebuffer?e._globeDepth.framebuffer:a.useFXAA?e._fxaa.getColorFramebuffer():a.originalFramebuffer,e._sunPostProcess.execute(n,l),t.framebuffer=l}a.isMoonVisible&&a.moonCommand.execute(n,t);var u;a.useOIT?(c(e._executeOITFunction)||(e._executeOITFunction=function(e,t,i,r){e._oit.executeCommands(e,t,i,r)}),u=e._executeOITFunction):u=Se;for(var h,d=a.clearGlobeDepth,p=a.clearGlobeDepth,m=e._depthClearCommand,f=e._depthPlane,v=e._frustumCommandsList,g=v.length,_=0;g>_;++_){var y=g-_-1,C=v[y];i.near=0!==y?C.near*Ve:C.near,i.far=C.far;var E,S=e.debugShowGlobeDepth?we(e,y):e._globeDepth;e.debugShowGlobeDepth&&c(S)&&a.useGlobeDepthFramebuffer&&(E=t.framebuffer,t.framebuffer=S.framebuffer),o.updateFrustum(i),m.execute(n,t);var w=C.commands[Y.GLOBE],T=C.indices[Y.GLOBE];for(h=0;T>h;++h)Ce(w[h],e,n,t);for(c(S)&&a.useGlobeDepthFramebuffer&&(e.copyGlobeDepth||e.debugShowGlobeDepth)&&(S.update(n),S.executeCopyDepth(n,t)),e.debugShowGlobeDepth&&c(S)&&a.useGlobeDepthFramebuffer&&(t.framebuffer=E),w=C.commands[Y.GROUND],T=C.indices[Y.GROUND],h=0;T>h;++h)Ce(w[h],e,n,t);d&&(m.execute(n,t),p&&f.execute(n,t));for(var x=Y.GROUND+1,b=Y.TRANSLUCENT,A=x;b>A;++A)for(w=C.commands[A],T=C.indices[A],h=0;T>h;++h)Ce(w[h],e,n,t);if(0!==y&&(i.near=C.near,o.updateFrustum(i)),w=C.commands[Y.TRANSLUCENT],w.length=C.indices[Y.TRANSLUCENT],u(e,Ce,t,w),c(S)&&a.useGlobeDepthFramebuffer&&e.useDepthPicking){var P=Te(e,y);P.update(n,S.framebuffer.depthStencilTexture),P.executeCopyDepth(n,t)}}}function be(e){var t=e._environmentState.sunComputeCommand;c(t)&&t.execute(e._computeEngine);for(var i=e._computeCommandList,r=i.length,n=0;r>n;++n)i[n].execute(e._computeEngine)}function Ae(e,t){for(var i=e.context,r=e._overlayCommandList,n=r.length,o=0;n>o;++o)r[o].execute(i,t)}function Pe(e,t){var i=e._context,r=t.viewport,o=e._frameState,a=o.camera;if(e._useWebVR)if(o.mode!==te.SCENE2D){r.x=0,r.y=0,r.width=.5*i.drawingBufferWidth,r.height=i.drawingBufferHeight;var s=L.clone(a,e._cameraVR),l=a.frustum.near,u=5*l,c=u/30,h=n.multiplyByScalar(s.right,.5*c,Ze);a.frustum.aspectRatio=r.width/r.height;var d=.5*c*l/u;n.add(s.position,h,a.position),a.frustum.xOffset=d,xe(e,t),r.x=t.viewport.width,n.subtract(s.position,h,a.position),a.frustum.xOffset=-d,xe(e,t),L.clone(s,a)}else{r.x=0,r.y=0,r.width=.5*i.drawingBufferWidth,r.height=i.drawingBufferHeight;var p=a.frustum.top;a.frustum.top=a.frustum.right*(r.height/r.width),a.frustum.bottom=-a.frustum.top,xe(e,t),r.x=t.viewport.width,xe(e,t),a.frustum.top=p,a.frustum.bottom=-p}else r.x=0,r.y=0,r.width=i.drawingBufferWidth,r.height=i.drawingBufferHeight,xe(e,t)}function Ie(e){var t=e._frameState,i=e._environmentState,r=t.passes.render;i.skyBoxCommand=r&&c(e.skyBox)?e.skyBox.update(t):void 0,i.skyAtmosphereCommand=r&&c(e.skyAtmosphere)?e.skyAtmosphere.update(t):void 0;var n=r&&c(e.sun)?e.sun.update(e):void 0;i.sunDrawCommand=c(n)?n.drawCommand:void 0,i.sunComputeCommand=c(n)?n.computeCommand:void 0,i.moonCommand=r&&c(e.moon)?e.moon.update(t):void 0;var o=i.clearGlobeDepth=c(e.globe)&&(!e.globe.depthTestAgainstTerrain||e.mode===te.SCENE2D),a=i.useDepthPlane=o&&e.mode===te.SCENE3D;a&&e._depthPlane.update(t)}function Me(e){var t=e._frameState;e._globe&&e._globe.update(t),e._groundPrimitives.update(t),e._primitives.update(t)}function De(e,t,i,r){var n=e._context,o=e._environmentState;o.originalFramebuffer=t.framebuffer,c(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!e._useWebVR?e._sunPostProcess=new oe:c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!c(e.sun)&&c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var s=e._clearColorCommand;a.clone(i,s.color),s.execute(n,t);var l=o.useGlobeDepthFramebuffer=!r&&c(e._globeDepth);l&&(e._globeDepth.update(n),e._globeDepth.clear(n,t,i));for(var u=!1,h=e._frustumCommandsList,d=h.length,p=0;d>p;++p)if(h[p].indices[Y.TRANSLUCENT]>0){u=!0;break}var m=o.useOIT=!r&&u&&c(e._oit)&&e._oit.isSupported();m&&(e._oit.update(n,e._globeDepth.framebuffer),e._oit.clear(n,t,i),o.useOIT=e._oit.isSupported());var f=o.useFXAA=!r&&e.fxaa;f&&(e._fxaa.update(n),e._fxaa.clear(n,t,i)),o.isSunVisible&&e.sunBloom&&!e._useWebVR?t.framebuffer=e._sunPostProcess.update(t):l?t.framebuffer=e._globeDepth.framebuffer:f&&(t.framebuffer=e._fxaa.getColorFramebuffer()),c(t.framebuffer)&&s.execute(n,t)}function Re(e,t){var i=e._context,r=e._environmentState,n=r.useGlobeDepthFramebuffer;if(e.debugShowGlobeDepth&&n){var o=we(e,e.debugShowDepthFrustum-1);o.executeDebugGlobeDepth(i,t)}if(e.debugShowPickDepth&&n){var a=Te(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 Oe(e){for(var t=e.afterRender,i=0,r=t.length;r>i;++i)t[i]();t.length=0}function Ne(e,t){c(t)||(t=S.now());var i=e._camera;ue(i,e._cameraClone,w.EPSILON6)?e._cameraStartFired&&y()-e._cameraMovedTime>e.cameraEventWaitTime&&(i.moveEnd.raiseEvent(),e._cameraStartFired=!1):(e._cameraStartFired||(i.moveStart.raiseEvent(),e._cameraStartFired=!0),e._cameraMovedTime=y(),L.clone(i,e._cameraClone)),e._preRender.raiseEvent(e,t);var r=e.context,n=r.uniformState,o=e._frameState,s=w.incrementWrap(o.frameNumber,15e6,1);de(e,s,t),o.passes.render=!0,o.creditDisplay.beginFrame(),e.fog.update(o),n.update(o),e._computeCommandList.length=0,e._overlayCommandList.length=0;var l=e._passState;l.framebuffer=void 0,l.blendingEnabled=void 0,l.scissorTest=void 0;var h=l.viewport;if(h.x=0,h.y=0,h.width=r.drawingBufferWidth,h.height=r.drawingBufferHeight,Ie(e),Me(e),ve(e),De(e,l,u(e.backgroundColor,a.BLACK)),be(e),Pe(e,l),Re(e,l),Ae(e,l),o.creditDisplay.endFrame(),e.debugShowFramesPerSecond){if(!c(e._performanceDisplay)){var d=document.createElement("div");d.className="cesium-performanceDisplay-defaultContainer";var p=e._canvas.parentNode;p.appendChild(d);var m=new X({container:d});e._performanceDisplay=m,e._performanceContainer=d}e._performanceDisplay.update()}else c(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer));r.endFrame(),Oe(o),e._postRender.raiseEvent(e,t)}function Le(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,et);o._setTransform(T.IDENTITY);var h=n.clone(o.position,Qe);n.multiplyByScalar(o.right,l,Je),n.add(Je,h,h),n.multiplyByScalar(o.up,u,Je),n.add(Je,h,h),o._setTransform(c),n.fromElements(h.z,h.x,h.y,h);var d=a.getPixelDimensions(s.width,s.height,1,$e),p=Ke;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 Fe(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,$e),f=m.x*i*.5,v=m.y*r*.5,g=tt;return g.top=p+v,g.bottom=p-v,g.right=d+f,g.left=d-f,g.near=a,g.far=o.far,g.computeCullingVolume(n.positionWC,n.directionWC,n.upWC)}function Be(e,t,i,r){return e._mode===te.SCENE2D?Le(e,t,i,r):Fe(e,t,i,r)}var Ve=.99;h(se.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 D.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return D.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}},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 c(this._oit)}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===te.SCENE2D?this.morphTo2D(0):e===te.SCENE3D?this.morphTo3D(0):e===te.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 L(this),c(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new k(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)}}});var ke,ze=new n,Ue=new n,Ge=new t,We=new B,He=new E,qe=new T(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);qe=T.inverseTransformation(qe,qe);var je=new K,Ye=new Q,Xe=new j;se.prototype.initializeFrame=function(){120===this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms()),this._tweens.update(),this._camera.update(this._mode),this._screenSpaceCameraController.update(),c(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update()};var Ze=new n;se.prototype.render=function(e){try{Ne(this,e)}catch(t){if(this._renderError.raiseEvent(this,t),this.rethrowRenderErrors)throw t}},se.prototype.clampLineWidth=function(e){return Math.max(D.minimumAliasedLineWidth,Math.min(e,D.maximumAliasedLineWidth))};var Ke=new j,Qe=new n,Je=new n,$e=new r,et=new T,tt=new Q,it=3,rt=3,nt=new e(0,0,it,rt),ot=new a(0,0,0,0),at=new r;se.prototype.pick=function(e){var t=this._context,i=t.uniformState,r=this._frameState,n=ie.transformWindowToDrawingBuffer(this,e,at);c(this._pickFramebuffer)||(this._pickFramebuffer=t.createPickFramebuffer()),de(this,r.frameNumber,r.time),r.cullingVolume=Be(this,n,it,rt),r.passes.pick=!0,i.update(r),nt.x=n.x-.5*(it-1),nt.y=this.drawingBufferHeight-n.y-.5*(rt-1);var o=this._pickFramebuffer.begin(nt);Me(this),ve(this),De(this,o,ot,!0),xe(this,o),Re(this,o);var a=this._pickFramebuffer.end(nt);return t.endFrame(),Oe(r),a};var st=new o,lt=new o(1,1/255,1/65025,1/160581375);return se.prototype.pickPosition=function(e,t){if(this.useDepthPicking){var i=this._context,r=i.uniformState,n=ie.transformWindowToDrawingBuffer(this,e,at);n.y=this.drawingBufferHeight-n.y;var a,s=this._camera;c(s.frustum.fov)?a=s.frustum.clone(je):c(s.frustum.infiniteProjectionMatrix)&&(a=s.frustum.clone(Ye));for(var l=this.numberOfFrustums,u=0;l>u;++u){var h=Te(this,u),d=i.readPixels({x:n.x,y:n.y,width:1,height:1,framebuffer:h.framebuffer}),p=o.unpack(d,0,st);o.divideByScalar(p,255,p);var m=o.dot(p,lt);if(m>0&&1>m){var f=this._frustumCommandsList[u];return a.near=f.near*(0!==u?Ve:1),a.far=f.far,r.updateFrustum(a),ie.drawingBufferToWgs84Coordinates(this,n,m,t)}}}},se.prototype.drillPick=function(e,t){var i,r,n=[],o=[],a=[];c(t)||(t=Number.MAX_VALUE);for(var s=this.pick(e);c(s)&&c(s.primitive)&&(n.push(s),!(0>=--t));){var l=s.primitive,u=!1;"function"==typeof l.getGeometryInstanceAttributes&&c(s.id)&&(r=l.getGeometryInstanceAttributes(s.id),c(r)&&c(r.show)&&(u=!0,r.show=A.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=A.toValue(!0,r.show);return n},se.prototype.completeMorph=function(){this._transitioner.completeMorph()},se.prototype.morphTo2D=function(e){var t,i=this.globe;t=c(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=u(e,2),this._transitioner.morphTo2D(e,t)},se.prototype.morphToColumbusView=function(e){var t,i=this.globe;t=c(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=u(e,2),this._transitioner.morphToColumbusView(e,t)},se.prototype.morphTo3D=function(e){var t,i=this.globe;t=c(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=u(e,2),this._transitioner.morphTo3D(e,t)},se.prototype.isDestroyed=function(){return!1},se.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(),c(this._globeDepth)&&this._globeDepth.destroy(),c(this._oit)&&this._oit.destroy(),this._fxaa.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay.destroy(),c(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),d(this)},se}),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){E._image=e,E._tileWidth=e.width,E._tileHeight=e.height,E._ready=!0,E._readyPromise.resolve(!0),c.handleSuccess(E._errorEvent)}function d(e){var t="Failed to load image "+_+".";C=c.handleError(C,E,E._errorEvent,t,0,0,0,p,e),E._readyPromise.reject(new u(t))}function p(){h(s(_),n,d)}r=t(r,{});var m=r.url;this._url=m;var f=r.proxy;this._proxy=f;var v=t(r.rectangle,l.MAX_VALUE),g=new a({rectangle:v,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 _=m;i(f)&&(_=f.getURL(_));var y=r.credit;"string"==typeof y&&(y=new e(y)),this._credit=y;var C,E=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"const float g = -0.95;\nconst float g2 = g * g;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\nvoid main (void)\n{\nfloat fCos = dot(czm_sunDirectionWC, normalize(v_toCamera)) / length(v_toCamera);\nfloat fRayleighPhase = 0.75 * (1.0 + fCos * fCos);\nfloat fMiePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + fCos * fCos) / pow(1.0 + g2 - 2.0 * g * fCos, 1.5);\nconst float fExposure = 2.0;\nvec3 rgb = fRayleighPhase * v_rayleighColor + fMiePhase * v_mieColor;\nrgb = vec3(1.0) - exp(-fExposure * rgb);\nfloat l = czm_luminance(rgb);\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 float fCameraHeight;\nuniform float fCameraHeight2;\nuniform float fOuterRadius;\nuniform float fOuterRadius2;\nuniform float fInnerRadius;\nuniform float fScale;\nuniform float fScaleDepth;\nuniform float fScaleOverScaleDepth;\nconst float Kr = 0.0025;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float Km = 0.0015;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst float ESun = 15.0;\nconst float fKmESun = Km * ESun;\nconst float fKrESun = Kr * ESun;\nconst vec3 v3InvWavelength = 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 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}\nvoid main(void)\n{\nvec3 v3Pos = position.xyz;\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\n#ifdef SKY_FROM_SPACE\nfloat B = 2.0 * dot(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 fStartAngle = dot(v3Ray, v3Start) / fOuterRadius;\nfloat fStartDepth = exp(-1.0 / fScaleDepth);\nfloat fStartOffset = fStartDepth*scale(fStartAngle);\n#else\nvec3 v3Start = czm_viewerPositionWC;\nfloat fHeight = length(v3Start);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fCameraHeight));\nfloat fStartAngle = dot(v3Ray, v3Start) / fHeight;\nfloat fStartOffset = fDepth*scale(fStartAngle);\n#endif\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0, 0.0, 0.0);\nfor(int i=0; i<nSamples; i++)\n{\nfloat fHeight = length(v3SamplePoint);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\nvec3 lightPosition = normalize(czm_viewerPositionWC);\nfloat fLightAngle = dot(lightPosition, v3SamplePoint) / fHeight;\nfloat fCameraAngle = dot(v3Ray, v3SamplePoint) / fHeight;\nfloat fScatter = (fStartOffset + fDepth*(scale(fLightAngle) - scale(fCameraAngle)));\nvec3 v3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\nv3FrontColor += v3Attenuate * (fDepth * fScaledLength);\nv3SamplePoint += v3SampleRay;\n}\nv_mieColor = v3FrontColor * fKmESun;\nv_rayleighColor = v3FrontColor * (v3InvWavelength * fKrESun);\nv_toCamera = czm_viewerPositionWC - v3Pos;\ngl_Position = czm_modelViewProjection * position;\n}\n"}),i("Scene/SkyAtmosphere",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/EllipsoidGeometry","../Core/GeometryPipeline","../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,v,g,_,y){"use strict";function C(i){i=t(i,o.WGS84),this.show=!0,this._ellipsoid=i,this._command=new c({owner:this}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._fCameraHeight=void 0,this._fCameraHeight2=void 0,this._outerRadius=e.maximumComponent(e.multiplyByScalar(i.radii,1.025,new e));var r=i.maximumRadius,n=.25,a=this;this._command.uniformMap={fCameraHeight:function(){return a._fCameraHeight},fCameraHeight2:function(){return a._fCameraHeight2},fOuterRadius:function(){return a._outerRadius},fOuterRadius2:function(){return a._outerRadius*a._outerRadius},fInnerRadius:function(){return r},fScale:function(){return 1/(a._outerRadius-r)},fScaleDepth:function(){return n},fScaleOverScaleDepth:function(){return 1/(a._outerRadius-r)/n}}}return r(C.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),C.prototype.update=function(t){if(this.show&&(t.mode===y.SCENE3D||t.mode===y.MORPHING)&&t.passes.render){var r=this._command;if(!i(r.vertexArray)){var n=t.context,o=a.createGeometry(new a({radii:e.multiplyByScalar(this._ellipsoid.radii,1.025,new e),slicePartitions:256,stackPartitions:256,vertexFormat:l.POSITION_ONLY}));r.vertexArray=m.fromGeometry({context:n,geometry:o,attributeLocations:s.createAttributeLocations(o),bufferUsage:u.STATIC_DRAW}),r.renderState=h.fromCache({cull:{enabled:!0,face:_.FRONT},blending:g.ALPHA_BLEND});var c=new p({defines:["SKY_FROM_SPACE"],sources:[v]});this._spSkyFromSpace=d.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:f}),c=new p({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphere=d.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:f})}var C=t.camera.positionWC;return this._fCameraHeight2=e.magnitudeSquared(C),this._fCameraHeight=Math.sqrt(this._fCameraHeight2),this._fCameraHeight>this._outerRadius?r.shaderProgram=this._spSkyFromSpace:r.shaderProgram=this._spSkyFromAtmosphere,r}},C.prototype.isDestroyed=function(){return!1},C.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(),n(this)},C}),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,v,g,_,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})),E=a.createAttributeLocations(C);s.vertexArray=f.fromGeometry({context:n,geometry:C,attributeLocations:E,bufferUsage:u.STATIC_DRAW}),s.shaderProgram=m.fromCache({context:n,vertexShaderSource:g,fragmentShaderSource:v,attributeLocations:E}),s.renderState=p.fromCache({blending:_.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/BoundingRectangle","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ClearCommand","../Renderer/ComputeCommand","../Renderer/DrawCommand","../Renderer/Framebuffer","../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,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M){"use strict";function D(){this.show=!0,this._drawCommand=new y({primitiveType:m.TRIANGLES,boundingVolume:new t,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new t,this._boundingVolume2D=new t,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 e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}l(D.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var R=new i,O=new i,N=new n,L=new n;return D.prototype.update=function(e){var n=e._passState,o=e.frameState,l=e.context;if(this.show){var u=o.mode;if(u!==I.SCENE2D&&u!==I.MORPHING&&o.passes.render){var m=n.viewport.width,g=n.viewport.height;if(!s(this._texture)||m!==this._drawingBufferWidth||g!==this._drawingBufferHeight||this._glowFactorDirty){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=m,this._drawingBufferHeight=g,this._glowFactorDirty=!1;var y=Math.max(m,g);y=Math.pow(2,Math.ceil(Math.log(y)/Math.log(2))-2),this._texture=new w({context:l,width:y,height:y,pixelFormat:p.RGBA}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;var C=this,D={u_glowLengthTS:function(){return C._glowLengthTS},u_radiusTS:function(){return C._radiusTS}};this._commands.computeCommand=new _({fragmentShaderSource:b,outputTexture:this._texture,uniformMap:D,persists:!1,owner:this,postExecute:function(){C._commands.computeCommand=void 0}})}var F=this._drawCommand;if(!s(F.vertexArray)){var B={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=f.createVertexBuffer({context:l,typedArray:V,usage:v.STATIC_DRAW}),z=[{index:B.direction,vertexBuffer:k,componentsPerAttribute:2,normalize:!0,componentDatatype:a.UNSIGNED_BYTE}],U=f.createIndexBuffer({context:l,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:v.STATIC_DRAW,indexDatatype:c.UNSIGNED_SHORT});F.vertexArray=new T({context:l,attributes:z,indexBuffer:U}),F.shaderProgram=S.fromCache({context:l,vertexShaderSource:A,fragmentShaderSource:x,attributeLocations:B}),F.renderState=E.fromCache({blending:P.ALPHA_BLEND}),F.uniformMap=this._uniformMap}var G=l.uniformState.sunPositionWC,W=l.uniformState.sunPositionColumbusView,H=this._boundingVolume,q=this._boundingVolume2D;r.clone(G,H.center),q.center.x=W.z,q.center.y=W.x,q.center.z=W.y,H.radius=h.SOLAR_RADIUS+h.SOLAR_RADIUS*this._glowLengthTS,q.radius=H.radius,u===I.SCENE3D?t.clone(H,F.boundingVolume):u===I.COLUMBUS_VIEW&&t.clone(q,F.boundingVolume);var j=M.computeActualWgs84Position(o,G,L),Y=r.magnitude(r.subtract(j,e.camera.position,L)),X=l.uniformState.projection,Z=N;Z.x=0,Z.y=0,Z.z=-Y,Z.w=1;var K=d.multiplyByVector(X,Z,L),Q=M.clipToDrawingBufferCoordinates(e,K,R);Z.x=h.SOLAR_RADIUS;var J=d.multiplyByVector(X,Z,L),$=M.clipToDrawingBufferCoordinates(e,J,O);return this._size=Math.ceil(i.magnitude(i.subtract($,Q,L))),this._size=2*this._size*(1+2*this._glowLengthTS),this._commands}}},D.prototype.isDestroyed=function(){return!1},D.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(),u(this)},D}),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/TileMapServiceImageryProvider",["../Core/Cartesian2","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/joinUrls","../Core/loadXML","../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,m,f,v,g){"use strict";function _(o){function s(i){for(var a,s,l,h,v=/tileformat/i,g=/tileset/i,C=/tilesets/i,w=/boundingbox/i,T=/srs/i,x=[],b=i.childNodes[0].childNodes,A=0;A<b.length;A++)if(v.test(b.item(A).nodeName))a=b.item(A);else if(C.test(b.item(A).nodeName)){l=b.item(A);for(var P=b.item(A).childNodes,I=0;I<P.length;I++)g.test(P.item(I).nodeName)&&x.push(P.item(I))}else w.test(b.item(A).nodeName)?s=b.item(A):T.test(b.item(A).nodeName)&&(h=b.item(A).textContent);S._fileExtension=r(S._fileExtension,a.getAttribute("extension")),S._tileWidth=r(S._tileWidth,parseInt(a.getAttribute("width"),10)),S._tileHeight=r(S._tileHeight,parseInt(a.getAttribute("height"),10)),S._minimumLevel=r(S._minimumLevel,parseInt(x[0].getAttribute("order"),10)),S._maximumLevel=r(S._maximumLevel,parseInt(x[x.length-1].getAttribute("order"),10));var M=l.getAttribute("profile"),D=!1;if(("geodetic"===M||"mercator"===M)&&(D=!0),!n(S._tilingScheme))if("geodetic"===M||"global-geodetic"===M)S._tilingScheme=new u({ellipsoid:o.ellipsoid});else{if("mercator"!==M&&"global-mercator"!==M){var R=c(y,"tilemapresource.xml")+"specifies an unsupported profile attribute, "+M+".";return E=m.handleError(E,S,S._errorEvent,R,void 0,void 0,void 0,_),void S._readyPromise.reject(new p(R))}S._tilingScheme=new f({ellipsoid:o.ellipsoid})}var O=S._tilingScheme;if(!n(S._rectangle)){var N,L,F,B;if(D)N=new e(parseFloat(s.getAttribute("miny")),parseFloat(s.getAttribute("minx"))),L=new e(parseFloat(s.getAttribute("maxy")),parseFloat(s.getAttribute("maxx"))),F=t.fromDegrees(N.x,N.y),B=t.fromDegrees(L.x,L.y);else if(N=new e(parseFloat(s.getAttribute("minx")),parseFloat(s.getAttribute("miny"))),L=new e(parseFloat(s.getAttribute("maxx")),parseFloat(s.getAttribute("maxy"))),S._tilingScheme instanceof u)F=t.fromDegrees(N.x,N.y),B=t.fromDegrees(L.x,L.y);else{var V=S._tilingScheme.projection;F=V.unproject(N),B=V.unproject(L)}S._rectangle=new d(F.longitude,F.latitude,B.longitude,B.latitude)}S._rectangle.west<O.rectangle.west&&(S._rectangle.west=O.rectangle.west),S._rectangle.east>O.rectangle.east&&(S._rectangle.east=O.rectangle.east),S._rectangle.south<O.rectangle.south&&(S._rectangle.south=O.rectangle.south),S._rectangle.north>O.rectangle.north&&(S._rectangle.north=O.rectangle.north);var k=O.positionToTileXY(d.southwest(S._rectangle),S._minimumLevel),z=O.positionToTileXY(d.northeast(S._rectangle),S._minimumLevel),U=(Math.abs(z.x-k.x)+1)*(Math.abs(z.y-k.y)+1);U>4&&(S._minimumLevel=0),S._tilingScheme=O,S._ready=!0,S._readyPromise.resolve(!0)}function g(e){S._fileExtension=r(o.fileExtension,"png"),S._tileWidth=r(o.tileWidth,256),S._tileHeight=r(o.tileHeight,256),S._minimumLevel=r(o.minimumLevel,0),S._maximumLevel=o.maximumLevel,S._tilingScheme=n(o.tilingScheme)?o.tilingScheme:new f({ellipsoid:o.ellipsoid}),S._rectangle=r(o.rectangle,S._tilingScheme.rectangle),S._ready=!0,S._readyPromise.resolve(!0)}function _(){var e=c(y,"tilemapresource.xml"),t=S._proxy;n(t)&&(e=t.getURL(e)),v(h(e),s,g)}a("TileMapServiceImageryProvider","Scene/TileMapServiceImageryProvider is deprecated. Use Scene/createTileMapServiceImageryProvider instead."),o=r(o,{});var y=o.url;this._url=y,this._ready=!1,this._readyPromise=v.defer(),this._proxy=o.proxy,this._tileDiscardPolicy=o.tileDiscardPolicy,this._errorEvent=new l,this._fileExtension=o.fileExtension,this._tileWidth=o.tileWidth,this._tileHeight=o.tileHeight,this._minimumLevel=o.minimumLevel,this._maximumLevel=o.maximumLevel,this._rectangle=d.clone(o.rectangle),this._tilingScheme=o.tilingScheme;var C=o.credit;"string"==typeof C&&(C=new i(C)),this._credit=C;var E,S=this;_()}function y(e,t,i,r){var o=e._tilingScheme.getNumberOfYTilesAtLevel(r),a=c(e._url,r+"/"+t+"/"+(o-i-1)+"."+e._fileExtension),s=e._proxy;return n(s)&&(a=s.getURL(a)),a}return o(_.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}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},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=y(this,e,t,i);return g.loadImage(this,r)},_.prototype.pickFeatures=function(){},_}),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/RenderState","../Renderer/ShaderSource","../Shaders/ViewportQuadFS","./BlendingState","./Material","./Pass"],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=u.fromType(u.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=o.fromCache({blending:l.ALPHA_BLEND,viewport:this.rectangle}));var n=t.passes;if(n.render){var u=t.context;if(this._material!==this.material||!i(this._overlayCommand)){this._material=this.material,i(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var h=new a({sources:[this._material.shaderSource,s]});this._overlayCommand=u.createViewportQuadCommand(h,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=c.OVERLAY}this._material.update(u),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(_)&&!i(_[e])&&(_[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,"")),v=e(m(t(r.parameters,t.EMPTY_OBJECT)),p.DefaultParameters);f=e(v,f);var g,_;g=new c(r.url),_=l(t(g.query,""));var y=e(m(t(r.getFeatureInfoParameters,t.EMPTY_OBJECT)),p.GetFeatureInfoDefaultParameters);_=e(y,_),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,E=h.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");i(_)&&(i(_.query_layers)||(_.query_layers=r.layers),i(_.x)||(_.x="{i}"),i(_.y)||(_.y="{j}"),i(_.info_format)||(_.info_format="{format}"),g.query=s(_),C=g.toString().replace(/%7B/g,"{").replace(/%7D/g,"}")),this._tileProvider=new d({url:E,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,withCredentials:r.withCredentials,headers:r.headers})}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/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){"use strict";function f(e){if(e=i(e,i.EMPTY_OBJECT),!r(e.url))throw new o("options.url is required.");if(!r(e.layer))throw new o("options.layer is required.");if(!r(e.style))throw new o("options.style is required.");if(!r(e.tileMatrixSetID))throw new o("options.tileMatrixSetID is required.");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 h({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=p.resolve(!0),this._headers=i(e.headers,void 0),this._withCredentials=i(e.withCredentials,void 0);var n=this._tilingScheme.positionToTileXY(c.southwest(this._rectangle),this._minimumLevel),s=this._tilingScheme.positionToTileXY(c.northeast(this._rectangle),this._minimumLevel),l=(Math.abs(s.x-n.x)+1)*(Math.abs(s.y-n.y)+1);if(l>4)throw new o("The imagery provider's rectangle and minimumLevel indicate that there are "+l+" tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.");this._errorEvent=new a;var u=e.credit;this._credit="string"==typeof u?new t(u):u,this._subdomains=e.subdomains,Array.isArray(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 v(t,n,o,a){var s,c=t._tileMatrixLabels,h=r(c)?c[a]:a.toString(),p=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}",p[(n+o+a)%p.length]);else{var m=new d(t._url),f=u(i(m.query,""));f=e(g,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=l(f),s=m.toString()}var v=t._proxy;return r(v)&&(s=v.getURL(s)),s}var g=s({service:"WMTS",version:"1.0.0",request:"GetTile"});return n(f.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}},headers:{get:function(){return this._headers}},withCredentials:{get:function(){return this._withCredentials}}}),f.prototype.getTileCredits=function(e,t,i){},f.prototype.requestImage=function(e,t,i){var r=v(this,e,t,i);return m.loadImage(this,r)},f.prototype.pickFeatures=function(){},f}),function(){!function(e){var r=this||(0,eval)("this"),n=r.document,o=r.navigator,a=r.jQuery,s=r.JSON;!function(e){"function"==typeof t&&"object"==typeof exports&&"object"==typeof module?e(module.exports||exports,t):"function"==typeof i&&i.amd?i("ThirdParty/knockout-3.2.0",["exports","require"],e):e(r.ko={})}(function(t,i){function l(e,t){return null===e||typeof e in p?e===t:!1}function u(t,i){var r;return function(){r||(r=setTimeout(function(){r=e,t()},i))}}function c(e,t){var i;return function(){clearTimeout(i),i=setTimeout(e,t)}}function h(e,t,i,r){d.d[e]={init:function(e,n,o,a,s){var l,u;return d.s(function(){var o=d.a.c(n()),a=!i!=!o,c=!u;(c||t||a!==l)&&(c&&d.Y.la()&&(u=d.a.ia(d.f.childNodes(e),!0)),a?(c||d.f.T(e,d.a.ia(u)),d.Ca(r?r(s,o):s,e)):d.f.ja(e),l=a)},null,{o:e}),{controlsDescendantBindings:!0}}},d.h.ha[e]=!1,d.f.Q[e]=!0}var d="undefined"!=typeof t?t:{};d.b=function(e,t){for(var i=e.split("."),r=d,n=0;n<i.length-1;n++)r=r[i[n]];r[i[i.length-1]]=t},d.A=function(e,t,i){e[t]=i},d.version="3.2.0",d.b("version",d.version),d.a=function(){function t(e,t){for(var i in e)e.hasOwnProperty(i)&&t(i,e[i])}function i(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}var u={__proto__:[]}instanceof Array,c={},h={};c[o&&/Firefox\/2/i.test(o.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],c.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),t(c,function(e,t){if(t.length)for(var i=0,r=t.length;r>i;i++)h[t[i]]=e});var p={propertychange:!0},m=n&&function(){for(var t=3,i=n.createElement("div"),r=i.getElementsByTagName("i");i.innerHTML="<!--[if gt IE "+ ++t+"]><i></i><![endif]-->",r[0];);return t>4?t:e}();return{vb:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],u:function(e,t){for(var i=0,r=e.length;r>i;i++)t(e[i],i)},m:function(e,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t);for(var i=0,r=e.length;r>i;i++)if(e[i]===t)return i;return-1},qb:function(e,t,i){for(var r=0,n=e.length;n>r;r++)if(t.call(i,e[r],r))return e[r];return null},ua:function(e,t){var i=d.a.m(e,t);i>0?e.splice(i,1):0===i&&e.shift()},rb:function(e){e=e||[];for(var t=[],i=0,r=e.length;r>i;i++)0>d.a.m(t,e[i])&&t.push(e[i]);return t},Da:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;n>r;r++)i.push(t(e[r],r));return i},ta:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;n>r;r++)t(e[r],r)&&i.push(e[r]);return i},ga:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var i=0,r=t.length;r>i;i++)e.push(t[i]);return e},ea:function(e,t,i){var r=d.a.m(d.a.Xa(e),t);0>r?i&&e.push(t):i||e.splice(r,1)},xa:u,extend:i,za:l,Aa:u?l:i,G:t,na: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},Ka:function(e){for(;e.firstChild;)d.removeNode(e.firstChild)},oc:function(e){e=d.a.S(e);for(var t=n.createElement("div"),i=0,r=e.length;r>i;i++)t.appendChild(d.R(e[i]));return t},ia:function(e,t){for(var i=0,r=e.length,n=[];r>i;i++){var o=e[i].cloneNode(!0);n.push(t?d.R(o):o)}return n},T:function(e,t){if(d.a.Ka(e),t)for(var i=0,r=t.length;r>i;i++)e.appendChild(t[i])},Lb: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;a>o;o++)n.insertBefore(t[o],r);for(o=0,a=i.length;a>o;o++)d.removeNode(i[o])}},ka:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.shift();if(1<e.length){var i=e[0],r=e[e.length-1];for(e.length=0;i!==r;)if(e.push(i),i=i.nextSibling,!i)return;e.push(r)}}return e},Nb:function(e,t){7>m?e.setAttribute("selected",t):e.selected=t},cb:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},vc:function(e,t){return e=e||"",t.length>e.length?!1:e.substring(0,t.length)===t},cc: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},Ja:function(e){return d.a.cc(e,e.ownerDocument.documentElement)},ob:function(e){return!!d.a.qb(e,d.a.Ja)},t:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},n:function(e,t,i){var r=m&&p[t];if(!r&&a)a(e).bind(t,i);else if(r||"function"!=typeof e.addEventListener){if("undefined"==typeof e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var n=function(t){i.call(e,t)},o="on"+t;e.attachEvent(o,n),d.a.w.da(e,function(){e.detachEvent(o,n)})}else e.addEventListener(t,i,!1)},oa:function(e,t){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var i;if("input"===d.a.t(e)&&e.type&&"click"==t.toLowerCase()?(i=e.type,i="checkbox"==i||"radio"==i):i=!1,a&&!i)a(e).trigger(t);else if("function"==typeof n.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");i=n.createEvent(h[t]||"HTMLEvents"),i.initEvent(t,!0,!0,r,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(i)}else if(i&&e.click)e.click();else{if("undefined"==typeof e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+t)}},c:function(e){return d.C(e)?e():e},Xa:function(e){return d.C(e)?e.v():e},Ba:function(e,t,i){if(t){var r=/\S+/g,n=e.className.match(r)||[];d.a.u(t.match(r),function(e){d.a.ea(n,e,i)}),e.className=n.join(" ")}},bb:function(t,i){var r=d.a.c(i);(null===r||r===e)&&(r="");var n=d.f.firstChild(t);!n||3!=n.nodeType||d.f.nextSibling(n)?d.f.T(t,[t.ownerDocument.createTextNode(r)]):n.data=r,d.a.fc(t)},Mb:function(e,t){if(e.name=t,7>=m)try{e.mergeAttributes(n.createElement("<input name='"+e.name+"'/>"),!1)}catch(i){}},fc:function(e){m>=9&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},dc:function(e){if(m){var t=e.style.width;e.style.width=0,e.style.width=t}},sc:function(e,t){e=d.a.c(e),t=d.a.c(t);for(var i=[],r=e;t>=r;r++)i.push(r);return i},S:function(e){for(var t=[],i=0,r=e.length;r>i;i++)t.push(e[i]);return t},yc:6===m,zc:7===m,L:m,xb:function(e,t){for(var i=d.a.S(e.getElementsByTagName("input")).concat(d.a.S(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;o>=0;o--)r(i[o])&&n.push(i[o]);return n},pc:function(e){return"string"==typeof e&&(e=d.a.cb(e))?s&&s.parse?s.parse(e):new Function("return "+e)():null},eb:function(e,t,i){if(!s||!s.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 s.stringify(d.a.c(e),t,i)},qc:function(e,i,r){r=r||{};var o=r.params||{},a=r.includeFields||this.vb,s=e;if("object"==typeof e&&"form"===d.a.t(e))for(var s=e.action,l=a.length-1;l>=0;l--)for(var u=d.a.xb(e,a[l]),c=u.length-1;c>=0;c--)o[u[c].name]=u[c].value;i=d.a.c(i);var h=n.createElement("form");h.style.display="none",h.action=s,h.method="post";for(var p in i)e=n.createElement("input"),e.type="hidden",e.name=p,e.value=d.a.eb(d.a.c(i[p])),h.appendChild(e);t(o,function(e,t){var i=n.createElement("input");i.type="hidden",i.name=e,i.value=t,h.appendChild(i)}),n.body.appendChild(h),r.submitter?r.submitter(h):h.submit(),setTimeout(function(){h.parentNode.removeChild(h)},0)}}}(),d.b("utils",d.a),d.b("utils.arrayForEach",d.a.u),d.b("utils.arrayFirst",d.a.qb),d.b("utils.arrayFilter",d.a.ta),d.b("utils.arrayGetDistinctValues",d.a.rb),d.b("utils.arrayIndexOf",d.a.m),d.b("utils.arrayMap",d.a.Da),d.b("utils.arrayPushAll",d.a.ga),d.b("utils.arrayRemoveItem",d.a.ua),d.b("utils.extend",d.a.extend),d.b("utils.fieldsIncludedWithJsonPost",d.a.vb),d.b("utils.getFormFields",d.a.xb),d.b("utils.peekObservable",d.a.Xa),d.b("utils.postJson",d.a.qc),d.b("utils.parseJson",d.a.pc),d.b("utils.registerEventHandler",d.a.n),d.b("utils.stringifyJson",d.a.eb),d.b("utils.range",d.a.sc),d.b("utils.toggleDomNodeCssClass",d.a.Ba),d.b("utils.triggerEvent",d.a.oa),d.b("utils.unwrapObservable",d.a.c),d.b("utils.objectForEach",d.a.G),d.b("utils.addOrRemoveItem",d.a.ea),d.b("unwrap",d.a.c),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this,i=Array.prototype.slice.call(arguments);return e=i.shift(),function(){return t.apply(e,i.concat(Array.prototype.slice.call(arguments)))}}),d.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):!1},F:function(){return i++ +r}}},d.b("utils.domData",d.a.e),d.b("utils.domData.clear",d.a.e.clear),d.a.w=new function(){function t(t,i){var n=d.a.e.get(t,r);return n===e&&i&&(n=[],d.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(d.a.e.clear(e),d.a.w.cleanExternalData(e),o[e.nodeType])for(r=e.firstChild;e=r;)r=e.nextSibling,8===e.nodeType&&i(e)}var r=d.a.e.F(),n={1:!0,8:!0,9:!0},o={1:!0,9:!0};return{da:function(e,i){if("function"!=typeof i)throw Error("Callback must be a function");t(e,!0).push(i)},Kb:function(i,n){var o=t(i,!1);o&&(d.a.ua(o,n),0==o.length&&d.a.e.set(i,r,e))},R:function(e){if(n[e.nodeType]&&(i(e),o[e.nodeType])){var t=[];d.a.ga(t,e.getElementsByTagName("*"));for(var r=0,a=t.length;a>r;r++)i(t[r])}return e},removeNode:function(e){d.R(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){a&&"function"==typeof a.cleanData&&a.cleanData([e])}}},d.R=d.a.w.R,d.removeNode=d.a.w.removeNode,d.b("cleanNode",d.R),d.b("removeNode",d.removeNode),d.b("utils.domNodeDisposal",d.a.w),d.b("utils.domNodeDisposal.addDisposeCallback",d.a.w.da),d.b("utils.domNodeDisposal.removeDisposeCallback",d.a.w.Kb),function(){d.a.ba=function(e){var t;if(a){if(a.parseHTML)t=a.parseHTML(e)||[];else if((t=a.clean([e]))&&t[0]){for(e=t[0];e.parentNode&&11!==e.parentNode.nodeType;)e=e.parentNode;e.parentNode&&e.parentNode.removeChild(e)}}else{var i=d.a.cb(e).toLowerCase();for(t=n.createElement("div"),i=i.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","</table>"]||!i.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!i.indexOf("<td")||!i.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||[0,"",""],e="ignored<div>"+i[1]+e+i[2]+"</div>","function"==typeof r.innerShiv?t.appendChild(r.innerShiv(e)):t.innerHTML=e;i[0]--;)t=t.lastChild;t=d.a.S(t.lastChild.childNodes)}return t},d.a.$a=function(t,i){if(d.a.Ka(t),i=d.a.c(i),null!==i&&i!==e)if("string"!=typeof i&&(i=i.toString()),a)a(t).html(i);else for(var r=d.a.ba(i),n=0;n<r.length;n++)t.appendChild(r[n])}}(),d.b("utils.parseHtmlFragment",d.a.ba),d.b("utils.setHtml",d.a.$a),d.D=function(){function t(e,i){if(e)if(8==e.nodeType){var r=d.D.Gb(e.nodeValue);null!=r&&i.push({bc:e,mc:r})}else if(1==e.nodeType)for(var r=0,n=e.childNodes,o=n.length;o>r;r++)t(n[r],i)}var i={};return{Ua: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+"]-->"},Rb: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]}},Sb:function(e,i){var r=[];t(e,r);for(var n=0,o=r.length;o>n;n++){var a=r[n].bc,s=[a];i&&d.a.ga(s,i),d.D.Rb(r[n].mc,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},Gb:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),d.b("memoization",d.D),d.b("memoization.memoize",d.D.Ua),d.b("memoization.unmemoize",d.D.Rb),d.b("memoization.parseMemoText",d.D.Gb),d.b("memoization.unmemoizeDomNodeAndDescendants",d.D.Sb),d.La={throttle:function(e,t){e.throttleEvaluation=t;var i=null;return d.j({read:e,write:function(r){clearTimeout(i),i=setTimeout(function(){e(r)},t)}})},rateLimit:function(e,t){var i,r,n;"number"==typeof t?i=t:(i=t.timeout,r=t.method),n="notifyWhenChangesStop"==r?c:u,e.Ta(function(e){return n(e,i)})},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var p={undefined:1,"boolean":1,number:1,string:1};d.b("extenders",d.La),d.Pb=function(e,t,i){this.target=e,this.wa=t,this.ac=i,this.Cb=!1,d.A(this,"dispose",this.K)},d.Pb.prototype.K=function(){this.Cb=!0,this.ac()},d.P=function(){d.a.Aa(this,d.P.fn),this.M={}};var m="change",f={U:function(e,t,i){var r=this;i=i||m;var n=new d.Pb(r,t?e.bind(t):e,function(){d.a.ua(r.M[i],n),r.nb&&r.nb()});return r.va&&r.va(i),r.M[i]||(r.M[i]=[]),r.M[i].push(n),n},notifySubscribers:function(e,t){if(t=t||m,this.Ab(t))try{d.k.Ea();for(var i,r=this.M[t].slice(0),n=0;i=r[n];++n)i.Cb||i.wa(e)}finally{d.k.end()}},Ta:function(e){var t,i,r,n=this,o=d.C(n);n.qa||(n.qa=n.notifySubscribers,n.notifySubscribers=function(e,t){t&&t!==m?"beforeChange"===t?n.kb(e):n.qa(e,t):n.lb(e)});var a=e(function(){o&&r===n&&(r=n()),t=!1,n.Pa(i,r)&&n.qa(i=r)});n.lb=function(e){t=!0,r=e,a()},n.kb=function(e){t||(i=e,n.qa(e,"beforeChange"))}},Ab:function(e){return this.M[e]&&this.M[e].length},yb:function(){var e=0;return d.a.G(this.M,function(t,i){e+=i.length}),e},Pa:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},extend:function(e){var t=this;return e&&d.a.G(e,function(e,i){var r=d.La[e];"function"==typeof r&&(t=r(t,i)||t)}),t}};d.A(f,"subscribe",f.U),d.A(f,"extend",f.extend),d.A(f,"getSubscriptionsCount",f.yb),d.a.xa&&d.a.za(f,Function.prototype),d.P.fn=f,d.Db=function(e){return null!=e&&"function"==typeof e.U&&"function"==typeof e.notifySubscribers},d.b("subscribable",d.P),d.b("isSubscribable",d.Db),d.Y=d.k=function(){function e(e){r.push(i),i=e}function t(){i=r.pop()}var i,r=[],n=0;return{Ea:e,end:t,Jb:function(e){if(i){if(!d.Db(e))throw Error("Only subscribable things can act as dependencies");i.wa(e,e.Vb||(e.Vb=++n))}},B:function(i,r,n){try{return e(),i.apply(r,n||[])}finally{t()}},la:function(){return i?i.s.la():void 0},ma:function(){return i?i.ma:void 0}}}(),d.b("computedContext",d.Y),d.b("computedContext.getDependenciesCount",d.Y.la),d.b("computedContext.isInitial",d.Y.ma),d.b("computedContext.isSleeping",d.Y.Ac),d.p=function(e){function t(){return 0<arguments.length?(t.Pa(i,arguments[0])&&(t.X(),i=arguments[0],t.W()),this):(d.k.Jb(t),i)}var i=e;return d.P.call(t),d.a.Aa(t,d.p.fn),t.v=function(){return i},t.W=function(){t.notifySubscribers(i)},t.X=function(){t.notifySubscribers(i,"beforeChange")},d.A(t,"peek",t.v),d.A(t,"valueHasMutated",t.W),d.A(t,"valueWillMutate",t.X),t},d.p.fn={equalityComparer:l};var v=d.p.rc="__ko_proto__";d.p.fn[v]=d.p,d.a.xa&&d.a.za(d.p.fn,d.P.fn),d.Ma=function(t,i){return null===t||t===e||t[v]===e?!1:t[v]===i?!0:d.Ma(t[v],i)},d.C=function(e){return d.Ma(e,d.p)},d.Ra=function(e){return"function"==typeof e&&e[v]===d.p||"function"==typeof e&&e[v]===d.j&&e.hc?!0:!1},d.b("observable",d.p),d.b("isObservable",d.C),d.b("isWriteableObservable",d.Ra),d.b("isWritableObservable",d.Ra),d.aa=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=d.p(e),d.a.Aa(e,d.aa.fn),e.extend({trackArrayChanges:!0})},d.aa.fn={remove:function(e){for(var t=this.v(),i=[],r="function"!=typeof e||d.C(e)?function(t){return t===e}:e,n=0;n<t.length;n++){var o=t[n];r(o)&&(0===i.length&&this.X(),i.push(o),t.splice(n,1),n--)}return i.length&&this.W(),i},removeAll:function(t){if(t===e){var i=this.v(),r=i.slice(0);return this.X(),i.splice(0,i.length),this.W(),r}return t?this.remove(function(e){return 0<=d.a.m(t,e)}):[]},destroy:function(e){var t=this.v(),i="function"!=typeof e||d.C(e)?function(t){return t===e}:e;this.X();for(var r=t.length-1;r>=0;r--)i(t[r])&&(t[r]._destroy=!0);this.W()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=d.a.m(t,e)}):[]},indexOf:function(e){var t=this();return d.a.m(t,e)},replace:function(e,t){var i=this.indexOf(e);i>=0&&(this.X(),this.v()[i]=t,this.W())}},d.a.u("pop push reverse shift sort splice unshift".split(" "),function(e){d.aa.fn[e]=function(){var t=this.v();return this.X(),this.sb(t,e,arguments),t=t[e].apply(t,arguments),this.W(),t}}),d.a.u(["slice"],function(e){d.aa.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),d.a.xa&&d.a.za(d.aa.fn,d.p.fn),d.b("observableArray",d.aa);var g="arrayChange";d.La.trackArrayChanges=function(e){function t(){if(!i){i=!0;var t=e.notifySubscribers;e.notifySubscribers=function(e,i){return i&&i!==m||++n,t.apply(this,arguments)};var o=[].concat(e.v()||[]);r=null,e.U(function(t){if(t=[].concat(t||[]),e.Ab(g)){var i;(!r||n>1)&&(r=d.a.Fa(o,t,{sparse:!0})),i=r,i.length&&e.notifySubscribers(i,g)}o=t,r=null,n=0})}}if(!e.sb){var i=!1,r=null,n=0,o=e.U;e.U=e.subscribe=function(e,i,r){return r===g&&t(),o.apply(this,arguments)},e.sb=function(e,t,o){function a(e,t,i){return s[s.length]={status:e,value:t,index:i}}if(i&&!n){var s=[],l=e.length,u=o.length,c=0;switch(t){case"push":c=l;case"unshift":for(t=0;u>t;t++)a("added",o[t],c+t);break;case"pop":c=l-1;case"shift":l&&a("deleted",e[c],c);break;case"splice":t=Math.min(Math.max(0,0>o[0]?l+o[0]:o[0]),l);for(var l=1===u?l:Math.min(t+(o[1]||0),l),u=t+u-2,c=Math.max(l,u),h=[],p=[],m=2;c>t;++t,++m)l>t&&p.push(a("deleted",e[t],t)),u>t&&h.push(a("added",o[m],t));d.a.wb(p,h);break;default:return}r=s}}}},d.s=d.j=function(t,i,r){function n(){d.a.G(x,function(e,t){t.K()}),x={}}function o(){n(),b=0,v=!0,p=!1}function a(){var e=l.throttleEvaluation;e&&e>=0?(clearTimeout(A),A=setTimeout(s,e)):l.ib?l.ib():s()}function s(t){if(m){if(_)throw Error("A 'pure' computed must not be called recursively")}else if(!v){if(w&&w()){if(!f)return void T()}else f=!1;if(m=!0,y)try{var r={};d.k.Ea({wa:function(e,t){r[t]||(r[t]=1,++b)},s:l,ma:e}),b=0,h=g.call(i)}finally{d.k.end(),m=!1}else try{var n=x,o=b;d.k.Ea({wa:function(e,t){v||(o&&n[t]?(x[t]=n[t],++b,delete n[t],--o):x[t]||(x[t]=e.U(a),++b))},s:l,ma:_?e:!b}),x={},b=0;try{var s=i?g.call(i):g()}finally{d.k.end(),o&&d.a.G(n,function(e,t){t.K()}),p=!1}l.Pa(h,s)&&(l.notifySubscribers(h,"beforeChange"),h=s,!0!==t&&l.notifySubscribers(h))}finally{m=!1}b||T()}}function l(){if(0<arguments.length){if("function"!=typeof C)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 C.apply(i,arguments),this}return d.k.Jb(l),p&&s(!0),h}function u(){return p&&!b&&s(!0),h}function c(){return p||b>0}var h,p=!0,m=!1,f=!1,v=!1,g=t,_=!1,y=!1;if(g&&"object"==typeof g?(r=g,g=r.read):(r=r||{},g||(g=r.read)),"function"!=typeof g)throw Error("Pass a function that returns the value of the ko.computed");var C=r.write,E=r.disposeWhenNodeIsRemoved||r.o||null,S=r.disposeWhen||r.Ia,w=S,T=o,x={},b=0,A=null;i||(i=r.owner),d.P.call(l),d.a.Aa(l,d.j.fn),l.v=u,l.la=function(){return b},l.hc="function"==typeof r.write,l.K=function(){T()},l.Z=c;var P=l.Ta;return l.Ta=function(e){P.call(l,e),l.ib=function(){l.kb(h),p=!0,l.lb(l)}},r.pure?(y=_=!0,l.va=function(){y&&(y=!1,s(!0))},l.nb=function(){l.yb()||(n(),y=p=!0)}):r.deferEvaluation&&(l.va=function(){u(),delete l.va}),d.A(l,"peek",l.v),d.A(l,"dispose",l.K),d.A(l,"isActive",l.Z),d.A(l,"getDependenciesCount",l.la),E&&(f=!0,E.nodeType&&(w=function(){return!d.a.Ja(E)||S&&S()})),y||r.deferEvaluation||s(),E&&c()&&E.nodeType&&(T=function(){d.a.w.Kb(E,T),o()},d.a.w.da(E,T)),l},d.jc=function(e){return d.Ma(e,d.j)},f=d.p.rc,d.j[f]=d.p,d.j.fn={equalityComparer:l},d.j.fn[f]=d.j,d.a.xa&&d.a.za(d.j.fn,d.P.fn),d.b("dependentObservable",d.j),d.b("computed",d.j),d.b("isComputed",d.jc),d.Ib=function(e,t){return"function"==typeof e?d.s(e,t,{pure:!0}):(e=d.a.extend({},e),e.pure=!0,d.s(e,t))},d.b("pureComputed",d.Ib),function(){function t(n,o,a){if(a=a||new r,n=o(n),"object"!=typeof n||null===n||n===e||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.hb=[]}d.Qb=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;d.C(e)&&10>t;t++)e=e();return e})},d.toJSON=function(e,t,i){return e=d.Qb(e),d.a.eb(e,t,i)},r.prototype={save:function(e,t){var i=d.a.m(this.keys,e);i>=0?this.hb[i]=t:(this.keys.push(e),this.hb.push(t))},get:function(t){return t=d.a.m(this.keys,t),t>=0?this.hb[t]:e}}}(),d.b("toJS",d.Qb),d.b("toJSON",d.toJSON),function(){d.i={q:function(t){switch(d.a.t(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?d.a.e.get(t,d.d.options.Va):7>=d.a.L?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?d.i.q(t.options[t.selectedIndex]):e;default:return t.value}},ca:function(t,i,r){switch(d.a.t(t)){case"option":switch(typeof i){case"string":d.a.e.set(t,d.d.options.Va,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=i;break;default:d.a.e.set(t,d.d.options.Va,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;s>a;++a)if(n=d.i.q(t.options[a]),n==i||""==n&&i===e){o=a;break}(r||o>=0||i===e&&1<t.size)&&(t.selectedIndex=o);break;default:(null===i||i===e)&&(i=""),t.value=i}}}}(),d.b("selectExtensions",d.i),d.b("selectExtensions.readValue",d.i.q),d.b("selectExtensions.writeValue",d.i.ca),d.h=function(){function e(e){e=d.a.cb(e),123===e.charCodeAt(0)&&(e=e.slice(1,-1));var t,i,a=[],s=e.match(r),l=0;if(s){s.push(",");for(var u,c=0;u=s[c];++c){var h=u.charCodeAt(0);if(44===h){if(0>=l){t&&a.push(i?{key:t,value:i.join("")}:{unknown:t}),t=i=l=0;continue}}else if(58===h){if(!i)continue}else if(47===h&&c&&1<u.length)(h=s[c-1].match(n))&&!o[h[0]]&&(e=e.substr(e.indexOf(u)+1), +s=e.match(r),s.push(","),c=-1,u="/");else if(40===h||123===h||91===h)++l;else if(41===h||125===h||93===h)--l;else if(!t&&!i){t=34===h||39===h?u.slice(1,-1):u;continue}i?i.push(u):i=[u]}}return a}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{ha:[],V:a,Wa:e,ya:function(r,n){function o(e,r){var n;if(!c){var h=d.getBindingHandler(e);if(h&&h.preprocess&&!(r=h.preprocess(r,e,o)))return;(h=a[e])&&(n=r,0<=d.a.m(t,n)?n=!1:(h=n.match(i),n=null===h?!1: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 d.a.u(h,function(e){o(e.key||e.unknown,e.value)}),l.length&&o("_ko_property_writers","{"+l.join(",")+" }"),s.join(",")},lc:function(e,t){for(var i=0;i<e.length;i++)if(e[i].key==t)return!0;return!1},pa:function(e,t,i,r,n){e&&d.C(e)?!d.Ra(e)||n&&e.v()===r||e(r):(e=t.get("_ko_property_writers"))&&e[i]&&e[i](r)}}}(),d.b("expressionRewriting",d.h),d.b("expressionRewriting.bindingRewriteValidators",d.h.ha),d.b("expressionRewriting.parseObjectLiteral",d.h.Wa),d.b("expressionRewriting.preProcessBindings",d.h.ya),d.b("expressionRewriting._twoWayBindings",d.h.V),d.b("jsonExpressionRewriting",d.h),d.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",d.h.ya),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 r(e,t){var r=i(e,t);return r?0<r.length?r[r.length-1].nextSibling:e.nextSibling:null}var o=n&&"<!--test-->"===n.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};d.f={Q:{},childNodes:function(t){return e(t)?i(t):t.childNodes},ja:function(t){if(e(t)){t=d.f.childNodes(t);for(var i=0,r=t.length;r>i;i++)d.removeNode(t[i])}else d.a.Ka(t)},T:function(t,i){if(e(t)){d.f.ja(t);for(var r=t.nextSibling,n=0,o=i.length;o>n;n++)r.parentNode.insertBefore(i[n],r)}else d.a.T(t,i)},Hb:function(t,i){e(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},Bb:function(t,i,r){r?e(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):d.f.Hb(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=r(i)),i.nextSibling&&t(i.nextSibling)?null:i.nextSibling},gc:e,xc:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},Fb:function(i){if(l[d.a.t(i)]){var n=i.firstChild;if(n)do if(1===n.nodeType){var o;o=n.firstChild;var a=null;if(o)do if(a)a.push(o);else if(e(o)){var s=r(o,!0);s?o=s:a=[o]}else t(o)&&(a=[o]);while(o=o.nextSibling);if(o=a)for(a=n.nextSibling,s=0;s<o.length;s++)a?i.insertBefore(o[s],a):i.appendChild(o[s])}while(n=n.nextSibling)}}}}(),d.b("virtualElements",d.f),d.b("virtualElements.allowedBindings",d.f.Q),d.b("virtualElements.emptyNode",d.f.ja),d.b("virtualElements.insertAfter",d.f.Bb),d.b("virtualElements.prepend",d.f.Hb),d.b("virtualElements.setDomNodeChildren",d.f.T),function(){d.J=function(){this.Yb={}},d.a.extend(d.J.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||d.g.getComponentNameForNode(e);case 8:return d.f.gc(e);default:return!1}},getBindings:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e):null;return d.g.mb(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 d.g.mb(i,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return d.f.xc(e);default:return null}},parseBindingsString:function(e,t,i,r){try{var n,o=this.Yb,a=e+(r&&r.valueAccessors||"");if(!(n=o[a])){var s,l="with($context){with($data||{}){return{"+d.h.ya(e,r)+"}}}";s=new Function("$context","$element",l),n=o[a]=s}return n(t,i)}catch(u){throw u.message="Unable to parse bindings.\nBindings value: "+e+"\nMessage: "+u.message,u}}}),d.J.instance=new d.J}(),d.b("bindingProvider",d.J),function(){function t(e){return function(){return e}}function i(e){return e()}function n(e){return d.a.na(d.k.B(e),function(t,i){return function(){return e()[i]}})}function o(e,t){return n(this.getBindings.bind(this,e,t))}function s(e,t,i){var r,n=d.f.firstChild(t),o=d.J.instance,a=o.preprocessNode;if(a){for(;r=n;)n=d.f.nextSibling(r),a.call(o,r);n=d.f.firstChild(t)}for(;r=n;)n=d.f.nextSibling(r),l(e,r,i)}function l(e,t,i){var r=!0,n=1===t.nodeType;n&&d.f.Fb(t),(n&&i||d.J.instance.nodeHasBindings(t))&&(r=c(t,null,e,i).shouldBindDescendants),r&&!p[d.a.t(t)]&&s(e,t,!n)}function u(e){var t=[],i={},r=[];return d.a.G(e,function n(o){if(!i[o]){var a=d.getBindingHandler(o);a&&(a.after&&(r.push(o),d.a.u(a.after,function(t){if(e[t]){if(-1!==d.a.m(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,zb:a})),i[o]=!0}}),t}function c(t,r,n,a){var s=d.a.e.get(t,m);if(!r){if(s)throw Error("You cannot apply bindings multiple times to the same element.");d.a.e.set(t,m,!0)}!s&&a&&d.Ob(t,n);var l;if(r&&"function"!=typeof r)l=r;else{var c=d.J.instance,h=c.getBindingAccessors||o,p=d.j(function(){return(l=r?r(n,t):h.call(c,t,n))&&n.I&&n.I(),l},null,{o:t});l&&p.Z()||(p=null)}var f;if(l){var v=p?function(e){return function(){return i(p()[e])}}:function(e){return l[e]},g=function(){return d.a.na(p?p():l,i)};g.get=function(e){return l[e]&&i(v(e))},g.has=function(e){return e in l},a=u(l),d.a.u(a,function(i){var r=i.zb.init,o=i.zb.update,a=i.key;if(8===t.nodeType&&!d.f.Q[a])throw Error("The binding '"+a+"' cannot be used with virtual elements");try{"function"==typeof r&&d.k.B(function(){var i=r(t,v(a),g,n.$data,n);if(i&&i.controlsDescendantBindings){if(f!==e)throw Error("Multiple bindings ("+f+" and "+a+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");f=a}}),"function"==typeof o&&d.j(function(){o(t,v(a),g,n.$data,n)},null,{o:t})}catch(s){throw s.message='Unable to process binding "'+a+": "+l[a]+'"\nMessage: '+s.message,s}})}return{shouldBindDescendants:f===e}}function h(e){return e&&e instanceof d.N?e:new d.N(e)}d.d={};var p={script:!0};d.getBindingHandler=function(e){return d.d[e]},d.N=function(t,i,r,n){var o,a=this,s="function"==typeof t&&!d.C(t),l=d.j(function(){var e=s?t():t,o=d.a.c(e);return i?(i.I&&i.I(),d.a.extend(a,i),l&&(a.I=l)):(a.$parents=[],a.$root=o,a.ko=d),a.$rawData=e,a.$data=o,r&&(a[r]=o),n&&n(a,i,o),a.$data},null,{Ia:function(){return o&&!d.a.ob(o)},o:!0});l.Z()&&(a.I=l,l.equalityComparer=null,o=[],l.Tb=function(t){o.push(t),d.a.w.da(t,function(t){d.a.ua(o,t),o.length||(l.K(),a.I=l=e)})})},d.N.prototype.createChildContext=function(e,t,i){return new d.N(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)})},d.N.prototype.extend=function(e){return new d.N(this.I||this.$data,this,null,function(t,i){t.$rawData=i.$rawData,d.a.extend(t,"function"==typeof e?e():e)})};var m=d.a.e.F(),f=d.a.e.F();d.Ob=function(e,t){return 2!=arguments.length?d.a.e.get(e,f):(d.a.e.set(e,f,t),void(t.I&&t.I.Tb(e)))},d.ra=function(e,t,i){return 1===e.nodeType&&d.f.Fb(e),c(e,t,h(i),!0)},d.Wb=function(e,i,r){return r=h(r),d.ra(e,"function"==typeof i?n(i.bind(null,r,e)):d.a.na(i,t),r)},d.Ca=function(e,t){1!==t.nodeType&&8!==t.nodeType||s(h(e),t,!0)},d.pb=function(e,t){if(!a&&r.jQuery&&(a=r.jQuery),t&&1!==t.nodeType&&8!==t.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");t=t||r.document.body,l(h(e),t,!0)},d.Ha=function(t){switch(t.nodeType){case 1:case 8:var i=d.Ob(t);if(i)return i;if(t.parentNode)return d.Ha(t.parentNode)}return e},d.$b=function(t){return(t=d.Ha(t))?t.$data:e},d.b("bindingHandlers",d.d),d.b("applyBindings",d.pb),d.b("applyBindingsToDescendants",d.Ca),d.b("applyBindingAccessorsToNode",d.ra),d.b("applyBindingsToNode",d.Wb),d.b("contextFor",d.Ha),d.b("dataFor",d.$b)}(),function(e){function t(t,r){var a,s=n.hasOwnProperty(t)?n[t]:e;s||(s=n[t]=new d.P,i(t,function(e){o[t]=e,delete n[t],a?s.notifySubscribers(e):setTimeout(function(){s.notifySubscribers(e)},0)}),a=!0),s.U(r)}function i(e,t){r("getConfig",[e],function(i){i?r("loadComponent",[e,i],function(e){t(e)}):t(null)})}function r(t,i,n,o){o||(o=d.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={};d.g={get:function(i,r){var n=o.hasOwnProperty(i)?o[i]:e;n?setTimeout(function(){r(n)},0):t(i,r)},tb:function(e){delete o[e]},jb:r},d.g.loaders=[],d.b("components",d.g),d.b("components.get",d.g.get),d.b("components.clearCachedDefinition",d.g.tb)}(),function(){function e(e,t,i,r){function n(){0===--a&&r(o)}var o={},a=2,l=i.template;i=i.viewModel,l?s(t,l,function(t){d.g.jb("loadTemplate",[e,t],function(e){o.template=e,n()})}):n(),i?s(t,i,function(t){d.g.jb("loadViewModel",[e,t],function(e){o[c]=e,n()})}):n()}function t(e,i,r){if("function"==typeof i)r(function(e){return new i(e)});else if("function"==typeof i[c])r(i[c]);else if("instance"in i){var n=i.instance;r(function(){return n})}else"viewModel"in i?t(e,i.viewModel,r):e("Unknown viewModel value: "+i)}function o(e){switch(d.a.t(e)){case"script":return d.a.ba(e.text);case"textarea":return d.a.ba(e.value);case"template":if(a(e.content))return d.a.ia(e.content.childNodes)}return d.a.ia(e.childNodes)}function a(e){return r.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function s(e,t,n){"string"==typeof t.require?i||r.require?(i||r.require)([t.require],n):e("Uses require, but no AMD loader is present"):n(t)}function l(e){return function(t){throw Error("Component '"+e+"': "+t)}}var u={};d.g.tc=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(d.g.Qa(e))throw Error("Component "+e+" is already registered");u[e]=t},d.g.Qa=function(e){return e in u},d.g.wc=function(e){delete u[e],d.g.tb(e)},d.g.ub={getConfig:function(e,t){t(u.hasOwnProperty(e)?u[e]:null)},loadComponent:function(t,i,r){var n=l(t);s(n,i,function(i){e(t,n,i,r)})},loadTemplate:function(e,t,i){if(e=l(e),"string"==typeof t)i(d.a.ba(t));else if(t instanceof Array)i(t);else if(a(t))i(d.a.S(t.childNodes));else if(t.element)if(t=t.element,r.HTMLElement?t instanceof HTMLElement:t&&t.tagName&&1===t.nodeType)i(o(t));else if("string"==typeof t){var s=n.getElementById(t);s?i(o(s)):e("Cannot find element with ID "+t)}else e("Unknown element type: "+t);else e("Unknown template value: "+t)},loadViewModel:function(e,i,r){t(l(e),i,r)}};var c="createViewModel";d.b("components.register",d.g.tc),d.b("components.isRegistered",d.g.Qa),d.b("components.unregister",d.g.wc),d.b("components.defaultLoader",d.g.ub),d.g.loaders.push(d.g.ub),d.g.Ub=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=d.a.na(r,function(t){return d.s(t,null,{o:e})}),n=d.a.na(r,function(t){return t.Z()?d.s(function(){return d.a.c(t())},null,{o:e}):t.v()});return n.hasOwnProperty("$raw")||(n.$raw=r),n}return{$raw:{}}}d.g.getComponentNameForNode=function(e){return e=d.a.t(e),d.g.Qa(e)&&e},d.g.mb=function(t,i,r,n){if(1===i.nodeType){var o=d.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 d.J;9>d.a.L&&(d.g.register=function(e){return function(t){return n.createElement(t),e.apply(this,arguments)}}(d.g.register),n.createDocumentFragment=function(e){return function(){var t,i=e(),r=d.g.Ub;for(t in r)r.hasOwnProperty(t)&&i.createElement(t);return i}}(n.createDocumentFragment))}(),function(){var e=0;d.d.component={init:function(t,i,r,n,o){function a(){var e=s&&s.dispose;"function"==typeof e&&e.call(s),l=null}var s,l;return d.a.w.da(t,a),d.s(function(){var r,n,u=d.a.c(i());if("string"==typeof u?r=u:(r=d.a.c(u.name),n=d.a.c(u.params)),!r)throw Error("No component name specified");var c=l=++e;d.g.get(r,function(e){if(l===c){if(a(),!e)throw Error("Unknown component '"+r+"'");var i=e.template;if(!i)throw Error("Component '"+r+"' has no template");i=d.a.ia(i),d.f.T(t,i);var i=n,u=e.createViewModel;e=u?u.call(e,i,{element:t}):i,i=o.createChildContext(e),s=e,d.Ca(i,t)}})},null,{o:t}),{controlsDescendantBindings:!0}}},d.f.Q.component=!0}();var _={"class":"className","for":"htmlFor"};d.d.attr={update:function(t,i){var r=d.a.c(i())||{};d.a.G(r,function(i,r){r=d.a.c(r);var n=!1===r||null===r||r===e;n&&t.removeAttribute(i),8>=d.a.L&&i in _?(i=_[i],n?t.removeAttribute(i):t[i]=r):n||t.setAttribute(i,r.toString()),"name"===i&&d.a.Mb(t,n?"":r.toString())})}},function(){d.d.checked={after:["value","attr"],init:function(t,i,r){function n(){var e=t.checked,n=h?a():e;if(!d.Y.ma()&&(!l||e)){var o=d.k.B(i);u?c!==n?(e&&(d.a.ea(o,n,!0),d.a.ea(o,c,!1)),c=n):d.a.ea(o,n,e):d.h.pa(o,r,"checked",n,!0)}}function o(){var e=d.a.c(i());t.checked=u?0<=d.a.m(e,a()):s?e:a()===e}var a=d.Ib(function(){return r.has("checkedValue")?d.a.c(r.get("checkedValue")):r.has("value")?d.a.c(r.get("value")):t.value}),s="checkbox"==t.type,l="radio"==t.type;if(s||l){var u=s&&d.a.c(i())instanceof Array,c=u?a():e,h=l||u;l&&!t.name&&d.d.uniqueName.init(t,function(){return!0}),d.s(n,null,{o:t}),d.a.n(t,"click",n),d.s(o,null,{o:t})}}},d.h.V.checked=!0,d.d.checkedValue={update:function(e,t){e.value=d.a.c(t())}}}(),d.d.css={update:function(e,t){var i=d.a.c(t());"object"==typeof i?d.a.G(i,function(t,i){i=d.a.c(i),d.a.Ba(e,t,i)}):(i=String(i||""),d.a.Ba(e,e.__ko__cssValue,!1),e.__ko__cssValue=i,d.a.Ba(e,i,!0))}},d.d.enable={update:function(e,t){var i=d.a.c(t());i&&e.disabled?e.removeAttribute("disabled"):i||e.disabled||(e.disabled=!0)}},d.d.disable={update:function(e,t){d.d.enable.update(e,function(){return!d.a.c(t())})}},d.d.event={init:function(e,t,i,r,n){var o=t()||{};d.a.G(o,function(o){"string"==typeof o&&d.a.n(e,o,function(e){var a,s=t()[o];if(s){try{var l=d.a.S(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())}})})}},d.d.foreach={Eb:function(e){return function(){var t=e(),i=d.a.Xa(t);return i&&"number"!=typeof i.length?(d.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:d.O.Oa}):{foreach:t,templateEngine:d.O.Oa}}},init:function(e,t){return d.d.template.init(e,d.d.foreach.Eb(t))},update:function(e,t,i,r,n){return d.d.template.update(e,d.d.foreach.Eb(t),i,r,n)}},d.h.ha.foreach=!1,d.f.Q.foreach=!0,d.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(a){o=n.body}r=o===e}n=t(),d.h.pa(n,i,"hasfocus",r,!0),e.__ko_hasfocusLastValue=r,e.__ko_hasfocusUpdating=!1}var n=r.bind(null,!0),o=r.bind(null,!1);d.a.n(e,"focus",n),d.a.n(e,"focusin",n),d.a.n(e,"blur",o),d.a.n(e,"focusout",o)},update:function(e,t){var i=!!d.a.c(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===i||(i?e.focus():e.blur(),d.k.B(d.a.oa,null,[e,i?"focusin":"focusout"]))}},d.h.V.hasfocus=!0,d.d.hasFocus=d.d.hasfocus,d.h.V.hasFocus=!0,d.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){d.a.$a(e,t())}},h("if"),h("ifnot",!1,!0),h("with",!0,!1,function(e,t){return e.createChildContext(t)});var y={};d.d.options={init:function(e){if("select"!==d.a.t(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 d.a.ta(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(h.length){var r=0<=d.a.m(h,d.i.q(i[0]));d.a.Nb(i[0],r),p&&!r&&d.k.B(d.a.oa,null,[t,"change"])}}var s=0!=t.length&&t.multiple?t.scrollTop:null,l=d.a.c(i()),u=r.get("optionsIncludeDestroyed");i={};var c,h;h=t.multiple?d.a.Da(n(),d.i.q):0<=t.selectedIndex?[d.i.q(t.options[t.selectedIndex])]:[],l&&("undefined"==typeof l.length&&(l=[l]),c=d.a.ta(l,function(t){return u||t===e||null===t||!d.a.c(t._destroy)}),r.has("optionsCaption")&&(l=d.a.c(r.get("optionsCaption")),null!==l&&l!==e&&c.unshift(y)));var p=!1;i.beforeRemove=function(e){t.removeChild(e)},l=a,r.has("optionsAfterRender")&&(l=function(t,i){a(0,i),d.k.B(r.get("optionsAfterRender"),null,[i[0],t!==y?t:e])}),d.a.Za(t,c,function(i,n,a){return a.length&&(h=a[0].selected?[d.i.q(a[0])]:[],p=!0),n=t.ownerDocument.createElement("option"),i===y?(d.a.bb(n,r.get("optionsCaption")),d.i.ca(n,e)):(a=o(i,r.get("optionsValue"),i),d.i.ca(n,d.a.c(a)),i=o(i,r.get("optionsText"),a),d.a.bb(n,i)),[n]},i,l),d.k.B(function(){r.get("valueAllowUnset")&&r.has("value")?d.i.ca(t,d.a.c(r.get("value")),!0):(t.multiple?h.length&&n().length<h.length:h.length&&0<=t.selectedIndex?d.i.q(t.options[t.selectedIndex])!==h[0]:h.length||0<=t.selectedIndex)&&d.a.oa(t,"change")}),d.a.dc(t),s&&20<Math.abs(s-t.scrollTop)&&(t.scrollTop=s)}},d.d.options.Va=d.a.e.F(),d.d.selectedOptions={after:["options","foreach"],init:function(e,t,i){d.a.n(e,"change",function(){var r=t(),n=[];d.a.u(e.getElementsByTagName("option"),function(e){e.selected&&n.push(d.i.q(e))}),d.h.pa(r,i,"selectedOptions",n)})},update:function(e,t){if("select"!=d.a.t(e))throw Error("values binding applies only to SELECT elements");var i=d.a.c(t());i&&"number"==typeof i.length&&d.a.u(e.getElementsByTagName("option"),function(e){var t=0<=d.a.m(i,d.i.q(e));d.a.Nb(e,t)})}},d.h.V.selectedOptions=!0,d.d.style={update:function(t,i){var r=d.a.c(i()||{});d.a.G(r,function(i,r){r=d.a.c(r),(null===r||r===e||!1===r)&&(r=""),t.style[i]=r})}},d.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");d.a.n(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)}})}},d.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){d.a.bb(e,t())}},d.f.Q.text=!0,function(){if(r&&r.navigator)var t=function(e){return e?parseFloat(e[1]):void 0},i=r.opera&&r.opera.version&&parseInt(r.opera.version()),n=r.navigator.userAgent,o=t(n.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),a=t(n.match(/Firefox\/([^ ]*)/));if(10>d.a.L)var s=d.a.e.F(),l=d.a.e.F(),u=function(e){var t=this.activeElement;(t=t&&d.a.e.get(t,l))&&t(e)},c=function(e,t){var i=e.ownerDocument;d.a.e.get(i,s)||(d.a.e.set(i,s,!0),d.a.n(i,"selectionchange",u)),d.a.e.set(e,l,t)};d.d.textInput={init:function(t,r,n){function s(e,i){d.a.n(t,e,i)}function l(){var i=d.a.c(r());(null===i||i===e)&&(i=""),m!==e&&i===m?setTimeout(l,4):t.value!==i&&(f=i,t.value=i)}function u(){p||(m=t.value,p=setTimeout(h,4))}function h(){clearTimeout(p),m=p=e;var i=t.value;f!==i&&(f=i,d.h.pa(r(),n,"textInput",i))}var p,m,f=t.value;10>d.a.L?(s("propertychange",function(e){"value"===e.propertyName&&h()}),8==d.a.L&&(s("keyup",h),s("keydown",h)),8<=d.a.L&&(c(t,h),s("dragend",u))):(s("input",h),5>o&&"textarea"===d.a.t(t)?(s("keydown",u),s("paste",u),s("cut",u)):11>i?s("keydown",u):4>a&&(s("DOMAutoComplete",h),s("dragdrop",h),s("drop",h))),s("change",h),d.s(l,null,{o:t})}},d.h.V.textInput=!0,d.d.textinput={preprocess:function(e,t,i){i("textInput",e)}}}(),d.d.uniqueName={init:function(e,t){if(t()){var i="ko_unique_"+ ++d.d.uniqueName.Zb;d.a.Mb(e,i)}}},d.d.uniqueName.Zb=0,d.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]),d.a.ga(r,n),r=d.a.rb(r));var s=function(){a=null,o=!1;var r=t(),n=d.i.q(e);d.h.pa(r,i,"value",n)};!d.a.L||"input"!=e.tagName.toLowerCase()||"text"!=e.type||"off"==e.autocomplete||e.form&&"off"==e.form.autocomplete||-1!=d.a.m(r,"propertychange")||(d.a.n(e,"propertychange",function(){o=!0}),d.a.n(e,"focus",function(){o=!1}),d.a.n(e,"blur",function(){o&&s()})),d.a.u(r,function(t){var i=s;d.a.vc(t,"after")&&(i=function(){a=d.i.q(e),setTimeout(s,0)},t=t.substring(5)),d.a.n(e,t,i)});var l=function(){var r=d.a.c(t()),n=d.i.q(e);if(null!==a&&r===a)setTimeout(l,0);else if(r!==n)if("select"===d.a.t(e)){var o=i.get("valueAllowUnset"),n=function(){d.i.ca(e,r,o)};n(),o||r===d.i.q(e)?setTimeout(n,0):d.k.B(d.a.oa,null,[e,"change"])}else d.i.ca(e,r)};d.s(l,null,{o:e})}else d.ra(e,{checkedValue:t})},update:function(){}},d.h.V.value=!0,d.d.visible={update:function(e,t){var i=d.a.c(t()),r="none"!=e.style.display;i&&!r?e.style.display="":!i&&r&&(e.style.display="none")}},function(e){d.d[e]={init:function(t,i,r,n,o){return d.d.event.init.call(this,t,function(){var t={};return t[e]=i(),t},r,n,o)}}}("click"),d.H=function(){},d.H.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},d.H.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},d.H.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){t=t||n;var i=t.getElementById(e);if(!i)throw Error("Cannot find template with ID "+e);return new d.r.l(i)}if(1==e.nodeType||8==e.nodeType)return new d.r.fa(e);throw Error("Unknown template type: "+e)},d.H.prototype.renderTemplate=function(e,t,i,r){return e=this.makeTemplateSource(e,r),this.renderTemplateSource(e,t,i)},d.H.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(e,t).data("isRewritten")},d.H.prototype.rewriteTemplate=function(e,t,i){e=this.makeTemplateSource(e,i),t=t(e.text()),e.text(t),e.data("isRewritten",!0)},d.b("templateEngine",d.H),d.fb=function(){function e(e,t,i,r){e=d.h.Wa(e);for(var n=d.h.ha,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{ "+d.h.ya(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{ec:function(e,t,i){t.isTemplateRewritten(e,i)||t.rewriteTemplate(e,function(e){return d.fb.nc(e,t)},i)},nc: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)})},Xb:function(e,t){return d.D.Ua(function(i,r){var n=i.nextSibling;n&&n.nodeName.toLowerCase()===t&&d.ra(n,e,r)})}}}(),d.b("__tr_ambtns",d.fb.Xb),function(){d.r={},d.r.l=function(e){this.l=e},d.r.l.prototype.text=function(){var e=d.a.t(this.l),e="script"===e?"text":"textarea"===e?"value":"innerHTML";if(0==arguments.length)return this.l[e];var t=arguments[0];"innerHTML"===e?d.a.$a(this.l,t):this.l[e]=t};var t=d.a.e.F()+"_";d.r.l.prototype.data=function(e){return 1===arguments.length?d.a.e.get(this.l,t+e):void d.a.e.set(this.l,t+e,arguments[1])};var i=d.a.e.F();d.r.fa=function(e){this.l=e},d.r.fa.prototype=new d.r.l,d.r.fa.prototype.text=function(){if(0==arguments.length){var t=d.a.e.get(this.l,i)||{};return t.gb===e&&t.Ga&&(t.gb=t.Ga.innerHTML),t.gb}d.a.e.set(this.l,i,{gb:arguments[0]})},d.r.l.prototype.nodes=function(){return 0==arguments.length?(d.a.e.get(this.l,i)||{}).Ga:void d.a.e.set(this.l,i,{Ga:arguments[0]})},d.b("templateSources",d.r),d.b("templateSources.domElement",d.r.l),d.b("templateSources.anonymousTemplate",d.r.fa)}(),function(){function t(e,t,i){var r;for(t=d.f.nextSibling(t);e&&(r=e)!==t;)e=d.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=d.J.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),d.a.ka(e,o))}t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||d.pb(i,e)}),t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||d.D.Sb(e,[i])}),d.a.ka(e,o)}}function r(e){return e.nodeType?e:0<e.length?e[0]:null}function n(e,t,n,a,s){s=s||{};var l=e&&r(e),l=l&&l.ownerDocument,u=s.templateEngine||o;if(d.fb.ec(n,u,l),n=u.renderTemplate(n,a,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":d.f.T(e,n),l=!0;break;case"replaceNode":d.a.Lb(e,n),l=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}return l&&(i(n,a),s.afterRender&&d.k.B(s.afterRender,null,[n,a.$data])),n}var o;d.ab=function(t){if(t!=e&&!(t instanceof d.H))throw Error("templateEngine must inherit from ko.templateEngine");o=t},d.Ya=function(t,i,a,s,l){if(a=a||{},(a.templateEngine||o)==e)throw Error("Set a template engine before calling renderTemplate");if(l=l||"replaceChildren",s){var u=r(s);return d.j(function(){var e=i&&i instanceof d.N?i:new d.N(d.a.c(i)),o=d.C(t)?t():"function"==typeof t?t(e.$data,e):t,e=n(s,l,o,e,a);"replaceNode"==l&&(s=e,u=r(s))},null,{Ia:function(){return!u||!d.a.Ja(u)},o:u&&"replaceNode"==l?u.parentNode:u})}return d.D.Ua(function(e){d.Ya(t,i,a,e,"replaceNode")})},d.uc=function(t,r,o,a,s){function l(e,t){i(t,c),o.afterRender&&o.afterRender(t,e)}function u(e,i){c=s.createChildContext(e,o.as,function(e){e.$index=i});var r=d.C(t)?t():"function"==typeof t?t(e,c):t;return n(null,"ignoreTargetNode",r,c,o)}var c;return d.j(function(){var t=d.a.c(r)||[];"undefined"==typeof t.length&&(t=[t]),t=d.a.ta(t,function(t){return o.includeDestroyed||t===e||null===t||!d.a.c(t._destroy)}),d.k.B(d.a.Za,null,[a,t,u,o,l])},null,{o:a})};var a=d.a.e.F();d.d.template={init:function(e,t){var i=d.a.c(t());return"string"==typeof i||i.name?d.f.ja(e):(i=d.f.childNodes(e),i=d.a.oc(i),new d.r.fa(e).nodes(i)),{controlsDescendantBindings:!0}},update:function(t,i,r,n,o){var s,l=i();i=d.a.c(l),r=!0,n=null,"string"==typeof i?i={}:(l=i.name,"if"in i&&(r=d.a.c(i["if"])),r&&"ifnot"in i&&(r=!d.a.c(i.ifnot)),s=d.a.c(i.data)),"foreach"in i?n=d.uc(l||t,r&&i.foreach||[],i,t,o):r?(o="data"in i?o.createChildContext(s,i.as):o,n=d.Ya(l||t,o,i,t)):d.f.ja(t),o=n,(s=d.a.e.get(t,a))&&"function"==typeof s.K&&s.K(),d.a.e.set(t,a,o&&o.Z()?o:e)}},d.h.ha.template=function(e){return e=d.h.Wa(e),1==e.length&&e[0].unknown||d.h.lc(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"},d.f.Q.template=!0}(),d.b("setTemplateEngine",d.ab),d.b("renderTemplate",d.Ya),d.a.wb=function(e,t,i){if(e.length&&t.length){var r,n,o,a,s;for(r=n=0;(!i||i>r)&&(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}}},d.a.Fa=function(){function e(e,t,i,r,n){var o,a,s,l,u,c=Math.min,h=Math.max,p=[],m=e.length,f=t.length,v=f-m||1,g=m+f+1;for(o=0;m>=o;o++)for(l=s,p.push(s=[]),u=c(f,o+v),a=h(0,o-1);u>=a;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=[],v=[],o=m,a=f;o||a;)f=p[o][a]-1,a&&f===p[o][a-1]?h.push(c[c.length]={status:i,value:t[--a],index:a}):o&&f===p[o-1][a]?v.push(c[c.length]={status:r,value:e[--o],index:o}):(--a,--o,n.sparse||c.push({status:"retained",value:t[a]}));return d.a.wb(h,v,10*m),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)}}(),d.b("utils.compareArrays",d.a.Fa),function(){function t(t,i,r,n,o){var a=[],s=d.j(function(){var e=i(r,o,d.a.ka(a,t))||[];0<a.length&&(d.a.Lb(a,e),n&&d.k.B(n,null,[r,e,o])),a.length=0,d.a.ga(a,e)},null,{o:t,Ia:function(){return!d.a.ob(a)}});return{$:a,j:s.Z()?s:e}}var i=d.a.e.F();d.a.Za=function(r,n,o,a,s){function l(e,t){C=h[t],g!==t&&(w[e]=C),C.Na(g++),d.a.ka(C.$,r),f.push(C),y.push(C)}function u(e,t){if(e)for(var i=0,r=t.length;r>i;i++)t[i]&&d.a.u(t[i].$,function(r){e(r,i,t[i].sa)})}n=n||[],a=a||{};var c=d.a.e.get(r,i)===e,h=d.a.e.get(r,i)||[],p=d.a.Da(h,function(e){return e.sa}),m=d.a.Fa(p,n,a.dontLimitMoves),f=[],v=0,g=0,_=[],y=[];n=[];for(var C,E,S,w=[],p=[],T=0;E=m[T];T++)switch(S=E.moved,E.status){case"deleted":S===e&&(C=h[v],C.j&&C.j.K(),_.push.apply(_,d.a.ka(C.$,r)),a.beforeRemove&&(n[T]=C,y.push(C))),v++;break;case"retained":l(T,v++);break;case"added":S!==e?l(T,S):(C={sa:E.value,Na:d.p(g++)},f.push(C),y.push(C),c||(p[T]=C))}u(a.beforeMove,w),d.a.u(_,a.beforeRemove?d.R:d.removeNode);for(var x,T=0,c=d.f.firstChild(r);C=y[T];T++){for(C.$||d.a.extend(C,t(r,o,C.sa,s,C.Na)),v=0;m=C.$[v];c=m.nextSibling,x=m,v++)m!==c&&d.f.Bb(r,m,x);!C.ic&&s&&(s(C.sa,C.$,C.Na),C.ic=!0)}u(a.beforeRemove,n),u(a.afterMove,w),u(a.afterAdd,p),d.a.e.set(r,i,f)}}(),d.b("utils.setDomNodeChildrenFromArrayMapping",d.a.Za),d.O=function(){this.allowTemplateRewriting=!1},d.O.prototype=new d.H,d.O.prototype.renderTemplateSource=function(e){var t=(9>d.a.L?0:e.nodes)?e.nodes():null;return t?d.a.S(t.cloneNode(!0).childNodes):(e=e.text(),d.a.ba(e))},d.O.Oa=new d.O,d.ab(d.O.Oa),d.b("nativeTemplateEngine",d.O),function(){d.Sa=function(){var e=this.kc=function(){if(!a||!a.tmpl)return 0;try{if(0<=a.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(t,i,r){if(r=r||{},2>e)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var o=t.data("precompiled");return o||(o=t.text()||"",o=a.template(null,"{{ko_with $item.koBindingContext}}"+o+"{{/ko_with}}"),t.data("precompiled",o)),t=[i.$data],i=a.extend({koBindingContext:i},r.templateOptions),i=a.tmpl(o,t,i),i.appendTo(n.createElement("div")),a.fragments={},i},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){n.write("<script type='text/html' id='"+e+"'>"+t+"</script>")},e>0&&(a.tmpl.tag.ko_code={open:"__.push($1 || '');"},a.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},d.Sa.prototype=new d.H;var e=new d.Sa;0<e.kc&&d.ab(e),d.b("jqueryTmplTemplateEngine",d.Sa)}()})}()}(),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.2.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:/Android/gi.test(navigator.userAgent),iOS:/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(_,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;n>r;++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(_,"text");r.setAttribute("x",e),r.setAttribute("y",t),r.setAttribute("class","cesium-animation-svgText");var n=document.createElementNS(_,"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):m>p?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 v(e,t){function i(e){m(b,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(_,"svg:svg");this._svgNode=s,s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",y);var h=document.createElementNS(_,"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 v=document.createElementNS(_,"g");v.appendChild(this._realtimeSVG.svgElement),v.appendChild(this._playReverseSVG.svgElement),v.appendChild(this._playForwardSVG.svgElement),v.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 E=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,w=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 T=l({tagName:"circle","class":"cesium-animation-blank",cx:0,cy:0,r:S}),x=document.createElementNS(_,"g");x.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(n),h.appendChild(x),h.appendChild(E),h.appendChild(v),x.appendChild(g),x.appendChild(C),x.appendChild(this._shuttleRingPointer),E.appendChild(this._knobOuter),E.appendChild(w),E.appendChild(this._knobDate),E.appendChild(this._knobTime),E.appendChild(this._knobStatus),E.appendChild(T),s.appendChild(h),e.appendChild(s);var b=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),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],I=this._knobDate.childNodes[0],M=this._knobStatus.childNodes[0];this._subscriptions=[a(t.pauseViewModel,"toggled",function(e){A!==e&&(A=e,A?b._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):b._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),a(t,"shuttleRingAngle",function(e){c(b._shuttleRingPointer,b._knobOuter,e)}),a(t,"dateLabel",function(e){I.textContent!==e&&(I.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,_="http://www.w3.org/2000/svg",y="http://www.w3.org/1999/xlink",C=e.fromCssColorString("rgba(247,250,255,0.384)"),E=e.fromCssColorString("rgba(143,191,255,0.216)"),S=e.fromCssColorString("rgba(153,197,255,0.098)"),w=e.fromCssColorString("rgba(255,255,255,0.086)"),T=e.fromCssColorString("rgba(255,255,255,0.267)"),x=e.fromCssColorString("rgba(255,255,255,0)"),b=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;i>t;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(v.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),v.prototype.isDestroyed=function(){return!1},v.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),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;n>i;i++)t[i].dispose();return r(this)},v.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}},v.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,E)},{tagName:"stop",offset:"46%","stop-color":h(e,S)},{tagName:"stop",offset:"81%","stop-color":h(e,w)}]},{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,E)},{tagName:"stop",offset:"46%","stop-color":h(i,S)},{tagName:"stop",offset:"81%","stop-color":h(i,w)}]},{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,E)},{tagName:"stop",offset:"46%","stop-color":h(r,S)},{tagName:"stop",offset:"81%","stop-color":h(r,w)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(n,T)},{tagName:"stop",offset:"75%","stop-color":h(n,x)}]},{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,b)},{tagName:"stop",offset:"85%","stop-color":h(o,E)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,b)},{tagName:"stop",offset:"60%","stop-color":h(o,C)},{tagName:"stop",offset:"85%","stop-color":h(o,w)}]},{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},v}),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){e.clockStep===i.SYSTEM_CLOCK&&(e.clockStep=i.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=1)}function d(e){h(e),e.shouldAnimate=!0}function p(e,t){return e-t}function m(t,i){var r=e(i,t,p);return 0>r?~r:r}function f(e,t){if(Math.abs(e)<=y)return e/y;var i,r,n=y,o=C,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 v(e,t,r){if(r.clockStep===i.SYSTEM_CLOCK)return y;if(Math.abs(e)<=1)return e*y;var n=t[t.length-1];e>n?e=n:-n>e&&(e=-n);var o,a,s=y,l=C,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 g(e){var r=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=g.defaultDateFormatter,this._timeFormatter=g.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,s.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(g.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 v(e.multiplier,r._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,C),-C);var t=r._allShuttleRingTicks,n=r._clockViewModel;if(n.clockStep=i.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)===C)return void(n.multiplier=e>0?t[t.length-1]:t[0]);var o=f(e,t);if(r.snapToTicks)o=t[m(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>y?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)&&0>n}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?(h(e),e.shouldAnimate=!1):r._canAnimate&&d(e)});this._pauseViewModel=new c(n,{toggled:s.computed(function(){return!r._isAnimating}),tooltip:"Pause"});var o=u(function(){var e=r._clockViewModel;h(e);var 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;h(e);var t=e.multiplier;0>t&&(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 p=u(function(){var e=r._clockViewModel;e.clockStep=i.SYSTEM_CLOCK,e.multiplier=1,e.shouldAnimate=!0},s.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new c(p,{toggled:s.computed(function(){return e.shouldAnimate&&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;h(e);var t=r._allShuttleRingTicks,i=e.multiplier,n=m(i,t)-1;n>=0&&(e.multiplier=t[n])}),this._faster=u(function(){var e=r._clockViewModel;h(e);var t=r._allShuttleRingTicks,i=e.multiplier,n=m(i,t)+1;n<t.length&&(e.multiplier=t[n])})}var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],y=15,C=105;return g.defaultDateFormatter=function(e,t){var i=a.toGregorianDate(e);return _[i.month-1]+" "+i.day+" "+i.year},g.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],g.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)},g.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},g.prototype.setShuttleRingTicks=function(e){var t,i,r,n={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,i=e.length;i>t;++t)r=e[t],n.hasOwnProperty(r)||(n[r]=!0,o.push(r));o.sort(p);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(g.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}}}),g._maxShuttleRingAngle=C,g._realtimeShuttleRingAngle=y,g}),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;n>i;i++)for(var s=a.length,l=0;s>l;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 v=document.createElement("div");v.className="cesium-baseLayerPicker-choices",v.setAttribute("data-bind","foreach: terrainProviderViewModels"),u.appendChild(v);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; }'),v.appendChild(g);var _=document.createElement("img");_.className="cesium-baseLayerPicker-itemIcon",_.setAttribute("data-bind","attr: { src: iconUrl }"),_.setAttribute("draggable","false"),g.appendChild(_);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:"//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:"//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:"//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:"//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:"//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:"//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:"//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:"//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:"//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:"MapQuest Open­Street­Map",iconUrl:e("Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.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:"//otile1-s.mqcdn.com/tiles/1.0.0/osm/"})}})),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:"//cesiumjs.org/blackmarble",maximumLevel:8,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:"//assets.agi.com/stk-terrain/world",requestWaterMask:!0,requestVertexNormals:!0})}})),n}return n}),i("Widgets/CesiumInspector/CesiumInspectorViewModel",["../../Core/Color","../../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,d){"use strict";function p(e){var i;if(t(e)){i="Command Statistics";var r=e.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: "+e.totalCommands}return i}function m(e,t,i){var r=Math.min(i,t);return r=Math.max(r,e)}function f(e,i){function r(e){v.removeInputAction(s.LEFT_CLICK),p.pickPrimitiveActive=!1;var i=p._scene.pick({x:e.position.x,y:e.position.y});t(i)&&(p.primitive=t(i.collection)?i.collection:i.primitive)}function n(e){var i,r=g.ellipsoid,n=p._scene.camera.pickEllipsoid({x:e.position.x,y:e.position.y},r);if(t(n))for(var a=r.cartesianToCartographic(n),l=g._surface.tileProvider._tilesToRenderByTextureCount,u=0;!i&&u<l.length;++u){var c=l[u];if(t(c))for(var h=0;!i&&h<c.length;++h){var d=c[h];o.contains(d.rectangle,a)&&(i=d)}}p.tile=i,v.removeInputAction(s.LEFT_CLICK),p.pickTileActive=!1}var p=this,f=e.canvas,v=new a(f);this._eventHandler=v,this._scene=e,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="+",h.track(this,["filterTile","suspendUpdates","dropDownVisible","shaderCacheText","frustums","frustumStatisticText","pickTileActive","pickPrimitiveActive","hasPickedPrimitive","hasPickedTile","tileText","generalVisible","generalSwitchText","primitivesVisible","primitivesSwitchText","terrainVisible","terrainSwitchText","depthFrustumText"]),this._toggleDropDown=d(function(){p.dropDownVisible=!p.dropDownVisible}),this._toggleGeneral=d(function(){p.generalVisible=!p.generalVisible,p.generalSwitchText=p.generalVisible?"-":"+"}),this._togglePrimitives=d(function(){p.primitivesVisible=!p.primitivesVisible,p.primitivesSwitchText=p.primitivesVisible?"-":"+"}),this._toggleTerrain=d(function(){p.terrainVisible=!p.terrainVisible,p.terrainSwitchText=p.terrainVisible?"-":"+"}),this._showFrustums=d(function(){return p.frustums?p._scene.debugShowFrustums=!0:p._scene.debugShowFrustums=!1,!0}),this._showPerformance=d(function(){return p.performance?p._performanceDisplay=new u({container:p._performanceContainer}):p._performanceContainer.innerHTML="",!0}),this._showPrimitiveBoundingSphere=d(function(){return p._primitive.debugShowBoundingVolume=p.primitiveBoundingSphere,!0}),this._showPrimitiveReferenceFrame=d(function(){if(p.primitiveReferenceFrame){var e=p._primitive.modelMatrix;p._modelMatrixPrimitive=new l({modelMatrix:e}),p._scene.primitives.add(p._modelMatrixPrimitive)}else t(p._modelMatrixPrimitive)&&(p._scene.primitives.remove(p._modelMatrixPrimitive),p._modelMatrixPrimitive=void 0);return!0}),this._doFilterPrimitive=d(function(){return p.filterPrimitive?p._scene.debugCommandFilter=function(e){return t(p._modelMatrixPrimitive)&&e.owner===p._modelMatrixPrimitive._primitive?!0:t(p._primitive)?e.owner===p._primitive||e.owner===p._primitive._billboardCollection||e.owner.primitive===p._primitive:!1}:p._scene.debugCommandFilter=void 0,!0}),this._showWireframe=d(function(){return g._surface.tileProvider._debug.wireframe=p.wireframe,!0}),this._showGlobeDepth=d(function(){return p._scene.debugShowGlobeDepth=p.globeDepth,!0}),this._showPickDepth=d(function(){return p._scene.debugShowPickDepth=p.pickDepth,!0}),this._incrementDepthFrustum=d(function(){var e=p.depthFrustum+1;return p.depthFrustum=m(1,p._numberOfFrustums,e),p.scene.debugShowDepthFrustum=p.depthFrustum,!0}),this._decrementDepthFrustum=d(function(){var e=p.depthFrustum-1;return p.depthFrustum=m(1,p._numberOfFrustums,e),p.scene.debugShowDepthFrustum=p.depthFrustum,!0}),this._doSuspendUpdates=d(function(){return g._surface._debug.suspendLodUpdate=p.suspendUpdates,p.suspendUpdates||(p.filterTile=!1),!0});var _;this._showTileCoordinates=d(function(){return p.tileCoordinates&&!t(_)?_=e.imageryLayers.addImageryProvider(new c({tilingScheme:e.terrainProvider.tilingScheme})):!p.tileCoordinates&&t(_)&&(e.imageryLayers.remove(_),_=void 0),!0}),this._showTileBoundingSphere=d(function(){return p.tileBoundingSphere?g._surface.tileProvider._debug.boundingSphereTile=p._tile:g._surface.tileProvider._debug.boundingSphereTile=void 0,!0}),this._doFilterTile=d(function(){return p.filterTile?(p.suspendUpdates=!0,p.doSuspendUpdates(),g._surface._tilesToRender=[],t(p._tile)&&g._surface._tilesToRender.push(p._tile)):(p.suspendUpdates=!1,p.doSuspendUpdates()),!0}),this._pickPrimitive=d(function(){p.pickPrimitiveActive=!p.pickPrimitiveActive,p.pickPrimitiveActive?v.setInputAction(r,s.LEFT_CLICK):v.removeInputAction(s.LEFT_CLICK)}),this._pickTile=d(function(){p.pickTileActive=!p.pickTileActive,p.pickTileActive?v.setInputAction(n,s.LEFT_CLICK):v.removeInputAction(s.LEFT_CLICK)})}return i(f.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 d(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){var e=this;return d(function(){e.tile=e.tile.children[0]})}},selectNE:{get:function(){var e=this;return d(function(){e.tile=e.tile.children[1]})}},selectSW:{get:function(){var e=this;return d(function(){e.tile=e.tile.children[2]})}},selectSE:{get:function(){var e=this;return d(function(){e.tile=e.tile.children[3]})}},primitive:{set:function(e){var i=this._primitive;e!==i&&(this.hasPickedPrimitive=!0,t(i)&&(i.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,t(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())},get:function(){return this._primitive}},tile:{set:function(e){if(t(e)){this.hasPickedTile=!0;var i=this._tile;e!==i&&(this.tileText="L: "+e.level+" X: "+e.x+" Y: "+e.y,this.tileText+="<br>SW corner: "+e.rectangle.west+", "+e.rectangle.south,this.tileText+="<br>NE corner: "+e.rectangle.east+", "+e.rectangle.north,this.tileText+="<br>Min: "+e.data.minimumHeight+" Max: "+e.data.maximumHeight),this._tile=e,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=p(e._scene.debugFrustumStatistics));var t=e._scene.numberOfFrustums;e._numberOfFrustums=t;var i=m(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}}}}),f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._eventHandler.destroy(),r(this)},f}),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(t,i){if(!e(t))throw new r("container is required.");if(!e(i))throw new r("scene is required.");t=o(t);var s=document.createElement("div"),l=new a(i,s);this._viewModel=l,this._container=t;var u=document.createElement("div");this._element=u;var c=document.createElement("div");c.textContent="Cesium Inspector",c.className="cesium-cesiumInspector-button",c.setAttribute("data-bind","click: toggleDropDown"),u.appendChild(c),u.className="cesium-cesiumInspector",u.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),t.appendChild(this._element);var h=document.createElement("div");this._panel=h,h.className="cesium-cesiumInspector-dropDown",u.appendChild(h);var d=document.createElement("div");d.className="cesium-cesiumInspector-sectionHeader";var p=document.createElement("span");p.className="cesium-cesiumInspector-toggleSwitch",p.setAttribute("data-bind","click: toggleGeneral, text: generalSwitchText"),d.appendChild(p),d.appendChild(document.createTextNode("General")),h.appendChild(d);var m=document.createElement("div");m.className="cesium-cesiumInspector-section",m.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : generalVisible, "cesium-cesiumInspector-hide" : !generalVisible}'),h.appendChild(m);var f=document.createElement("div");m.appendChild(f);var v=document.createElement("div");v.className="cesium-cesiumInspector-frustumStats",v.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : frustums, "cesium-cesiumInspector-hide" : !frustums}, html: frustumStatisticText');var g=document.createElement("input");g.type="checkbox",g.setAttribute("data-bind","checked: frustums, click: showFrustums"),f.appendChild(g),f.appendChild(document.createTextNode("Show Frustums")),f.appendChild(v);var _=document.createElement("div");m.appendChild(_);var y=document.createElement("input");y.type="checkbox",y.setAttribute("data-bind","checked: performance, click: showPerformance"),_.appendChild(y),_.appendChild(document.createTextNode("Performance Display")),s.className="cesium-cesiumInspector-performanceDisplay",m.appendChild(s);var C=document.createElement("div");C.className="cesium-cesiumInspector-shaderCache",C.setAttribute("data-bind","html: shaderCacheText"),m.appendChild(C);var E=document.createElement("div");m.appendChild(E);var S=document.createElement("input");S.type="checkbox",S.setAttribute("data-bind","checked: globeDepth, click: showGlobeDepth"),E.appendChild(S),E.appendChild(document.createTextNode("Show globe depth"));var w=document.createElement("div");E.appendChild(w);var T=document.createElement("div");m.appendChild(T);var x=document.createElement("input");x.type="checkbox",x.setAttribute("data-bind","checked: pickDepth, click: showPickDepth"),T.appendChild(x),T.appendChild(document.createTextNode("Show pick depth"));var b=document.createElement("div");m.appendChild(b);var A=document.createElement("span");A.setAttribute("data-bind",'html: "     Frustum:"'),b.appendChild(A);var P=document.createElement("span");P.setAttribute("data-bind","text: depthFrustumText"),b.appendChild(P);var I=document.createElement("input");I.type="button",I.value="-",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: decrementDepthFrustum"),b.appendChild(I);var M=document.createElement("input");M.type="button",M.value="+",M.className="cesium-cesiumInspector-pickButton",M.setAttribute("data-bind","click: incrementDepthFrustum"),b.appendChild(M);var D=document.createElement("div");D.className="cesium-cesiumInspector-sectionHeader",p=document.createElement("span"),p.className="cesium-cesiumInspector-toggleSwitch",p.setAttribute("data-bind","click: togglePrimitives, text: primitivesSwitchText"),D.appendChild(p),D.appendChild(document.createTextNode("Primitives")),h.appendChild(D);var R=document.createElement("div");R.className="cesium-cesiumInspector-section",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : primitivesVisible, "cesium-cesiumInspector-hide" : !primitivesVisible}'),h.appendChild(R);var O=document.createElement("div");O.className="cesium-cesiumInspector-pickSection",R.appendChild(O);var N=document.createElement("input");N.type="button",N.value="Pick a primitive",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');var L=document.createElement("div");L.className="cesium-cesiumInspector-center",L.appendChild(N),O.appendChild(L);var F=document.createElement("div");O.appendChild(F);var B=document.createElement("input");B.type="checkbox",B.setAttribute("data-bind","checked: primitiveBoundingSphere, click: showPrimitiveBoundingSphere, enable: hasPickedPrimitive"),F.appendChild(B),F.appendChild(document.createTextNode("Show bounding sphere"));var V=document.createElement("div");O.appendChild(V);var k=document.createElement("input");k.type="checkbox",k.setAttribute("data-bind","checked: primitiveReferenceFrame, click: showPrimitiveReferenceFrame, enable: hasPickedPrimitive"),V.appendChild(k),V.appendChild(document.createTextNode("Show reference frame"));var z=document.createElement("div");this._primitiveOnly=z,O.appendChild(z);var U=document.createElement("input");U.type="checkbox",U.setAttribute("data-bind","checked: filterPrimitive, click: doFilterPrimitive, enable: hasPickedPrimitive"),z.appendChild(U),z.appendChild(document.createTextNode("Show only selected"));var G=document.createElement("div");G.className="cesium-cesiumInspector-sectionHeader",p=document.createElement("span"),p.className="cesium-cesiumInspector-toggleSwitch",p.setAttribute("data-bind","click: toggleTerrain, text: terrainSwitchText"),G.appendChild(p),G.appendChild(document.createTextNode("Terrain")),h.appendChild(G);var W=document.createElement("div");W.className="cesium-cesiumInspector-section",W.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : terrainVisible, "cesium-cesiumInspector-hide" : !terrainVisible}'),h.appendChild(W);var H=document.createElement("div");H.className="cesium-cesiumInspector-pickSection",W.appendChild(H);var q=document.createElement("input");q.type="button",q.value="Pick a tile",q.className="cesium-cesiumInspector-pickButton",q.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),L=document.createElement("div"),L.appendChild(q),L.className="cesium-cesiumInspector-center",H.appendChild(L);var j=document.createElement("div");H.appendChild(j);var Y=document.createElement("input");Y.type="button",Y.value="Parent",Y.className="cesium-cesiumInspector-pickButton",Y.setAttribute("data-bind","click: selectParent");var X=document.createElement("input");X.type="button",X.value="NW",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectNW");var Z=document.createElement("input");Z.type="button",Z.value="NE",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind","click: selectNE");var K=document.createElement("input");K.type="button",K.value="SW",K.className="cesium-cesiumInspector-pickButton",K.setAttribute("data-bind","click: selectSW");var Q=document.createElement("input");Q.type="button",Q.value="SE",Q.className="cesium-cesiumInspector-pickButton",Q.setAttribute("data-bind","click: selectSE");var J=document.createElement("div");J.className="cesium-cesiumInspector-tileText",j.className="cesium-cesiumInspector-frustumStats",j.appendChild(J),j.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : hasPickedTile, "cesium-cesiumInspector-hide" : !hasPickedTile}'),J.setAttribute("data-bind","html: tileText");var $=document.createElement("div");$.className="cesium-cesiumInspector-relativeText",$.textContent="Select relative:",j.appendChild($);var ee=document.createElement("table"),te=document.createElement("tr"),ie=document.createElement("tr"),re=document.createElement("td");re.appendChild(Y);var ne=document.createElement("td");ne.appendChild(X);var oe=document.createElement("td");oe.appendChild(Z),te.appendChild(re),te.appendChild(ne),te.appendChild(oe);var ae=document.createElement("td"),se=document.createElement("td");se.appendChild(K);var le=document.createElement("td");le.appendChild(Q),ie.appendChild(ae), +ie.appendChild(se),ie.appendChild(le),ee.appendChild(te),ee.appendChild(ie),j.appendChild(ee);var ue=document.createElement("div");H.appendChild(ue);var ce=document.createElement("input");ce.type="checkbox",ce.setAttribute("data-bind","checked: tileBoundingSphere, enable: hasPickedTile, click: showTileBoundingSphere"),ue.appendChild(ce),ue.appendChild(document.createTextNode("Show bounding volume"));var he=document.createElement("div");H.appendChild(he);var de=document.createElement("input");de.type="checkbox",de.setAttribute("data-bind","checked: filterTile, enable: hasPickedTile, click: doFilterTile"),he.appendChild(de),he.appendChild(document.createTextNode("Show only selected"));var pe=document.createElement("div");W.appendChild(pe);var me=document.createElement("input");me.type="checkbox",me.setAttribute("data-bind","checked: wireframe, click: showWireframe"),pe.appendChild(me),pe.appendChild(document.createTextNode("Wireframe"));var fe=document.createElement("div");W.appendChild(fe);var ve=document.createElement("input");ve.type="checkbox",ve.setAttribute("data-bind","checked: suspendUpdates, click: doSuspendUpdates"),fe.appendChild(ve),fe.appendChild(document.createTextNode("Suspend LOD update"));var ge=document.createElement("div");W.appendChild(ge);var _e=document.createElement("input");_e.type="checkbox",_e.setAttribute("data-bind","checked: tileCoordinates, click: showTileCoordinates"),ge.appendChild(_e),ge.appendChild(document.createTextNode("Show tile coordinates")),n.applyBindings(l,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/SkyAtmosphere","../../Scene/SkyBox","../../Scene/Sun","../getElement"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,v,g,_,y,C,E,S){"use strict";function w(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(l){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){var u="An error occurred while rendering. Rendering has stopped.";e.showErrorPanel(u,void 0,l)}}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 b(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 A(e,a){e=S(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)?S(a.creditContainer):s;T.appendChild(d);var A=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=A,this._resolutionScale=1,this._forceResize=!1,this._clock=o(a.clock)?a.clock:new i,x(this);try{var I=new g({canvas:l,contextOptions:a.contextOptions,creditContainer:d,mapProjection:a.mapProjection,orderIndependentTranslucency:a.orderIndependentTranslucency,scene3DOnly:n(a.scene3DOnly,!1),terrainExaggeration:a.terrainExaggeration});this._scene=I,I.camera.constrainedAxis=t.UNIT_Z,b(this);var M=n(I.mapProjection.ellipsoid,u.WGS84),D=I.frameState.creditDisplay,R=new r("Cesium",P,"http://cesiumjs.org/");D.addDefaultCredit(R);var O=a.globe;o(O)||(O=new f(M)),O!==!1&&(I.globe=O);var N=a.skyBox;o(N)||(N=new C({sources:{positiveX:w("px"),negativeX:w("mx"),positiveY:w("py"),negativeY:w("my"),positiveZ:w("pz"),negativeZ:w("mz")}})),N!==!1&&(I.skyBox=N,I.sun=new E,I.moon=new v);var L=a.skyAtmosphere;o(L)||(L=new y(M)),L!==!1&&(I.skyAtmosphere=L);var F=a.globe===!1?!1:a.imageryProvider;o(F)||(F=new m({url:"//dev.virtualearth.net"})),F!==!1&&I.imageryLayers.addImageryProvider(F),o(a.terrainProvider)&&a.globe!==!1&&(I.terrainProvider=a.terrainProvider),this._screenSpaceEventHandler=new p(l,!1),o(a.sceneMode)&&(a.sceneMode===_.SCENE2D&&this._scene.morphTo2D(0),a.sceneMode===_.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 B=this;I.renderError.addEventListener(function(e,t){if(B._useDefaultRenderLoop=!1,B._renderLoopRunning=!1,B._showRenderLoopErrors){var i="An error occurred while rendering. Rendering has stopped.";B.showErrorPanel(i,void 0,t)}})}catch(V){if(A){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,V)}throw V}}var P="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAAaCAYAAABikagwAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB9wGGRQyF371QVsAABOHSURBVGje7Vp5cFTHmf91v2Nm3owGnYMuEEJCOBiEjDlsDMYQjGMOOwmXcWxiLywpJ9iuTXZd612corJssFOxi8LerXizxEGUvWsivNxxHHCQ8WYBYSFzmUMCCXQjaUajOd/V+4f6Kc14kI/KZv/xq+p6M/PmO15/9/c1wa0vwpcMQAHgBuAFoPG7mz8jAGwASQBxADFhJQGYACwAjK+vrr/AJQ8jVMqfuwH4AGQByAaQnTNqXGHWqHGFbq8/g1BJsgw9GQ12Bds/qWsxEvEeAEEAfQDCAKKCgPGVcP//BOsIVQHgAZAJIACgsHTqvDvK7150T2bR2DFaZm6W4slwUypR20yaiUg4OtDbcaP36rlPPt6/7f2B3q5mAB0AeriAE18J9y93kVu4X4W73BwAhQBK5v/gZ98ZVXXvDG92IJMx569MQDEoK0tPmOHu1s4L7799sH7vtvcAXAPQCaCfu2qLu+7h+Eh3sS8Bcyt48iVgPos2+4J7jS+BIx2etDBSynfH/Xq46y0CUL70n3/zXMmUuXepWoZHFCQhFIQARCBFJYV6/Nn+QHnVBH9Ovq/51JFWADpfJhcqEzyDcx9ukTTr/xr2VnDpng0nuHR0h1u3wvWF6EspgBIAFYAfQAGAsuU/rfm7kePvvJ0QiTj6QSgBISS9ujEGSikkxaXklIwfK8uK2Xru2HVurWKspZyezGmmWwp/LqVsupPQub4grPQ5YIejKQvPJAGflLLJSBGmxPEqKXhU4XdJEBq7BR5Z+L+DKx3MTTHWEaybx9WCud/btCJQMeX2Qevk+NPoks0YPArF/RUj0NyXxOmO2CAy1a1OmL9yUVfTmatXTx52EildYFQVNlgRmBR1xQJgCBbPBAVUhcw8lTObLz0FVk4RIEmJJyJNZzFBiCTFBRL+f50rriFUATRFiZSU/XYEAw6X5LlIUghZqXvl5p8pfycRZsgjymlKGw1Adm7JbRUVs785nwGghP5pp9mfFMOxWstmuC3gwdcrRqA/buJUWwyKRMAYgydrZNZt9337623njn+ixyN9nAmdM5nBvYOPfxc3mnEmTQ4T5VZv8hfz8aUKnocJd5tvVhxAhOMADzNefleFjRUFa/D/xzi8LQhIEpTG4VXnNBzlZYISufk7juCfqaAoLkHYcZ6HBAEM8O+ObJz3HcFDpJfDJwWYfiHMMTklviocKHv6I3+zRFLdKhEEatmALBFIBIibNhQ6KFyJEjT2JHDoUj/a+nVIVIBhBGOnzptWXzhmTFfT2TZBOH4AgSeeeGJqRUVFqdfr9btcLnVQXwapmqZpJZPJRCgUCh47duzie++9dwWAXl5enrlp06bF0WhUM01TYYwRrmg2vzNKqS3Lsunz+Yy6urpTP//5z09blkVLSkryVq9ePT03NzegqqqbUnqTGyOEMNM0k319fX2///3vz9bW1l4DYD700EPFy5Ytm65pmvbBBx9c2rp166Wnnnqq7MEHH5zAGIu8/vrr+w8ePPgJVwrRO2gAcg8cOLA2mUx62tvbB9avX39s+fLlo++///5JXNiwbXugpqam9tChQ2cEj6NzuQwlsi+//PKSzMzMQtu2qcfjMZqbm09v2LDht4J3sQEQOU2Jo8mKKzt7VEU5lSgFBi3PZkBZrgv3lGbCo1Jc7I7iSGN40JcQgoGkhXdO94ESQJEoGI+1k/M9mDKqQHEv++akl186e45rNAAE3njjjccWLFhwfyAQyJEkiabGbcc7JJNJva2trX3Lli3vvPbaa+eKi4uLV6xY8d10cf5TcZ8x5OXl5b366qs9lFLtrbfeWldVVXW7pmkuxhjS0SSEIJlMGitXrrz2/PPPv1lTU3NtypQp0x955JG/kmVZdrlcR7du3WrOnTt33pIlS+YDwNGjR68ePHiwjVtukm+wI9ichQsXPgUAHR0d3evXr78xc+bMu9asWbOQUjpENz8/v/jQoUP/IiiH40UzAeQvW7Zs1rp16/7a5/NpDr/19fWlGzZsOM4tNsphkc5iPaXTvl6uuDUvY4MZLwNQ4Ffw+LR8+KQQTCuJSQUFcMsEe88FoSkSKCFwyWSISQbg9pEefHdGAJHIdUydVjFecL3K448/Pm3hwoUPBAKBHFGIlmU5pRCRpMGEze12q2PHjh2zatWqeTt37gwODAxkOQIJhUJ6Y2Njn6IojFJqE0KYsGyPx0POnTvXnUgkfGvXrr1j5syZU7iFsKampv5YLBZ34GzbJgAwatSo7MzMTE95eXnZT37yk0dramr+PRQKZSQSCdPn88nBYNADID8UCmkAYBiGGQ6Hna6cksbdZliWZUuSRKPRKAAUBINBfywWM30+n+yEtenTp9+5YsWKGTt37oxwz+a44RwARc8+++xSr9eriQrY398v8311CUncTTHN0Q7Vl1OQJymq4iBwyxQPT8qDVwri1d1/i8ttp/AP39mOBeMn41pQx9mOGFSZ3qT52ZqMR6aMRGvXKfzbgX9Ea3PnSLEdOWXKlK/5/X4/AFy8ePHG6tWr90QikS5VVaOEEIsxRhljngcffLBi8+bNjxBCUFJSMrKkpMRvGIbboXP27Nn+2bNn/3cgEIgSQmKEEAOARQixKKVxRVEioVAoYtu2dMcdd4x24Hbv3t3+ox/96ONoNBqklMa4ppNkMinNnz8///nnn6/y+Xw0mUxaANy6rrsdl28YhguAX9d1F98jwn9TUjJkJ5N1DWV0ti0ByDAMw+PsbzQatX0+Hy0oKMhcvnz5nP3791+IxWJRIUaPfO655+ZVVlaOA4BoNGprmkZ5uJJThZouKyYAqOrWVEKoE7cwszQDlQUK3jr8S5y++iEIIXh55/fwylOH8e3KHHSEdfQnLFBuRbJEsLQyF27Sh3eO/iuudV+EaSuqkJF6MjMzs9xutwIAv/rVr06eOHHiEwCtPBHQOaPaxYsXLxcXF8cKCwtzOzo6+ltbW4OFhYU+h2nDMAgAqbu7W8xkLSEBcsos1bbtocZIIBBQs7Ky5Pb2dkvXdV1wfaipqemsqak5yF1bFABljNEU4Sj87nia1LKHCJWGLLh6AkDhiksAoLq6um/VqlWZWVlZ8gMPPHDHwoULK2tqasJcYJ7y8vKyb33rW/f4/X43YwybNm26vnnz5pIUb0tvVe44maSVjEfizDJtmwFlOS4srczGiQvv4ncnd4ASAkIo+mN92LLrB/j7Vb/GQxOz8Z/1PTDsQXc6p3QEqopU7Dr6S5y8fAiKpCKhs6SQSUqyLKsO4d7e3j4AvbxD1csFQQF4EolEaP369TVCFjuiqKiogG8w5s6dm8sY++ZwcfbZZ5/dvHXr1isnT55scVz+rFmz8urr6xc4Ls22bZZIJExd181oNGr09PREDx06dPmFF144Ho/HTVGIjiE4guECoyl1LYTPcppGEAghDAAikUjixRdfbHnppZfKfD6fa82aNfMOHz7cHgwGbwBwr1ix4u677rqrgsfU4I4dO66lCPZTXSkqpOaMa60e7mjuosw0RmYoWHf3SLT3NOKt91+CbsZBeOlDCcX5luP4rw9fw4wSH+4p9cMlU3xtpAfLJmej/vIR7PnjLyDRwXeKhoxubokWAOYkDXxTLE5brB11oTZMCrWoNQgymJwZhsHC4bAZjUaNaDRqxGIx3VnxeDzJky8TQGLHjh3n9u3bd6ytrS3U2dkZ6e3tjfX398cHBgYS8XjcIIQQr9frKioq8ldWVhb88Ic/vHfbtm3zAXhs25aHUx7uEt1COeXEXM3JfAWLvWnSxRhLbNu2rampqSlMCME3vvGNyXPmzKkCUFZeXn776tWr72WMwbZtvPDCCx+5XK6wo6BcOdhwQ4Chuu/KR39onDGS9T80u9ivkgiqD/0UbT2NcKvelMaEhXfrqlGaPwEPT5qH0lwvqopcaOtpxPb3/gmGmYBEFRBC0HUlfp67tQQALxMKYsaYU+tlcSadNN8NIOO+++4bnZ2d7Q+Hw+zIkSNJxtiQ9TQ1NUW3bNnSmJWVlZBlWaeUWs5SVTUxYsSIRF1dXScAwzTN2MMPP7w3Pz//ZFVVVUFubq7L6/VKmqZRl8ulKIriVlVVmz59ev6cOXMCLpeLLliwYDyAOpGm08SglA659mQy6eHTrwiPtRYXbi6vP2/yjI61AoDL5Ur09vZ2bt++/ezGjRvvppSSjRs3Lti9e/fvnnzyyfHjx48fyRjDwYMHL9TW1jYWFhZ6xfIs3UhUTlPQRwGE9Gv/c/ba9YGi2rPv0FONf/iUUB3Lj8SDqD60GYtmdGBcYSVOnL+K39b9Gp19zVDkwZzBSpLY9Qv9Z3lKHgOgmaYZd9zg1KlTS994441L3G3lcD6oo/1btmxZFwgEctrb27vWrFlzwLIs2cmKW1pa4q+//vp1AbchdIKiPGZHAJDFixcHpk+ffnsoFNLefvvt3ra2Nl0YSDhdt4zy8vLwsWPHsl0ul6ooigSACuEZXKBJwzAMxhhUVZW8Xm8uH5hQ3mCwOf95VVVVYx03yQVhUEpNQbBxADfefPPN6NKlS8dUVlYWVlZW5r344osz1q1bV8IYQzAYjFVXV5+IxWIdkiTlpfDCUgcC6Sw2CqBvw4ZN+7/9d+Wzo1avT5HU9N1tMpj4dfU14z/efxletx9xPYpIPAhVccO2bVBKcf189I/h3mSLkBi5b9y40RWLxZJer9f12GOPTa6oqMjq6enpJYQYlFLGyx21tLQ0MGnSpDGEECQSCZMQIjuNCF6aqI8++mheVlZWJrdYkzcoLEVREj6fL1FfX39x165dzfPnzy/7/ve/v1LXdWvlypVde/bsuRKLxQyn1LEsS2aMeebNm1fs8/lkxhgsy7IAJBRF0Yc2TZZ1AANNTU0djoJt2rRpzqxZs/K6urq6JUnSCSHMMAxZ07SsxYsXV1JKCWMMAwMDMQBhVVWTjtU6gr1y5Yq1d+/ej8aNG5eraZr6zDPPjPV4PBJjDLW1ted27dr1MYCYqqpDcpMkyRIaEyydxToxNgagr7e3t+XEe0rNxPkjnvhTznNr4Sb0KBL6YO9BovJQnRXptTqaPgr9wTLsDgAhTkOurq4+unz58vs1TRvl9/vVuXPnljHGxgqxw2GcEjLYJLlw4cKV06dPd06bNo04+MePH+/ftm3bNNG1iW5KVVVl//79ew4cONC8d+/ey88884ysKIp85513jpo8eXJh2pHX4EUIITh58uRFAN1utzvHcb0ejycGoKuurk5vbW29u7i4ODB69OisJ5988i4xxDhsKIoiEUJgmqZ94MCBOgBdmqaVODxrmhbhiaP+4x//+N2lS5dOmjBhwhiPxyMBQFdXV191dfX7tm23AdBdLtdQzFYUxWmb3iRcmqbh7vQfOz9+v/PdjvP6kcHuE288MJZWuM4Smw1mgkQvHw/v6Wga+BjADY53AEDfmTNnLq9du/Znp06datB13RA3ROwGmaZphcPhgX379v326aefftO27Tafz9fJGGOmadqMMSbLMpEkiaZbjDFommYQQsK1tbWNr7zyymvhcLifEIJbwRBCmGVZ1vHjxz9atGjRLwA0Z2dndzpdHb/fHwTQcuLEiYann3761fPnz3+i67pBCCGUUkoIofwjpZQS27ZZd3f3ja1bt1Zv3LhxL4CrmZmZPYQQkxCCjIyMEIB2AG0Amrdv3/6beDweNwzD1nXdPHXq1Indu3cf48+7MjIyupw98ng8EW4wCWH4kHbQLgsnJ4oAlN332Ji1hbeps6lEaLohQLrhQCJi9zcei77TcLh9H4CrALp4rLN5LBvBE4scAP6JEyfmBQIBL6VUopSCMcYGBgYSly5dCvX19YW5QkQAmD6fz3PvvfeWxmIxr2EYHqFXPBRrKKWWJEmG1+uNtbW1dTU0NNzgz7wA/OXl5bkFBQV+XsYQwVpZMpk0jh8/3snpRQCYo0aN8k6YMCHX5XLRa9euBRsaGnr4Jnp458c7ceLEbK/X6xL5MQzDbGhoCNq2HeO4YgBYWVmZv6KiIkdVVbS0tHQ3NDR0CsORrDlz5oyllHoYY3p9ff31cDjczeGhaVrGkiVLSg3DkLu7u/s+/PDDFn4UKeJYLhnmAJvGs9QCAKOnLMhfNHqSNl/LlHOpTORbWa4et2ORXqv1wgf9NVfO9B7nTYcuPvlICq02t9CJ8ggjOJomodOF0ZQtHNvxCC08pBnbmcIhO53jdA7mpXaKUkOSWGoxYaaKlIa7IozT0uET+XDGehDGhhBGb6bTmBHezeb8OyNPCPQk/ptzeHConCSfcZDNI1hWQXaBVl5254hZmSPVce4MKUdxEQ+VJMnUbcNIWJFoyOzoa02eOX2k+yg/79TFNWkgZchOUobe4vA63WzUEmpYsa+dCoM0Izgz5aQkTUOPpGvUpKFJBaUR8Q03cLdT8NkppyEgPGOCYcnCiNASsn2SwrstDA2Gxnbkc5xSdHGrcmaBWYoqZ+YUe4pcXuqXJCobupWIhaze3vZohzAfdOaKN2mSwPxwR0ZSZ6uptZoIN9yxFCYIiqV5v3THStgwNNPhvtXxFgzDP9K8q52Cj6ZRNnaLffoUDfI5zhVLgrvxCN0Ux5URYXYYF84Wf2qqf4uDV591ZuiLHir7c8F+mZOU5M+Iazg8n3mYjnxORkV3I6dxg6KrMQW3Yaexlq+uv8D1v2IL+t4z3B/NAAAAAElFTkSuQmCC";return a(A.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){if(0>=e)throw new l("targetFrameRate must be greater than 0, or undefined.");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){if(0>=e)throw new l("resolutionScale must be greater than 0.");this._resolutionScale=e,this._forceResize=!0}}}),A.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)},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),s(this)},A.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),b(this))},A.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}else this._clock.tick()},A}),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);var r=a.observable(i.startTime);r.equalityComparer=o.equals,this.systemTime=a.observable(o.now()),this.systemTime.equalityComparer=o.equals,a.track(this,["systemTime"]),this.startTime=void 0,a.defineProperty(this,"startTime",{get:r,set:function(e){r(e),i.startTime=e}});var s=a.observable(i.stopTime);s.equalityComparer=o.equals,this.stopTime=void 0,a.defineProperty(this,"stopTime",{get:s,set:function(e){i.stopTime=e,s(e)}});var l=a.observable(i.currentTime);l.equalityComparer=o.equals,this.currentTime=void 0,a.defineProperty(this,"currentTime",{get:l,set:function(e){i.currentTime=e,l(e)}});var u=a.observable(i.multiplier);this.multiplier=void 0,a.defineProperty(this,"multiplier",{get:u,set:function(e){i.multiplier=e,u(e)}});var c=a.observable(i.clockStep);c.equalityComparer=function(e,t){return e===t},this.clockStep=void 0,a.defineProperty(this,"clockStep",{get:c,set:function(e){c(e),i.clockStep=e}});var h=a.observable(i.clockRange);h.equalityComparer=function(e,t){return e===t},this.clockRange=void 0,a.defineProperty(this,"clockRange",{get:h,set:function(e){h(e),i.clockRange=e}});var d=a.observable(i.canAnimate);this.canAnimate=void 0,a.defineProperty(this,"canAnimate",{get:d,set:function(e){d(e),i.canAnimate=e}});var p=a.observable(i.shouldAnimate);this.shouldAnimate=void 0,a.defineProperty(this,"shouldAnimate",{get:p,set:function(e){p(e),i.shouldAnimate=e}})}return i(s.prototype,{clock:{get:function(){return this._clock}}}),s.prototype.synchronize=function(){var e=this._clock,t=e.startTime,i=e.stopTime,r=e.currentTime,n=e.multiplier,a=e.clockStep,s=e.clockRange,l=e.canAnimate,u=e.shouldAnimate;this.systemTime=o.now(),this.startTime=t,this.stopTime=i,this.currentTime=r,this.multiplier=n,this.clockStep=a,this.clockRange=s,this.canAnimate=l,this.shouldAnimate=u},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","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(t){this._url=i(t.url,"//dev.virtualearth.net/"),this._url.length>0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._key=e.getKey(t.key),this._scene=t.scene,this._flightDuration=t.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodeInProgress=void 0,this._complete=new a;var r=this;this._searchCommand=p(function(){r.isSearchInProgress?g(r):v(r)}),h.track(this,["_searchText","_isSearchInProgress"]),this.isSearchInProgress=void 0,h.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,h.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,h.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})}function f(e,t){e._scene.camera.flyTo({destination:t,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:l.IDENTITY,convert:!1})}function v(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 f(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=d(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];f(e,u.fromDegrees(a,o,l,s))}},function(){c.cancel||(e._isSearchInProgress=!1,e.searchText=e._searchText+" (error)")})}}function g(e){e._isSearchInProgress=!1,r(e._geocodeInProgress)&&(e._geocodeInProgress.cancel=!0,e._geocodeInProgress=void 0)}return n(m.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}}}),m}),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" : searchText.length > 0 }'),r.appendChild(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("mousedown",this._onInputBegin,!0),document.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),document.addEventListener("touchend",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),i(this)},l}),i("Widgets/HomeButton/HomeButtonViewModel",["../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Matrix4","../../Core/Rectangle","../../Scene/Camera","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(t,r){var n=t.mode;if(i(t)&&n===l.MORPHING&&t.completeMorph(),n===l.SCENE2D)t.camera.flyTo({destination:a.MAX_VALUE,duration:r,endTransform:o.IDENTITY});else if(n===l.SCENE3D){var u=t.camera.getRectangleCameraCoordinates(s.DEFAULT_VIEW_RECTANGLE),c=e.magnitude(u);c+=c*s.DEFAULT_VIEW_FACTOR,e.normalize(u,u),e.multiplyByScalar(u,c,u),t.camera.flyTo({destination:u,duration:r,endTransform:o.IDENTITY})}else if(n===l.COLUMBUS_VIEW){var h=t.globe.ellipsoid.maximumRadius,d=new e(0,-1,1);d=e.multiplyByScalar(e.normalize(d,d),5*h,d),t.camera.flyTo({destination:d,duration:r,orientation:{heading:0,pitch:-Math.acos(e.normalize(d,p).z),roll:0},endTransform:o.IDENTITY,convert:!1})}}function d(e,t){this._scene=e,this._duration=t;var i=this;this._command=c(function(){h(i._scene,i._duration)}),this.tooltip="View Home",u.track(this,["tooltip"])}var p=new e;return r(d.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}}}),d}),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 v=document.createElement("img");v.src=e("Widgets/Images/NavigationHelp/Touch.svg"),v.className="cesium-navigation-button-icon",v.style.width="25px",v.style.height="25px",f.appendChild(v),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 _=document.createElement("div");_.className="cesium-touch-navigation-help cesium-navigation-help-instructions",_.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),_.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(_),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;0>n&&(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=_.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=v(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),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function u(e){return 10>e?"0"+e.toString():e.toString()}function c(e){return function(t){e._mouseMode!==_.touchOnly&&(0===t.button?(e._mouseMode=_.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,2===t.button?e._mouseMode=_.zoom:e._mouseMode=_.slide)),t.preventDefault()}}function h(e){return function(t){e._mouseMode=_.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0px 0px"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function d(e){return function(t){var i;if(e._mouseMode===_.scrub){t.preventDefault();var r=t.clientX-e._topDiv.getBoundingClientRect().left;0>r?(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===_.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===_.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=_.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._handleTouchMove(t)):e._touchMode===y.scrub&&e._handleTouchMove(t),e._mouseMode=_.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 v(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=_.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,_={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],E=["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),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)):0>l&&(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||0>t||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 E[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(S/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function i(e){return(e-S)/v}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,v=this._timeBarSecondsSpan;d>v?(v=d,this._timeBarSecondsSpan=d,this._endJulian=n.addSeconds(this._startJulian,d,new n)):v>p&&(v=p,this._timeBarSecondsSpan=p,this._endJulian=n.addSeconds(this._startJulian,p,new n));var g=this._timeBarEle.clientWidth;10>g&&(g=10);var _,y=this._startJulian,E=Math.min(v/g*1e-5,.4);_=v>31536e4?n.fromIso8601(n.toDate(y).toISOString().substring(0,2)+"00-01-01T00:00:00Z"):v>31536e3?n.fromIso8601(n.toDate(y).toISOString().substring(0,3)+"0-01-01T00:00:00Z"):v>86400?n.fromIso8601(n.toDate(y).toISOString().substring(0,4)+"-01-01T00:00:00Z"):n.fromIso8601(n.toDate(y).toISOString().substring(0,10)+"T00:00:00Z");var S=n.secondsDifference(this._startJulian,n.addSeconds(_,E,new n)),w=S+v;this._epochJulian=_,this._rulerEle.innerHTML=this.makeLabel(n.addSeconds(this._endJulian,-d,new n));var T=this._rulerEle.offsetWidth+20;30>T&&(T=180);var x=f;f-=m;var b={startTime:S,startJulian:y,epochJulian:_,duration:v,timeBarWidth:g,getAlpha:i};this._highlightRanges.forEach(function(e){h+=e.render(b)});var A=0,P=0,I=0,M=T/g;M>1&&(M=1),M*=this._timeBarSecondsSpan;var D,R=-1,O=-1,N=C.length;for(D=0;N>D;++D){var L=C[D];if(++R,A=L,L>M&&L>f)break;0>O&&g*(L/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(O=R)}if(R>0){for(;R>0;)if(--R,Math.abs(r(A,C[R]))<1e-5){C[R]>=f&&(P=C[R]);break}if(O>=0)for(;R>O;){if(Math.abs(r(P,C[O]))<1e-5&&C[O]>=f){I=C[O];break}++O}}f=x,f>m&&1e-5>I&&Math.abs(f-A)>m&&(I=f,A+m>=f&&(P=0));var F,B=-999999;if(g*(I/this._timeBarSecondsSpan)>=3)for(o=e(I);w>=o;o=t(o,I))h+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(P/this._timeBarSecondsSpan)>=3)for(o=e(P);w>=o;o=t(o,P))h+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(A/this._timeBarSecondsSpan)>=2){this._mainTicSpan=A,w+=A,o=e(A);for(var V=n.computeTaiMinusUtc(_);w>=o;){var k=n.addSeconds(y,o-S,new n);if(A>2.1){var z=n.computeTaiMinusUtc(k);Math.abs(z-V)>.1&&(o+=z-V,k=n.addSeconds(y,o-S,new n))}var U=Math.round(g*i(o)),G=this.makeLabel(k);this._rulerEle.innerHTML=G,F=this._rulerEle.offsetWidth,10>F&&(F=T);var W=U-(F/2-1);W>B?(B=W+F+5,h+='<span class="cesium-timeline-ticMain" style="left: '+U.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+W.toString()+'px;">'+G+"</span>"):h+='<span class="cesium-timeline-ticSub" style="left: '+U.toString()+'px;"></span>',o=t(o,A)}}else this._mainTicSpan=-1;h+='<span class="cesium-timeline-icon16" style="left:'+u+'px;bottom:0;background-position: 0px 0px;"></span>',a.innerHTML=h,this._scrubElement=a.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),b.y=0,this._trackList.forEach(function(e){e.render(c._context,b),b.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._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/definedNotNull","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Core/Fullscreen","../../Core/isArray","../../Core/Matrix4","../../Core/ScreenSpaceEventType","../../DataSources/BoundingSphereState","../../DataSources/ConstantPositionProperty","../../DataSources/DataSourceCollection","../../DataSources/DataSourceDisplay","../../DataSources/Entity","../../DataSources/EntityView","../../DataSources/Property","../../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,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,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 g)return o}return r(e.scene.globe)?H(e,t.position):void 0}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 g({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 g({id:i.name,description:i.description});if(r(i.position)){var o=e.scene.globe.ellipsoid.cartographicToCartesian(i.position,ee);n.position=new m(o)}e.selectedEntity=n}},function(){e.selectedEntity===a&&(e.selectedEntity=q())}),a}}function q(){return new g({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 o(e){var t=G(c,e);r(t)&&(y.getValueOrUndefined(t.position,c.clock.currentTime)?c.trackedEntity=t:c.zoomTo(t))}function a(e){c.selectedEntity=G(c,e)}e=R(e),t=i(t,i.EMPTY_OBJECT);var u=!(r(t.globe)&&t.globe===!1||r(t.baseLayerPicker)&&t.baseLayerPicker===!1),c=this,h=document.createElement("div");h.className="cesium-viewer",e.appendChild(h);var p=document.createElement("div");p.className="cesium-viewer-cesiumWidgetContainer",h.appendChild(p);var m=document.createElement("div");m.className="cesium-viewer-bottom",h.appendChild(m);var g=i(t.scene3DOnly,!1),_=new P(p,{terrainProvider:t.terrainProvider,imageryProvider:u?!1: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:m,scene3DOnly:g,terrainExaggeration:t.terrainExaggeration}),C=t.dataSources,S=!1;r(C)||(C=new f,S=!0);var W=new v({scene:_.scene,dataSourceCollection:C}),H=_.clock,q=new I(H),X=new l;X.add(H.onTick,Y.prototype._onTick,this),X.add(_.scene.morphStart,Y.prototype._clearTrackedObject,this);var Z;if(!r(t.selectionIndicator)||t.selectionIndicator!==!1){var K=document.createElement("div");K.className="cesium-viewer-selectionIndicatorContainer",h.appendChild(K),Z=new B(K,_.scene)}var Q;if(!r(t.infoBox)||t.infoBox!==!1){var J=document.createElement("div");J.className="cesium-viewer-infoBoxContainer",h.appendChild(J),Q=new N(J);var $=Q.viewModel;X.add($.cameraClicked,Y.prototype._onInfoBoxCameraClicked,this),X.add($.closeClicked,Y.prototype._onInfoBoxClockClicked,this)}var ee=document.createElement("div");ee.className="cesium-viewer-toolbar",h.appendChild(ee);var te;if(!r(t.geocoder)||t.geocoder!==!1){var ie=document.createElement("div");ie.className="cesium-viewer-geocoderContainer",ee.appendChild(ie),te=new D({container:ie,scene:_.scene}),X.add(te.viewModel.search.beforeExecute,Y.prototype._clearObjects,this)}var re;if(r(t.homeButton)&&t.homeButton===!1||(re=new O(ee,_.scene),r(te)&&X.add(re.viewModel.command.afterExecute,function(){var e=te.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),X.add(re.viewModel.command.beforeExecute,Y.prototype._clearTrackedObject,this)),t.sceneModePicker===!0&&g)throw new s("options.sceneModePicker is not available when options.scene3DOnly is set to true.");var ne;g||r(t.sceneModePicker)&&t.sceneModePicker===!1||(ne=new F(ee,_.scene));var oe,ae;if(u){var se=i(t.imageryProviderViewModels,b()),le=i(t.terrainProviderViewModels,A());oe=new x(ee,{globe:_.scene.globe,imageryProviderViewModels:se,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:le,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel});var ue=ee.getElementsByClassName("cesium-baseLayerPicker-dropDown");ae=ue[0]}var ce;if(!r(t.navigationHelpButton)||t.navigationHelpButton!==!1){var he=!0;try{if(n(window.localStorage)){var de=window.localStorage.getItem("cesium-hasSeenNavHelp");r(de)&&Boolean(de)?he=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch(pe){}ce=new L({container:ee,instructionsInitiallyVisible:i(t.navigationInstructionsInitiallyVisible,he)})}var me;if(!r(t.animation)||t.animation!==!1){var fe=document.createElement("div");fe.className="cesium-viewer-animationContainer",h.appendChild(fe),me=new w(fe,new T(q))}var ve;if(!r(t.timeline)||t.timeline!==!1){var ge=document.createElement("div");ge.className="cesium-viewer-timelineContainer",h.appendChild(ge),ve=new k(ge,H),ve.addEventListener("settime",U,!1),ve.zoomTo(H.startTime,H.stopTime)}var _e,ye;if(!r(t.fullscreenButton)||t.fullscreenButton!==!1){var Ce=document.createElement("div");Ce.className="cesium-viewer-fullscreenContainer",h.appendChild(Ce),_e=new M(Ce,t.fullscreenElement),ye=V(_e.viewModel,"isFullscreenEnabled",function(e){Ce.style.display=e?"block":"none",r(ve)&&(ve.container.style.right=Ce.clientWidth+"px",ve.resize())})}var Ee,Se,we;if(t.vrButton){var Te=document.createElement("div");Te.className="cesium-viewer-vrContainer",h.appendChild(Te),Ee=new z(Te,_.scene,t.fullScreenElement),Se=V(Ee.viewModel,"isVREnabled",function(e){Te.style.display=e?"block":"none",r(_e)&&(Te.style.right=Ce.clientWidth+"px"),r(ve)&&(ve.container.style.right=Te.clientWidth+"px",ve.resize())}),we=V(Ee.viewModel,"isVRMode",function(e){j(c,e)})}this._baseLayerPickerDropDown=ae,this._fullscreenSubscription=ye,this._vrSubscription=Se,this._vrModeSubscription=we,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=i(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=m,this._element=h,this._cesiumWidget=_,this._selectionIndicator=Z,this._infoBox=Q,this._dataSourceCollection=C,this._destroyDataSourceCollection=S,this._dataSourceDisplay=W,this._clockViewModel=q,this._toolbar=ee,this._homeButton=re,this._sceneModePicker=ne,this._baseLayerPicker=oe,this._navigationHelpButton=ce,this._animation=me,this._timeline=ve,this._fullscreenButton=_e,this._vrButton=Ee,this._geocoder=te,this._eventHelper=X,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=r(Q)||r(Z),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,E.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),X.add(C.dataSourceAdded,Y.prototype._onDataSourceAdded,this),X.add(C.dataSourceRemoved,Y.prototype._onDataSourceRemoved,this),X.add(_.scene.preRender,Y.prototype.resize,this),X.add(_.scene.postRender,Y.prototype._postRender,this);for(var xe=C.length,be=0;xe>be;be++)this._dataSourceAdded(C,C.get(be));this._dataSourceAdded(void 0,W.defaultDataSource),X.add(C.dataSourceAdded,Y.prototype._dataSourceAdded,this),X.add(C.dataSourceRemoved,Y.prototype._dataSourceRemoved,this),_.screenSpaceEventHandler.setInputAction(a,d.LEFT_CLICK),_.screenSpaceEventHandler.setInputAction(o,d.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.isLoading&&r(t.loadingEvent))var n=t.loadingEvent.addEventListener(function(){n(),e._zoomPromise===a&&(e._zoomTarget=t.entities.values.slice(0))});else t=i(t.values,t),r(t.entities)&&(t=t.entities.values),c(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){for(var o=t._zoomPromise,a=[],s=0,l=n.length;l>s;s++){var u=t._dataSourceDisplay.getBoundingSphere(n[s],!1,$);if(u===p.PENDING)return;u!==p.FAILED&&a.push(e.clone($))}if(0===a.length)return void K(t);t.trackedEntity=void 0;var c=t.scene,d=c.camera,m=e.fromBoundingSpheres(a),f=c.screenSpaceCameraController;if(f.minimumZoomDistance=Math.min(f.minimumZoomDistance,.5*m.radius),t._zoomIsFlight){var v=i(t._zoomOptions,{}),g={duration:v.duration,maximumHeight:v.maximumHeight,complete:function(){o.resolve(!0)},cancel:function(){o.resolve(!1)},offset:v.offset};Z(t),d.flyToBoundingSphere(m,g)}else d.viewBoundingSphere(m,t._zoomOptions),d.lookAtTransform(h.IDENTITY),Z(t),o.resolve(!0)}}function J(e){if(e._needTrackedEntityUpdate){var t=e._trackedEntity,i=e.clock.currentTime,n=y.getValueOrUndefined(t.position,i);if(r(n)){var o=e.scene,a=e._dataSourceDisplay.getBoundingSphere(t,!1,$);if(a!==p.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!==p.FAILED?$:void 0;e._entityView=new _(t,o,o.mapProjection.ellipsoid,l),e._entityView.update(i),e._needTrackedEntityUpdate=!1}}}}var $=new e,ee=new t;return o(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; +}},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(h.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,900>=m&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):i>=600?(h=136,(600>m||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,v=this._vrButton,g=c.container,_=g.style;p=g.clientHeight+3,_.left=h+"px";var y=0;r(f)&&(y+=f.container.clientWidth),r(v)&&(y+=v.container.clientWidth),_.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(d.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(d.LEFT_DOUBLE_CLICK);var t=this.dataSources,i=t.length;for(e=0;i>e;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()),a(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;r(a)&&a.update(n);var s,l=!1,u=this.selectedEntity,c=r(u)&&this._enableInfoOrSelection;if(c&&u.isShowing&&u.isAvailable(n)){var h=this._dataSourceDisplay.getBoundingSphere(u,!0,$);h!==p.FAILED?s=$.center:r(u.position)&&(s=u.position.getValue(n,s)),l=r(s)}var d=r(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;r(d)&&(d.position=t.clone(s,d.position),d.showSelection=c&&l,d.update());var m=r(this._infoBox)?this._infoBox.viewModel:void 0;r(m)&&(m.showInfo=c,m.enableCamera=l,m.isCameraTracking=this.trackedEntity===this.selectedEntity,c?(m.titleText=i(u.name,u.id),m.description=y.getValueOrDefault(u.description,n,"")):(m.titleText="",m.description=""))},Y.prototype._onEntityCollectionChanged=function(e,t,i){for(var r=i.length,n=0;r>n;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(n){if(!e(n))throw new i("viewer is required.");var o=document.createElement("div");o.className="cesium-viewer-cesiumInspectorContainer",n.container.appendChild(o);var a=new r(o,n.scene);t(n,{cesiumInspector:{get:function(){return a}}}),n.scene.postRender.addEventListener(function(){n.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),v&&(t.entities.removeAll(),t.dataSources.removeAll());for(var i=e.dataTransfer.files,r=i.length,n=0;r>n;n++){var o=i[n],a=new FileReader;a.onload=m(t,o,_),a.onerror=f(t,o),a.readAsText(o)}}r=e(r,e.EMPTY_OBJECT);var s=!0,l=!0,c=new n,v=e(r.clearOnDrop,!0),g=e(r.dropTarget,t.container),_=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 v},set:function(e){v=e}},flyToOnDrop:{get:function(){return l},set:function(e){l=e}},proxy:{get:function(){return _},set:function(e){_=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){return function(n){var o=i.name;try{var u;if(/\.czml$/i.test(o))u=a.load(JSON.parse(n.target.result),{sourceUri:o});else if(/\.geojson$/i.test(o)||/\.json$/i.test(o)||/\.topojson$/i.test(o))u=s.load(JSON.parse(n.target.result),{sourceUri:o});else{if(!/\.(kml|kmz)$/i.test(o))return void e.dropError.raiseEvent(e,o,"Unrecognized file: "+o);u=l.load(i,{sourceUri:o,proxy:r})}t(u)&&e.dataSources.add(u).then(function(t){e.flyToOnDrop&&e.flyTo(t)}).otherwise(function(t){e.dropError.raiseEvent(e,o,t)})}catch(c){e.dropError.raiseEvent(e,o,c)}}}function f(e,t){return function(i){e.dropError.raiseEvent(e,t.name,i.target.error)}}return c}),i("Widgets/Viewer/viewerEntityMixin",["../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/DeveloperError","../../Core/EventHelper","../../Core/Event","../../Core/ScreenSpaceEventType","../../Core/wrapFunction","../../DataSources/ConstantPositionProperty","../../DataSources/Entity","../../DataSources/EntityView","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../subscribeAndEvaluate"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e,t){var r=e.scene,n=r.camera.getPickRay(t),o=r.imageryLayers.pickImageryLayerFeatures(n,r);if(i(o)){var a=new u("Loading...");return a.description={getValue:function(){return"Loading feature information..."}},p(o,function(t){if(e.selectedEntity===a){if(!i(t)||0===t.length)return void(e.selectedEntity=v());var r=t[0],n=new u(r.name);if(n.description={getValue:function(){return r.description}},i(r.position)){var o=e.scene.globe.ellipsoid.cartographicToCartesian(r.position,_);n.position=new l(o)}e.selectedEntity=n}},function(){if(e.selectedEntity===a){var t=new u("None");t.description={getValue:function(){return"No features found."}},e.selectedEntity=v()}}),a}}function v(){var e=new u("None");return e.description={getValue:function(){return"No features found."}},e}var g=function(e){function r(){e.trackedEntity=e.selectedEntity}function l(){e.trackedEntity=void 0}function p(){e.selectedEntity=void 0}function v(){e.trackedEntity=void 0,e.selectedEntity=void 0}function g(r){var n=r.currentTime;i(x)&&x.update(n);var o=e.selectedEntity,a=i(o)&&M;if(a){var s,l=i(I)?I.position:void 0,u=!1;o.isAvailable(n)&&i(o.position)&&(s=o.position.getValue(n,l),u=i(s)&&e.trackedEntity!==e.selectedEntity),i(I)&&(I.position=s),i(A)&&(A.enableCamera=u,A.isCameraTracking=e.trackedEntity===e.selectedEntity,i(o.description)?A.descriptionRawHtml=t(o.description.getValue(n),""):A.descriptionRawHtml="")}i(I)&&(I.showSelection=a,I.update()),i(A)&&(A.showInfo=a)}function _(r){var n=e.scene.pick(r.position);if(i(n)){var o=t(n.id,n.primitive.id);if(o instanceof u)return o}return f(e,r.position)}function y(t){i(t)&&i(t.position)&&(e.trackedEntity=t)}function C(e){var t=_(e);i(t)&&y(t)}function E(t){var i=e.selectedEntity;e.selectedEntity=_(t),e.eventSelector.raiseEvent(e.selectedEntity,i)}function S(t,i,r){for(var n=r.length,o=0;n>o;o++){var a=r[o];e.trackedEntity===a&&e.homeButton.viewModel.command(),e.selectedEntity===a&&(e.selectedEntity=void 0)}}function w(e,t){var i=t.entities;i.collectionChanged.addEventListener(S)}function T(t,r){var n=r.entities;n.collectionChanged.removeEventListener(S),i(e.trackedEntity)&&n.getById(e.trackedEntity.id)===e.trackedEntity&&e.homeButton.viewModel.command(),i(e.selectedEntity)&&n.getById(e.selectedEntity.id)===e.selectedEntity&&(e.selectedEntity=void 0)}var x,b=e.infoBox,A=i(b)?b.viewModel:void 0,P=e.selectionIndicator,I=i(P)?P.viewModel:void 0,M=i(b)||i(P),D=new n,R=new o;e.eventSelector=R,i(A)&&(D.add(A.cameraClicked,r),D.add(A.closeClicked,p)),D.add(e.clock.onTick,g),i(e.homeButton)&&D.add(e.homeButton.viewModel.command.beforeExecute,l),i(e.geocoder)&&D.add(e.geocoder.viewModel.search.beforeExecute,v);for(var O=e.dataSources,N=O.length,L=0;N>L;L++)w(O,O.get(L));D.add(e.dataSources.dataSourceAdded,w),D.add(e.dataSources.dataSourceRemoved,T),e.screenSpaceEventHandler.setInputAction(E,a.LEFT_CLICK),e.screenSpaceEventHandler.setInputAction(C,a.LEFT_DOUBLE_CLICK),e.trackedEntity=void 0,e.selectedEntity=void 0,d.track(e,["trackedEntity","selectedEntity"]);var F=[];F.push(m(e,"trackedEntity",function(t){var r=e.scene,n=r.mode,o=i(t);(n===h.COLUMBUS_VIEW||n===h.SCENE2D)&&(r.screenSpaceCameraController.enableTranslate=!o),(n===h.COLUMBUS_VIEW||n===h.SCENE3D)&&(r.screenSpaceCameraController.enableTilt=!o),x=o&&i(t.position)?new c(t,r,e.scene.globe.ellipsoid):void 0})),F.push(m(e,"selectedEntity",function(e){i(e)?(i(A)&&(A.titleText=i(e.name)?e.name:e.id),i(I)&&I.animateAppear()):i(I)&&I.animateDepart()})),e.destroy=s(e,e.destroy,function(){D.removeAll();var t;for(t=0;t<F.length;t++)F[t].dispose();e.screenSpaceEventHandler.removeInputAction(a.LEFT_CLICK),e.screenSpaceEventHandler.removeInputAction(a.LEFT_DOUBLE_CLICK);var i=e.dataSources,r=i.length;for(t=0;r>t;t++)T(i,i.get(t))})},_=new e;return g}),i("Widgets/Viewer/viewerPerformanceWatchdogMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../PerformanceWatchdog/PerformanceWatchdog"],function(e,t,i,r,n){"use strict";function o(o,a){if(!t(o))throw new r("viewer is required.");a=e(a,e.EMPTY_OBJECT);var s=new n({scene:o.scene,container:o.bottomContainer,lowFrameRateMessage:a.lowFrameRateMessage});i(o,{performanceWatchdog:{get:function(){return s}}})}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(u){u instanceof Error?a.error={name:u.name,message:u.message,stack:u.stack}:a.error=u}t(n)||(n=e(self.webkitPostMessage,self.postMessage)),l.canTransferArrayBuffer||(o.length=0);try{n(a,o)}catch(u){a.result=void 0,a.error="postMessage failed with error: "+i(u)+"\n with responseMessage: "+JSON.stringify(a),n(a)}}}return r}),i("Cesium",["./Core/appendForwardSlash","./Core/ArcGisImageServerTerrainProvider","./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/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/definedNotNull","./Core/defineProperties","./Core/deprecationWarning","./Core/destroyObject","./Core/DeveloperError","./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/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/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/VertexFormat","./Core/VideoSynchronizer","./Core/Visibility","./Core/VRTheWorldTerrainProvider","./Core/WallGeometry","./Core/WallGeometryLibrary","./Core/WallOutlineGeometry","./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/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/StaticOutlineGeometryBatch","./DataSources/StripeMaterialProperty","./DataSources/StripeOrientation","./DataSources/TimeIntervalCollectionPositionProperty","./DataSources/TimeIntervalCollectionProperty","./DataSources/VelocityOrientationProperty","./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/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","./Renderer/WebGLConstants","./Scene/Appearance","./Scene/ArcGisMapServerImageryProvider","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/BlendEquation","./Scene/BlendFunction","./Scene/BlendingState","./Scene/Camera","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/createOpenStreetMapImageryProvider","./Scene/createTangentSpaceDebugPrimitive","./Scene/createTileMapServiceImageryProvider","./Scene/CreditDisplay","./Scene/CullFace","./Scene/CullingVolume","./Scene/DebugAppearance","./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/GetFeatureInfoFormat","./Scene/getModelAccessor","./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/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/OpenStreetMapImageryProvider","./Scene/OrthographicFrustum","./Scene/Pass","./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/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/TileMapServiceImageryProvider","./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/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/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/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/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/gltfDefaults","./ThirdParty/knockout-3.2.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/viewerEntityMixin","./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,v,g,_,y,C,E,S,w,T,x,b,A,P,I,M,D,R,O,N,L,F,B,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,ve,ge,_e,ye,Ce,Ee,Se,we,Te,xe,be,Ae,Pe,Ie,Me,De,Re,Oe,Ne,Le,Fe,Be,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,vt,gt,_t,yt,Ct,Et,St,wt,Tt,xt,bt,At,Pt,It,Mt,Dt,Rt,Ot,Nt,Lt,Ft,Bt,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,vi,gi,_i,yi,Ci,Ei,Si,wi,Ti,xi,bi,Ai,Pi,Ii,Mi,Di,Ri,Oi,Ni,Li,Fi,Bi,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,vr,gr,_r,yr,Cr,Er,Sr,wr,Tr,xr,br,Ar,Pr,Ir,Mr,Dr,Rr,Or,Nr,Lr,Fr,Br,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,vn,gn,_n,yn,Cn,En,Sn,wn,Tn,xn,bn,An,Pn,In,Mn,Dn,Rn,On,Nn,Ln,Fn,Bn,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,vo,go,_o,yo,Co,Eo,So,wo,To,xo,bo,Ao,Po,Io,Mo,Do,Ro,Oo,No,Lo,Fo,Bo,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,va,ga,_a,ya,Ca,Ea,Sa,wa,Ta,xa,ba,Aa,Pa,Ia,Ma,Da,Ra,Oa,Na,La,Fa,Ba,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,vs,gs,_s,ys,Cs,Es,Ss,ws,Ts,xs,bs,As,Ps,Is,Ms,Ds,Rs,Os,Ns,Ls,Fs,Bs,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,vl,gl,_l,yl,Cl,El,Sl,wl,Tl,xl,bl,Al,Pl,Il,Ml,Dl,Rl,Ol,Nl,Ll,Fl,Bl,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,vu,gu,_u,yu,Cu,Eu,Su,wu,Tu,xu,bu,Au,Pu,Iu,Mu,Du,Ru,Ou,Nu,Lu,Fu,Bu,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,vc,gc,_c,yc,Cc,Ec,Sc,wc,Tc,xc,bc,Ac,Pc,Ic,Mc,Dc,Rc,Oc,Nc,Lc,Fc,Bc,Vc,kc,zc,Uc,Gc,Wc,Hc,qc,jc,Yc,Xc,Zc,Kc,Qc,Jc,$c,eh){ +"use strict";var th={VERSION:"1.18",_shaders:{}};return th.appendForwardSlash=e,th.ArcGisImageServerTerrainProvider=t,th.AssociativeArray=i,th.AttributeCompression=r,th.AxisAlignedBoundingBox=n,th.barycentricCoordinates=o,th.binarySearch=a,th.BingMapsApi=s,th.BoundingRectangle=l,th.BoundingSphere=u,th.BoxGeometry=c,th.BoxOutlineGeometry=h,th.buildModuleUrl=d,th.cancelAnimationFrame=p,th.Cartesian2=m,th.Cartesian3=f,th.Cartesian4=v,th.Cartographic=g,th.CatmullRomSpline=_,th.CesiumTerrainProvider=y,th.CircleGeometry=C,th.CircleOutlineGeometry=E,th.Clock=S,th.ClockRange=w,th.ClockStep=T,th.clone=x,th.Color=b,th.ColorGeometryInstanceAttribute=A,th.combine=P,th.ComponentDatatype=I,th.CornerType=M,th.CorridorGeometry=D,th.CorridorGeometryLibrary=R,th.CorridorOutlineGeometry=O,th.createGuid=N,th.Credit=L,th.CubicRealPolynomial=F,th.CylinderGeometry=B,th.CylinderGeometryLibrary=V,th.CylinderOutlineGeometry=k,th.DefaultProxy=z,th.defaultValue=U,th.defined=G,th.definedNotNull=W,th.defineProperties=H,th.deprecationWarning=q,th.destroyObject=j,th.DeveloperError=Y,th.EarthOrientationParameters=X,th.EarthOrientationParametersSample=Z,th.EasingFunction=K,th.EllipseGeometry=Q,th.EllipseGeometryLibrary=J,th.EllipseOutlineGeometry=$,th.Ellipsoid=ee,th.EllipsoidalOccluder=te,th.EllipsoidGeodesic=ie,th.EllipsoidGeometry=re,th.EllipsoidOutlineGeometry=ne,th.EllipsoidTangentPlane=oe,th.EllipsoidTerrainProvider=ae,th.EncodedCartesian3=se,th.Event=le,th.EventHelper=ue,th.ExtrapolationType=ce,th.FeatureDetection=he,th.formatError=de,th.freezeObject=pe,th.Fullscreen=me,th.GeographicProjection=fe,th.GeographicTilingScheme=ve,th.Geometry=ge,th.GeometryAttribute=_e,th.GeometryAttributes=ye,th.GeometryInstance=Ce,th.GeometryInstanceAttribute=Ee,th.GeometryPipeline=Se,th.GeometryType=we,th.getAbsoluteUri=Te,th.getBaseUri=xe,th.getExtensionFromUri=be,th.getFilenameFromUri=Ae,th.getImagePixels=Pe,th.getMagic=Ie,th.getStringFromTypedArray=Me,th.getTimestamp=De,th.GregorianDate=Re,th.HeadingPitchRange=Oe,th.HeightmapTerrainData=Ne,th.HeightmapTessellator=Le,th.HermitePolynomialApproximation=Fe,th.HermiteSpline=Be,th.Iau2000Orientation=Ve,th.Iau2006XysData=ke,th.Iau2006XysSample=ze,th.IauOrientationAxes=Ue,th.IauOrientationParameters=Ge,th.IndexDatatype=We,th.InterpolationAlgorithm=He,th.Intersect=qe,th.Intersections2D=je,th.IntersectionTests=Ye,th.Interval=Xe,th.isArray=Ze,th.isCrossOriginUrl=Ke,th.isLeapYear=Qe,th.Iso8601=Je,th.joinUrls=$e,th.JulianDate=et,th.KeyboardEventModifier=tt,th.LagrangePolynomialApproximation=it,th.LeapSecond=rt,th.LinearApproximation=nt,th.LinearSpline=ot,th.loadArrayBuffer=at,th.loadBlob=st,th.loadImage=lt,th.loadImageFromTypedArray=ut,th.loadImageViaBlob=ct,th.loadJson=ht,th.loadJsonp=dt,th.loadText=pt,th.loadWithXhr=mt,th.loadXML=ft,th.MapboxApi=vt,th.MapProjection=gt,th.Math=_t,th.Matrix2=yt,th.Matrix3=Ct,th.Matrix4=Et,th.mergeSort=St,th.NearFarScalar=wt,th.objectToQuery=Tt,th.Occluder=xt,th.OrientedBoundingBox=bt,th.Packable=At,th.PackableForInterpolation=Pt,th.parseResponseHeaders=It,th.PinBuilder=Mt,th.PixelFormat=Dt,th.Plane=Rt,th.PointGeometry=Ot,th.pointInsideTriangle=Nt,th.PolygonGeometry=Lt,th.PolygonGeometryLibrary=Ft,th.PolygonHierarchy=Bt,th.PolygonOutlineGeometry=Vt,th.PolygonPipeline=kt,th.PolylineGeometry=zt,th.PolylinePipeline=Ut,th.PolylineVolumeGeometry=Gt,th.PolylineVolumeGeometryLibrary=Wt,th.PolylineVolumeOutlineGeometry=Ht,th.PrimitiveType=qt,th.QuadraticRealPolynomial=jt,th.QuantizedMeshTerrainData=Yt,th.QuarticRealPolynomial=Xt,th.Quaternion=Zt,th.QuaternionSpline=Kt,th.queryToObject=Qt,th.Queue=Jt,th.Ray=$t,th.Rectangle=ei,th.RectangleGeometry=ti,th.RectangleGeometryLibrary=ii,th.RectangleOutlineGeometry=ri,th.ReferenceFrame=ni,th.requestAnimationFrame=oi,th.RequestErrorEvent=ai,th.RuntimeError=si,th.sampleTerrain=li,th.scaleToGeodeticSurface=ui,th.ScreenSpaceEventHandler=ci,th.ScreenSpaceEventType=hi,th.ShowGeometryInstanceAttribute=di,th.Simon1994PlanetaryPositions=pi,th.SimplePolylineGeometry=mi,th.SphereGeometry=fi,th.SphereOutlineGeometry=vi,th.Spherical=gi,th.Spline=_i,th.subdivideArray=yi,th.TaskProcessor=Ci,th.TerrainData=Ei,th.TerrainEncoding=Si,th.TerrainMesh=wi,th.TerrainProvider=Ti,th.TerrainQuantization=xi,th.throttleRequestByServer=bi,th.TileProviderError=Ai,th.TilingScheme=Pi,th.TimeConstants=Ii,th.TimeInterval=Mi,th.TimeIntervalCollection=Di,th.TimeStandard=Ri,th.Tipsify=Oi,th.Transforms=Ni,th.TranslationRotationScale=Li,th.TridiagonalSystemSolver=Fi,th.VertexFormat=Bi,th.VideoSynchronizer=Vi,th.Visibility=ki,th.VRTheWorldTerrainProvider=zi,th.WallGeometry=Ui,th.WallGeometryLibrary=Gi,th.WallOutlineGeometry=Wi,th.WebMercatorProjection=Hi,th.WebMercatorTilingScheme=qi,th.WindingOrder=ji,th.wrapFunction=Yi,th.writeTextToCanvas=Xi,th.BillboardGraphics=Zi,th.BillboardVisualizer=Ki,th.BoundingSphereState=Qi,th.BoxGeometryUpdater=Ji,th.BoxGraphics=$i,th.CallbackProperty=er,th.CheckerboardMaterialProperty=tr,th.ColorMaterialProperty=ir,th.CompositeEntityCollection=rr,th.CompositeMaterialProperty=nr,th.CompositePositionProperty=or,th.CompositeProperty=ar,th.ConstantPositionProperty=sr,th.ConstantProperty=lr,th.CorridorGeometryUpdater=ur,th.CorridorGraphics=cr,th.createMaterialPropertyDescriptor=hr,th.createPropertyDescriptor=dr,th.createRawPropertyDescriptor=pr,th.CustomDataSource=mr,th.CylinderGeometryUpdater=fr,th.CylinderGraphics=vr,th.CzmlDataSource=gr,th.DataSource=_r,th.DataSourceClock=yr,th.DataSourceCollection=Cr,th.DataSourceDisplay=Er,th.dynamicGeometryGetBoundingSphere=Sr,th.DynamicGeometryUpdater=wr,th.EllipseGeometryUpdater=Tr,th.EllipseGraphics=xr,th.EllipsoidGeometryUpdater=br,th.EllipsoidGraphics=Ar,th.Entity=Pr,th.EntityCollection=Ir,th.EntityView=Mr,th.GeoJsonDataSource=Dr,th.GeometryUpdater=Rr,th.GeometryVisualizer=Or,th.GridMaterialProperty=Nr,th.ImageMaterialProperty=Lr,th.KmlDataSource=Fr,th.LabelGraphics=Br,th.LabelVisualizer=Vr,th.MaterialProperty=kr,th.ModelGraphics=zr,th.ModelVisualizer=Ur,th.NodeTransformationProperty=Gr,th.PathGraphics=Wr,th.PathVisualizer=Hr,th.PointGraphics=qr,th.PointVisualizer=jr,th.PolygonGeometryUpdater=Yr,th.PolygonGraphics=Xr,th.PolylineArrowMaterialProperty=Zr,th.PolylineGeometryUpdater=Kr,th.PolylineGlowMaterialProperty=Qr,th.PolylineGraphics=Jr,th.PolylineOutlineMaterialProperty=$r,th.PolylineVolumeGeometryUpdater=en,th.PolylineVolumeGraphics=tn,th.PositionProperty=rn,th.PositionPropertyArray=nn,th.Property=on,th.PropertyArray=an,th.PropertyBag=sn,th.RectangleGeometryUpdater=ln,th.RectangleGraphics=un,th.ReferenceProperty=cn,th.Rotation=hn,th.SampledPositionProperty=dn,th.SampledProperty=pn,th.ScaledPositionProperty=mn,th.StaticGeometryColorBatch=fn,th.StaticGeometryPerMaterialBatch=vn,th.StaticOutlineGeometryBatch=gn,th.StripeMaterialProperty=_n,th.StripeOrientation=yn,th.TimeIntervalCollectionPositionProperty=Cn,th.TimeIntervalCollectionProperty=En,th.VelocityOrientationProperty=Sn,th.Visualizer=wn,th.WallGeometryUpdater=Tn,th.WallGraphics=xn,th.AutomaticUniforms=bn,th.Buffer=An,th.BufferUsage=Pn,th.ClearCommand=In,th.ComputeCommand=Mn,th.ComputeEngine=Dn,th.Context=Rn,th.ContextLimits=On,th.createUniform=Nn,th.createUniformArray=Ln,th.CubeMap=Fn,th.CubeMapFace=Bn,th.DrawCommand=Vn,th.Framebuffer=kn,th.loadCubeMap=zn,th.MipmapHint=Un,th.PassState=Gn,th.PickFramebuffer=Wn,th.PixelDatatype=Hn,th.Renderbuffer=qn,th.RenderbufferFormat=jn,th.RenderState=Yn,th.Sampler=Xn,th.ShaderCache=Zn,th.ShaderProgram=Kn,th.ShaderSource=Qn,th.Texture=Jn,th.TextureMagnificationFilter=$n,th.TextureMinificationFilter=eo,th.TextureWrap=to,th.UniformState=io,th.VertexArray=ro,th.VertexArrayFacade=no,th.WebGLConstants=oo,th.Appearance=ao,th.ArcGisMapServerImageryProvider=so,th.Billboard=lo,th.BillboardCollection=uo,th.BingMapsImageryProvider=co,th.BingMapsStyle=ho,th.BlendEquation=po,th.BlendFunction=mo,th.BlendingState=fo,th.Camera=vo,th.CameraEventAggregator=go,th.CameraEventType=_o,th.CameraFlightPath=yo,th.createOpenStreetMapImageryProvider=Co,th.createTangentSpaceDebugPrimitive=Eo,th.createTileMapServiceImageryProvider=So,th.CreditDisplay=wo,th.CullFace=To,th.CullingVolume=xo,th.DebugAppearance=bo,th.DebugModelMatrixPrimitive=Ao,th.DepthFunction=Po,th.DepthPlane=Io,th.DeviceOrientationCameraController=Mo,th.DiscardMissingTileImagePolicy=Do,th.EllipsoidPrimitive=Ro,th.EllipsoidSurfaceAppearance=Oo,th.Fog=No,th.FrameRateMonitor=Lo,th.FrameState=Fo,th.FrustumCommands=Bo,th.FXAA=Vo,th.GetFeatureInfoFormat=ko,th.getModelAccessor=zo,th.Globe=Uo,th.GlobeDepth=Go,th.GlobeSurfaceShaderSet=Wo,th.GlobeSurfaceTile=Ho,th.GlobeSurfaceTileProvider=qo,th.GoogleEarthImageryProvider=jo,th.GridImageryProvider=Yo,th.GroundPrimitive=Xo,th.HeightReference=Zo,th.HorizontalOrigin=Ko,th.Imagery=Qo,th.ImageryLayer=Jo,th.ImageryLayerCollection=$o,th.ImageryLayerFeatureInfo=ea,th.ImageryProvider=ta,th.ImageryState=ia,th.Label=ra,th.LabelCollection=na,th.LabelStyle=oa,th.MapboxImageryProvider=aa,th.Material=sa,th.MaterialAppearance=la,th.Model=ua,th.ModelAnimation=ca,th.ModelAnimationCache=ha,th.ModelAnimationCollection=da,th.ModelAnimationLoop=pa,th.ModelAnimationState=ma,th.ModelMaterial=fa,th.modelMaterialsCommon=va,th.ModelMesh=ga,th.ModelNode=_a,th.Moon=ya,th.NeverTileDiscardPolicy=Ca,th.OIT=Ea,th.OpenStreetMapImageryProvider=Sa,th.OrthographicFrustum=wa,th.Pass=Ta,th.PerformanceDisplay=xa,th.PerInstanceColorAppearance=ba,th.PerspectiveFrustum=Aa,th.PerspectiveOffCenterFrustum=Pa,th.PickDepth=Ia,th.PointAppearance=Ma,th.PointPrimitive=Da,th.PointPrimitiveCollection=Ra,th.Polyline=Oa,th.PolylineCollection=Na,th.PolylineColorAppearance=La,th.PolylineMaterialAppearance=Fa,th.Primitive=Ba,th.PrimitiveCollection=Va,th.PrimitivePipeline=ka,th.PrimitiveState=za,th.QuadtreeOccluders=Ua,th.QuadtreePrimitive=Ga,th.QuadtreeTile=Wa,th.QuadtreeTileLoadState=Ha,th.QuadtreeTileProvider=qa,th.Scene=ja,th.SceneMode=Ya,th.SceneTransforms=Xa,th.SceneTransitioner=Za,th.ScreenSpaceCameraController=Ka,th.SingleTileImageryProvider=Qa,th.SkyAtmosphere=Ja,th.SkyBox=$a,th.StencilFunction=es,th.StencilOperation=ts,th.Sun=is,th.SunPostProcess=rs,th.TerrainState=ns,th.TextureAtlas=os,th.TileBoundingBox=as,th.TileCoordinatesImageryProvider=ss,th.TileDiscardPolicy=ls,th.TileImagery=us,th.TileMapServiceImageryProvider=cs,th.TileReplacementQueue=hs,th.TileState=ds,th.TileTerrain=ps,th.TweenCollection=ms,th.UrlTemplateImageryProvider=fs,th.VerticalOrigin=vs,th.ViewportQuad=gs,th.WebMapServiceImageryProvider=_s,th.WebMapTileServiceImageryProvider=ys,th._shaders.AdjustTranslucentFS=Cs,th._shaders.AllMaterialAppearanceFS=Es,th._shaders.AllMaterialAppearanceVS=Ss,th._shaders.BasicMaterialAppearanceFS=ws,th._shaders.BasicMaterialAppearanceVS=Ts,th._shaders.EllipsoidSurfaceAppearanceFS=xs,th._shaders.EllipsoidSurfaceAppearanceVS=bs,th._shaders.PerInstanceColorAppearanceFS=As,th._shaders.PerInstanceColorAppearanceVS=Ps,th._shaders.PerInstanceFlatColorAppearanceFS=Is,th._shaders.PerInstanceFlatColorAppearanceVS=Ms,th._shaders.PointAppearanceFS=Ds,th._shaders.PointAppearanceVS=Rs,th._shaders.PolylineColorAppearanceVS=Os,th._shaders.PolylineMaterialAppearanceVS=Ns,th._shaders.TexturedMaterialAppearanceFS=Ls,th._shaders.TexturedMaterialAppearanceVS=Fs,th._shaders.BillboardCollectionFS=Bs,th._shaders.BillboardCollectionVS=Vs,th._shaders.degreesPerRadian=ks,th._shaders.depthRange=zs,th._shaders.epsilon1=Us,th._shaders.epsilon2=Gs,th._shaders.epsilon3=Ws,th._shaders.epsilon4=Hs,th._shaders.epsilon5=qs,th._shaders.epsilon6=js,th._shaders.epsilon7=Ys,th._shaders.infinity=Xs,th._shaders.oneOverPi=Zs,th._shaders.oneOverTwoPi=Ks,th._shaders.pi=Qs,th._shaders.piOverFour=Js,th._shaders.piOverSix=$s,th._shaders.piOverThree=el,th._shaders.piOverTwo=tl,th._shaders.radiansPerDegree=il,th._shaders.sceneMode2D=rl,th._shaders.sceneMode3D=nl,th._shaders.sceneModeColumbusView=ol,th._shaders.sceneModeMorphing=al,th._shaders.solarRadius=sl,th._shaders.threePiOver2=ll,th._shaders.twoPi=ul,th._shaders.webMercatorMaxLatitude=cl,th._shaders.CzmBuiltins=hl,th._shaders.alphaWeight=dl,th._shaders.antialias=pl,th._shaders.columbusViewMorph=ml,th._shaders.computePosition=fl,th._shaders.cosineAndSine=vl,th._shaders.decompressTextureCoordinates=gl,th._shaders.eastNorthUpToEyeCoordinates=_l,th._shaders.ellipsoidContainsPoint=yl,th._shaders.ellipsoidNew=Cl,th._shaders.ellipsoidWgs84TextureCoordinates=El,th._shaders.equalsEpsilon=Sl,th._shaders.eyeOffset=wl,th._shaders.eyeToWindowCoordinates=Tl,th._shaders.fog=xl,th._shaders.geodeticSurfaceNormal=bl,th._shaders.getDefaultMaterial=Al,th._shaders.getLambertDiffuse=Pl,th._shaders.getSpecular=Il,th._shaders.getWaterNoise=Ml,th._shaders.getWgs84EllipsoidEC=Dl,th._shaders.hue=Rl,th._shaders.isEmpty=Ol,th._shaders.isFull=Nl,th._shaders.latitudeToWebMercatorFraction=Ll,th._shaders.luminance=Fl,th._shaders.metersPerPixel=Bl,th._shaders.modelToWindowCoordinates=Vl,th._shaders.multiplyWithColorBalance=kl,th._shaders.nearFarScalar=zl,th._shaders.octDecode=Ul,th._shaders.packDepth=Gl,th._shaders.phong=Wl,th._shaders.pointAlongRay=Hl,th._shaders.rayEllipsoidIntersectionInterval=ql,th._shaders.RGBToXYZ=jl,th._shaders.saturation=Yl,th._shaders.signNotZero=Xl,th._shaders.tangentToEyeSpaceMatrix=Zl,th._shaders.translateRelativeToEye=Kl,th._shaders.translucentPhong=Ql,th._shaders.transpose=Jl,th._shaders.unpackDepth=$l,th._shaders.windowToEyeCoordinates=eu,th._shaders.XYZToRGB=tu,th._shaders.depthRangeStruct=iu,th._shaders.ellipsoid=ru,th._shaders.material=nu,th._shaders.materialInput=ou,th._shaders.ray=au,th._shaders.raySegment=su,th._shaders.CompositeOITFS=lu,th._shaders.DepthPlaneFS=uu,th._shaders.DepthPlaneVS=cu,th._shaders.EllipsoidFS=hu,th._shaders.EllipsoidVS=du,th._shaders.GlobeFS=pu,th._shaders.GlobeVS=mu,th._shaders.GroundAtmosphere=fu,th._shaders.BumpMapMaterial=vu,th._shaders.CheckerboardMaterial=gu,th._shaders.DotMaterial=_u,th._shaders.FadeMaterial=yu,th._shaders.GridMaterial=Cu,th._shaders.NormalMapMaterial=Eu,th._shaders.PolylineArrowMaterial=Su,th._shaders.PolylineGlowMaterial=wu,th._shaders.PolylineOutlineMaterial=Tu,th._shaders.RimLightingMaterial=xu,th._shaders.StripeMaterial=bu,th._shaders.Water=Au,th._shaders.PointPrimitiveCollectionFS=Pu,th._shaders.PointPrimitiveCollectionVS=Iu,th._shaders.PolylineCommon=Mu,th._shaders.PolylineFS=Du,th._shaders.PolylineVS=Ru,th._shaders.AdditiveBlend=Ou,th._shaders.BrightPass=Nu,th._shaders.FXAA=Lu,th._shaders.GaussianBlur1D=Fu,th._shaders.PassThrough=Bu,th._shaders.ReprojectWebMercatorFS=Vu,th._shaders.ReprojectWebMercatorVS=ku,th._shaders.ShadowVolumeFS=zu,th._shaders.ShadowVolumeVS=Uu,th._shaders.SkyAtmosphereFS=Gu,th._shaders.SkyAtmosphereVS=Wu,th._shaders.SkyBoxFS=Hu,th._shaders.SkyBoxVS=qu,th._shaders.SunFS=ju,th._shaders.SunTextureFS=Yu,th._shaders.SunVS=Xu,th._shaders.ViewportQuadFS=Zu,th._shaders.ViewportQuadVS=Ku,th.Autolinker=Qu,th.gltfDefaults=Ju,th["knockout-3.2.0"]=$u,th["knockout-es5"]=ec,th.knockout=tc,th.measureText=ic,th["mersenne-twister"]=rc,th.NoSleep=nc,th.sprintf=oc,th.topojson=ac,th.Tween=sc,th.Uri=lc,th.when=uc,th.zip=cc,th.Animation=hc,th.AnimationViewModel=dc,th.BaseLayerPicker=pc,th.BaseLayerPickerViewModel=mc,th.createDefaultImageryProviderViewModels=fc,th.createDefaultTerrainProviderViewModels=vc,th.ProviderViewModel=gc,th.CesiumInspector=_c,th.CesiumInspectorViewModel=yc,th.CesiumWidget=Cc,th.ClockViewModel=Ec,th.Command=Sc,th.createCommand=wc,th.FullscreenButton=Tc,th.FullscreenButtonViewModel=xc,th.Geocoder=bc,th.GeocoderViewModel=Ac,th.getElement=Pc,th.HomeButton=Ic,th.HomeButtonViewModel=Mc,th.InfoBox=Dc,th.InfoBoxViewModel=Rc,th.NavigationHelpButton=Oc,th.NavigationHelpButtonViewModel=Nc,th.PerformanceWatchdog=Lc,th.PerformanceWatchdogViewModel=Fc,th.SceneModePicker=Bc,th.SceneModePickerViewModel=Vc,th.SelectionIndicator=kc,th.SelectionIndicatorViewModel=zc,th.subscribeAndEvaluate=Uc,th.SvgPathBindingHandler=Gc,th.Timeline=Wc,th.TimelineHighlightRange=Hc,th.TimelineTrack=qc,th.ToggleButtonViewModel=jc,th.Viewer=Yc,th.viewerCesiumInspectorMixin=Xc,th.viewerDragDropMixin=Zc,th.viewerEntityMixin=Kc,th.viewerPerformanceWatchdogMixin=Qc,th.VRButton=Jc,th.VRButtonViewModel=$c,th.createTaskProcessorWorker=eh,th}),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/Widgets/Animation/Animation.css b/Widgets/Animation/Animation.css index bad6137..e5873b6 100644 --- a/Widgets/Animation/Animation.css +++ b/Widgets/Animation/Animation.css @@ -1 +1 @@ -.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; 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; 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;} \ No newline at end of file +.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;} \ No newline at end of file diff --git a/Widgets/Animation/lighter.css b/Widgets/Animation/lighter.css index f044698..d3a6d71 100644 --- a/Widgets/Animation/lighter.css +++ b/Widgets/Animation/lighter.css @@ -1 +1 @@ -.cesium-lighter .cesium-animation-themeNormal {color: #E5F2FE;} .cesium-lighter .cesium-animation-themeHover {color: #ABD6FF;} .cesium-lighter .cesium-animation-themeSelect {color: #E5F2FE;} .cesium-lighter .cesium-animation-themeDisabled {color: #EFEFEF;} .cesium-lighter .cesium-animation-themeKnob {color: #E1E2E3;} .cesium-lighter .cesium-animation-themePointer {color: #FA5;} .cesium-lighter .cesium-animation-themeSwoosh {color: #ACE;} .cesium-lighter .cesium-animation-themeSwooshHover {color: #BDF;} .cesium-lighter .cesium-animation-svgText {fill: #111;} .cesium-lighter .cesium-animation-rectButton .cesium-animation-buttonPath {fill: #111;} .cesium-lighter .cesium-animation-rectButton .cesium-animation-buttonMain {stroke: #759DC0;} .cesium-lighter .cesium-animation-buttonToggled .cesium-animation-buttonGlow {fill: #FFAA2A;} .cesium-lighter .cesium-animation-buttonToggled .cesium-animation-buttonMain {stroke: #EA0;} .cesium-lighter .cesium-animation-rectButton:hover .cesium-animation-buttonMain {stroke: #759DC0;} .cesium-lighter .cesium-animation-buttonToggled:hover .cesium-animation-buttonGlow {fill: #fff;} .cesium-lighter .cesium-animation-buttonToggled:hover .cesium-animation-buttonMain {stroke: #EA0;} .cesium-lighter .cesium-animation-rectButton:active .cesium-animation-buttonMain {fill: #ABD6FF;} .cesium-lighter .cesium-animation-buttonDisabled .cesium-animation-buttonMain {stroke: #D3D3D3;} .cesium-lighter .cesium-animation-buttonDisabled .cesium-animation-buttonPath {fill: #818181;} .cesium-lighter .cesium-animation-shuttleRingBack {fill: #FAFAFA; fill-opacity: 1; stroke: #AEAEAE; stroke-width: 1.2;} .cesium-lighter .cesium-animation-shuttleRingSwoosh line {stroke: #8AC;} .cesium-lighter .cesium-animation-knobOuter {stroke: #A5A5A5;} \ No newline at end of file +.cesium-lighter .cesium-animation-themeNormal{color:#E5F2FE;}.cesium-lighter .cesium-animation-themeHover{color:#ABD6FF;}.cesium-lighter .cesium-animation-themeSelect{color:#E5F2FE;}.cesium-lighter .cesium-animation-themeDisabled{color:#EFEFEF;}.cesium-lighter .cesium-animation-themeKnob{color:#E1E2E3;}.cesium-lighter .cesium-animation-themePointer{color:#FA5;}.cesium-lighter .cesium-animation-themeSwoosh{color:#ACE;}.cesium-lighter .cesium-animation-themeSwooshHover{color:#BDF;}.cesium-lighter .cesium-animation-svgText{fill:#111;}.cesium-lighter .cesium-animation-rectButton .cesium-animation-buttonPath{fill:#111;}.cesium-lighter .cesium-animation-rectButton .cesium-animation-buttonMain{stroke:#759DC0;}.cesium-lighter .cesium-animation-buttonToggled .cesium-animation-buttonGlow{fill:#FFAA2A;}.cesium-lighter .cesium-animation-buttonToggled .cesium-animation-buttonMain{stroke:#EA0;}.cesium-lighter .cesium-animation-rectButton:hover .cesium-animation-buttonMain{stroke:#759DC0;}.cesium-lighter .cesium-animation-buttonToggled:hover .cesium-animation-buttonGlow{fill:#fff;}.cesium-lighter .cesium-animation-buttonToggled:hover .cesium-animation-buttonMain{stroke:#EA0;}.cesium-lighter .cesium-animation-rectButton:active .cesium-animation-buttonMain{fill:#ABD6FF;}.cesium-lighter .cesium-animation-buttonDisabled .cesium-animation-buttonMain{stroke:#D3D3D3;}.cesium-lighter .cesium-animation-buttonDisabled .cesium-animation-buttonPath{fill:#818181;}.cesium-lighter .cesium-animation-shuttleRingBack{fill:#FAFAFA;fill-opacity:1;stroke:#AEAEAE;stroke-width:1.2;}.cesium-lighter .cesium-animation-shuttleRingSwoosh line{stroke:#8AC;}.cesium-lighter .cesium-animation-knobOuter{stroke:#A5A5A5;} \ No newline at end of file diff --git a/Widgets/BaseLayerPicker/BaseLayerPicker.css b/Widgets/BaseLayerPicker/BaseLayerPicker.css index fd0b9f3..b5e1619 100644 --- a/Widgets/BaseLayerPicker/BaseLayerPicker.css +++ b/Widgets/BaseLayerPicker/BaseLayerPicker.css @@ -1 +1 @@ -.cesium-baseLayerPicker-selected {position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;} .cesium-baseLayerPicker-dropDown {display: block; position: absolute; 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; 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; 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);} \ No newline at end of file +.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);} \ No newline at end of file diff --git a/Widgets/BaseLayerPicker/lighter.css b/Widgets/BaseLayerPicker/lighter.css index 2b39fc0..5222176 100644 --- a/Widgets/BaseLayerPicker/lighter.css +++ b/Widgets/BaseLayerPicker/lighter.css @@ -1 +1 @@ -.cesium-lighter .cesium-baseLayerPicker-itemIcon {border-color: #759dc0;} .cesium-lighter .cesium-baseLayerPicker-dropDown {background-color: rgba(240, 240, 240, 0.75);} .cesium-lighter .cesium-baseLayerPicker-sectionTitle {color: black;} .cesium-lighter .cesium-baseLayerPicker-itemLabel {color: black;} .cesium-lighter .cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon {border-color: #000;} .cesium-lighter .cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel {color: rgb(0, 61, 168);} .cesium-lighter .cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon {border: double 4px rgb(0, 61, 168);} \ No newline at end of file +.cesium-lighter .cesium-baseLayerPicker-itemIcon{border-color:#759dc0;}.cesium-lighter .cesium-baseLayerPicker-dropDown{background-color:rgba(240,240,240,0.75);}.cesium-lighter .cesium-baseLayerPicker-sectionTitle{color:black;}.cesium-lighter .cesium-baseLayerPicker-itemLabel{color:black;}.cesium-lighter .cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon{border-color:#000;}.cesium-lighter .cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel{color:rgb(0,61,168);}.cesium-lighter .cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon{border:double 4px rgb(0,61,168);} \ No newline at end of file diff --git a/Widgets/CesiumInspector/CesiumInspector.css b/Widgets/CesiumInspector/CesiumInspector.css index 0215bff..9bde0e3 100644 --- a/Widgets/CesiumInspector/CesiumInspector.css +++ b/Widgets/CesiumInspector/CesiumInspector.css @@ -1 +1 @@ -.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; 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; 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;} \ No newline at end of file +.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;} \ No newline at end of file diff --git a/Widgets/CesiumWidget/CesiumWidget.css b/Widgets/CesiumWidget/CesiumWidget.css index 9156d8b..9290f1a 100644 --- a/Widgets/CesiumWidget/CesiumWidget.css +++ b/Widgets/CesiumWidget/CesiumWidget.css @@ -1 +1 @@ -.cesium-widget {position: relative;} .cesium-widget,.cesium-widget canvas {width: 100%; height: 100%;} .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;} \ No newline at end of file +.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;} \ No newline at end of file diff --git a/Widgets/CesiumWidget/lighter.css b/Widgets/CesiumWidget/lighter.css index 5b06a90..b20dcf7 100644 --- a/Widgets/CesiumWidget/lighter.css +++ b/Widgets/CesiumWidget/lighter.css @@ -1 +1 @@ -.cesium-lighter .cesium-widget-errorPanel {background: rgba(255, 255, 255, 0.7);} .cesium-lighter .cesium-widget-errorPanel-content {border: 1px solid #526F82; border-radius: 7px; background-color: white; color: black;} .cesium-lighter .cesium-widget-errorPanel-header {color: #B87D00;} \ No newline at end of file +.cesium-lighter .cesium-widget-errorPanel{background:rgba(255,255,255,0.7);}.cesium-lighter .cesium-widget-errorPanel-content{border:1px solid #526F82;border-radius:7px;background-color:white;color:black;}.cesium-lighter .cesium-widget-errorPanel-header{color:#B87D00;} \ No newline at end of file diff --git a/Widgets/FullscreenButton/FullscreenButton.css b/Widgets/FullscreenButton/FullscreenButton.css index 8ac41b3..2bbe891 100644 --- a/Widgets/FullscreenButton/FullscreenButton.css +++ b/Widgets/FullscreenButton/FullscreenButton.css @@ -1 +1 @@ -.cesium-button.cesium-fullscreenButton {display: block; width: 100%; height: 100%; margin: 0; border-radius: 0;} \ No newline at end of file +.cesium-button.cesium-fullscreenButton{display:block;width:100%;height:100%;margin:0;border-radius:0;} \ No newline at end of file diff --git a/Widgets/Geocoder/Geocoder.css b/Widgets/Geocoder/Geocoder.css index 266db19..541862c 100644 --- a/Widgets/Geocoder/Geocoder.css +++ b/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; 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;} .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-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/Widgets/Geocoder/lighter.css b/Widgets/Geocoder/lighter.css index a906d8f..f54fbea 100644 --- a/Widgets/Geocoder/lighter.css +++ b/Widgets/Geocoder/lighter.css @@ -1 +1 @@ -.cesium-lighter .cesium-geocoder-input {border: solid 1px #759dc0; background-color: rgba(240, 240, 240, 0.9); color: black;} .cesium-lighter .cesium-viewer-geocoderContainer:hover .cesium-geocoder-input {border-color: #aef; box-shadow: 0 0 8px #fff;} .cesium-lighter .cesium-geocoder-searchButton {background-color: #e2f0ff; fill: #111;} .cesium-lighter .cesium-geocoder-searchButton:hover {background-color: #a6d2ff;} \ No newline at end of file +.cesium-lighter .cesium-geocoder-input{border:solid 1px #759dc0;background-color:rgba(240,240,240,0.9);color:black;}.cesium-lighter .cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-lighter .cesium-geocoder-searchButton{background-color:#e2f0ff;fill:#111;}.cesium-lighter .cesium-geocoder-searchButton:hover{background-color:#a6d2ff;} \ No newline at end of file diff --git a/Widgets/InfoBox/InfoBox.css b/Widgets/InfoBox/InfoBox.css index 49fe245..8a97760 100644 --- a/Widgets/InfoBox/InfoBox.css +++ b/Widgets/InfoBox/InfoBox.css @@ -1 +1 @@ -.cesium-infoBox {display: block; position: absolute; top: 50px; right: 0; width: 40%; max-width: 360px; 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, 0.8); border-top-left-radius: 7px; text-align: center; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;} .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-body {padding: 4px 10px; margin-right: 4px; overflow: auto;} .cesium-infoBox-bodyless .cesium-infoBox-body {display: none;} .cesium-infoBox-loadingContainer {margin: 5px; text-align: center;} .cesium-infoBox-loading {display: inline-block; background-image: url(../Images/info-loading.gif); width: 16px; height: 11px;} .cesium-infoBox-description {font-size: 13px;} .cesium-infoBox-defaultTable {width: 100%;} .cesium-infoBox-defaultTable tr:nth-child(odd) {background-color: rgba(84, 84, 84, 0.8);} .cesium-infoBox-defaultTable tr:nth-child(even) {background-color: rgba(84, 84, 84, 0.25);} .cesium-infoBox-defaultTable th {font-weight: normal; padding: 3px; vertical-align: middle; text-align: center;} .cesium-infoBox-defaultTable td {padding: 3px; vertical-align: middle; text-align: left;} \ No newline at end of file +.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);} \ No newline at end of file diff --git a/Widgets/NavigationHelpButton/NavigationHelpButton.css b/Widgets/NavigationHelpButton/NavigationHelpButton.css index 19a92da..084ebb4 100644 --- a/Widgets/NavigationHelpButton/NavigationHelpButton.css +++ b/Widgets/NavigationHelpButton/NavigationHelpButton.css @@ -1 +1 @@ -.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); -ms-transform: scale(0.01); -o-transform: scale(0.01); transform: scale(0.01); -webkit-transform-origin: 234px -10px; -moz-transform-origin: 234px -10px; -ms-transform-origin: 234px -10px; -o-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; -ms-transition: visibility 0s 0.25s, -ms-transform 0.25s ease-in; -o-transition: visibility 0s 0.25s, -o-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); -ms-transform: scale(1); -o-transform: scale(1); transform: scale(1); transition: transform 0.25s ease-out; -webkit-transition: -webkit-transform 0.25s ease-out; -moz-transition: -moz-transform 0.25s ease-out; -ms-transition: -ms-transform 0.25s ease-out; -o-transition: -o-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);} \ No newline at end of file +.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);} \ No newline at end of file diff --git a/Widgets/NavigationHelpButton/lighter.css b/Widgets/NavigationHelpButton/lighter.css index b4be272..97bf08a 100644 --- a/Widgets/NavigationHelpButton/lighter.css +++ b/Widgets/NavigationHelpButton/lighter.css @@ -1 +1 @@ -.cesium-lighter .cesium-navigation-help-instructions {border: 1px solid #759dc0; background-color: rgba(255, 255, 255, 0.9);} .cesium-lighter .cesium-navigation-help-pan {color: #66ccee; font-weight: bold;} .cesium-lighter .cesium-navigation-help-zoom {color: #65ec00; font-weight: bold;} .cesium-lighter .cesium-navigation-help-rotate {color: #eec722; font-weight: bold;} .cesium-lighter .cesium-navigation-help-tilt {color: #d800d8; font-weight: bold;} .cesium-lighter .cesium-navigation-help-details {color: #222222;} .cesium-lighter .cesium-navigation-button {color: #222222; border-top: 1px solid #759dc0; border-right: 1px solid #759dc0;} .cesium-lighter .cesium-navigation-button-selected {background-color: rgba(196, 225, 255, 0.9);} .cesium-lighter .cesium-navigation-button-unselected {background-color: rgba(226, 240, 255, 0.9);} .cesium-lighter .cesium-navigation-button-unselected:hover {background-color: rgba(166, 210, 255, 0.9);} \ No newline at end of file +.cesium-lighter .cesium-navigation-help-instructions{border:1px solid #759dc0;background-color:rgba(255,255,255,0.9);}.cesium-lighter .cesium-navigation-help-pan{color:#66ccee;font-weight:bold;}.cesium-lighter .cesium-navigation-help-zoom{color:#65ec00;font-weight:bold;}.cesium-lighter .cesium-navigation-help-rotate{color:#eec722;font-weight:bold;}.cesium-lighter .cesium-navigation-help-tilt{color:#d800d8;font-weight:bold;}.cesium-lighter .cesium-navigation-help-details{color:#222222;}.cesium-lighter .cesium-navigation-button{color:#222222;border-top:1px solid #759dc0;border-right:1px solid #759dc0;}.cesium-lighter .cesium-navigation-button-selected{background-color:rgba(196,225,255,0.9);}.cesium-lighter .cesium-navigation-button-unselected{background-color:rgba(226,240,255,0.9);}.cesium-lighter .cesium-navigation-button-unselected:hover{background-color:rgba(166,210,255,0.9);} \ No newline at end of file diff --git a/Widgets/PerformanceWatchdog/PerformanceWatchdog.css b/Widgets/PerformanceWatchdog/PerformanceWatchdog.css index d93b063..aca8e2a 100644 --- a/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +++ b/Widgets/PerformanceWatchdog/PerformanceWatchdog.css @@ -1 +1 @@ -.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;} \ No newline at end of file +.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;} \ No newline at end of file diff --git a/Widgets/SceneModePicker/SceneModePicker.css b/Widgets/SceneModePicker/SceneModePicker.css index 79fe954..2a98a4c 100644 --- a/Widgets/SceneModePicker/SceneModePicker.css +++ b/Widgets/SceneModePicker/SceneModePicker.css @@ -1 +1 @@ -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; 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;} \ No newline at end of file +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;} \ No newline at end of file diff --git a/Widgets/SelectionIndicator/SelectionIndicator.css b/Widgets/SelectionIndicator/SelectionIndicator.css index ed160c9..dca2461 100644 --- a/Widgets/SelectionIndicator/SelectionIndicator.css +++ b/Widgets/SelectionIndicator/SelectionIndicator.css @@ -1 +1 @@ -.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;} \ No newline at end of file +.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;} \ No newline at end of file diff --git a/Widgets/Timeline/Timeline.css b/Widgets/Timeline/Timeline.css index d8f6f00..4484cb7 100644 --- a/Widgets/Timeline/Timeline.css +++ b/Widgets/Timeline/Timeline.css @@ -1 +1 @@ -.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: -o-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: -ms-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;} \ No newline at end of file +.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;} \ No newline at end of file diff --git a/Widgets/Timeline/lighter.css b/Widgets/Timeline/lighter.css index a63981c..422bb1b 100644 --- a/Widgets/Timeline/lighter.css +++ b/Widgets/Timeline/lighter.css @@ -1 +1 @@ -.cesium-lighter .cesium-timeline-bar {background: -moz-linear-gradient(top, #eeeeee 0%, #ffffff 50%, #fafafa 100%); background: -webkit-linear-gradient(top, #eeeeee 0%,#ffffff 50%,#fafafa 100%); background: -o-linear-gradient(top, #eeeeee 0%,#ffffff 50%,#fafafa 100%); background: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 50%,#fafafa 100%); background: linear-gradient(to bottom, #eeeeee 0%,#ffffff 50%,#fafafa 100%);} .cesium-lighter .cesium-timeline-ticLabel {color: #000;} .cesium-lighter .cesium-timeline-ticMain {position: absolute; bottom: 0; left: 0; width: 1px; height: 50%; background: #000;} .cesium-lighter .cesium-timeline-ticSub {background: #444;} \ No newline at end of file +.cesium-lighter .cesium-timeline-bar{background:-moz-linear-gradient(top,#eeeeee 0%,#ffffff 50%,#fafafa 100%);background:-webkit-linear-gradient(top,#eeeeee 0%,#ffffff 50%,#fafafa 100%);background:linear-gradient(to bottom,#eeeeee 0%,#ffffff 50%,#fafafa 100%);}.cesium-lighter .cesium-timeline-ticLabel{color:#000;}.cesium-lighter .cesium-timeline-ticMain{position:absolute;bottom:0;left:0;width:1px;height:50%;background:#000;}.cesium-lighter .cesium-timeline-ticSub{background:#444;} \ No newline at end of file diff --git a/Widgets/Viewer/Viewer.css b/Widgets/Viewer/Viewer.css index 5292acc..dee3277 100644 --- a/Widgets/Viewer/Viewer.css +++ b/Widgets/Viewer/Viewer.css @@ -1 +1 @@ -.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: 0px 0px 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-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-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/Widgets/lighter.css b/Widgets/lighter.css index 6a77c62..3c2c52c 100644 --- a/Widgets/lighter.css +++ b/Widgets/lighter.css @@ -1 +1 @@ -.cesium-lighter .cesium-button {color: #111; fill: #111; background: #e2f0ff; border: 1px solid #759dc0;} .cesium-lighter .cesium-button:focus {color: #000; fill: #000; border-color: #ea4;} .cesium-lighter .cesium-button:hover {color: #000; fill: #000; background: #a6d2ff; border-color: #aef; box-shadow: 0 0 8px #777;} .cesium-lighter .cesium-button:active {color: #fff; fill: #fff; background: #48b; border-color: #ea0;} .cesium-lighter .cesium-button:disabled, .cesium-lighter .cesium-button-disabled, .cesium-lighter .cesium-button-disabled:focus, .cesium-lighter .cesium-button-disabled:hover, .cesium-lighter .cesium-button-disabled:active {background: #ccc; border-color: #999; color: #999; fill: #999; box-shadow: none;} .cesium-lighter .cesium-animation-themeNormal {color: #E5F2FE;} .cesium-lighter .cesium-animation-themeHover {color: #ABD6FF;} .cesium-lighter .cesium-animation-themeSelect {color: #E5F2FE;} .cesium-lighter .cesium-animation-themeDisabled {color: #EFEFEF;} .cesium-lighter .cesium-animation-themeKnob {color: #E1E2E3;} .cesium-lighter .cesium-animation-themePointer {color: #FA5;} .cesium-lighter .cesium-animation-themeSwoosh {color: #ACE;} .cesium-lighter .cesium-animation-themeSwooshHover {color: #BDF;} .cesium-lighter .cesium-animation-svgText {fill: #111;} .cesium-lighter .cesium-animation-rectButton .cesium-animation-buttonPath {fill: #111;} .cesium-lighter .cesium-animation-rectButton .cesium-animation-buttonMain {stroke: #759DC0;} .cesium-lighter .cesium-animation-buttonToggled .cesium-animation-buttonGlow {fill: #FFAA2A;} .cesium-lighter .cesium-animation-buttonToggled .cesium-animation-buttonMain {stroke: #EA0;} .cesium-lighter .cesium-animation-rectButton:hover .cesium-animation-buttonMain {stroke: #759DC0;} .cesium-lighter .cesium-animation-buttonToggled:hover .cesium-animation-buttonGlow {fill: #fff;} .cesium-lighter .cesium-animation-buttonToggled:hover .cesium-animation-buttonMain {stroke: #EA0;} .cesium-lighter .cesium-animation-rectButton:active .cesium-animation-buttonMain {fill: #ABD6FF;} .cesium-lighter .cesium-animation-buttonDisabled .cesium-animation-buttonMain {stroke: #D3D3D3;} .cesium-lighter .cesium-animation-buttonDisabled .cesium-animation-buttonPath {fill: #818181;} .cesium-lighter .cesium-animation-shuttleRingBack {fill: #FAFAFA; fill-opacity: 1; stroke: #AEAEAE; stroke-width: 1.2;} .cesium-lighter .cesium-animation-shuttleRingSwoosh line {stroke: #8AC;} .cesium-lighter .cesium-animation-knobOuter {stroke: #A5A5A5;} .cesium-lighter .cesium-baseLayerPicker-itemIcon {border-color: #759dc0;} .cesium-lighter .cesium-baseLayerPicker-dropDown {background-color: rgba(240, 240, 240, 0.75);} .cesium-lighter .cesium-baseLayerPicker-sectionTitle {color: black;} .cesium-lighter .cesium-baseLayerPicker-itemLabel {color: black;} .cesium-lighter .cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon {border-color: #000;} .cesium-lighter .cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel {color: rgb(0, 61, 168);} .cesium-lighter .cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon {border: double 4px rgb(0, 61, 168);} .cesium-lighter .cesium-widget-errorPanel {background: rgba(255, 255, 255, 0.7);} .cesium-lighter .cesium-widget-errorPanel-content {border: 1px solid #526F82; border-radius: 7px; background-color: white; color: black;} .cesium-lighter .cesium-widget-errorPanel-header {color: #B87D00;} .cesium-lighter .cesium-geocoder-input {border: solid 1px #759dc0; background-color: rgba(240, 240, 240, 0.9); color: black;} .cesium-lighter .cesium-viewer-geocoderContainer:hover .cesium-geocoder-input {border-color: #aef; box-shadow: 0 0 8px #fff;} .cesium-lighter .cesium-geocoder-searchButton {background-color: #e2f0ff; fill: #111;} .cesium-lighter .cesium-geocoder-searchButton:hover {background-color: #a6d2ff;} .cesium-lighter .cesium-timeline-bar {background: -moz-linear-gradient(top, #eeeeee 0%, #ffffff 50%, #fafafa 100%); background: -webkit-linear-gradient(top, #eeeeee 0%,#ffffff 50%,#fafafa 100%); background: -o-linear-gradient(top, #eeeeee 0%,#ffffff 50%,#fafafa 100%); background: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 50%,#fafafa 100%); background: linear-gradient(to bottom, #eeeeee 0%,#ffffff 50%,#fafafa 100%);} .cesium-lighter .cesium-timeline-ticLabel {color: #000;} .cesium-lighter .cesium-timeline-ticMain {position: absolute; bottom: 0; left: 0; width: 1px; height: 50%; background: #000;} .cesium-lighter .cesium-timeline-ticSub {background: #444;} .cesium-lighter .cesium-navigation-help-instructions {border: 1px solid #759dc0; background-color: rgba(255, 255, 255, 0.9);} .cesium-lighter .cesium-navigation-help-pan {color: #66ccee; font-weight: bold;} .cesium-lighter .cesium-navigation-help-zoom {color: #65ec00; font-weight: bold;} .cesium-lighter .cesium-navigation-help-rotate {color: #eec722; font-weight: bold;} .cesium-lighter .cesium-navigation-help-tilt {color: #d800d8; font-weight: bold;} .cesium-lighter .cesium-navigation-help-details {color: #222222;} .cesium-lighter .cesium-navigation-button {color: #222222; border-top: 1px solid #759dc0; border-right: 1px solid #759dc0;} .cesium-lighter .cesium-navigation-button-selected {background-color: rgba(196, 225, 255, 0.9);} .cesium-lighter .cesium-navigation-button-unselected {background-color: rgba(226, 240, 255, 0.9);} .cesium-lighter .cesium-navigation-button-unselected:hover {background-color: rgba(166, 210, 255, 0.9);} \ No newline at end of file +.cesium-lighter .cesium-button{color:#111;fill:#111;background:#e2f0ff;border:1px solid #759dc0;}.cesium-lighter .cesium-button:focus{color:#000;fill:#000;border-color:#ea4;}.cesium-lighter .cesium-button:hover{color:#000;fill:#000;background:#a6d2ff;border-color:#aef;box-shadow:0 0 8px #777;}.cesium-lighter .cesium-button:active{color:#fff;fill:#fff;background:#48b;border-color:#ea0;}.cesium-lighter .cesium-button:disabled,.cesium-lighter .cesium-button-disabled,.cesium-lighter .cesium-button-disabled:focus,.cesium-lighter .cesium-button-disabled:hover,.cesium-lighter .cesium-button-disabled:active{background:#ccc;border-color:#999;color:#999;fill:#999;box-shadow:none;}.cesium-lighter .cesium-performanceDisplay{background-color:#e2f0ff;border-color:#759dc0;}.cesium-lighter .cesium-performanceDisplay-fps{color:#e52;}.cesium-lighter .cesium-performanceDisplay-ms{color:#ea4;}.cesium-lighter .cesium-animation-themeNormal{color:#E5F2FE;}.cesium-lighter .cesium-animation-themeHover{color:#ABD6FF;}.cesium-lighter .cesium-animation-themeSelect{color:#E5F2FE;}.cesium-lighter .cesium-animation-themeDisabled{color:#EFEFEF;}.cesium-lighter .cesium-animation-themeKnob{color:#E1E2E3;}.cesium-lighter .cesium-animation-themePointer{color:#FA5;}.cesium-lighter .cesium-animation-themeSwoosh{color:#ACE;}.cesium-lighter .cesium-animation-themeSwooshHover{color:#BDF;}.cesium-lighter .cesium-animation-svgText{fill:#111;}.cesium-lighter .cesium-animation-rectButton .cesium-animation-buttonPath{fill:#111;}.cesium-lighter .cesium-animation-rectButton .cesium-animation-buttonMain{stroke:#759DC0;}.cesium-lighter .cesium-animation-buttonToggled .cesium-animation-buttonGlow{fill:#FFAA2A;}.cesium-lighter .cesium-animation-buttonToggled .cesium-animation-buttonMain{stroke:#EA0;}.cesium-lighter .cesium-animation-rectButton:hover .cesium-animation-buttonMain{stroke:#759DC0;}.cesium-lighter .cesium-animation-buttonToggled:hover .cesium-animation-buttonGlow{fill:#fff;}.cesium-lighter .cesium-animation-buttonToggled:hover .cesium-animation-buttonMain{stroke:#EA0;}.cesium-lighter .cesium-animation-rectButton:active .cesium-animation-buttonMain{fill:#ABD6FF;}.cesium-lighter .cesium-animation-buttonDisabled .cesium-animation-buttonMain{stroke:#D3D3D3;}.cesium-lighter .cesium-animation-buttonDisabled .cesium-animation-buttonPath{fill:#818181;}.cesium-lighter .cesium-animation-shuttleRingBack{fill:#FAFAFA;fill-opacity:1;stroke:#AEAEAE;stroke-width:1.2;}.cesium-lighter .cesium-animation-shuttleRingSwoosh line{stroke:#8AC;}.cesium-lighter .cesium-animation-knobOuter{stroke:#A5A5A5;}.cesium-lighter .cesium-baseLayerPicker-itemIcon{border-color:#759dc0;}.cesium-lighter .cesium-baseLayerPicker-dropDown{background-color:rgba(240,240,240,0.75);}.cesium-lighter .cesium-baseLayerPicker-sectionTitle{color:black;}.cesium-lighter .cesium-baseLayerPicker-itemLabel{color:black;}.cesium-lighter .cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon{border-color:#000;}.cesium-lighter .cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel{color:rgb(0,61,168);}.cesium-lighter .cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon{border:double 4px rgb(0,61,168);}.cesium-lighter .cesium-widget-errorPanel{background:rgba(255,255,255,0.7);}.cesium-lighter .cesium-widget-errorPanel-content{border:1px solid #526F82;border-radius:7px;background-color:white;color:black;}.cesium-lighter .cesium-widget-errorPanel-header{color:#B87D00;}.cesium-lighter .cesium-geocoder-input{border:solid 1px #759dc0;background-color:rgba(240,240,240,0.9);color:black;}.cesium-lighter .cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-lighter .cesium-geocoder-searchButton{background-color:#e2f0ff;fill:#111;}.cesium-lighter .cesium-geocoder-searchButton:hover{background-color:#a6d2ff;}.cesium-lighter .cesium-timeline-bar{background:-moz-linear-gradient(top,#eeeeee 0%,#ffffff 50%,#fafafa 100%);background:-webkit-linear-gradient(top,#eeeeee 0%,#ffffff 50%,#fafafa 100%);background:linear-gradient(to bottom,#eeeeee 0%,#ffffff 50%,#fafafa 100%);}.cesium-lighter .cesium-timeline-ticLabel{color:#000;}.cesium-lighter .cesium-timeline-ticMain{position:absolute;bottom:0;left:0;width:1px;height:50%;background:#000;}.cesium-lighter .cesium-timeline-ticSub{background:#444;}.cesium-lighter .cesium-navigation-help-instructions{border:1px solid #759dc0;background-color:rgba(255,255,255,0.9);}.cesium-lighter .cesium-navigation-help-pan{color:#66ccee;font-weight:bold;}.cesium-lighter .cesium-navigation-help-zoom{color:#65ec00;font-weight:bold;}.cesium-lighter .cesium-navigation-help-rotate{color:#eec722;font-weight:bold;}.cesium-lighter .cesium-navigation-help-tilt{color:#d800d8;font-weight:bold;}.cesium-lighter .cesium-navigation-help-details{color:#222222;}.cesium-lighter .cesium-navigation-button{color:#222222;border-top:1px solid #759dc0;border-right:1px solid #759dc0;}.cesium-lighter .cesium-navigation-button-selected{background-color:rgba(196,225,255,0.9);}.cesium-lighter .cesium-navigation-button-unselected{background-color:rgba(226,240,255,0.9);}.cesium-lighter .cesium-navigation-button-unselected:hover{background-color:rgba(166,210,255,0.9);} \ No newline at end of file diff --git a/Widgets/lighterShared.css b/Widgets/lighterShared.css index 5a9b86a..238d3bc 100644 --- a/Widgets/lighterShared.css +++ b/Widgets/lighterShared.css @@ -1 +1 @@ -.cesium-lighter .cesium-button {color: #111; fill: #111; background: #e2f0ff; border: 1px solid #759dc0;} .cesium-lighter .cesium-button:focus {color: #000; fill: #000; border-color: #ea4;} .cesium-lighter .cesium-button:hover {color: #000; fill: #000; background: #a6d2ff; border-color: #aef; box-shadow: 0 0 8px #777;} .cesium-lighter .cesium-button:active {color: #fff; fill: #fff; background: #48b; border-color: #ea0;} .cesium-lighter .cesium-button:disabled, .cesium-lighter .cesium-button-disabled, .cesium-lighter .cesium-button-disabled:focus, .cesium-lighter .cesium-button-disabled:hover, .cesium-lighter .cesium-button-disabled:active {background: #ccc; border-color: #999; color: #999; fill: #999; box-shadow: none;} \ No newline at end of file +.cesium-lighter .cesium-button{color:#111;fill:#111;background:#e2f0ff;border:1px solid #759dc0;}.cesium-lighter .cesium-button:focus{color:#000;fill:#000;border-color:#ea4;}.cesium-lighter .cesium-button:hover{color:#000;fill:#000;background:#a6d2ff;border-color:#aef;box-shadow:0 0 8px #777;}.cesium-lighter .cesium-button:active{color:#fff;fill:#fff;background:#48b;border-color:#ea0;}.cesium-lighter .cesium-button:disabled,.cesium-lighter .cesium-button-disabled,.cesium-lighter .cesium-button-disabled:focus,.cesium-lighter .cesium-button-disabled:hover,.cesium-lighter .cesium-button-disabled:active{background:#ccc;border-color:#999;color:#999;fill:#999;box-shadow:none;}.cesium-lighter .cesium-performanceDisplay{background-color:#e2f0ff;border-color:#759dc0;}.cesium-lighter .cesium-performanceDisplay-fps{color:#e52;}.cesium-lighter .cesium-performanceDisplay-ms{color:#ea4;} \ No newline at end of file diff --git a/Widgets/shared.css b/Widgets/shared.css index 5614539..bb33f84 100644 --- a/Widgets/shared.css +++ b/Widgets/shared.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; 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-toolbar-button {-moz-box-sizing: border-box; box-sizing: border-box; width: 32px; height: 32px; border-radius: 14%; padding: 0; vertical-align: middle; z-index: 0;} \ 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-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;} \ No newline at end of file diff --git a/Widgets/widgets.css b/Widgets/widgets.css index e0a64c2..670e86b 100644 --- a/Widgets/widgets.css +++ b/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; 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-toolbar-button {-moz-box-sizing: border-box; box-sizing: border-box; width: 32px; height: 32px; border-radius: 14%; padding: 0; vertical-align: middle; z-index: 0;} .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; 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; 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; 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; 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; 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%;} .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; 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; 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-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; 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;} .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: 360px; 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, 0.8); border-top-left-radius: 7px; text-align: center; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;} .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-body {padding: 4px 10px; margin-right: 4px; overflow: auto;} .cesium-infoBox-bodyless .cesium-infoBox-body {display: none;} .cesium-infoBox-loadingContainer {margin: 5px; text-align: center;} .cesium-infoBox-loading {display: inline-block; background-image: url(Images/info-loading.gif); width: 16px; height: 11px;} .cesium-infoBox-description {font-size: 13px;} .cesium-infoBox-defaultTable {width: 100%;} .cesium-infoBox-defaultTable tr:nth-child(odd) {background-color: rgba(84, 84, 84, 0.8);} .cesium-infoBox-defaultTable tr:nth-child(even) {background-color: rgba(84, 84, 84, 0.25);} .cesium-infoBox-defaultTable th {font-weight: normal; padding: 3px; vertical-align: middle; text-align: center;} .cesium-infoBox-defaultTable td {padding: 3px; vertical-align: middle; text-align: left;} 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; 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); -ms-transform: scale(0.01); -o-transform: scale(0.01); transform: scale(0.01); -webkit-transform-origin: 234px -10px; -moz-transform-origin: 234px -10px; -ms-transform-origin: 234px -10px; -o-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; -ms-transition: visibility 0s 0.25s, -ms-transform 0.25s ease-in; -o-transition: visibility 0s 0.25s, -o-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); -ms-transform: scale(1); -o-transform: scale(1); transform: scale(1); transition: transform 0.25s ease-out; -webkit-transition: -webkit-transform 0.25s ease-out; -moz-transition: -moz-transform 0.25s ease-out; -ms-transition: -ms-transform 0.25s ease-out; -o-transition: -o-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: -o-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: -ms-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: 0px 0px 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-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-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 diff --git a/Workers/cesiumWorkerBootstrapper.js b/Workers/cesiumWorkerBootstrapper.js index 8512e7e..6697c97 100644 --- a/Workers/cesiumWorkerBootstrapper.js +++ b/Workers/cesiumWorkerBootstrapper.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,9 +21,9 @@ * See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details. */ /** vim: et:ts=4:sw=4:sts=4 - * @license RequireJS 2.1.9 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. + * @license RequireJS 2.1.20 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/requirejs for details */ -function setTimeout(e){e()}"undefined"==typeof self&&(self={}),self.onmessage=function(e){var t=e.data;require(t.loaderConfig,[t.workerModule],function(e){self.onmessage=e})};var requirejs,require,define;!function(global){function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){if(e){var i;for(i=0;i<e.length&&(!e[i]||!t(e[i],i,e));i+=1);}}function eachReverse(e,t){if(e){var i;for(i=e.length-1;i>-1&&(!e[i]||!t(e[i],i,e));i-=1);}}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var i;for(i in e)if(hasProp(e,i)&&t(e[i],i))break}function mixin(e,t,i,r){return t&&eachProp(t,function(t,n){(i||!hasProp(e,n))&&(r&&"string"!=typeof t?(e[n]||(e[n]={}),mixin(e[n],t,i,r)):e[n]=t)}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,i,r){var n=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return n.requireType=e,n.requireModules=r,i&&(n.originalError=i),n}function newContext(e){function t(e){var t,i;for(t=0;e[t];t+=1)if(i=e[t],"."===i)e.splice(t,1),t-=1;else if(".."===i){if(1===t&&(".."===e[2]||".."===e[0]))break;t>0&&(e.splice(t-1,2),t-=2)}}function i(e,i,r){var n,a,o,s,c,u,p,d,f,l,h,m=i&&i.split("/"),g=m,v=y.map,x=v&&v["*"];if(e&&"."===e.charAt(0)&&(i?(g=getOwn(y.pkgs,i)?m=[i]:m.slice(0,m.length-1),e=g.concat(e.split("/")),t(e),a=getOwn(y.pkgs,n=e[0]),e=e.join("/"),a&&e===n+"/"+a.main&&(e=n)):0===e.indexOf("./")&&(e=e.substring(2))),r&&v&&(m||x)){for(s=e.split("/"),c=s.length;c>0;c-=1){if(p=s.slice(0,c).join("/"),m)for(u=m.length;u>0;u-=1)if(o=getOwn(v,m.slice(0,u).join("/")),o&&(o=getOwn(o,p))){d=o,f=c;break}if(d)break;!l&&x&&getOwn(x,p)&&(l=getOwn(x,p),h=c)}!d&&l&&(d=l,f=h),d&&(s.splice(0,f,d),e=s.join("/"))}return e}function r(e){isBrowser&&each(scripts(),function(t){return t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===q.contextName?(t.parentNode.removeChild(t),!0):void 0})}function n(e){var t=getOwn(y.paths,e);return t&&isArray(t)&&t.length>1?(t.shift(),q.require.undef(e),q.require([e]),!0):void 0}function a(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 o(e,t,r,n){var o,s,c,u,p=null,d=t?t.name:null,f=e,l=!0,h="";return e||(l=!1,e="_@r"+(A+=1)),u=a(e),p=u[0],e=u[1],p&&(p=i(p,d,n),s=getOwn(j,p)),e&&(p?h=s&&s.normalize?s.normalize(e,function(e){return i(e,d,n)}):i(e,d,n):(h=i(e,d,n),u=a(h),p=u[0],h=u[1],r=!0,o=q.nameToUrl(h))),c=!p||s||r?"":"_unnormalized"+(T+=1),{prefix:p,name:h,parentMap:t,unnormalized:!!c,url:o,originalName:f,isDefine:l,id:(p?p+"!"+h:h)+c}}function s(e){var t=e.id,i=getOwn(k,t);return i||(i=k[t]=new q.Module(e)),i}function c(e,t,i){var r=e.id,n=getOwn(k,r);!hasProp(j,r)||n&&!n.defineEmitComplete?(n=s(e),n.error&&"error"===t?i(n.error):n.on(t,i)):"defined"===t&&i(j[r])}function u(e,t){var i=e.requireModules,r=!1;t?t(e):(each(i,function(t){var i=getOwn(k,t);i&&(i.error=e,i.events.error&&(r=!0,i.emit("error",e)))}),r||req.onError(e))}function p(){globalDefQueue.length&&(apsp.apply(M,[M.length-1,0].concat(globalDefQueue)),globalDefQueue=[])}function d(e){delete k[e],delete S[e]}function f(e,t,i){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,function(r,n){var a=r.id,o=getOwn(k,a);!o||e.depMatched[n]||i[a]||(getOwn(t,a)?(e.defineDep(n,j[a]),e.check()):f(o,t,i))}),i[r]=!0)}function l(){var e,t,i,a,o=1e3*y.waitSeconds,s=o&&q.startTime+o<(new Date).getTime(),c=[],p=[],d=!1,h=!0;if(!x){if(x=!0,eachProp(S,function(i){if(e=i.map,t=e.id,i.enabled&&(e.isDefine||p.push(i),!i.error))if(!i.inited&&s)n(t)?(a=!0,d=!0):(c.push(t),r(t));else if(!i.inited&&i.fetched&&e.isDefine&&(d=!0,!e.prefix))return h=!1}),s&&c.length)return i=makeError("timeout","Load timeout for modules: "+c,null,c),i.contextName=q.contextName,u(i);h&&each(p,function(e){f(e,{},{})}),s&&!a||!d||!isBrowser&&!isWebWorker||w||(w=setTimeout(function(){w=0,l()},50)),x=!1}}function h(e){hasProp(j,e[0])||s(o(e[0],null,!0)).init(e[1],e[2])}function m(e,t,i,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(i,t,!1)}function g(e){var t=e.currentTarget||e.srcElement;return m(t,q.onScriptLoad,"load","onreadystatechange"),m(t,q.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function v(){var e;for(p();M.length;){if(e=M.shift(),null===e[0])return u(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));h(e)}}var x,b,q,E,w,y={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},shim:{},config:{}},k={},S={},O={},M=[],j={},P={},A=1,T=1;return E={require:function(e){return e.require?e.require:e.require=q.makeRequire(e.map)},exports:function(e){return e.usingExports=!0,e.map.isDefine?e.exports?e.exports:e.exports=j[e.map.id]={}:void 0},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){var t,i=getOwn(y.pkgs,e.map.id);return t=i?getOwn(y.config,e.map.id+"/"+i.main):getOwn(y.config,e.map.id),t||{}},exports:j[e.map.id]}}},b=function(e){this.events=getOwn(O,e.id)||{},this.map=e,this.shim=getOwn(y.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},b.prototype={init:function(e,t,i,r){r=r||{},this.inited||(this.factory=t,i?this.on("error",i):this.events.error&&(i=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=i,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,q.startTime=(new Date).getTime();var e=this.map;return this.shim?(q.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()})),void 0):e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;P[e]||(P[e]=!0,q.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,i=this.map.id,r=this.depExports,n=this.exports,a=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(a)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{n=q.execCb(i,a,r,n)}catch(o){e=o}else n=q.execCb(i,a,r,n);if(this.map.isDefine&&(t=this.module,t&&void 0!==t.exports&&t.exports!==this.exports?n=t.exports:void 0===n&&this.usingExports&&(n=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",u(this.error=e)}else n=a;this.exports=n,this.map.isDefine&&!this.ignore&&(j[i]=n,req.onResourceLoad&&req.onResourceLoad(q,this.map,this.depMaps)),d(i),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=o(e.prefix);this.depMaps.push(r),c(r,"defined",bind(this,function(r){var n,a,p,f=this.map.name,l=this.map.parentMap?this.map.parentMap.name:null,h=q.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(f=r.normalize(f,function(e){return i(e,l,!0)})||""),a=o(e.prefix+"!"+f,this.map.parentMap),c(a,"defined",bind(this,function(e){this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),p=getOwn(k,a.id),p&&(this.depMaps.push(a),this.events.error&&p.on("error",bind(this,function(e){this.emit("error",e)})),p.enable()),void 0):(n=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})}),n.error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(k,function(e){0===e.map.id.indexOf(t+"_unnormalized")&&d(e.map.id)}),u(e)}),n.fromText=bind(this,function(i,r){var a=e.name,c=o(a),p=useInteractive;r&&(i=r),p&&(useInteractive=!1),s(c),hasProp(y.config,t)&&(y.config[a]=y.config[t]);try{req.exec(i)}catch(d){return u(makeError("fromtexteval","fromText eval for "+t+" failed: "+d,d,[t]))}p&&(useInteractive=!0),this.depMaps.push(c),q.completeLoad(a),h([a],n)}),r.load(e.name,h,n,y),void 0)})),q.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){S[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var i,r,n;if("string"==typeof e){if(e=o(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,n=getOwn(E,e.id))return this.depExports[t]=n(this),void 0;this.depCount+=1,c(e,"defined",bind(this,function(e){this.defineDep(t,e),this.check()})),this.errback&&c(e,"error",bind(this,this.errback))}i=e.id,r=k[i],hasProp(E,i)||!r||r.enabled||q.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(k,e.id);t&&!t.enabled&&q.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var i=this.events[e];i||(i=this.events[e]=[]),i.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),"error"===e&&delete this.events[e]}},q={config:y,contextName:e,registry:k,defined:j,urlFetched:P,defQueue:M,Module:b,makeModuleMap:o,nextTick:req.nextTick,onError:u,configure:function(e){e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/");var t=y.pkgs,i=y.shim,r={paths:!0,config:!0,map:!0};eachProp(e,function(e,t){r[t]?"map"===t?(y.map||(y.map={}),mixin(y[t],e,!0,!0)):mixin(y[t],e,!0):y[t]=e}),e.shim&&(eachProp(e.shim,function(e,t){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=q.makeShimExports(e)),i[t]=e}),y.shim=i),e.packages&&(each(e.packages,function(e){var i;e="string"==typeof e?{name:e}:e,i=e.location,t[e.name]={name:e.name,location:i||e.name,main:(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}}),y.pkgs=t),eachProp(k,function(e,t){e.inited||e.map.unnormalized||(e.map=o(t))}),(e.deps||e.callback)&&q.require(e.deps||[],e.callback)},makeShimExports:function(e){function t(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}return t},makeRequire:function(t,n){function a(i,r,c){var p,d,f;return n.enableBuildCallback&&r&&isFunction(r)&&(r.__requireJsBuild=!0),"string"==typeof i?isFunction(r)?u(makeError("requireargs","Invalid require call"),c):t&&hasProp(E,i)?E[i](k[t.id]):req.get?req.get(q,i,t,a):(d=o(i,t,!1,!0),p=d.id,hasProp(j,p)?j[p]:u(makeError("notloaded",'Module name "'+p+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(v(),q.nextTick(function(){v(),f=s(o(null,t)),f.skipMap=n.skipMap,f.init(i,r,c,{enabled:!0}),l()}),a)}return n=n||{},mixin(a,{isBrowser:isBrowser,toUrl:function(e){var r,n=e.lastIndexOf("."),a=e.split("/")[0],o="."===a||".."===a;return-1!==n&&(!o||n>1)&&(r=e.substring(n,e.length),e=e.substring(0,n)),q.nameToUrl(i(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(j,o(e,t,!1,!0).id)},specified:function(e){return e=o(e,t,!1,!0).id,hasProp(j,e)||hasProp(k,e)}}),t||(a.undef=function(e){p();var i=o(e,t,!0),n=getOwn(k,e);r(e),delete j[e],delete P[i.url],delete O[e],n&&(n.events.defined&&(O[e]=n.events),d(e))}),a},enable:function(e){var t=getOwn(k,e.id);t&&s(e).enable()},completeLoad:function(e){var t,i,r,a=getOwn(y.shim,e)||{},o=a.exports;for(p();M.length;){if(i=M.shift(),null===i[0]){if(i[0]=e,t)break;t=!0}else i[0]===e&&(t=!0);h(i)}if(r=getOwn(k,e),!t&&!hasProp(j,e)&&r&&!r.inited){if(!(!y.enforceDefine||o&&getGlobal(o)))return n(e)?void 0:u(makeError("nodefine","No define call for "+e,null,[e]));h([e,a.deps||[],a.exportsFn])}l()},nameToUrl:function(e,t,i){var r,n,a,o,s,c,u,p,d;if(req.jsExtRegExp.test(e))p=e+(t||"");else{for(r=y.paths,n=y.pkgs,s=e.split("/"),c=s.length;c>0;c-=1){if(u=s.slice(0,c).join("/"),a=getOwn(n,u),d=getOwn(r,u)){isArray(d)&&(d=d[0]),s.splice(0,c,d);break}if(a){o=e===a.name?a.location+"/"+a.main:a.location,s.splice(0,c,o);break}}p=s.join("/"),p+=t||(/^data\:|\?/.test(p)||i?"":".js"),p=("/"===p.charAt(0)||p.match(/^[\w\+\.\-]+:/)?"":y.baseUrl)+p}return y.urlArgs?p+((-1===p.indexOf("?")?"?":"&")+y.urlArgs):p},load:function(e,t){req.load(q,e,t)},execCb:function(e,t,i,r){return t.apply(r,i)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=g(e);q.completeLoad(t.id)}},onScriptError:function(e){var t=g(e);return n(t.id)?void 0:u(makeError("scripterror","Script error for: "+t.id,e,[t.id]))}},q.require=q.makeRequire(),q}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState?interactiveScript:(eachReverse(scripts(),function(e){return"interactive"===e.readyState?interactiveScript=e:void 0}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.1.9",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,apsp=ap.splice,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if("undefined"==typeof define){if("undefined"!=typeof requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}"undefined"==typeof require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,i,r){var n,a,o=defContextName;return isArray(e)||"string"==typeof e||(a=e,isArray(t)?(e=t,t=i,i=r):e=[]),a&&a.context&&(o=a.context),n=getOwn(contexts,o),n||(n=contexts[o]=req.s.newContext(o)),a&&n.configure(a),n.require(e,t,i)},req.config=function(e){return req(e)},req.nextTick="undefined"!=typeof setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e){var t=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return t.type=e.scriptType||"text/javascript",t.charset="utf-8",t.async=!0,t},req.load=function(e,t,i){var r,n=e&&e.config||{};if(isBrowser)return r=req.createNode(n,t,i),r.setAttribute("data-requirecontext",e.contextName),r.setAttribute("data-requiremodule",t),!r.attachEvent||r.attachEvent.toString&&r.attachEvent.toString().indexOf("[native code")<0||isOpera?(r.addEventListener("load",e.onScriptLoad,!1),r.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,r.attachEvent("onreadystatechange",e.onScriptLoad)),r.src=i,currentlyAddingScript=r,baseElement?head.insertBefore(r,baseElement):head.appendChild(r),currentlyAddingScript=null,r;if(isWebWorker)try{importScripts(i),e.completeLoad(t)}catch(a){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+i,a,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){return head||(head=e.parentNode),dataMain=e.getAttribute("data-main"),dataMain?(mainScript=dataMain,cfg.baseUrl||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0):void 0}),define=function(e,t,i){var r,n;"string"!=typeof e&&(i=t,t=e,e=null),isArray(t)||(i=t,t=null),!t&&isFunction(i)&&(t=[],i.length&&(i.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(e,i){t.push(i)}),t=(1===i.length?["require"]:["require","exports","module"]).concat(t))),useInteractive&&(r=currentlyAddingScript||getInteractiveScript(),r&&(e||(e=r.getAttribute("data-requiremodule")),n=contexts[r.getAttribute("data-requirecontext")])),(n?n.defQueue:globalDefQueue).push([e,t,i])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this); \ No newline at end of file +function setTimeout(e){e()}"undefined"==typeof self&&(self={}),self.onmessage=function(e){var t=e.data;require(t.loaderConfig,[t.workerModule],function(e){self.onmessage=e})};var requirejs,require,define;!function(global){function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){if(e){var i;for(i=0;i<e.length&&(!e[i]||!t(e[i],i,e));i+=1);}}function eachReverse(e,t){if(e){var i;for(i=e.length-1;i>-1&&(!e[i]||!t(e[i],i,e));i-=1);}}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var i;for(i in e)if(hasProp(e,i)&&t(e[i],i))break}function mixin(e,t,i,r){return t&&eachProp(t,function(t,n){(i||!hasProp(e,n))&&(!r||"object"!=typeof t||!t||isArray(t)||isFunction(t)||t instanceof RegExp?e[n]=t:(e[n]||(e[n]={}),mixin(e[n],t,i,r)))}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,i,r){var n=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return n.requireType=e,n.requireModules=r,i&&(n.originalError=i),n}function newContext(e){function t(e){var t,i;for(t=0;t<e.length;t++)if(i=e[t],"."===i)e.splice(t,1),t-=1;else if(".."===i){if(0===t||1===t&&".."===e[2]||".."===e[t-1])continue;t>0&&(e.splice(t-1,2),t-=2)}}function i(e,i,r){var n,o,a,s,u,c,d,p,f,l,h,m,g=i&&i.split("/"),v=y.map,x=v&&v["*"];if(e&&(e=e.split("/"),d=e.length-1,y.nodeIdCompat&&jsSuffixRegExp.test(e[d])&&(e[d]=e[d].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&g&&(m=g.slice(0,g.length-1),e=m.concat(e)),t(e),e=e.join("/")),r&&v&&(g||x)){a=e.split("/");e:for(s=a.length;s>0;s-=1){if(c=a.slice(0,s).join("/"),g)for(u=g.length;u>0;u-=1)if(o=getOwn(v,g.slice(0,u).join("/")),o&&(o=getOwn(o,c))){p=o,f=s;break e}!l&&x&&getOwn(x,c)&&(l=getOwn(x,c),h=s)}!p&&l&&(p=l,f=h),p&&(a.splice(0,f,p),e=a.join("/"))}return n=getOwn(y.pkgs,e),n?n:e}function r(e){isBrowser&&each(scripts(),function(t){return t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===q.contextName?(t.parentNode.removeChild(t),!0):void 0})}function n(e){var t=getOwn(y.paths,e);return t&&isArray(t)&&t.length>1?(t.shift(),q.require.undef(e),q.makeRequire(null,{skipMap:!0})([e]),!0):void 0}function o(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 a(e,t,r,n){var a,s,u,c,d=null,p=t?t.name:null,f=e,l=!0,h="";return e||(l=!1,e="_@r"+(A+=1)),c=o(e),d=c[0],e=c[1],d&&(d=i(d,p,n),s=getOwn(j,d)),e&&(d?h=s&&s.normalize?s.normalize(e,function(e){return i(e,p,n)}):-1===e.indexOf("!")?i(e,p,n):e:(h=i(e,p,n),c=o(h),d=c[0],h=c[1],r=!0,a=q.nameToUrl(h))),u=!d||s||r?"":"_unnormalized"+(T+=1),{prefix:d,name:h,parentMap:t,unnormalized:!!u,url:a,originalName:f,isDefine:l,id:(d?d+"!"+h:h)+u}}function s(e){var t=e.id,i=getOwn(k,t);return i||(i=k[t]=new q.Module(e)),i}function u(e,t,i){var r=e.id,n=getOwn(k,r);!hasProp(j,r)||n&&!n.defineEmitComplete?(n=s(e),n.error&&"error"===t?i(n.error):n.on(t,i)):"defined"===t&&i(j[r])}function c(e,t){var i=e.requireModules,r=!1;t?t(e):(each(i,function(t){var i=getOwn(k,t);i&&(i.error=e,i.events.error&&(r=!0,i.emit("error",e)))}),r||req.onError(e))}function d(){globalDefQueue.length&&(each(globalDefQueue,function(e){var t=e[0];"string"==typeof t&&(q.defQueueMap[t]=!0),O.push(e)}),globalDefQueue=[])}function p(e){delete k[e],delete S[e]}function f(e,t,i){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,function(r,n){var o=r.id,a=getOwn(k,o);!a||e.depMatched[n]||i[o]||(getOwn(t,o)?(e.defineDep(n,j[o]),e.check()):f(a,t,i))}),i[r]=!0)}function l(){var e,t,i=1e3*y.waitSeconds,o=i&&q.startTime+i<(new Date).getTime(),a=[],s=[],u=!1,d=!0;if(!x){if(x=!0,eachProp(S,function(e){var i=e.map,c=i.id;if(e.enabled&&(i.isDefine||s.push(e),!e.error))if(!e.inited&&o)n(c)?(t=!0,u=!0):(a.push(c),r(c));else if(!e.inited&&e.fetched&&i.isDefine&&(u=!0,!i.prefix))return d=!1}),o&&a.length)return e=makeError("timeout","Load timeout for modules: "+a,null,a),e.contextName=q.contextName,c(e);d&&each(s,function(e){f(e,{},{})}),o&&!t||!u||!isBrowser&&!isWebWorker||w||(w=setTimeout(function(){w=0,l()},50)),x=!1}}function h(e){hasProp(j,e[0])||s(a(e[0],null,!0)).init(e[1],e[2])}function m(e,t,i,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(i,t,!1)}function g(e){var t=e.currentTarget||e.srcElement;return m(t,q.onScriptLoad,"load","onreadystatechange"),m(t,q.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function v(){var e;for(d();O.length;){if(e=O.shift(),null===e[0])return c(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));h(e)}q.defQueueMap={}}var x,b,q,E,w,y={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},k={},S={},M={},O=[],j={},P={},R={},A=1,T=1;return E={require:function(e){return e.require?e.require:e.require=q.makeRequire(e.map)},exports:function(e){return e.usingExports=!0,e.map.isDefine?e.exports?j[e.map.id]=e.exports:e.exports=j[e.map.id]={}:void 0},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(y.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},b=function(e){this.events=getOwn(M,e.id)||{},this.map=e,this.shim=getOwn(y.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},b.prototype={init:function(e,t,i,r){r=r||{},this.inited||(this.factory=t,i?this.on("error",i):this.events.error&&(i=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=i,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,q.startTime=(new Date).getTime();var e=this.map;return this.shim?void q.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()})):e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;P[e]||(P[e]=!0,q.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,i=this.map.id,r=this.depExports,n=this.exports,o=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{n=q.execCb(i,o,r,n)}catch(a){e=a}else n=q.execCb(i,o,r,n);if(this.map.isDefine&&void 0===n&&(t=this.module,t?n=t.exports:this.usingExports&&(n=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",c(this.error=e)}else n=o;this.exports=n,this.map.isDefine&&!this.ignore&&(j[i]=n,req.onResourceLoad&&req.onResourceLoad(q,this.map,this.depMaps)),p(i),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(q.defQueueMap,i)||this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=a(e.prefix);this.depMaps.push(r),u(r,"defined",bind(this,function(r){var n,o,d,f=getOwn(R,this.map.id),l=this.map.name,h=this.map.parentMap?this.map.parentMap.name:null,m=q.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(l=r.normalize(l,function(e){return i(e,h,!0)})||""),o=a(e.prefix+"!"+l,this.map.parentMap),u(o,"defined",bind(this,function(e){this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),d=getOwn(k,o.id),void(d&&(this.depMaps.push(o),this.events.error&&d.on("error",bind(this,function(e){this.emit("error",e)})),d.enable()))):f?(this.map.url=q.nameToUrl(f),void this.load()):(n=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})}),n.error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(k,function(e){0===e.map.id.indexOf(t+"_unnormalized")&&p(e.map.id)}),c(e)}),n.fromText=bind(this,function(i,r){var o=e.name,u=a(o),d=useInteractive;r&&(i=r),d&&(useInteractive=!1),s(u),hasProp(y.config,t)&&(y.config[o]=y.config[t]);try{req.exec(i)}catch(p){return c(makeError("fromtexteval","fromText eval for "+t+" failed: "+p,p,[t]))}d&&(useInteractive=!0),this.depMaps.push(u),q.completeLoad(o),m([o],n)}),void r.load(e.name,m,n,y))})),q.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){S[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var i,r,n;if("string"==typeof e){if(e=a(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,n=getOwn(E,e.id))return void(this.depExports[t]=n(this));this.depCount+=1,u(e,"defined",bind(this,function(e){this.undefed||(this.defineDep(t,e),this.check())})),this.errback?u(e,"error",bind(this,this.errback)):this.events.error&&u(e,"error",bind(this,function(e){this.emit("error",e)}))}i=e.id,r=k[i],hasProp(E,i)||!r||r.enabled||q.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(k,e.id);t&&!t.enabled&&q.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var i=this.events[e];i||(i=this.events[e]=[]),i.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),"error"===e&&delete this.events[e]}},q={config:y,contextName:e,registry:k,defined:j,urlFetched:P,defQueue:O,defQueueMap:{},Module:b,makeModuleMap:a,nextTick:req.nextTick,onError:c,configure:function(e){e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/");var t=y.shim,i={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(e,t){i[t]?(y[t]||(y[t]={}),mixin(y[t],e,!0,!0)):y[t]=e}),e.bundles&&eachProp(e.bundles,function(e,t){each(e,function(e){e!==t&&(R[e]=t)})}),e.shim&&(eachProp(e.shim,function(e,i){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=q.makeShimExports(e)),t[i]=e}),y.shim=t),e.packages&&each(e.packages,function(e){var t,i;e="string"==typeof e?{name:e}:e,i=e.name,t=e.location,t&&(y.paths[i]=e.location),y.pkgs[i]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(k,function(e,t){e.inited||e.map.unnormalized||(e.map=a(t,null,!0))}),(e.deps||e.callback)&&q.require(e.deps||[],e.callback)},makeShimExports:function(e){function t(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}return t},makeRequire:function(t,n){function o(i,r,u){var d,p,f;return n.enableBuildCallback&&r&&isFunction(r)&&(r.__requireJsBuild=!0),"string"==typeof i?isFunction(r)?c(makeError("requireargs","Invalid require call"),u):t&&hasProp(E,i)?E[i](k[t.id]):req.get?req.get(q,i,t,o):(p=a(i,t,!1,!0),d=p.id,hasProp(j,d)?j[d]:c(makeError("notloaded",'Module name "'+d+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(v(),q.nextTick(function(){v(),f=s(a(null,t)),f.skipMap=n.skipMap,f.init(i,r,u,{enabled:!0}),l()}),o)}return n=n||{},mixin(o,{isBrowser:isBrowser,toUrl:function(e){var r,n=e.lastIndexOf("."),o=e.split("/")[0],a="."===o||".."===o;return-1!==n&&(!a||n>1)&&(r=e.substring(n,e.length),e=e.substring(0,n)),q.nameToUrl(i(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(j,a(e,t,!1,!0).id)},specified:function(e){return e=a(e,t,!1,!0).id,hasProp(j,e)||hasProp(k,e)}}),t||(o.undef=function(e){d();var i=a(e,t,!0),n=getOwn(k,e);n.undefed=!0,r(e),delete j[e],delete P[i.url],delete M[e],eachReverse(O,function(t,i){t[0]===e&&O.splice(i,1)}),delete q.defQueueMap[e],n&&(n.events.defined&&(M[e]=n.events),p(e))}),o},enable:function(e){var t=getOwn(k,e.id);t&&s(e).enable()},completeLoad:function(e){var t,i,r,o=getOwn(y.shim,e)||{},a=o.exports;for(d();O.length;){if(i=O.shift(),null===i[0]){if(i[0]=e,t)break;t=!0}else i[0]===e&&(t=!0);h(i)}if(q.defQueueMap={},r=getOwn(k,e),!t&&!hasProp(j,e)&&r&&!r.inited){if(!(!y.enforceDefine||a&&getGlobal(a)))return n(e)?void 0:c(makeError("nodefine","No define call for "+e,null,[e]));h([e,o.deps||[],o.exportsFn])}l()},nameToUrl:function(e,t,i){var r,n,o,a,s,u,c,d=getOwn(y.pkgs,e);if(d&&(e=d),c=getOwn(R,e))return q.nameToUrl(c,t,i);if(req.jsExtRegExp.test(e))s=e+(t||"");else{for(r=y.paths,n=e.split("/"),o=n.length;o>0;o-=1)if(a=n.slice(0,o).join("/"),u=getOwn(r,a)){isArray(u)&&(u=u[0]),n.splice(0,o,u);break}s=n.join("/"),s+=t||(/^data\:|\?/.test(s)||i?"":".js"),s=("/"===s.charAt(0)||s.match(/^[\w\+\.\-]+:/)?"":y.baseUrl)+s}return y.urlArgs?s+((-1===s.indexOf("?")?"?":"&")+y.urlArgs):s},load:function(e,t){req.load(q,e,t)},execCb:function(e,t,i,r){return t.apply(r,i)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=g(e);q.completeLoad(t.id)}},onScriptError:function(e){var t=g(e);return n(t.id)?void 0:c(makeError("scripterror","Script error for: "+t.id,e,[t.id]))}},q.require=q.makeRequire(),q}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState?interactiveScript:(eachReverse(scripts(),function(e){return"interactive"===e.readyState?interactiveScript=e:void 0}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.1.20",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if("undefined"==typeof define){if("undefined"!=typeof requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}"undefined"==typeof require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,i,r){var n,o,a=defContextName;return isArray(e)||"string"==typeof e||(o=e,isArray(t)?(e=t,t=i,i=r):e=[]),o&&o.context&&(a=o.context),n=getOwn(contexts,a),n||(n=contexts[a]=req.s.newContext(a)),o&&n.configure(o),n.require(e,t,i)},req.config=function(e){return req(e)},req.nextTick="undefined"!=typeof setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,i){var r=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return r.type=e.scriptType||"text/javascript",r.charset="utf-8",r.async=!0,r},req.load=function(e,t,i){var r,n=e&&e.config||{};if(isBrowser)return r=req.createNode(n,t,i),n.onNodeCreated&&n.onNodeCreated(r,n,t,i),r.setAttribute("data-requirecontext",e.contextName),r.setAttribute("data-requiremodule",t),!r.attachEvent||r.attachEvent.toString&&r.attachEvent.toString().indexOf("[native code")<0||isOpera?(r.addEventListener("load",e.onScriptLoad,!1),r.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,r.attachEvent("onreadystatechange",e.onScriptLoad)),r.src=i,currentlyAddingScript=r,baseElement?head.insertBefore(r,baseElement):head.appendChild(r),currentlyAddingScript=null,r;if(isWebWorker)try{importScripts(i),e.completeLoad(t)}catch(o){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+i,o,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){return head||(head=e.parentNode),dataMain=e.getAttribute("data-main"),dataMain?(mainScript=dataMain,cfg.baseUrl||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0):void 0}),define=function(e,t,i){var r,n;"string"!=typeof e&&(i=t,t=e,e=null),isArray(t)||(i=t,t=null),!t&&isFunction(i)&&(t=[],i.length&&(i.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(e,i){t.push(i)}),t=(1===i.length?["require"]:["require","exports","module"]).concat(t))),useInteractive&&(r=currentlyAddingScript||getInteractiveScript(),r&&(e||(e=r.getAttribute("data-requiremodule")),n=contexts[r.getAttribute("data-requirecontext")])),n?(n.defQueue.push([e,t,i]),n.defQueueMap[e]=!0):globalDefQueue.push([e,t,i])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this); \ No newline at end of file diff --git a/Workers/combineGeometry.js b/Workers/combineGeometry.js index 883cafc..5098ae3 100644 --- a/Workers/combineGeometry.js +++ b/Workers/combineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +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";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};r.EPSILON1=.1,r.EPSILON2=.01,r.EPSILON3=.001,r.EPSILON4=1e-4,r.EPSILON5=1e-5,r.EPSILON6=1e-6,r.EPSILON7=1e-7,r.EPSILON8=1e-8,r.EPSILON9=1e-9,r.EPSILON10=1e-10,r.EPSILON11=1e-11,r.EPSILON12=1e-12,r.EPSILON13=1e-13,r.EPSILON14=1e-14,r.EPSILON15=1e-15,r.EPSILON16=1e-16,r.EPSILON17=1e-17,r.EPSILON18=1e-18,r.EPSILON19=1e-19,r.EPSILON20=1e-20,r.GRAVITATIONALPARAMETER=3986004418e5,r.SOLAR_RADIUS=6955e5,r.LUNAR_RADIUS=1737400,r.SIXTY_FOUR_KILOBYTES=65536,r.sign=function(e){return e>0?1:0>e?-1:0},r.signNotZero=function(e){return 0>e?-1:1},r.toSNorm=function(e){return Math.round(255*(.5*r.clamp(e,-1,1)+.5))},r.fromSNorm=function(e){return 2*(r.clamp(e,0,255)/255)-1},r.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},r.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},r.lerp=function(e,t,r){return(1-r)*e+r*t},r.PI=Math.PI,r.ONE_OVER_PI=1/Math.PI,r.PI_OVER_TWO=.5*Math.PI,r.PI_OVER_THREE=Math.PI/3,r.PI_OVER_FOUR=Math.PI/4,r.PI_OVER_SIX=Math.PI/6,r.THREE_PI_OVER_TWO=.5*3*Math.PI,r.TWO_PI=2*Math.PI,r.ONE_OVER_TWO_PI=1/(2*Math.PI),r.RADIANS_PER_DEGREE=Math.PI/180,r.DEGREES_PER_RADIAN=180/Math.PI,r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600,r.toRadians=function(e){return e*r.RADIANS_PER_DEGREE},r.toDegrees=function(e){return e*r.DEGREES_PER_RADIAN},r.convertLongitudeRange=function(e){var t=r.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},r.negativePiToPi=function(e){for(var t=r.EPSILON10,n=r.PI,o=r.TWO_PI;-(n+t)>e;)e+=o;if(-n>e)return-n;for(;e>n+t;)e-=o;return e>n?n:e},r.zeroToTwoPi=function(e){var t=e%r.TWO_PI;return 0>t?(t+r.TWO_PI)%r.TWO_PI:t},r.equalsEpsilon=function(e,r,n){return n=t(n,0),Math.abs(e-r)<=n};var n=[1];r.factorial=function(e){var t=n.length;if(e>=t)for(var r=n[t-1],o=t;e>=o;o++)n.push(r*o);return n[e]},r.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},r.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},r.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},r.clamp=function(e,t,r){return t>e?t:e>r?r:e};var o=new e;return r.setRandomNumberSeed=function(t){o=new e(t)},r.nextRandomNumber=function(){return o.random()},r.acosClamped=function(e){return Math.acos(r.clamp(e,-1,1))},r.asinClamped=function(e){return Math.asin(r.clamp(e,-1,1))},r}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";var a=function(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)};a.fromSpherical=function(r,n){t(n)||(n=new a);var o=r.clock,i=r.cone,u=e(r.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(o),n.y=s*Math.sin(o),n.z=u*Math.cos(i),n},a.fromElements=function(e,r,n,o){return t(o)?(o.x=e,o.y=r,o.z=n,o):new a(e,r,n)},a.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new a(e.x,e.y,e.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z},a.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new a),o.x=r[n++],o.y=r[n++],o.z=r[n],o},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},a.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},a.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var i=new a;a.distance=function(e,t){return a.subtract(e,t,i),a.magnitude(i)},a.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var u=new a;a.lerp=function(e,t,r,n){return a.multiplyByScalar(t,r,u),n=a.multiplyByScalar(e,1-r,n),a.add(u,n,n)};var s=new a,c=new a;a.angleBetween=function(e,t){a.normalize(e,s),a.normalize(t,c);var r=a.dot(s,c),n=a.magnitude(a.cross(s,c,s));return Math.atan2(n,r)};var l=new a;a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,l);return a.abs(r,r),t=r.x<=r.y?r.x<=r.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):r.y<=r.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,t)},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z},a.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n},a.cross=function(e,t,r){var n=e.x,o=e.y,a=e.z,i=t.x,u=t.y,s=t.z,c=o*s-a*u,l=a*i-n*s,f=n*u-o*i;return r.x=c,r.y=l,r.z=f,r},a.fromDegrees=function(e,t,r,n,i){var u=o.toRadians(e),s=o.toRadians(t);return a.fromRadians(u,s,r,n,i)};var f=new a,m=new a,h=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(r,n,o,i,u){o=e(o,0);var s=t(i)?i.radiiSquared:h,c=Math.cos(n);f.x=c*Math.cos(r),f.y=c*Math.sin(r),f.z=Math.sin(n),f=a.normalize(f,f),a.multiplyComponents(s,f,m);var l=Math.sqrt(a.dot(f,m));return m=a.divideByScalar(m,l,m),f=a.multiplyByScalar(f,o,f),t(u)||(u=new a),a.add(m,f,u)},a.fromDegreesArray=function(e,t,r){for(var n=new Array(e.length),i=0;i<e.length;i++)n[i]=o.toRadians(e[i]);return a.fromRadiansArray(n,t,r)},a.fromRadiansArray=function(e,r,n){var o=e.length;t(n)?n.length=o/2:n=new Array(o/2);for(var i=0;o>i;i+=2){var u=e[i],s=e[i+1];n[i/2]=a.fromRadians(u,s,0,r,n[i/2])}return n},a.fromDegreesArrayHeights=function(e,t,r){for(var n=new Array(e.length),i=0;i<e.length;i+=3)n[i]=o.toRadians(e[i]),n[i+1]=o.toRadians(e[i+1]),n[i+2]=e[i+2];return a.fromRadiansArrayHeights(n,t,r)},a.fromRadiansArrayHeights=function(e,r,n){var o=e.length;t(n)?n.length=o/3:n=new Array(o/3);for(var i=0;o>i;i+=3){var u=e[i],s=e[i+1],c=e[i+2];n[i/3]=a.fromRadians(u,s,c,r,n[i/3])}return n},a.ZERO=n(new a(0,0,0)),a.UNIT_X=n(new a(1,0,0)),a.UNIT_Y=n(new a(0,1,0)),a.UNIT_Z=n(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";var a=function(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)};return a.fromRadians=function(r,n,o,i){return o=e(o,0),t(i)?(i.longitude=r,i.latitude=n,i.height=o,i):new a(r,n,o)},a.fromDegrees=function(e,t,r,n){return e=o.toRadians(e),t=o.toRadians(t),a.fromRadians(e,t,r,n)},a.clone=function(e,r){return t(e)?t(r)?(r.longitude=e.longitude,r.latitude=e.latitude,r.height=e.height,r):new a(e.longitude,e.latitude,e.height):void 0},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.longitude===r.longitude&&e.latitude===r.latitude&&e.height===r.height},a.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.longitude-r.longitude)<=n&&Math.abs(e.latitude-r.latitude)<=n&&Math.abs(e.height-r.height)<=n},a.ZERO=n(new a(0,0,0)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o,a,i,u){"use strict";function s(t,n,o,a){n=r(n,0),o=r(o,0),a=r(a,0),t._radii=new e(n,o,a),t._radiiSquared=new e(n*n,o*o,a*a),t._radiiToTheFourth=new e(n*n*n*n,o*o*o*o,a*a*a*a),t._oneOverRadii=new e(0===n?0:1/n,0===o?0:1/o,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===o?0:1/(o*o),0===a?0:1/(a*a)),t._minimumRadius=Math.min(n,o,a),t._maximumRadius=Math.max(n,o,a),t._centerToleranceSquared=u.EPSILON1}var c=function(e,t,r){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,s(this,e,t,r)};o(c.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),c.clone=function(t,r){if(!n(t))return void 0;var o=t._radii;return n(r)?(e.clone(o,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new c(o.x,o.y,o.z)},c.fromCartesian3=function(e,t){return n(t)||(t=new c),n(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=i(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=i(new c(1,1,1)),c.MOON=i(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,r){var o=t.longitude,a=t.latitude,i=Math.cos(a),u=i*Math.cos(o),s=i*Math.sin(o),c=Math.sin(a);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},c.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var l=new e,f=new e;c.prototype.cartographicToCartesian=function(t,r){var o=l,a=f;this.geodeticSurfaceNormalCartographic(t,o),e.multiplyComponents(this._radiiSquared,o,a);var i=Math.sqrt(e.dot(o,a));return e.divideByScalar(a,i,a),e.multiplyByScalar(o,t.height,o),n(r)||(r=new e),e.add(a,o,r)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var o=0;r>o;o++)t[o]=this.cartographicToCartesian(e[o],t[o]);return t};var m=new e,h=new e,d=new e;c.prototype.cartesianToCartographic=function(r,o){var a=this.scaleToGeodeticSurface(r,h);if(!n(a))return void 0;var i=this.geodeticSurfaceNormal(a,m),s=e.subtract(r,a,d),c=Math.atan2(i.y,i.x),l=Math.asin(i.z),f=u.sign(e.dot(s,r))*e.magnitude(s);return n(o)?(o.longitude=c,o.latitude=l,o.height=f,o):new t(c,l,f)},c.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var o=0;r>o;++o)t[o]=this.cartesianToCartographic(e[o],t[o]);return t};var p=new e,y=new e;return c.prototype.scaleToGeodeticSurface=function(t,r){var o=t.x,a=t.y,i=t.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,m=o*o*c*c,h=a*a*l*l,d=i*i*f*f,v=m+h+d,g=Math.sqrt(1/v),E=e.multiplyByScalar(t,g,p);if(v<this._centerToleranceSquared)return isFinite(g)?e.clone(E,r):void 0;var S=this._oneOverRadiiSquared,C=S.x,w=S.y,A=S.z,x=y;x.x=2*E.x*C,x.y=2*E.y*w,x.z=2*E.z*A;var b,T,M,R,O,I,N,L,z,P,D,F=(1-g)*e.magnitude(t)/(.5*e.magnitude(x)),_=0;do{F-=_,M=1/(1+F*C),R=1/(1+F*w),O=1/(1+F*A),I=M*M,N=R*R,L=O*O,z=I*M,P=N*R,D=L*O,b=m*I+h*N+d*L-1,T=m*z*C+h*P*w+d*D*A;var B=-2*T;_=b/B}while(Math.abs(b)>u.EPSILON12);return n(r)?(r.x=o*M,r.y=a*R,r.z=i*O,r):new e(o*M,a*R,i*O)},c.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var o=t.x,a=t.y,i=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(o*o*u.x+a*a*u.y+i*i*u.z);return e.multiplyByScalar(t,s,r)},c.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},c.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},c.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,o,a,i){"use strict";var u=function(e){this._ellipsoid=r(e,i.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return o(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var o=this._semimajorAxis,a=t.longitude*o,i=t.latitude*o,u=t.height;return n(r)?(r.x=a,r.y=i,r.z=u,r):new e(a,i,u)},u.prototype.unproject=function(e,r){var o=this._oneOverSemimajorAxis,a=e.x*o,i=e.y*o,u=e.z;return n(r)?(r.longitude=a,r.latitude=i,r.height=u,r):new t(a,i,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";var t=function(t,r){this.start=e(t,0),this.stop=e(r,0)};return t}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";var o=function(t,r,n,o){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(o,0)};o.fromElements=function(e,r,n,a,i){return t(i)?(i.x=e,i.y=r,i.z=n,i.w=a,i):new o(e,r,n,a)},o.fromColor=function(e,r){return t(r)?(r.x=e.red,r.y=e.green,r.z=e.blue,r.w=e.alpha,r):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r):new o(e.x,e.y,e.z,e.w):void 0},o.packedLength=4,o.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w},o.unpack=function(r,n,a){return n=e(n,0),t(a)||(a=new o),a.x=r[n++],a.y=r[n++],a.z=r[n++],a.w=r[n],a},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,t){return o.subtract(e,t,a),o.magnitude(a)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var i=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,i),n=o.multiplyByScalar(e,1-r,n),o.add(i,n,n)};var u=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,u);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):r.y<=r.z?r.y<=r.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z&&e.w===r.w},o.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n&&Math.abs(e.w-r.w)<=n},o.ZERO=n(new o(0,0,0,0)),o.UNIT_X=n(new o(1,0,0,0)),o.UNIT_Y=n(new o(0,1,0,0)),o.UNIT_Z=n(new o(0,0,1,0)),o.UNIT_W=n(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o,a){"use strict";function i(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function u(e){for(var t=0,r=0;3>r;++r){var n=e[c.getElementIndex(h[r],m[r])];t+=2*n*n}return Math.sqrt(t)}function s(e,t){for(var r=a.EPSILON15,n=0,o=1,i=0;3>i;++i){var u=Math.abs(e[c.getElementIndex(h[i],m[i])]);u>n&&(o=i,n=u)}var s=1,l=0,f=m[o],d=h[o];if(Math.abs(e[c.getElementIndex(d,f)])>r){var p,y=e[c.getElementIndex(d,d)],v=e[c.getElementIndex(f,f)],g=e[c.getElementIndex(d,f)],E=(y-v)/2/g;p=0>E?-1/(-E+Math.sqrt(1+E*E)):1/(E+Math.sqrt(1+E*E)),s=1/Math.sqrt(1+p*p),l=p*s}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(f,f)]=t[c.getElementIndex(d,d)]=s,t[c.getElementIndex(d,f)]=l,t[c.getElementIndex(f,d)]=-l,t}var c=function(e,r,n,o,a,i,u,s,c){this[0]=t(e,0),this[1]=t(o,0),this[2]=t(u,0),this[3]=t(r,0),this[4]=t(a,0),this[5]=t(s,0),this[6]=t(n,0),this[7]=t(i,0),this[8]=t(c,0)};c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,n,o){return n=t(n,0),r(o)||(o=new c),o[0]=e[n],o[1]=e[n+1],o[2]=e[n+2],o[3]=e[n+3],o[4]=e[n+4],o[5]=e[n+5],o[6]=e[n+6],o[7]=e[n+7],o[8]=e[n+8],o},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var n=e.x*e.x,o=e.x*e.y,a=e.x*e.z,i=e.x*e.w,u=e.y*e.y,s=e.y*e.z,l=e.y*e.w,f=e.z*e.z,m=e.z*e.w,h=e.w*e.w,d=n-u-f+h,p=2*(o-m),y=2*(a+l),v=2*(o+m),g=-n+u-f+h,E=2*(s-i),S=2*(a-l),C=2*(s+i),w=-n-u+f+h;return r(t)?(t[0]=d,t[1]=v,t[2]=S,t[3]=p,t[4]=g,t[5]=C,t[6]=y,t[7]=E,t[8]=w,t):new c(d,p,y,v,g,E,S,C,w)},c.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new c(e.x,0,0,0,e.y,0,0,0,e.z)},c.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new c(e,0,0,0,e,0,0,0,e)},c.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.fromRotationX=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=o,t[6]=0,t[7]=-o,t[8]=n,t):new c(1,0,0,0,n,-o,0,o,n)},c.fromRotationY=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-o,t[3]=0,t[4]=1,t[5]=0,t[6]=o,t[7]=0,t[8]=n,t):new c(n,0,o,0,1,0,-o,0,n)},c.fromRotationZ=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=n,t[1]=o,t[2]=0,t[3]=-o,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new c(n,-o,0,o,n,0,0,0,1)},c.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},c.getElementIndex=function(e,t){return 3*e+t},c.getColumn=function(e,t,r){var n=3*t,o=e[n],a=e[n+1],i=e[n+2];return r.x=o,r.y=a,r.z=i,r},c.setColumn=function(e,t,r,n){n=c.clone(e,n);var o=3*t;return n[o]=r.x,n[o+1]=r.y,n[o+2]=r.z,n},c.getRow=function(e,t,r){var n=e[t],o=e[t+3],a=e[t+6];return r.x=n,r.y=o,r.z=a,r},c.setRow=function(e,t,r,n){return n=c.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var l=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),r};var f=new e;c.getMaximumScale=function(t){return c.getScale(t,f),e.maximumComponent(f)},c.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],i=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=o,r[2]=a,r[3]=i,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=f,r},c.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},c.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},c.multiplyByVector=function(e,t,r){var n=t.x,o=t.y,a=t.z,i=e[0]*n+e[3]*o+e[6]*a,u=e[1]*n+e[4]*o+e[7]*a,s=e[2]*n+e[5]*o+e[8]*a;return r.x=i,r.y=u,r.z=s,r},c.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},c.transpose=function(e,t){var r=e[0],n=e[3],o=e[6],a=e[1],i=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=o,t[3]=a,t[4]=i,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var m=[1,0,0],h=[2,2,1],d=new c,p=new c;return c.computeEigenDecomposition=function(e,t){var n=a.EPSILON20,o=10,l=0,f=0;r(t)||(t={});for(var m=t.unitary=c.clone(c.IDENTITY,t.unitary),h=t.diagonal=c.clone(e,t.diagonal),y=n*i(h);o>f&&u(h)>y;)s(h,d),c.transpose(d,p),c.multiply(h,d,h),c.multiply(p,h,h),c.multiply(m,d,m),++l>2&&(++f,l=0);return t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},c.determinant=function(e){var t=e[0],r=e[3],n=e[6],o=e[1],a=e[4],i=e[7],u=e[2],s=e[5],c=e[8];return t*(a*c-s*i)+o*(s*n-r*c)+u*(r*i-a*n)},c.inverse=function(e,t){var r=e[0],o=e[1],i=e[2],u=e[3],s=e[4],l=e[5],f=e[6],m=e[7],h=e[8],d=c.determinant(e);if(Math.abs(d)<=a.EPSILON15)throw new n("matrix is not invertible");t[0]=s*h-m*l,t[1]=m*i-o*h,t[2]=o*l-s*i,t[3]=f*l-u*h,t[4]=r*h-f*i,t[5]=u*i-r*l,t[6]=u*m-f*s,t[7]=f*o-r*m,t[8]=r*s-u*o;var p=1/d;return c.multiplyByScalar(t,p,t)},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},c.IDENTITY=o(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,o,a,i,u,s){"use strict";var c=function(e,t,n,o,a,i,u,s,c,l,f,m,h,d,p,y){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),this[5]=r(i,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(p,0),this[12]=r(o,0),this[13]=r(s,0),this[14]=r(m,0),this[15]=r(y,0)};c.packedLength=16,c.pack=function(e,t,n){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]},c.unpack=function(e,t,o){return t=r(t,0),n(o)||(o=new c),o[0]=e[t++],o[1]=e[t++],o[2]=e[t++],o[3]=e[t++],o[4]=e[t++],o[5]=e[t++],o[6]=e[t++],o[7]=e[t++],o[8]=e[t++],o[9]=e[t++],o[10]=e[t++],o[11]=e[t++],o[12]=e[t++],o[13]=e[t++],o[14]=e[t++],o[15]=e[t],o},c.clone=function(e,t){return n(e)?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 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]):void 0},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 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,o,a){return o=r(o,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]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a):new c(t[0],t[3],t[6],o.x,t[1],t[4],t[7],o.y,t[2],t[5],t[8],o.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,r,o){n(o)||(o=new c);var a=r.x,i=r.y,u=r.z,s=t.x*t.x,l=t.x*t.y,f=t.x*t.z,m=t.x*t.w,h=t.y*t.y,d=t.y*t.z,p=t.y*t.w,y=t.z*t.z,v=t.z*t.w,g=t.w*t.w,E=s-h-y+g,S=2*(l-v),C=2*(f+p),w=2*(l+v),A=-s+h-y+g,x=2*(d-m),b=2*(f-p),T=2*(d+m),M=-s-h+y+g;return o[0]=E*a,o[1]=w*a,o[2]=b*a,o[3]=0,o[4]=S*i,o[5]=A*i,o[6]=T*i,o[7]=0,o[8]=C*u,o[9]=x*u,o[10]=M*u,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.IDENTITY,e,t)},c.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 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 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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,f=new e,m=new e;c.fromCamera=function(t,r){var o=t.eye,a=t.target,i=t.up;e.normalize(e.subtract(a,o,l),l),e.normalize(e.cross(l,i,f),f),e.normalize(e.cross(f,l,m),m);var u=f.x,s=f.y,h=f.z,d=l.x,p=l.y,y=l.z,v=m.x,g=m.y,E=m.z,S=o.x,C=o.y,w=o.z,A=u*-S+s*-C+h*-w,x=v*-S+g*-C+E*-w,b=d*S+p*C+y*w;return n(r)?(r[0]=u,r[1]=v,r[2]=-d,r[3]=0,r[4]=s,r[5]=g,r[6]=-p,r[7]=0,r[8]=h,r[9]=E,r[10]=-y,r[11]=0,r[12]=A,r[13]=x,r[14]=b,r[15]=1,r):new c(u,s,h,A,v,g,E,x,-d,-p,-y,b,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,r,n,o){var a=Math.tan(.5*e),i=1/a,u=i/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=i,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=-1,o[12]=0,o[13]=0,o[14]=c,o[15]=0,o},c.computeOrthographicOffCenter=function(e,t,r,n,o,a,i){var u=1/(t-e),s=1/(n-r),c=1/(a-o),l=-(t+e)*u,f=-(n+r)*s,m=-(a+o)*c;return u*=2,s*=2,c*=-2,i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=c,i[11]=0,i[12]=l,i[13]=f,i[14]=m,i[15]=1,i},c.computePerspectiveOffCenter=function(e,t,r,n,o,a,i){var u=2*o/(t-e),s=2*o/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),f=-(a+o)/(a-o),m=-1,h=-2*a*o/(a-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=c,i[9]=l,i[10]=f,i[11]=m,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},c.computeInfinitePerspectiveOffCenter=function(e,t,r,n,o,a){var i=2*o/(t-e),u=2*o/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,f=-1,m=-2*o;return a[0]=i,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=s,a[9]=c,a[10]=l,a[11]=f,a[12]=0,a[13]=0,a[14]=m,a[15]=0,a},c.computeViewportTransformation=function(e,t,n,o){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),i=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),m=c,h=l,d=f,p=a+c,y=i+l,v=t+f,g=1;return o[0]=m,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=d,o[11]=0,o[12]=p,o[13]=y,o[14]=v,o[15]=g,o},c.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]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,r){var n=4*t,o=e[n],a=e[n+1],i=e[n+2],u=e[n+3];return r.x=o,r.y=a,r.z=i,r.w=u,r},c.setColumn=function(e,t,r,n){n=c.clone(e,n);var o=4*t;return n[o]=r.x,n[o+1]=r.y,n[o+2]=r.z,n[o+3]=r.w,n},c.getRow=function(e,t,r){var n=e[t],o=e[t+4],a=e[t+8],i=e[t+12];return r.x=n,r.y=o,r.z=a,r.w=i,r},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 h=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],h)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],h)),r};var d=new e;c.getMaximumScale=function(t){return c.getScale(t,d),e.maximumComponent(d)},c.multiply=function(e,t,r){var n=e[0],o=e[1],a=e[2],i=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],m=e[9],h=e[10],d=e[11],p=e[12],y=e[13],v=e[14],g=e[15],E=t[0],S=t[1],C=t[2],w=t[3],A=t[4],x=t[5],b=t[6],T=t[7],M=t[8],R=t[9],O=t[10],I=t[11],N=t[12],L=t[13],z=t[14],P=t[15],D=n*E+u*S+f*C+p*w,F=o*E+s*S+m*C+y*w,_=a*E+c*S+h*C+v*w,B=i*E+l*S+d*C+g*w,U=n*A+u*x+f*b+p*T,G=o*A+s*x+m*b+y*T,q=a*A+c*x+h*b+v*T,k=i*A+l*x+d*b+g*T,W=n*M+u*R+f*O+p*I,V=o*M+s*R+m*O+y*I,Y=a*M+c*R+h*O+v*I,H=i*M+l*R+d*O+g*I,j=n*N+u*L+f*z+p*P,K=o*N+s*L+m*z+y*P,Z=a*N+c*L+h*z+v*P,X=i*N+l*L+d*z+g*P;return r[0]=D,r[1]=F,r[2]=_,r[3]=B,r[4]=U,r[5]=G,r[6]=q,r[7]=k,r[8]=W,r[9]=V,r[10]=Y,r[11]=H,r[12]=j,r[13]=K,r[14]=Z,r[15]=X,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],o=e[1],a=e[2],i=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],m=e[12],h=e[13],d=e[14],p=t[0],y=t[1],v=t[2],g=t[4],E=t[5],S=t[6],C=t[8],w=t[9],A=t[10],x=t[12],b=t[13],T=t[14],M=n*p+i*y+c*v,R=o*p+u*y+l*v,O=a*p+s*y+f*v,I=n*g+i*E+c*S,N=o*g+u*E+l*S,L=a*g+s*E+f*S,z=n*C+i*w+c*A,P=o*C+u*w+l*A,D=a*C+s*w+f*A,F=n*x+i*b+c*T+m,_=o*x+u*b+l*T+h,B=a*x+s*b+f*T+d;return r[0]=M,r[1]=R,r[2]=O,r[3]=0,r[4]=I,r[5]=N,r[6]=L,r[7]=0,r[8]=z,r[9]=P,r[10]=D,r[11]=0,r[12]=F,r[13]=_,r[14]=B,r[15]=1,r},c.multiplyByTranslation=function(e,t,r){var n=t.x,o=t.y,a=t.z,i=n*e[0]+o*e[4]+a*e[8]+e[12],u=n*e[1]+o*e[5]+a*e[9]+e[13],s=n*e[2]+o*e[6]+a*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=i,r[13]=u,r[14]=s,r[15]=e[15],r};var p=new e;c.multiplyByUniformScale=function(e,t,r){return p.x=t,p.y=t,p.z=t,c.multiplyByScale(e,p,r)},c.multiplyByScale=function(e,t,r){var n=t.x,o=t.y,a=t.z;return 1===n&&1===o&&1===a?c.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=o*e[4],r[5]=o*e[5],r[6]=o*e[6],r[7]=0,r[8]=a*e[8],r[9]=a*e[9],r[10]=a*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},c.multiplyByVector=function(e,t,r){var n=t.x,o=t.y,a=t.z,i=t.w,u=e[0]*n+e[4]*o+e[8]*a+e[12]*i,s=e[1]*n+e[5]*o+e[9]*a+e[13]*i,c=e[2]*n+e[6]*o+e[10]*a+e[14]*i,l=e[3]*n+e[7]*o+e[11]*a+e[15]*i;return r.x=u,r.y=s,r.z=c,r.w=l,r},c.multiplyByPointAsVector=function(e,t,r){var n=t.x,o=t.y,a=t.z,i=e[0]*n+e[4]*o+e[8]*a,u=e[1]*n+e[5]*o+e[9]*a,s=e[2]*n+e[6]*o+e[10]*a;return r.x=i,r.y=u,r.z=s,r},c.multiplyByPoint=function(e,t,r){var n=t.x,o=t.y,a=t.z,i=e[0]*n+e[4]*o+e[8]*a+e[12],u=e[1]*n+e[5]*o+e[9]*a+e[13],s=e[2]*n+e[6]*o+e[10]*a+e[14];return r.x=i,r.y=u,r.z=s,r},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],o=e[3],a=e[6],i=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=i,t[14]=u,t[15]=e[15],t},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||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]&&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]},c.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},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 y=new u,v=new u,g=new t,E=new t(0,0,0,1);return c.inverse=function(e,r){if(u.equalsEpsilon(c.getRotation(e,y),v,i.EPSILON7)&&t.equals(c.getRow(e,3,g),E))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],o=e[4],a=e[8],l=e[12],f=e[1],m=e[5],h=e[9],d=e[13],p=e[2],S=e[6],C=e[10],w=e[14],A=e[3],x=e[7],b=e[11],T=e[15],M=C*T,R=w*b,O=S*T,I=w*x,N=S*b,L=C*x,z=p*T,P=w*A,D=p*b,F=C*A,_=p*x,B=S*A,U=M*m+I*h+N*d-(R*m+O*h+L*d),G=R*f+z*h+F*d-(M*f+P*h+D*d),q=O*f+P*m+_*d-(I*f+z*m+B*d),k=L*f+D*m+B*h-(N*f+F*m+_*h),W=R*o+O*a+L*l-(M*o+I*a+N*l),V=M*n+P*a+D*l-(R*n+z*a+F*l),Y=I*n+z*o+B*l-(O*n+P*o+_*l),H=N*n+F*o+_*a-(L*n+D*o+B*a);M=a*d,R=l*h,O=o*d,I=l*m,N=o*h,L=a*m,z=n*d,P=l*f,D=n*h,F=a*f,_=n*m,B=o*f;var j=M*x+I*b+N*T-(R*x+O*b+L*T),K=R*A+z*b+F*T-(M*A+P*b+D*T),Z=O*A+P*x+_*T-(I*A+z*x+B*T),X=L*A+D*x+B*b-(N*A+F*x+_*b),Q=O*C+L*w+R*S-(N*w+M*S+I*C),J=D*w+M*p+P*C-(z*C+F*w+R*p),$=z*S+B*w+I*p-(_*w+O*p+P*S),et=_*C+N*p+F*S-(D*S+B*C+L*p),tt=n*U+o*G+a*q+l*k;if(Math.abs(tt)<i.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return tt=1/tt,r[0]=U*tt,r[1]=G*tt,r[2]=q*tt,r[3]=k*tt,r[4]=W*tt,r[5]=V*tt,r[6]=Y*tt,r[7]=H*tt,r[8]=j*tt,r[9]=K*tt,r[10]=Z*tt,r[11]=X*tt,r[12]=Q*tt,r[13]=J*tt,r[14]=$*tt,r[15]=et*tt,r},c.inverseTransformation=function(e,t){var r=e[0],n=e[1],o=e[2],a=e[4],i=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],m=e[13],h=e[14],d=-r*f-n*m-o*h,p=-a*f-i*m-u*h,y=-s*f-c*m-l*h;return t[0]=r,t[1]=a,t[2]=s,t[3]=0,t[4]=n,t[5]=i,t[6]=c,t[7]=0,t[8]=o,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=p,t[14]=y,t[15]=1,t},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,o,a,i){"use strict";var u=function(e,r,n,o){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(o,0)};u.fromDegrees=function(e,n,o,a,s){return e=i.toRadians(t(e,0)),n=i.toRadians(t(n,0)),o=i.toRadians(t(o,0)),a=i.toRadians(t(a,0)),r(s)?(s.west=e,s.south=n,s.east=o,s.north=a,s):new u(e,n,o,a)},u.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,i=-Number.MAX_VALUE,s=0,c=e.length;c>s;s++){var l=e[s];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),a=Math.min(a,l.latitude),i=Math.max(i,l.latitude)}return r(t)?(t.west=n,t.south=a,t.east=o,t.north=i,t):new u(n,a,o,i)},u.packedLength=4,u.pack=function(e,r,n){n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north},u.unpack=function(e,n,o){return n=t(n,0),r(o)||(o=new u),o.west=e[n++],o.south=e[n++],o.east=e[n++],o.north=e[n],o},u.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},u.validate=function(){},u.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},u.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},u.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},u.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},u.center=function(t,n){var o=t.east,a=t.west,u=.5*(a+o);return a>o&&(u=i.negativePiToPi(u+i.PI)),r(n)?(n.longitude=u,n.latitude=.5*(t.south+t.north),n.height=0,n):new e(u,.5*(t.south+t.north))},u.intersectWith=function(e,t,n){var o=Math.max(e.west,t.west),a=Math.max(e.south,t.south),i=Math.min(e.east,t.east),s=Math.min(e.north,t.north);return r(n)?(n.west=o,n.south=a,n.east=i,n.north=s,n):new u(o,a,i,s)},u.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},u.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var s=new e;return u.subsample=function(e,n,a,u){n=t(n,o.WGS84),a=t(a,0),r(u)||(u=[]);var c=0,l=e.north,f=e.south,m=e.east,h=e.west,d=s;d.height=a,d.longitude=h,d.latitude=l,u[c]=n.cartographicToCartesian(d,u[c]),c++,d.longitude=m,u[c]=n.cartographicToCartesian(d,u[c]),c++,d.latitude=f,u[c]=n.cartographicToCartesian(d,u[c]),c++,d.longitude=h,u[c]=n.cartographicToCartesian(d,u[c]),c++,d.latitude=0>l?l:f>0?f:0;for(var p=1;8>p;++p){var y=-Math.PI+p*i.PI_OVER_TWO;y>h&&m>y&&(d.longitude=y,u[c]=n.cartographicToCartesian(d,u[c]),c++)}return 0===d.latitude&&(d.longitude=h,u[c]=n.cartographicToCartesian(d,u[c]),c++,d.longitude=m,u[c]=n.cartographicToCartesian(d,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-i.PI_OVER_TWO,Math.PI,i.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,r,n,o,a,i,u,s,c,l){"use strict";var f=function(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)},m=new e,h=new e,d=new e,p=new e,y=new e,v=new e,g=new e,E=new e,S=new e,C=new e,w=new e,A=new e;f.fromPoints=function(t,r){if(n(r)||(r=new f),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var o=e.clone(t[0],g),a=e.clone(o,m),i=e.clone(o,h),u=e.clone(o,d),s=e.clone(o,p),c=e.clone(o,y),l=e.clone(o,v),x=t.length,b=1;x>b;b++){e.clone(t[b],o);var T=o.x,M=o.y,R=o.z;T<a.x&&e.clone(o,a),T>s.x&&e.clone(o,s),M<i.y&&e.clone(o,i),M>c.y&&e.clone(o,c),R<u.z&&e.clone(o,u),R>l.z&&e.clone(o,l)}var O=e.magnitudeSquared(e.subtract(s,a,E)),I=e.magnitudeSquared(e.subtract(c,i,E)),N=e.magnitudeSquared(e.subtract(l,u,E)),L=a,z=s,P=O;I>P&&(P=I,L=i,z=c),N>P&&(P=N,L=u,z=l);var D=S;D.x=.5*(L.x+z.x),D.y=.5*(L.y+z.y),D.z=.5*(L.z+z.z);var F=e.magnitudeSquared(e.subtract(z,D,E)),_=Math.sqrt(F),B=C;B.x=a.x,B.y=i.y,B.z=u.z;var U=w;U.x=s.x,U.y=c.y,U.z=l.z;var G=e.multiplyByScalar(e.add(B,U,E),.5,A),q=0;for(b=0;x>b;b++){e.clone(t[b],o);var k=e.magnitude(e.subtract(o,G,E));k>q&&(q=k);var W=e.magnitudeSquared(e.subtract(o,D,E));if(W>F){var V=Math.sqrt(W);_=.5*(_+V),F=_*_;var Y=V-_;D.x=(_*D.x+Y*o.x)/V,D.y=(_*D.y+Y*o.y)/V,D.z=(_*D.z+Y*o.z)/V}}return q>_?(e.clone(D,r.center),r.radius=_):(e.clone(G,r.center),r.radius=q),r};var x=new i,b=new e,T=new e,M=new t,R=new t;f.fromRectangle2D=function(e,t,r){return f.fromRectangleWithHeights2D(e,t,0,0,r)},f.fromRectangleWithHeights2D=function(t,o,a,i,u){if(n(u)||(u=new f),!n(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;o=r(o,x),l.southwest(t,M),M.height=a,l.northeast(t,R),R.height=i;var s=o.project(M,b),c=o.project(R,T),m=c.x-s.x,h=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(m*m+h*h+d*d);var p=u.center;return p.x=s.x+.5*m,p.y=s.y+.5*h,p.z=s.z+.5*d,u};var O=[];f.fromRectangle3D=function(e,t,o,i){t=r(t,a.WGS84),o=r(o,0);var u;return n(e)&&(u=l.subsample(e,t,o,O)),f.fromPoints(u,i)},f.fromVertices=function(t,o,a,i){if(n(i)||(i=new f),!n(t)||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;o=r(o,e.ZERO),a=r(a,3);var u=g;u.x=t[0]+o.x,u.y=t[1]+o.y,u.z=t[2]+o.z;for(var s=e.clone(u,m),c=e.clone(u,h),l=e.clone(u,d),x=e.clone(u,p),b=e.clone(u,y),T=e.clone(u,v),M=t.length,R=0;M>R;R+=a){var O=t[R]+o.x,I=t[R+1]+o.y,N=t[R+2]+o.z;u.x=O,u.y=I,u.z=N,O<s.x&&e.clone(u,s),O>x.x&&e.clone(u,x),I<c.y&&e.clone(u,c),I>b.y&&e.clone(u,b),N<l.z&&e.clone(u,l),N>T.z&&e.clone(u,T)}var L=e.magnitudeSquared(e.subtract(x,s,E)),z=e.magnitudeSquared(e.subtract(b,c,E)),P=e.magnitudeSquared(e.subtract(T,l,E)),D=s,F=x,_=L;z>_&&(_=z,D=c,F=b),P>_&&(_=P,D=l,F=T);var B=S;B.x=.5*(D.x+F.x),B.y=.5*(D.y+F.y),B.z=.5*(D.z+F.z);var U=e.magnitudeSquared(e.subtract(F,B,E)),G=Math.sqrt(U),q=C;q.x=s.x,q.y=c.y,q.z=l.z;var k=w;k.x=x.x,k.y=b.y,k.z=T.z;var W=e.multiplyByScalar(e.add(q,k,E),.5,A),V=0;for(R=0;M>R;R+=a){u.x=t[R]+o.x,u.y=t[R+1]+o.y,u.z=t[R+2]+o.z;var Y=e.magnitude(e.subtract(u,W,E));Y>V&&(V=Y);var H=e.magnitudeSquared(e.subtract(u,B,E));if(H>U){var j=Math.sqrt(H);G=.5*(G+j),U=G*G;var K=j-G;B.x=(G*B.x+K*u.x)/j,B.y=(G*B.y+K*u.y)/j,B.z=(G*B.z+K*u.z)/j}}return V>G?(e.clone(B,i.center),i.radius=G):(e.clone(W,i.center),i.radius=V),i},f.fromCornerPoints=function(t,r,o){n(o)||(o=new f);var a=o.center;return e.add(t,r,a),e.multiplyByScalar(a,.5,a),o.radius=e.distance(a,r),o},f.fromEllipsoid=function(t,r){return n(r)||(r=new f),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r},f.clone=function(t,r){return n(t)?n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius):void 0},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var o=e.center;t[n++]=o.x,t[n++]=o.y,t[n++]=o.z,t[n]=e.radius},f.unpack=function(e,t,o){t=r(t,0),n(o)||(o=new f);var a=o.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],o.radius=e[t],o};var I=new e,N=new e;f.union=function(t,r,o){n(o)||(o=new f);var a=t.center,i=r.center;e.add(a,i,N);var u=e.multiplyByScalar(N,.5,N),s=e.magnitude(e.subtract(a,u,I))+t.radius,c=e.magnitude(e.subtract(i,u,I))+r.radius;return o.radius=Math.max(s,c),e.clone(u,o.center),o};var L=new e;f.expand=function(t,r,n){n=f.clone(t,n);var o=e.magnitude(e.subtract(r,n.center,L));return o>n.radius&&(n.radius=o),n},f.intersect=function(t,r){var n=t.center,o=t.radius,a=e.dot(r,n)+r.w;return-o>a?u.OUTSIDE:o>a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=c.getMaximumScale(t)*e.radius,r};var z=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,z);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var P=new e;f.computePlaneDistances=function(t,r,o,a){n(a)||(a=new s);var i=e.subtract(t.center,r,P),u=e.multiplyByScalar(o,e.dot(o,i),P),c=e.magnitude(u);return a.start=c-t.radius,a.stop=c+t.radius,a};for(var D=new e,F=new e,_=new e,B=new e,U=new e,G=new t,q=new Array(8),k=0;8>k;++k)q[k]=new e;var W=new i;return f.projectTo2D=function(t,n,o){n=r(n,W);var a=n.ellipsoid,i=t.center,u=t.radius,s=a.geodeticSurfaceNormal(i,D),c=e.cross(e.UNIT_Z,s,F);e.normalize(c,c);var l=e.cross(s,c,_);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var m=e.negate(l,U),h=e.negate(c,B),d=q,p=d[0];e.add(s,l,p),e.add(p,c,p),p=d[1],e.add(s,l,p),e.add(p,h,p),p=d[2],e.add(s,m,p),e.add(p,h,p),p=d[3],e.add(s,m,p),e.add(p,c,p),e.negate(s,s),p=d[4],e.add(s,l,p),e.add(p,c,p),p=d[5],e.add(s,l,p),e.add(p,h,p),p=d[6],e.add(s,m,p),e.add(p,h,p),p=d[7],e.add(s,m,p),e.add(p,c,p);for(var y=d.length,v=0;y>v;++v){var g=d[v];e.add(i,g,g);var E=a.cartesianToCartographic(g,G);n.project(E,g)}o=f.fromPoints(d,o),i=o.center;var S=i.x,C=i.y,w=i.z;return i.x=w,i.y=S,i.z=C,o},f.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersect=function(e){return f.intersect(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},o={};return t(o,{element:{get:function(){return o.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return o.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return o.supportsFullscreen()?null!==o.element:void 0}}}),o.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var o,a=["webkit","moz","o","ms","khtml"],i=0,u=a.length;u>i;++i){var s=a[i];o=s+"RequestFullscreen","function"==typeof t[o]?(n.requestFullscreen=o,r=!0):(o=s+"RequestFullScreen","function"==typeof t[o]&&(n.requestFullscreen=o,r=!0)),o=s+"ExitFullscreen","function"==typeof document[o]?n.exitFullscreen=o:(o=s+"CancelFullScreen","function"==typeof document[o]&&(n.exitFullscreen=o)),o=s+"FullscreenEnabled",e(document[o])?n.fullscreenEnabled=o:(o=s+"FullScreenEnabled",e(document[o])&&(n.fullscreenEnabled=o)),o=s+"FullscreenElement",e(document[o])?n.fullscreenElement=o:(o=s+"FullScreenElement",e(document[o])&&(n.fullscreenElement=o)),o=s+"fullscreenchange",e(document["on"+o])&&("ms"===s&&(o="MSFullscreenChange"),n.fullscreenchange=o),o=s+"fullscreenerror",e(document["on"+o])&&("ms"===s&&(o="MSFullscreenError"),n.fullscreenerror=o)}return r},o.requestFullscreen=function(e){o.supportsFullscreen()&&e[n.requestFullscreen]()},o.exitFullscreen=function(){o.supportsFullscreen()&&document[n.exitFullscreen]()},o}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function n(e){for(var t=e.split("."),r=0,n=t.length;n>r;++r)t[r]=parseInt(t[r],10);return t}function o(){if(!t(d)){d=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(d=!0,p=n(e[1]))}return d}function a(){return o()&&p}function i(){if(!t(y)&&(y=!1,!o()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(y=!0,v=n(e[1]))}return y}function u(){return i()&&v}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(g=!0,E=n(e[1]),E.isNightly=!!e[2])}return g}function c(){return s()&&E}function l(){if(!t(S)){S=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(S=!0,C=n(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(S=!0,C=n(e[1])))}return S}function f(){return l()&&C}function m(){if(!t(w)){w=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(w=!0,A=n(e[1]))}return w}function h(){return m()&&A}var d,p,y,v,g,E,S,C,w,A,x={isChrome:o,chromeVersion:a,isSafari:i,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:m,firefoxVersion:h,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};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,o,a){"use strict";function i(e,t,r){return 0>r&&(r+=1),r>1&&(r-=1),1>6*r?e+6*(t-e)*r:1>2*r?t:2>3*r?e+6*(t-e)*(2/3-r):e}var u=function(t,r,n,o){this.red=e(t,1),this.green=e(r,1),this.blue=e(n,1),this.alpha=e(o,1)};u.fromCartesian4=function(e,r){return t(r)?(r.red=e.x,r.green=e.y,r.blue=e.z,r.alpha=e.w,r):new u(e.x,e.y,e.z,e.w)},u.fromBytes=function(t,r,n,o){return t=u.byteToFloat(e(t,255)),r=u.byteToFloat(e(r,255)),n=u.byteToFloat(e(n,255)),o=u.byteToFloat(e(o,255)),new u(t,r,n,o)};var s,c,l;n.supportsTypedArrays()&&(s=new ArrayBuffer(4),c=new Uint32Array(s),l=new Uint8Array(s)),u.fromRgba=function(e){return c[0]=e,u.fromBytes(l[0],l[1],l[2],l[3])},u.fromHsl=function(t,r,n,o){t=e(t,0)%1,r=e(r,0),n=e(n,0),o=e(o,1);var a=n,s=n,c=n;if(0!==r){var l;l=.5>n?n*(1+r):n+r-n*r;var f=2*n-l;a=i(f,l,t+1/3),s=i(f,l,t),c=i(f,l,t-1/3)}return new u(a,s,c,o)},u.fromRandom=function(r,n){r=e(r,e.EMPTY_OBJECT);var o=r.red;if(!t(o)){var i=e(r.minimumRed,0),s=e(r.maximumRed,1);o=i+a.nextRandomNumber()*(s-i)}var c=r.green;if(!t(c)){var l=e(r.minimumGreen,0),f=e(r.maximumGreen,1);c=l+a.nextRandomNumber()*(f-l)}var m=r.blue;if(!t(m)){var h=e(r.minimumBlue,0),d=e(r.maximumBlue,1);m=h+a.nextRandomNumber()*(d-h)}var p=r.alpha;if(!t(p)){var y=e(r.minimumAlpha,0),v=e(r.maximumAlpha,1);p=y+a.nextRandomNumber()*(v-y)}return t(n)?(n.red=o,n.green=c,n.blue=m,n.alpha=p,n):new u(o,c,m,p)};var f=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,m=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,h=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,d=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return u.fromCssColorString=function(r){var n=u[r.toUpperCase()];if(t(n))return u.clone(n);var o=f.exec(r);return null!==o?new u(parseInt(o[1],16)/15,parseInt(o[2],16)/15,parseInt(o[3],16)/15):(o=m.exec(r),null!==o?new u(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255):(o=h.exec(r),null!==o?new u(parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),parseFloat(e(o[4],"1.0"))):(o=d.exec(r),null!==o?u.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(e(o[4],"1.0"))):void 0)))},u.packedLength=4,u.pack=function(t,r,n){n=e(n,0),r[n++]=t.red,r[n++]=t.green,r[n++]=t.blue,r[n]=t.alpha},u.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new u),o.red=r[n++],o.green=r[n++],o.blue=r[n++],o.alpha=r[n],o},u.byteToFloat=function(e){return e/255},u.floatToByte=function(e){return 1===e?255:0|256*e},u.clone=function(e,r){return t(e)?t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=e.alpha,r):new u(e.red,e.green,e.blue,e.alpha):void 0},u.equals=function(e,r){return e===r||t(e)&&t(r)&&e.red===r.red&&e.green===r.green&&e.blue===r.blue&&e.alpha===r.alpha},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,r){return this===e||t(e)&&Math.abs(this.red-e.red)<=r&&Math.abs(this.green-e.green)<=r&&Math.abs(this.blue-e.blue)<=r&&Math.abs(this.alpha-e.alpha)<=r},u.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},u.prototype.toCssColorString=function(){var e=u.floatToByte(this.red),t=u.floatToByte(this.green),r=u.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+r+")":"rgba("+e+","+t+","+r+","+this.alpha+")"},u.prototype.toBytes=function(e){var r=u.floatToByte(this.red),n=u.floatToByte(this.green),o=u.floatToByte(this.blue),a=u.floatToByte(this.alpha);return t(e)?(e[0]=r,e[1]=n,e[2]=o,e[3]=a,e):[r,n,o,a]},u.prototype.toRgba=function(){return l[0]=u.floatToByte(this.red),l[1]=u.floatToByte(this.green),l[2]=u.floatToByte(this.blue),l[3]=u.floatToByte(this.alpha),c[0]},u.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.ALICEBLUE=o(u.fromCssColorString("#F0F8FF")),u.ANTIQUEWHITE=o(u.fromCssColorString("#FAEBD7")),u.AQUA=o(u.fromCssColorString("#00FFFF")),u.AQUAMARINE=o(u.fromCssColorString("#7FFFD4")),u.AZURE=o(u.fromCssColorString("#F0FFFF")),u.BEIGE=o(u.fromCssColorString("#F5F5DC")),u.BISQUE=o(u.fromCssColorString("#FFE4C4")),u.BLACK=o(u.fromCssColorString("#000000")),u.BLANCHEDALMOND=o(u.fromCssColorString("#FFEBCD")),u.BLUE=o(u.fromCssColorString("#0000FF")),u.BLUEVIOLET=o(u.fromCssColorString("#8A2BE2")),u.BROWN=o(u.fromCssColorString("#A52A2A")),u.BURLYWOOD=o(u.fromCssColorString("#DEB887")),u.CADETBLUE=o(u.fromCssColorString("#5F9EA0")),u.CHARTREUSE=o(u.fromCssColorString("#7FFF00")),u.CHOCOLATE=o(u.fromCssColorString("#D2691E")),u.CORAL=o(u.fromCssColorString("#FF7F50")),u.CORNFLOWERBLUE=o(u.fromCssColorString("#6495ED")),u.CORNSILK=o(u.fromCssColorString("#FFF8DC")),u.CRIMSON=o(u.fromCssColorString("#DC143C")),u.CYAN=o(u.fromCssColorString("#00FFFF")),u.DARKBLUE=o(u.fromCssColorString("#00008B")),u.DARKCYAN=o(u.fromCssColorString("#008B8B")),u.DARKGOLDENROD=o(u.fromCssColorString("#B8860B")),u.DARKGRAY=o(u.fromCssColorString("#A9A9A9")),u.DARKGREEN=o(u.fromCssColorString("#006400")),u.DARKGREY=u.DARKGRAY,u.DARKKHAKI=o(u.fromCssColorString("#BDB76B")),u.DARKMAGENTA=o(u.fromCssColorString("#8B008B")),u.DARKOLIVEGREEN=o(u.fromCssColorString("#556B2F")),u.DARKORANGE=o(u.fromCssColorString("#FF8C00")),u.DARKORCHID=o(u.fromCssColorString("#9932CC")),u.DARKRED=o(u.fromCssColorString("#8B0000")),u.DARKSALMON=o(u.fromCssColorString("#E9967A")),u.DARKSEAGREEN=o(u.fromCssColorString("#8FBC8F")),u.DARKSLATEBLUE=o(u.fromCssColorString("#483D8B")),u.DARKSLATEGRAY=o(u.fromCssColorString("#2F4F4F")),u.DARKSLATEGREY=u.DARKSLATEGRAY,u.DARKTURQUOISE=o(u.fromCssColorString("#00CED1")),u.DARKVIOLET=o(u.fromCssColorString("#9400D3")),u.DEEPPINK=o(u.fromCssColorString("#FF1493")),u.DEEPSKYBLUE=o(u.fromCssColorString("#00BFFF")),u.DIMGRAY=o(u.fromCssColorString("#696969")),u.DIMGREY=u.DIMGRAY,u.DODGERBLUE=o(u.fromCssColorString("#1E90FF")),u.FIREBRICK=o(u.fromCssColorString("#B22222")),u.FLORALWHITE=o(u.fromCssColorString("#FFFAF0")),u.FORESTGREEN=o(u.fromCssColorString("#228B22")),u.FUSCHIA=o(u.fromCssColorString("#FF00FF")),u.GAINSBORO=o(u.fromCssColorString("#DCDCDC")),u.GHOSTWHITE=o(u.fromCssColorString("#F8F8FF")),u.GOLD=o(u.fromCssColorString("#FFD700")),u.GOLDENROD=o(u.fromCssColorString("#DAA520")),u.GRAY=o(u.fromCssColorString("#808080")),u.GREEN=o(u.fromCssColorString("#008000")),u.GREENYELLOW=o(u.fromCssColorString("#ADFF2F")),u.GREY=u.GRAY,u.HONEYDEW=o(u.fromCssColorString("#F0FFF0")),u.HOTPINK=o(u.fromCssColorString("#FF69B4")),u.INDIANRED=o(u.fromCssColorString("#CD5C5C")),u.INDIGO=o(u.fromCssColorString("#4B0082")),u.IVORY=o(u.fromCssColorString("#FFFFF0")),u.KHAKI=o(u.fromCssColorString("#F0E68C")),u.LAVENDER=o(u.fromCssColorString("#E6E6FA")),u.LAVENDAR_BLUSH=o(u.fromCssColorString("#FFF0F5")),u.LAWNGREEN=o(u.fromCssColorString("#7CFC00")),u.LEMONCHIFFON=o(u.fromCssColorString("#FFFACD")),u.LIGHTBLUE=o(u.fromCssColorString("#ADD8E6")),u.LIGHTCORAL=o(u.fromCssColorString("#F08080")),u.LIGHTCYAN=o(u.fromCssColorString("#E0FFFF")),u.LIGHTGOLDENRODYELLOW=o(u.fromCssColorString("#FAFAD2")),u.LIGHTGRAY=o(u.fromCssColorString("#D3D3D3")),u.LIGHTGREEN=o(u.fromCssColorString("#90EE90")),u.LIGHTGREY=u.LIGHTGRAY,u.LIGHTPINK=o(u.fromCssColorString("#FFB6C1")),u.LIGHTSEAGREEN=o(u.fromCssColorString("#20B2AA")),u.LIGHTSKYBLUE=o(u.fromCssColorString("#87CEFA")),u.LIGHTSLATEGRAY=o(u.fromCssColorString("#778899")),u.LIGHTSLATEGREY=u.LIGHTSLATEGRAY,u.LIGHTSTEELBLUE=o(u.fromCssColorString("#B0C4DE")),u.LIGHTYELLOW=o(u.fromCssColorString("#FFFFE0")),u.LIME=o(u.fromCssColorString("#00FF00")),u.LIMEGREEN=o(u.fromCssColorString("#32CD32")),u.LINEN=o(u.fromCssColorString("#FAF0E6")),u.MAGENTA=o(u.fromCssColorString("#FF00FF")),u.MAROON=o(u.fromCssColorString("#800000")),u.MEDIUMAQUAMARINE=o(u.fromCssColorString("#66CDAA")),u.MEDIUMBLUE=o(u.fromCssColorString("#0000CD")),u.MEDIUMORCHID=o(u.fromCssColorString("#BA55D3")),u.MEDIUMPURPLE=o(u.fromCssColorString("#9370DB")),u.MEDIUMSEAGREEN=o(u.fromCssColorString("#3CB371")),u.MEDIUMSLATEBLUE=o(u.fromCssColorString("#7B68EE")),u.MEDIUMSPRINGGREEN=o(u.fromCssColorString("#00FA9A")),u.MEDIUMTURQUOISE=o(u.fromCssColorString("#48D1CC")),u.MEDIUMVIOLETRED=o(u.fromCssColorString("#C71585")),u.MIDNIGHTBLUE=o(u.fromCssColorString("#191970")),u.MINTCREAM=o(u.fromCssColorString("#F5FFFA")),u.MISTYROSE=o(u.fromCssColorString("#FFE4E1")),u.MOCCASIN=o(u.fromCssColorString("#FFE4B5")),u.NAVAJOWHITE=o(u.fromCssColorString("#FFDEAD")),u.NAVY=o(u.fromCssColorString("#000080")),u.OLDLACE=o(u.fromCssColorString("#FDF5E6")),u.OLIVE=o(u.fromCssColorString("#808000")),u.OLIVEDRAB=o(u.fromCssColorString("#6B8E23")),u.ORANGE=o(u.fromCssColorString("#FFA500")),u.ORANGERED=o(u.fromCssColorString("#FF4500")),u.ORCHID=o(u.fromCssColorString("#DA70D6")),u.PALEGOLDENROD=o(u.fromCssColorString("#EEE8AA")),u.PALEGREEN=o(u.fromCssColorString("#98FB98")),u.PALETURQUOISE=o(u.fromCssColorString("#AFEEEE")),u.PALEVIOLETRED=o(u.fromCssColorString("#DB7093")),u.PAPAYAWHIP=o(u.fromCssColorString("#FFEFD5")),u.PEACHPUFF=o(u.fromCssColorString("#FFDAB9")),u.PERU=o(u.fromCssColorString("#CD853F")),u.PINK=o(u.fromCssColorString("#FFC0CB")),u.PLUM=o(u.fromCssColorString("#DDA0DD")),u.POWDERBLUE=o(u.fromCssColorString("#B0E0E6")),u.PURPLE=o(u.fromCssColorString("#800080")),u.RED=o(u.fromCssColorString("#FF0000")),u.ROSYBROWN=o(u.fromCssColorString("#BC8F8F")),u.ROYALBLUE=o(u.fromCssColorString("#4169E1")),u.SADDLEBROWN=o(u.fromCssColorString("#8B4513")),u.SALMON=o(u.fromCssColorString("#FA8072")),u.SANDYBROWN=o(u.fromCssColorString("#F4A460")),u.SEAGREEN=o(u.fromCssColorString("#2E8B57")),u.SEASHELL=o(u.fromCssColorString("#FFF5EE")),u.SIENNA=o(u.fromCssColorString("#A0522D")),u.SILVER=o(u.fromCssColorString("#C0C0C0")),u.SKYBLUE=o(u.fromCssColorString("#87CEEB")),u.SLATEBLUE=o(u.fromCssColorString("#6A5ACD")),u.SLATEGRAY=o(u.fromCssColorString("#708090")),u.SLATEGREY=u.SLATEGRAY,u.SNOW=o(u.fromCssColorString("#FFFAFA")),u.SPRINGGREEN=o(u.fromCssColorString("#00FF7F")),u.STEELBLUE=o(u.fromCssColorString("#4682B4")),u.TAN=o(u.fromCssColorString("#D2B48C")),u.TEAL=o(u.fromCssColorString("#008080")),u.THISTLE=o(u.fromCssColorString("#D8BFD8")),u.TOMATO=o(u.fromCssColorString("#FF6347")),u.TURQUOISE=o(u.fromCssColorString("#40E0D0")),u.VIOLET=o(u.fromCssColorString("#EE82EE")),u.WHEAT=o(u.fromCssColorString("#F5DEB3")),u.WHITE=o(u.fromCssColorString("#FFFFFF")),u.WHITESMOKE=o(u.fromCssColorString("#F5F5F5")),u.YELLOW=o(u.fromCssColorString("#FFFF00")),u.YELLOWGREEN=o(u.fromCssColorString("#9ACD32")),u -}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,r,n,o){"use strict";if(!n.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return t(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(t,n,o,i){switch(o=e(o,0),i=e(i,(n.byteLength-o)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(n,o,i);case a.UNSIGNED_BYTE:return new Uint8Array(n,o,i);case a.SHORT:return new Int16Array(n,o,i);case a.UNSIGNED_SHORT:return new Uint16Array(n,o,i);case a.FLOAT:return new Float32Array(n,o,i);case a.DOUBLE:return new Float64Array(n,o,i);default:throw new r("componentDatatype is not a valid value.")}},o(a)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject"],function(e){"use strict";var t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===t.POINTS||e===t.LINES||e===t.LINE_LOOP||e===t.LINE_STRIP||e===t.TRIANGLES||e===t.TRIANGLE_STRIP||e===t.TRIANGLE_FAN}};return e(t)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,o){"use strict";var a=function(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,o.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE)};return a.computeNumberOfVertices=function(e){var n=-1;for(var o in e.attributes)if(e.attributes.hasOwnProperty(o)&&t(e.attributes[o])&&t(e.attributes[o].values)){var a=e.attributes[o],i=a.values.length/a.componentsPerAttribute;if(n!==i&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=i}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";var a=function(t,r){this.x=e(t,0),this.y=e(r,0)};a.fromElements=function(e,r,n){return t(n)?(n.x=e,n.y=r,n):new a(e,r)},a.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new a(e.x,e.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n]=t.y},a.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new a),o.x=r[n++],o.y=r[n],o},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y)},a.minimumComponent=function(e){return Math.min(e.x,e.y)},a.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},a.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var i=new a;a.distance=function(e,t){return a.subtract(e,t,i),a.magnitude(i)},a.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var u=new a;a.lerp=function(e,t,r,n){return a.multiplyByScalar(t,r,u),n=a.multiplyByScalar(e,1-r,n),a.add(u,n,n)};var s=new a,c=new a;a.angleBetween=function(e,t){return a.normalize(e,s),a.normalize(t,c),o.acosClamped(a.dot(s,c))};var l=new a;return a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,l);return a.abs(r,r),t=r.x<=r.y?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Y,t)},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y},a.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n},a.ZERO=n(new a(0,0)),a.UNIT_X=n(new a(1,0)),a.UNIT_Y=n(new a(0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,o){"use strict";var a={};a.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=t.x,n=t.y;t.x=(1-Math.abs(n))*o.signNotZero(r),t.y=(1-Math.abs(r))*o.signNotZero(n)}return t.x=o.toSNorm(t.x),t.y=o.toSNorm(t.y),t},a.octDecode=function(e,r,n){if(n.x=o.fromSNorm(e),n.y=o.fromSNorm(r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var a=n.x;n.x=(1-Math.abs(n.y))*o.signNotZero(a),n.y=(1-Math.abs(a))*o.signNotZero(n.y)}return t.normalize(n,n)},a.octPackFloat=function(e){return 256*e.x+e.y};var i=new e;return a.octEncodeFloat=function(e){return a.octEncode(e,i),a.octPackFloat(i)},a.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),o=256*(r-n);return a.octDecode(n,o,t)},a.octPack=function(e,t,r,n){var o=a.octEncodeFloat(e),u=a.octEncodeFloat(t),s=a.octEncode(r,i);return n.x=65536*s.x+o,n.y=65536*s.y+u,n},a.octUnpack=function(e,t,r,n){var o=e.x/65536,i=Math.floor(o),u=65536*(o-i);o=e.y/65536;var s=Math.floor(o),c=65536*(o-s);a.octDecodeFloat(u,t),a.octDecodeFloat(c,r),a.octDecode(i,s,n)},a.compressTextureCoordinates=function(e){var t=1===e.x?4095:0|4096*e.x,r=1===e.y?4095:0|4096*e.y;return 4096*t+r},a.decompressTextureCoordinates=function(e,t){var r=e/4096;return t.x=Math.floor(r)/4096,t.y=r-Math.floor(r),t},a}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=new t,o=new t,a=new t,i=function(i,u,s,c,l){r(l)||(l=new t);var f,m,h,d,p,y,v,g;r(u.z)?(f=t.subtract(s,u,n),m=t.subtract(c,u,o),h=t.subtract(i,u,a),d=t.dot(f,f),p=t.dot(f,m),y=t.dot(f,h),v=t.dot(m,m),g=t.dot(m,h)):(f=e.subtract(s,u,n),m=e.subtract(c,u,o),h=e.subtract(i,u,a),d=e.dot(f,f),p=e.dot(f,m),y=e.dot(f,h),v=e.dot(m,m),g=e.dot(m,h));var E=1/(d*v-p*p);return l.y=(v*y-p*g)*E,l.z=(d*g-p*y)*E,l.x=1-l.y-l.z,l};return i}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)};r.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var n={high:0,low:0};r.fromCartesian=function(e,o){t(o)||(o=new r);var a=o.high,i=o.low;return r.encode(e.x,n),a.x=n.high,i.x=n.low,r.encode(e.y,n),a.y=n.high,i.y=n.low,r.encode(e.z,n),a.z=n.high,i.z=n.low,o};var o=new r;return r.writeElements=function(e,t,n){r.fromCartesian(e,o);var a=o.high,i=o.low;t[n]=a.x,t[n+1]=a.y,t[n+2]=a.z,t[n+3]=i.x,t[n+4]=i.y,t[n+5]=i.z},r}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n){"use strict";var o={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};return o.getSizeInBytes=function(e){switch(e){case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},o.validate=function(t){return e(t)&&(t===o.UNSIGNED_BYTE||t===o.UNSIGNED_SHORT||t===o.UNSIGNED_INT)},o.createTypedArray=function(e,t){return e>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},o.createTypedArrayFromArrayBuffer=function(e,t,r,o){return e>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,o):new Uint16Array(t,r,o)},r(o)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var o=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(o/Math.max(Math.abs(e),Math.abs(r)))<n?0:o}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,o){var a;if(0===e)return 0===n?[]:[-o/n];if(0===n){if(0===o)return[0,0];var i=Math.abs(o),u=Math.abs(e);if(u>i&&i/u<t.EPSILON14)return[0,0];if(i>u&&u/i<t.EPSILON14)return[];if(a=-o/e,0>a)return[];var s=Math.sqrt(a);return[-s,s]}if(0===o)return a=-n/e,0>a?[a,0]:[0,a];var c=n*n,l=4*e*o,f=r(c,-l,t.EPSILON14);if(0>f)return[];var m=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[m/e,o/m]:[o/m,m/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var o,a,i=e,u=t/3,s=r/3,c=n,l=i*s,f=u*c,m=u*u,h=s*s,d=i*s-m,p=i*c-u*s,y=u*c-h,v=4*d*y-p*p;if(0>v){var g,E,S;m*f>=l*h?(g=i,E=d,S=-2*u*d+i*p):(g=c,E=y,S=-c*p+2*s*y);var C=0>S?-1:1,w=-C*Math.abs(g)*Math.sqrt(-v);a=-S+w;var A=a/2,x=0>A?-Math.pow(-A,1/3):Math.pow(A,1/3),b=a===w?-x:-E/x;return o=0>=E?x+b:-S/(x*x+b*b+E),m*f>=l*h?[(o-u)/i]:[-c/(o+s)]}var T=d,M=-2*u*d+i*p,R=y,O=-c*p+2*s*y,I=Math.sqrt(v),N=Math.sqrt(3)/2,L=Math.abs(Math.atan2(i*I,-M)/3);o=2*Math.sqrt(-T);var z=Math.cos(L);a=o*z;var P=o*(-z/2-N*Math.sin(L)),D=a+P>2*u?a-u:P-u,F=i,_=D/F;L=Math.abs(Math.atan2(c*I,-O)/3),o=2*Math.sqrt(-R),z=Math.cos(L),a=o*z,P=o*(-z/2-N*Math.sin(L));var B=-c,U=2*s>a+P?a+s:P+s,G=B/U,q=F*U,k=-D*U-F*B,W=D*B,V=(s*k-u*W)/(-u*k+s*q);return V>=_?G>=_?G>=V?[_,V,G]:[_,G,V]:[G,_,V]:G>=_?[V,_,G]:G>=V?[V,G,_]:[G,V,_]}var n={};return n.computeDiscriminant=function(e,t,r,n){var o=e*e,a=t*t,i=r*r,u=n*n,s=18*e*t*r*n+a*i-27*o*u-4*(e*i*r+a*t*n);return s},n.computeRealRoots=function(e,n,o,a){var i,u;if(0===e)return t.computeRealRoots(n,o,a);if(0===n){if(0===o){if(0===a)return[0,0,0];u=-a/e;var s=0>u?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===a?(i=t.computeRealRoots(e,0,o),0===i.Length?[0]:[i[0],0,i[1]]):r(e,0,o,a)}return 0===o?0===a?(u=-n/e,0>u?[u,0,0]:[0,0,u]):r(e,n,0,a):0===a?(i=t.computeRealRoots(e,n,o),0===i.length?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]):r(e,n,o,a)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function o(t,o,a,i){var u=t*t,s=o-3*u/8,c=a-o*t/2+u*t/8,l=i-a*t/4+o*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var m=-t/4,h=f[f.length-1];if(Math.abs(h)<r.EPSILON14){var d=n.computeRealRoots(1,s,l);if(2===d.length){var p,y=d[0],v=d[1];if(y>=0&&v>=0){var g=Math.sqrt(y),E=Math.sqrt(v);return[m-E,m-g,m+g,m+E]}if(y>=0&&0>v)return p=Math.sqrt(y),[m-p,m+p];if(0>y&&v>=0)return p=Math.sqrt(v),[m-p,m+p]}return[]}if(h>0){var S=Math.sqrt(h),C=(s+h-c/S)/2,w=(s+h+c/S)/2,A=n.computeRealRoots(1,S,C),x=n.computeRealRoots(1,-S,w);return 0!==A.length?(A[0]+=m,A[1]+=m,0!==x.length?(x[0]+=m,x[1]+=m,A[1]<=x[0]?[A[0],A[1],x[0],x[1]]:x[1]<=A[0]?[x[0],x[1],A[0],A[1]]:A[0]>=x[0]&&A[1]<=x[1]?[x[0],A[0],A[1],x[1]]:x[0]>=A[0]&&x[1]<=A[1]?[A[0],x[0],x[1],A[1]]:A[0]>x[0]&&A[0]<x[1]?[x[0],A[0],x[1],A[1]]:[A[0],x[0],A[1],x[1]]):A):0!==x.length?(x[0]+=m,x[1]+=m,x):[]}}return[]}function a(t,o,a,i){var u=a*a,s=o*o,c=t*t,l=-2*o,f=a*t+s-4*i,m=c*i-a*o*t+u,h=e.computeRealRoots(1,l,f,m);if(h.length>0){var d,p,y=h[0],v=o-y,g=v*v,E=t/2,S=v/2,C=g-4*i,w=g+4*Math.abs(i),A=c-4*y,x=c+4*Math.abs(y);if(0>y||A*w>C*x){var b=Math.sqrt(A);d=b/2,p=0===b?0:(t*S-a)/b}else{var T=Math.sqrt(C);d=0===T?0:(t*S-a)/T,p=T/2}var M,R;0===E&&0===d?(M=0,R=0):r.sign(E)===r.sign(d)?(M=E+d,R=y/M):(R=E-d,M=y/R);var O,I;0===S&&0===p?(O=0,I=0):r.sign(S)===r.sign(p)?(O=S+p,I=i/O):(I=S-p,O=i/I);var N=n.computeRealRoots(1,M,O),L=n.computeRealRoots(1,R,I);if(0!==N.length)return 0!==L.length?N[1]<=L[0]?[N[0],N[1],L[0],L[1]]:L[1]<=N[0]?[L[0],L[1],N[0],N[1]]:N[0]>=L[0]&&N[1]<=L[1]?[L[0],N[0],N[1],L[1]]:L[0]>=N[0]&&L[1]<=N[1]?[N[0],L[0],L[1],N[1]]:N[0]>L[0]&&N[0]<L[1]?[L[0],N[0],L[1],N[1]]:[N[0],L[0],N[1],L[1]]:N;if(0!==L.length)return L}return[]}var i={};return i.computeDiscriminant=function(e,t,r,n,o){var a=e*e,i=a*e,u=t*t,s=u*t,c=r*r,l=c*r,f=n*n,m=f*n,h=o*o,d=h*o,p=u*c*f-4*s*m-4*e*l*f+18*e*t*r*m-27*a*f*f+256*i*d+o*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*f+144*a*r*f)+h*(144*e*u*r-27*u*u-128*a*c-192*a*t*n);return p},i.computeRealRoots=function(t,n,i,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,i,u,s);var c=n/t,l=i/t,f=u/t,m=s/t,h=0>c?1:0;switch(h+=0>l?h+1:h,h+=0>f?h+1:h,h+=0>m?h+1:h){case 0:return o(c,l,f,m);case 1:return a(c,l,f,m);case 2:return a(c,l,f,m);case 3:return o(c,l,f,m);case 4:return o(c,l,f,m);case 5:return a(c,l,f,m);case 6:return o(c,l,f,m);case 7:return o(c,l,f,m);case 8:return a(c,l,f,m);case 9:return o(c,l,f,m);case 10:return o(c,l,f,m);case 11:return a(c,l,f,m);case 12:return o(c,l,f,m);case 13:return o(c,l,f,m);case 14:return o(c,l,f,m);case 15:return o(c,l,f,m);default:return void 0}},i}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=function(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n};return n.getPoint=function(t,n,o){return r(o)||(o=new e),o=e.multiplyByScalar(t.direction,n,o),e.add(t.origin,o,o)},n}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,o,a,i,u,s,c){"use strict";function l(t,n,o,i,u){u=r(u,!1);var s,c,l,f,m,h=t.origin,d=t.direction,p=e.subtract(o,n,y),C=e.subtract(i,n,v),w=e.cross(d,C,g),A=e.dot(p,w);if(u){if(A<a.EPSILON6)return void 0;if(s=e.subtract(h,n,E),l=e.dot(s,w),0>l||l>A)return void 0;if(c=e.cross(s,p,S),f=e.dot(d,c),0>f||l+f>A)return void 0;m=e.dot(C,c)/A}else{if(Math.abs(A)<a.EPSILON6)return void 0;var x=1/A;if(s=e.subtract(h,n,E),l=e.dot(s,w)*x,0>l||l>1)return void 0;if(c=e.cross(s,p,S),f=e.dot(d,c)*x,0>f||l+f>1)return void 0;m=e.dot(C,c)*x}return m}function f(e,t,r,n){var o=t*t-4*e*r;if(0>o)return void 0;if(o>0){var a=1/(2*e),i=Math.sqrt(o),u=(-t+i)*a,s=(-t-i)*a;return s>u?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);return 0===c?void 0:(n.root0=n.root1=c,n)}function m(t,r,o){n(o)||(o={});var a=t.origin,i=t.direction,u=r.center,s=r.radius*r.radius,c=e.subtract(a,u,g),l=e.dot(i,i),m=2*e.dot(i,c),h=e.magnitudeSquared(c)-s,d=f(l,m,h,w);return n(d)?(o.start=d.root0,o.stop=d.root1,o):void 0}function h(e,t,r){var n=e+t;return a.sign(e)!==a.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function d(t,r,n,o,c){var l,f=o*o,m=c*c,d=(t[i.COLUMN1ROW1]-t[i.COLUMN2ROW2])*m,p=c*(o*h(t[i.COLUMN1ROW0],t[i.COLUMN0ROW1],a.EPSILON15)+r.y),y=t[i.COLUMN0ROW0]*f+t[i.COLUMN2ROW2]*m+o*r.x+n,v=m*h(t[i.COLUMN2ROW1],t[i.COLUMN1ROW2],a.EPSILON15),g=c*(o*h(t[i.COLUMN2ROW0],t[i.COLUMN0ROW2])+r.z),E=[];if(0===g&&0===v){if(l=u.computeRealRoots(d,p,y),0===l.length)return E;var S=l[0],C=Math.sqrt(Math.max(1-S*S,0));if(E.push(new e(o,c*S,c*-C)),E.push(new e(o,c*S,c*C)),2===l.length){var w=l[1],A=Math.sqrt(Math.max(1-w*w,0));E.push(new e(o,c*w,c*-A)),E.push(new e(o,c*w,c*A))}return E}var x=g*g,b=v*v,T=d*d,M=g*v,R=T+b,O=2*(p*d+M),I=2*y*d+p*p-b+x,N=2*(y*p-M),L=y*y-x;if(0===R&&0===O&&0===I&&0===N)return E;l=s.computeRealRoots(R,O,I,N,L);var z=l.length;if(0===z)return E;for(var P=0;z>P;++P){var D,F=l[P],_=F*F,B=Math.max(1-_,0),U=Math.sqrt(B);D=a.sign(d)===a.sign(y)?h(d*_+y,p*F,a.EPSILON12):a.sign(y)===a.sign(p*F)?h(d*_,p*F+y,a.EPSILON12):h(d*_+p*F,y,a.EPSILON12);var G=h(v*F,g,a.EPSILON15),q=D*G;0>q?E.push(new e(o,c*F,c*U)):q>0?E.push(new e(o,c*F,c*-U)):0!==U?(E.push(new e(o,c*F,c*-U)),E.push(new e(o,c*F,c*U)),++P):E.push(new e(o,c*F,c*U))}return E}var p={};p.rayPlane=function(t,r,o){n(o)||(o=new e);var i=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(Math.abs(c)<a.EPSILON15)return void 0;var l=(-r.distance-e.dot(s,i))/c;return 0>l?void 0:(o=e.multiplyByScalar(u,l,o),e.add(i,o,o))};var y=new e,v=new e,g=new e,E=new e,S=new e;p.rayTriangle=function(t,r,o,a,i,u){var s=l(t,r,o,a,i);return!n(s)||0>s?void 0:(n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u))};var C=new c;p.lineSegmentTriangle=function(t,r,o,a,i,u,s){var c=C;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var f=l(c,o,a,i,u);return!n(f)||0>f||f>e.distance(t,r)?void 0:(n(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var w={root0:0,root1:0};p.raySphere=function(e,t,r){return r=m(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var A=new c;p.lineSegmentSphere=function(t,r,o,a){var i=A;e.clone(t,i.origin);var u=e.subtract(r,t,i.direction),s=e.magnitude(u);return e.normalize(u,u),a=m(i,o,a),!n(a)||a.stop<0||a.start>s?void 0:(a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a)};var x=new e,b=new e;p.rayEllipsoid=function(t,r){var n,o,a,i,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,x),l=e.multiplyComponents(s,t.direction,b),f=e.magnitudeSquared(c),m=e.dot(c,l);if(f>1){if(m>=0)return void 0;var h=m*m;if(n=f-1,o=e.magnitudeSquared(l),a=o*n,a>h)return void 0;if(h>a){i=m*m-a,u=-m+Math.sqrt(i);var d=u/o,p=n/u;return p>d?{start:d,stop:p}:{start:p,stop:d}}var y=Math.sqrt(n/o);return{start:y,stop:y}}return 1>f?(n=f-1,o=e.magnitudeSquared(l),a=o*n,i=m*m-a,u=-m+Math.sqrt(i),{start:0,stop:u/o}):0>m?(o=e.magnitudeSquared(l),{start:0,stop:-m/o}):void 0};var T=new e,M=new e,R=new e,O=new e,I=new e,N=new i,L=new i,z=new i,P=new i,D=new i,F=new i,_=new i,B=new e,U=new e,G=new t;p.grazingAltitudeLocation=function(t,r){var o=t.origin,u=t.direction,s=r.geodeticSurfaceNormal(o);if(e.dot(u,s)>=0)return o;var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u),f=e.normalize(l,T),m=e.mostOrthogonalAxis(l,O),h=e.normalize(e.cross(m,f,M),M),p=e.normalize(e.cross(f,h,R),R),y=N;y[0]=f.x,y[1]=f.y,y[2]=f.z,y[3]=h.x,y[4]=h.y,y[5]=h.z,y[6]=p.x,y[7]=p.y,y[8]=p.z;var v=i.transpose(y,L),g=i.fromScale(r.radii,z),E=i.fromScale(r.oneOverRadii,P),S=D;S[0]=0,S[1]=-u.z,S[2]=u.y,S[3]=u.z,S[4]=0,S[5]=-u.x,S[6]=-u.y,S[7]=u.x,S[8]=0;var C,w,A=i.multiply(i.multiply(v,E,F),S,F),x=i.multiply(i.multiply(A,g,_),y,_),b=i.multiplyByVector(A,o,I),q=d(x,e.negate(b,T),0,0,1),k=q.length;if(k>0){for(var W=e.clone(e.ZERO,U),V=Number.NEGATIVE_INFINITY,Y=0;k>Y;++Y){C=i.multiplyByVector(g,i.multiplyByVector(y,q[Y],B),B);var H=e.normalize(e.subtract(C,o,O),O),j=e.dot(H,u);j>V&&(V=j,W=e.clone(C,W))}var K=r.cartesianToCartographic(W,G);return V=a.clamp(V,0,1),w=e.magnitude(e.subtract(W,o,O))*Math.sqrt(1-V*V),w=c?-w:w,K.height=w,r.cartographicToCartesian(K)}return void 0};var q=new e;return p.lineSegmentPlane=function(t,r,o,i){n(i)||(i=new e);var u=e.subtract(r,t,q),s=o.normal,c=e.dot(s,u);if(Math.abs(c)<a.EPSILON6)return void 0;var l=e.dot(s,t),f=-(o.distance+l)/c;return 0>f||f>1?void 0:(e.multiplyByScalar(u,f,i),e.add(t,i,i),i)},p.trianglePlaneIntersection=function(t,r,n,o){var a=o.normal,i=o.distance,u=e.dot(a,t)+i<0,s=e.dot(a,r)+i<0,c=e.dot(a,n)+i<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,m;if((1===l||2===l)&&(f=new e,m=new e),1===l){if(u)return p.lineSegmentPlane(t,r,o,f),p.lineSegmentPlane(t,n,o,m),{positions:[t,r,n,f,m],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(r,n,o,f),p.lineSegmentPlane(r,t,o,m),{positions:[t,r,n,f,m],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(n,t,o,f),p.lineSegmentPlane(n,r,o,m),{positions:[t,r,n,f,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return p.lineSegmentPlane(r,t,o,f),p.lineSegmentPlane(n,t,o,m),{positions:[t,r,n,f,m],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(n,r,o,f),p.lineSegmentPlane(t,r,o,m),{positions:[t,r,n,f,m],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,n,o,f),p.lineSegmentPlane(r,n,o,m),{positions:[t,r,n,f,m],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},p}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(t,r){this.normal=e.clone(t),this.distance=r};return r.fromPointNormal=function(n,o,a){var i=-e.dot(o,n);return t(a)?(e.clone(o,a.normal),a.distance=i,a):new r(o,i)},r.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},r}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};return r.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,o=r.maximumIndex,a=e(r.cacheSize,24),i=n.length;if(!t(o)){o=0;for(var u=0,s=n[u];i>u;)s>o&&(o=s),++u,s=n[u]}for(var c=[],l=0;o+1>l;l++)c[l]=0;for(var f=a+1,m=0;i>m;++m)f-c[n[m]]>a&&(c[n[m]]=f,++f);return(f-a+1)/(i/3)},r.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var o=t[t.length-1];if(t.splice(t.length-1,1),e[o].numLiveTriangles>0)return o}for(;n>a;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}function o(e,t,r,o,a,i,u){for(var s,c=-1,l=-1,f=0;f<r.length;){var m=r[f];o[m].numLiveTriangles&&(s=0,a-o[m].timeStamp+2*o[m].numLiveTriangles<=t&&(s=a-o[m].timeStamp),(s>l||-1===l)&&(l=s,c=m)),++f}return-1===c?n(o,i,e,u):c}r=e(r,e.EMPTY_OBJECT);var a,i=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=i.length,l=0,f=0,m=i[f],h=c;if(t(u))l=u+1;else{for(;h>f;)m>l&&(l=m),++f,m=i[f];if(-1===l)return 0;++l}for(var d=[],p=0;l>p;p++)d[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var y=0;h>f;)d[i[f]].vertexTriangles.push(y),++d[i[f]].numLiveTriangles,d[i[f+1]].vertexTriangles.push(y),++d[i[f+1]].numLiveTriangles,d[i[f+2]].vertexTriangles.push(y),++d[i[f+2]].numLiveTriangles,++y,f+=3;var v=0,g=s+1;a=1;var E,S,C=[],w=[],A=0,x=[],b=c/3,T=[];for(p=0;b>p;p++)T[p]=!1;for(var M,R;-1!==v;){C=[],S=d[v],R=S.vertexTriangles.length;for(var O=0;R>O;++O)if(y=S.vertexTriangles[O],!T[y]){T[y]=!0,f=y+y+y;for(var I=0;3>I;++I)M=i[f],C.push(M),w.push(M),x[A]=M,++A,E=d[M],--E.numLiveTriangles,g-E.timeStamp>s&&(E.timeStamp=g,++g),++f}v=o(i,s,C,d,g,w,l)}return x},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,r,n,o,a,i,u,s,c,l,f,m,h,d,p,y,v,g,E,S,C,w,A,x){"use strict";function b(e,t,r,n,o){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=o,e[t++]=o,e[t]=r}function T(e){for(var t=e.length,r=6*(t/3),n=y.createTypedArray(t,r),o=0,a=0;t>a;a+=3,o+=6)b(n,o,e[a],e[a+1],e[a+2]);return n}function M(e){var t=e.length;if(t>=3){var r=6*(t-2),n=y.createTypedArray(t,r);b(n,0,e[0],e[1],e[2]);for(var o=6,a=3;t>a;++a,o+=6)b(n,o,e[a-1],e[a],e[a-2]);return n}return new Uint16Array}function R(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=y.createTypedArray(t,r),o=e[0],a=0,i=1;t>i;++i,a+=6)b(n,a,o,e[i],e[i+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 I(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var o=t[n],a=0;a<o.componentsPerAttribute;++a)e[n].values.push(o.values[r*o.componentsPerAttribute+a])}function N(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;n>a;a+=3)o.unpack(r,a,J),C.multiplyByPoint(e,J,J),o.pack(J,r,a)}function L(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;n>a;a+=3)o.unpack(r,a,J),S.multiplyByVector(e,J,J),J=o.normalize(J,J),o.pack(J,r,a)}function z(e){var t,r=e.length,n={},o=e[0].geometry.attributes;for(t in o)if(o.hasOwnProperty(t)&&c(o[t])&&c(o[t].values)){for(var a=o[t],i=a.values.length,s=!0,l=1;r>l;++l){var f=e[l].geometry.attributes[t];if(!c(f)||a.componentDatatype!==f.componentDatatype||a.componentsPerAttribute!==f.componentsPerAttribute||a.normalize!==f.normalize){s=!1;break}i+=f.values.length}s&&(n[t]=new d({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:u.createTypedArray(a.componentDatatype,i)}))}return n}function P(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function D(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,o=3;t>o;++o)r[n++]=o-1,r[n++]=0,r[n++]=o;return e.indices=r,e.primitiveType=A.TRIANGLES,e}function F(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,o=3;t-1>o;o+=2)r[n++]=o,r[n++]=o-1,r[n++]=o+1,t>o+2&&(r[n++]=o,r[n++]=o+1,r[n++]=o+2);return e.indices=r,e.primitiveType=A.TRIANGLES,e}function _(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function B(e){var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,o=2;t>o;++o)r[n++]=o-1,r[n++]=o;return e.indices=r,e.primitiveType=A.LINES,e}function U(e){var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,o=2;t>o;++o)r[n++]=o-1,r[n++]=o;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=A.LINES,e}function G(e){switch(e.primitiveType){case A.TRIANGLE_FAN:return D(e);case A.TRIANGLE_STRIP:return F(e);case A.TRIANGLES:return P(e);case A.LINE_STRIP:return B(e);case A.LINE_LOOP:return U(e);case A.LINES:return _(e)}return e}function q(e,t){Math.abs(e.y)<E.EPSILON11&&(e.y=t?-E.EPSILON11:E.EPSILON11)}function k(e,t,r,n){o.add(e,o.multiplyByScalar(o.subtract(t,e,ht),e.y/(e.y-t.y),ht),r),o.clone(r,n),q(r,!0),q(n,!1)}function W(e,t,r){if(e.x>=0||t.x>=0||r.x>=0)return void 0;var n=e.y<0,o=t.y<0,a=r.y<0;q(e,n),q(t,o),q(r,a);var i=0;i+=n?1:0,i+=o?1:0,i+=a?1:0;var u=gt.indices;1===i?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(k(e,t,dt,yt),k(e,r,pt,vt),u[0]=0,u[3]=1,u[4]=2,u[6]=1):o?(k(t,r,dt,yt),k(t,e,pt,vt),u[0]=1,u[3]=2,u[4]=0,u[6]=2):a&&(k(r,e,dt,yt),k(r,t,pt,vt),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===i&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?o?a||(k(r,e,dt,yt),k(r,t,pt,vt),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(k(t,r,dt,yt),k(t,e,pt,vt),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(k(e,t,dt,yt),k(e,r,pt,vt),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=gt.positions;return s[0]=e,s[1]=t,s[2]=r,gt.length=3,(1===i||2===i)&&(s[3]=dt,s[4]=pt,s[5]=yt,s[6]=vt,gt.length=7),gt}function V(e,r,a,i,u,s,l,f){if(c(u)||c(s)||c(l)||c(f)){var m,h,d,p,y,v,g,E,S,C,w,A,x=i.positions,b=x[0],T=x[1],M=x[2],R=Et,O=St,I=Ct,N=wt,L=At,z=xt;c(u)&&(m=o.fromArray(u,3*e),h=o.fromArray(u,3*r),d=o.fromArray(u,3*a)),c(s)&&(p=o.fromArray(s,3*e),y=o.fromArray(s,3*r),v=o.fromArray(s,3*a)),c(l)&&(g=o.fromArray(l,3*e),E=o.fromArray(l,3*r),S=o.fromArray(l,3*a)),c(f)&&(C=n.fromArray(f,2*e),w=n.fromArray(f,2*r),A=n.fromArray(f,2*a));for(var P=3;P<x.length;++P){var D=x[P],F=t(D,b,T,M);if(c(u)){R=o.multiplyByScalar(m,F.x,R),O=o.multiplyByScalar(h,F.y,O),I=o.multiplyByScalar(d,F.z,I);var _=o.add(R,O,bt);o.add(_,I,_),o.normalize(_,_),u.push(_.x,_.y,_.z)}if(c(s)){R=o.multiplyByScalar(p,F.x,R),O=o.multiplyByScalar(y,F.y,O),I=o.multiplyByScalar(v,F.z,I);var B=o.add(R,O,bt);o.add(B,I,B),o.normalize(B,B),s.push(B.x,B.y,B.z)}if(c(l)){R=o.multiplyByScalar(g,F.x,R),O=o.multiplyByScalar(E,F.y,O),I=o.multiplyByScalar(S,F.z,I);var U=o.add(R,O,bt);o.add(U,I,U),o.normalize(U,U),l.push(U.x,U.y,U.z)}if(c(f)){N=n.multiplyByScalar(C,F.x,N),L=n.multiplyByScalar(w,F.y,L),z=n.multiplyByScalar(A,F.z,z);var G=n.add(N,L,N);n.add(G,z,G),f.push(G.x,G.y)}}}}function Y(e){for(var t=e.attributes,r=t.position.values,n=c(t.normal)?t.normal.values:void 0,a=c(t.binormal)?t.binormal.values:void 0,i=c(t.tangent)?t.tangent.values:void 0,s=c(t.st)?t.st.values:void 0,l=e.indices,f=Array.prototype.slice.call(r,0),m=c(n)?Array.prototype.slice.call(n,0):void 0,d=c(a)?Array.prototype.slice.call(a,0):void 0,p=c(i)?Array.prototype.slice.call(i,0):void 0,v=c(s)?Array.prototype.slice.call(s,0):void 0,g=[],E=l.length,S=0;E>S;S+=3){var C=l[S],w=l[S+1],A=l[S+2],x=o.fromArray(r,3*C),b=o.fromArray(r,3*w),T=o.fromArray(r,3*A),M=W(x,b,T);if(c(M))if(f[3*C+1]=M.positions[0].y,f[3*w+1]=M.positions[1].y,f[3*A+1]=M.positions[2].y,M.length>3){for(var R=f.length/3,O=0;O<M.indices.length;++O){var I=M.indices[O];3>I?g.push(l[S+I]):g.push(I-3+R)}for(var N=3;N<M.positions.length;++N){var L=M.positions[N];f.push(L.x,L.y,L.z)}V(C,w,A,M,m,d,p,v)}else g.push(C,w,A);else g.push(C,w,A)}e.attributes.position.values=new Float64Array(f),c(m)&&(t.normal.values=u.createTypedArray(t.normal.componentDatatype,m)),c(d)&&(t.binormal.values=u.createTypedArray(t.binormal.componentDatatype,d)),c(p)&&(t.tangent.values=u.createTypedArray(t.tangent.componentDatatype,p)),c(v)&&(t.st.values=u.createTypedArray(t.st.componentDatatype,v));var z=h.computeNumberOfVertices(e);e.indices=y.createTypedArray(z,g)}function H(e){for(var t=e.attributes,r=t.position.values,n=e.indices,a=Array.prototype.slice.call(r,0),i=[],u=n.length,s=0;u>s;s+=2){var l=n[s],f=n[s+1],m=o.fromArray(r,3*l),d=o.fromArray(r,3*f);if(Math.abs(m.y)<E.EPSILON6&&(m.y=m.y<0?-E.EPSILON6:E.EPSILON6,a[3*l+1]=m.y),Math.abs(d.y)<E.EPSILON6&&(d.y=d.y<0?-E.EPSILON6:E.EPSILON6,a[3*f+1]=d.y),i.push(l),m.x<0||d.x<0){var p=g.lineSegmentPlane(m,d,Tt);if(c(p)){var v=o.multiplyByScalar(o.UNIT_Y,5*E.EPSILON9,Mt);m.y<0&&o.negate(v,v);var S=a.length/3;i.push(S,S+1);var C=o.add(p,v,Rt);a.push(C.x,C.y,C.z),o.negate(v,v),o.add(p,v,C),a.push(C.x,C.y,C.z)}}i.push(f)}e.attributes.position.values=new Float64Array(a);var w=h.computeNumberOfVertices(e);e.indices=y.createTypedArray(w,i)}function j(e){var t=e.attributes,r=t.position.values,i=c(t.st)?t.st.values:void 0,s=c(t.prevPosition)?t.prevPosition.values:void 0,l=c(t.nextPosition)?t.nextPosition.values:void 0,f=c(t.expandAndWidth)?t.expandAndWidth.values:void 0,m=c(t.color)?t.color.values:void 0;e.indices;for(var d=Array.prototype.slice.call(r,0),p=c(i)?Array.prototype.slice.call(i,0):void 0,v=c(s)?Array.prototype.slice.call(s,0):void 0,S=c(l)?Array.prototype.slice.call(l,0):void 0,C=c(f)?Array.prototype.slice.call(f,0):void 0,w=c(m)?Array.prototype.slice.call(m,0):void 0,A=[],x=d.length/3,b=0;x>b;b+=4){var T=b,M=b+1,R=b+2,O=o.fromArray(d,3*T,Nt),I=o.fromArray(d,3*M,Lt),N=o.fromArray(d,3*R,zt),L=o.equals(O,I);Math.abs(O.y)<E.EPSILON6&&(O.y=N.y<0?-E.EPSILON6:E.EPSILON6,d[3*T+1]=O.y),Math.abs(N.y)<E.EPSILON6&&(N.y=O.y<0?-E.EPSILON6:E.EPSILON6,d[3*R+1]=N.y),d[3*M+1]=I.y=L?O.y:N.y; -var z=!1;if(O.x<0||N.x<0){var P=g.lineSegmentPlane(O,N,Tt,Lt);if(c(P)){var D=o.multiplyByScalar(o.UNIT_Y,5*E.EPSILON9,Pt);O.y<0&&o.negate(D,D);var F=o.add(P,D,Dt);d.push(F.x,F.y,F.z),d.push(F.x,F.y,F.z),o.negate(D,D),o.add(P,D,F),d.push(F.x,F.y,F.z),d.push(F.x,F.y,F.z),v.push(O.x,O.y,O.z,O.x,O.y,O.z),v.push(O.x,O.y,O.z,O.x,O.y,O.z),S.push(N.x,N.y,N.z,N.x,N.y,N.z),S.push(N.x,N.y,N.z,N.x,N.y,N.z);var _=n.fromArray(C,2*T),B=Math.abs(_.y);C.push(-1,-B,1,-B),C.push(-1,B,1,B);var U=o.magnitudeSquared(o.subtract(P,O,Pt));if(U/=o.magnitudeSquared(o.subtract(N,O,Pt)),c(w)){var G=a.fromArray(w,4*T,Ft),q=a.fromArray(w,4*R,Ft),k=E.lerp(G.x,q.x,U),W=E.lerp(G.y,q.y,U),V=E.lerp(G.z,q.z,U),Y=E.lerp(G.w,q.w,U);w.push(k,W,V,Y),w.push(k,W,V,Y),w.push(k,W,V,Y),w.push(k,W,V,Y)}if(c(p)){var H=n.fromArray(p,2*T,Ot),j=n.fromArray(p,2*(b+3),It),K=E.lerp(H.x,j.x,U);p.push(K,H.y),p.push(K,j.y),p.push(K,H.y),p.push(K,j.y)}z=!0}}if(z){var Z=d.length/3-4;A.push(b,Z,b+1),A.push(b+1,Z,Z+1),A.push(Z+2,b+2,Z+3),A.push(Z+3,b+2,b+3)}else A.push(b,b+2,b+1),A.push(b+1,b+2,b+3)}t.position.values=new Float64Array(d),t.prevPosition.values=u.createTypedArray(t.prevPosition.componentDatatype,v),t.nextPosition.values=u.createTypedArray(t.nextPosition.componentDatatype,S),t.expandAndWidth.values=u.createTypedArray(t.expandAndWidth.componentDatatype,C),c(p)&&(t.st.values=u.createTypedArray(t.st.componentDatatype,p)),c(w)&&(t.color.values=u.createTypedArray(t.color.componentDatatype,w));var X=h.computeNumberOfVertices(e);e.indices=y.createTypedArray(X,A)}var K={};K.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case A.TRIANGLES:e.indices=T(t);break;case A.TRIANGLE_STRIP:e.indices=M(t);break;case A.TRIANGLE_FAN:e.indices=R(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=A.LINES}return e},K.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var o=e.attributes.position.values,a=e.attributes[t].values,i=o.length,l=new Float64Array(2*i),f=0,m=0;i>m;m+=3)l[f++]=o[m],l[f++]=o[m+1],l[f++]=o[m+2],l[f++]=o[m]+a[m]*n,l[f++]=o[m+1]+a[m+1]*n,l[f++]=o[m+2]+a[m+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:A.LINES,boundingSphere:p})},K.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],n=e.attributes,o={},a=0,i=r.length;for(t=0;i>t;++t){var u=r[t];c(n[u])&&(o[u]=a++)}for(var s in n)n.hasOwnProperty(s)&&!c(o[s])&&(o[s]=a++);return o},K.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),o=0;t>o;o++)n[o]=-1;for(var a,i=r,s=i.length,l=y.createTypedArray(t,s),f=0,m=0,d=0;s>f;)a=n[i[f]],-1!==a?l[m]=a:(a=i[f],n[a]=d,l[m]=d,++d),++f,++m;e.indices=l;var p=e.attributes;for(var v in p)if(p.hasOwnProperty(v)&&c(p[v])&&c(p[v].values)){for(var g=p[v],E=g.values,S=0,C=g.componentsPerAttribute,w=u.createTypedArray(g.componentDatatype,d*C);t>S;){var A=n[S];if(-1!==A)for(o=0;C>o;o++)w[C*A+o]=E[C*S+o];++S}g.values=w}}return e},K.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===A.TRIANGLES&&c(r)){for(var n=r.length,o=0,a=0;n>a;a++)r[a]>o&&(o=r[a]);e.indices=x.tipsify({indices:r,maximumIndex:o,cacheSize:t})}return e},K.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>E.SIXTY_FOUR_KILOBYTES){var n,o=[],a=[],i=0,u=O(e.attributes),s=e.indices,l=s.length;e.primitiveType===A.TRIANGLES?n=3:e.primitiveType===A.LINES?n=2:e.primitiveType===A.POINTS&&(n=1);for(var f=0;l>f;f+=n){for(var m=0;n>m;++m){var d=s[f+m],p=o[d];c(p)||(p=i++,o[d]=p,I(u,e.attributes,d)),a.push(p)}i+n>E.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere})),o=[],a=[],i=0,u=O(e.attributes))}0!==a.length&&t.push(new h({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere}))}else t.push(e);return t};var Z=new o,X=new i;K.projectTo2D=function(e,t,r,n,a){var i=e.attributes[t];a=c(a)?a:new m;for(var s=a.ellipsoid,f=i.values,h=new Float64Array(f.length),p=0,y=0;y<f.length;y+=3){var v=o.fromArray(f,y,Z),g=s.cartesianToCartographic(v,X);if(!c(g))throw new l("Could not project point ("+v.x+", "+v.y+", "+v.z+") to 2D.");var E=a.project(g,Z);h[p++]=E.x,h[p++]=E.y,h[p++]=E.z}return e.attributes[r]=i,e.attributes[n]=new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:h}),delete e.attributes[t],e};var Q={high:0,low:0};K.encodeAttribute=function(e,t,r,n){for(var o=e.attributes[t],a=o.values,i=a.length,s=new Float32Array(i),c=new Float32Array(i),l=0;i>l;++l)f.encode(a[l],Q),s[l]=Q.high,c[l]=Q.low;var m=o.componentsPerAttribute;return e.attributes[r]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:m,values:s}),e.attributes[n]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:m,values:c}),delete e.attributes[t],e};var J=new o,$=new C,et=new S;K.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(C.equals(t,C.IDENTITY))return e;var n=e.geometry.attributes;N(t,n.position),N(t,n.prevPosition),N(t,n.nextPosition),(c(n.normal)||c(n.binormal)||c(n.tangent))&&(C.inverse(t,$),C.transpose($,$),C.getRotation($,et),L(et,n.normal),L(et,n.binormal),L(et,n.tangent));var o=e.geometry.boundingSphere;return c(o)&&(e.geometry.boundingSphere=r.transform(o,t,o)),e.modelMatrix=C.clone(C.IDENTITY),e};var tt=new o;K.combine=function(e){var t,n,a,i,u=e.length;e[0].modelMatrix;var s,l,f,m=c(e[0].geometry.indices),d=e[0].geometry.primitiveType,p=z(e);for(t in p)if(p.hasOwnProperty(t))for(s=p[t].values,i=0,n=0;u>n;++n)for(l=e[n].geometry.attributes[t].values,f=l.length,a=0;f>a;++a)s[i++]=l[a];var v;if(m){var g=0;for(n=0;u>n;++n)g+=e[n].geometry.indices.length;var E=h.computeNumberOfVertices(new h({attributes:p,primitiveType:A.POINTS})),S=y.createTypedArray(E,g),C=0,w=0;for(n=0;u>n;++n){var x=e[n].geometry.indices,b=x.length;for(i=0;b>i;++i)S[C++]=w+x[i];w+=h.computeNumberOfVertices(e[n].geometry)}v=S}var T,M=new o,R=0;for(n=0;u>n;++n){if(T=e[n].geometry.boundingSphere,!c(T)){M=void 0;break}o.add(T.center,M,M)}if(c(M))for(o.divideByScalar(M,u,M),n=0;u>n;++n){T=e[n].geometry.boundingSphere;var O=o.magnitude(o.subtract(T.center,M,tt))+T.radius;O>R&&(R=O)}return new h({attributes:p,indices:v,primitiveType:d,boundingSphere:c(M)?new r(M,R):void 0})};var rt=new o,nt=new o,ot=new o,at=new o;K.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,a=r.position.values.length/3,i=t.length,s=new Array(a),c=new Array(i/3),l=new Array(i),f=0;a>f;f++)s[f]={indexOffset:0,count:0,currentCount:0};var m=0;for(f=0;i>f;f+=3){var h=t[f],p=t[f+1],y=t[f+2],v=3*h,g=3*p,E=3*y;nt.x=n[v],nt.y=n[v+1],nt.z=n[v+2],ot.x=n[g],ot.y=n[g+1],ot.z=n[g+2],at.x=n[E],at.y=n[E+1],at.z=n[E+2],s[h].count++,s[p].count++,s[y].count++,o.subtract(ot,nt,ot),o.subtract(at,nt,at),c[m]=o.cross(ot,at,new o),m++}var S=0;for(f=0;a>f;f++)s[f].indexOffset+=S,S+=s[f].count;m=0;var C;for(f=0;i>f;f+=3){C=s[t[f]];var w=C.indexOffset+C.currentCount;l[w]=m,C.currentCount++,C=s[t[f+1]],w=C.indexOffset+C.currentCount,l[w]=m,C.currentCount++,C=s[t[f+2]],w=C.indexOffset+C.currentCount,l[w]=m,C.currentCount++,m++}var A=new Float32Array(3*a);for(f=0;a>f;f++){var x=3*f;if(C=s[f],C.count>0){for(o.clone(o.ZERO,rt),m=0;m<C.count;m++)o.add(rt,c[l[C.indexOffset+m]],rt);o.normalize(rt,rt),A[x]=rt.x,A[x+1]=rt.y,A[x+2]=rt.z}else A[x]=0,A[x+1]=0,A[x+2]=1}return e.attributes.normal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:A}),e};var it=new o,ut=new o,st=new o;K.computeBinormalAndTangent=function(e){e.attributes;for(var t=e.indices,r=e.attributes.position.values,n=e.attributes.normal.values,a=e.attributes.st.values,i=e.attributes.position.values.length/3,s=t.length,c=new Array(3*i),l=0;l<c.length;l++)c[l]=0;var f,m,h;for(l=0;s>l;l+=3){var p=t[l],y=t[l+1],v=t[l+2];f=3*p,m=3*y,h=3*v;var g=2*p,E=2*y,S=2*v,C=r[f],w=r[f+1],A=r[f+2],x=a[g],b=a[g+1],T=a[E+1]-b,M=a[S+1]-b,R=1/((a[E]-x)*M-(a[S]-x)*T),O=(M*(r[m]-C)-T*(r[h]-C))*R,I=(M*(r[m+1]-w)-T*(r[h+1]-w))*R,N=(M*(r[m+2]-A)-T*(r[h+2]-A))*R;c[f]+=O,c[f+1]+=I,c[f+2]+=N,c[m]+=O,c[m+1]+=I,c[m+2]+=N,c[h]+=O,c[h+1]+=I,c[h+2]+=N}var L=new Float32Array(3*i),z=new Float32Array(3*i);for(l=0;i>l;l++){f=3*l,m=f+1,h=f+2;var P=o.fromArray(n,f,it),D=o.fromArray(c,f,st),F=o.dot(P,D);o.multiplyByScalar(P,F,ut),o.normalize(o.subtract(D,ut,D),D),z[f]=D.x,z[m]=D.y,z[h]=D.z,o.normalize(o.cross(P,D,D),D),L[f]=D.x,L[m]=D.y,L[h]=D.z}return e.attributes.tangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:z}),e.attributes.binormal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e};var ct=new n,lt=new o,ft=new o,mt=new o;K.compressVertices=function(t){var r=t.attributes.normal,a=t.attributes.st;if(!c(r)&&!c(a))return t;var i,s,l,f,m=t.attributes.tangent,h=t.attributes.binormal;c(r)&&(i=r.values),c(a)&&(s=a.values),c(m)&&(l=m.values),h&&(f=h.values);var p=c(i)?i.length:s.length,y=c(i)?3:2,v=p/y,g=v,E=c(s)&&c(i)?2:1;E+=c(l)||c(f)?1:0,g*=E;for(var S=new Float32Array(g),C=0,w=0;v>w;++w){c(s)&&(n.fromArray(s,2*w,ct),S[C++]=e.compressTextureCoordinates(ct));var A=3*w;c(i)&&c(l)&&c(f)?(o.fromArray(i,A,lt),o.fromArray(l,A,ft),o.fromArray(f,A,mt),e.octPack(lt,ft,mt,ct),S[C++]=ct.x,S[C++]=ct.y):(c(i)&&(o.fromArray(i,A,lt),S[C++]=e.octEncodeFloat(lt)),c(l)&&(o.fromArray(l,A,lt),S[C++]=e.octEncodeFloat(lt)),c(f)&&(o.fromArray(f,A,lt),S[C++]=e.octEncodeFloat(lt)))}return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:E,values:S}),c(i)&&delete t.attributes.normal,c(s)&&delete t.attributes.st,c(l)&&delete t.attributes.tangent,c(f)&&delete t.attributes.binormal,t};var ht=new o,dt=new o,pt=new o,yt=new o,vt=new o,gt={positions:new Array(7),indices:new Array(9)},Et=new o,St=new o,Ct=new o,wt=new n,At=new n,xt=new n,bt=new o,Tt=w.fromPointNormal(o.ZERO,o.UNIT_Y),Mt=new o,Rt=new o,Ot=new n,It=new n,Nt=new o,Lt=new o,zt=new o,Pt=new o,Dt=new o,Ft=new a;return new a,K.wrapLongitude=function(e){var t=e.boundingSphere;if(c(t)){var n=t.center.x-t.radius;if(n>0||r.intersect(t,a.UNIT_Y)!==v.INTERSECTING)return e}if(e.geometryType!==p.NONE)switch(e.geometryType){case p.POLYLINES:j(e);break;case p.TRIANGLES:Y(e);break;case p.LINES:H(e)}else G(e),e.primitiveType===A.TRIANGLES?Y(e):e.primitiveType===A.LINES&&H(e);return e},K}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,o,a,i,u){"use strict";var s=function(e){this._ellipsoid=r(e,i.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return o(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.mercatorAngleToGeodeticLatitude=function(e){return u.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},s.geodeticLatitudeToMercatorAngle=function(e){e>s.MaximumLatitude?e=s.MaximumLatitude:e<-s.MaximumLatitude&&(e=-s.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI),s.prototype.project=function(t,r){var o=this._semimajorAxis,a=t.longitude*o,i=s.geodeticLatitudeToMercatorAngle(t.latitude)*o,u=t.height;return n(r)?(r.x=a,r.y=i,r.z=u,r):new e(a,i,u)},s.prototype.unproject=function(e,r){var o=this._oneOverSemimajorAxis,a=e.x*o,i=s.mercatorAngleToGeodeticLatitude(e.y*o),u=e.z;return n(r)?(r.longitude=a,r.latitude=i,r.height=u,r):new t(a,i,u)},s}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,n,o,a,i,u,s,c,l,f,m,h,d){"use strict";function p(e,t,r){var n,o=!r,a=e.length;if(!o&&a>1){var i=e[0].modelMatrix;for(n=1;a>n;++n)if(!h.equals(i,e[n].modelMatrix)){o=!0;break}}if(o)for(n=0;a>n;++n)f.transformToWorldCoordinates(e[n]);else h.clone(e[0].modelMatrix,t)}function y(e,n){for(var o=e.length,a=0;o>a;++a){var i=e[a],u=i.geometry,s=u.attributes,c=s.position,f=4*(c.values.length/c.componentsPerAttribute);s.pickColor=new l({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0,values:new Uint8Array(f)});for(var m=n[a],h=t.floatToByte(m.red),d=t.floatToByte(m.green),p=t.floatToByte(m.blue),y=t.floatToByte(m.alpha),v=s.pickColor.values,g=0;f>g;g+=4)v[g]=h,v[g+1]=d,v[g+2]=p,v[g+3]=y}}function v(e){var t,r=e.length,n=[],a=e[0].attributes;for(t in a)if(a.hasOwnProperty(t)){for(var i=a[t],u=!0,s=1;r>s;++s){var c=e[s].attributes[t];if(!o(c)||i.componentDatatype!==c.componentDatatype||i.componentsPerAttribute!==c.componentsPerAttribute||i.normalize!==c.normalize){u=!1;break}}u&&n.push(t)}return n}function g(e,t){for(var n=e.length,o=0;n>o;++o)for(var a=e[o],i=a.attributes,u=a.geometry,s=c.computeNumberOfVertices(u),f=t.length,m=0;f>m;++m){for(var h=t[m],d=i[h],p=d.componentDatatype,y=d.value,v=y.length,g=r.createTypedArray(p,s*v),E=0;s>E;++E)g.set(y,E*v);u.attributes[h]=new l({componentDatatype:p,componentsPerAttribute:v,normalize:d.normalize,values:g})}}function E(e){var t,n=e.instances,o=e.pickIds,a=e.projection,i=e.elementIndexUintSupported,u=e.scene3DOnly,s=e.allowPicking,c=e.vertexCacheOptimize,l=e.compressVertices,m=e.modelMatrix,h=n.length;if(n[0].geometry.primitiveType,p(n,m,u),!u)for(t=0;h>t;++t)f.wrapLongitude(n[t].geometry);s&&y(n,o);var d=v(n);if(g(n,d),c)for(t=0;h>t;++t)f.reorderForPostVertexCache(n[t].geometry),f.reorderForPreVertexCache(n[t].geometry);var E,S=f.combine(n),C=S.attributes;if(u)for(E in C)C.hasOwnProperty(E)&&C[E].componentDatatype===r.DOUBLE&&f.encodeAttribute(S,E,E+"3DHigh",E+"3DLow");else for(E in C)if(C.hasOwnProperty(E)&&C[E].componentDatatype===r.DOUBLE){var w=E+"3D",A=E+"2D";f.projectTo2D(S,E,w,A,a),f.encodeAttribute(S,w,w+"High",w+"Low"),f.encodeAttribute(S,A,A+"High",A+"Low")}return l&&f.compressVertices(S),i?[S]:f.fitToUnsignedShortIndices(S)}function S(e,t,n){for(var o=[],a=e.attributes,i=n.length,u=0;i>u;++u){var s=n[u],c=a[s],l=c.componentDatatype;l===r.DOUBLE&&(l=r.FLOAT);var f=r.createTypedArray(l,c.values);o.push({index:t[s],componentDatatype:l,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,values:f}),delete a[s]}return o}function C(e,t,r){for(var a=[],i=v(e),u=e.length,s={},l={},f=0;u>f;++f)for(var m=e[f],h=c.computeNumberOfVertices(m.geometry),d=i.length,p=0;d>p;++p)for(var y=i[p],g=r[y],E=h;E>0;){for(var S,C=n(l[y],0),w=t[C],A=w.length,x=0;A>x&&(S=w[x],S.index!==g);++x);o(a[f])||(a[f]={}),o(a[f][y])||(a[f][y]={dirty:!1,value:m.attributes[y].value,indices:[]});var b,T=S.values.length/S.componentsPerAttribute,M=n(s[y],0);T>M+E?(b=E,a[f][y].indices.push({attribute:S,offset:M,count:b}),s[y]=M+E):(b=T-M,a[f][y].indices.push({attribute:S,offset:M,count:b}),s[y]=0,l[y]=C+1),E-=b}return a}function w(e,t){var r=e.attributes;for(var n in r)if(r.hasOwnProperty(n)){var a=r[n];o(a)&&o(a.values)&&t.push(a.values.buffer)}o(e.indices)&&t.push(e.indices.buffer)}function A(e,t){for(var r=e.length,n=0;r>n;++n)w(e[n],t)}function x(e,t){for(var r=e.length,n=0;r>n;++n)for(var o=e[n],a=o.length,i=0;a>i;++i)t.push(o[i].values.buffer)}function b(t){for(var r=1,n=t.length,a=0;n>a;a++){var i=t[a],u=i.attributes;r+=4+e.packedLength+(o(i.indices)?i.indices.length:0);for(var s in u)if(u.hasOwnProperty(s)&&o(u[s])){var c=u[s];r+=5+c.values.length}}return r}function T(e,t){for(var r=e.length,n=new Uint32Array(e.length),o=0;r>o;++o)n[o]=e[o].toRgba();return t.push(n.buffer),n}function M(e){for(var r=e.length,n=new Array(r),o=0;r>o;o++)n[o]=t.fromRgba(e[o]);return n}function R(e){for(var t=e.length,r=1+17*t,n=0;t>n;n++){var a=e[n].attributes;for(var i in a)if(a.hasOwnProperty(i)&&o(a[i])){var u=a[i];r+=5+u.value.length}}return r}function O(e,t){var r=new Float64Array(R(e)),n={},a=[],i=e.length,u=0;r[u++]=i;for(var s=0;i>s;s++){var c=e[s];h.pack(c.modelMatrix,r,u),u+=h.packedLength;var l=c.attributes,f=[];for(var m in l)l.hasOwnProperty(m)&&o(l[m])&&(f.push(m),o(n[m])||(n[m]=a.length,a.push(m)));r[u++]=f.length;for(var d=0;d<f.length;d++){var p=f[d],y=l[p];r[u++]=n[p],r[u++]=y.componentDatatype,r[u++]=y.componentsPerAttribute,r[u++]=y.normalize,r[u++]=y.value.length,r.set(y.value,u),u+=y.value.length}}return t.push(r.buffer),{stringTable:a,packedData:r}}function I(e){for(var t=e.packedData,n=e.stringTable,o=new Array(t[0]),a=0,i=1;i<t.length;){var u=h.unpack(t,i);i+=h.packedLength;for(var s={},c=t[i++],l=0;c>l;l++){for(var f=n[t[i++]],m=t[i++],d=t[i++],p=0!==t[i++],y=t[i++],v=r.createTypedArray(m,y),g=0;y>g;g++)v[g]=t[i++];s[f]={componentDatatype:m,componentsPerAttribute:d,normalize:p,value:v}}o[a++]={attributes:s,modelMatrix:u}}return o}function N(e){for(var t=e.length,r=1+t,n=0;t>n;n++){var a=e[n];for(var i in a)if(a.hasOwnProperty(i)&&o(a[i])){var u=a[i];r+=3+3*u.indices.length+u.value.length}}return r}function L(e,t){var r=new Float64Array(N(e)),n=[],a=[],i={},u=e.length,s=0;r[s++]=u;for(var c=0;u>c;c++){var l=e[c],f=[];for(var m in l)l.hasOwnProperty(m)&&o(l[m])&&(f.push(m),o(i[m])||(i[m]=n.length,n.push(m)));r[s++]=f.length;for(var h=0;h<f.length;h++){var d=f[h],p=l[d];r[s++]=i[d];var y=p.indices,v=y.length;r[s++]=v;for(var g=0;v>g;g++){var E=y[g];r[s++]=E.count,r[s++]=E.offset;var S=a.indexOf(E.attribute);-1===S&&(S=a.length,a.push(E.attribute)),r[s++]=S}r[s++]=p.value.length,r.set(p.value,s),s+=p.value.length}}return t.push(r.buffer),{stringTable:n,packedData:r,attributeTable:a}}function z(e){for(var t=e.stringTable,n=e.attributeTable,o=e.packedData,a=new Array(o[0]),i=0,u=1,s=o.length;s>u;){for(var c={},l=o[u++],f=0;l>f;f++){for(var m=t[o[u++]],h=new Array(o[u++]),d=0;d<h.length;d++){var p={};p.count=o[u++],p.offset=o[u++],p.attribute=n[o[u++]],h[d]=p}for(var y=o[u++],v=r.createTypedArray(h[0].attribute.componentDatatype,y),g=0;y>g;g++)v[g]=o[u++];c[m]={dirty:!1,indices:h,value:v}}a[i++]=c}return a}if(!u.supportsTypedArrays())return{};var P={};return P.combineGeometry=function(e){for(var t=E(e),r=f.createAttributeLocations(t[0]),n=e.instances,o=v(n),a=[],i=t.length,u=0;i>u;++u){var s=t[u];a.push(S(s,r,o))}var c=C(n,a,r);return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:r,vaAttributes:a,vaAttributeLocations:c}},P.packCreateGeometryResults=function(t,r){var n=new Float64Array(b(t)),a=[],i={},u=t.length,s=0;n[s++]=u;for(var c=0;u>c;c++){var l=t[c];n[s++]=l.primitiveType,n[s++]=l.geometryType,e.pack(l.boundingSphere,n,s),s+=e.packedLength;var f=l.attributes,m=[];for(var h in f)f.hasOwnProperty(h)&&o(f[h])&&(m.push(h),o(i[h])||(i[h]=a.length,a.push(h)));n[s++]=m.length;for(var d=0;d<m.length;d++){var p=m[d],y=f[p];n[s++]=i[p],n[s++]=y.componentDatatype,n[s++]=y.componentsPerAttribute,n[s++]=y.normalize?1:0,n[s++]=y.values.length,n.set(y.values,s),s+=y.values.length}var v=o(l.indices)?l.indices.length:0;n[s++]=v,v>0&&(n.set(l.indices,s),s+=v)}return r.push(n.buffer),{stringTable:a,packedData:n}},P.unpackCreateGeometryResults=function(t){for(var n,o=t.stringTable,a=t.packedData,i=new Array(a[0]),u=0,s=1;s<a.length;){var f=a[s++],h=a[s++],d=e.unpack(a,s);s+=e.packedLength;var p,y,v,g={},E=a[s++];for(n=0;E>n;n++){var S=o[a[s++]],C=a[s++];v=a[s++];var w=0!==a[s++];p=a[s++],y=r.createTypedArray(C,p);for(var A=0;p>A;A++)y[A]=a[s++];g[S]=new l({componentDatatype:C,componentsPerAttribute:v,normalize:w,values:y})}var x;if(p=a[s++],p>0){var b=y.length/v;for(x=m.createTypedArray(b,p),n=0;p>n;n++)x[n]=a[s++]}i[u++]=new c({primitiveType:f,geometryType:h,boundingSphere:d,indices:x,attributes:g})}return i},P.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,n=r.length,o=0;n>o;o++)t.push(r[o].packedData.buffer);var a;return e.allowPicking&&(a=T(e.pickIds,t)),{createGeometryResults:e.createGeometryResults,packedInstances:O(e.instances,t),packedPickIds:a,ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix}},P.unpackCombineGeometryParameters=function(e){for(var t=I(e.packedInstances),r=e.allowPicking?M(e.packedPickIds):void 0,n=e.createGeometryResults,o=n.length,a=0,u=0;o>u;u++)for(var c=P.unpackCreateGeometryResults(n[u]),l=c.length,f=0;l>f;f++)t[a++].geometry=c[f];var m=i.clone(e.ellipsoid),p=e.isGeographic?new s(m):new d(m);return{instances:t,pickIds:r,ellipsoid:m,projection:p,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:h.clone(e.modelMatrix)}},P.packCombineGeometryResults=function(e,t){return A(e.geometries,t),x(e.vaAttributes,t),{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,packedVaAttributeLocations:L(e.vaAttributeLocations,t),modelMatrix:e.modelMatrix}},P.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,perInstanceAttributeLocations:z(e.packedVaAttributeLocations,e.vaAttributes),modelMatrix:e.modelMatrix}},P}),define("Core/formatError",["./defined"],function(e){"use strict";var t=function(t){var r,n=t.name,o=t.message;r=e(n)&&e(o)?n+": "+o:t.toString();var a=t.stack;return e(a)&&(r+="\n"+a),r};return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";var n=function(n){var o,a=[],i={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;a.length=0,i.id=s.id,i.error=void 0,i.result=void 0;try{i.result=n(s.parameters,a)}catch(c){i.error=c instanceof Error?{name:c.name,message:c.message,stack:c.stack}:c}t(o)||(o=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(a.length=0);try{o(i,a)}catch(c){i.result=void 0,i.error="postMessage failed with error: "+r(c)+"\n with responseMessage: "+JSON.stringify(i),o(i)}}};return n}),define("Workers/combineGeometry",["../Scene/PrimitivePipeline","./createTaskProcessorWorker"],function(e,t){"use strict";function r(t,r){var n=e.unpackCombineGeometryParameters(t),o=e.combineGeometry(n);return e.packCombineGeometryResults(o,r)}return t(r)})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";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(r){t=r.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=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 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(e){return e>0?1:0>e?-1:0},o.signNotZero=function(e){return 0>e?-1:1},o.toSNorm=function(e){return Math.round(255*(.5*o.clamp(e,-1,1)+.5))},o.fromSNorm=function(e){return o.clamp(e,0,255)/255*2-1},o.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},o.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},o.lerp=function(e,t,r){return(1-r)*e+r*t},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(e){return e*o.RADIANS_PER_DEGREE},o.toDegrees=function(e){return e*o.DEGREES_PER_RADIAN},o.convertLongitudeRange=function(e){var t=o.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},o.negativePiToPi=function(e){return o.zeroToTwoPi(e+o.PI)-o.PI},o.zeroToTwoPi=function(e){var t=o.mod(e,o.TWO_PI);return Math.abs(t)<o.EPSILON14&&Math.abs(e)>o.EPSILON14?o.TWO_PI:t},o.mod=function(e,t){return(e%t+t)%t},o.equalsEpsilon=function(e,r,n,o){o=t(o,n);var i=Math.abs(e-r);return o>=i||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];o.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;e>=n;n++)i.push(r*n);return i[e]},o.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},o.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},o.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},o.clamp=function(e,t,r){return t>e?t:e>r?r:e};var a=new e;return o.setRandomNumberSeed=function(t){a=new e(t)},o.nextRandomNumber=function(){return a.random()},o.acosClamped=function(e){return Math.acos(o.clamp(e,-1,1))},o.asinClamped=function(e){return Math.asin(o.clamp(e,-1,1))},o.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},o.logBase=function(e,t){return Math.log(e)/Math.log(t)},o.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},o}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,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(r,n){t(n)||(n=new i);var o=r.clock,a=r.cone,s=e(r.magnitude,1),u=s*Math.sin(a);return n.x=u*Math.cos(o),n.y=u*Math.sin(o),n.z=s*Math.cos(a),n},i.fromElements=function(e,r,n,o){return t(o)?(o.x=e,o.y=r,o.z=n,o):new i(e,r,n)},i.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z},i.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new i),o.x=r[n++],o.y=r[n++],o.z=r[n],o},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 a=new i;i.distance=function(e,t){return i.subtract(e,t,a),i.magnitude(a)},i.distanceSquared=function(e,t){return i.subtract(e,t,a),i.magnitudeSquared(a)},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.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 u=new i,c=new i;i.angleBetween=function(e,t){i.normalize(e,u),i.normalize(t,c);var r=i.dot(u,c),n=i.magnitude(i.cross(u,c,u));return Math.atan2(n,r)};var l=new i;i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);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,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.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,r,n,i){return e===r||t(e)&&t(r)&&o.equalsEpsilon(e.x,r.x,n,i)&&o.equalsEpsilon(e.y,r.y,n,i)&&o.equalsEpsilon(e.z,r.z,n,i)},i.cross=function(e,t,r){var n=e.x,o=e.y,i=e.z,a=t.x,s=t.y,u=t.z,c=o*u-i*s,l=i*a-n*u,E=n*s-o*a;return r.x=c,r.y=l,r.z=E,r},i.fromDegrees=function(e,t,r,n,a){var s=o.toRadians(e),u=o.toRadians(t);return i.fromRadians(s,u,r,n,a)};var E=new i,f=new i,m=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(r,n,o,a,s){o=e(o,0);var u=t(a)?a.radiiSquared:m,c=Math.cos(n);E.x=c*Math.cos(r),E.y=c*Math.sin(r),E.z=Math.sin(n),E=i.normalize(E,E),i.multiplyComponents(u,E,f);var l=Math.sqrt(i.dot(E,f));return f=i.divideByScalar(f,l,f),E=i.multiplyByScalar(E,o,E),t(s)||(s=new i),i.add(f,E,s)},i.fromDegreesArray=function(e,t,r){for(var n=new Array(e.length),a=0;a<e.length;a++)n[a]=o.toRadians(e[a]);return i.fromRadiansArray(n,t,r)},i.fromRadiansArray=function(e,r,n){var o=e.length;t(n)?n.length=o/2:n=new Array(o/2);for(var a=0;o>a;a+=2){var s=e[a],u=e[a+1];n[a/2]=i.fromRadians(s,u,0,r,n[a/2])}return n},i.fromDegreesArrayHeights=function(e,t,r){for(var n=new Array(e.length),a=0;a<e.length;a+=3)n[a]=o.toRadians(e[a]),n[a+1]=o.toRadians(e[a+1]),n[a+2]=e[a+2];return i.fromRadiansArrayHeights(n,t,r)},i.fromRadiansArrayHeights=function(e,r,n){var o=e.length;t(n)?n.length=o/3:n=new Array(o/3);for(var a=0;o>a;a+=3){var s=e[a],u=e[a+1],c=e[a+2];n[a/3]=i.fromRadians(s,u,c,r,n[a/3])}return n},i.ZERO=n(new i(0,0,0)),i.UNIT_X=n(new i(1,0,0)),i.UNIT_Y=n(new i(0,1,0)),i.UNIT_Z=n(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 o(r,o,s,u,c){var l=r.x,E=r.y,f=r.z,m=o.x,h=o.y,d=o.z,p=l*l*m*m,R=E*E*h*h,T=f*f*d*d,A=p+R+T,_=Math.sqrt(1/A),y=e.multiplyByScalar(r,_,i);if(u>A)return isFinite(_)?e.clone(y,c):void 0;var S=s.x,v=s.y,C=s.z,N=a;N.x=y.x*S*2,N.y=y.y*v*2,N.z=y.z*C*2;var g,I,O,M,L,F,P,w,D,b,x,U=(1-_)*e.magnitude(r)/(.5*e.magnitude(N)),B=0;do{U-=B,O=1/(1+U*S),M=1/(1+U*v),L=1/(1+U*C),F=O*O,P=M*M,w=L*L,D=F*O,b=P*M,x=w*L,g=p*F+R*P+T*w-1,I=p*D*S+R*b*v+T*x*C;var G=-2*I;B=g/G}while(Math.abs(g)>n.EPSILON12);return t(c)?(c.x=l*O,c.y=E*M,c.z=f*L,c):new e(l*O,E*M,f*L)}var i=new e,a=new e;return o}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,o,i,a){"use strict";function s(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}s.fromRadians=function(e,n,o,i){return o=t(o,0),r(i)?(i.longitude=e,i.latitude=n,i.height=o,i):new s(e,n,o)},s.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),s.fromRadians(e,t,r,n)};var u=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),m=i.EPSILON1;return s.fromCartesian=function(t,n,o){var h=r(n)?n.oneOverRadii:E,d=r(n)?n.oneOverRadiiSquared:f,p=r(n)?n._centerToleranceSquared:m,R=a(t,h,d,p,c);if(r(R)){var T=e.multiplyComponents(t,d,u);T=e.normalize(T,T);var A=e.subtract(t,R,l),_=Math.atan2(T.y,T.x),y=Math.asin(T.z),S=i.sign(e.dot(A,t))*e.magnitude(A);return r(o)?(o.longitude=_,o.latitude=y,o.height=S,o):new s(_,y,S)}},s.clone=function(e,t){return r(e)?r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new s(e.longitude,e.latitude,e.height):void 0},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},s.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},s.ZERO=o(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}),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,o,i,a,s,u){"use strict";function c(t,n,o,i){n=r(n,0),o=r(o,0),i=r(i,0),t._radii=new e(n,o,i),t._radiiSquared=new e(n*n,o*o,i*i),t._radiiToTheFourth=new e(n*n*n*n,o*o*o*o,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===o?0:1/o,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===o?0:1/(o*o),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,o,i),t._maximumRadius=Math.max(n,o,i),t._centerToleranceSquared=s.EPSILON1}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,c(this,e,t,r)}o(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 o=t._radii;return n(r)?(e.clone(o,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new l(o.x,o.y,o.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=a(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=a(new l(1,1,1)),l.MOON=a(new l(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,o){o=r(o,0),e.pack(t._radii,n,o)},l.unpack=function(t,n,o){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,o)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var o=t.longitude,i=t.latitude,a=Math.cos(i),s=a*Math.cos(o),u=a*Math.sin(o),c=Math.sin(i);return n(r)||(r=new e),r.x=s,r.y=u,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 o=E,i=f;this.geodeticSurfaceNormalCartographic(t,o),e.multiplyComponents(this._radiiSquared,o,i);var a=Math.sqrt(e.dot(o,i));return e.divideByScalar(i,a,i),e.multiplyByScalar(o,t.height,o),n(r)||(r=new e),e.add(i,o,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var o=0;r>o;o++)t[o]=this.cartographicToCartesian(e[o],t[o]);return t};var m=new e,h=new e,d=new e;return l.prototype.cartesianToCartographic=function(r,o){var i=this.scaleToGeodeticSurface(r,h);if(n(i)){var a=this.geodeticSurfaceNormal(i,m),u=e.subtract(r,i,d),c=Math.atan2(a.y,a.x),l=Math.asin(a.z),E=s.sign(e.dot(u,r))*e.magnitude(u);return n(o)?(o.longitude=c,o.latitude=l,o.height=E,o):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 o=0;r>o;++o)t[o]=this.cartesianToCartographic(e[o],t[o]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return u(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var o=t.x,i=t.y,a=t.z,s=this._oneOverRadiiSquared,u=1/Math.sqrt(o*o*s.x+i*i*s.y+a*a*s.z);return e.multiplyByScalar(t,u,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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,o,i,a){"use strict";function s(e){this._ellipsoid=r(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return o(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.prototype.project=function(t,r){var o=this._semimajorAxis,i=t.longitude*o,a=t.latitude*o,s=t.height;return n(r)?(r.x=i,r.y=a,r.z=s,r):new e(i,a,s)},s.prototype.unproject=function(e,r){var o=this._oneOverSemimajorAxis,i=e.x*o,a=e.y*o,s=e.z;return n(r)?(r.longitude=i,r.latitude=a,r.height=s,r):new t(i,a,s)},s}),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","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o,i){"use strict";function a(e,r,n,o,i,a,s,u,c){this[0]=t(e,0),this[1]=t(o,0),this[2]=t(s,0),this[3]=t(r,0),this[4]=t(i,0),this[5]=t(u,0),this[6]=t(n,0),this[7]=t(a,0),this[8]=t(c,0)}function s(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function u(e){for(var t=0,r=0;3>r;++r){var n=e[a.getElementIndex(m[r],f[r])];t+=2*n*n}return Math.sqrt(t)}function c(e,t){for(var r=i.EPSILON15,n=0,o=1,s=0;3>s;++s){var u=Math.abs(e[a.getElementIndex(m[s],f[s])]);u>n&&(o=s,n=u)}var c=1,l=0,E=f[o],h=m[o];if(Math.abs(e[a.getElementIndex(h,E)])>r){var d,p=e[a.getElementIndex(h,h)],R=e[a.getElementIndex(E,E)],T=e[a.getElementIndex(h,E)],A=(p-R)/2/T;d=0>A?-1/(-A+Math.sqrt(1+A*A)):1/(A+Math.sqrt(1+A*A)),c=1/Math.sqrt(1+d*d),l=d*c}return t=a.clone(a.IDENTITY,t),t[a.getElementIndex(E,E)]=t[a.getElementIndex(h,h)]=c,t[a.getElementIndex(h,E)]=l,t[a.getElementIndex(E,h)]=-l,t}a.packedLength=9,a.pack=function(e,r,n){n=t(n,0),r[n++]=e[0],r[n++]=e[1],r[n++]=e[2],r[n++]=e[3],r[n++]=e[4],r[n++]=e[5],r[n++]=e[6],r[n++]=e[7],r[n++]=e[8]},a.unpack=function(e,n,o){return n=t(n,0),r(o)||(o=new a),o[0]=e[n++],o[1]=e[n++],o[2]=e[n++],o[3]=e[n++],o[4]=e[n++],o[5]=e[n++],o[6]=e[n++],o[7]=e[n++],o[8]=e[n++],o},a.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new a(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},a.fromArray=function(e,n,o){return n=t(n,0),r(o)||(o=new a),o[0]=e[n],o[1]=e[n+1],o[2]=e[n+2],o[3]=e[n+3],o[4]=e[n+4],o[5]=e[n+5],o[6]=e[n+6],o[7]=e[n+7],o[8]=e[n+8],o},a.fromColumnMajorArray=function(e,t){return a.clone(e,t)},a.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 a(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},a.fromQuaternion=function(e,t){var n=e.x*e.x,o=e.x*e.y,i=e.x*e.z,s=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,m=e.w*e.w,h=n-u-E+m,d=2*(o-f),p=2*(i+l),R=2*(o+f),T=-n+u-E+m,A=2*(c-s),_=2*(i-l),y=2*(c+s),S=-n-u+E+m;return r(t)?(t[0]=h,t[1]=R,t[2]=_,t[3]=d,t[4]=T,t[5]=y,t[6]=p,t[7]=A,t[8]=S,t):new a(h,d,p,R,T,A,_,y,S)},a.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 a(e.x,0,0,0,e.y,0,0,0,e.z)},a.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 a(e,0,0,0,e,0,0,0,e)},a.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 a(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},a.fromRotationX=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=o,t[6]=0,t[7]=-o,t[8]=n,t):new a(1,0,0,0,n,-o,0,o,n)},a.fromRotationY=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-o,t[3]=0,t[4]=1,t[5]=0,t[6]=o,t[7]=0,t[8]=n,t):new a(n,0,o,0,1,0,-o,0,n)},a.fromRotationZ=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=n,t[1]=o,t[2]=0,t[3]=-o,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new a(n,-o,0,o,n,0,0,0,1)},a.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]]},a.getElementIndex=function(e,t){return 3*e+t},a.getColumn=function(e,t,r){var n=3*t,o=e[n],i=e[n+1],a=e[n+2];return r.x=o,r.y=i,r.z=a,r},a.setColumn=function(e,t,r,n){n=a.clone(e,n);var o=3*t;return n[o]=r.x,n[o+1]=r.y,n[o+2]=r.z,n},a.getRow=function(e,t,r){var n=e[t],o=e[t+3],i=e[t+6];return r.x=n,r.y=o,r.z=i,r},a.setRow=function(e,t,r,n){return n=a.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var l=new e;a.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),r};var E=new e;a.getMaximumScale=function(t){return a.getScale(t,E),e.maximumComponent(E)},a.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=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],u=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]=o,r[2]=i,r[3]=a,r[4]=s,r[5]=u,r[6]=c,r[7]=l,r[8]=E,r},a.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},a.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},a.multiplyByVector=function(e,t,r){var n=t.x,o=t.y,i=t.z,a=e[0]*n+e[3]*o+e[6]*i,s=e[1]*n+e[4]*o+e[7]*i,u=e[2]*n+e[5]*o+e[8]*i;return r.x=a,r.y=s,r.z=u,r},a.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},a.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},a.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},a.transpose=function(e,t){var r=e[0],n=e[3],o=e[6],i=e[1],a=e[4],s=e[7],u=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=o,t[3]=i,t[4]=a,t[5]=s,t[6]=u,t[7]=c,t[8]=l,t};var f=[1,0,0],m=[2,2,1],h=new a,d=new a;return a.computeEigenDecomposition=function(e,t){var n=i.EPSILON20,o=10,l=0,E=0;r(t)||(t={});for(var f=t.unitary=a.clone(a.IDENTITY,t.unitary),m=t.diagonal=a.clone(e,t.diagonal),p=n*s(m);o>E&&u(m)>p;)c(m,h),a.transpose(h,d),a.multiply(m,h,m),a.multiply(d,m,m),a.multiply(f,h,f),++l>2&&(++E,l=0);return t},a.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},a.determinant=function(e){var t=e[0],r=e[3],n=e[6],o=e[1],i=e[4],a=e[7],s=e[2],u=e[5],c=e[8];return t*(i*c-u*a)+o*(u*n-r*c)+s*(r*a-i*n)},a.inverse=function(e,t){var r=e[0],o=e[1],s=e[2],u=e[3],c=e[4],l=e[5],E=e[6],f=e[7],m=e[8],h=a.determinant(e);if(Math.abs(h)<=i.EPSILON15)throw new n("matrix is not invertible");t[0]=c*m-f*l,t[1]=f*s-o*m,t[2]=o*l-c*s,t[3]=E*l-u*m,t[4]=r*m-E*s,t[5]=u*s-r*l,t[6]=u*f-E*c,t[7]=E*o-r*f,t[8]=r*c-u*o;var d=1/h;return a.multiplyByScalar(t,d,t)},a.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]},a.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},a.IDENTITY=o(new a(1,0,0,0,1,0,0,0,1)),a.ZERO=o(new a(0,0,0,0,0,0,0,0,0)),a.COLUMN0ROW0=0,a.COLUMN0ROW1=1,a.COLUMN0ROW2=2,a.COLUMN1ROW0=3,a.COLUMN1ROW1=4,a.COLUMN1ROW2=5,a.COLUMN2ROW0=6,a.COLUMN2ROW1=7,a.COLUMN2ROW2=8,a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.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]},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},a}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";function i(t,r,n,o){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(o,0)}i.fromElements=function(e,r,n,o,a){return t(a)?(a.x=e,a.y=r,a.z=n,a.w=o,a):new i(e,r,n,o)},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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w},i.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new i),o.x=r[n++],o.y=r[n++],o.z=r[n++],o.w=r[n],o},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 a=new i;i.distance=function(e,t){return i.subtract(e,t,a),i.magnitude(a)},i.distanceSquared=function(e,t){return i.subtract(e,t,a),i.magnitudeSquared(a)},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.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 u=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,u);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)&&o.equalsEpsilon(e.x,r.x,n,i)&&o.equalsEpsilon(e.y,r.y,n,i)&&o.equalsEpsilon(e.z,r.z,n,i)&&o.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(r){t=r.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,o,i,a,s,u){"use strict";function c(e,t,n,o,i,a,s,u,c,l,E,f,m,h,d,p){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(m,0),this[4]=r(t,0),this[5]=r(a,0),this[6]=r(l,0),this[7]=r(h,0),this[8]=r(n,0),this[9]=r(s,0),this[10]=r(E,0),this[11]=r(d,0),this[12]=r(o,0),this[13]=r(u,0),this[14]=r(f,0),this[15]=r(p,0)}c.packedLength=16,c.pack=function(e,t,n){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]},c.unpack=function(e,t,o){return t=r(t,0),n(o)||(o=new c),o[0]=e[t++],o[1]=e[t++],o[2]=e[t++],o[3]=e[t++],o[4]=e[t++],o[5]=e[t++],o[6]=e[t++],o[7]=e[t++],o[8]=e[t++],o[9]=e[t++],o[10]=e[t++],o[11]=e[t++],o[12]=e[t++],o[13]=e[t++],o[14]=e[t++],o[15]=e[t],o},c.clone=function(e,t){return n(e)?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 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]):void 0},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 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,o,i){return o=r(o,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]=o.x,i[13]=o.y,i[14]=o.z,i[15]=1,i):new c(t[0],t[3],t[6],o.x,t[1],t[4],t[7],o.y,t[2],t[5],t[8],o.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,r,o){n(o)||(o=new c);var i=r.x,a=r.y,s=r.z,u=t.x*t.x,l=t.x*t.y,E=t.x*t.z,f=t.x*t.w,m=t.y*t.y,h=t.y*t.z,d=t.y*t.w,p=t.z*t.z,R=t.z*t.w,T=t.w*t.w,A=u-m-p+T,_=2*(l-R),y=2*(E+d),S=2*(l+R),v=-u+m-p+T,C=2*(h-f),N=2*(E-d),g=2*(h+f),I=-u-m+p+T;return o[0]=A*i,o[1]=S*i,o[2]=N*i,o[3]=0,o[4]=_*a,o[5]=v*a,o[6]=g*a,o[7]=0,o[8]=y*s,o[9]=C*s,o[10]=I*s,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o},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 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 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 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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,E=new e,f=new e;c.fromCamera=function(t,r){var o=t.eye,i=t.target,a=t.up;e.normalize(e.subtract(i,o,l),l),e.normalize(e.cross(l,a,E),E),e.normalize(e.cross(E,l,f),f);var s=E.x,u=E.y,m=E.z,h=l.x,d=l.y,p=l.z,R=f.x,T=f.y,A=f.z,_=o.x,y=o.y,S=o.z,v=s*-_+u*-y+m*-S,C=R*-_+T*-y+A*-S,N=h*_+d*y+p*S; +return n(r)?(r[0]=s,r[1]=R,r[2]=-h,r[3]=0,r[4]=u,r[5]=T,r[6]=-d,r[7]=0,r[8]=m,r[9]=A,r[10]=-p,r[11]=0,r[12]=v,r[13]=C,r[14]=N,r[15]=1,r):new c(s,u,m,v,R,T,A,C,-h,-d,-p,N,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,r,n,o){var i=Math.tan(.5*e),a=1/i,s=a/t,u=(n+r)/(r-n),c=2*n*r/(r-n);return o[0]=s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=u,o[11]=-1,o[12]=0,o[13]=0,o[14]=c,o[15]=0,o},c.computeOrthographicOffCenter=function(e,t,r,n,o,i,a){var s=1/(t-e),u=1/(n-r),c=1/(i-o),l=-(t+e)*s,E=-(n+r)*u,f=-(i+o)*c;return s*=2,u*=2,c*=-2,a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=c,a[11]=0,a[12]=l,a[13]=E,a[14]=f,a[15]=1,a},c.computePerspectiveOffCenter=function(e,t,r,n,o,i,a){var s=2*o/(t-e),u=2*o/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),E=-(i+o)/(i-o),f=-1,m=-2*i*o/(i-o);return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=c,a[9]=l,a[10]=E,a[11]=f,a[12]=0,a[13]=0,a[14]=m,a[15]=0,a},c.computeInfinitePerspectiveOffCenter=function(e,t,r,n,o,i){var a=2*o/(t-e),s=2*o/(n-r),u=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,E=-1,f=-2*o;return i[0]=a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=u,i[9]=c,i[10]=l,i[11]=E,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},c.computeViewportTransformation=function(e,t,n,o){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),a=r(e.y,0),s=r(e.width,0),u=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*s,l=.5*u,E=.5*(n-t),f=c,m=l,h=E,d=i+c,p=a+l,R=t+E,T=1;return o[0]=f,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=m,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=h,o[11]=0,o[12]=d,o[13]=p,o[14]=R,o[15]=T,o},c.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]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,r){var n=4*t,o=e[n],i=e[n+1],a=e[n+2],s=e[n+3];return r.x=o,r.y=i,r.z=a,r.w=s,r},c.setColumn=function(e,t,r,n){n=c.clone(e,n);var o=4*t;return n[o]=r.x,n[o+1]=r.y,n[o+2]=r.z,n[o+3]=r.w,n},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],o=e[t+4],i=e[t+8],a=e[t+12];return r.x=n,r.y=o,r.z=i,r.w=a,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 m=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],m)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],m)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],m)),r};var h=new e;c.getMaximumScale=function(t){return c.getScale(t,h),e.maximumComponent(h)},c.multiply=function(e,t,r){var n=e[0],o=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],E=e[8],f=e[9],m=e[10],h=e[11],d=e[12],p=e[13],R=e[14],T=e[15],A=t[0],_=t[1],y=t[2],S=t[3],v=t[4],C=t[5],N=t[6],g=t[7],I=t[8],O=t[9],M=t[10],L=t[11],F=t[12],P=t[13],w=t[14],D=t[15],b=n*A+s*_+E*y+d*S,x=o*A+u*_+f*y+p*S,U=i*A+c*_+m*y+R*S,B=a*A+l*_+h*y+T*S,G=n*v+s*C+E*N+d*g,z=o*v+u*C+f*N+p*g,V=i*v+c*C+m*N+R*g,H=a*v+l*C+h*N+T*g,q=n*I+s*O+E*M+d*L,W=o*I+u*O+f*M+p*L,Y=i*I+c*O+m*M+R*L,X=a*I+l*O+h*M+T*L,k=n*F+s*P+E*w+d*D,K=o*F+u*P+f*w+p*D,Z=i*F+c*P+m*w+R*D,j=a*F+l*P+h*w+T*D;return r[0]=b,r[1]=x,r[2]=U,r[3]=B,r[4]=G,r[5]=z,r[6]=V,r[7]=H,r[8]=q,r[9]=W,r[10]=Y,r[11]=X,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],o=e[1],i=e[2],a=e[4],s=e[5],u=e[6],c=e[8],l=e[9],E=e[10],f=e[12],m=e[13],h=e[14],d=t[0],p=t[1],R=t[2],T=t[4],A=t[5],_=t[6],y=t[8],S=t[9],v=t[10],C=t[12],N=t[13],g=t[14],I=n*d+a*p+c*R,O=o*d+s*p+l*R,M=i*d+u*p+E*R,L=n*T+a*A+c*_,F=o*T+s*A+l*_,P=i*T+u*A+E*_,w=n*y+a*S+c*v,D=o*y+s*S+l*v,b=i*y+u*S+E*v,x=n*C+a*N+c*g+f,U=o*C+s*N+l*g+m,B=i*C+u*N+E*g+h;return r[0]=I,r[1]=O,r[2]=M,r[3]=0,r[4]=L,r[5]=F,r[6]=P,r[7]=0,r[8]=w,r[9]=D,r[10]=b,r[11]=0,r[12]=x,r[13]=U,r[14]=B,r[15]=1,r},c.multiplyByMatrix3=function(e,t,r){var n=e[0],o=e[1],i=e[2],a=e[4],s=e[5],u=e[6],c=e[8],l=e[9],E=e[10],f=t[0],m=t[1],h=t[2],d=t[3],p=t[4],R=t[5],T=t[6],A=t[7],_=t[8],y=n*f+a*m+c*h,S=o*f+s*m+l*h,v=i*f+u*m+E*h,C=n*d+a*p+c*R,N=o*d+s*p+l*R,g=i*d+u*p+E*R,I=n*T+a*A+c*_,O=o*T+s*A+l*_,M=i*T+u*A+E*_;return r[0]=y,r[1]=S,r[2]=v,r[3]=0,r[4]=C,r[5]=N,r[6]=g,r[7]=0,r[8]=I,r[9]=O,r[10]=M,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,o=t.y,i=t.z,a=n*e[0]+o*e[4]+i*e[8]+e[12],s=n*e[1]+o*e[5]+i*e[9]+e[13],u=n*e[2]+o*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]=a,r[13]=s,r[14]=u,r[15]=e[15],r};var d=new e;c.multiplyByUniformScale=function(e,t,r){return d.x=t,d.y=t,d.z=t,c.multiplyByScale(e,d,r)},c.multiplyByScale=function(e,t,r){var n=t.x,o=t.y,i=t.z;return 1===n&&1===o&&1===i?c.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=o*e[4],r[5]=o*e[5],r[6]=o*e[6],r[7]=0,r[8]=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)},c.multiplyByVector=function(e,t,r){var n=t.x,o=t.y,i=t.z,a=t.w,s=e[0]*n+e[4]*o+e[8]*i+e[12]*a,u=e[1]*n+e[5]*o+e[9]*i+e[13]*a,c=e[2]*n+e[6]*o+e[10]*i+e[14]*a,l=e[3]*n+e[7]*o+e[11]*i+e[15]*a;return r.x=s,r.y=u,r.z=c,r.w=l,r},c.multiplyByPointAsVector=function(e,t,r){var n=t.x,o=t.y,i=t.z,a=e[0]*n+e[4]*o+e[8]*i,s=e[1]*n+e[5]*o+e[9]*i,u=e[2]*n+e[6]*o+e[10]*i;return r.x=a,r.y=s,r.z=u,r},c.multiplyByPoint=function(e,t,r){var n=t.x,o=t.y,i=t.z,a=e[0]*n+e[4]*o+e[8]*i+e[12],s=e[1]*n+e[5]*o+e[9]*i+e[13],u=e[2]*n+e[6]*o+e[10]*i+e[14];return r.x=a,r.y=s,r.z=u,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],o=e[3],i=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]=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]=o,t[13]=a,t[14]=s,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||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]},c.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},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 p=new s,R=new s,T=new t,A=new t(0,0,0,1);return c.inverse=function(e,r){if(s.equalsEpsilon(c.getRotation(e,p),R,a.EPSILON7)&&t.equals(c.getRow(e,3,T),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],o=e[4],i=e[8],l=e[12],E=e[1],f=e[5],m=e[9],h=e[13],d=e[2],_=e[6],y=e[10],S=e[14],v=e[3],C=e[7],N=e[11],g=e[15],I=y*g,O=S*N,M=_*g,L=S*C,F=_*N,P=y*C,w=d*g,D=S*v,b=d*N,x=y*v,U=d*C,B=_*v,G=I*f+L*m+F*h-(O*f+M*m+P*h),z=O*E+w*m+x*h-(I*E+D*m+b*h),V=M*E+D*f+U*h-(L*E+w*f+B*h),H=P*E+b*f+B*m-(F*E+x*f+U*m),q=O*o+M*i+P*l-(I*o+L*i+F*l),W=I*n+D*i+b*l-(O*n+w*i+x*l),Y=L*n+w*o+B*l-(M*n+D*o+U*l),X=F*n+x*o+U*i-(P*n+b*o+B*i);I=i*h,O=l*m,M=o*h,L=l*f,F=o*m,P=i*f,w=n*h,D=l*E,b=n*m,x=i*E,U=n*f,B=o*E;var k=I*C+L*N+F*g-(O*C+M*N+P*g),K=O*v+w*N+x*g-(I*v+D*N+b*g),Z=M*v+D*C+U*g-(L*v+w*C+B*g),j=P*v+b*C+B*N-(F*v+x*C+U*N),Q=M*y+P*S+O*_-(F*S+I*_+L*y),J=b*S+I*d+D*y-(w*y+x*S+O*d),$=w*_+B*S+L*d-(U*S+M*d+D*_),ee=U*y+F*d+x*_-(b*_+B*y+P*d),te=n*G+o*z+i*V+l*H;if(Math.abs(te)<a.EPSILON20)throw new u("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=G*te,r[1]=z*te,r[2]=V*te,r[3]=H*te,r[4]=q*te,r[5]=W*te,r[6]=Y*te,r[7]=X*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],o=e[2],i=e[4],a=e[5],s=e[6],u=e[8],c=e[9],l=e[10],E=e[12],f=e[13],m=e[14],h=-r*E-n*f-o*m,d=-i*E-a*f-s*m,p=-u*E-c*f-l*m;return t[0]=r,t[1]=i,t[2]=u,t[3]=0,t[4]=n,t[5]=a,t[6]=c,t[7]=0,t[8]=o,t[9]=s,t[10]=l,t[11]=0,t[12]=h,t[13]=d,t[14]=p,t[15]=1,t},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,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/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function o(t,r){this.normal=e.clone(t),this.distance=r}o.fromPointNormal=function(r,n,i){var a=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=a,i):new o(n,a)};var i=new e;return o.fromCartesian4=function(r,n){var a=e.fromCartesian4(r,i),s=r.w;return t(n)?(e.clone(a,n.normal),n.distance=s,n):new o(a,s)},o.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},o.ORIGIN_XY_PLANE=n(new o(e.UNIT_Z,0)),o.ORIGIN_YZ_PLANE=n(new o(e.UNIT_X,0)),o.ORIGIN_ZX_PLANE=n(new o(e.UNIT_Y,0)),o}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,o,i,a,s){"use strict";function u(e,r,n,o){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(o,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,r,n){n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north},u.unpack=function(e,n,o){return n=t(n,0),r(o)||(o=new u),o.west=e[n++],o.south=e[n++],o.east=e[n++],o.north=e[n],o},u.computeWidth=function(e){var t=e.east,r=e.west;return r>t&&(t+=s.TWO_PI),t-r},u.computeHeight=function(e){return e.north-e.south},u.fromDegrees=function(e,n,o,i,a){return e=s.toRadians(t(e,0)),n=s.toRadians(t(n,0)),o=s.toRadians(t(o,0)),i=s.toRadians(t(i,0)),r(a)?(a.west=e,a.south=n,a.east=o,a.north=i,a):new u(e,n,o,i)},u.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,E=0,f=e.length;f>E;E++){var m=e[E];n=Math.min(n,m.longitude),o=Math.max(o,m.longitude),c=Math.min(c,m.latitude),l=Math.max(l,m.latitude);var h=m.longitude>=0?m.longitude:m.longitude+s.TWO_PI;i=Math.min(i,h),a=Math.max(a,h)}return o-n>a-i&&(n=i,o=a,o>s.PI&&(o-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=o,t.north=l,t):new u(n,c,o,l)},u.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},u.validate=function(e){},u.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},u.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},u.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},u.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},u.center=function(t,n){var o=t.east,i=t.west;i>o&&(o+=s.TWO_PI);var a=s.negativePiToPi(.5*(i+o)),u=.5*(t.south+t.north);return r(n)?(n.longitude=a,n.latitude=u,n.height=0,n):new e(a,u)},u.intersection=function(e,t,n){var o=e.east,i=e.west,a=t.east,c=t.west;i>o&&a>0?o+=s.TWO_PI:c>a&&o>0&&(a+=s.TWO_PI),i>o&&0>c?c+=s.TWO_PI:c>a&&0>i&&(i+=s.TWO_PI);var l=s.negativePiToPi(Math.max(i,c)),E=s.negativePiToPi(Math.min(o,a));if(!((e.west<e.east||t.west<t.east)&&l>=E)){var f=Math.max(e.south,t.south),m=Math.min(e.north,t.north);if(!(f>=m))return r(n)?(n.west=l,n.south=f,n.east=E,n.north=m,n):new u(l,f,E,m)}},u.union=function(e,t,n){return r(n)||(n=new u),n.west=Math.min(e.west,t.west),n.south=Math.min(e.south,t.south),n.east=Math.max(e.east,t.east),n.north=Math.max(e.north,t.north),n},u.expand=function(e,t,n){return r(n)||(n=new u),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},u.contains=function(e,t){var r=t.longitude,n=t.latitude,o=e.west,i=e.east;return o>i&&(i+=s.TWO_PI,0>r&&(r+=s.TWO_PI)),(r>o||s.equalsEpsilon(r,o,s.EPSILON14))&&(i>r||s.equalsEpsilon(r,i,s.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return u.subsample=function(e,n,o,a){n=t(n,i.WGS84),o=t(o,0),r(a)||(a=[]);var l=0,E=e.north,f=e.south,m=e.east,h=e.west,d=c;d.height=o,d.longitude=h,d.latitude=E,a[l]=n.cartographicToCartesian(d,a[l]),l++,d.longitude=m,a[l]=n.cartographicToCartesian(d,a[l]),l++,d.latitude=f,a[l]=n.cartographicToCartesian(d,a[l]),l++,d.longitude=h,a[l]=n.cartographicToCartesian(d,a[l]),l++,0>E?d.latitude=E:f>0?d.latitude=f:d.latitude=0;for(var p=1;8>p;++p)d.longitude=-Math.PI+p*s.PI_OVER_TWO,u.contains(e,d)&&(a[l]=n.cartographicToCartesian(d,a[l]),l++);return 0===d.latitude&&(d.longitude=h,a[l]=n.cartographicToCartesian(d,a[l]),l++,d.longitude=m,a[l]=n.cartographicToCartesian(d,a[l]),l++),a.length=l,a},u.MAX_VALUE=a(new u(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Plane","./Rectangle"],function(e,t,r,n,o,i,a,s,u,c,l,E,f){"use strict";function m(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,R=new e,T=new e,A=new e,_=new e,y=new e,S=new e,v=new e,C=new e,N=new e;m.fromPoints=function(t,r){if(n(r)||(r=new m),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var o=e.clone(t[0],_),i=e.clone(o,h),a=e.clone(o,d),s=e.clone(o,p),u=e.clone(o,R),c=e.clone(o,T),l=e.clone(o,A),E=t.length,f=1;E>f;f++){e.clone(t[f],o);var g=o.x,I=o.y,O=o.z;g<i.x&&e.clone(o,i),g>u.x&&e.clone(o,u),I<a.y&&e.clone(o,a),I>c.y&&e.clone(o,c),O<s.z&&e.clone(o,s),O>l.z&&e.clone(o,l)}var M=e.magnitudeSquared(e.subtract(u,i,y)),L=e.magnitudeSquared(e.subtract(c,a,y)),F=e.magnitudeSquared(e.subtract(l,s,y)),P=i,w=u,D=M;L>D&&(D=L,P=a,w=c),F>D&&(D=F,P=s,w=l);var b=S;b.x=.5*(P.x+w.x),b.y=.5*(P.y+w.y),b.z=.5*(P.z+w.z);var x=e.magnitudeSquared(e.subtract(w,b,y)),U=Math.sqrt(x),B=v;B.x=i.x,B.y=a.y,B.z=s.z;var G=C;G.x=u.x,G.y=c.y,G.z=l.z;var z=e.multiplyByScalar(e.add(B,G,y),.5,N),V=0;for(f=0;E>f;f++){e.clone(t[f],o);var H=e.magnitude(e.subtract(o,z,y));H>V&&(V=H);var q=e.magnitudeSquared(e.subtract(o,b,y));if(q>x){var W=Math.sqrt(q);U=.5*(U+W),x=U*U;var Y=W-U;b.x=(U*b.x+Y*o.x)/W,b.y=(U*b.y+Y*o.y)/W,b.z=(U*b.z+Y*o.z)/W}}return V>U?(e.clone(b,r.center),r.radius=U):(e.clone(z,r.center),r.radius=V),r};var g=new a,I=new e,O=new e,M=new t,L=new t;m.fromRectangle2D=function(e,t,r){return m.fromRectangleWithHeights2D(e,t,0,0,r)},m.fromRectangleWithHeights2D=function(t,o,i,a,s){if(n(s)||(s=new m),!n(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;o=r(o,g),f.southwest(t,M),M.height=i,f.northeast(t,L),L.height=a;var u=o.project(M,I),c=o.project(L,O),l=c.x-u.x,E=c.y-u.y,h=c.z-u.z;s.radius=.5*Math.sqrt(l*l+E*E+h*h);var d=s.center;return d.x=u.x+.5*l,d.y=u.y+.5*E,d.z=u.z+.5*h,s};var F=[];m.fromRectangle3D=function(e,t,o,a){t=r(t,i.WGS84),o=r(o,0);var s;return n(e)&&(s=f.subsample(e,t,o,F)),m.fromPoints(s,a)},m.fromVertices=function(t,o,i,a){if(n(a)||(a=new m),!n(t)||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;o=r(o,e.ZERO),i=r(i,3);var s=_;s.x=t[0]+o.x,s.y=t[1]+o.y,s.z=t[2]+o.z;for(var u=e.clone(s,h),c=e.clone(s,d),l=e.clone(s,p),E=e.clone(s,R),f=e.clone(s,T),g=e.clone(s,A),I=t.length,O=0;I>O;O+=i){var M=t[O]+o.x,L=t[O+1]+o.y,F=t[O+2]+o.z;s.x=M,s.y=L,s.z=F,M<u.x&&e.clone(s,u),M>E.x&&e.clone(s,E),L<c.y&&e.clone(s,c),L>f.y&&e.clone(s,f),F<l.z&&e.clone(s,l),F>g.z&&e.clone(s,g)}var P=e.magnitudeSquared(e.subtract(E,u,y)),w=e.magnitudeSquared(e.subtract(f,c,y)),D=e.magnitudeSquared(e.subtract(g,l,y)),b=u,x=E,U=P;w>U&&(U=w,b=c,x=f),D>U&&(U=D,b=l,x=g);var B=S;B.x=.5*(b.x+x.x),B.y=.5*(b.y+x.y),B.z=.5*(b.z+x.z);var G=e.magnitudeSquared(e.subtract(x,B,y)),z=Math.sqrt(G),V=v;V.x=u.x,V.y=c.y,V.z=l.z;var H=C;H.x=E.x,H.y=f.y,H.z=g.z;var q=e.multiplyByScalar(e.add(V,H,y),.5,N),W=0;for(O=0;I>O;O+=i){s.x=t[O]+o.x,s.y=t[O+1]+o.y,s.z=t[O+2]+o.z;var Y=e.magnitude(e.subtract(s,q,y));Y>W&&(W=Y);var X=e.magnitudeSquared(e.subtract(s,B,y));if(X>G){var k=Math.sqrt(X);z=.5*(z+k),G=z*z;var K=k-z;B.x=(z*B.x+K*s.x)/k,B.y=(z*B.y+K*s.y)/k,B.z=(z*B.z+K*s.z)/k}}return W>z?(e.clone(B,a.center),a.radius=z):(e.clone(q,a.center),a.radius=W),a},m.fromEncodedCartesianVertices=function(t,r,o){if(n(o)||(o=new m),!n(t)||!n(r)||t.length!==r.length||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;var i=_;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var a=e.clone(i,h),s=e.clone(i,d),u=e.clone(i,p),c=e.clone(i,R),l=e.clone(i,T),E=e.clone(i,A),f=t.length,g=0;f>g;g+=3){var I=t[g]+r[g],O=t[g+1]+r[g+1],M=t[g+2]+r[g+2];i.x=I,i.y=O,i.z=M,I<a.x&&e.clone(i,a),I>c.x&&e.clone(i,c),O<s.y&&e.clone(i,s),O>l.y&&e.clone(i,l),M<u.z&&e.clone(i,u),M>E.z&&e.clone(i,E)}var L=e.magnitudeSquared(e.subtract(c,a,y)),F=e.magnitudeSquared(e.subtract(l,s,y)),P=e.magnitudeSquared(e.subtract(E,u,y)),w=a,D=c,b=L;F>b&&(b=F,w=s,D=l),P>b&&(b=P,w=u,D=E);var x=S;x.x=.5*(w.x+D.x),x.y=.5*(w.y+D.y),x.z=.5*(w.z+D.z);var U=e.magnitudeSquared(e.subtract(D,x,y)),B=Math.sqrt(U),G=v;G.x=a.x,G.y=s.y,G.z=u.z;var z=C;z.x=c.x,z.y=l.y,z.z=E.z;var V=e.multiplyByScalar(e.add(G,z,y),.5,N),H=0;for(g=0;f>g;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 q=e.magnitude(e.subtract(i,V,y));q>H&&(H=q);var W=e.magnitudeSquared(e.subtract(i,x,y));if(W>U){var Y=Math.sqrt(W);B=.5*(B+Y),U=B*B;var X=Y-B;x.x=(B*x.x+X*i.x)/Y,x.y=(B*x.y+X*i.y)/Y,x.z=(B*x.z+X*i.z)/Y}}return H>B?(e.clone(x,o.center),o.radius=B):(e.clone(V,o.center),o.radius=H),o},m.fromCornerPoints=function(t,r,o){n(o)||(o=new m);var i=o.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),o.radius=e.distance(i,r),o},m.fromEllipsoid=function(t,r){return n(r)||(r=new m),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var P=new e;m.fromBoundingSpheres=function(t,r){if(n(r)||(r=new m),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var o=t.length;if(1===o)return m.clone(t[0],r);if(2===o)return m.union(t[0],t[1],r);for(var i=[],a=0;o>a;a++)i.push(t[a].center);r=m.fromPoints(i,r);var s=r.center,u=r.radius;for(a=0;o>a;a++){var c=t[a];u=Math.max(u,e.distance(s,c.center,P)+c.radius)}return r.radius=u,r};var w=new e,D=new e,b=new e;m.fromOrientedBoundingBox=function(t,r){n(r)||(r=new m);var o=t.halfAxes,i=c.getColumn(o,0,w),a=c.getColumn(o,1,D),s=c.getColumn(o,2,b),u=e.magnitude(i),l=e.magnitude(a),E=e.magnitude(s);return r.center=e.clone(t.center,r.center),r.radius=Math.max(u,l,E),r},m.clone=function(t,r){return n(t)?n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new m(t.center,t.radius):void 0},m.packedLength=4,m.pack=function(e,t,n){n=r(n,0);var o=e.center;t[n++]=o.x,t[n++]=o.y,t[n++]=o.z,t[n]=e.radius},m.unpack=function(e,t,o){t=r(t,0),n(o)||(o=new m);var i=o.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],o.radius=e[t],o};var x=new e,U=new e;m.union=function(t,r,o){n(o)||(o=new m);var i=t.center,a=t.radius,s=r.center,u=r.radius,c=e.subtract(s,i,x),l=e.magnitude(c);if(a>=l+u)return t.clone(o),o;if(u>=l+a)return r.clone(o),o;var E=.5*(a+l+u),f=e.multiplyByScalar(c,(-a+E)/l,U);return e.add(f,i,f),e.clone(f,o.center),o.radius=E,o};var B=new e;m.expand=function(t,r,n){n=m.clone(t,n);var o=e.magnitude(e.subtract(r,n.center,B));return o>n.radius&&(n.radius=o),n},m.intersectPlane=function(t,r){var n=t.center,o=t.radius,i=r.normal,a=e.dot(i,n)+r.distance;return-o>a?s.OUTSIDE:o>a?s.INTERSECTING:s.INSIDE},m.transform=function(e,t,r){return n(r)||(r=new m),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var G=new e;m.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,G);return e.magnitudeSquared(n)-t.radius*t.radius},m.transformWithoutScale=function(e,t,r){return n(r)||(r=new m),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var z=new e;m.computePlaneDistances=function(t,r,o,i){n(i)||(i=new u);var a=e.subtract(t.center,r,z),s=e.dot(o,a);return i.start=s-t.radius,i.stop=s+t.radius,i};for(var V=new e,H=new e,q=new e,W=new e,Y=new e,X=new t,k=new Array(8),K=0;8>K;++K)k[K]=new e;var Z=new a;return m.projectTo2D=function(t,n,o){n=r(n,Z);var i=n.ellipsoid,a=t.center,s=t.radius,u=i.geodeticSurfaceNormal(a,V),c=e.cross(e.UNIT_Z,u,H);e.normalize(c,c);var l=e.cross(u,c,q);e.normalize(l,l),e.multiplyByScalar(u,s,u),e.multiplyByScalar(l,s,l),e.multiplyByScalar(c,s,c);var E=e.negate(l,Y),f=e.negate(c,W),h=k,d=h[0];e.add(u,l,d),e.add(d,c,d),d=h[1],e.add(u,l,d),e.add(d,f,d),d=h[2],e.add(u,E,d),e.add(d,f,d),d=h[3],e.add(u,E,d),e.add(d,c,d),e.negate(u,u),d=h[4],e.add(u,l,d),e.add(d,c,d),d=h[5],e.add(u,l,d),e.add(d,f,d),d=h[6],e.add(u,E,d),e.add(d,f,d),d=h[7],e.add(u,E,d),e.add(d,c,d);for(var p=h.length,R=0;p>R;++R){var T=h[R];e.add(a,T,T);var A=i.cartesianToCartographic(T,X);n.project(A,T)}o=m.fromPoints(h,o),a=o.center;var _=a.x,y=a.y,S=a.z;return a.x=S,a.y=_,a.z=y,o},m.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},m.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},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,r){return m.computePlaneDistances(this,e,t,r)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.clone=function(e){return m.clone(this,e)},m}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},o={};return t(o,{element:{get:function(){return o.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return o.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return o.supportsFullscreen()?null!==o.element:void 0}}}),o.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var o,i=["webkit","moz","o","ms","khtml"],a=0,s=i.length;s>a;++a){var u=i[a];o=u+"RequestFullscreen","function"==typeof t[o]?(n.requestFullscreen=o,r=!0):(o=u+"RequestFullScreen","function"==typeof t[o]&&(n.requestFullscreen=o,r=!0)),o=u+"ExitFullscreen","function"==typeof document[o]?n.exitFullscreen=o:(o=u+"CancelFullScreen","function"==typeof document[o]&&(n.exitFullscreen=o)),o=u+"FullscreenEnabled",e(document[o])?n.fullscreenEnabled=o:(o=u+"FullScreenEnabled",e(document[o])&&(n.fullscreenEnabled=o)),o=u+"FullscreenElement",e(document[o])?n.fullscreenElement=o:(o=u+"FullScreenElement",e(document[o])&&(n.fullscreenElement=o)),o=u+"fullscreenchange",e(document["on"+o])&&("ms"===u&&(o="MSFullscreenChange"),n.fullscreenchange=o),o=u+"fullscreenerror",e(document["on"+o])&&("ms"===u&&(o="MSFullscreenError"),n.fullscreenerror=o)}return r},o.requestFullscreen=function(e,t){o.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},o.exitFullscreen=function(){o.supportsFullscreen()&&document[n.exitFullscreen]()},o}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function n(e){for(var t=e.split("."),r=0,n=t.length;n>r;++r)t[r]=parseInt(t[r],10);return t}function o(){if(!t(A)){A=!1;var e=/ Chrome\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(A=!0,_=n(e[1]))}return A}function i(){return o()&&_}function a(){if(!t(y)&&(y=!1,!o()&&/ Safari\/[\.0-9]+/.test(T.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(y=!0,S=n(e[1]))}return y}function s(){return a()&&S}function u(){if(!t(v)){v=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(T.userAgent);null!==e&&(v=!0,C=n(e[1]),C.isNightly=!!e[2])}return v}function c(){return u()&&C}function l(){if(!t(N)){N=!1;var e;"Microsoft Internet Explorer"===T.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(N=!0,g=n(e[1]))):"Netscape"===T.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(N=!0,g=n(e[1])))}return N}function E(){return l()&&g}function f(){if(!t(I)){I=!1;var e=/Firefox\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(I=!0,O=n(e[1]))}return I}function m(){return t(M)||(M=/Windows/i.test(T.appVersion)),M}function h(){return f()&&O}function d(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(T.pointerEnabled)||T.pointerEnabled)),L}function p(){if(!t(P)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;P=t(r)&&""!==r,P&&(F=r)}return P}function R(){return p()?F:void 0}var T;T="undefined"!=typeof navigator?navigator:{};var A,_,y,S,v,C,N,g,I,O,M,L,F,P,w={isChrome:o,chromeVersion:i,isSafari:a,safariVersion:s,isWebkit:u,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:E,isFirefox:f,firefoxVersion:h,isWindows:m,hardwareConcurrency:e(T.hardwareConcurrency,3),supportsPointerEvents:d,supportsImageRenderingPixelated:p,imageRenderingValue:R};return w.supportsFullscreen=function(){return r.supportsFullscreen()},w.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},w.supportsWebWorkers=function(){return"undefined"!=typeof Worker},w}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(e,t,r,n,o,i){"use strict";function a(e,t,r){return 0>r&&(r+=1),r>1&&(r-=1),1>6*r?e+6*(t-e)*r:1>2*r?t:2>3*r?e+(t-e)*(2/3-r)*6:e}function s(t,r,n,o){this.red=e(t,1),this.green=e(r,1),this.blue=e(n,1),this.alpha=e(o,1)}s.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 s(e.x,e.y,e.z,e.w)},s.fromBytes=function(r,n,o,i,a){return r=s.byteToFloat(e(r,255)),n=s.byteToFloat(e(n,255)),o=s.byteToFloat(e(o,255)),i=s.byteToFloat(e(i,255)),t(a)?(a.red=r,a.green=n,a.blue=o,a.alpha=i,a):new s(r,n,o,i)},s.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 s(e.red,e.green,e.blue,r)};var u,c,l;n.supportsTypedArrays()&&(u=new ArrayBuffer(4),c=new Uint32Array(u),l=new Uint8Array(u)),s.fromRgba=function(e){return c[0]=e,s.fromBytes(l[0],l[1],l[2],l[3])},s.fromHsl=function(t,r,n,o){t=e(t,0)%1,r=e(r,0),n=e(n,0),o=e(o,1);var i=n,u=n,c=n;if(0!==r){var l;l=.5>n?n*(1+r):n+r-n*r;var E=2*n-l;i=a(E,l,t+1/3),u=a(E,l,t),c=a(E,l,t-1/3)}return new s(i,u,c,o)},s.fromRandom=function(r,n){r=e(r,e.EMPTY_OBJECT);var o=r.red;if(!t(o)){var a=e(r.minimumRed,0),u=e(r.maximumRed,1);o=a+i.nextRandomNumber()*(u-a)}var c=r.green;if(!t(c)){var l=e(r.minimumGreen,0),E=e(r.maximumGreen,1);c=l+i.nextRandomNumber()*(E-l)}var f=r.blue;if(!t(f)){var m=e(r.minimumBlue,0),h=e(r.maximumBlue,1);f=m+i.nextRandomNumber()*(h-m)}var d=r.alpha;if(!t(d)){var p=e(r.minimumAlpha,0),R=e(r.maximumAlpha,1);d=p+i.nextRandomNumber()*(R-p)}return t(n)?(n.red=o,n.green=c,n.blue=f,n.alpha=d,n):new s(o,c,f,d)};var E=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,f=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,m=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,h=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(r){var n=s[r.toUpperCase()];if(t(n))return s.clone(n);var o=E.exec(r);return null!==o?new s(parseInt(o[1],16)/15,parseInt(o[2],16)/15,parseInt(o[3],16)/15):(o=f.exec(r),null!==o?new s(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255):(o=m.exec(r),null!==o?new s(parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),parseFloat(e(o[4],"1.0"))):(o=h.exec(r),null!==o?s.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(e(o[4],"1.0"))):void 0)))},s.packedLength=4,s.pack=function(t,r,n){n=e(n,0),r[n++]=t.red,r[n++]=t.green,r[n++]=t.blue,r[n]=t.alpha},s.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new s),o.red=r[n++],o.green=r[n++],o.blue=r[n++],o.alpha=r[n],o},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:256*e|0},s.clone=function(e,r){return t(e)?t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=e.alpha,r):new s(e.red,e.green,e.blue,e.alpha):void 0; +},s.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},s.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]},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,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},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),r=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+r+")":"rgba("+e+","+t+","+r+","+this.alpha+")"},s.prototype.toBytes=function(e){var r=s.floatToByte(this.red),n=s.floatToByte(this.green),o=s.floatToByte(this.blue),i=s.floatToByte(this.alpha);return t(e)?(e[0]=r,e[1]=n,e[2]=o,e[3]=i,e):[r,n,o,i]},s.prototype.toRgba=function(){return l[0]=s.floatToByte(this.red),l[1]=s.floatToByte(this.green),l[2]=s.floatToByte(this.blue),l[3]=s.floatToByte(this.alpha),c[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.ALICEBLUE=o(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=o(s.fromCssColorString("#FAEBD7")),s.AQUA=o(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=o(s.fromCssColorString("#7FFFD4")),s.AZURE=o(s.fromCssColorString("#F0FFFF")),s.BEIGE=o(s.fromCssColorString("#F5F5DC")),s.BISQUE=o(s.fromCssColorString("#FFE4C4")),s.BLACK=o(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=o(s.fromCssColorString("#FFEBCD")),s.BLUE=o(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=o(s.fromCssColorString("#8A2BE2")),s.BROWN=o(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=o(s.fromCssColorString("#DEB887")),s.CADETBLUE=o(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=o(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=o(s.fromCssColorString("#D2691E")),s.CORAL=o(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=o(s.fromCssColorString("#6495ED")),s.CORNSILK=o(s.fromCssColorString("#FFF8DC")),s.CRIMSON=o(s.fromCssColorString("#DC143C")),s.CYAN=o(s.fromCssColorString("#00FFFF")),s.DARKBLUE=o(s.fromCssColorString("#00008B")),s.DARKCYAN=o(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=o(s.fromCssColorString("#B8860B")),s.DARKGRAY=o(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=o(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=o(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=o(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=o(s.fromCssColorString("#556B2F")),s.DARKORANGE=o(s.fromCssColorString("#FF8C00")),s.DARKORCHID=o(s.fromCssColorString("#9932CC")),s.DARKRED=o(s.fromCssColorString("#8B0000")),s.DARKSALMON=o(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=o(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=o(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=o(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=o(s.fromCssColorString("#00CED1")),s.DARKVIOLET=o(s.fromCssColorString("#9400D3")),s.DEEPPINK=o(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=o(s.fromCssColorString("#00BFFF")),s.DIMGRAY=o(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=o(s.fromCssColorString("#1E90FF")),s.FIREBRICK=o(s.fromCssColorString("#B22222")),s.FLORALWHITE=o(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=o(s.fromCssColorString("#228B22")),s.FUSCHIA=o(s.fromCssColorString("#FF00FF")),s.GAINSBORO=o(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=o(s.fromCssColorString("#F8F8FF")),s.GOLD=o(s.fromCssColorString("#FFD700")),s.GOLDENROD=o(s.fromCssColorString("#DAA520")),s.GRAY=o(s.fromCssColorString("#808080")),s.GREEN=o(s.fromCssColorString("#008000")),s.GREENYELLOW=o(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=o(s.fromCssColorString("#F0FFF0")),s.HOTPINK=o(s.fromCssColorString("#FF69B4")),s.INDIANRED=o(s.fromCssColorString("#CD5C5C")),s.INDIGO=o(s.fromCssColorString("#4B0082")),s.IVORY=o(s.fromCssColorString("#FFFFF0")),s.KHAKI=o(s.fromCssColorString("#F0E68C")),s.LAVENDER=o(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=o(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=o(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=o(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=o(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=o(s.fromCssColorString("#F08080")),s.LIGHTCYAN=o(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=o(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=o(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=o(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=o(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=o(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=o(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=o(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=o(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=o(s.fromCssColorString("#FFFFE0")),s.LIME=o(s.fromCssColorString("#00FF00")),s.LIMEGREEN=o(s.fromCssColorString("#32CD32")),s.LINEN=o(s.fromCssColorString("#FAF0E6")),s.MAGENTA=o(s.fromCssColorString("#FF00FF")),s.MAROON=o(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=o(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=o(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=o(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=o(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=o(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=o(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=o(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=o(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=o(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=o(s.fromCssColorString("#191970")),s.MINTCREAM=o(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=o(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=o(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=o(s.fromCssColorString("#FFDEAD")),s.NAVY=o(s.fromCssColorString("#000080")),s.OLDLACE=o(s.fromCssColorString("#FDF5E6")),s.OLIVE=o(s.fromCssColorString("#808000")),s.OLIVEDRAB=o(s.fromCssColorString("#6B8E23")),s.ORANGE=o(s.fromCssColorString("#FFA500")),s.ORANGERED=o(s.fromCssColorString("#FF4500")),s.ORCHID=o(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=o(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=o(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=o(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=o(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=o(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=o(s.fromCssColorString("#FFDAB9")),s.PERU=o(s.fromCssColorString("#CD853F")),s.PINK=o(s.fromCssColorString("#FFC0CB")),s.PLUM=o(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=o(s.fromCssColorString("#B0E0E6")),s.PURPLE=o(s.fromCssColorString("#800080")),s.RED=o(s.fromCssColorString("#FF0000")),s.ROSYBROWN=o(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=o(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=o(s.fromCssColorString("#8B4513")),s.SALMON=o(s.fromCssColorString("#FA8072")),s.SANDYBROWN=o(s.fromCssColorString("#F4A460")),s.SEAGREEN=o(s.fromCssColorString("#2E8B57")),s.SEASHELL=o(s.fromCssColorString("#FFF5EE")),s.SIENNA=o(s.fromCssColorString("#A0522D")),s.SILVER=o(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=o(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=o(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=o(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=o(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=o(s.fromCssColorString("#00FF7F")),s.STEELBLUE=o(s.fromCssColorString("#4682B4")),s.TAN=o(s.fromCssColorString("#D2B48C")),s.TEAL=o(s.fromCssColorString("#008080")),s.THISTLE=o(s.fromCssColorString("#D8BFD8")),s.TOMATO=o(s.fromCssColorString("#FF6347")),s.TURQUOISE=o(s.fromCssColorString("#40E0D0")),s.VIOLET=o(s.fromCssColorString("#EE82EE")),s.WHEAT=o(s.fromCssColorString("#F5DEB3")),s.WHITE=o(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=o(s.fromCssColorString("#F5F5F5")),s.YELLOW=o(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=o(s.fromCssColorString("#9ACD32")),s.TRANSPARENT=o(new s(0,0,0,0)),s}),define("Renderer/WebGLConstants",["../Core/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",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,r,n,o,i){"use strict";if(!o.supportsTypedArrays())return{};var a={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return r(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(e,r,o,i){switch(o=t(o,0),i=t(i,(r.byteLength-o)/a.getSizeInBytes(e)),e){case a.BYTE:return new Int8Array(r,o,i);case a.UNSIGNED_BYTE:return new Uint8Array(r,o,i);case a.SHORT:return new Int16Array(r,o,i);case a.UNSIGNED_SHORT:return new Uint16Array(r,o,i);case a.FLOAT:return new Float32Array(r,o,i);case a.DOUBLE:return new Float64Array(r,o,i);default:throw new n("componentDatatype is not a valid value.")}},i(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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,o){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,o.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=void 0}return i.computeNumberOfVertices=function(e){var n=-1;for(var o in e.attributes)if(e.attributes.hasOwnProperty(o)&&t(e.attributes[o])&&t(e.attributes[o].values)){var i=e.attributes[o],a=i.values.length/i.componentsPerAttribute;if(n!==a&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=a}return n},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,o){"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){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n]=t.y},i.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new i),o.x=r[n++],o.y=r[n],o},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 a=new i;i.distance=function(e,t){return i.subtract(e,t,a),i.magnitude(a)},i.distanceSquared=function(e,t){return i.subtract(e,t,a),i.magnitudeSquared(a)},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.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 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 u=new i,c=new i;i.angleBetween=function(e,t){return i.normalize(e,u),i.normalize(t,c),o.acosClamped(i.dot(u,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)&&o.equalsEpsilon(e.x,r.x,n,i)&&o.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,o){"use strict";var i={};i.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=t.x,n=t.y;t.x=(1-Math.abs(n))*o.signNotZero(r),t.y=(1-Math.abs(r))*o.signNotZero(n)}return t.x=o.toSNorm(t.x),t.y=o.toSNorm(t.y),t},i.octDecode=function(e,r,n){if(n.x=o.fromSNorm(e),n.y=o.fromSNorm(r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var i=n.x;n.x=(1-Math.abs(n.y))*o.signNotZero(i),n.y=(1-Math.abs(i))*o.signNotZero(n.y)}return t.normalize(n,n)},i.octPackFloat=function(e){return 256*e.x+e.y};var a=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,a),i.octPackFloat(a)},i.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),o=256*(r-n);return i.octDecode(n,o,t)},i.octPack=function(e,t,r,n){var o=i.octEncodeFloat(e),s=i.octEncodeFloat(t),u=i.octEncode(r,a);return n.x=65536*u.x+o,n.y=65536*u.y+s,n},i.octUnpack=function(e,t,r,n){var o=e.x/65536,a=Math.floor(o),s=65536*(o-a);o=e.y/65536;var u=Math.floor(o),c=65536*(o-u);i.octDecodeFloat(s,t),i.octDecodeFloat(c,r),i.octDecode(a,u,n)},i.compressTextureCoordinates=function(e){var t=1===e.x?4095:4096*e.x|0,r=1===e.y?4095:4096*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096;return t.x=Math.floor(r)/4096,t.y=r-Math.floor(r),t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function o(n,o,u,c,l){r(l)||(l=new t);var E,f,m,h,d,p,R,T;r(o.z)?(E=t.subtract(u,o,i),f=t.subtract(c,o,a),m=t.subtract(n,o,s),h=t.dot(E,E),d=t.dot(E,f),p=t.dot(E,m),R=t.dot(f,f),T=t.dot(f,m)):(E=e.subtract(u,o,i),f=e.subtract(c,o,a),m=e.subtract(n,o,s),h=e.dot(E,E),d=e.dot(E,f),p=e.dot(E,m),R=e.dot(f,f),T=e.dot(f,m));var A=1/(h*R-d*d);return l.y=(R*p-d*T)*A,l.z=(h*T-d*p)*A,l.x=1-l.y-l.z,l}var i=new t,a=new t,s=new t;return o}),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 o={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,a=r.low;return n.encode(e.x,o),i.x=o.high,a.x=o.low,n.encode(e.y,o),i.y=o.high,a.y=o.low,n.encode(e.z,o),i.z=o.high,a.z=o.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var o=i.high,a=i.low;t[r]=o.x,t[r+1]=o.y,t[r+2]=o.z,t[r+3]=a.x,t[r+4]=a.y,t[r+5]=a.z},n}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,n){"use strict";function o(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 o}),define("Core/IndexDatatype",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";var i={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=o.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,n){return e>=o.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,n):new Uint16Array(t,r,n)},n(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var o=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(o/Math.max(Math.abs(e),Math.abs(r)))<n?0:o}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,o){var i;if(0===e)return 0===n?[]:[-o/n]; +if(0===n){if(0===o)return[0,0];var a=Math.abs(o),s=Math.abs(e);if(s>a&&a/s<t.EPSILON14)return[0,0];if(a>s&&s/a<t.EPSILON14)return[];if(i=-o/e,0>i)return[];var u=Math.sqrt(i);return[-u,u]}if(0===o)return i=-n/e,0>i?[i,0]:[0,i];var c=n*n,l=4*e*o,E=r(c,-l,t.EPSILON14);if(0>E)return[];var f=-.5*r(n,t.sign(n)*Math.sqrt(E),t.EPSILON14);return n>0?[f/e,o/f]:[o/f,f/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var o,i,a=e,s=t/3,u=r/3,c=n,l=a*u,E=s*c,f=s*s,m=u*u,h=a*u-f,d=a*c-s*u,p=s*c-m,R=4*h*p-d*d;if(0>R){var T,A,_;f*E>=l*m?(T=a,A=h,_=-2*s*h+a*d):(T=c,A=p,_=-c*d+2*u*p);var y=0>_?-1:1,S=-y*Math.abs(T)*Math.sqrt(-R);i=-_+S;var v=i/2,C=0>v?-Math.pow(-v,1/3):Math.pow(v,1/3),N=i===S?-C:-A/C;return o=0>=A?C+N:-_/(C*C+N*N+A),f*E>=l*m?[(o-s)/a]:[-c/(o+u)]}var g=h,I=-2*s*h+a*d,O=p,M=-c*d+2*u*p,L=Math.sqrt(R),F=Math.sqrt(3)/2,P=Math.abs(Math.atan2(a*L,-I)/3);o=2*Math.sqrt(-g);var w=Math.cos(P);i=o*w;var D=o*(-w/2-F*Math.sin(P)),b=i+D>2*s?i-s:D-s,x=a,U=b/x;P=Math.abs(Math.atan2(c*L,-M)/3),o=2*Math.sqrt(-O),w=Math.cos(P),i=o*w,D=o*(-w/2-F*Math.sin(P));var B=-c,G=2*u>i+D?i+u:D+u,z=B/G,V=x*G,H=-b*G-x*B,q=b*B,W=(u*H-s*q)/(-s*H+u*V);return W>=U?z>=U?z>=W?[U,W,z]:[U,z,W]:[z,U,W]:z>=U?[W,U,z]:z>=W?[W,z,U]:[z,W,U]}var n={};return n.computeDiscriminant=function(e,t,r,n){var o=e*e,i=t*t,a=r*r,s=n*n,u=18*e*t*r*n+i*a-27*o*s-4*(e*a*r+i*t*n);return u},n.computeRealRoots=function(e,n,o,i){var a,s;if(0===e)return t.computeRealRoots(n,o,i);if(0===n){if(0===o){if(0===i)return[0,0,0];s=-i/e;var u=0>s?-Math.pow(-s,1/3):Math.pow(s,1/3);return[u,u,u]}return 0===i?(a=t.computeRealRoots(e,0,o),0===a.Length?[0]:[a[0],0,a[1]]):r(e,0,o,i)}return 0===o?0===i?(s=-n/e,0>s?[s,0,0]:[0,0,s]):r(e,n,0,i):0===i?(a=t.computeRealRoots(e,n,o),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]]):r(e,n,o,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function o(t,o,i,a){var s=t*t,u=o-3*s/8,c=i-o*t/2+s*t/8,l=a-i*t/4+o*s/16-3*s*s/256,E=e.computeRealRoots(1,2*u,u*u-4*l,-c*c);if(E.length>0){var f=-t/4,m=E[E.length-1];if(Math.abs(m)<r.EPSILON14){var h=n.computeRealRoots(1,u,l);if(2===h.length){var d,p=h[0],R=h[1];if(p>=0&&R>=0){var T=Math.sqrt(p),A=Math.sqrt(R);return[f-A,f-T,f+T,f+A]}if(p>=0&&0>R)return d=Math.sqrt(p),[f-d,f+d];if(0>p&&R>=0)return d=Math.sqrt(R),[f-d,f+d]}return[]}if(m>0){var _=Math.sqrt(m),y=(u+m-c/_)/2,S=(u+m+c/_)/2,v=n.computeRealRoots(1,_,y),C=n.computeRealRoots(1,-_,S);return 0!==v.length?(v[0]+=f,v[1]+=f,0!==C.length?(C[0]+=f,C[1]+=f,v[1]<=C[0]?[v[0],v[1],C[0],C[1]]:C[1]<=v[0]?[C[0],C[1],v[0],v[1]]:v[0]>=C[0]&&v[1]<=C[1]?[C[0],v[0],v[1],C[1]]:C[0]>=v[0]&&C[1]<=v[1]?[v[0],C[0],C[1],v[1]]:v[0]>C[0]&&v[0]<C[1]?[C[0],v[0],C[1],v[1]]:[v[0],C[0],v[1],C[1]]):v):0!==C.length?(C[0]+=f,C[1]+=f,C):[]}}return[]}function i(t,o,i,a){var s=i*i,u=o*o,c=t*t,l=-2*o,E=i*t+u-4*a,f=c*a-i*o*t+s,m=e.computeRealRoots(1,l,E,f);if(m.length>0){var h,d,p=m[0],R=o-p,T=R*R,A=t/2,_=R/2,y=T-4*a,S=T+4*Math.abs(a),v=c-4*p,C=c+4*Math.abs(p);if(0>p||v*S>y*C){var N=Math.sqrt(v);h=N/2,d=0===N?0:(t*_-i)/N}else{var g=Math.sqrt(y);h=0===g?0:(t*_-i)/g,d=g/2}var I,O;0===A&&0===h?(I=0,O=0):r.sign(A)===r.sign(h)?(I=A+h,O=p/I):(O=A-h,I=p/O);var M,L;0===_&&0===d?(M=0,L=0):r.sign(_)===r.sign(d)?(M=_+d,L=a/M):(L=_-d,M=a/L);var F=n.computeRealRoots(1,I,M),P=n.computeRealRoots(1,O,L);if(0!==F.length)return 0!==P.length?F[1]<=P[0]?[F[0],F[1],P[0],P[1]]:P[1]<=F[0]?[P[0],P[1],F[0],F[1]]:F[0]>=P[0]&&F[1]<=P[1]?[P[0],F[0],F[1],P[1]]:P[0]>=F[0]&&P[1]<=F[1]?[F[0],P[0],P[1],F[1]]:F[0]>P[0]&&F[0]<P[1]?[P[0],F[0],P[1],F[1]]:[F[0],P[0],F[1],P[1]]:F;if(0!==P.length)return P}return[]}var a={};return a.computeDiscriminant=function(e,t,r,n,o){var i=e*e,a=i*e,s=t*t,u=s*t,c=r*r,l=c*r,E=n*n,f=E*n,m=o*o,h=m*o,d=s*c*E-4*u*f-4*e*l*E+18*e*t*r*f-27*i*E*E+256*a*h+o*(18*u*r*n-4*s*l+16*e*c*c-80*e*t*c*n-6*e*s*E+144*i*r*E)+m*(144*e*s*r-27*s*s-128*i*c-192*i*t*n);return d},a.computeRealRoots=function(t,n,a,s,u){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,a,s,u);var c=n/t,l=a/t,E=s/t,f=u/t,m=0>c?1:0;switch(m+=0>l?m+1:m,m+=0>E?m+1:m,m+=0>f?m+1:m){case 0:return o(c,l,E,f);case 1:return i(c,l,E,f);case 2:return i(c,l,E,f);case 3:return o(c,l,E,f);case 4:return o(c,l,E,f);case 5:return i(c,l,E,f);case 6:return o(c,l,E,f);case 7:return o(c,l,E,f);case 8:return i(c,l,E,f);case 9:return o(c,l,E,f);case 10:return o(c,l,E,f);case 11:return i(c,l,E,f);case 12:return o(c,l,E,f);case 13:return o(c,l,E,f);case 14:return o(c,l,E,f);case 15:return o(c,l,E,f);default:return}},a}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function o(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 o.getPoint=function(t,n,o){return r(o)||(o=new e),o=e.multiplyByScalar(t.direction,n,o),e.add(t.origin,o,o)},o}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,o,i,a,s,u,c){"use strict";function l(t,n,o,a,s){s=r(s,!1);var u,c,l,E,f,m=t.origin,h=t.direction,d=e.subtract(o,n,p),y=e.subtract(a,n,R),S=e.cross(h,y,T),v=e.dot(d,S);if(s){if(v<i.EPSILON6)return;if(u=e.subtract(m,n,A),l=e.dot(u,S),0>l||l>v)return;if(c=e.cross(u,d,_),E=e.dot(h,c),0>E||l+E>v)return;f=e.dot(y,c)/v}else{if(Math.abs(v)<i.EPSILON6)return;var C=1/v;if(u=e.subtract(m,n,A),l=e.dot(u,S)*C,0>l||l>1)return;if(c=e.cross(u,d,_),E=e.dot(h,c)*C,0>E||l+E>1)return;f=e.dot(y,c)*C}return f}function E(e,t,r,n){var o=t*t-4*e*r;if(!(0>o)){if(o>0){var i=1/(2*e),a=Math.sqrt(o),s=(-t+a)*i,u=(-t-a)*i;return u>s?(n.root0=s,n.root1=u):(n.root0=u,n.root1=s),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function f(t,r,o){n(o)||(o={});var i=t.origin,a=t.direction,s=r.center,u=r.radius*r.radius,c=e.subtract(i,s,T),l=e.dot(a,a),f=2*e.dot(a,c),m=e.magnitudeSquared(c)-u,h=E(l,f,m,S);return n(h)?(o.start=h.root0,o.stop=h.root1,o):void 0}function m(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,o,c){var l,E=o*o,f=c*c,h=(t[a.COLUMN1ROW1]-t[a.COLUMN2ROW2])*f,d=c*(o*m(t[a.COLUMN1ROW0],t[a.COLUMN0ROW1],i.EPSILON15)+r.y),p=t[a.COLUMN0ROW0]*E+t[a.COLUMN2ROW2]*f+o*r.x+n,R=f*m(t[a.COLUMN2ROW1],t[a.COLUMN1ROW2],i.EPSILON15),T=c*(o*m(t[a.COLUMN2ROW0],t[a.COLUMN0ROW2])+r.z),A=[];if(0===T&&0===R){if(l=s.computeRealRoots(h,d,p),0===l.length)return A;var _=l[0],y=Math.sqrt(Math.max(1-_*_,0));if(A.push(new e(o,c*_,c*-y)),A.push(new e(o,c*_,c*y)),2===l.length){var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));A.push(new e(o,c*S,c*-v)),A.push(new e(o,c*S,c*v))}return A}var C=T*T,N=R*R,g=h*h,I=T*R,O=g+N,M=2*(d*h+I),L=2*p*h+d*d-N+C,F=2*(p*d-I),P=p*p-C;if(0===O&&0===M&&0===L&&0===F)return A;l=u.computeRealRoots(O,M,L,F,P);var w=l.length;if(0===w)return A;for(var D=0;w>D;++D){var b,x=l[D],U=x*x,B=Math.max(1-U,0),G=Math.sqrt(B);b=i.sign(h)===i.sign(p)?m(h*U+p,d*x,i.EPSILON12):i.sign(p)===i.sign(d*x)?m(h*U,d*x+p,i.EPSILON12):m(h*U+d*x,p,i.EPSILON12);var z=m(R*x,T,i.EPSILON15),V=b*z;0>V?A.push(new e(o,c*x,c*G)):V>0?A.push(new e(o,c*x,c*-G)):0!==G?(A.push(new e(o,c*x,c*-G)),A.push(new e(o,c*x,c*G)),++D):A.push(new e(o,c*x,c*G))}return A}var d={};d.rayPlane=function(t,r,o){n(o)||(o=new e);var a=t.origin,s=t.direction,u=r.normal,c=e.dot(u,s);if(!(Math.abs(c)<i.EPSILON15)){var l=(-r.distance-e.dot(u,a))/c;if(!(0>l))return o=e.multiplyByScalar(s,l,o),e.add(a,o,o)}};var p=new e,R=new e,T=new e,A=new e,_=new e;d.rayTriangle=function(t,r,o,i,a,s){var u=l(t,r,o,i,a);if(n(u)&&!(0>u))return n(s)||(s=new e),e.multiplyByScalar(t.direction,u,s),e.add(t.origin,s,s)};var y=new c;d.lineSegmentTriangle=function(t,r,o,i,a,s,u){var c=y;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var E=l(c,o,i,a,s);return!n(E)||0>E||E>e.distance(t,r)?void 0:(n(u)||(u=new e),e.multiplyByScalar(c.direction,E,u),e.add(c.origin,u,u))};var S={root0:0,root1:0};d.raySphere=function(e,t,r){return r=f(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var v=new c;d.lineSegmentSphere=function(t,r,o,i){var a=v,s=e.subtract(r,t,a.direction),u=e.magnitude(s);return e.normalize(s,s),i=f(a,o,i),!n(i)||i.stop<0||i.start>u?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,u),i)};var C=new e,N=new e;d.rayEllipsoid=function(t,r){var n,o,i,a,s,u=r.oneOverRadii,c=e.multiplyComponents(u,t.origin,C),l=e.multiplyComponents(u,t.direction,N),E=e.magnitudeSquared(c),f=e.dot(c,l);if(E>1){if(f>=0)return;var m=f*f;if(n=E-1,o=e.magnitudeSquared(l),i=o*n,i>m)return;if(m>i){a=f*f-i,s=-f+Math.sqrt(a);var h=s/o,d=n/s;return d>h?{start:h,stop:d}:{start:d,stop:h}}var p=Math.sqrt(n/o);return{start:p,stop:p}}return 1>E?(n=E-1,o=e.magnitudeSquared(l),i=o*n,a=f*f-i,s=-f+Math.sqrt(a),{start:0,stop:s/o}):0>f?(o=e.magnitudeSquared(l),{start:0,stop:-f/o}):void 0};var g=new e,I=new e,O=new e,M=new e,L=new e,F=new a,P=new a,w=new a,D=new a,b=new a,x=new a,U=new a,B=new e,G=new e,z=new t;d.grazingAltitudeLocation=function(t,r){var o=t.origin,s=t.direction,u=r.geodeticSurfaceNormal(o,g);if(e.dot(s,u)>=0)return o;var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(s,g),E=e.normalize(l,l),f=e.mostOrthogonalAxis(l,M),m=e.normalize(e.cross(f,E,I),I),d=e.normalize(e.cross(E,m,O),O),p=F;p[0]=E.x,p[1]=E.y,p[2]=E.z,p[3]=m.x,p[4]=m.y,p[5]=m.z,p[6]=d.x,p[7]=d.y,p[8]=d.z;var R=a.transpose(p,P),T=a.fromScale(r.radii,w),A=a.fromScale(r.oneOverRadii,D),_=b;_[0]=0,_[1]=-s.z,_[2]=s.y,_[3]=s.z,_[4]=0,_[5]=-s.x,_[6]=-s.y,_[7]=s.x,_[8]=0;var y,S,v=a.multiply(a.multiply(R,A,x),_,x),C=a.multiply(a.multiply(v,T,U),p,U),N=a.multiplyByVector(v,o,L),V=h(C,e.negate(N,g),0,0,1),H=V.length;if(H>0){for(var q=e.clone(e.ZERO,G),W=Number.NEGATIVE_INFINITY,Y=0;H>Y;++Y){y=a.multiplyByVector(T,a.multiplyByVector(p,V[Y],B),B);var X=e.normalize(e.subtract(y,o,M),M),k=e.dot(X,s);k>W&&(W=k,q=e.clone(y,q))}var K=r.cartesianToCartographic(q,z);return W=i.clamp(W,0,1),S=e.magnitude(e.subtract(q,o,M))*Math.sqrt(1-W*W),S=c?-S:S,K.height=S,r.cartographicToCartesian(K,new e)}};var V=new e;return d.lineSegmentPlane=function(t,r,o,a){n(a)||(a=new e);var s=e.subtract(r,t,V),u=o.normal,c=e.dot(u,s);if(!(Math.abs(c)<i.EPSILON6)){var l=e.dot(u,t),E=-(o.distance+l)/c;if(!(0>E||E>1))return e.multiplyByScalar(s,E,a),e.add(t,a,a),a}},d.trianglePlaneIntersection=function(t,r,n,o){var i=o.normal,a=o.distance,s=e.dot(i,t)+a<0,u=e.dot(i,r)+a<0,c=e.dot(i,n)+a<0,l=0;l+=s?1:0,l+=u?1:0,l+=c?1:0;var E,f;if((1===l||2===l)&&(E=new e,f=new e),1===l){if(s)return d.lineSegmentPlane(t,r,o,E),d.lineSegmentPlane(t,n,o,f),{positions:[t,r,n,E,f],indices:[0,3,4,1,2,4,1,4,3]};if(u)return d.lineSegmentPlane(r,n,o,E),d.lineSegmentPlane(r,t,o,f),{positions:[t,r,n,E,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return d.lineSegmentPlane(n,t,o,E),d.lineSegmentPlane(n,r,o,f),{positions:[t,r,n,E,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!s)return d.lineSegmentPlane(r,t,o,E),d.lineSegmentPlane(n,t,o,f),{positions:[t,r,n,E,f],indices:[1,2,4,1,4,3,0,3,4]};if(!u)return d.lineSegmentPlane(n,r,o,E),d.lineSegmentPlane(t,r,o,f),{positions:[t,r,n,E,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return d.lineSegmentPlane(t,n,o,E),d.lineSegmentPlane(r,n,o,f),{positions:[t,r,n,E,f],indices:[0,1,4,0,4,3,2,3,4]}}},d}),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,o=r.maximumIndex,i=e(r.cacheSize,24),a=n.length;if(!t(o)){o=0;for(var s=0,u=n[s];a>s;)u>o&&(o=u),++s,u=n[s]}for(var c=[],l=0;o+1>l;l++)c[l]=0;for(var E=i+1,f=0;a>f;++f)E-c[n[f]]>i&&(c[n[f]]=E,++E);return(E-i+1)/(a/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var o=t[t.length-1];if(t.splice(t.length-1,1),e[o].numLiveTriangles>0)return o}for(;n>i;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(e,t,r,o,i,a,s){for(var u,c=-1,l=-1,E=0;E<r.length;){var f=r[E];o[f].numLiveTriangles&&(u=0,i-o[f].timeStamp+2*o[f].numLiveTriangles<=t&&(u=i-o[f].timeStamp),(u>l||-1===l)&&(l=u,c=f)),++E}return-1===c?n(o,a,e,s):c}r=e(r,e.EMPTY_OBJECT);var i,a=r.indices,s=r.maximumIndex,u=e(r.cacheSize,24),c=a.length,l=0,E=0,f=a[E],m=c;if(t(s))l=s+1;else{for(;m>E;)f>l&&(l=f),++E,f=a[E];if(-1===l)return 0;++l}for(var h=[],d=0;l>d;d++)h[d]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};E=0;for(var p=0;m>E;)h[a[E]].vertexTriangles.push(p),++h[a[E]].numLiveTriangles,h[a[E+1]].vertexTriangles.push(p),++h[a[E+1]].numLiveTriangles,h[a[E+2]].vertexTriangles.push(p),++h[a[E+2]].numLiveTriangles,++p,E+=3;var R=0,T=u+1;i=1;var A,_,y=[],S=[],v=0,C=[],N=c/3,g=[];for(d=0;N>d;d++)g[d]=!1;for(var I,O;-1!==R;){y=[],_=h[R],O=_.vertexTriangles.length;for(var M=0;O>M;++M)if(p=_.vertexTriangles[M],!g[p]){g[p]=!0,E=p+p+p;for(var L=0;3>L;++L)I=a[E],y.push(I),S.push(I),C[v]=I,++v,A=h[I],--A.numLiveTriangles,T-A.timeStamp>u&&(A.timeStamp=T,++T),++E}R=o(a,u,y,h,T,S,l)}return C},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,o,i,a,s,u,c,l,E,f,m,h,d,p,R,T,A,_,y,S,v,C,N){"use strict";function g(e,t,r,n,o){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=o,e[t++]=o,e[t]=r}function I(e){for(var t=e.length,r=t/3*6,n=R.createTypedArray(t,r),o=0,i=0;t>i;i+=3,o+=6)g(n,o,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=R.createTypedArray(t,r);g(n,0,e[0],e[1],e[2]);for(var o=6,i=3;t>i;++i,o+=6)g(n,o,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=R.createTypedArray(t,r),o=e[0],i=0,a=1;t>a;++a,i+=6)g(n,i,o,e[a],e[a+1]);return n}return new Uint16Array}function L(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 h({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function F(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var o=t[n],i=0;i<o.componentsPerAttribute;++i)e[n].values.push(o.values[r*o.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;n>i;i+=3)o.unpack(r,i,ie),S.multiplyByPoint(e,ie,ie),o.pack(ie,r,i)}function w(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;n>i;i+=3)o.unpack(r,i,ie),y.multiplyByVector(e,ie,ie),ie=o.normalize(ie,ie),o.pack(ie,r,i)}function D(e,t){var r,n=e.length,o={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var a=i[r],u=a.values.length,l=!0,E=1;n>E;++E){var f=e[E][t].attributes[r];if(!c(f)||a.componentDatatype!==f.componentDatatype||a.componentsPerAttribute!==f.componentsPerAttribute||a.normalize!==f.normalize){l=!1;break}u+=f.values.length}l&&(o[r]=new h({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:s.createTypedArray(a.componentDatatype,u)}))}return o}function b(e,t){var n,i,a,s,u,l,E,f=e.length,h=(e[0].modelMatrix,c(e[0][t].indices)),d=e[0][t].primitiveType,p=D(e,t);for(n in p)if(p.hasOwnProperty(n))for(u=p[n].values,s=0,i=0;f>i;++i)for(l=e[i][t].attributes[n].values,E=l.length,a=0;E>a;++a)u[s++]=l[a];var T;if(h){var A=0;for(i=0;f>i;++i)A+=e[i][t].indices.length;var _=m.computeNumberOfVertices(new m({attributes:p,primitiveType:C.POINTS})),y=R.createTypedArray(_,A),S=0,v=0;for(i=0;f>i;++i){var N=e[i][t].indices,g=N.length;for(s=0;g>s;++s)y[S++]=v+N[s];v+=m.computeNumberOfVertices(e[i][t])}T=y}var I,O=new o,M=0;for(i=0;f>i;++i){if(I=e[i][t].boundingSphere,!c(I)){O=void 0;break}o.add(I.center,O,O)}if(c(O))for(o.divideByScalar(O,f,O),i=0;f>i;++i){I=e[i][t].boundingSphere;var L=o.magnitude(o.subtract(I.center,O,ue))+I.radius;L>M&&(M=L)}return new m({attributes:p,indices:T,primitiveType:d,boundingSphere:c(O)?new r(O,M):void 0})}function x(e){if(c(e.indices))return e;for(var t=m.computeNumberOfVertices(e),r=R.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function U(e){var t=m.computeNumberOfVertices(e),r=R.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,o=3;t>o;++o)r[n++]=o-1,r[n++]=0,r[n++]=o;return e.indices=r,e.primitiveType=C.TRIANGLES,e}function B(e){var t=m.computeNumberOfVertices(e),r=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,o=3;t-1>o;o+=2)r[n++]=o,r[n++]=o-1,r[n++]=o+1,t>o+2&&(r[n++]=o,r[n++]=o+1,r[n++]=o+2);return e.indices=r,e.primitiveType=C.TRIANGLES,e}function G(e){if(c(e.indices))return e;for(var t=m.computeNumberOfVertices(e),r=R.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function z(e){var t=m.computeNumberOfVertices(e),r=R.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,o=2;t>o;++o)r[n++]=o-1,r[n++]=o;return e.indices=r,e.primitiveType=C.LINES,e}function V(e){var t=m.computeNumberOfVertices(e),r=R.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,o=2;t>o;++o)r[n++]=o-1,r[n++]=o;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=C.LINES,e}function H(e){switch(e.primitiveType){case C.TRIANGLE_FAN:return U(e);case C.TRIANGLE_STRIP:return B(e);case C.TRIANGLES:return x(e);case C.LINE_STRIP:return z(e);case C.LINE_LOOP:return V(e);case C.LINES:return G(e)}return e}function q(e,t){Math.abs(e.y)<_.EPSILON6&&(t?e.y=-_.EPSILON6:e.y=_.EPSILON6)}function W(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,o=Math.abs(e.y),i=Math.abs(t.y),a=Math.abs(r.y);n=o>i?o>a?_.sign(e.y):_.sign(r.y):i>a?_.sign(t.y):_.sign(r.y);var s=0>n;q(e,s),q(t,s),q(r,s)}function Y(e,t,r,n){o.add(e,o.multiplyByScalar(o.subtract(t,e,_e),e.y/(e.y-t.y),_e),r),o.clone(r,n),q(r,!0),q(n,!1)}function X(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){W(e,t,r);var n=e.y<0,o=t.y<0,i=r.y<0,a=0;a+=n?1:0,a+=o?1:0,a+=i?1:0;var s=Ne.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,n?(Y(e,t,ye,ve),Y(e,r,Se,Ce),s[0]=0,s[3]=1,s[4]=2,s[6]=1):o?(Y(t,r,ye,ve),Y(t,e,Se,Ce),s[0]=1,s[3]=2,s[4]=0,s[6]=2):i&&(Y(r,e,ye,ve),Y(r,t,Se,Ce),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,n?o?i||(Y(r,e,ye,ve),Y(r,t,Se,Ce),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(Y(t,r,ye,ve),Y(t,e,Se,Ce),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(Y(e,t,ye,ve),Y(e,r,Se,Ce),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var u=Ne.positions;return u[0]=e,u[1]=t,u[2]=r,u.length=3,(1===a||2===a)&&(u[3]=ye,u[4]=Se,u[5]=ve,u[6]=Ce,u.length=7),Ne}}function k(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var o in n)if(n.hasOwnProperty(o)&&c(n[o])&&c(n[o].values)){var i=n[o];i.values=s.createTypedArray(i.componentDatatype,i.values)}var a=m.computeNumberOfVertices(e);return e.indices=R.createTypedArray(a,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 o=t[n];r[n]=new h({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new m({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 j(e,r,i,a,s,u,l,E,f,m,h){if(c(u)||c(l)||c(E)||c(f)){var d=o.fromArray(s,3*e,ge),p=o.fromArray(s,3*r,Ie),R=o.fromArray(s,3*i,Oe),T=t(a,d,p,R,Me);if(c(u)){var A=o.fromArray(u,3*e,ge),_=o.fromArray(u,3*r,Ie),y=o.fromArray(u,3*i,Oe);o.multiplyByScalar(A,T.x,A),o.multiplyByScalar(_,T.y,_),o.multiplyByScalar(y,T.z,y);var S=o.add(A,_,A);o.add(S,y,S),o.normalize(S,S),o.pack(S,m.normal.values,3*h)}if(c(l)){var v=o.fromArray(l,3*e,ge),C=o.fromArray(l,3*r,Ie),N=o.fromArray(l,3*i,Oe);o.multiplyByScalar(v,T.x,v),o.multiplyByScalar(C,T.y,C),o.multiplyByScalar(N,T.z,N);var g=o.add(v,C,v);o.add(g,N,g),o.normalize(g,g),o.pack(g,m.binormal.values,3*h)}if(c(E)){var I=o.fromArray(E,3*e,ge),O=o.fromArray(E,3*r,Ie),M=o.fromArray(E,3*i,Oe);o.multiplyByScalar(I,T.x,I),o.multiplyByScalar(O,T.y,O),o.multiplyByScalar(M,T.z,M);var L=o.add(I,O,I);o.add(L,M,L),o.normalize(L,L),o.pack(L,m.tangent.values,3*h)}if(c(f)){var F=n.fromArray(f,2*e,Le),P=n.fromArray(f,2*r,Fe),w=n.fromArray(f,2*i,Pe);n.multiplyByScalar(F,T.x,F),n.multiplyByScalar(P,T.y,P),n.multiplyByScalar(w,T.z,w);var D=n.add(F,P,F);n.add(D,w,D),n.pack(D,m.st.values,2*h)}}}function Q(e,t,r,n,o,i){var a=e.position.values.length/3;if(-1!==o){var s=n[o],u=r[s];return-1===u?(r[s]=a,e.position.values.push(i.x,i.y,i.z),t.push(a),a):(t.push(u),u)}return e.position.values.push(i.x,i.y,i.z),t.push(a),a}function J(e){var t,r,n,i,a,s=e.geometry,u=s.attributes,l=u.position.values,E=c(u.normal)?u.normal.values:void 0,f=c(u.binormal)?u.binormal.values:void 0,m=c(u.tangent)?u.tangent.values:void 0,h=c(u.st)?u.st.values:void 0,d=s.indices,p=K(s),R=K(s),T=[];T.length=l.length/3;var A=[];for(A.length=l.length/3,a=0;a<T.length;++a)T[a]=-1,A[a]=-1;var _=d.length;for(a=0;_>a;a+=3){var y=d[a],S=d[a+1],v=d[a+2],C=o.fromArray(l,3*y),N=o.fromArray(l,3*S),g=o.fromArray(l,3*v),I=X(C,N,g);if(c(I)&&I.positions.length>3)for(var O=I.positions,M=I.indices,L=M.length,F=0;L>F;++F){var P=M[F],w=O[P];w.y<0?(t=R.attributes,r=R.indices,n=T):(t=p.attributes,r=p.indices,n=A),i=Q(t,r,n,d,3>P?a+P:-1,w),j(y,S,v,w,l,E,f,m,h,t,i)}else c(I)&&(C=I.positions[0],N=I.positions[1],g=I.positions[2]),C.y<0?(t=R.attributes,r=R.indices,n=T):(t=p.attributes,r=p.indices,n=A),i=Q(t,r,n,d,a,C),j(y,S,v,C,l,E,f,m,h,t,i),i=Q(t,r,n,d,a+1,N),j(y,S,v,N,l,E,f,m,h,t,i),i=Q(t,r,n,d,a+2,g),j(y,S,v,g,l,E,f,m,h,t,i)}Z(e,R,p)}function $(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,a=r.indices,s=K(r),u=K(r),l=a.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;l>t;t+=2){var m=a[t],h=a[t+1],d=o.fromArray(i,3*m,ge),p=o.fromArray(i,3*h,Ie);Math.abs(d.y)<_.EPSILON6&&(d.y<0?d.y=-_.EPSILON6:d.y=_.EPSILON6),Math.abs(p.y)<_.EPSILON6&&(p.y<0?p.y=-_.EPSILON6:p.y=_.EPSILON6);var R=s.attributes,T=s.indices,y=f,S=u.attributes,v=u.indices,C=E,N=A.lineSegmentPlane(d,p,we,Oe);if(c(N)){var g=o.multiplyByScalar(o.UNIT_Y,5*_.EPSILON9,De);d.y<0&&(o.negate(g,g),R=u.attributes,T=u.indices,y=E,S=s.attributes,v=s.indices,C=f);var I=o.add(N,g,be);Q(R,T,y,a,t,d),Q(R,T,y,a,-1,I),o.negate(g,g),o.add(N,g,I),Q(S,v,C,a,-1,I),Q(S,v,C,a,t+1,p)}else{var O,M,L;d.y<0?(O=u.attributes,M=u.indices,L=E):(O=s.attributes,M=s.indices,L=f),Q(O,M,L,a,t,d),Q(O,M,L,a,t+1,p)}}Z(e,u,s)}function ee(e){var t,r,a,s=e.geometry,u=s.attributes,l=u.position.values,E=u.prevPosition.values,f=u.nextPosition.values,m=u.expandAndWidth.values,h=c(u.st)?u.st.values:void 0,d=c(u.color)?u.color.values:void 0,p=K(s),R=K(s),T=l.length/3;for(t=0;T>t;t+=4){var y=t,S=t+1,v=t+2,C=t+3,N=o.fromArray(l,3*y,Be),g=o.fromArray(l,3*S,Ge),I=o.fromArray(l,3*v,ze),O=o.fromArray(l,3*C,Ve);Math.abs(N.y)<_.EPSILON6&&(N.y=_.EPSILON6*(I.y<0?-1:1),g.y=N.y),Math.abs(I.y)<_.EPSILON6&&(I.y=_.EPSILON6*(N.y<0?-1:1),O.y=I.y);var M=p.attributes,L=p.indices,F=R.attributes,P=R.indices,w=A.lineSegmentPlane(N,I,we,He);if(c(w)){var D=o.multiplyByScalar(o.UNIT_Y,5*_.EPSILON9,qe);N.y<0&&(o.negate(D,D),M=R.attributes,L=R.indices,F=p.attributes,P=p.indices);var b=o.add(w,D,We);for(M.position.values.push(N.x,N.y,N.z,g.x,g.y,g.z),M.position.values.push(b.x,b.y,b.z),M.position.values.push(b.x,b.y,b.z),o.negate(D,D),o.add(w,D,b),F.position.values.push(b.x,b.y,b.z),F.position.values.push(b.x,b.y,b.z),F.position.values.push(I.x,I.y,I.z,O.x,O.y,O.z),r=3*y;3*y+6>r;++r)M.prevPosition.values.push(E[r]);for(M.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),F.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),r=3*v;3*v+6>r;++r)F.prevPosition.values.push(E[r]);for(r=3*y;3*y+6>r;++r)M.nextPosition.values.push(f[r]);for(M.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),F.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),r=3*v;3*v+6>r;++r)F.nextPosition.values.push(f[r]);var x=n.fromArray(m,2*y,xe),U=Math.abs(x.y);M.expandAndWidth.values.push(-1,U,1,U),M.expandAndWidth.values.push(-1,-U,1,-U),F.expandAndWidth.values.push(-1,U,1,U),F.expandAndWidth.values.push(-1,-U,1,-U);var B=o.magnitudeSquared(o.subtract(w,N,Ve));if(B/=o.magnitudeSquared(o.subtract(I,N,Ve)),c(d)){var G=i.fromArray(d,4*y,Ye),z=i.fromArray(d,4*v,Ye),V=_.lerp(G.x,z.x,B),H=_.lerp(G.y,z.y,B),q=_.lerp(G.z,z.z,B),W=_.lerp(G.w,z.w,B);for(r=4*y;4*y+8>r;++r)M.color.values.push(d[r]);for(M.color.values.push(V,H,q,W),M.color.values.push(V,H,q,W),F.color.values.push(V,H,q,W),F.color.values.push(V,H,q,W),r=4*v;4*v+8>r;++r)F.color.values.push(d[r])}if(c(h)){var Y=n.fromArray(h,2*y,xe),X=n.fromArray(h,2*(t+3),Ue),k=_.lerp(Y.x,X.x,B);for(r=2*y;2*y+4>r;++r)M.st.values.push(h[r]);for(M.st.values.push(k,Y.y),M.st.values.push(k,X.y),F.st.values.push(k,Y.y),F.st.values.push(k,X.y),r=2*v;2*v+4>r;++r)F.st.values.push(h[r])}a=M.position.values.length/3-4,L.push(a,a+2,a+1),L.push(a+1,a+2,a+3),a=F.position.values.length/3-4,P.push(a,a+2,a+1),P.push(a+1,a+2,a+3)}else{var j,Q;for(N.y<0?(j=R.attributes,Q=R.indices):(j=p.attributes,Q=p.indices),j.position.values.push(N.x,N.y,N.z),j.position.values.push(g.x,g.y,g.z),j.position.values.push(I.x,I.y,I.z),j.position.values.push(O.x,O.y,O.z),r=3*t;3*t+12>r;++r)j.prevPosition.values.push(E[r]),j.nextPosition.values.push(f[r]);for(r=2*t;2*t+8>r;++r)j.expandAndWidth.values.push(m[r]),c(h)&&j.st.values.push(h[r]);if(c(d))for(r=4*t;4*t+16>r;++r)j.color.values.push(d[r]);a=j.position.values.length/3-4,Q.push(a,a+2,a+1),Q.push(a+1,a+2,a+3)}}Z(e,R,p)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case C.TRIANGLES:e.indices=I(t);break;case C.TRIANGLE_STRIP:e.indices=O(t);break;case C.TRIANGLE_FAN:e.indices=M(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=C.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=u(t,"normal"),n=u(n,1e4);for(var o=e.attributes.position.values,i=e.attributes[t].values,a=o.length,l=new Float64Array(2*a),E=0,f=0;a>f;f+=3)l[E++]=o[f],l[E++]=o[f+1],l[E++]=o[f+2],l[E++]=o[f]+i[f]*n,l[E++]=o[f+1]+i[f+1]*n,l[E++]=o[f+2]+i[f+2]*n;var d,p=e.boundingSphere;return c(p)&&(d=new r(p.center,p.radius+n)),new m({attributes:{position:new h({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:C.LINES,boundingSphere:d})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],n=e.attributes,o={},i=0,a=r.length;for(t=0;a>t;++t){var s=r[t];c(n[s])&&(o[s]=i++)}for(var u in n)n.hasOwnProperty(u)&&!c(o[u])&&(o[u]=i++);return o},te.reorderForPreVertexCache=function(e){var t=m.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),o=0;t>o;o++)n[o]=-1;for(var i,a=r,u=a.length,l=R.createTypedArray(t,u),E=0,f=0,h=0;u>E;)i=n[a[E]],-1!==i?l[f]=i:(i=a[E],n[i]=h,l[f]=h,++h),++E,++f;e.indices=l;var d=e.attributes;for(var p in d)if(d.hasOwnProperty(p)&&c(d[p])&&c(d[p].values)){for(var T=d[p],A=T.values,_=0,y=T.componentsPerAttribute,S=s.createTypedArray(T.componentDatatype,h*y);t>_;){var v=n[_];if(-1!==v)for(o=0;y>o;o++)S[y*v+o]=A[y*_+o];++_}T.values=S}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===C.TRIANGLES&&c(r)){for(var n=r.length,o=0,i=0;n>i;i++)r[i]>o&&(o=r[i]);e.indices=N.tipsify({indices:r,maximumIndex:o,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=m.computeNumberOfVertices(e);if(c(e.indices)&&r>=_.SIXTY_FOUR_KILOBYTES){var n,o=[],i=[],a=0,s=L(e.attributes),u=e.indices,l=u.length;e.primitiveType===C.TRIANGLES?n=3:e.primitiveType===C.LINES?n=2:e.primitiveType===C.POINTS&&(n=1);for(var E=0;l>E;E+=n){for(var f=0;n>f;++f){var h=u[E+f],d=o[h];c(d)||(d=a++,o[h]=d,F(s,e.attributes,h)),i.push(d)}a+n>=_.SIXTY_FOUR_KILOBYTES&&(t.push(new m({attributes:s,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),o=[],i=[],a=0,s=L(e.attributes))}0!==i.length&&t.push(new m({attributes:s,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new o,ne=new a;te.projectTo2D=function(e,t,r,n,i){var a=e.attributes[t];i=c(i)?i:new f;for(var u=i.ellipsoid,E=a.values,m=new Float64Array(E.length),d=0,p=0;p<E.length;p+=3){var R=o.fromArray(E,p,re),T=u.cartesianToCartographic(R,ne);if(!c(T))throw new l("Could not project point ("+R.x+", "+R.y+", "+R.z+") to 2D.");var A=i.project(T,re);m[d++]=A.x,m[d++]=A.y,m[d++]=A.z}return e.attributes[r]=a,e.attributes[n]=new h({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:m}),delete e.attributes[t],e};var oe={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var o=e.attributes[t],i=o.values,a=i.length,u=new Float32Array(a),c=new Float32Array(a),l=0;a>l;++l)E.encode(i[l],oe),u[l]=oe.high,c[l]=oe.low;var f=o.componentsPerAttribute;return e.attributes[r]=new h({componentDatatype:s.FLOAT,componentsPerAttribute:f,values:u}),e.attributes[n]=new h({componentDatatype:s.FLOAT,componentsPerAttribute:f,values:c}),delete e.attributes[t],e};var ie=new o,ae=new S,se=new y;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(S.equals(t,S.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))&&(S.inverse(t,ae),S.transpose(ae,ae),S.getRotation(ae,se),w(se,n.normal),w(se,n.binormal),w(se,n.tangent));var o=e.geometry.boundingSphere;return c(o)&&(e.geometry.boundingSphere=r.transform(o,t,o)),e.modelMatrix=S.clone(S.IDENTITY),e};var ue=new o;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,o=0;n>o;++o){var i=e[o];c(i.geometry)?t.push(i):r.push(i)}var a=[];return t.length>0&&a.push(b(t,"geometry")),r.length>0&&(a.push(b(r,"westHemisphereGeometry")),a.push(b(r,"eastHemisphereGeometry"))),a};var ce=new o,le=new o,Ee=new o,fe=new o;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,a=t.length,u=new Array(i),c=new Array(a/3),l=new Array(a),E=0;i>E;E++)u[E]={indexOffset:0,count:0,currentCount:0};var f=0;for(E=0;a>E;E+=3){var m=t[E],d=t[E+1],p=t[E+2],R=3*m,T=3*d,A=3*p;le.x=n[R],le.y=n[R+1],le.z=n[R+2],Ee.x=n[T],Ee.y=n[T+1],Ee.z=n[T+2],fe.x=n[A],fe.y=n[A+1],fe.z=n[A+2],u[m].count++,u[d].count++,u[p].count++,o.subtract(Ee,le,Ee),o.subtract(fe,le,fe),c[f]=o.cross(Ee,fe,new o),f++}var _=0;for(E=0;i>E;E++)u[E].indexOffset+=_,_+=u[E].count;f=0;var y;for(E=0;a>E;E+=3){y=u[t[E]];var S=y.indexOffset+y.currentCount;l[S]=f,y.currentCount++,y=u[t[E+1]],S=y.indexOffset+y.currentCount,l[S]=f,y.currentCount++,y=u[t[E+2]],S=y.indexOffset+y.currentCount,l[S]=f,y.currentCount++,f++}var v=new Float32Array(3*i);for(E=0;i>E;E++){var C=3*E;if(y=u[E],y.count>0){for(o.clone(o.ZERO,ce),f=0;f<y.count;f++)o.add(ce,c[l[y.indexOffset+f]],ce);o.normalize(ce,ce),v[C]=ce.x,v[C+1]=ce.y,v[C+2]=ce.z}else v[C]=0,v[C+1]=0,v[C+2]=1}return e.attributes.normal=new h({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:v}),e};var me=new o,he=new o,de=new o;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,a=e.attributes.position.values.length/3,u=t.length,c=new Array(3*a),l=0;l<c.length;l++)c[l]=0;var E,f,m; +for(l=0;u>l;l+=3){var d=t[l],p=t[l+1],R=t[l+2];E=3*d,f=3*p,m=3*R;var T=2*d,A=2*p,_=2*R,y=r[E],S=r[E+1],v=r[E+2],C=i[T],N=i[T+1],g=i[A+1]-N,I=i[_+1]-N,O=1/((i[A]-C)*I-(i[_]-C)*g),M=(I*(r[f]-y)-g*(r[m]-y))*O,L=(I*(r[f+1]-S)-g*(r[m+1]-S))*O,F=(I*(r[f+2]-v)-g*(r[m+2]-v))*O;c[E]+=M,c[E+1]+=L,c[E+2]+=F,c[f]+=M,c[f+1]+=L,c[f+2]+=F,c[m]+=M,c[m+1]+=L,c[m+2]+=F}var P=new Float32Array(3*a),w=new Float32Array(3*a);for(l=0;a>l;l++){E=3*l,f=E+1,m=E+2;var D=o.fromArray(n,E,me),b=o.fromArray(c,E,de),x=o.dot(D,b);o.multiplyByScalar(D,x,he),o.normalize(o.subtract(b,he,b),b),w[E]=b.x,w[f]=b.y,w[m]=b.z,o.normalize(o.cross(D,b,b),b),P[E]=b.x,P[f]=b.y,P[m]=b.z}return e.attributes.tangent=new h({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:w}),e.attributes.binormal=new h({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:P}),e};var pe=new n,Re=new o,Te=new o,Ae=new o;te.compressVertices=function(t){var r=t.attributes.normal,i=t.attributes.st;if(!c(r)&&!c(i))return t;var a,u,l,E,f=t.attributes.tangent,m=t.attributes.binormal;c(r)&&(a=r.values),c(i)&&(u=i.values),c(f)&&(l=f.values),m&&(E=m.values);var d=c(a)?a.length:u.length,p=c(a)?3:2,R=d/p,T=R,A=c(u)&&c(a)?2:1;A+=c(l)||c(E)?1:0,T*=A;for(var _=new Float32Array(T),y=0,S=0;R>S;++S){c(u)&&(n.fromArray(u,2*S,pe),_[y++]=e.compressTextureCoordinates(pe));var v=3*S;c(a)&&c(l)&&c(E)?(o.fromArray(a,v,Re),o.fromArray(l,v,Te),o.fromArray(E,v,Ae),e.octPack(Re,Te,Ae,pe),_[y++]=pe.x,_[y++]=pe.y):(c(a)&&(o.fromArray(a,v,Re),_[y++]=e.octEncodeFloat(Re)),c(l)&&(o.fromArray(l,v,Re),_[y++]=e.octEncodeFloat(Re)),c(E)&&(o.fromArray(E,v,Re),_[y++]=e.octEncodeFloat(Re)))}return t.attributes.compressedAttributes=new h({componentDatatype:s.FLOAT,componentsPerAttribute:A,values:_}),c(a)&&delete t.attributes.normal,c(u)&&delete t.attributes.st,c(l)&&delete t.attributes.tangent,c(E)&&delete t.attributes.binormal,t};var _e=new o,ye=new o,Se=new o,ve=new o,Ce=new o,Ne={positions:new Array(7),indices:new Array(9)},ge=new o,Ie=new o,Oe=new o,Me=new o,Le=new n,Fe=new n,Pe=new n,we=v.fromPointNormal(o.ZERO,o.UNIT_Y),De=new o,be=new o,xe=new n,Ue=new n,Be=new o,Ge=new o,ze=new o,Ve=new o,He=new o,qe=new o,We=new o,Ye=new i;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var o=n.center.x-n.radius;if(o>0||r.intersectPlane(n,v.ORIGIN_ZX_PLANE)!==T.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:$(e)}else H(t),t.primitiveType===C.TRIANGLES?J(e):t.primitiveType===C.LINES&&$(e);return e},te}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,o,i,a,s){"use strict";function u(e){this._ellipsoid=r(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return o(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.mercatorAngleToGeodeticLatitude=function(e){return s.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},u.geodeticLatitudeToMercatorAngle=function(e){e>u.MaximumLatitude?e=u.MaximumLatitude:e<-u.MaximumLatitude&&(e=-u.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},u.MaximumLatitude=u.mercatorAngleToGeodeticLatitude(Math.PI),u.prototype.project=function(t,r){var o=this._semimajorAxis,i=t.longitude*o,a=u.geodeticLatitudeToMercatorAngle(t.latitude)*o,s=t.height;return n(r)?(r.x=i,r.y=a,r.z=s,r):new e(i,a,s)},u.prototype.unproject=function(e,r){var o=this._oneOverSemimajorAxis,i=e.x*o,a=u.mercatorAngleToGeodeticLatitude(e.y*o),s=e.z;return n(r)?(r.longitude=i,r.latitude=a,r.height=s,r):new t(i,a,s)},u}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,n,o,i,a,s,u,c,l,E,f,m,h,d){"use strict";function p(e,t,r){var n,o=!r,i=e.length;if(!o&&i>1){var a=e[0].modelMatrix;for(n=1;i>n;++n)if(!h.equals(a,e[n].modelMatrix)){o=!0;break}}if(o)for(n=0;i>n;++n)f.transformToWorldCoordinates(e[n]);else h.multiplyTransformation(t,e[0].modelMatrix,t)}function R(e,n){var o=e.attributes,i=o.position,a=4*(i.values.length/i.componentsPerAttribute);o.pickColor=new l({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0,values:new Uint8Array(a)});for(var s=t.floatToByte(n.red),u=t.floatToByte(n.green),c=t.floatToByte(n.blue),E=t.floatToByte(n.alpha),f=o.pickColor.values,m=0;a>m;m+=4)f[m]=s,f[m+1]=u,f[m+2]=c,f[m+3]=E}function T(e,t){for(var r=e.length,n=0;r>n;++n){var i=e[n],a=t[n];o(i.geometry)?R(i.geometry,a):(R(i.westHemisphereGeometry,a),R(i.eastHemisphereGeometry,a))}}function A(e){var t,r=e.length,n=[],i=e[0].attributes;for(t in i)if(i.hasOwnProperty(t)){for(var a=i[t],s=!0,u=1;r>u;++u){var c=e[u].attributes[t];if(!o(c)||a.componentDatatype!==c.componentDatatype||a.componentsPerAttribute!==c.componentsPerAttribute||a.normalize!==c.normalize){s=!1;break}}s&&n.push(t)}return n}function _(e,t,n){for(var o=c.computeNumberOfVertices(t),i=n.length,a=0;i>a;++a){for(var s=n[a],u=e[s],E=u.componentDatatype,f=u.value,m=f.length,h=r.createTypedArray(E,o*m),d=0;o>d;++d)h.set(f,d*m);t.attributes[s]=new l({componentDatatype:E,componentsPerAttribute:m,normalize:u.normalize,values:h})}}function y(e,t){for(var r=e.length,n=0;r>n;++n){var i=e[n],a=i.attributes;o(i.geometry)?_(a,i.geometry,t):(_(a,i.westHemisphereGeometry,t),_(a,i.eastHemisphereGeometry,t))}}function S(t){var n,i,a=t.instances,s=t.pickIds,u=t.projection,c=t.elementIndexUintSupported,l=t.scene3DOnly,E=t.allowPicking,m=t.vertexCacheOptimize,h=t.compressVertices,d=t.modelMatrix,R=a.length;a[0].geometry.primitiveType;if(p(a,d,l),!l)for(n=0;R>n;++n)f.splitLongitude(a[n]);E&&T(a,s);var _=A(a);if(y(a,_),m)for(n=0;R>n;++n){var S=a[n];o(S.geometry)?(f.reorderForPostVertexCache(S.geometry),f.reorderForPreVertexCache(S.geometry)):(f.reorderForPostVertexCache(S.westHemisphereGeometry),f.reorderForPreVertexCache(S.westHemisphereGeometry),f.reorderForPostVertexCache(S.eastHemisphereGeometry),f.reorderForPreVertexCache(S.eastHemisphereGeometry))}var v=f.combineInstances(a);for(R=v.length,n=0;R>n;++n){i=v[n];var C,N=i.attributes;if(l)for(C in N)N.hasOwnProperty(C)&&N[C].componentDatatype===r.DOUBLE&&f.encodeAttribute(i,C,C+"3DHigh",C+"3DLow");else for(C in N)if(N.hasOwnProperty(C)&&N[C].componentDatatype===r.DOUBLE){var g=C+"3D",I=C+"2D";f.projectTo2D(i,C,g,I,u),o(i.boundingSphere)&&"position"===C&&(i.boundingSphereCV=e.fromVertices(i.attributes.position2D.values)),f.encodeAttribute(i,g,g+"High",g+"Low"),f.encodeAttribute(i,I,I+"High",I+"Low")}h&&f.compressVertices(i)}if(!c){var O=[];for(R=v.length,n=0;R>n;++n)i=v[n],O=O.concat(f.fitToUnsignedShortIndices(i));v=O}return v}function v(e,t,n){for(var o=[],i=e.attributes,a=n.length,s=0;a>s;++s){var u=n[s],c=i[u],l=c.componentDatatype;l===r.DOUBLE&&(l=r.FLOAT);var E=r.createTypedArray(l,c.values);o.push({index:t[u],componentDatatype:l,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,values:E}),delete i[u]}return o}function C(e,t,r,i,a,s,u,l,E){var f=c.computeNumberOfVertices(t);o(u[e])||(u[e]={boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV});for(var m=i.length,h=0;m>h;++h)for(var d=i[h],p=a[d],R=f;R>0;){for(var T,A=n(E[d],0),_=s[A],y=_.length,S=0;y>S&&(T=_[S],T.index!==p);++S);o(u[e][d])||(u[e][d]={dirty:!1,valid:!0,value:r[d].value,indices:[]});var v,C=T.values.length/T.componentsPerAttribute,N=n(l[d],0);C>N+R?(v=R,u[e][d].indices.push({attribute:T,offset:N,count:v}),l[d]=N+R):(v=C-N,u[e][d].indices.push({attribute:T,offset:N,count:v}),l[d]=0,E[d]=A+1),R-=v}}function N(e,t,r,n,i){var a,s,u,c=[],l=e.length,E={},f={};for(a=0;l>a;++a)s=e[a],u=s.attributes,o(s.geometry)&&C(a,s.geometry,u,i,n,r,c,E,f);for(a=0;l>a;++a)s=e[a],u=s.attributes,o(s.westHemisphereGeometry)&&C(a,s.westHemisphereGeometry,u,i,n,r,c,E,f);for(a=0;l>a;++a)s=e[a],u=s.attributes,o(s.eastHemisphereGeometry)&&C(a,s.eastHemisphereGeometry,u,i,n,r,c,E,f);for(l=t.length,a=0;l>a;++a){s=t[a],u=s.attributes;var m={};c.push(m);for(var h=i.length,d=0;h>d;++d){var p=i[d];m[p]={dirty:!1,valid:!1,value:u[p].value,indices:[]}}}return c}function g(e,t,r,n){var i,a,s,u=n.length-1;if(u>=0){var c=n[u];i=c.offset+c.count,s=c.index,a=r[s].indices.length}else i=0,s=0,a=r[s].indices.length;for(var l=e.length,E=0;l>E;++E){var f=e[E],m=f[t];if(o(m)){var h=m.indices.length;i+h>a&&(i=0,a=r[++s].indices.length),n.push({index:s,offset:i,count:h}),i+=h}}}function I(e,t){var r=[];return g(e,"geometry",t,r),g(e,"westHemisphereGeometry",t,r),g(e,"eastHemisphereGeometry",t,r),r}function O(e,t){var r=e.attributes;for(var n in r)if(r.hasOwnProperty(n)){var i=r[n];o(i)&&o(i.values)&&t.push(i.values.buffer)}o(e.indices)&&t.push(e.indices.buffer)}function M(e,t){for(var r=e.length,n=0;r>n;++n)O(e[n],t)}function L(e,t){for(var r=e.length,n=0;r>n;++n)for(var o=e[n],i=o.length,a=0;i>a;++a)t.push(o[a].values.buffer)}function F(t){for(var r=1,n=t.length,i=0;n>i;i++){var a=t[i];if(++r,o(a)){var s=a.attributes;r+=6+2*e.packedLength+(o(a.indices)?a.indices.length:0);for(var u in s)if(s.hasOwnProperty(u)&&o(s[u])){var c=s[u];r+=5+c.values.length}}}return r}function P(e,t){for(var r=e.length,n=new Uint32Array(e.length),o=0;r>o;++o)n[o]=e[o].toRgba();return t.push(n.buffer),n}function w(e){for(var r=e.length,n=new Array(r),o=0;r>o;o++)n[o]=t.fromRgba(e[o]);return n}function D(e){for(var t=e.length,r=1+17*t,n=0;t>n;n++){var i=e[n].attributes;for(var a in i)if(i.hasOwnProperty(a)&&o(i[a])){var s=i[a];r+=5+s.value.length}}return r}function b(e,t){var r=new Float64Array(D(e)),n={},i=[],a=e.length,s=0;r[s++]=a;for(var u=0;a>u;u++){var c=e[u];h.pack(c.modelMatrix,r,s),s+=h.packedLength;var l=c.attributes,E=[];for(var f in l)l.hasOwnProperty(f)&&o(l[f])&&(E.push(f),o(n[f])||(n[f]=i.length,i.push(f)));r[s++]=E.length;for(var m=0;m<E.length;m++){var d=E[m],p=l[d];r[s++]=n[d],r[s++]=p.componentDatatype,r[s++]=p.componentsPerAttribute,r[s++]=p.normalize,r[s++]=p.value.length,r.set(p.value,s),s+=p.value.length}}return t.push(r.buffer),{stringTable:i,packedData:r}}function x(e){for(var t=e.packedData,n=e.stringTable,o=new Array(t[0]),i=0,a=1;a<t.length;){var s=h.unpack(t,a);a+=h.packedLength;for(var u={},c=t[a++],l=0;c>l;l++){for(var E=n[t[a++]],f=t[a++],m=t[a++],d=0!==t[a++],p=t[a++],R=r.createTypedArray(f,p),T=0;p>T;T++)R[T]=t[a++];u[E]={componentDatatype:f,componentsPerAttribute:m,normalize:d,value:R}}o[i++]={attributes:u,modelMatrix:s}}return o}function U(t){for(var r=t.length,n=1+r,i=0;r>i;i++){var a=t[i];n+=2,n+=o(a.boundingSphere)?e.packedLength:0,n+=o(a.boundingSphereCV)?e.packedLength:0;for(var s in a)if(a.hasOwnProperty(s)&&o(a[s])&&"boundingSphere"!==s&&"boundingSphereCV"!==s){var u=a[s];n+=4+3*u.indices.length+u.value.length}}return n}function B(t,r){var n=new Float64Array(U(t)),i=[],a=[],s={},u=t.length,c=0;n[c++]=u;for(var l=0;u>l;l++){var E=t[l],f=E.boundingSphere,m=o(f);n[c++]=m?1:0,m&&(e.pack(f,n,c),c+=e.packedLength),f=E.boundingSphereCV,m=o(f),n[c++]=m?1:0,m&&(e.pack(f,n,c),c+=e.packedLength);var h=[];for(var d in E)E.hasOwnProperty(d)&&o(E[d])&&"boundingSphere"!==d&&"boundingSphereCV"!==d&&(h.push(d),o(s[d])||(s[d]=i.length,i.push(d)));n[c++]=h.length;for(var p=0;p<h.length;p++){var R=h[p],T=E[R];n[c++]=s[R],n[c++]=T.valid?1:0;var A=T.indices,_=A.length;n[c++]=_;for(var y=0;_>y;y++){var S=A[y];n[c++]=S.count,n[c++]=S.offset;var v=a.indexOf(S.attribute);-1===v&&(v=a.length,a.push(S.attribute)),n[c++]=v}n[c++]=T.value.length,n.set(T.value,c),c+=T.value.length}}return r.push(n.buffer),{stringTable:i,packedData:n,attributeTable:a}}function G(t,n){for(var o=t.stringTable,i=t.attributeTable,a=t.packedData,s=new Array(a[0]),u=0,c=1,l=a.length;l>c;){var E={},f=1===a[c++];f&&(E.boundingSphere=e.unpack(a,c),c+=e.packedLength),f=1===a[c++],f&&(E.boundingSphereCV=e.unpack(a,c),c+=e.packedLength);for(var m=a[c++],h=0;m>h;h++){for(var d=o[a[c++]],p=1===a[c++],R=a[c++],T=R>0?new Array(R):void 0,A=0;R>A;A++){var _={};_.count=a[c++],_.offset=a[c++],_.attribute=i[a[c++]],T[A]=_}for(var y=a[c++],S=p?r.createTypedArray(T[0].attribute.componentDatatype,y):new Array(y),v=0;y>v;v++)S[v]=a[c++];E[d]={dirty:!1,valid:p,indices:T,value:S}}s[u++]=E}return s}if(!s.supportsTypedArrays())return{};var z={};return z.combineGeometry=function(e){var t,r,n,i,a,s=e.instances,u=e.invalidInstances;if(s.length>0){t=S(e),r=f.createAttributeLocations(t[0]),i=A(s),n=[],a=t.length;for(var c=0;a>c;++c){var l=t[c];n.push(v(l,r,i))}}i=o(i)?i:A(u);var E,m=N(s,u,n,r,i);return e.createPickOffsets&&o(t)&&(E=I(s,t)),{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:r,vaAttributes:n,vaAttributeLocations:m,validInstancesIndices:e.validInstancesIndices,invalidInstancesIndices:e.invalidInstancesIndices,pickOffsets:E}},z.packCreateGeometryResults=function(t,r){var n=new Float64Array(F(t)),i=[],a={},s=t.length,u=0;n[u++]=s;for(var c=0;s>c;c++){var l=t[c],E=o(l);if(n[u++]=E?1:0,E){n[u++]=l.primitiveType,n[u++]=l.geometryType;var f=o(l.boundingSphere)?1:0;n[u++]=f,f&&e.pack(l.boundingSphere,n,u),u+=e.packedLength;var m=o(l.boundingSphereCV)?1:0;n[u++]=m,m&&e.pack(l.boundingSphereCV,n,u),u+=e.packedLength;var h=l.attributes,d=[];for(var p in h)h.hasOwnProperty(p)&&o(h[p])&&(d.push(p),o(a[p])||(a[p]=i.length,i.push(p)));n[u++]=d.length;for(var R=0;R<d.length;R++){var T=d[R],A=h[T];n[u++]=a[T],n[u++]=A.componentDatatype,n[u++]=A.componentsPerAttribute,n[u++]=A.normalize?1:0,n[u++]=A.values.length,n.set(A.values,u),u+=A.values.length}var _=o(l.indices)?l.indices.length:0;n[u++]=_,_>0&&(n.set(l.indices,u),u+=_)}}return r.push(n.buffer),{stringTable:i,packedData:n}},z.unpackCreateGeometryResults=function(t){for(var n,o=t.stringTable,i=t.packedData,a=new Array(i[0]),s=0,u=1;u<i.length;){var f=1===i[u++];if(f){var h,d,p=i[u++],R=i[u++],T=1===i[u++];T&&(h=e.unpack(i,u)),u+=e.packedLength;var A=1===i[u++];A&&(d=e.unpack(i,u)),u+=e.packedLength;var _,y,S,v=new E,C=i[u++];for(n=0;C>n;n++){var N=o[i[u++]],g=i[u++];S=i[u++];var I=0!==i[u++];_=i[u++],y=r.createTypedArray(g,_);for(var O=0;_>O;O++)y[O]=i[u++];v[N]=new l({componentDatatype:g,componentsPerAttribute:S,normalize:I,values:y})}var M;if(_=i[u++],_>0){var L=y.length/S;for(M=m.createTypedArray(L,_),n=0;_>n;n++)M[n]=i[u++]}a[s++]=new c({primitiveType:p,geometryType:R,boundingSphere:h,indices:M,attributes:v})}else a[s++]=void 0}return a},z.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,n=r.length,o=0;n>o;o++)t.push(r[o].packedData.buffer);var i;return e.allowPicking&&(i=P(e.pickIds,t)),{createGeometryResults:e.createGeometryResults,packedInstances:b(e.instances,t),packedPickIds:i,ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof u,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},z.unpackCombineGeometryParameters=function(e){for(var t=x(e.packedInstances),r=e.allowPicking,n=r?w(e.packedPickIds):void 0,i=e.createGeometryResults,s=i.length,c=0,l=[],E=[],f=[],m=[],p=[],R=0;s>R;R++)for(var T=z.unpackCreateGeometryResults(i[R]),A=T.length,_=0;A>_;_++){var y=T[_],S=t[c];o(y)?(S.geometry=y,l.push(S),f.push(c),r&&p.push(n[c])):(E.push(S),m.push(c)),++c}var v=a.clone(e.ellipsoid),C=e.isGeographic?new u(v):new d(v);return{instances:l,invalidInstances:E,validInstancesIndices:f,invalidInstancesIndices:m,pickIds:p,ellipsoid:v,projection:C,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:h.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},z.packCombineGeometryResults=function(e,t){return o(e.geometries)&&(M(e.geometries,t),L(e.vaAttributes,t)),{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,packedVaAttributeLocations:B(e.vaAttributeLocations,t),modelMatrix:e.modelMatrix,validInstancesIndices:e.validInstancesIndices,invalidInstancesIndices:e.invalidInstancesIndices,pickOffsets:e.pickOffsets}},z.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,perInstanceAttributeLocations:G(e.packedVaAttributeLocations,e.vaAttributes),modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets}},z}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var r,n=t.name,o=t.message;r=e(n)&&e(o)?n+": "+o: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 o,i=[],a={id:void 0,result:void 0,error:void 0};return function(s){var u=s.data;i.length=0,a.id=u.id,a.error=void 0,a.result=void 0;try{a.result=n(u.parameters,i)}catch(c){c instanceof Error?a.error={name:c.name,message:c.message,stack:c.stack}:a.error=c}t(o)||(o=e(self.webkitPostMessage,self.postMessage)),u.canTransferArrayBuffer||(i.length=0);try{o(a,i)}catch(c){a.result=void 0,a.error="postMessage failed with error: "+r(c)+"\n with responseMessage: "+JSON.stringify(a),o(a)}}}return n}),define("Workers/combineGeometry",["../Scene/PrimitivePipeline","./createTaskProcessorWorker"],function(e,t){"use strict";function r(t,r){var n=e.unpackCombineGeometryParameters(t),o=e.combineGeometry(n);return e.packCombineGeometryResults(o,r)}return t(r)})}(); \ No newline at end of file diff --git a/Workers/createBoxGeometry.js b/Workers/createBoxGeometry.js index b511307..42ab0c5 100644 --- a/Workers/createBoxGeometry.js +++ b/Workers/createBoxGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,5 +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";var t=function(t){return void 0!==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";var e=function(t,e){return void 0!==t?t:e};return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";var e=function(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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("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^=2636928640&t<<7,t^=4022730752&t<<15,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){"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(t){return t>0?1:0>t?-1:0},n.signNotZero=function(t){return 0>t?-1:1},n.toSNorm=function(t){return Math.round(255*(.5*n.clamp(t,-1,1)+.5))},n.fromSNorm=function(t){return 2*(n.clamp(t,0,255)/255)-1},n.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},n.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},n.lerp=function(t,e,n){return(1-n)*t+n*e},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(t){return t*n.RADIANS_PER_DEGREE},n.toDegrees=function(t){return t*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(t){var e=n.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},n.negativePiToPi=function(t){for(var e=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+e)>t;)t+=i;if(-r>t)return-r;for(;t>r+e;)t-=i;return t>r?r:t},n.zeroToTwoPi=function(t){var e=t%n.TWO_PI;return 0>e?(e+n.TWO_PI)%n.TWO_PI:e},n.equalsEpsilon=function(t,n,r){return r=e(r,0),Math.abs(t-n)<=r};var r=[1];n.factorial=function(t){var e=r.length;if(t>=e)for(var n=r[e-1],i=e;t>=i;i++)r.push(n*i);return r[t]},n.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},n.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},n.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},n.clamp=function(t,e,n){return e>t?e:t>n?n:t};var i=new t;return n.setRandomNumberSeed=function(e){i=new t(e)},n.nextRandomNumber=function(){return i.random()},n.acosClamped=function(t){return Math.acos(n.clamp(t,-1,1))},n.asinClamped=function(t){return Math.asin(n.clamp(t,-1,1))},n}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)};a.fromSpherical=function(n,r){e(r)||(r=new a);var i=n.clock,o=n.cone,u=t(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(t,n,r,i){return e(i)?(i.x=t,i.y=n,i.z=r,i):new a(t,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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.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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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 s=new a,c=new a;a.angleBetween=function(t,e){a.normalize(t,s),a.normalize(e,c);var n=a.dot(s,c),r=a.magnitude(a.cross(s,c,s));return Math.atan2(r,n)};var l=new a;a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,l);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):n.y<=n.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r},a.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,s=e.z,c=i*s-a*u,l=a*o-r*s,h=r*u-i*o;return n.x=c,n.y=l,n.z=h,n},a.fromDegrees=function(t,e,n,r,o){var u=i.toRadians(t),s=i.toRadians(e);return a.fromRadians(u,s,n,r,o)};var h=new a,f=new a,d=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=t(i,0);var s=e(o)?o.radiiSquared:d,c=Math.cos(r);h.x=c*Math.cos(n),h.y=c*Math.sin(n),h.z=Math.sin(r),h=a.normalize(h,h),a.multiplyComponents(s,h,f);var l=Math.sqrt(a.dot(h,f));return f=a.divideByScalar(f,l,f),h=a.multiplyByScalar(h,i,h),e(u)||(u=new a),a.add(f,h,u)},a.fromDegreesArray=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=i.toRadians(t[o]);return a.fromRadiansArray(r,e,n)},a.fromRadiansArray=function(t,n,r){var i=t.length;e(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],s=t[o+1];r[o/2]=a.fromRadians(u,s,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o+=3)r[o]=i.toRadians(t[o]),r[o+1]=i.toRadians(t[o+1]),r[o+2]=t[o+2];return a.fromRadiansArrayHeights(r,e,n)},a.fromRadiansArrayHeights=function(t,n,r){var i=t.length;e(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],s=t[o+1],c=t[o+2];r[o/3]=a.fromRadians(u,s,c,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)};return a.fromRadians=function(n,r,i,o){return i=t(i,0),e(o)?(o.longitude=n,o.latitude=r,o.height=i,o):new a(n,r,i)},a.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),a.fromRadians(t,e,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new a(t.longitude,t.latitude,t.height):void 0},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.longitude-n.longitude)<=r&&Math.abs(t.latitude-n.latitude)<=r&&Math.abs(t.height-n.height)<=r},a.ZERO=r(new a(0,0,0)),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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),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"],function(t,e,n,r,i,a,o,u){"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}var c=function(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,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))return void 0;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.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),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=s,n.z=c,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 l=new t,h=new t;c.prototype.cartographicToCartesian=function(e,n){var i=l,a=h;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;n>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var f=new t,d=new t,m=new t;c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,d);if(!r(a))return void 0;var o=this.geodeticSurfaceNormal(a,f),s=t.subtract(n,a,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),h=u.sign(t.dot(s,n))*t.magnitude(s);return r(i)?(i.longitude=c,i.latitude=l,i.height=h,i):new e(c,l,h)},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;n>i;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e};var y=new t,p=new t;return c.prototype.scaleToGeodeticSurface=function(e,n){var i=e.x,a=e.y,o=e.z,s=this._oneOverRadii,c=s.x,l=s.y,h=s.z,f=i*i*c*c,d=a*a*l*l,m=o*o*h*h,v=f+d+m,w=Math.sqrt(1/v),x=t.multiplyByScalar(e,w,y);if(v<this._centerToleranceSquared)return isFinite(w)?t.clone(x,n):void 0;var E=this._oneOverRadiiSquared,g=E.x,z=E.y,M=E.z,S=p;S.x=2*x.x*g,S.y=2*x.y*z,S.z=2*x.z*M;var O,T,R,_,N,I,b,A,P,C,L,q=(1-w)*t.magnitude(e)/(.5*t.magnitude(S)),U=0;do{q-=U,R=1/(1+q*g),_=1/(1+q*z),N=1/(1+q*M),I=R*R,b=_*_,A=N*N,P=I*R,C=b*_,L=A*N,O=f*I+d*b+m*A-1,T=f*P*g+d*C*z+m*L*M;var D=-2*T;U=O/D}while(Math.abs(O)>u.EPSILON12);return r(n)?(n.x=i*R,n.y=a*_,n.z=o*N,n):new t(i*R,a*_,o*N)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,s,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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";var u=function(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";var e=function(e,n){this.start=t(e,0),this.stop=t(n,0)};return e}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";var i=function(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)};i.fromElements=function(t,n,r,a,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=a,o):new i(t,n,r,a)},i.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 i(t.red,t.green,t.blue,t.alpha)},i.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new i(t.x,t.y,t.z,t.w):void 0},i.packedLength=4,i.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r++],a.w=n[r],a},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,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},i.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},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 a=new i;i.distance=function(t,e){return i.subtract(t,e,a),i.magnitude(a)},i.normalize=function(t,e){var n=i.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,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,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},i.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},i.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},i.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},i.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},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 o=new i;i.lerp=function(t,e,n,r){return i.multiplyByScalar(e,n,o),r=i.multiplyByScalar(t,1-n,r),i.add(o,r,r)};var u=new i;return i.mostOrthogonalAxis=function(t,e){var n=i.normalize(t,u);return i.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?i.clone(i.UNIT_X,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e):n.y<=n.z?n.y<=n.w?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e)},i.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},i.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r&&Math.abs(t.w-n.w)<=r},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(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e){return i.equalsEpsilon(this,t,e)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t){for(var e=0,n=0;9>n;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function u(t){for(var e=0,n=0;3>n;++n){var r=t[c.getElementIndex(d[n],f[n])];e+=2*r*r}return Math.sqrt(e)}function s(t,e){for(var n=a.EPSILON15,r=0,i=1,o=0;3>o;++o){var u=Math.abs(t[c.getElementIndex(d[o],f[o])]);u>r&&(i=o,r=u)}var s=1,l=0,h=f[i],m=d[i];if(Math.abs(t[c.getElementIndex(m,h)])>n){var y,p=t[c.getElementIndex(m,m)],v=t[c.getElementIndex(h,h)],w=t[c.getElementIndex(m,h)],x=(p-v)/2/w;y=0>x?-1/(-x+Math.sqrt(1+x*x)):1/(x+Math.sqrt(1+x*x)),s=1/Math.sqrt(1+y*y),l=y*s}return e=c.clone(c.IDENTITY,e),e[c.getElementIndex(h,h)]=e[c.getElementIndex(m,m)]=s,e[c.getElementIndex(m,h)]=l,e[c.getElementIndex(h,m)]=-l,e}var c=function(t,n,r,i,a,o,u,s,c){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(s,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(c,0)};c.clone=function(t,e){return n(t)?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 c(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},c.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new c),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},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[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 c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},c.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,u=t.y*t.y,s=t.y*t.z,l=t.y*t.w,h=t.z*t.z,f=t.z*t.w,d=t.w*t.w,m=r-u-h+d,y=2*(i-f),p=2*(a+l),v=2*(i+f),w=-r+u-h+d,x=2*(s-o),E=2*(a-l),g=2*(s+o),z=-r-u+h+d;return n(e)?(e[0]=m,e[1]=v,e[2]=E,e[3]=y,e[4]=w,e[5]=g,e[6]=p,e[7]=x,e[8]=z,e):new c(m,y,p,v,w,x,E,g,z)},c.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 c(t.x,0,0,0,t.y,0,0,0,t.z)},c.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 c(t,0,0,0,t,0,0,0,t)},c.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 c(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},c.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 c(1,0,0,0,r,-i,0,i,r)},c.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 c(r,0,i,0,1,0,-i,0,r)},c.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 c(r,-i,0,i,r,0,0,0,1)},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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},c.getElementIndex=function(t,e){return 3*t+e},c.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},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},c.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},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,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[3],e[4],e[5],l)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],l)),n};var h=new t;c.getMaximumScale=function(e){return c.getScale(e,h),t.maximumComponent(h)},c.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],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],c=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],h=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]=s,n[6]=c,n[7]=l,n[8]=h,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},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},c.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,s=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=s,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},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},c.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],s=t[2],c=t[5],l=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=s,e[7]=c,e[8]=l,e};var f=[1,0,0],d=[2,2,1],m=new c,y=new c;return c.computeEigenDecomposition=function(t,e){var r=a.EPSILON20,i=10,l=0,h=0;n(e)||(e={});for(var f=e.unitary=c.clone(c.IDENTITY,e.unitary),d=e.diagonal=c.clone(t,e.diagonal),p=r*o(d);i>h&&u(d)>p;)s(d,m),c.transpose(m,y),c.multiply(d,m,d),c.multiply(y,d,d),c.multiply(f,m,f),++l>2&&(++h,l=0);return 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},c.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],s=t[5],c=t[8];return e*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},c.inverse=function(t,e){var n=t[0],i=t[1],o=t[2],u=t[3],s=t[4],l=t[5],h=t[6],f=t[7],d=t[8],m=c.determinant(t);if(Math.abs(m)<=a.EPSILON15)throw new r("matrix is not invertible");e[0]=s*d-f*l,e[1]=f*o-i*d,e[2]=i*l-s*o,e[3]=h*l-u*d,e[4]=n*d-h*o,e[5]=u*o-n*l,e[6]=u*f-h*s,e[7]=h*i-n*f,e[8]=n*s-u*i;var y=1/m;return c.multiplyByScalar(e,y,e)},c.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]},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},c.IDENTITY=i(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(t){"use strict";var e=function(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,s){"use strict";var c=function(t,e,r,i,a,o,u,s,c,l,h,f,d,m,y,p){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(e,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(m,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(h,0),this[11]=n(y,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(p,0)};c.packedLength=16,c.pack=function(t,e,r){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]},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){return r(t)?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]):void 0},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,s=e.x*e.x,l=e.x*e.y,h=e.x*e.z,f=e.x*e.w,d=e.y*e.y,m=e.y*e.z,y=e.y*e.w,p=e.z*e.z,v=e.z*e.w,w=e.w*e.w,x=s-d-p+w,E=2*(l-v),g=2*(h+y),z=2*(l+v),M=-s+d-p+w,S=2*(m-f),O=2*(h-y),T=2*(m+f),R=-s-d+p+w;return i[0]=x*a,i[1]=z*a,i[2]=O*a,i[3]=0,i[4]=E*o,i[5]=M*o,i[6]=T*o,i[7]=0,i[8]=g*u,i[9]=S*u,i[10]=R*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},c.fromTranslation=function(t,e){return c.fromRotationTranslation(u.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 l=new t,h=new t,f=new t;c.fromCamera=function(e,n){var i=e.eye,a=e.target,o=e.up;t.normalize(t.subtract(a,i,l),l),t.normalize(t.cross(l,o,h),h),t.normalize(t.cross(h,l,f),f);var u=h.x,s=h.y,d=h.z,m=l.x,y=l.y,p=l.z,v=f.x,w=f.y,x=f.z,E=i.x,g=i.y,z=i.z,M=u*-E+s*-g+d*-z,S=v*-E+w*-g+x*-z,O=m*E+y*g+p*z;return r(n)?(n[0]=u,n[1]=v,n[2]=-m,n[3]=0,n[4]=s,n[5]=w,n[6]=-y,n[7]=0,n[8]=d,n[9]=x,n[10]=-p,n[11]=0,n[12]=M,n[13]=S,n[14]=O,n[15]=1,n):new c(u,s,d,M,v,w,x,S,-m,-y,-p,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,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},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),s=1/(r-n),c=1/(a-i),l=-(e+t)*u,h=-(r+n)*s,f=-(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]=h,o[14]=f,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),s=2*i/(r-n),c=(e+t)/(e-t),l=(r+n)/(r-n),h=-(a+i)/(a-i),f=-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]=h,o[11]=f,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),l=-1,h=-1,f=-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]=h,a[12]=0,a[13]=0,a[14]=f,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),s=n(t.height,0);e=n(e,0),r=n(r,1);var c=.5*u,l=.5*s,h=.5*(r-e),f=c,d=l,m=h,y=a+c,p=o+l,v=e+h,w=1;return i[0]=f,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]=m,i[11]=0,i[12]=y,i[13]=p,i[14]=v,i[15]=w,i},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.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 d=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],d)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],d)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],d)),n};var m=new t;c.getMaximumScale=function(e){return c.getScale(e,m),t.maximumComponent(m)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],s=t[5],c=t[6],l=t[7],h=t[8],f=t[9],d=t[10],m=t[11],y=t[12],p=t[13],v=t[14],w=t[15],x=e[0],E=e[1],g=e[2],z=e[3],M=e[4],S=e[5],O=e[6],T=e[7],R=e[8],_=e[9],N=e[10],I=e[11],b=e[12],A=e[13],P=e[14],C=e[15],L=r*x+u*E+h*g+y*z,q=i*x+s*E+f*g+p*z,U=a*x+c*E+d*g+v*z,D=o*x+l*E+m*g+w*z,F=r*M+u*S+h*O+y*T,B=i*M+s*S+f*O+p*T,W=a*M+c*S+d*O+v*T,G=o*M+l*S+m*O+w*T,V=r*R+u*_+h*N+y*I,Y=i*R+s*_+f*N+p*I,k=a*R+c*_+d*N+v*I,j=o*R+l*_+m*N+w*I,H=r*b+u*A+h*P+y*C,Z=i*b+s*A+f*P+p*C,X=a*b+c*A+d*P+v*C,K=o*b+l*A+m*P+w*C;return n[0]=L,n[1]=q,n[2]=U,n[3]=D,n[4]=F,n[5]=B,n[6]=W,n[7]=G,n[8]=V,n[9]=Y,n[10]=k,n[11]=j,n[12]=H,n[13]=Z,n[14]=X,n[15]=K,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],s=t[6],c=t[8],l=t[9],h=t[10],f=t[12],d=t[13],m=t[14],y=e[0],p=e[1],v=e[2],w=e[4],x=e[5],E=e[6],g=e[8],z=e[9],M=e[10],S=e[12],O=e[13],T=e[14],R=r*y+o*p+c*v,_=i*y+u*p+l*v,N=a*y+s*p+h*v,I=r*w+o*x+c*E,b=i*w+u*x+l*E,A=a*w+s*x+h*E,P=r*g+o*z+c*M,C=i*g+u*z+l*M,L=a*g+s*z+h*M,q=r*S+o*O+c*T+f,U=i*S+u*O+l*T+d,D=a*S+s*O+h*T+m;return n[0]=R,n[1]=_,n[2]=N,n[3]=0,n[4]=I,n[5]=b,n[6]=A,n[7]=0,n[8]=P,n[9]=C,n[10]=L,n[11]=0,n[12]=q,n[13]=U,n[14]=D,n[15]=1,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],s=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]=s,n[15]=t[15],n};var y=new t;c.multiplyByUniformScale=function(t,e,n){return y.x=e,y.y=e,y.z=e,c.multiplyByScale(t,y,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,s=t[1]*r+t[5]*i+t[9]*a+t[13]*o,c=t[2]*r+t[6]*i+t[10]*a+t[14]*o,l=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,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,s=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=s,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],s=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=s,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[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[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]},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 p=new u,v=new u,w=new e,x=new e(0,0,0,1);return c.inverse=function(t,n){if(u.equalsEpsilon(c.getRotation(t,p),v,o.EPSILON7)&&e.equals(c.getRow(t,3,w),x))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],l=t[12],h=t[1],f=t[5],d=t[9],m=t[13],y=t[2],E=t[6],g=t[10],z=t[14],M=t[3],S=t[7],O=t[11],T=t[15],R=g*T,_=z*O,N=E*T,I=z*S,b=E*O,A=g*S,P=y*T,C=z*M,L=y*O,q=g*M,U=y*S,D=E*M,F=R*f+I*d+b*m-(_*f+N*d+A*m),B=_*h+P*d+q*m-(R*h+C*d+L*m),W=N*h+C*f+U*m-(I*h+P*f+D*m),G=A*h+L*f+D*d-(b*h+q*f+U*d),V=_*i+N*a+A*l-(R*i+I*a+b*l),Y=R*r+C*a+L*l-(_*r+P*a+q*l),k=I*r+P*i+D*l-(N*r+C*i+U*l),j=b*r+q*i+U*a-(A*r+L*i+D*a);R=a*m,_=l*d,N=i*m,I=l*f,b=i*d,A=a*f,P=r*m,C=l*h,L=r*d,q=a*h,U=r*f,D=i*h;var H=R*S+I*O+b*T-(_*S+N*O+A*T),Z=_*M+P*O+q*T-(R*M+C*O+L*T),X=N*M+C*S+U*T-(I*M+P*S+D*T),K=A*M+L*S+D*O-(b*M+q*S+U*O),J=N*g+A*z+_*E-(b*z+R*E+I*g),Q=L*z+R*y+C*g-(P*g+q*z+_*y),$=P*E+D*z+I*y-(U*z+N*y+C*E),te=U*g+b*y+q*E-(L*E+D*g+A*y),ee=r*F+i*B+a*W+l*G;if(Math.abs(ee)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return ee=1/ee,n[0]=F*ee,n[1]=B*ee,n[2]=W*ee,n[3]=G*ee,n[4]=V*ee,n[5]=Y*ee,n[6]=k*ee,n[7]=j*ee,n[8]=H*ee,n[9]=Z*ee,n[10]=X*ee,n[11]=K*ee,n[12]=J*ee,n[13]=Q*ee,n[14]=$*ee,n[15]=te*ee,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],s=t[8],c=t[9],l=t[10],h=t[12],f=t[13],d=t[14],m=-n*h-r*f-i*d,y=-a*h-o*f-u*d,p=-s*h-c*f-l*d;return e[0]=n,e[1]=a,e[2]=s,e[3]=0,e[4]=r,e[5]=o,e[6]=c,e[7]=0,e[8]=i,e[9]=u,e[10]=l,e[11]=0,e[12]=m,e[13]=y,e[14]=p,e[15]=1,e},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";var u=function(t,n,r,i){this.west=e(t,0),this.south=e(n,0),this.east=e(r,0),this.north=e(i,0)};u.fromDegrees=function(t,r,i,a,s){return t=o.toRadians(e(t,0)),r=o.toRadians(e(r,0)),i=o.toRadians(e(i,0)),a=o.toRadians(e(a,0)),n(s)?(s.west=t,s.south=r,s.east=i,s.north=a,s):new u(t,r,i,a)},u.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=t.length;c>s;s++){var l=t[s];r=Math.min(r,l.longitude),i=Math.max(i,l.longitude),a=Math.min(a,l.latitude),o=Math.max(o,l.latitude)}return n(e)?(e.west=r,e.south=a,e.east=i,e.north=o,e):new u(r,a,i,o)},u.packedLength=4,u.pack=function(t,n,r){r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i.west=t[r++],i.south=t[r++],i.east=t[r++],i.north=t[r],i},u.clone=function(t,e){return n(t)?n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new u(t.west,t.south,t.east,t.north):void 0},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.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},u.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},u.validate=function(){},u.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)},u.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)},u.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)},u.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)},u.center=function(e,r){var i=e.east,a=e.west,u=.5*(a+i);return a>i&&(u=o.negativePiToPi(u+o.PI)),n(r)?(r.longitude=u,r.latitude=.5*(e.south+e.north),r.height=0,r):new t(u,.5*(e.south+e.north))},u.intersectWith=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),s=Math.min(t.north,e.north);return n(r)?(r.west=i,r.south=a,r.east=o,r.north=s,r):new u(i,a,o,s)},u.contains=function(t,e){return e.longitude>=t.west&&e.longitude<=t.east&&e.latitude>=t.south&&e.latitude<=t.north},u.isEmpty=function(t){return t.west>=t.east||t.south>=t.north};var s=new t;return u.subsample=function(t,r,a,u){r=e(r,i.WGS84),a=e(a,0),n(u)||(u=[]);var c=0,l=t.north,h=t.south,f=t.east,d=t.west,m=s;m.height=a,m.longitude=d,m.latitude=l,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:h>0?h:0;for(var y=1;8>y;++y){var p=-Math.PI+y*o.PI_OVER_TWO;p>d&&f>p&&(m.longitude=p,u[c]=r.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,s,c,l){"use strict";var h=function(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)},f=new t,d=new t,m=new t,y=new t,p=new t,v=new t,w=new t,x=new t,E=new t,g=new t,z=new t,M=new t;h.fromPoints=function(e,n){if(r(n)||(n=new h),!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],w),a=t.clone(i,f),o=t.clone(i,d),u=t.clone(i,m),s=t.clone(i,y),c=t.clone(i,p),l=t.clone(i,v),S=e.length,O=1;S>O;O++){t.clone(e[O],i);var T=i.x,R=i.y,_=i.z;T<a.x&&t.clone(i,a),T>s.x&&t.clone(i,s),R<o.y&&t.clone(i,o),R>c.y&&t.clone(i,c),_<u.z&&t.clone(i,u),_>l.z&&t.clone(i,l)}var N=t.magnitudeSquared(t.subtract(s,a,x)),I=t.magnitudeSquared(t.subtract(c,o,x)),b=t.magnitudeSquared(t.subtract(l,u,x)),A=a,P=s,C=N;I>C&&(C=I,A=o,P=c),b>C&&(C=b,A=u,P=l);var L=E;L.x=.5*(A.x+P.x),L.y=.5*(A.y+P.y),L.z=.5*(A.z+P.z);var q=t.magnitudeSquared(t.subtract(P,L,x)),U=Math.sqrt(q),D=g;D.x=a.x,D.y=o.y,D.z=u.z;var F=z;F.x=s.x,F.y=c.y,F.z=l.z;var B=t.multiplyByScalar(t.add(D,F,x),.5,M),W=0;for(O=0;S>O;O++){t.clone(e[O],i);var G=t.magnitude(t.subtract(i,B,x));G>W&&(W=G);var V=t.magnitudeSquared(t.subtract(i,L,x));if(V>q){var Y=Math.sqrt(V);U=.5*(U+Y),q=U*U;var k=Y-U;L.x=(U*L.x+k*i.x)/Y,L.y=(U*L.y+k*i.y)/Y,L.z=(U*L.z+k*i.z)/Y}}return W>U?(t.clone(L,n.center),n.radius=U):(t.clone(B,n.center),n.radius=W),n};var S=new o,O=new t,T=new t,R=new e,_=new e;h.fromRectangle2D=function(t,e,n){return h.fromRectangleWithHeights2D(t,e,0,0,n)},h.fromRectangleWithHeights2D=function(e,i,a,o,u){if(r(u)||(u=new h),!r(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;i=n(i,S),l.southwest(e,R),R.height=a,l.northeast(e,_),_.height=o;var s=i.project(R,O),c=i.project(_,T),f=c.x-s.x,d=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(f*f+d*d+m*m);var y=u.center;return y.x=s.x+.5*f,y.y=s.y+.5*d,y.z=s.z+.5*m,u};var N=[];h.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=l.subsample(t,e,i,N)),h.fromPoints(u,o)},h.fromVertices=function(e,i,a,o){if(r(o)||(o=new h),!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=w;u.x=e[0]+i.x,u.y=e[1]+i.y,u.z=e[2]+i.z;for(var s=t.clone(u,f),c=t.clone(u,d),l=t.clone(u,m),S=t.clone(u,y),O=t.clone(u,p),T=t.clone(u,v),R=e.length,_=0;R>_;_+=a){var N=e[_]+i.x,I=e[_+1]+i.y,b=e[_+2]+i.z;u.x=N,u.y=I,u.z=b,N<s.x&&t.clone(u,s),N>S.x&&t.clone(u,S),I<c.y&&t.clone(u,c),I>O.y&&t.clone(u,O),b<l.z&&t.clone(u,l),b>T.z&&t.clone(u,T)}var A=t.magnitudeSquared(t.subtract(S,s,x)),P=t.magnitudeSquared(t.subtract(O,c,x)),C=t.magnitudeSquared(t.subtract(T,l,x)),L=s,q=S,U=A;P>U&&(U=P,L=c,q=O),C>U&&(U=C,L=l,q=T);var D=E;D.x=.5*(L.x+q.x),D.y=.5*(L.y+q.y),D.z=.5*(L.z+q.z);var F=t.magnitudeSquared(t.subtract(q,D,x)),B=Math.sqrt(F),W=g;W.x=s.x,W.y=c.y,W.z=l.z;var G=z;G.x=S.x,G.y=O.y,G.z=T.z;var V=t.multiplyByScalar(t.add(W,G,x),.5,M),Y=0;for(_=0;R>_;_+=a){u.x=e[_]+i.x,u.y=e[_+1]+i.y,u.z=e[_+2]+i.z;var k=t.magnitude(t.subtract(u,V,x));k>Y&&(Y=k);var j=t.magnitudeSquared(t.subtract(u,D,x));if(j>F){var H=Math.sqrt(j);B=.5*(B+H),F=B*B;var Z=H-B;D.x=(B*D.x+Z*u.x)/H,D.y=(B*D.y+Z*u.y)/H,D.z=(B*D.z+Z*u.z)/H}}return Y>B?(t.clone(D,o.center),o.radius=B):(t.clone(V,o.center),o.radius=Y),o},h.fromCornerPoints=function(e,n,i){r(i)||(i=new h);var a=i.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),i.radius=t.distance(a,n),i},h.fromEllipsoid=function(e,n){return r(n)||(n=new h),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n},h.clone=function(e,n){return r(e)?r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new h(e.center,e.radius):void 0},h.packedLength=4,h.pack=function(t,e,r){r=n(r,0);var i=t.center;e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius},h.unpack=function(t,e,i){e=n(e,0),r(i)||(i=new h);var a=i.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],i.radius=t[e],i};var I=new t,b=new t;h.union=function(e,n,i){r(i)||(i=new h);var a=e.center,o=n.center;t.add(a,o,b);var u=t.multiplyByScalar(b,.5,b),s=t.magnitude(t.subtract(a,u,I))+e.radius,c=t.magnitude(t.subtract(o,u,I))+n.radius;return i.radius=Math.max(s,c),t.clone(u,i.center),i};var A=new t;h.expand=function(e,n,r){r=h.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,A));return i>r.radius&&(r.radius=i),r},h.intersect=function(e,n){var r=e.center,i=e.radius,a=t.dot(n,r)+n.w;return-i>a?u.OUTSIDE:i>a?u.INTERSECTING:u.INSIDE},h.transform=function(t,e,n){return r(n)||(n=new h),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var P=new t;h.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,P);return t.magnitudeSquared(r)-e.radius*e.radius},h.transformWithoutScale=function(t,e,n){return r(n)||(n=new h),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var C=new t;h.computePlaneDistances=function(e,n,i,a){r(a)||(a=new s);var o=t.subtract(e.center,n,C),u=t.multiplyByScalar(i,t.dot(i,o),C),c=t.magnitude(u);return a.start=c-e.radius,a.stop=c+e.radius,a};for(var L=new t,q=new t,U=new t,D=new t,F=new t,B=new e,W=new Array(8),G=0;8>G;++G)W[G]=new t;var V=new o;return h.projectTo2D=function(e,r,i){r=n(r,V);var a=r.ellipsoid,o=e.center,u=e.radius,s=a.geodeticSurfaceNormal(o,L),c=t.cross(t.UNIT_Z,s,q);t.normalize(c,c);var l=t.cross(s,c,U);t.normalize(l,l),t.multiplyByScalar(s,u,s),t.multiplyByScalar(l,u,l),t.multiplyByScalar(c,u,c);var f=t.negate(l,F),d=t.negate(c,D),m=W,y=m[0];t.add(s,l,y),t.add(y,c,y),y=m[1],t.add(s,l,y),t.add(y,d,y),y=m[2],t.add(s,f,y),t.add(y,d,y),y=m[3],t.add(s,f,y),t.add(y,c,y),t.negate(s,s),y=m[4],t.add(s,l,y),t.add(y,c,y),y=m[5],t.add(s,l,y),t.add(y,d,y),y=m[6],t.add(s,f,y),t.add(y,d,y),y=m[7],t.add(s,f,y),t.add(y,c,y);for(var p=m.length,v=0;p>v;++v){var w=m[v];t.add(o,w,w);var x=a.cartesianToCartographic(w,B);r.project(x,w)}i=h.fromPoints(m,i),o=i.center;var E=o.x,g=o.y,z=o.z;return o.x=z,o.y=E,o.z=g,i},h.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},h.prototype.intersect=function(t){return h.intersect(this,t)},h.prototype.equals=function(t){return h.equals(this,t)},h.prototype.clone=function(t){return h.clone(this,t)},h}),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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof e[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",t(document[i])?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",t(document[i])&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",t(document[i])?r.fullscreenElement=i:(i=s+"FullScreenElement",t(document[i])&&(r.fullscreenElement=i)),i=s+"fullscreenchange",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t){i.supportsFullscreen()&&t[r.requestFullscreen]()},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;r>n;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(m)){m=!1;var t=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(m=!0,y=r(t[1]))}return m}function a(){return i()&&y}function o(){if(!e(p)&&(p=!1,!i()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(p=!0,v=r(t[1]))}return p}function u(){return o()&&v}function s(){if(!e(w)){w=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==t&&(w=!0,x=r(t[1]),x.isNightly=!!t[2])}return w}function c(){return s()&&x}function l(){if(!e(E)){E=!1;var t;"Microsoft Internet Explorer"===navigator.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(E=!0,g=r(t[1]))):"Netscape"===navigator.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(E=!0,g=r(t[1])))}return E}function h(){return l()&&g}function f(){if(!e(z)){z=!1;var t=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(z=!0,M=r(t[1]))}return z}function d(){return f()&&M}var m,y,p,v,w,x,E,g,z,M,S={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:h,isFirefox:f,firefoxVersion:d,hardwareConcurrency:t(navigator.hardwareConcurrency,3)};return S.supportsFullscreen=function(){return n.supportsFullscreen()},S.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},S.supportsWebWorkers=function(){return"undefined"!=typeof Worker},S}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,e,n,r,i){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(t){switch(t){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(t){return t instanceof Int8Array?a.BYTE:t instanceof Uint8Array?a.UNSIGNED_BYTE:t instanceof Int16Array?a.SHORT:t instanceof Uint16Array?a.UNSIGNED_SHORT:t instanceof Float32Array?a.FLOAT:t instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(t){return e(t)&&(t===a.BYTE||t===a.UNSIGNED_BYTE||t===a.SHORT||t===a.UNSIGNED_SHORT||t===a.FLOAT||t===a.DOUBLE)},a.createTypedArray=function(t,e){switch(t){case a.BYTE:return new Int8Array(e);case a.UNSIGNED_BYTE:return new Uint8Array(e);case a.SHORT:return new Int16Array(e);case a.UNSIGNED_SHORT:return new Uint16Array(e);case a.FLOAT:return new Float32Array(e);case a.DOUBLE:return new Float64Array(e);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(e,r,i,o){switch(i=t(i,0),o=t(o,(r.byteLength-i)/a.getSizeInBytes(e)),e){case a.BYTE:return new Int8Array(r,i,o);case a.UNSIGNED_BYTE:return new Uint8Array(r,i,o);case a.SHORT:return new Int16Array(r,i,o);case a.UNSIGNED_SHORT:return new Uint16Array(r,i,o);case a.FLOAT:return new Float32Array(r,i,o);case a.DOUBLE:return new Float64Array(r,i,o);default:throw new n("componentDatatype is not a valid value.")}},i(a)}),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"],function(t){"use strict";var e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(t){return t===e.POINTS||t===e.LINES||t===e.LINE_LOOP||t===e.LINE_STRIP||t===e.TRIANGLES||t===e.TRIANGLE_STRIP||t===e.TRIANGLE_FAN}};return t(e)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";var a=function(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)};return a.computeNumberOfVertices=function(t){var r=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&e(t.attributes[i])&&e(t.attributes[i].values)){var a=t.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t){"use strict";var e=function(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 e}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";var e=function(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","./freezeObject"],function(t,e){"use strict";var n=function(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 n.POSITION_ONLY=e(new n({position:!0})),n.POSITION_AND_NORMAL=e(new n({position:!0,normal:!0})),n.POSITION_NORMAL_AND_ST=e(new n({position:!0,normal:!0,st:!0})),n.POSITION_AND_ST=e(new n({position:!0,st:!0})),n.POSITION_AND_COLOR=e(new n({position:!0,color:!0})),n.ALL=e(new n({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),n.DEFAULT=n.POSITION_NORMAL_AND_ST,n}),define("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(t,e,n,r,i,a,o,u,s,c,l){"use strict";var h=new e,f=function(t){t=r(t,r.EMPTY_OBJECT);var n=t.minimumCorner,i=t.maximumCorner,a=r(t.vertexFormat,l.DEFAULT);this._minimumCorner=e.clone(n),this._maximumCorner=e.clone(i),this._vertexFormat=a,this._workerName="createBoxGeometry"};return f.fromDimensions=function(t){t=r(t,r.EMPTY_OBJECT);var n=t.dimensions,i=e.multiplyByScalar(n,.5,new e),a=e.negate(i,new e),o=i,u={minimumCorner:a,maximumCorner:o,vertexFormat:t.vertexFormat};return new f(u)},f.createGeometry=function(r){var i,a,l=r._minimumCorner,f=r._maximumCorner,d=r._vertexFormat,m=new s;if(d.position&&(d.st||d.normal||d.binormal||d.tangent)){if(d.position&&(a=new Float64Array(72),a[0]=l.x,a[1]=l.y,a[2]=f.z,a[3]=f.x,a[4]=l.y,a[5]=f.z,a[6]=f.x,a[7]=f.y,a[8]=f.z,a[9]=l.x,a[10]=f.y,a[11]=f.z,a[12]=l.x,a[13]=l.y,a[14]=l.z,a[15]=f.x,a[16]=l.y,a[17]=l.z,a[18]=f.x,a[19]=f.y,a[20]=l.z,a[21]=l.x,a[22]=f.y,a[23]=l.z,a[24]=f.x,a[25]=l.y,a[26]=l.z,a[27]=f.x,a[28]=f.y,a[29]=l.z,a[30]=f.x,a[31]=f.y,a[32]=f.z,a[33]=f.x,a[34]=l.y,a[35]=f.z,a[36]=l.x,a[37]=l.y,a[38]=l.z,a[39]=l.x,a[40]=f.y,a[41]=l.z,a[42]=l.x,a[43]=f.y,a[44]=f.z,a[45]=l.x,a[46]=l.y,a[47]=f.z,a[48]=l.x,a[49]=f.y,a[50]=l.z,a[51]=f.x,a[52]=f.y,a[53]=l.z,a[54]=f.x,a[55]=f.y,a[56]=f.z,a[57]=l.x,a[58]=f.y,a[59]=f.z,a[60]=l.x,a[61]=l.y,a[62]=l.z,a[63]=f.x,a[64]=l.y,a[65]=l.z,a[66]=f.x,a[67]=l.y,a[68]=f.z,a[69]=l.x,a[70]=l.y,a[71]=f.z,m.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:a})),d.normal){var y=new Float32Array(72);y[0]=0,y[1]=0,y[2]=1,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=1,y[9]=0,y[10]=0,y[11]=1,y[12]=0,y[13]=0,y[14]=-1,y[15]=0,y[16]=0,y[17]=-1,y[18]=0,y[19]=0,y[20]=-1,y[21]=0,y[22]=0,y[23]=-1,y[24]=1,y[25]=0,y[26]=0,y[27]=1,y[28]=0,y[29]=0,y[30]=1,y[31]=0,y[32]=0,y[33]=1,y[34]=0,y[35]=0,y[36]=-1,y[37]=0,y[38]=0,y[39]=-1,y[40]=0,y[41]=0,y[42]=-1,y[43]=0,y[44]=0,y[45]=-1,y[46]=0,y[47]=0,y[48]=0,y[49]=1,y[50]=0,y[51]=0,y[52]=1,y[53]=0,y[54]=0,y[55]=1,y[56]=0,y[57]=0,y[58]=1,y[59]=0,y[60]=0,y[61]=-1,y[62]=0,y[63]=0,y[64]=-1,y[65]=0,y[66]=0,y[67]=-1,y[68]=0,y[69]=0,y[70]=-1,y[71]=0,m.normal=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:y})}if(d.st){var p=new Float32Array(48);p[0]=0,p[1]=0,p[2]=1,p[3]=0,p[4]=1,p[5]=1,p[6]=0,p[7]=1,p[8]=1,p[9]=0,p[10]=0,p[11]=0,p[12]=0,p[13]=1,p[14]=1,p[15]=1,p[16]=0,p[17]=0,p[18]=1,p[19]=0,p[20]=1,p[21]=1,p[22]=0,p[23]=1,p[24]=1,p[25]=0,p[26]=0,p[27]=0,p[28]=0,p[29]=1,p[30]=1,p[31]=1,p[32]=1,p[33]=0,p[34]=0,p[35]=0,p[36]=0,p[37]=1,p[38]=1,p[39]=1,p[40]=0,p[41]=0,p[42]=1,p[43]=0,p[44]=1,p[45]=1,p[46]=0,p[47]=1,m.st=new u({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:p})}if(d.tangent){var v=new Float32Array(72);v[0]=1,v[1]=0,v[2]=0,v[3]=1,v[4]=0,v[5]=0,v[6]=1,v[7]=0,v[8]=0,v[9]=1,v[10]=0,v[11]=0,v[12]=-1,v[13]=0,v[14]=0,v[15]=-1,v[16]=0,v[17]=0,v[18]=-1,v[19]=0,v[20]=0,v[21]=-1,v[22]=0,v[23]=0,v[24]=0,v[25]=1,v[26]=0,v[27]=0,v[28]=1,v[29]=0,v[30]=0,v[31]=1,v[32]=0,v[33]=0,v[34]=1,v[35]=0,v[36]=0,v[37]=-1,v[38]=0,v[39]=0,v[40]=-1,v[41]=0,v[42]=0,v[43]=-1,v[44]=0,v[45]=0,v[46]=-1,v[47]=0,v[48]=-1,v[49]=0,v[50]=0,v[51]=-1,v[52]=0,v[53]=0,v[54]=-1,v[55]=0,v[56]=0,v[57]=-1,v[58]=0,v[59]=0,v[60]=1,v[61]=0,v[62]=0,v[63]=1,v[64]=0,v[65]=0,v[66]=1,v[67]=0,v[68]=0,v[69]=1,v[70]=0,v[71]=0,m.tangent=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:v})}if(d.binormal){var w=new Float32Array(72);w[0]=0,w[1]=1,w[2]=0,w[3]=0,w[4]=1,w[5]=0,w[6]=0,w[7]=1,w[8]=0,w[9]=0,w[10]=1,w[11]=0,w[12]=0,w[13]=1,w[14]=0,w[15]=0,w[16]=1,w[17]=0,w[18]=0,w[19]=1,w[20]=0,w[21]=0,w[22]=1,w[23]=0,w[24]=0,w[25]=0,w[26]=1,w[27]=0,w[28]=0,w[29]=1,w[30]=0,w[31]=0,w[32]=1,w[33]=0,w[34]=0,w[35]=1,w[36]=0,w[37]=0,w[38]=1,w[39]=0,w[40]=0,w[41]=1,w[42]=0,w[43]=0,w[44]=1,w[45]=0,w[46]=0,w[47]=1,w[48]=0,w[49]=0,w[50]=1,w[51]=0,w[52]=0,w[53]=1,w[54]=0,w[55]=0,w[56]=1,w[57]=0,w[58]=0,w[59]=1,w[60]=0,w[61]=0,w[62]=1,w[63]=0,w[64]=0,w[65]=1,w[66]=0,w[67]=0,w[68]=1,w[69]=0,w[70]=0,w[71]=1,m.binormal=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:w})}i=new Uint16Array(36),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3,i[6]=6,i[7]=5,i[8]=4,i[9]=7,i[10]=6,i[11]=4,i[12]=8,i[13]=9,i[14]=10,i[15]=8,i[16]=10,i[17]=11,i[18]=14,i[19]=13,i[20]=12,i[21]=15,i[22]=14,i[23]=12,i[24]=18,i[25]=17,i[26]=16,i[27]=19,i[28]=18,i[29]=16,i[30]=20,i[31]=21,i[32]=22,i[33]=20,i[34]=22,i[35]=23}else a=new Float64Array(24),a[0]=l.x,a[1]=l.y,a[2]=l.z,a[3]=f.x,a[4]=l.y,a[5]=l.z,a[6]=f.x,a[7]=f.y,a[8]=l.z,a[9]=l.x,a[10]=f.y,a[11]=l.z,a[12]=l.x,a[13]=l.y,a[14]=f.z,a[15]=f.x,a[16]=l.y,a[17]=f.z,a[18]=f.x,a[19]=f.y,a[20]=f.z,a[21]=l.x,a[22]=f.y,a[23]=f.z,m.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:a}),i=new Uint16Array(36),i[0]=4,i[1]=5,i[2]=6,i[3]=4,i[4]=6,i[5]=7,i[6]=1,i[7]=0,i[8]=3,i[9]=1,i[10]=3,i[11]=2,i[12]=1,i[13]=6,i[14]=5,i[15]=1,i[16]=2,i[17]=6,i[18]=2,i[19]=3,i[20]=7,i[21]=2,i[22]=7,i[23]=6,i[24]=3,i[25]=0,i[26]=4,i[27]=3,i[28]=4,i[29]=7,i[30]=0,i[31]=1,i[32]=5,i[33]=0,i[34]=5,i[35]=4;var x=e.subtract(f,l,h),E=.5*e.magnitude(x);return new o({attributes:m,indices:i,primitiveType:c.TRIANGLES,boundingSphere:new t(e.ZERO,E)})},f}),define("Workers/createBoxGeometry",["../Core/BoxGeometry"],function(t){"use strict";return t.createGeometry})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==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(n){e=n.stack}this.stack=e}return 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("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:0>t?-1:0},i.signNotZero=function(t){return 0>t?-1:1},i.toSNorm=function(t){return Math.round(255*(.5*i.clamp(t,-1,1)+.5))},i.fromSNorm=function(t){return i.clamp(t,0,255)/255*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.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 i>=a||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;t>=r;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 e>t?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";function a(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}a.fromSpherical=function(n,r){e(r)||(r=new a);var i=n.clock,o=n.cone,u=t(n.magnitude,1),E=u*Math.sin(o);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(t,n,r,i){return e(i)?(i.x=t,i.y=n,i.z=r,i):new a(t,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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){a.normalize(t,E),a.normalize(e,s);var n=a.dot(E,s),r=a.magnitude(a.cross(E,s,E));return Math.atan2(r,n)};var c=new a;a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,c);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):n.y<=n.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},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)},a.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},a.fromDegrees=function(t,e,n,r,o){var u=i.toRadians(t),E=i.toRadians(e);return a.fromRadians(u,E,n,r,o)};var _=new a,R=new a,T=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=t(i,0);var E=e(o)?o.radiiSquared:T,s=Math.cos(r);_.x=s*Math.cos(n),_.y=s*Math.sin(n),_.z=Math.sin(r),_=a.normalize(_,_),a.multiplyComponents(E,_,R);var c=Math.sqrt(a.dot(_,R));return R=a.divideByScalar(R,c,R),_=a.multiplyByScalar(_,i,_),e(u)||(u=new a),a.add(R,_,u)},a.fromDegreesArray=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=i.toRadians(t[o]);return a.fromRadiansArray(r,e,n)},a.fromRadiansArray=function(t,n,r){var i=t.length;e(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],E=t[o+1];r[o/2]=a.fromRadians(u,E,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o+=3)r[o]=i.toRadians(t[o]),r[o+1]=i.toRadians(t[o+1]),r[o+2]=t[o+2];return a.fromRadiansArrayHeights(r,e,n)},a.fromRadiansArrayHeights=function(t,n,r){var i=t.length;e(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],E=t[o+1],s=t[o+2];r[o/3]=a.fromRadians(u,E,s,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(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+")"},a}),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,R=n.z,T=i.x,l=i.y,A=i.z,f=c*c*T*T,N=_*_*l*l,h=R*R*A*A,d=f+N+h,m=Math.sqrt(1/d),I=t.multiplyByScalar(n,m,a);if(E>d)return isFinite(m)?t.clone(I,s):void 0;var S=u.x,M=u.y,O=u.z,y=o;y.x=I.x*S*2,y.y=I.y*M*2,y.z=I.z*O*2;var p,C,F,L,U,P,x,w,v,D,B,g=(1-m)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{g-=z,F=1/(1+g*S),L=1/(1+g*M),U=1/(1+g*O),P=F*F,x=L*L,w=U*U,v=P*F,D=x*L,B=w*U,p=f*P+N*x+h*w-1,C=f*v*S+N*D*M+h*B*O;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*F,s.y=_*L,s.z=R*U,s):new t(c*F,_*L,R*U)}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),R=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),T=a.EPSILON1;return u.fromCartesian=function(e,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:R,f=n(r)?r._centerToleranceSquared:T,N=o(e,l,A,f,s);if(n(N)){var h=t.multiplyComponents(e,A,E);h=t.normalize(h,h);var d=t.subtract(e,N,c),m=Math.atan2(h.y,h.x),I=Math.asin(h.z),S=a.sign(t.dot(d,e))*t.magnitude(d);return n(i)?(i.longitude=m,i.latitude=I,i.height=S,i):new u(m,I,S)}},u.clone=function(t,e){return n(t)?n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height):void 0},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}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,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){i=n(i,0),t.pack(e._radii,r,i)},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,R=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=R;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;n>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var T=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,T),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;n>i;++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}),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","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(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 u(t){for(var e=0,n=0;9>n;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function E(t){for(var e=0,n=0;3>n;++n){var r=t[o.getElementIndex(T[n],R[n])];e+=2*r*r}return Math.sqrt(e)}function s(t,e){for(var n=a.EPSILON15,r=0,i=1,u=0;3>u;++u){var E=Math.abs(t[o.getElementIndex(T[u],R[u])]);E>r&&(i=u,r=E)}var s=1,c=0,_=R[i],l=T[i];if(Math.abs(t[o.getElementIndex(l,_)])>n){var A,f=t[o.getElementIndex(l,l)],N=t[o.getElementIndex(_,_)],h=t[o.getElementIndex(l,_)],d=(f-N)/2/h;A=0>d?-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=o.clone(o.IDENTITY,e),e[o.getElementIndex(_,_)]=e[o.getElementIndex(l,l)]=s,e[o.getElementIndex(l,_)]=c,e[o.getElementIndex(_,l)]=-c,e}o.packedLength=9,o.pack=function(t,n,r){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]},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),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},o.clone=function(t,e){return n(t)?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 o(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},o.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new o),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},o.fromColumnMajorArray=function(t,e){return o.clone(t,e)},o.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 o(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},o.fromQuaternion=function(t,e){var r=t.x*t.x,i=t.x*t.y,a=t.x*t.z,u=t.x*t.w,E=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,R=t.z*t.w,T=t.w*t.w,l=r-E-_+T,A=2*(i-R),f=2*(a+c),N=2*(i+R),h=-r+E-_+T,d=2*(s-u),m=2*(a-c),I=2*(s+u),S=-r-E+_+T;return n(e)?(e[0]=l,e[1]=N,e[2]=m,e[3]=A,e[4]=h,e[5]=I,e[6]=f,e[7]=d,e[8]=S,e):new o(l,A,f,N,h,d,m,I,S)},o.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 o(t.x,0,0,0,t.y,0,0,0,t.z)},o.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 o(t,0,0,0,t,0,0,0,t)},o.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 o(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},o.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 o(1,0,0,0,r,-i,0,i,r)},o.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 o(r,0,i,0,1,0,-i,0,r)},o.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 o(r,-i,0,i,r,0,0,0,1)},o.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]]},o.getElementIndex=function(t,e){return 3*t+e},o.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},o.setColumn=function(t,e,n,r){r=o.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},o.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},o.setRow=function(t,e,n,r){return r=o.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var c=new t;o.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],c)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],c)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],c)),n};var _=new t;o.getMaximumScale=function(e){return o.getScale(e,_),t.maximumComponent(_)},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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],T=[2,2,1],l=new o,A=new o;return o.computeEigenDecomposition=function(t,e){var r=a.EPSILON20,i=10,c=0,_=0;n(e)||(e={});for(var R=e.unitary=o.clone(o.IDENTITY,e.unitary),T=e.diagonal=o.clone(t,e.diagonal),f=r*u(T);i>_&&E(T)>f;)s(T,l),o.transpose(l,A),o.multiply(T,l,T),o.multiply(A,T,T),o.multiply(R,l,R),++c>2&&(++_,c=0);return e},o.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},o.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)},o.inverse=function(t,e){var n=t[0],i=t[1],u=t[2],E=t[3],s=t[4],c=t[5],_=t[6],R=t[7],T=t[8],l=o.determinant(t);if(Math.abs(l)<=a.EPSILON15)throw new r("matrix is not invertible");e[0]=s*T-R*c,e[1]=R*u-i*T,e[2]=i*c-s*u,e[3]=_*c-E*T,e[4]=n*T-_*u,e[5]=E*u-n*c,e[6]=E*R-_*s,e[7]=_*i-n*R,e[8]=n*s-E*i;var A=1/l;return o.multiplyByScalar(e,A,e)},o.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]},o.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},o.IDENTITY=i(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=i(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.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]},o.prototype.equalsEpsilon=function(t,e){return o.equalsEpsilon(this,t,e)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return e(t)?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):void 0},a.packedLength=4,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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.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.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(n){e=n.stack}this.stack=e}return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(t,e,r,i,a,o,u,E,s,c,_,R,T,l,A,f){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(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(R,0),this[15]=n(f,0)}s.packedLength=16,s.pack=function(t,e,r){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]},s.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new s),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},s.clone=function(t,e){return r(t)?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 s(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]):void 0},s.fromArray=s.unpack,s.fromColumnMajorArray=function(t,e){return s.clone(t,e)},s.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 s(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])},s.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 s(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)},s.fromTranslationQuaternionRotationScale=function(t,e,n,i){r(i)||(i=new s);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,c=e.x*e.y,_=e.x*e.z,R=e.x*e.w,T=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-T-f+h,m=2*(c-N),I=2*(_+A),S=2*(c+N),M=-E+T-f+h,O=2*(l-R),y=2*(_-A),p=2*(l+R),C=-E-T+f+h;return i[0]=d*a,i[1]=S*a,i[2]=y*a,i[3]=0,i[4]=m*o,i[5]=M*o,i[6]=p*o,i[7]=0,i[8]=I*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},s.fromTranslationRotationScale=function(t,e){return s.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},s.fromTranslation=function(t,e){return s.fromRotationTranslation(u.IDENTITY,t,e)},s.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 s(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},s.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 s(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var c=new t,_=new t,R=new t;s.fromCamera=function(e,n){var i=e.eye,a=e.target,o=e.up;t.normalize(t.subtract(a,i,c),c),t.normalize(t.cross(c,o,_),_),t.normalize(t.cross(_,c,R),R);var u=_.x,E=_.y,T=_.z,l=c.x,A=c.y,f=c.z,N=R.x,h=R.y,d=R.z,m=i.x,I=i.y,S=i.z,M=u*-m+E*-I+T*-S,O=N*-m+h*-I+d*-S,y=l*m+A*I+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]=T,n[9]=d,n[10]=-f,n[11]=0,n[12]=M,n[13]=O,n[14]=y,n[15]=1,n):new s(u,E,T,M,N,h,d,O,-l,-A,-f,y,0,0,0,1)},s.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},s.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,R=-(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]=R,o[15]=1,o},s.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),R=-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]=R,o[12]=0,o[13]=0,o[14]=T,o[15]=0,o},s.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,R=-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]=R,a[15]=0,a},s.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),R=s,T=c,l=_,A=a+s,f=o+c,N=e+_,h=1;return i[0]=R,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]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=N,i[15]=h,i},s.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]]},s.getElementIndex=function(t,e){return 4*t+e},s.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},s.setColumn=function(t,e,n,r){r=s.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},s.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},s.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},s.setRow=function(t,e,n,r){return r=s.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var T=new t;s.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[4],e[5],e[6],T)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],T)),n};var l=new t;s.getMaximumScale=function(e){return s.getScale(e,l),t.maximumComponent(l)},s.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],R=t[9],T=t[10],l=t[11],A=t[12],f=t[13],N=t[14],h=t[15],d=e[0],m=e[1],I=e[2],S=e[3],M=e[4],O=e[5],y=e[6],p=e[7],C=e[8],F=e[9],L=e[10],U=e[11],P=e[12],x=e[13],w=e[14],v=e[15],D=r*d+u*m+_*I+A*S,B=i*d+E*m+R*I+f*S,g=a*d+s*m+T*I+N*S,z=o*d+c*m+l*I+h*S,G=r*M+u*O+_*y+A*p,b=i*M+E*O+R*y+f*p,X=a*M+s*O+T*y+N*p,V=o*M+c*O+l*y+h*p,H=r*C+u*F+_*L+A*U,q=i*C+E*F+R*L+f*U,W=a*C+s*F+T*L+N*U,Y=o*C+c*F+l*L+h*U,K=r*P+u*x+_*w+A*v,k=i*P+E*x+R*w+f*v,Z=a*P+s*x+T*w+N*v,j=o*P+c*x+l*w+h*v;return n[0]=D,n[1]=B,n[2]=g,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},s.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},s.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},s.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],R=t[12],T=t[13],l=t[14],A=e[0],f=e[1],N=e[2],h=e[4],d=e[5],m=e[6],I=e[8],S=e[9],M=e[10],O=e[12],y=e[13],p=e[14],C=r*A+o*f+s*N,F=i*A+u*f+c*N,L=a*A+E*f+_*N,U=r*h+o*d+s*m,P=i*h+u*d+c*m,x=a*h+E*d+_*m,w=r*I+o*S+s*M,v=i*I+u*S+c*M,D=a*I+E*S+_*M,B=r*O+o*y+s*p+R,g=i*O+u*y+c*p+T,z=a*O+E*y+_*p+l;return n[0]=C,n[1]=F,n[2]=L,n[3]=0,n[4]=U,n[5]=P,n[6]=x,n[7]=0,n[8]=w,n[9]=v,n[10]=D,n[11]=0,n[12]=B,n[13]=g,n[14]=z,n[15]=1,n},s.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],R=e[0],T=e[1],l=e[2],A=e[3],f=e[4],N=e[5],h=e[6],d=e[7],m=e[8],I=r*R+o*T+s*l,S=i*R+u*T+c*l,M=a*R+E*T+_*l,O=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*m,F=i*h+u*d+c*m,L=a*h+E*d+_*m;return n[0]=I,n[1]=S,n[2]=M,n[3]=0,n[4]=O,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=F,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},s.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;s.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,s.multiplyByScale(t,A,n)},s.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?s.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)},s.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},s.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},s.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},s.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},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[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},s.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},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[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},s.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]},s.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},s.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},s.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 f=new u,N=new u,h=new e,d=new e(0,0,0,1);return s.inverse=function(t,n){if(u.equalsEpsilon(s.getRotation(t,f),N,o.EPSILON7)&&e.equals(s.getRow(t,3,h),d))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],c=t[12],_=t[1],R=t[5],T=t[9],l=t[13],A=t[2],m=t[6],I=t[10],S=t[14],M=t[3],O=t[7],y=t[11],p=t[15],C=I*p,F=S*y,L=m*p,U=S*O,P=m*y,x=I*O,w=A*p,v=S*M,D=A*y,B=I*M,g=A*O,z=m*M,G=C*R+U*T+P*l-(F*R+L*T+x*l),b=F*_+w*T+B*l-(C*_+v*T+D*l),X=L*_+v*R+g*l-(U*_+w*R+z*l),V=x*_+D*R+z*T-(P*_+B*R+g*T),H=F*i+L*a+x*c-(C*i+U*a+P*c),q=C*r+v*a+D*c-(F*r+w*a+B*c),W=U*r+w*i+z*c-(L*r+v*i+g*c),Y=P*r+B*i+g*a-(x*r+D*i+z*a);C=a*l,F=c*T,L=i*l,U=c*R,P=i*T,x=a*R,w=r*l,v=c*_,D=r*T,B=a*_,g=r*R,z=i*_;var K=C*O+U*y+P*p-(F*O+L*y+x*p),k=F*M+w*y+B*p-(C*M+v*y+D*p),Z=L*M+v*O+g*p-(U*M+w*O+z*p),j=x*M+D*O+z*y-(P*M+B*O+g*y),Q=L*I+x*S+F*m-(P*S+C*m+U*I),J=D*S+C*A+v*I-(w*I+B*S+F*A),$=w*m+z*S+U*A-(g*S+L*A+v*m),tt=g*I+P*A+B*m-(D*m+z*I+x*A),et=r*G+i*b+a*X+c*V;if(Math.abs(et)<o.EPSILON20)throw new E("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},s.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],R=t[13],T=t[14],l=-n*_-r*R-i*T,A=-a*_-o*R-u*T,f=-E*_-s*R-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]=l,e[13]=A,e[14]=f,e[15]=1,e},s.IDENTITY=a(new s(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),s.ZERO=a(new s(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN0ROW3=3,s.COLUMN1ROW0=4,s.COLUMN1ROW1=5,s.COLUMN1ROW2=6,s.COLUMN1ROW3=7,s.COLUMN2ROW0=8,s.COLUMN2ROW1=9,s.COLUMN2ROW2=10,s.COLUMN2ROW3=11,s.COLUMN3ROW0=12,s.COLUMN3ROW1=13,s.COLUMN3ROW2=14,s.COLUMN3ROW3=15,s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.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]},s.prototype.equalsEpsilon=function(t,e){return s.equalsEpsilon(this,t,e)},s.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},s}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function i(e,n){this.normal=t.clone(e),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-t.dot(r,n);return e(a)?(t.clone(r,a.normal),a.distance=o,a):new i(r,o)};var a=new t;return i.fromCartesian4=function(n,r){var o=t.fromCartesian4(n,a),u=n.w;return e(r)?(t.clone(o,r.normal),r.distance=u,r):new i(o,u)},i.getPointDistance=function(e,n){return t.dot(e.normal,n)+e.distance},i.ORIGIN_XY_PLANE=r(new i(t.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=r(new i(t.UNIT_X,0)),i.ORIGIN_ZX_PLANE=r(new i(t.UNIT_Y,0)),i}),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){r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north},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 n>e&&(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,R=t.length;R>_;_++){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 l=T.longitude>=0?T.longitude:T.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.clone=function(t,e){return n(t)?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):void 0},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;a>i&&(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;a>i&&o>0?i+=u.TWO_PI:s>o&&i>0&&(o+=u.TWO_PI),a>i&&0>s?s+=u.TWO_PI:s>o&&0>a&&(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 R=Math.max(t.south,e.south),T=Math.min(t.north,e.north);if(!(R>=T))return n(r)?(r.west=c,r.south=R,r.east=_,r.north=T,r):new E(c,R,_,T)}},E.union=function(t,e,r){return n(r)||(r=new E),r.west=Math.min(t.west,e.west),r.south=Math.min(t.south,e.south),r.east=Math.max(t.east,e.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 i>a&&(a+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(a>n||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,R=t.south,T=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=T,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.latitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,0>_?A.latitude=_:R>0?A.latitude=R:A.latitude=0;for(var f=1;8>f;++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=T,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","./Plane","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_,R){"use strict";function T(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var l=new t,A=new t,f=new t,N=new t,h=new t,d=new t,m=new t,I=new t,S=new t,M=new t,O=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],m),a=t.clone(i,l),o=t.clone(i,A),u=t.clone(i,f),E=t.clone(i,N),s=t.clone(i,h),c=t.clone(i,d),_=e.length,R=1;_>R;R++){t.clone(e[R],i);var p=i.x,C=i.y,F=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),F<u.z&&t.clone(i,u),F>c.z&&t.clone(i,c)}var L=t.magnitudeSquared(t.subtract(E,a,I)),U=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),x=a,w=E,v=L;U>v&&(v=U,x=o,w=s),P>v&&(v=P,x=u,w=c);var D=S;D.x=.5*(x.x+w.x),D.y=.5*(x.y+w.y),D.z=.5*(x.z+w.z);var B=t.magnitudeSquared(t.subtract(w,D,I)),g=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,y),X=0;for(R=0;_>R;R++){t.clone(e[R],i);var V=t.magnitude(t.subtract(i,b,I));V>X&&(X=V);var H=t.magnitudeSquared(t.subtract(i,D,I));if(H>B){var q=Math.sqrt(H);g=.5*(g+q),B=g*g;var W=q-g;D.x=(g*D.x+W*i.x)/q,D.y=(g*D.y+W*i.y)/q,D.z=(g*D.z+W*i.z)/q}}return X>g?(t.clone(D,n.center),n.radius=g):(t.clone(b,n.center),n.radius=X),n};var p=new o,C=new t,F=new t,L=new e,U=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,p),R.southwest(e,L),L.height=a,R.northeast(e,U),U.height=o;var E=i.project(L,C),s=i.project(U,F),c=s.x-E.x,_=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+_*_+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*_,A.z=E.z+.5*l,u};var P=[];T.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=R.subsample(t,e,i,P)),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=m;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,A),c=t.clone(u,f),_=t.clone(u,N),R=t.clone(u,h),p=t.clone(u,d),C=e.length,F=0;C>F;F+=a){var L=e[F]+i.x,U=e[F+1]+i.y,P=e[F+2]+i.z;u.x=L,u.y=U,u.z=P,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),U<s.y&&t.clone(u,s),U>R.y&&t.clone(u,R),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var x=t.magnitudeSquared(t.subtract(_,E,I)),w=t.magnitudeSquared(t.subtract(R,s,I)),v=t.magnitudeSquared(t.subtract(p,c,I)),D=E,B=_,g=x;w>g&&(g=w,D=s,B=R),v>g&&(g=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=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=R.y,V.z=p.z;var H=t.multiplyByScalar(t.add(X,V,I),.5,y),q=0;for(F=0;C>F;F+=a){u.x=e[F]+i.x,u.y=e[F+1]+i.y,u.z=e[F+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 q>b?(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=m;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,A),E=t.clone(a,f),s=t.clone(a,N),c=t.clone(a,h),_=t.clone(a,d),R=e.length,p=0;R>p;p+=3){var C=e[p]+n[p],F=e[p+1]+n[p+1],L=e[p+2]+n[p+2];a.x=C,a.y=F,a.z=L,C<o.x&&t.clone(a,o),C>s.x&&t.clone(a,s),F<u.y&&t.clone(a,u),F>c.y&&t.clone(a,c),L<E.z&&t.clone(a,E),L>_.z&&t.clone(a,_)}var U=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),x=t.magnitudeSquared(t.subtract(_,E,I)),w=o,v=s,D=U;P>D&&(D=P,w=u,v=c),x>D&&(D=x,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 g=t.magnitudeSquared(t.subtract(v,B,I)),z=Math.sqrt(g),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,y),V=0;for(p=0;R>p;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>g){var W=Math.sqrt(q);z=.5*(z+W),g=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 V>z?(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 x=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;i>o;o++)a.push(e[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;i>o;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,x)+s.radius)}return n.radius=E,n};var w=new t,v=new t,D=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,v),u=s.getColumn(i,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){return r(e)?r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius):void 0},T.packedLength=4,T.pack=function(t,e,r){r=n(r,0);var i=t.center;e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius},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 B=new t,g=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,B),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,g);return t.add(R,a,R),t.clone(R,i.center),i.radius=_,i};var z=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,z));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-i>o?u.OUTSIDE:i>o?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 G=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,G);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 b=new t;T.computePlaneDistances=function(e,n,i,a){r(a)||(a=new E);var o=t.subtract(e.center,n,b),u=t.dot(i,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var X=new t,V=new t,H=new t,q=new t,W=new t,Y=new e,K=new Array(8),k=0;8>k;++k)K[k]=new t;var Z=new o;return T.projectTo2D=function(e,r,i){r=n(r,Z);var a=r.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,X),s=t.cross(t.UNIT_Z,E,V);t.normalize(s,s);var c=t.cross(E,s,H);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,q),l=K,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;f>N;++N){var h=l[N];t.add(o,h,h);var d=a.cartesianToCartographic(h,Y);r.project(d,h)}i=T.fromPoints(l,i),o=i.center;var m=o.x,I=o.y,S=o.z;return o.x=S,o.y=m,o.z=I,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("Renderer/WebGLConstants",["../Core/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/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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++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",t(document[i])?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",t(document[i])&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",t(document[i])?r.fullscreenElement=i:(i=E+"FullScreenElement",t(document[i])&&(r.fullscreenElement=i)),i=E+"fullscreenchange",t(document["on"+i])&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",t(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;r>n;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(d)){d=!1;var t=/ Chrome\/([\.0-9]+)/.exec(h.userAgent);null!==t&&(d=!0,m=r(t[1]))}return d}function a(){return i()&&m}function o(){if(!e(I)&&(I=!1,!i()&&/ Safari\/[\.0-9]+/.test(h.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(h.userAgent);null!==t&&(I=!0,S=r(t[1]))}return I}function u(){return o()&&S}function E(){if(!e(M)){M=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(h.userAgent);null!==t&&(M=!0,O=r(t[1]),O.isNightly=!!t[2])}return M}function s(){return E()&&O}function c(){if(!e(y)){y=!1;var t;"Microsoft Internet Explorer"===h.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(h.userAgent),null!==t&&(y=!0,p=r(t[1]))):"Netscape"===h.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(h.userAgent),null!==t&&(y=!0,p=r(t[1])))}return y}function _(){return c()&&p}function R(){if(!e(C)){C=!1;var t=/Firefox\/([\.0-9]+)/.exec(h.userAgent);null!==t&&(C=!0,F=r(t[1]))}return C}function T(){return e(L)||(L=/Windows/i.test(h.appVersion)),L}function l(){return R()&&F}function A(){return e(U)||(U="undefined"!=typeof PointerEvent&&(!e(h.pointerEnabled)||h.pointerEnabled)),U}function f(){if(!e(x)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;x=e(n)&&""!==n,x&&(P=n)}return x}function N(){return f()?P:void 0}var h;h="undefined"!=typeof navigator?navigator:{};var d,m,I,S,M,O,y,p,C,F,L,U,P,x,w={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isFirefox:R,firefoxVersion:l,isWindows:T,hardwareConcurrency:t(h.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:f,imageRenderingValue:N};return w.supportsFullscreen=function(){return n.supportsFullscreen()},w.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},w.supportsWebWorkers=function(){return"undefined"!=typeof Worker},w}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,e,n,r,i,a){"use strict";if(!i.supportsTypedArrays())return{};var o={BYTE:t.BYTE,UNSIGNED_BYTE:t.UNSIGNED_BYTE,SHORT:t.SHORT,UNSIGNED_SHORT:t.UNSIGNED_SHORT,FLOAT:t.FLOAT,DOUBLE:t.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},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 Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return n(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||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.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(t,n,i,a){switch(i=e(i,0),a=e(a,(n.byteLength-i)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,i,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,i,a);case o.SHORT:return new Int16Array(n,i,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,i,a);case o.FLOAT:return new Float32Array(n,i,a);case o.DOUBLE:return new Float64Array(n,i,a);default:throw new r("componentDatatype is not a valid value.")}},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",["../Renderer/WebGLConstants","./freezeObject"],function(t,e){"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(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 e(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=void 0}return a.computeNumberOfVertices=function(t){var r=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&e(t.attributes[i])&&e(t.attributes[i].values)){var a=t.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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){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},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){return e(t)?(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):void 0},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 R=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){if(!i(t))throw new a("boundingBox is required.");return new _({minimum:t.minimum,maximum:t.maximum})},_.fromAxisAlignedBoundingBox=function(t){if(!i(t))throw new a("boundingBox is required.");return new _({minimum:t.minimum,maximum:t.maximum})},_.packedLength=2*e.packedLength+c.packedLength,_.pack=function(t,n,i){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)};var T=new e,l=new e,A=new c,f={minimum:T,maximum:l,vertexFormat:A};return _.unpack=function(t,n,a){n=r(n,0);var o=e.unpack(t,n,T),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,a,c=r._minimum,_=r._maximum,T=r._vertexFormat,l=new E;if(T.position&&(T.st||T.normal||T.binormal||T.tangent)){if(T.position&&(a=new Float64Array(72),a[0]=c.x,a[1]=c.y,a[2]=_.z,a[3]=_.x,a[4]=c.y,a[5]=_.z,a[6]=_.x,a[7]=_.y,a[8]=_.z,a[9]=c.x,a[10]=_.y,a[11]=_.z,a[12]=c.x,a[13]=c.y,a[14]=c.z,a[15]=_.x,a[16]=c.y,a[17]=c.z,a[18]=_.x,a[19]=_.y,a[20]=c.z,a[21]=c.x,a[22]=_.y,a[23]=c.z,a[24]=_.x,a[25]=c.y,a[26]=c.z,a[27]=_.x,a[28]=_.y,a[29]=c.z,a[30]=_.x,a[31]=_.y,a[32]=_.z,a[33]=_.x,a[34]=c.y,a[35]=_.z,a[36]=c.x,a[37]=c.y,a[38]=c.z,a[39]=c.x,a[40]=_.y,a[41]=c.z,a[42]=c.x,a[43]=_.y,a[44]=_.z,a[45]=c.x,a[46]=c.y,a[47]=_.z,a[48]=c.x,a[49]=_.y,a[50]=c.z,a[51]=_.x,a[52]=_.y,a[53]=c.z,a[54]=_.x,a[55]=_.y,a[56]=_.z,a[57]=c.x,a[58]=_.y,a[59]=_.z,a[60]=c.x,a[61]=c.y,a[62]=c.z,a[63]=_.x,a[64]=c.y,a[65]=c.z,a[66]=_.x,a[67]=c.y,a[68]=_.z,a[69]=c.x,a[70]=c.y,a[71]=_.z,l.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:a})),T.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(T.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(T.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(T.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})}i=new Uint16Array(36),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3,i[6]=6,i[7]=5,i[8]=4,i[9]=7,i[10]=6,i[11]=4,i[12]=8,i[13]=9,i[14]=10,i[15]=8,i[16]=10,i[17]=11,i[18]=14,i[19]=13,i[20]=12,i[21]=15,i[22]=14,i[23]=12,i[24]=18,i[25]=17,i[26]=16,i[27]=19,i[28]=18,i[29]=16,i[30]=20,i[31]=21,i[32]=22,i[33]=20,i[34]=22,i[35]=23}else a=new Float64Array(24),a[0]=c.x,a[1]=c.y,a[2]=c.z,a[3]=_.x,a[4]=c.y,a[5]=c.z,a[6]=_.x,a[7]=_.y,a[8]=c.z,a[9]=c.x,a[10]=_.y,a[11]=c.z,a[12]=c.x,a[13]=c.y,a[14]=_.z,a[15]=_.x,a[16]=c.y,a[17]=_.z,a[18]=_.x,a[19]=_.y,a[20]=_.z,a[21]=c.x,a[22]=_.y,a[23]=_.z,l.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:a}),i=new Uint16Array(36),i[0]=4,i[1]=5,i[2]=6,i[3]=4,i[4]=6,i[5]=7,i[6]=1,i[7]=0,i[8]=3,i[9]=1,i[10]=3,i[11]=2,i[12]=1,i[13]=6,i[14]=5,i[15]=1,i[16]=2,i[17]=6,i[18]=2,i[19]=3,i[20]=7,i[21]=2,i[22]=7,i[23]=6,i[24]=3,i[25]=0,i[26]=4,i[27]=3,i[28]=4,i[29]=7,i[30]=0,i[31]=1,i[32]=5,i[33]=0,i[34]=5,i[35]=4;var d=e.subtract(_,c,R),m=.5*e.magnitude(d);return new o({attributes:l,indices:i,primitiveType:s.TRIANGLES,boundingSphere:new t(e.ZERO,m)})},_}),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/Workers/createBoxOutlineGeometry.js b/Workers/createBoxOutlineGeometry.js index d3eefba..52cbe32 100644 --- a/Workers/createBoxOutlineGeometry.js +++ b/Workers/createBoxOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,5 +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";var t=function(t){return void 0!==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";var e=function(t,e){return void 0!==t?t:e};return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";var e=function(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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("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^=2636928640&t<<7,t^=4022730752&t<<15,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){"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(t){return t>0?1:0>t?-1:0},n.signNotZero=function(t){return 0>t?-1:1},n.toSNorm=function(t){return Math.round(255*(.5*n.clamp(t,-1,1)+.5))},n.fromSNorm=function(t){return 2*(n.clamp(t,0,255)/255)-1},n.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},n.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},n.lerp=function(t,e,n){return(1-n)*t+n*e},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(t){return t*n.RADIANS_PER_DEGREE},n.toDegrees=function(t){return t*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(t){var e=n.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},n.negativePiToPi=function(t){for(var e=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+e)>t;)t+=i;if(-r>t)return-r;for(;t>r+e;)t-=i;return t>r?r:t},n.zeroToTwoPi=function(t){var e=t%n.TWO_PI;return 0>e?(e+n.TWO_PI)%n.TWO_PI:e},n.equalsEpsilon=function(t,n,r){return r=e(r,0),Math.abs(t-n)<=r};var r=[1];n.factorial=function(t){var e=r.length;if(t>=e)for(var n=r[e-1],i=e;t>=i;i++)r.push(n*i);return r[t]},n.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},n.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},n.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},n.clamp=function(t,e,n){return e>t?e:t>n?n:t};var i=new t;return n.setRandomNumberSeed=function(e){i=new t(e)},n.nextRandomNumber=function(){return i.random()},n.acosClamped=function(t){return Math.acos(n.clamp(t,-1,1))},n.asinClamped=function(t){return Math.asin(n.clamp(t,-1,1))},n}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)};a.fromSpherical=function(n,r){e(r)||(r=new a);var i=n.clock,o=n.cone,u=t(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(t,n,r,i){return e(i)?(i.x=t,i.y=n,i.z=r,i):new a(t,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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.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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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 s=new a,c=new a;a.angleBetween=function(t,e){a.normalize(t,s),a.normalize(e,c);var n=a.dot(s,c),r=a.magnitude(a.cross(s,c,s));return Math.atan2(r,n)};var l=new a;a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,l);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):n.y<=n.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r},a.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,s=e.z,c=i*s-a*u,l=a*o-r*s,h=r*u-i*o;return n.x=c,n.y=l,n.z=h,n},a.fromDegrees=function(t,e,n,r,o){var u=i.toRadians(t),s=i.toRadians(e);return a.fromRadians(u,s,n,r,o)};var h=new a,f=new a,d=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=t(i,0);var s=e(o)?o.radiiSquared:d,c=Math.cos(r);h.x=c*Math.cos(n),h.y=c*Math.sin(n),h.z=Math.sin(r),h=a.normalize(h,h),a.multiplyComponents(s,h,f);var l=Math.sqrt(a.dot(h,f));return f=a.divideByScalar(f,l,f),h=a.multiplyByScalar(h,i,h),e(u)||(u=new a),a.add(f,h,u)},a.fromDegreesArray=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=i.toRadians(t[o]);return a.fromRadiansArray(r,e,n)},a.fromRadiansArray=function(t,n,r){var i=t.length;e(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],s=t[o+1];r[o/2]=a.fromRadians(u,s,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o+=3)r[o]=i.toRadians(t[o]),r[o+1]=i.toRadians(t[o+1]),r[o+2]=t[o+2];return a.fromRadiansArrayHeights(r,e,n)},a.fromRadiansArrayHeights=function(t,n,r){var i=t.length;e(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],s=t[o+1],c=t[o+2];r[o/3]=a.fromRadians(u,s,c,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)};return a.fromRadians=function(n,r,i,o){return i=t(i,0),e(o)?(o.longitude=n,o.latitude=r,o.height=i,o):new a(n,r,i)},a.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),a.fromRadians(t,e,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new a(t.longitude,t.latitude,t.height):void 0},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.longitude-n.longitude)<=r&&Math.abs(t.latitude-n.latitude)<=r&&Math.abs(t.height-n.height)<=r},a.ZERO=r(new a(0,0,0)),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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),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"],function(t,e,n,r,i,a,o,u){"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}var c=function(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,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))return void 0;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.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),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=s,n.z=c,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 l=new t,h=new t;c.prototype.cartographicToCartesian=function(e,n){var i=l,a=h;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;n>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var f=new t,d=new t,m=new t;c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,d);if(!r(a))return void 0;var o=this.geodeticSurfaceNormal(a,f),s=t.subtract(n,a,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),h=u.sign(t.dot(s,n))*t.magnitude(s);return r(i)?(i.longitude=c,i.latitude=l,i.height=h,i):new e(c,l,h)},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;n>i;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e};var y=new t,p=new t;return c.prototype.scaleToGeodeticSurface=function(e,n){var i=e.x,a=e.y,o=e.z,s=this._oneOverRadii,c=s.x,l=s.y,h=s.z,f=i*i*c*c,d=a*a*l*l,m=o*o*h*h,v=f+d+m,w=Math.sqrt(1/v),x=t.multiplyByScalar(e,w,y);if(v<this._centerToleranceSquared)return isFinite(w)?t.clone(x,n):void 0;var E=this._oneOverRadiiSquared,g=E.x,M=E.y,z=E.z,S=p;S.x=2*x.x*g,S.y=2*x.y*M,S.z=2*x.z*z;var O,R,T,_,I,N,b,A,C,P,L,q=(1-w)*t.magnitude(e)/(.5*t.magnitude(S)),U=0;do{q-=U,T=1/(1+q*g),_=1/(1+q*M),I=1/(1+q*z),N=T*T,b=_*_,A=I*I,C=N*T,P=b*_,L=A*I,O=f*N+d*b+m*A-1,R=f*C*g+d*P*M+m*L*z;var D=-2*R;U=O/D}while(Math.abs(O)>u.EPSILON12);return r(n)?(n.x=i*T,n.y=a*_,n.z=o*I,n):new t(i*T,a*_,o*I)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,s,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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";var u=function(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";var e=function(e,n){this.start=t(e,0),this.stop=t(n,0)};return e}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";var i=function(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)};i.fromElements=function(t,n,r,a,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=a,o):new i(t,n,r,a)},i.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 i(t.red,t.green,t.blue,t.alpha)},i.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new i(t.x,t.y,t.z,t.w):void 0},i.packedLength=4,i.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r++],a.w=n[r],a},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,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},i.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},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 a=new i;i.distance=function(t,e){return i.subtract(t,e,a),i.magnitude(a)},i.normalize=function(t,e){var n=i.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,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,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},i.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},i.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},i.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},i.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},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 o=new i;i.lerp=function(t,e,n,r){return i.multiplyByScalar(e,n,o),r=i.multiplyByScalar(t,1-n,r),i.add(o,r,r)};var u=new i;return i.mostOrthogonalAxis=function(t,e){var n=i.normalize(t,u);return i.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?i.clone(i.UNIT_X,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e):n.y<=n.z?n.y<=n.w?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e)},i.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},i.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r&&Math.abs(t.w-n.w)<=r},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(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e){return i.equalsEpsilon(this,t,e)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t){for(var e=0,n=0;9>n;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function u(t){for(var e=0,n=0;3>n;++n){var r=t[c.getElementIndex(d[n],f[n])];e+=2*r*r}return Math.sqrt(e)}function s(t,e){for(var n=a.EPSILON15,r=0,i=1,o=0;3>o;++o){var u=Math.abs(t[c.getElementIndex(d[o],f[o])]);u>r&&(i=o,r=u)}var s=1,l=0,h=f[i],m=d[i];if(Math.abs(t[c.getElementIndex(m,h)])>n){var y,p=t[c.getElementIndex(m,m)],v=t[c.getElementIndex(h,h)],w=t[c.getElementIndex(m,h)],x=(p-v)/2/w;y=0>x?-1/(-x+Math.sqrt(1+x*x)):1/(x+Math.sqrt(1+x*x)),s=1/Math.sqrt(1+y*y),l=y*s}return e=c.clone(c.IDENTITY,e),e[c.getElementIndex(h,h)]=e[c.getElementIndex(m,m)]=s,e[c.getElementIndex(m,h)]=l,e[c.getElementIndex(h,m)]=-l,e}var c=function(t,n,r,i,a,o,u,s,c){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(s,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(c,0)};c.clone=function(t,e){return n(t)?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 c(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},c.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new c),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},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[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 c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},c.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,u=t.y*t.y,s=t.y*t.z,l=t.y*t.w,h=t.z*t.z,f=t.z*t.w,d=t.w*t.w,m=r-u-h+d,y=2*(i-f),p=2*(a+l),v=2*(i+f),w=-r+u-h+d,x=2*(s-o),E=2*(a-l),g=2*(s+o),M=-r-u+h+d;return n(e)?(e[0]=m,e[1]=v,e[2]=E,e[3]=y,e[4]=w,e[5]=g,e[6]=p,e[7]=x,e[8]=M,e):new c(m,y,p,v,w,x,E,g,M)},c.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 c(t.x,0,0,0,t.y,0,0,0,t.z)},c.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 c(t,0,0,0,t,0,0,0,t)},c.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 c(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},c.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 c(1,0,0,0,r,-i,0,i,r)},c.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 c(r,0,i,0,1,0,-i,0,r)},c.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 c(r,-i,0,i,r,0,0,0,1)},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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},c.getElementIndex=function(t,e){return 3*t+e},c.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},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},c.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},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,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[3],e[4],e[5],l)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],l)),n};var h=new t;c.getMaximumScale=function(e){return c.getScale(e,h),t.maximumComponent(h)},c.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],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],c=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],h=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]=s,n[6]=c,n[7]=l,n[8]=h,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},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},c.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,s=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=s,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},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},c.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],s=t[2],c=t[5],l=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=s,e[7]=c,e[8]=l,e};var f=[1,0,0],d=[2,2,1],m=new c,y=new c;return c.computeEigenDecomposition=function(t,e){var r=a.EPSILON20,i=10,l=0,h=0;n(e)||(e={});for(var f=e.unitary=c.clone(c.IDENTITY,e.unitary),d=e.diagonal=c.clone(t,e.diagonal),p=r*o(d);i>h&&u(d)>p;)s(d,m),c.transpose(m,y),c.multiply(d,m,d),c.multiply(y,d,d),c.multiply(f,m,f),++l>2&&(++h,l=0);return 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},c.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],s=t[5],c=t[8];return e*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},c.inverse=function(t,e){var n=t[0],i=t[1],o=t[2],u=t[3],s=t[4],l=t[5],h=t[6],f=t[7],d=t[8],m=c.determinant(t);if(Math.abs(m)<=a.EPSILON15)throw new r("matrix is not invertible");e[0]=s*d-f*l,e[1]=f*o-i*d,e[2]=i*l-s*o,e[3]=h*l-u*d,e[4]=n*d-h*o,e[5]=u*o-n*l,e[6]=u*f-h*s,e[7]=h*i-n*f,e[8]=n*s-u*i;var y=1/m;return c.multiplyByScalar(e,y,e)},c.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]},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},c.IDENTITY=i(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(t){"use strict";var e=function(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,s){"use strict";var c=function(t,e,r,i,a,o,u,s,c,l,h,f,d,m,y,p){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(e,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(m,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(h,0),this[11]=n(y,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(p,0)};c.packedLength=16,c.pack=function(t,e,r){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]},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){return r(t)?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]):void 0},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,s=e.x*e.x,l=e.x*e.y,h=e.x*e.z,f=e.x*e.w,d=e.y*e.y,m=e.y*e.z,y=e.y*e.w,p=e.z*e.z,v=e.z*e.w,w=e.w*e.w,x=s-d-p+w,E=2*(l-v),g=2*(h+y),M=2*(l+v),z=-s+d-p+w,S=2*(m-f),O=2*(h-y),R=2*(m+f),T=-s-d+p+w;return i[0]=x*a,i[1]=M*a,i[2]=O*a,i[3]=0,i[4]=E*o,i[5]=z*o,i[6]=R*o,i[7]=0,i[8]=g*u,i[9]=S*u,i[10]=T*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},c.fromTranslation=function(t,e){return c.fromRotationTranslation(u.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 l=new t,h=new t,f=new t;c.fromCamera=function(e,n){var i=e.eye,a=e.target,o=e.up;t.normalize(t.subtract(a,i,l),l),t.normalize(t.cross(l,o,h),h),t.normalize(t.cross(h,l,f),f);var u=h.x,s=h.y,d=h.z,m=l.x,y=l.y,p=l.z,v=f.x,w=f.y,x=f.z,E=i.x,g=i.y,M=i.z,z=u*-E+s*-g+d*-M,S=v*-E+w*-g+x*-M,O=m*E+y*g+p*M;return r(n)?(n[0]=u,n[1]=v,n[2]=-m,n[3]=0,n[4]=s,n[5]=w,n[6]=-y,n[7]=0,n[8]=d,n[9]=x,n[10]=-p,n[11]=0,n[12]=z,n[13]=S,n[14]=O,n[15]=1,n):new c(u,s,d,z,v,w,x,S,-m,-y,-p,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,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},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),s=1/(r-n),c=1/(a-i),l=-(e+t)*u,h=-(r+n)*s,f=-(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]=h,o[14]=f,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),s=2*i/(r-n),c=(e+t)/(e-t),l=(r+n)/(r-n),h=-(a+i)/(a-i),f=-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]=h,o[11]=f,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),l=-1,h=-1,f=-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]=h,a[12]=0,a[13]=0,a[14]=f,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),s=n(t.height,0);e=n(e,0),r=n(r,1);var c=.5*u,l=.5*s,h=.5*(r-e),f=c,d=l,m=h,y=a+c,p=o+l,v=e+h,w=1;return i[0]=f,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]=m,i[11]=0,i[12]=y,i[13]=p,i[14]=v,i[15]=w,i},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.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 d=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],d)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],d)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],d)),n};var m=new t;c.getMaximumScale=function(e){return c.getScale(e,m),t.maximumComponent(m)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],s=t[5],c=t[6],l=t[7],h=t[8],f=t[9],d=t[10],m=t[11],y=t[12],p=t[13],v=t[14],w=t[15],x=e[0],E=e[1],g=e[2],M=e[3],z=e[4],S=e[5],O=e[6],R=e[7],T=e[8],_=e[9],I=e[10],N=e[11],b=e[12],A=e[13],C=e[14],P=e[15],L=r*x+u*E+h*g+y*M,q=i*x+s*E+f*g+p*M,U=a*x+c*E+d*g+v*M,D=o*x+l*E+m*g+w*M,B=r*z+u*S+h*O+y*R,F=i*z+s*S+f*O+p*R,W=a*z+c*S+d*O+v*R,G=o*z+l*S+m*O+w*R,V=r*T+u*_+h*I+y*N,Y=i*T+s*_+f*I+p*N,k=a*T+c*_+d*I+v*N,j=o*T+l*_+m*I+w*N,H=r*b+u*A+h*C+y*P,Z=i*b+s*A+f*C+p*P,X=a*b+c*A+d*C+v*P,K=o*b+l*A+m*C+w*P;return n[0]=L,n[1]=q,n[2]=U,n[3]=D,n[4]=B,n[5]=F,n[6]=W,n[7]=G,n[8]=V,n[9]=Y,n[10]=k,n[11]=j,n[12]=H,n[13]=Z,n[14]=X,n[15]=K,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],s=t[6],c=t[8],l=t[9],h=t[10],f=t[12],d=t[13],m=t[14],y=e[0],p=e[1],v=e[2],w=e[4],x=e[5],E=e[6],g=e[8],M=e[9],z=e[10],S=e[12],O=e[13],R=e[14],T=r*y+o*p+c*v,_=i*y+u*p+l*v,I=a*y+s*p+h*v,N=r*w+o*x+c*E,b=i*w+u*x+l*E,A=a*w+s*x+h*E,C=r*g+o*M+c*z,P=i*g+u*M+l*z,L=a*g+s*M+h*z,q=r*S+o*O+c*R+f,U=i*S+u*O+l*R+d,D=a*S+s*O+h*R+m;return n[0]=T,n[1]=_,n[2]=I,n[3]=0,n[4]=N,n[5]=b,n[6]=A,n[7]=0,n[8]=C,n[9]=P,n[10]=L,n[11]=0,n[12]=q,n[13]=U,n[14]=D,n[15]=1,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],s=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]=s,n[15]=t[15],n};var y=new t;c.multiplyByUniformScale=function(t,e,n){return y.x=e,y.y=e,y.z=e,c.multiplyByScale(t,y,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,s=t[1]*r+t[5]*i+t[9]*a+t[13]*o,c=t[2]*r+t[6]*i+t[10]*a+t[14]*o,l=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,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,s=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=s,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],s=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=s,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[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[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]},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 p=new u,v=new u,w=new e,x=new e(0,0,0,1);return c.inverse=function(t,n){if(u.equalsEpsilon(c.getRotation(t,p),v,o.EPSILON7)&&e.equals(c.getRow(t,3,w),x))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],l=t[12],h=t[1],f=t[5],d=t[9],m=t[13],y=t[2],E=t[6],g=t[10],M=t[14],z=t[3],S=t[7],O=t[11],R=t[15],T=g*R,_=M*O,I=E*R,N=M*S,b=E*O,A=g*S,C=y*R,P=M*z,L=y*O,q=g*z,U=y*S,D=E*z,B=T*f+N*d+b*m-(_*f+I*d+A*m),F=_*h+C*d+q*m-(T*h+P*d+L*m),W=I*h+P*f+U*m-(N*h+C*f+D*m),G=A*h+L*f+D*d-(b*h+q*f+U*d),V=_*i+I*a+A*l-(T*i+N*a+b*l),Y=T*r+P*a+L*l-(_*r+C*a+q*l),k=N*r+C*i+D*l-(I*r+P*i+U*l),j=b*r+q*i+U*a-(A*r+L*i+D*a);T=a*m,_=l*d,I=i*m,N=l*f,b=i*d,A=a*f,C=r*m,P=l*h,L=r*d,q=a*h,U=r*f,D=i*h;var H=T*S+N*O+b*R-(_*S+I*O+A*R),Z=_*z+C*O+q*R-(T*z+P*O+L*R),X=I*z+P*S+U*R-(N*z+C*S+D*R),K=A*z+L*S+D*O-(b*z+q*S+U*O),J=I*g+A*M+_*E-(b*M+T*E+N*g),Q=L*M+T*y+P*g-(C*g+q*M+_*y),$=C*E+D*M+N*y-(U*M+I*y+P*E),te=U*g+b*y+q*E-(L*E+D*g+A*y),ee=r*B+i*F+a*W+l*G;if(Math.abs(ee)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return ee=1/ee,n[0]=B*ee,n[1]=F*ee,n[2]=W*ee,n[3]=G*ee,n[4]=V*ee,n[5]=Y*ee,n[6]=k*ee,n[7]=j*ee,n[8]=H*ee,n[9]=Z*ee,n[10]=X*ee,n[11]=K*ee,n[12]=J*ee,n[13]=Q*ee,n[14]=$*ee,n[15]=te*ee,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],s=t[8],c=t[9],l=t[10],h=t[12],f=t[13],d=t[14],m=-n*h-r*f-i*d,y=-a*h-o*f-u*d,p=-s*h-c*f-l*d;return e[0]=n,e[1]=a,e[2]=s,e[3]=0,e[4]=r,e[5]=o,e[6]=c,e[7]=0,e[8]=i,e[9]=u,e[10]=l,e[11]=0,e[12]=m,e[13]=y,e[14]=p,e[15]=1,e},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";var u=function(t,n,r,i){this.west=e(t,0),this.south=e(n,0),this.east=e(r,0),this.north=e(i,0)};u.fromDegrees=function(t,r,i,a,s){return t=o.toRadians(e(t,0)),r=o.toRadians(e(r,0)),i=o.toRadians(e(i,0)),a=o.toRadians(e(a,0)),n(s)?(s.west=t,s.south=r,s.east=i,s.north=a,s):new u(t,r,i,a)},u.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=t.length;c>s;s++){var l=t[s];r=Math.min(r,l.longitude),i=Math.max(i,l.longitude),a=Math.min(a,l.latitude),o=Math.max(o,l.latitude)}return n(e)?(e.west=r,e.south=a,e.east=i,e.north=o,e):new u(r,a,i,o)},u.packedLength=4,u.pack=function(t,n,r){r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i.west=t[r++],i.south=t[r++],i.east=t[r++],i.north=t[r],i},u.clone=function(t,e){return n(t)?n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new u(t.west,t.south,t.east,t.north):void 0},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.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},u.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},u.validate=function(){},u.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)},u.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)},u.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)},u.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)},u.center=function(e,r){var i=e.east,a=e.west,u=.5*(a+i);return a>i&&(u=o.negativePiToPi(u+o.PI)),n(r)?(r.longitude=u,r.latitude=.5*(e.south+e.north),r.height=0,r):new t(u,.5*(e.south+e.north))},u.intersectWith=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),s=Math.min(t.north,e.north);return n(r)?(r.west=i,r.south=a,r.east=o,r.north=s,r):new u(i,a,o,s)},u.contains=function(t,e){return e.longitude>=t.west&&e.longitude<=t.east&&e.latitude>=t.south&&e.latitude<=t.north},u.isEmpty=function(t){return t.west>=t.east||t.south>=t.north};var s=new t;return u.subsample=function(t,r,a,u){r=e(r,i.WGS84),a=e(a,0),n(u)||(u=[]);var c=0,l=t.north,h=t.south,f=t.east,d=t.west,m=s;m.height=a,m.longitude=d,m.latitude=l,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:h>0?h:0;for(var y=1;8>y;++y){var p=-Math.PI+y*o.PI_OVER_TWO;p>d&&f>p&&(m.longitude=p,u[c]=r.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,s,c,l){"use strict";var h=function(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)},f=new t,d=new t,m=new t,y=new t,p=new t,v=new t,w=new t,x=new t,E=new t,g=new t,M=new t,z=new t;h.fromPoints=function(e,n){if(r(n)||(n=new h),!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],w),a=t.clone(i,f),o=t.clone(i,d),u=t.clone(i,m),s=t.clone(i,y),c=t.clone(i,p),l=t.clone(i,v),S=e.length,O=1;S>O;O++){t.clone(e[O],i);var R=i.x,T=i.y,_=i.z;R<a.x&&t.clone(i,a),R>s.x&&t.clone(i,s),T<o.y&&t.clone(i,o),T>c.y&&t.clone(i,c),_<u.z&&t.clone(i,u),_>l.z&&t.clone(i,l)}var I=t.magnitudeSquared(t.subtract(s,a,x)),N=t.magnitudeSquared(t.subtract(c,o,x)),b=t.magnitudeSquared(t.subtract(l,u,x)),A=a,C=s,P=I;N>P&&(P=N,A=o,C=c),b>P&&(P=b,A=u,C=l);var L=E;L.x=.5*(A.x+C.x),L.y=.5*(A.y+C.y),L.z=.5*(A.z+C.z);var q=t.magnitudeSquared(t.subtract(C,L,x)),U=Math.sqrt(q),D=g;D.x=a.x,D.y=o.y,D.z=u.z;var B=M;B.x=s.x,B.y=c.y,B.z=l.z;var F=t.multiplyByScalar(t.add(D,B,x),.5,z),W=0;for(O=0;S>O;O++){t.clone(e[O],i);var G=t.magnitude(t.subtract(i,F,x));G>W&&(W=G);var V=t.magnitudeSquared(t.subtract(i,L,x));if(V>q){var Y=Math.sqrt(V);U=.5*(U+Y),q=U*U;var k=Y-U;L.x=(U*L.x+k*i.x)/Y,L.y=(U*L.y+k*i.y)/Y,L.z=(U*L.z+k*i.z)/Y}}return W>U?(t.clone(L,n.center),n.radius=U):(t.clone(F,n.center),n.radius=W),n};var S=new o,O=new t,R=new t,T=new e,_=new e;h.fromRectangle2D=function(t,e,n){return h.fromRectangleWithHeights2D(t,e,0,0,n)},h.fromRectangleWithHeights2D=function(e,i,a,o,u){if(r(u)||(u=new h),!r(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;i=n(i,S),l.southwest(e,T),T.height=a,l.northeast(e,_),_.height=o;var s=i.project(T,O),c=i.project(_,R),f=c.x-s.x,d=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(f*f+d*d+m*m);var y=u.center;return y.x=s.x+.5*f,y.y=s.y+.5*d,y.z=s.z+.5*m,u};var I=[];h.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=l.subsample(t,e,i,I)),h.fromPoints(u,o)},h.fromVertices=function(e,i,a,o){if(r(o)||(o=new h),!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=w;u.x=e[0]+i.x,u.y=e[1]+i.y,u.z=e[2]+i.z;for(var s=t.clone(u,f),c=t.clone(u,d),l=t.clone(u,m),S=t.clone(u,y),O=t.clone(u,p),R=t.clone(u,v),T=e.length,_=0;T>_;_+=a){var I=e[_]+i.x,N=e[_+1]+i.y,b=e[_+2]+i.z;u.x=I,u.y=N,u.z=b,I<s.x&&t.clone(u,s),I>S.x&&t.clone(u,S),N<c.y&&t.clone(u,c),N>O.y&&t.clone(u,O),b<l.z&&t.clone(u,l),b>R.z&&t.clone(u,R)}var A=t.magnitudeSquared(t.subtract(S,s,x)),C=t.magnitudeSquared(t.subtract(O,c,x)),P=t.magnitudeSquared(t.subtract(R,l,x)),L=s,q=S,U=A;C>U&&(U=C,L=c,q=O),P>U&&(U=P,L=l,q=R);var D=E;D.x=.5*(L.x+q.x),D.y=.5*(L.y+q.y),D.z=.5*(L.z+q.z);var B=t.magnitudeSquared(t.subtract(q,D,x)),F=Math.sqrt(B),W=g;W.x=s.x,W.y=c.y,W.z=l.z;var G=M;G.x=S.x,G.y=O.y,G.z=R.z;var V=t.multiplyByScalar(t.add(W,G,x),.5,z),Y=0;for(_=0;T>_;_+=a){u.x=e[_]+i.x,u.y=e[_+1]+i.y,u.z=e[_+2]+i.z;var k=t.magnitude(t.subtract(u,V,x));k>Y&&(Y=k);var j=t.magnitudeSquared(t.subtract(u,D,x));if(j>B){var H=Math.sqrt(j);F=.5*(F+H),B=F*F;var Z=H-F;D.x=(F*D.x+Z*u.x)/H,D.y=(F*D.y+Z*u.y)/H,D.z=(F*D.z+Z*u.z)/H}}return Y>F?(t.clone(D,o.center),o.radius=F):(t.clone(V,o.center),o.radius=Y),o},h.fromCornerPoints=function(e,n,i){r(i)||(i=new h);var a=i.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),i.radius=t.distance(a,n),i},h.fromEllipsoid=function(e,n){return r(n)||(n=new h),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n},h.clone=function(e,n){return r(e)?r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new h(e.center,e.radius):void 0},h.packedLength=4,h.pack=function(t,e,r){r=n(r,0);var i=t.center;e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius},h.unpack=function(t,e,i){e=n(e,0),r(i)||(i=new h);var a=i.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],i.radius=t[e],i};var N=new t,b=new t;h.union=function(e,n,i){r(i)||(i=new h);var a=e.center,o=n.center;t.add(a,o,b);var u=t.multiplyByScalar(b,.5,b),s=t.magnitude(t.subtract(a,u,N))+e.radius,c=t.magnitude(t.subtract(o,u,N))+n.radius;return i.radius=Math.max(s,c),t.clone(u,i.center),i};var A=new t;h.expand=function(e,n,r){r=h.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,A));return i>r.radius&&(r.radius=i),r},h.intersect=function(e,n){var r=e.center,i=e.radius,a=t.dot(n,r)+n.w;return-i>a?u.OUTSIDE:i>a?u.INTERSECTING:u.INSIDE},h.transform=function(t,e,n){return r(n)||(n=new h),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var C=new t;h.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,C);return t.magnitudeSquared(r)-e.radius*e.radius},h.transformWithoutScale=function(t,e,n){return r(n)||(n=new h),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var P=new t;h.computePlaneDistances=function(e,n,i,a){r(a)||(a=new s);var o=t.subtract(e.center,n,P),u=t.multiplyByScalar(i,t.dot(i,o),P),c=t.magnitude(u);return a.start=c-e.radius,a.stop=c+e.radius,a};for(var L=new t,q=new t,U=new t,D=new t,B=new t,F=new e,W=new Array(8),G=0;8>G;++G)W[G]=new t;var V=new o;return h.projectTo2D=function(e,r,i){r=n(r,V);var a=r.ellipsoid,o=e.center,u=e.radius,s=a.geodeticSurfaceNormal(o,L),c=t.cross(t.UNIT_Z,s,q);t.normalize(c,c);var l=t.cross(s,c,U);t.normalize(l,l),t.multiplyByScalar(s,u,s),t.multiplyByScalar(l,u,l),t.multiplyByScalar(c,u,c);var f=t.negate(l,B),d=t.negate(c,D),m=W,y=m[0];t.add(s,l,y),t.add(y,c,y),y=m[1],t.add(s,l,y),t.add(y,d,y),y=m[2],t.add(s,f,y),t.add(y,d,y),y=m[3],t.add(s,f,y),t.add(y,c,y),t.negate(s,s),y=m[4],t.add(s,l,y),t.add(y,c,y),y=m[5],t.add(s,l,y),t.add(y,d,y),y=m[6],t.add(s,f,y),t.add(y,d,y),y=m[7],t.add(s,f,y),t.add(y,c,y);for(var p=m.length,v=0;p>v;++v){var w=m[v];t.add(o,w,w);var x=a.cartesianToCartographic(w,F);r.project(x,w)}i=h.fromPoints(m,i),o=i.center;var E=o.x,g=o.y,M=o.z;return o.x=M,o.y=E,o.z=g,i},h.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},h.prototype.intersect=function(t){return h.intersect(this,t)},h.prototype.equals=function(t){return h.equals(this,t)},h.prototype.clone=function(t){return h.clone(this,t)},h}),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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof e[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",t(document[i])?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",t(document[i])&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",t(document[i])?r.fullscreenElement=i:(i=s+"FullScreenElement",t(document[i])&&(r.fullscreenElement=i)),i=s+"fullscreenchange",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t){i.supportsFullscreen()&&t[r.requestFullscreen]()},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;r>n;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(m)){m=!1;var t=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(m=!0,y=r(t[1]))}return m}function a(){return i()&&y}function o(){if(!e(p)&&(p=!1,!i()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(p=!0,v=r(t[1]))}return p}function u(){return o()&&v}function s(){if(!e(w)){w=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==t&&(w=!0,x=r(t[1]),x.isNightly=!!t[2])}return w}function c(){return s()&&x}function l(){if(!e(E)){E=!1;var t;"Microsoft Internet Explorer"===navigator.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(E=!0,g=r(t[1]))):"Netscape"===navigator.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(E=!0,g=r(t[1])))}return E}function h(){return l()&&g}function f(){if(!e(M)){M=!1;var t=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(M=!0,z=r(t[1]))}return M}function d(){return f()&&z}var m,y,p,v,w,x,E,g,M,z,S={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:h,isFirefox:f,firefoxVersion:d,hardwareConcurrency:t(navigator.hardwareConcurrency,3)};return S.supportsFullscreen=function(){return n.supportsFullscreen()},S.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},S.supportsWebWorkers=function(){return"undefined"!=typeof Worker},S}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,e,n,r,i){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(t){switch(t){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(t){return t instanceof Int8Array?a.BYTE:t instanceof Uint8Array?a.UNSIGNED_BYTE:t instanceof Int16Array?a.SHORT:t instanceof Uint16Array?a.UNSIGNED_SHORT:t instanceof Float32Array?a.FLOAT:t instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(t){return e(t)&&(t===a.BYTE||t===a.UNSIGNED_BYTE||t===a.SHORT||t===a.UNSIGNED_SHORT||t===a.FLOAT||t===a.DOUBLE)},a.createTypedArray=function(t,e){switch(t){case a.BYTE:return new Int8Array(e);case a.UNSIGNED_BYTE:return new Uint8Array(e);case a.SHORT:return new Int16Array(e);case a.UNSIGNED_SHORT:return new Uint16Array(e);case a.FLOAT:return new Float32Array(e);case a.DOUBLE:return new Float64Array(e);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(e,r,i,o){switch(i=t(i,0),o=t(o,(r.byteLength-i)/a.getSizeInBytes(e)),e){case a.BYTE:return new Int8Array(r,i,o);case a.UNSIGNED_BYTE:return new Uint8Array(r,i,o);case a.SHORT:return new Int16Array(r,i,o);case a.UNSIGNED_SHORT:return new Uint16Array(r,i,o);case a.FLOAT:return new Float32Array(r,i,o);case a.DOUBLE:return new Float64Array(r,i,o);default:throw new n("componentDatatype is not a valid value.")}},i(a)}),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"],function(t){"use strict";var e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(t){return t===e.POINTS||t===e.LINES||t===e.LINE_LOOP||t===e.LINE_STRIP||t===e.TRIANGLES||t===e.TRIANGLE_STRIP||t===e.TRIANGLE_FAN}};return t(e)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";var a=function(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)};return a.computeNumberOfVertices=function(t){var r=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&e(t.attributes[i])&&e(t.attributes[i].values)){var a=t.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t){"use strict";var e=function(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 e}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";var e=function(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/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(t,e,n,r,i,a,o,u,s,c){"use strict";var l=new e,h=function(t){t=r(t,r.EMPTY_OBJECT);var n=t.minimumCorner,i=t.maximumCorner;this._min=e.clone(n),this._max=e.clone(i),this._workerName="createBoxOutlineGeometry"};return h.fromDimensions=function(t){t=r(t,r.EMPTY_OBJECT);var n=t.dimensions,i=e.multiplyByScalar(n,.5,new e),a=e.negate(i,new e),o=i,u={minimumCorner:a,maximumCorner:o};return new h(u)},h.createGeometry=function(r){var i=r._min,a=r._max,h=new s,f=new Uint16Array(24),d=new Float64Array(24);d[0]=i.x,d[1]=i.y,d[2]=i.z,d[3]=a.x,d[4]=i.y,d[5]=i.z,d[6]=a.x,d[7]=a.y,d[8]=i.z,d[9]=i.x,d[10]=a.y,d[11]=i.z,d[12]=i.x,d[13]=i.y,d[14]=a.z,d[15]=a.x,d[16]=i.y,d[17]=a.z,d[18]=a.x,d[19]=a.y,d[20]=a.z,d[21]=i.x,d[22]=a.y,d[23]=a.z,h.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:d}),f[0]=4,f[1]=5,f[2]=5,f[3]=6,f[4]=6,f[5]=7,f[6]=7,f[7]=4,f[8]=0,f[9]=1,f[10]=1,f[11]=2,f[12]=2,f[13]=3,f[14]=3,f[15]=0,f[16]=0,f[17]=4,f[18]=1,f[19]=5,f[20]=2,f[21]=6,f[22]=3,f[23]=7;var m=e.subtract(a,i,l),y=.5*e.magnitude(m);return new o({attributes:h,indices:f,primitiveType:c.LINES,boundingSphere:new t(e.ZERO,y)})},h}),define("Workers/createBoxOutlineGeometry",["../Core/BoxOutlineGeometry"],function(t){"use strict";return t.createGeometry})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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:0>e?-1:0},i.signNotZero=function(e){return 0>e?-1:1},i.toSNorm=function(e){return Math.round(255*(.5*i.clamp(e,-1,1)+.5))},i.fromSNorm=function(e){return i.clamp(e,0,255)/255*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.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 i>=a||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;e>=r;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}a.fromSpherical=function(n,r){t(r)||(r=new a);var i=n.clock,o=n.cone,u=e(n.magnitude,1),E=u*Math.sin(o);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(e,n,r,i){return t(i)?(i.x=e,i.y=n,i.z=r,i):new a(e,n,r)},a.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new a(e.x,e.y,e.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 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},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var u=new a;a.lerp=function(e,t,n,r){return a.multiplyByScalar(t,n,u),r=a.multiplyByScalar(e,1-n,r),a.add(u,r,r)};var E=new a,s=new a;a.angleBetween=function(e,t){a.normalize(e,E),a.normalize(t,s);var n=a.dot(E,s),r=a.magnitude(a.cross(E,s,E));return Math.atan2(r,n)};var c=new a;a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,c);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):n.y<=n.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,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},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},a.equalsEpsilon=function(e,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)},a.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},a.fromDegrees=function(e,t,n,r,o){var u=i.toRadians(e),E=i.toRadians(t);return a.fromRadians(u,E,n,r,o)};var _=new a,R=new a,T=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=e(i,0);var E=t(o)?o.radiiSquared:T,s=Math.cos(r);_.x=s*Math.cos(n),_.y=s*Math.sin(n),_.z=Math.sin(r),_=a.normalize(_,_),a.multiplyComponents(E,_,R);var c=Math.sqrt(a.dot(_,R));return R=a.divideByScalar(R,c,R),_=a.multiplyByScalar(_,i,_),t(u)||(u=new a),a.add(R,_,u)},a.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=i.toRadians(e[o]);return a.fromRadiansArray(r,t,n)},a.fromRadiansArray=function(e,n,r){var i=e.length;t(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=e[o],E=e[o+1];r[o/2]=a.fromRadians(u,E,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=i.toRadians(e[o]),r[o+1]=i.toRadians(e[o+1]),r[o+2]=e[o+2];return a.fromRadiansArrayHeights(r,t,n)},a.fromRadiansArrayHeights=function(e,n,r){var i=e.length;t(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=e[o],E=e[o+1],s=e[o+2];r[o/3]=a.fromRadians(u,E,s,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),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,R=n.z,T=i.x,l=i.y,A=i.z,f=c*c*T*T,N=_*_*l*l,h=R*R*A*A,d=f+N+h,I=Math.sqrt(1/d),S=e.multiplyByScalar(n,I,a);if(E>d)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 C,p,U,L,F,P,B,w,D,v,x,g=(1-I)*e.magnitude(n)/(.5*e.magnitude(y)),z=0;do{g-=z,U=1/(1+g*M),L=1/(1+g*m),F=1/(1+g*O),P=U*U,B=L*L,w=F*F,D=P*U,v=B*L,x=w*F,C=f*P+N*B+h*w-1,p=f*D*M+N*v*m+h*x*O;var G=-2*p;z=C/G}while(Math.abs(C)>r.EPSILON12);return t(s)?(s.x=c*U,s.y=_*L,s.z=R*F,s):new e(c*U,_*L,R*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),R=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),T=a.EPSILON1;return u.fromCartesian=function(t,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:R,f=n(r)?r._centerToleranceSquared:T,N=o(t,l,A,f,s);if(n(N)){var h=e.multiplyComponents(t,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){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){i=n(i,0),e.pack(t._radii,r,i)},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,R=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=R;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;n>i;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var T=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,T),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;n>i;++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}),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","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(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 u(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function E(e){for(var t=0,n=0;3>n;++n){var r=e[o.getElementIndex(T[n],R[n])];t+=2*r*r}return Math.sqrt(t)}function s(e,t){for(var n=a.EPSILON15,r=0,i=1,u=0;3>u;++u){var E=Math.abs(e[o.getElementIndex(T[u],R[u])]);E>r&&(i=u,r=E)}var s=1,c=0,_=R[i],l=T[i];if(Math.abs(e[o.getElementIndex(l,_)])>n){var A,f=e[o.getElementIndex(l,l)],N=e[o.getElementIndex(_,_)],h=e[o.getElementIndex(l,_)],d=(f-N)/2/h;A=0>d?-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=o.clone(o.IDENTITY,t),t[o.getElementIndex(_,_)]=t[o.getElementIndex(l,l)]=s,t[o.getElementIndex(l,_)]=c,t[o.getElementIndex(_,l)]=-c,t}o.packedLength=9,o.pack=function(e,n,r){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]},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[4]=e[r++],i[5]=e[r++],i[6]=e[r++],i[7]=e[r++],i[8]=e[r++],i},o.clone=function(e,t){return n(e)?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 o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},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[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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var r=e.x*e.x,i=e.x*e.y,a=e.x*e.z,u=e.x*e.w,E=e.y*e.y,s=e.y*e.z,c=e.y*e.w,_=e.z*e.z,R=e.z*e.w,T=e.w*e.w,l=r-E-_+T,A=2*(i-R),f=2*(a+c),N=2*(i+R),h=-r+E-_+T,d=2*(s-u),I=2*(a-c),S=2*(s+u),M=-r-E+_+T;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 o(l,A,f,N,h,d,I,S,M)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,r,-i,0,i,r)},o.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 o(r,0,i,0,1,0,-i,0,r)},o.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 o(r,-i,0,i,r,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},o.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},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var c=new e;o.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],c)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],c)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],c)),n};var _=new e;o.getMaximumScale=function(t){return o.getScale(t,_),e.maximumComponent(_)},o.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},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[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},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[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},o.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},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[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},o.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},o.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},o.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],T=[2,2,1],l=new o,A=new o;return o.computeEigenDecomposition=function(e,t){var r=a.EPSILON20,i=10,c=0,_=0;n(t)||(t={});for(var R=t.unitary=o.clone(o.IDENTITY,t.unitary),T=t.diagonal=o.clone(e,t.diagonal),f=r*u(T);i>_&&E(T)>f;)s(T,l),o.transpose(l,A),o.multiply(T,l,T),o.multiply(A,T,T),o.multiply(R,l,R),++c>2&&(++_,c=0);return 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[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},o.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)},o.inverse=function(e,t){var n=e[0],i=e[1],u=e[2],E=e[3],s=e[4],c=e[5],_=e[6],R=e[7],T=e[8],l=o.determinant(e);if(Math.abs(l)<=a.EPSILON15)throw new r("matrix is not invertible");t[0]=s*T-R*c,t[1]=R*u-i*T,t[2]=i*c-s*u,t[3]=_*c-E*T,t[4]=n*T-_*u,t[5]=E*u-n*c,t[6]=E*R-_*s,t[7]=_*i-n*R,t[8]=n*s-E*i;var A=1/l;return o.multiplyByScalar(t,A,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=i(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=i(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},a.packedLength=4,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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.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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(e,t,r,i,a,o,u,E,s,c,_,R,T,l,A,f){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(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(R,0),this[15]=n(f,0)}s.packedLength=16,s.pack=function(e,t,r){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]},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[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},s.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new s(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]):void 0},s.fromArray=s.unpack,s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},s.fromRotationTranslation=function(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 s(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)},s.fromTranslationQuaternionRotationScale=function(e,t,n,i){r(i)||(i=new s);var a=n.x,o=n.y,u=n.z,E=t.x*t.x,c=t.x*t.y,_=t.x*t.z,R=t.x*t.w,T=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-T-f+h,I=2*(c-N),S=2*(_+A),M=2*(c+N),m=-E+T-f+h,O=2*(l-R),y=2*(_-A),C=2*(l+R),p=-E-T+f+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]=C*o,i[7]=0,i[8]=S*u,i[9]=O*u,i[10]=p*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},s.fromTranslationRotationScale=function(e,t){return s.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},s.fromTranslation=function(e,t){return s.fromRotationTranslation(u.IDENTITY,e,t)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new s(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new s(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var c=new e,_=new e,R=new e;s.fromCamera=function(t,n){var i=t.eye,a=t.target,o=t.up;e.normalize(e.subtract(a,i,c),c),e.normalize(e.cross(c,o,_),_),e.normalize(e.cross(_,c,R),R);var u=_.x,E=_.y,T=_.z,l=c.x,A=c.y,f=c.z,N=R.x,h=R.y,d=R.z,I=i.x,S=i.y,M=i.z,m=u*-I+E*-S+T*-M,O=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]=T,n[9]=d,n[10]=-f,n[11]=0,n[12]=m,n[13]=O,n[14]=y,n[15]=1,n):new s(u,E,T,m,N,h,d,O,-l,-A,-f,y,0,0,0,1)},s.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},s.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,R=-(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]=R,o[15]=1,o},s.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),R=-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]=R,o[12]=0,o[13]=0,o[14]=T,o[15]=0,o},s.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,R=-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]=R,a[15]=0,a},s.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),R=s,T=c,l=_,A=a+s,f=o+c,N=t+_,h=1;return i[0]=R,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]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=N,i[15]=h,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[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},s.getElementIndex=function(e,t){return 4*e+t},s.getColumn=function(e,t,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},s.setColumn=function(e,t,n,r){r=s.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},s.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},s.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},s.setRow=function(e,t,n,r){return r=s.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;s.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 l=new e;s.getMaximumScale=function(t){return s.getScale(t,l),e.maximumComponent(l)},s.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],R=e[9],T=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],m=t[4],O=t[5],y=t[6],C=t[7],p=t[8],U=t[9],L=t[10],F=t[11],P=t[12],B=t[13],w=t[14],D=t[15],v=r*d+u*I+_*S+A*M,x=i*d+E*I+R*S+f*M,g=a*d+s*I+T*S+N*M,z=o*d+c*I+l*S+h*M,G=r*m+u*O+_*y+A*C,b=i*m+E*O+R*y+f*C,X=a*m+s*O+T*y+N*C,V=o*m+c*O+l*y+h*C,H=r*p+u*U+_*L+A*F,q=i*p+E*U+R*L+f*F,W=a*p+s*U+T*L+N*F,Y=o*p+c*U+l*L+h*F,K=r*P+u*B+_*w+A*D,Z=i*P+E*B+R*w+f*D,k=a*P+s*B+T*w+N*D,j=o*P+c*B+l*w+h*D;return n[0]=v,n[1]=x,n[2]=g,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]=Z,n[14]=k,n[15]=j,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[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},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[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},s.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],R=e[12],T=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],m=t[10],O=t[12],y=t[13],C=t[14],p=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,B=a*h+E*d+_*I,w=r*S+o*M+s*m,D=i*S+u*M+c*m,v=a*S+E*M+_*m,x=r*O+o*y+s*C+R,g=i*O+u*y+c*C+T,z=a*O+E*y+_*C+l;return n[0]=p,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=B,n[7]=0,n[8]=w,n[9]=D,n[10]=v,n[11]=0,n[12]=x,n[13]=g,n[14]=z,n[15]=1,n},s.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],R=t[0],T=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*R+o*T+s*l,M=i*R+u*T+c*l,m=a*R+E*T+_*l,O=r*A+o*f+s*N,y=i*A+u*f+c*N,C=a*A+E*f+_*N,p=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]=C,n[7]=0,n[8]=p,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},s.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;s.multiplyByUniformScale=function(e,t,n){return A.x=t,A.y=t,A.z=t,s.multiplyByScale(e,A,n)},s.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?s.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)},s.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},s.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},s.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},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[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},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},s.transpose=function(e,t){var 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},s.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e[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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},s.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},s.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var f=new u,N=new u,h=new t,d=new t(0,0,0,1);return s.inverse=function(e,n){if(u.equalsEpsilon(s.getRotation(e,f),N,o.EPSILON7)&&t.equals(s.getRow(e,3,h),d))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],c=e[12],_=e[1],R=e[5],T=e[9],l=e[13],A=e[2],I=e[6],S=e[10],M=e[14],m=e[3],O=e[7],y=e[11],C=e[15],p=S*C,U=M*y,L=I*C,F=M*O,P=I*y,B=S*O,w=A*C,D=M*m,v=A*y,x=S*m,g=A*O,z=I*m,G=p*R+F*T+P*l-(U*R+L*T+B*l),b=U*_+w*T+x*l-(p*_+D*T+v*l),X=L*_+D*R+g*l-(F*_+w*R+z*l),V=B*_+v*R+z*T-(P*_+x*R+g*T),H=U*i+L*a+B*c-(p*i+F*a+P*c),q=p*r+D*a+v*c-(U*r+w*a+x*c),W=F*r+w*i+z*c-(L*r+D*i+g*c),Y=P*r+x*i+g*a-(B*r+v*i+z*a);p=a*l,U=c*T,L=i*l,F=c*R,P=i*T,B=a*R,w=r*l,D=c*_,v=r*T,x=a*_,g=r*R,z=i*_;var K=p*O+F*y+P*C-(U*O+L*y+B*C),Z=U*m+w*y+x*C-(p*m+D*y+v*C),k=L*m+D*O+g*C-(F*m+w*O+z*C),j=B*m+v*O+z*y-(P*m+x*O+g*y),Q=L*S+B*M+U*I-(P*M+p*I+F*S),J=v*M+p*A+D*S-(w*S+x*M+U*A),$=w*I+z*M+F*A-(g*M+L*A+D*I),ee=g*S+P*A+x*I-(v*I+z*S+B*A),te=r*G+i*b+a*X+c*V;if(Math.abs(te)<o.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]=V*te,n[4]=H*te,n[5]=q*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},s.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],R=e[13],T=e[14],l=-n*_-r*R-i*T,A=-a*_-o*R-u*T,f=-E*_-s*R-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]=l,t[13]=A,t[14]=f,t[15]=1,t},s.IDENTITY=a(new s(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),s.ZERO=a(new s(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN0ROW3=3,s.COLUMN1ROW0=4,s.COLUMN1ROW1=5,s.COLUMN1ROW2=6,s.COLUMN1ROW3=7,s.COLUMN2ROW0=8,s.COLUMN2ROW1=9,s.COLUMN2ROW2=10,s.COLUMN2ROW3=11,s.COLUMN3ROW0=12,s.COLUMN3ROW1=13,s.COLUMN3ROW2=14,s.COLUMN3ROW3=15,s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.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]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},s}),define("Core/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}),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){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},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 n>t&&(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,R=e.length;R>_;_++){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 l=T.longitude>=0?T.longitude:T.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.clone=function(e,t){return n(e)?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):void 0},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;a>i&&(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;a>i&&o>0?i+=u.TWO_PI:s>o&&i>0&&(o+=u.TWO_PI),a>i&&0>s?s+=u.TWO_PI:s>o&&0>a&&(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 R=Math.max(e.south,t.south),T=Math.min(e.north,t.north);if(!(R>=T))return n(r)?(r.west=c,r.south=R,r.east=_,r.north=T,r):new E(c,R,_,T)}},E.union=function(e,t,r){return n(r)||(r=new E),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.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 i>a&&(a+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(a>n||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,R=e.south,T=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=T,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.latitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,0>_?A.latitude=_:R>0?A.latitude=R:A.latitude=0;for(var f=1;8>f;++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=T,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","./Plane","./Rectangle"],function(e,t,n,r,i,a,o,u,E,s,c,_,R){"use strict";function T(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var 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,m=new e,O=new e,y=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],I),a=e.clone(i,l),o=e.clone(i,A),u=e.clone(i,f),E=e.clone(i,N),s=e.clone(i,h),c=e.clone(i,d),_=t.length,R=1;_>R;R++){e.clone(t[R],i);var C=i.x,p=i.y,U=i.z;C<a.x&&e.clone(i,a),C>E.x&&e.clone(i,E),p<o.y&&e.clone(i,o),p>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,S)),F=e.magnitudeSquared(e.subtract(s,o,S)),P=e.magnitudeSquared(e.subtract(c,u,S)),B=a,w=E,D=L;F>D&&(D=F,B=o,w=s),P>D&&(D=P,B=u,w=c);var v=M;v.x=.5*(B.x+w.x),v.y=.5*(B.y+w.y),v.z=.5*(B.z+w.z);var x=e.magnitudeSquared(e.subtract(w,v,S)),g=Math.sqrt(x),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,S),.5,y),X=0;for(R=0;_>R;R++){e.clone(t[R],i);var V=e.magnitude(e.subtract(i,b,S));V>X&&(X=V);var H=e.magnitudeSquared(e.subtract(i,v,S));if(H>x){var q=Math.sqrt(H);g=.5*(g+q),x=g*g;var W=q-g;v.x=(g*v.x+W*i.x)/q,v.y=(g*v.y+W*i.y)/q,v.z=(g*v.z+W*i.z)/q}}return X>g?(e.clone(v,n.center),n.radius=g):(e.clone(b,n.center),n.radius=X),n};var C=new o,p=new e,U=new e,L=new t,F=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,C),R.southwest(t,L),L.height=a,R.northeast(t,F),F.height=o;var E=i.project(L,p),s=i.project(F,U),c=s.x-E.x,_=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+_*_+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*_,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=R.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=I;u.x=t[0]+i.x,u.y=t[1]+i.y,u.z=t[2]+i.z;for(var E=e.clone(u,l),s=e.clone(u,A),c=e.clone(u,f),_=e.clone(u,N),R=e.clone(u,h),C=e.clone(u,d),p=t.length,U=0;p>U;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>R.y&&e.clone(u,R),P<c.z&&e.clone(u,c),P>C.z&&e.clone(u,C)}var B=e.magnitudeSquared(e.subtract(_,E,S)),w=e.magnitudeSquared(e.subtract(R,s,S)),D=e.magnitudeSquared(e.subtract(C,c,S)),v=E,x=_,g=B;w>g&&(g=w,v=s,x=R),D>g&&(g=D,v=c,x=C);var z=M;z.x=.5*(v.x+x.x),z.y=.5*(v.y+x.y),z.z=.5*(v.z+x.z);var G=e.magnitudeSquared(e.subtract(x,z,S)),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=R.y,V.z=C.z;var H=e.multiplyByScalar(e.add(X,V,S),.5,y),q=0;for(U=0;p>U;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,S));W>q&&(q=W);var Y=e.magnitudeSquared(e.subtract(u,z,S));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 q>b?(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=I;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,l),u=e.clone(a,A),E=e.clone(a,f),s=e.clone(a,N),c=e.clone(a,h),_=e.clone(a,d),R=t.length,C=0;R>C;C+=3){var p=t[C]+n[C],U=t[C+1]+n[C+1],L=t[C+2]+n[C+2];a.x=p,a.y=U,a.z=L,p<o.x&&e.clone(a,o),p>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,S)),P=e.magnitudeSquared(e.subtract(c,u,S)),B=e.magnitudeSquared(e.subtract(_,E,S)),w=o,D=s,v=F;P>v&&(v=P,w=u,D=c),B>v&&(v=B,w=E,D=_);var x=M;x.x=.5*(w.x+D.x),x.y=.5*(w.y+D.y),x.z=.5*(w.z+D.z);var g=e.magnitudeSquared(e.subtract(D,x,S)),z=Math.sqrt(g),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,S),.5,y),V=0;for(C=0;R>C;C+=3){a.x=t[C]+n[C],a.y=t[C+1]+n[C+1],a.z=t[C+2]+n[C+2];var H=e.magnitude(e.subtract(a,X,S));H>V&&(V=H);var q=e.magnitudeSquared(e.subtract(a,x,S));if(q>g){var W=Math.sqrt(q);z=.5*(z+W),g=z*z;var Y=W-z;x.x=(z*x.x+Y*a.x)/W,x.y=(z*x.y+Y*a.y)/W,x.z=(z*x.z+Y*a.z)/W}}return V>z?(e.clone(x,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 B=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;i>o;o++)a.push(t[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;i>o;o++){var s=t[o];E=Math.max(E,e.distance(u,s.center,B)+s.radius)}return n.radius=E,n};var w=new e,D=new e,v=new e;T.fromOrientedBoundingBox=function(t,n){r(n)||(n=new T);var i=t.halfAxes,a=s.getColumn(i,0,w),o=s.getColumn(i,1,D),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){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new T(t.center,t.radius):void 0},T.packedLength=4,T.pack=function(e,t,r){r=n(r,0);var i=e.center;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 T);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var x=new e,g=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,x),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,g);return e.add(R,a,R),e.clone(R,i.center),i.radius=_,i};var z=new e;T.expand=function(t,n,r){r=T.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,z));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-i>o?u.OUTSIDE:i>o?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 G=new e;T.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,G);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 b=new e;T.computePlaneDistances=function(t,n,i,a){r(a)||(a=new E);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 X=new e,V=new e,H=new e,q=new e,W=new e,Y=new t,K=new Array(8),Z=0;8>Z;++Z)K[Z]=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,X),s=e.cross(e.UNIT_Z,E,V);e.normalize(s,s);var c=e.cross(E,s,H);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,q),l=K,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;f>N;++N){var h=l[N];e.add(o,h,h);var d=a.cartesianToCartographic(h,Y);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("Renderer/WebGLConstants",["../Core/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/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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++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",e(document[i])?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",e(document[i])&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",e(document[i])?r.fullscreenElement=i:(i=E+"FullScreenElement",e(document[i])&&(r.fullscreenElement=i)),i=E+"fullscreenchange",e(document["on"+i])&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",e(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;r>n;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(d)){d=!1;var e=/ Chrome\/([\.0-9]+)/.exec(h.userAgent);null!==e&&(d=!0,I=r(e[1]))}return d}function a(){return i()&&I}function o(){if(!t(S)&&(S=!1,!i()&&/ Safari\/[\.0-9]+/.test(h.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(h.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function u(){return o()&&M}function E(){if(!t(m)){m=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(h.userAgent);null!==e&&(m=!0,O=r(e[1]),O.isNightly=!!e[2])}return m}function s(){return E()&&O}function c(){if(!t(y)){y=!1;var e;"Microsoft Internet Explorer"===h.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(h.userAgent),null!==e&&(y=!0,C=r(e[1]))):"Netscape"===h.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(h.userAgent),null!==e&&(y=!0,C=r(e[1])))}return y}function _(){return c()&&C}function R(){if(!t(p)){p=!1;var e=/Firefox\/([\.0-9]+)/.exec(h.userAgent);null!==e&&(p=!0,U=r(e[1]))}return p}function T(){return t(L)||(L=/Windows/i.test(h.appVersion)),L}function l(){return R()&&U}function A(){return t(F)||(F="undefined"!=typeof PointerEvent&&(!t(h.pointerEnabled)||h.pointerEnabled)),F}function f(){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 f()?P:void 0}var h;h="undefined"!=typeof navigator?navigator:{};var d,I,S,M,m,O,y,C,p,U,L,F,P,B,w={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isFirefox:R,firefoxVersion:l,isWindows:T,hardwareConcurrency:e(h.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:f,imageRenderingValue:N};return w.supportsFullscreen=function(){return n.supportsFullscreen()},w.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},w.supportsWebWorkers=function(){return"undefined"!=typeof Worker},w}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,i,a){"use strict";if(!i.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return n(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,n,i,a){switch(i=t(i,0),a=t(a,(n.byteLength-i)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,i,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,i,a);case o.SHORT:return new Int16Array(n,i,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,i,a);case o.FLOAT:return new Float32Array(n,i,a);case o.DOUBLE:return new Float64Array(n,i,a);default:throw new r("componentDatatype is not a valid value.")}},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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(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=void 0}return a.computeNumberOfVertices=function(e){var r=-1;for(var i in e.attributes)if(e.attributes.hasOwnProperty(i)&&t(e.attributes[i])&&t(e.attributes[i].values)){var a=e.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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){if(!i(e))throw new a("boundingBox is required.");return new c({minimum:e.minimum,maximum:e.maximum})},c.packedLength=2*t.packedLength,c.pack=function(e,n,i){i=r(i,0),t.pack(e._min,n,i),t.pack(e._max,n,i+t.packedLength)};var R=new t,T=new t,l={minimum:R,maximum:T};return c.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n,R),u=t.unpack(e,n+t.packedLength,T);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,c=new E,R=new Uint16Array(24),T=new Float64Array(24);T[0]=i.x,T[1]=i.y,T[2]=i.z,T[3]=a.x,T[4]=i.y,T[5]=i.z,T[6]=a.x,T[7]=a.y,T[8]=i.z,T[9]=i.x,T[10]=a.y,T[11]=i.z,T[12]=i.x,T[13]=i.y,T[14]=a.z,T[15]=a.x,T[16]=i.y,T[17]=a.z,T[18]=a.x,T[19]=a.y,T[20]=a.z,T[21]=i.x,T[22]=a.y,T[23]=a.z,c.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:T}),R[0]=4,R[1]=5,R[2]=5,R[3]=6,R[4]=6,R[5]=7,R[6]=7,R[7]=4,R[8]=0,R[9]=1,R[10]=1,R[11]=2,R[12]=2,R[13]=3,R[14]=3,R[15]=0,R[16]=0,R[17]=4,R[18]=1,R[19]=5,R[20]=2,R[21]=6,R[22]=3,R[23]=7;var l=t.subtract(a,i,_),A=.5*t.magnitude(l);return new o({attributes:c,indices:R,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/Workers/createCircleGeometry.js b/Workers/createCircleGeometry.js index 1cd4c9b..38b06b3 100644 --- a/Workers/createCircleGeometry.js +++ b/Workers/createCircleGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +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";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};r.EPSILON1=.1,r.EPSILON2=.01,r.EPSILON3=.001,r.EPSILON4=1e-4,r.EPSILON5=1e-5,r.EPSILON6=1e-6,r.EPSILON7=1e-7,r.EPSILON8=1e-8,r.EPSILON9=1e-9,r.EPSILON10=1e-10,r.EPSILON11=1e-11,r.EPSILON12=1e-12,r.EPSILON13=1e-13,r.EPSILON14=1e-14,r.EPSILON15=1e-15,r.EPSILON16=1e-16,r.EPSILON17=1e-17,r.EPSILON18=1e-18,r.EPSILON19=1e-19,r.EPSILON20=1e-20,r.GRAVITATIONALPARAMETER=3986004418e5,r.SOLAR_RADIUS=6955e5,r.LUNAR_RADIUS=1737400,r.SIXTY_FOUR_KILOBYTES=65536,r.sign=function(e){return e>0?1:0>e?-1:0},r.signNotZero=function(e){return 0>e?-1:1},r.toSNorm=function(e){return Math.round(255*(.5*r.clamp(e,-1,1)+.5))},r.fromSNorm=function(e){return 2*(r.clamp(e,0,255)/255)-1},r.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},r.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},r.lerp=function(e,t,r){return(1-r)*e+r*t},r.PI=Math.PI,r.ONE_OVER_PI=1/Math.PI,r.PI_OVER_TWO=.5*Math.PI,r.PI_OVER_THREE=Math.PI/3,r.PI_OVER_FOUR=Math.PI/4,r.PI_OVER_SIX=Math.PI/6,r.THREE_PI_OVER_TWO=.5*3*Math.PI,r.TWO_PI=2*Math.PI,r.ONE_OVER_TWO_PI=1/(2*Math.PI),r.RADIANS_PER_DEGREE=Math.PI/180,r.DEGREES_PER_RADIAN=180/Math.PI,r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600,r.toRadians=function(e){return e*r.RADIANS_PER_DEGREE},r.toDegrees=function(e){return e*r.DEGREES_PER_RADIAN},r.convertLongitudeRange=function(e){var t=r.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},r.negativePiToPi=function(e){for(var t=r.EPSILON10,n=r.PI,a=r.TWO_PI;-(n+t)>e;)e+=a;if(-n>e)return-n;for(;e>n+t;)e-=a;return e>n?n:e},r.zeroToTwoPi=function(e){var t=e%r.TWO_PI;return 0>t?(t+r.TWO_PI)%r.TWO_PI:t},r.equalsEpsilon=function(e,r,n){return n=t(n,0),Math.abs(e-r)<=n};var n=[1];r.factorial=function(e){var t=n.length;if(e>=t)for(var r=n[t-1],a=t;e>=a;a++)n.push(r*a);return n[e]},r.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},r.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},r.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},r.clamp=function(e,t,r){return t>e?t:e>r?r:e};var a=new e;return r.setRandomNumberSeed=function(t){a=new e(t)},r.nextRandomNumber=function(){return a.random()},r.acosClamped=function(e){return Math.acos(r.clamp(e,-1,1))},r.asinClamped=function(e){return Math.asin(r.clamp(e,-1,1))},r}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i=function(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)};i.fromSpherical=function(r,n){t(n)||(n=new i);var a=r.clock,o=r.cone,u=e(r.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,r,n,a){return t(a)?(a.x=e,a.y=r,a.z=n,a):new i(e,r,n)},i.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z},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},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 o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(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},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.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 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){i.normalize(e,s),i.normalize(t,c);var r=i.dot(s,c),n=i.magnitude(i.cross(s,c,s));return Math.atan2(n,r)};var l=new i;i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);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,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z},i.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n},i.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},i.fromDegrees=function(e,t,r,n,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,r,n,o)};var f=new i,y=new i,d=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(r,n,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(n);f.x=c*Math.cos(r),f.y=c*Math.sin(r),f.z=Math.sin(n),f=i.normalize(f,f),i.multiplyComponents(s,f,y);var l=Math.sqrt(i.dot(f,y));return y=i.divideByScalar(y,l,y),f=i.multiplyByScalar(f,a,f),t(u)||(u=new i),i.add(y,f,u)},i.fromDegreesArray=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o++)n[o]=a.toRadians(e[o]);return i.fromRadiansArray(n,t,r)},i.fromRadiansArray=function(e,r,n){var a=e.length;t(n)?n.length=a/2:n=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];n[o/2]=i.fromRadians(u,s,0,r,n[o/2])}return n},i.fromDegreesArrayHeights=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o+=3)n[o]=a.toRadians(e[o]),n[o+1]=a.toRadians(e[o+1]),n[o+2]=e[o+2];return i.fromRadiansArrayHeights(n,t,r)},i.fromRadiansArrayHeights=function(e,r,n){var a=e.length;t(n)?n.length=a/3:n=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];n[o/3]=i.fromRadians(u,s,c,r,n[o/3])}return n},i.ZERO=n(new i(0,0,0)),i.UNIT_X=n(new i(1,0,0)),i.UNIT_Y=n(new i(0,1,0)),i.UNIT_Z=n(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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i=function(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)};return i.fromRadians=function(r,n,a,o){return a=e(a,0),t(o)?(o.longitude=r,o.latitude=n,o.height=a,o):new i(r,n,a)},i.fromDegrees=function(e,t,r,n){return e=a.toRadians(e),t=a.toRadians(t),i.fromRadians(e,t,r,n)},i.clone=function(e,r){return t(e)?t(r)?(r.longitude=e.longitude,r.latitude=e.latitude,r.height=e.height,r):new i(e.longitude,e.latitude,e.height):void 0},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.longitude===r.longitude&&e.latitude===r.latitude&&e.height===r.height},i.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.longitude-r.longitude)<=n&&Math.abs(e.latitude-r.latitude)<=n&&Math.abs(e.height-r.height)<=n},i.ZERO=n(new i(0,0,0)),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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},i}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(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}var c=function(e,t,r){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,s(this,e,t,r)};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(t,r){if(!n(t))return void 0;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 c(a.x,a.y,a.z)},c.fromCartesian3=function(e,t){return n(t)||(t=new c),n(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=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.prototype.geocentricSurfaceNormal=e.normalize,c.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)},c.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var l=new e,f=new e;c.prototype.cartographicToCartesian=function(t,r){var a=l,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)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;r>a;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var y=new e,d=new e,m=new e;c.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,d);if(!n(i))return void 0;var o=this.geodeticSurfaceNormal(i,y),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)},c.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;r>a;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t};var h=new e,p=new e;return c.prototype.scaleToGeodeticSurface=function(t,r){var a=t.x,i=t.y,o=t.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,y=a*a*c*c,d=i*i*l*l,m=o*o*f*f,v=y+d+m,g=Math.sqrt(1/v),w=e.multiplyByScalar(t,g,h);if(v<this._centerToleranceSquared)return isFinite(g)?e.clone(w,r):void 0;var x=this._oneOverRadiiSquared,E=x.x,S=x.y,M=x.z,b=p;b.x=2*w.x*E,b.y=2*w.y*S,b.z=2*w.z*M;var T,A,z,O,N,I,R,P,_,L,C,D=(1-g)*e.magnitude(t)/(.5*e.magnitude(b)),q=0;do{D-=q,z=1/(1+D*E),O=1/(1+D*S),N=1/(1+D*M),I=z*z,R=O*O,P=N*N,_=I*z,L=R*O,C=P*N,T=y*I+d*R+m*P-1,A=y*_*E+d*L*S+m*C*M;var B=-2*A;q=T/B}while(Math.abs(T)>u.EPSILON12);return n(r)?(r.x=a*z,r.y=i*O,r.z=o*N,r):new e(a*z,i*O,o*N)},c.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)},c.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},c.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},c.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";var u=function(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";var t=function(t,r){this.start=e(t,0),this.stop=e(r,0)};return t}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";var a=function(t,r,n,a){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(a,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){return t(e)?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):void 0},a.packedLength=4,a.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w},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.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 i=new a;a.distance=function(e,t){return a.subtract(e,t,i),a.magnitude(i)},a.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.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.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 o=new a;a.lerp=function(e,t,r,n){return a.multiplyByScalar(t,r,o),n=a.multiplyByScalar(e,1-r,n),a.add(o,n,n)};var u=new a;return a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,u);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.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n&&Math.abs(e.w-r.w)<=n},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){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function u(e){for(var t=0,r=0;3>r;++r){var n=e[c.getElementIndex(d[r],y[r])];t+=2*n*n}return Math.sqrt(t)}function s(e,t){for(var r=i.EPSILON15,n=0,a=1,o=0;3>o;++o){var u=Math.abs(e[c.getElementIndex(d[o],y[o])]);u>n&&(a=o,n=u)}var s=1,l=0,f=y[a],m=d[a];if(Math.abs(e[c.getElementIndex(m,f)])>r){var h,p=e[c.getElementIndex(m,m)],v=e[c.getElementIndex(f,f)],g=e[c.getElementIndex(m,f)],w=(p-v)/2/g;h=0>w?-1/(-w+Math.sqrt(1+w*w)):1/(w+Math.sqrt(1+w*w)),s=1/Math.sqrt(1+h*h),l=h*s}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(f,f)]=t[c.getElementIndex(m,m)]=s,t[c.getElementIndex(m,f)]=l,t[c.getElementIndex(f,m)]=-l,t}var c=function(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)};c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,n,a){return n=t(n,0),r(a)||(a=new c),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},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,s=e.y*e.z,l=e.y*e.w,f=e.z*e.z,y=e.z*e.w,d=e.w*e.w,m=n-u-f+d,h=2*(a-y),p=2*(i+l),v=2*(a+y),g=-n+u-f+d,w=2*(s-o),x=2*(i-l),E=2*(s+o),S=-n-u+f+d;return r(t)?(t[0]=m,t[1]=v,t[2]=x,t[3]=h,t[4]=g,t[5]=E,t[6]=p,t[7]=w,t[8]=S,t):new c(m,h,p,v,g,w,x,E,S)},c.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new c(e.x,0,0,0,e.y,0,0,0,e.z)},c.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new c(e,0,0,0,e,0,0,0,e)},c.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.fromRotationX=function(e,t){var n=Math.cos(e),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 c(1,0,0,0,n,-a,0,a,n)},c.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 c(n,0,a,0,1,0,-a,0,n)},c.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 c(n,-a,0,a,n,0,0,0,1)},c.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},c.getElementIndex=function(e,t){return 3*e+t},c.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},c.setColumn=function(e,t,r,n){n=c.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},c.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},c.setRow=function(e,t,r,n){return n=c.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var l=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),r};var f=new e;c.getMaximumScale=function(t){return c.getScale(t,f),e.maximumComponent(f)},c.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],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},c.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},c.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},c.multiplyByVector=function(e,t,r){var n=t.x,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},c.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},c.transpose=function(e,t){var r=e[0],n=e[3],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 y=[1,0,0],d=[2,2,1],m=new c,h=new c;return c.computeEigenDecomposition=function(e,t){var n=i.EPSILON20,a=10,l=0,f=0;r(t)||(t={});for(var y=t.unitary=c.clone(c.IDENTITY,t.unitary),d=t.diagonal=c.clone(e,t.diagonal),p=n*o(d);a>f&&u(d)>p;)s(d,m),c.transpose(m,h),c.multiply(d,m,d),c.multiply(h,d,d),c.multiply(y,m,y),++l>2&&(++f,l=0);return t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},c.determinant=function(e){var t=e[0],r=e[3],n=e[6],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)},c.inverse=function(e,t){var r=e[0],a=e[1],o=e[2],u=e[3],s=e[4],l=e[5],f=e[6],y=e[7],d=e[8],m=c.determinant(e);if(Math.abs(m)<=i.EPSILON15)throw new n("matrix is not invertible");t[0]=s*d-y*l,t[1]=y*o-a*d,t[2]=a*l-s*o,t[3]=f*l-u*d,t[4]=r*d-f*o,t[5]=u*o-r*l,t[6]=u*y-f*s,t[7]=f*a-r*y,t[8]=r*s-u*a;var h=1/m;return c.multiplyByScalar(t,h,t)},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},c.IDENTITY=a(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s){"use strict";var c=function(e,t,n,a,i,o,u,s,c,l,f,y,d,m,h,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(m,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(h,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(y,0),this[15]=r(p,0)};c.packedLength=16,c.pack=function(e,t,n){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]},c.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new c),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},c.clone=function(e,t){return n(e)?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 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]):void 0},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,r,a){n(a)||(a=new c);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,l=t.x*t.y,f=t.x*t.z,y=t.x*t.w,d=t.y*t.y,m=t.y*t.z,h=t.y*t.w,p=t.z*t.z,v=t.z*t.w,g=t.w*t.w,w=s-d-p+g,x=2*(l-v),E=2*(f+h),S=2*(l+v),M=-s+d-p+g,b=2*(m-y),T=2*(f-h),A=2*(m+y),z=-s-d+p+g;return a[0]=w*i,a[1]=S*i,a[2]=T*i,a[3]=0,a[4]=x*o,a[5]=M*o,a[6]=A*o,a[7]=0,a[8]=E*u,a[9]=b*u,a[10]=z*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.IDENTITY,e,t)},c.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 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 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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,f=new e,y=new e;c.fromCamera=function(t,r){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,y),y);var u=f.x,s=f.y,d=f.z,m=l.x,h=l.y,p=l.z,v=y.x,g=y.y,w=y.z,x=a.x,E=a.y,S=a.z,M=u*-x+s*-E+d*-S,b=v*-x+g*-E+w*-S,T=m*x+h*E+p*S;return n(r)?(r[0]=u,r[1]=v,r[2]=-m,r[3]=0,r[4]=s,r[5]=g,r[6]=-h,r[7]=0,r[8]=d,r[9]=w,r[10]=-p,r[11]=0,r[12]=M,r[13]=b,r[14]=T,r[15]=1,r):new c(u,s,d,M,v,g,w,b,-m,-h,-p,T,0,0,0,1)},c.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},c.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,y=-(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]=y,o[15]=1,o},c.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),y=-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]=y,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},c.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,y=-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]=y,i[15]=0,i},c.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),y=c,d=l,m=f,h=i+c,p=o+l,v=t+f,g=1;return a[0]=y,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]=m,a[11]=0,a[12]=h,a[13]=p,a[14]=v,a[15]=g,a},c.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]]},c.getElementIndex=function(e,t){return 4*e+t},c.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},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.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},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 d=new e;c.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 m=new e;c.getMaximumScale=function(t){return c.getScale(t,m),e.maximumComponent(m)},c.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],y=e[9],d=e[10],m=e[11],h=e[12],p=e[13],v=e[14],g=e[15],w=t[0],x=t[1],E=t[2],S=t[3],M=t[4],b=t[5],T=t[6],A=t[7],z=t[8],O=t[9],N=t[10],I=t[11],R=t[12],P=t[13],_=t[14],L=t[15],C=n*w+u*x+f*E+h*S,D=a*w+s*x+y*E+p*S,q=i*w+c*x+d*E+v*S,B=o*w+l*x+m*E+g*S,U=n*M+u*b+f*T+h*A,F=a*M+s*b+y*T+p*A,G=i*M+c*b+d*T+v*A,W=o*M+l*b+m*T+g*A,V=n*z+u*O+f*N+h*I,Y=a*z+s*O+y*N+p*I,k=i*z+c*O+d*N+v*I,j=o*z+l*O+m*N+g*I,H=n*R+u*P+f*_+h*L,Z=a*R+s*P+y*_+p*L,X=i*R+c*P+d*_+v*L,Q=o*R+l*P+m*_+g*L;return r[0]=C,r[1]=D,r[2]=q,r[3]=B,r[4]=U,r[5]=F,r[6]=G,r[7]=W,r[8]=V,r[9]=Y,r[10]=k,r[11]=j,r[12]=H,r[13]=Z,r[14]=X,r[15]=Q,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],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],y=e[12],d=e[13],m=e[14],h=t[0],p=t[1],v=t[2],g=t[4],w=t[5],x=t[6],E=t[8],S=t[9],M=t[10],b=t[12],T=t[13],A=t[14],z=n*h+o*p+c*v,O=a*h+u*p+l*v,N=i*h+s*p+f*v,I=n*g+o*w+c*x,R=a*g+u*w+l*x,P=i*g+s*w+f*x,_=n*E+o*S+c*M,L=a*E+u*S+l*M,C=i*E+s*S+f*M,D=n*b+o*T+c*A+y,q=a*b+u*T+l*A+d,B=i*b+s*T+f*A+m;return r[0]=z,r[1]=O,r[2]=N,r[3]=0,r[4]=I,r[5]=R,r[6]=P,r[7]=0,r[8]=_,r[9]=L,r[10]=C,r[11]=0,r[12]=D,r[13]=q,r[14]=B,r[15]=1,r},c.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 h=new e;c.multiplyByUniformScale=function(e,t,r){return h.x=t,h.y=t,h.z=t,c.multiplyByScale(e,h,r)},c.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?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]=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)},c.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},c.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},c.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},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],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},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||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]&&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]},c.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},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 p=new u,v=new u,g=new t,w=new t(0,0,0,1);return c.inverse=function(e,r){if(u.equalsEpsilon(c.getRotation(e,p),v,o.EPSILON7)&&t.equals(c.getRow(e,3,g),w))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],l=e[12],f=e[1],y=e[5],d=e[9],m=e[13],h=e[2],x=e[6],E=e[10],S=e[14],M=e[3],b=e[7],T=e[11],A=e[15],z=E*A,O=S*T,N=x*A,I=S*b,R=x*T,P=E*b,_=h*A,L=S*M,C=h*T,D=E*M,q=h*b,B=x*M,U=z*y+I*d+R*m-(O*y+N*d+P*m),F=O*f+_*d+D*m-(z*f+L*d+C*m),G=N*f+L*y+q*m-(I*f+_*y+B*m),W=P*f+C*y+B*d-(R*f+D*y+q*d),V=O*a+N*i+P*l-(z*a+I*i+R*l),Y=z*n+L*i+C*l-(O*n+_*i+D*l),k=I*n+_*a+B*l-(N*n+L*a+q*l),j=R*n+D*a+q*i-(P*n+C*a+B*i);z=i*m,O=l*d,N=a*m,I=l*y,R=a*d,P=i*y,_=n*m,L=l*f,C=n*d,D=i*f,q=n*y,B=a*f;var H=z*b+I*T+R*A-(O*b+N*T+P*A),Z=O*M+_*T+D*A-(z*M+L*T+C*A),X=N*M+L*b+q*A-(I*M+_*b+B*A),Q=P*M+C*b+B*T-(R*M+D*b+q*T),K=N*E+P*S+O*x-(R*S+z*x+I*E),J=C*S+z*h+L*E-(_*E+D*S+O*h),$=_*x+B*S+I*h-(q*S+N*h+L*x),et=q*E+R*h+D*x-(C*x+B*E+P*h),tt=n*U+a*F+i*G+l*W;if(Math.abs(tt)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return tt=1/tt,r[0]=U*tt,r[1]=F*tt,r[2]=G*tt,r[3]=W*tt,r[4]=V*tt,r[5]=Y*tt,r[6]=k*tt,r[7]=j*tt,r[8]=H*tt,r[9]=Z*tt,r[10]=X*tt,r[11]=Q*tt,r[12]=K*tt,r[13]=J*tt,r[14]=$*tt,r[15]=et*tt,r},c.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],y=e[13],d=e[14],m=-r*f-n*y-a*d,h=-i*f-o*y-u*d,p=-s*f-c*y-l*d;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]=m,t[13]=h,t[14]=p,t[15]=1,t},c.IDENTITY=i(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o){"use strict";var u=function(e,r,n,a){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(a,0)};u.fromDegrees=function(e,n,a,i,s){return e=o.toRadians(t(e,0)),n=o.toRadians(t(n,0)),a=o.toRadians(t(a,0)),i=o.toRadians(t(i,0)),r(s)?(s.west=e,s.south=n,s.east=a,s.north=i,s):new u(e,n,a,i)},u.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=e.length;c>s;s++){var l=e[s];n=Math.min(n,l.longitude),a=Math.max(a,l.longitude),i=Math.min(i,l.latitude),o=Math.max(o,l.latitude)}return r(t)?(t.west=n,t.south=i,t.east=a,t.north=o,t):new u(n,i,a,o)},u.packedLength=4,u.pack=function(e,r,n){n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north},u.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new u),a.west=e[n++],a.south=e[n++],a.east=e[n++],a.north=e[n],a},u.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},u.validate=function(){},u.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},u.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},u.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},u.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},u.center=function(t,n){var a=t.east,i=t.west,u=.5*(i+a);return i>a&&(u=o.negativePiToPi(u+o.PI)),r(n)?(n.longitude=u,n.latitude=.5*(t.south+t.north),n.height=0,n):new e(u,.5*(t.south+t.north))},u.intersectWith=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),s=Math.min(e.north,t.north);return r(n)?(n.west=a,n.south=i,n.east=o,n.north=s,n):new u(a,i,o,s)},u.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},u.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var s=new e;return u.subsample=function(e,n,i,u){n=t(n,a.WGS84),i=t(i,0),r(u)||(u=[]);var c=0,l=e.north,f=e.south,y=e.east,d=e.west,m=s;m.height=i,m.longitude=d,m.latitude=l,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.longitude=y,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.latitude=f,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:f>0?f:0;for(var h=1;8>h;++h){var p=-Math.PI+h*o.PI_OVER_TWO;p>d&&y>p&&(m.longitude=p,u[c]=n.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=d,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.longitude=y,u[c]=n.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=i(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l){"use strict";var f=function(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)},y=new e,d=new e,m=new e,h=new e,p=new e,v=new e,g=new e,w=new e,x=new e,E=new e,S=new e,M=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],g),i=e.clone(a,y),o=e.clone(a,d),u=e.clone(a,m),s=e.clone(a,h),c=e.clone(a,p),l=e.clone(a,v),b=t.length,T=1;b>T;T++){e.clone(t[T],a);var A=a.x,z=a.y,O=a.z;A<i.x&&e.clone(a,i),A>s.x&&e.clone(a,s),z<o.y&&e.clone(a,o),z>c.y&&e.clone(a,c),O<u.z&&e.clone(a,u),O>l.z&&e.clone(a,l)}var N=e.magnitudeSquared(e.subtract(s,i,w)),I=e.magnitudeSquared(e.subtract(c,o,w)),R=e.magnitudeSquared(e.subtract(l,u,w)),P=i,_=s,L=N;I>L&&(L=I,P=o,_=c),R>L&&(L=R,P=u,_=l);var C=x;C.x=.5*(P.x+_.x),C.y=.5*(P.y+_.y),C.z=.5*(P.z+_.z);var D=e.magnitudeSquared(e.subtract(_,C,w)),q=Math.sqrt(D),B=E;B.x=i.x,B.y=o.y,B.z=u.z;var U=S;U.x=s.x,U.y=c.y,U.z=l.z;var F=e.multiplyByScalar(e.add(B,U,w),.5,M),G=0;for(T=0;b>T;T++){e.clone(t[T],a);var W=e.magnitude(e.subtract(a,F,w));W>G&&(G=W);var V=e.magnitudeSquared(e.subtract(a,C,w));if(V>D){var Y=Math.sqrt(V);q=.5*(q+Y),D=q*q;var k=Y-q;C.x=(q*C.x+k*a.x)/Y,C.y=(q*C.y+k*a.y)/Y,C.z=(q*C.z+k*a.z)/Y}}return G>q?(e.clone(C,r.center),r.radius=q):(e.clone(F,r.center),r.radius=G),r};var b=new o,T=new e,A=new e,z=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,b),l.southwest(t,z),z.height=i,l.northeast(t,O),O.height=o;var s=a.project(z,T),c=a.project(O,A),y=c.x-s.x,d=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(y*y+d*d+m*m);var h=u.center;return h.x=s.x+.5*y,h.y=s.y+.5*d,h.z=s.z+.5*m,u};var N=[];f.fromRectangle3D=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0);var u;return n(e)&&(u=l.subsample(e,t,a,N)),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=g;u.x=t[0]+a.x,u.y=t[1]+a.y,u.z=t[2]+a.z;for(var s=e.clone(u,y),c=e.clone(u,d),l=e.clone(u,m),b=e.clone(u,h),T=e.clone(u,p),A=e.clone(u,v),z=t.length,O=0;z>O;O+=i){var N=t[O]+a.x,I=t[O+1]+a.y,R=t[O+2]+a.z;u.x=N,u.y=I,u.z=R,N<s.x&&e.clone(u,s),N>b.x&&e.clone(u,b),I<c.y&&e.clone(u,c),I>T.y&&e.clone(u,T),R<l.z&&e.clone(u,l),R>A.z&&e.clone(u,A)}var P=e.magnitudeSquared(e.subtract(b,s,w)),_=e.magnitudeSquared(e.subtract(T,c,w)),L=e.magnitudeSquared(e.subtract(A,l,w)),C=s,D=b,q=P;_>q&&(q=_,C=c,D=T),L>q&&(q=L,C=l,D=A);var B=x;B.x=.5*(C.x+D.x),B.y=.5*(C.y+D.y),B.z=.5*(C.z+D.z);var U=e.magnitudeSquared(e.subtract(D,B,w)),F=Math.sqrt(U),G=E;G.x=s.x,G.y=c.y,G.z=l.z;var W=S;W.x=b.x,W.y=T.y,W.z=A.z;var V=e.multiplyByScalar(e.add(G,W,w),.5,M),Y=0;for(O=0;z>O;O+=i){u.x=t[O]+a.x,u.y=t[O+1]+a.y,u.z=t[O+2]+a.z;var k=e.magnitude(e.subtract(u,V,w));k>Y&&(Y=k);var j=e.magnitudeSquared(e.subtract(u,B,w));if(j>U){var H=Math.sqrt(j);F=.5*(F+H),U=F*F;var Z=H-F;B.x=(F*B.x+Z*u.x)/H,B.y=(F*B.y+Z*u.y)/H,B.z=(F*B.z+Z*u.z)/H}}return Y>F?(e.clone(B,o.center),o.radius=F):(e.clone(V,o.center),o.radius=Y),o},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},f.clone=function(t,r){return n(t)?n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius):void 0},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var a=e.center;t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius},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 I=new e,R=new e;f.union=function(t,r,a){n(a)||(a=new f);var i=t.center,o=r.center;e.add(i,o,R);var u=e.multiplyByScalar(R,.5,R),s=e.magnitude(e.subtract(i,u,I))+t.radius,c=e.magnitude(e.subtract(o,u,I))+r.radius;return a.radius=Math.max(s,c),e.clone(u,a.center),a};var P=new e;f.expand=function(t,r,n){n=f.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,P));return a>n.radius&&(n.radius=a),n},f.intersect=function(t,r){var n=t.center,a=t.radius,i=e.dot(r,n)+r.w;return-a>i?u.OUTSIDE:a>i?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=c.getMaximumScale(t)*e.radius,r};var _=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,_);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var L=new e;f.computePlaneDistances=function(t,r,a,i){n(i)||(i=new s);var o=e.subtract(t.center,r,L),u=e.multiplyByScalar(a,e.dot(a,o),L),c=e.magnitude(u);return i.start=c-t.radius,i.stop=c+t.radius,i};for(var C=new e,D=new e,q=new e,B=new e,U=new e,F=new t,G=new Array(8),W=0;8>W;++W)G[W]=new e;var V=new o;return f.projectTo2D=function(t,n,a){n=r(n,V);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,C),c=e.cross(e.UNIT_Z,s,D);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 y=e.negate(l,U),d=e.negate(c,B),m=G,h=m[0];e.add(s,l,h),e.add(h,c,h),h=m[1],e.add(s,l,h),e.add(h,d,h),h=m[2],e.add(s,y,h),e.add(h,d,h),h=m[3],e.add(s,y,h),e.add(h,c,h),e.negate(s,s),h=m[4],e.add(s,l,h),e.add(h,c,h),h=m[5],e.add(s,l,h),e.add(h,d,h),h=m[6],e.add(s,y,h),e.add(h,d,h),h=m[7],e.add(s,y,h),e.add(h,c,h);for(var p=m.length,v=0;p>v;++v){var g=m[v];e.add(o,g,g);var w=i.cartesianToCartographic(g,F);n.project(w,g)}a=f.fromPoints(m,a),o=a.center;var x=o.x,E=o.y,S=o.z;return o.x=S,o.y=x,o.z=E,a},f.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersect=function(e){return f.intersect(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i=function(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){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n]=t.y},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.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.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.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.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n},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){return i.equalsEpsilon(this,e,t)},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(){return a.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?n.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(n.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e){a.supportsFullscreen()&&e[n.requestFullscreen]()},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;n>r;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(m)){m=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(m=!0,h=n(e[1]))}return m}function i(){return a()&&h}function o(){if(!t(p)&&(p=!1,!a()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(p=!0,v=n(e[1]))}return p}function u(){return o()&&v}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(g=!0,w=n(e[1]),w.isNightly=!!e[2])}return g}function c(){return s()&&w}function l(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=n(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=n(e[1])))}return x}function f(){return l()&&E}function y(){if(!t(S)){S=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(S=!0,M=n(e[1]))}return S}function d(){return y()&&M}var m,h,p,v,g,w,x,E,S,M,b={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:y,firefoxVersion:d,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};return b.supportsFullscreen=function(){return r.supportsFullscreen()},b.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},b.supportsWebWorkers=function(){return"undefined"!=typeof Worker},b}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,r,n,a){"use strict";if(!n.supportsTypedArrays())return{};var i={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},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 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.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.FLOAT:return new Float32Array(t);case i.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},i.createArrayBufferView=function(t,n,a,o){switch(a=e(a,0),o=e(o,(n.byteLength-a)/i.getSizeInBytes(t)),t){case i.BYTE:return new Int8Array(n,a,o);case i.UNSIGNED_BYTE:return new Uint8Array(n,a,o);case i.SHORT:return new Int16Array(n,a,o);case i.UNSIGNED_SHORT:return new Uint16Array(n,a,o);case i.FLOAT:return new Float32Array(n,a,o);case i.DOUBLE:return new Float64Array(n,a,o);default:throw new r("componentDatatype is not a valid value.")}},a(i)}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,n,a,i,o,u){"use strict";var s=function(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)},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,y=Math.cos(i);return r(a)?(a.x=u,a.y=l,a.z=f,a.w=y,a):new s(u,l,f,y)};var l=[1,2,0],f=new Array(3);s.fromRotationMatrix=function(e,t){var n,a,i,o,c,y=e[u.COLUMN0ROW0],d=e[u.COLUMN1ROW1],m=e[u.COLUMN2ROW2],h=y+d+m;if(h>0)n=Math.sqrt(h+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,v=0;d>y&&(v=1),m>y&&m>d&&(v=2);var g=p[v],w=p[g];n=Math.sqrt(e[u.getElementIndex(v,v)]-e[u.getElementIndex(g,g)]-e[u.getElementIndex(w,w)]+1);var x=f;x[v]=.5*n,n=.5/n,c=(e[u.getElementIndex(w,g)]-e[u.getElementIndex(g,w)])*n,x[g]=(e[u.getElementIndex(g,v)]+e[u.getElementIndex(v,g)])*n,x[w]=(e[u.getElementIndex(w,v)]+e[u.getElementIndex(v,w)])*n,a=-x[0],i=-x[1],o=-x[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=c,t):new s(a,i,o,c)};var y=new e,d=new e,m=new s,h=new s,p=new s;s.packedLength=4,s.pack=function(e,r,n){n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w},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,p),s.conjugate(p,p);for(var a=0,i=r-t+1;i>a;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,y);var u=s.computeAngle(m);n[o]=y.x*u,n[o+1]=y.y*u,n[o+2]=y.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,h),0===u?s.clone(s.IDENTITY,m):s.fromAxisAngle(d,u,m),s.multiply(m,h,o)},s.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w):void 0},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,y=o*s-n*c+a*l+i*u,d=o*c+n*s-a*u+i*l,m=o*l-n*u-a*s-i*c;return r.x=f,r.y=y,r.z=d,r.w=m,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 v=new s;s.lerp=function(e,t,r,n){return v=s.multiplyByScalar(t,r,v),n=s.multiplyByScalar(e,1-r,n),s.add(v,n,n)};var g=new s,w=new s,x=new s;s.slerp=function(e,t,r,n){var a=s.dot(e,t),i=t;if(0>a&&(a=-a,i=g=s.negate(t,g)),1-a<o.EPSILON6)return s.lerp(e,i,r,n);var u=Math.acos(a);return w=s.multiplyByScalar(e,Math.sin((1-r)*u),w),x=s.multiplyByScalar(i,Math.sin(r*u),x),n=s.add(w,x,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 E=new e,S=new e,M=new s,b=new s;s.computeInnerQuadrangle=function(t,r,n,a){var i=s.conjugate(r,M);s.multiply(i,n,b);var o=s.log(b,E);s.multiply(i,t,b);var u=s.log(b,S);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,M),s.multiply(r,M,a)},s.squad=function(e,t,r,n,a,i){var o=s.slerp(e,t,a,M),u=s.slerp(r,n,a,b);return s.slerp(o,u,2*a*(1-a),i)};for(var T=new s,A=1.9011074535173003,z=a.supportsTypedArrays()?new Float32Array(8):[],O=a.supportsTypedArrays()?new Float32Array(8):[],N=a.supportsTypedArrays()?new Float32Array(8):[],I=a.supportsTypedArrays()?new Float32Array(8):[],R=0;7>R;++R){var P=R+1,_=2*P+1;z[R]=1/(P*_),O[R]=P/_}return z[7]=A/136,O[7]=8*A/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)N[f]=(z[f]*c-O[f])*o,I[f]=(z[f]*l-O[f])*o;var y=a*r*(1+N[0]*(1+N[1]*(1+N[2]*(1+N[3]*(1+N[4]*(1+N[5]*(1+N[6]*(1+N[7])))))))),d=u*(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=s.multiplyByScalar(e,d,T);return s.multiplyByScalar(t,y,n),s.add(m,n,n)},s.fastSquad=function(e,t,r,n,a,i){var o=s.fastSlerp(e,t,a,M),u=s.fastSlerp(r,n,a,b);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,y,d,m,h,p){var v=t+a;e.multiplyByScalar(l,Math.cos(v),o),e.multiplyByScalar(i,Math.sin(v),u),e.add(o,u,o);var g=Math.cos(t);g*=g;var w=Math.sin(t);w*=w;var x=y/Math.sqrt(d*g+f*w),E=x/m;return n.fromAxisAngle(o,E,s),r.fromQuaternion(s,c),r.multiplyByVector(c,h,p),e.normalize(p,p),e.multiplyByScalar(p,m,p),p}var i={},o=new e,u=new e,s=new n,c=new r,l=new e,f=new e,y=new e,d=new e;i.raisePositionsToHeight=function(t,r,n){for(var a=r.ellipsoid,i=r.height,o=r.extrudedHeight,u=n?2*(t.length/3):t.length/3,s=new Float64Array(3*u),c=d,m=t.length,h=n?m:0,p=0;m>p;p+=3){var v,g=p+1,w=p+2,x=e.fromArray(t,p,l); -x=a.scaleToGeodeticSurface(x,x),v=e.clone(x,f),c=a.geodeticSurfaceNormal(x,c);var E=e.multiplyByScalar(c,i,y);x=e.add(x,E,x),n&&(E=e.multiplyByScalar(c,o,E),v=e.add(v,E,v),s[p+h]=v.x,s[g+h]=v.y,s[w+h]=v.z),s[p]=x.x,s[g]=x.y,s[w]=x.z}return s};var m=new e,h=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,d=r.granularity,v=2.31,g=o*o,w=u*u,x=u*o,E=e.magnitude(c),S=e.normalize(c,m),M=e.cross(e.UNIT_Z,c,h);M=e.normalize(M,M);var b,T,A,z,O,N=e.cross(S,M,p),I=1+Math.ceil(t.PI_OVER_TWO/d),R=v/(I-1),P=2*I*(I+1),_=n?new Array(3*P):void 0,L=0,C=l,D=f,q=i?[]:void 0,B=i?[]:void 0,U=t.PI_OVER_TWO;for(b=0;I>b&&U>0;++b){if(C=a(U,s,N,M,g,x,w,E,S,C),D=a(Math.PI-U,s,N,M,g,x,w,E,S,D),n){for(_[L++]=C.x,_[L++]=C.y,_[L++]=C.z,A=2*b+2,T=1;A-1>T;++T)z=T/(A-1),O=e.lerp(C,D,z,y),_[L++]=O.x,_[L++]=O.y,_[L++]=O.z;_[L++]=D.x,_[L++]=D.y,_[L++]=D.z}i&&(B.unshift(C.x,C.y,C.z),0!==b&&q.push(D.x,D.y,D.z)),U=t.PI_OVER_TWO-(b+1)*R}for(I=b,b=I;b>0;--b){if(U=t.PI_OVER_TWO-(b-1)*R,C=a(-U,s,N,M,g,x,w,E,S,C),D=a(U+Math.PI,s,N,M,g,x,w,E,S,D),n){for(_[L++]=C.x,_[L++]=C.y,_[L++]=C.z,A=2*(b-1)+2,T=1;A-1>T;++T)z=T/(A-1),O=e.lerp(C,D,z,y),_[L++]=O.x,_[L++]=O.y,_[L++]=O.z;_[L++]=D.x,_[L++]=D.y,_[L++]=D.z}i&&(B.unshift(C.x,C.y,C.z),1!==b&&q.push(D.x,D.y,D.z))}var F={};return n&&(_.length!==L&&(P=L/3,_.length=L),F.positions=_,F.numPts=I),i&&(F.outerPositions=B.concat(q)),F},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"],function(e){"use strict";var t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===t.POINTS||e===t.LINES||e===t.LINE_LOOP||e===t.LINE_STRIP||e===t.TRIANGLES||e===t.TRIANGLE_STRIP||e===t.TRIANGLE_FAN}};return e(t)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,a){"use strict";var i=function(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)};return i.computeNumberOfVertices=function(e){var n=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(n!==o&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=o}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(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";var a=function(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,{})};return a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,a){"use strict";var i={};i.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=t.x,n=t.y;t.x=(1-Math.abs(n))*a.signNotZero(r),t.y=(1-Math.abs(r))*a.signNotZero(n)}return t.x=a.toSNorm(t.x),t.y=a.toSNorm(t.y),t},i.octDecode=function(e,r,n){if(n.x=a.fromSNorm(e),n.y=a.fromSNorm(r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var i=n.x;n.x=(1-Math.abs(n.y))*a.signNotZero(i),n.y=(1-Math.abs(i))*a.signNotZero(n.y)}return t.normalize(n,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 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=1===e.x?4095:0|4096*e.x,r=1===e.y?4095:0|4096*e.y;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096;return t.x=Math.floor(r)/4096,t.y=r-Math.floor(r),t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=new t,a=new t,i=new t,o=function(o,u,s,c,l){r(l)||(l=new t);var f,y,d,m,h,p,v,g;r(u.z)?(f=t.subtract(s,u,n),y=t.subtract(c,u,a),d=t.subtract(o,u,i),m=t.dot(f,f),h=t.dot(f,y),p=t.dot(f,d),v=t.dot(y,y),g=t.dot(y,d)):(f=e.subtract(s,u,n),y=e.subtract(c,u,a),d=e.subtract(o,u,i),m=e.dot(f,f),h=e.dot(f,y),p=e.dot(f,d),v=e.dot(y,y),g=e.dot(y,d));var w=1/(m*v-h*h);return l.y=(v*p-h*g)*w,l.z=(m*g-h*p)*w,l.x=1-l.y-l.z,l};return o}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)};r.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var n={high:0,low:0};r.fromCartesian=function(e,a){t(a)||(a=new r);var i=a.high,o=a.low;return r.encode(e.x,n),i.x=n.high,o.x=n.low,r.encode(e.y,n),i.y=n.high,o.y=n.low,r.encode(e.z,n),i.z=n.high,o.z=n.low,a};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"],function(e,t,r,n){"use strict";var a={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,a){return e>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(a)}),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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,0>i?[i,0]:[0,i];var c=n*n,l=4*e*a,f=r(c,-l,t.EPSILON14);if(0>f)return[];var y=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[y/e,a/y]:[a/y,y/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,y=u*u,d=s*s,m=o*s-y,h=o*c-u*s,p=u*c-d,v=4*m*p-h*h;if(0>v){var g,w,x;y*f>=l*d?(g=o,w=m,x=-2*u*m+o*h):(g=c,w=p,x=-c*h+2*s*p);var E=0>x?-1:1,S=-E*Math.abs(g)*Math.sqrt(-v);i=-x+S;var M=i/2,b=0>M?-Math.pow(-M,1/3):Math.pow(M,1/3),T=i===S?-b:-w/b;return a=0>=w?b+T:-x/(b*b+T*T+w),y*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var A=m,z=-2*u*m+o*h,O=p,N=-c*h+2*s*p,I=Math.sqrt(v),R=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*I,-z)/3);a=2*Math.sqrt(-A);var _=Math.cos(P);i=a*_;var L=a*(-_/2-R*Math.sin(P)),C=i+L>2*u?i-u:L-u,D=o,q=C/D;P=Math.abs(Math.atan2(c*I,-N)/3),a=2*Math.sqrt(-O),_=Math.cos(P),i=a*_,L=a*(-_/2-R*Math.sin(P));var B=-c,U=2*s>i+L?i+s:L+s,F=B/U,G=D*U,W=-C*U-D*B,V=C*B,Y=(s*W-u*V)/(-u*W+s*G);return Y>=q?F>=q?F>=Y?[q,Y,F]:[q,F,Y]:[F,q,Y]:F>=q?[Y,q,F]:F>=Y?[Y,F,q]:[F,Y,q]}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=0>u?-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,0>u?[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 y=-t/4,d=f[f.length-1];if(Math.abs(d)<r.EPSILON14){var m=n.computeRealRoots(1,s,l);if(2===m.length){var h,p=m[0],v=m[1];if(p>=0&&v>=0){var g=Math.sqrt(p),w=Math.sqrt(v);return[y-w,y-g,y+g,y+w]}if(p>=0&&0>v)return h=Math.sqrt(p),[y-h,y+h];if(0>p&&v>=0)return h=Math.sqrt(v),[y-h,y+h]}return[]}if(d>0){var x=Math.sqrt(d),E=(s+d-c/x)/2,S=(s+d+c/x)/2,M=n.computeRealRoots(1,x,E),b=n.computeRealRoots(1,-x,S);return 0!==M.length?(M[0]+=y,M[1]+=y,0!==b.length?(b[0]+=y,b[1]+=y,M[1]<=b[0]?[M[0],M[1],b[0],b[1]]:b[1]<=M[0]?[b[0],b[1],M[0],M[1]]:M[0]>=b[0]&&M[1]<=b[1]?[b[0],M[0],M[1],b[1]]:b[0]>=M[0]&&b[1]<=M[1]?[M[0],b[0],b[1],M[1]]:M[0]>b[0]&&M[0]<b[1]?[b[0],M[0],b[1],M[1]]:[M[0],b[0],M[1],b[1]]):M):0!==b.length?(b[0]+=y,b[1]+=y,b):[]}}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,y=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,y);if(d.length>0){var m,h,p=d[0],v=a-p,g=v*v,w=t/2,x=v/2,E=g-4*o,S=g+4*Math.abs(o),M=c-4*p,b=c+4*Math.abs(p);if(0>p||M*S>E*b){var T=Math.sqrt(M);m=T/2,h=0===T?0:(t*x-i)/T}else{var A=Math.sqrt(E);m=0===A?0:(t*x-i)/A,h=A/2}var z,O;0===w&&0===m?(z=0,O=0):r.sign(w)===r.sign(m)?(z=w+m,O=p/z):(O=w-m,z=p/O);var N,I;0===x&&0===h?(N=0,I=0):r.sign(x)===r.sign(h)?(N=x+h,I=o/N):(I=x-h,N=o/I);var R=n.computeRealRoots(1,z,N),P=n.computeRealRoots(1,O,I);if(0!==R.length)return 0!==P.length?R[1]<=P[0]?[R[0],R[1],P[0],P[1]]:P[1]<=R[0]?[P[0],P[1],R[0],R[1]]:R[0]>=P[0]&&R[1]<=P[1]?[P[0],R[0],R[1],P[1]]:P[0]>=R[0]&&P[1]<=R[1]?[R[0],P[0],P[1],R[1]]:R[0]>P[0]&&R[0]<P[1]?[P[0],R[0],P[1],R[1]]:[R[0],P[0],R[1],P[1]]:R;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,y=f*n,d=a*a,m=d*a,h=u*c*f-4*s*y-4*e*l*f+18*e*t*r*y-27*i*f*f+256*o*m+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)+d*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return h},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,y=s/t,d=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>f?d+1:d,d+=0>y?d+1:d){case 0:return a(c,l,f,y);case 1:return i(c,l,f,y);case 2:return i(c,l,f,y);case 3:return a(c,l,f,y);case 4:return a(c,l,f,y);case 5:return i(c,l,f,y);case 6:return a(c,l,f,y);case 7:return a(c,l,f,y);case 8:return i(c,l,f,y);case 9:return a(c,l,f,y);case 10:return a(c,l,f,y);case 11:return i(c,l,f,y);case 12:return a(c,l,f,y);case 13:return a(c,l,f,y);case 14:return a(c,l,f,y);case 15:return a(c,l,f,y);default:return void 0}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=function(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n};return n.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},n}),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(t,n,a,o,u){u=r(u,!1);var s,c,l,f,y,d=t.origin,m=t.direction,h=e.subtract(a,n,p),E=e.subtract(o,n,v),S=e.cross(m,E,g),M=e.dot(h,S);if(u){if(M<i.EPSILON6)return void 0;if(s=e.subtract(d,n,w),l=e.dot(s,S),0>l||l>M)return void 0;if(c=e.cross(s,h,x),f=e.dot(m,c),0>f||l+f>M)return void 0;y=e.dot(E,c)/M}else{if(Math.abs(M)<i.EPSILON6)return void 0;var b=1/M;if(s=e.subtract(d,n,w),l=e.dot(s,S)*b,0>l||l>1)return void 0;if(c=e.cross(s,h,x),f=e.dot(m,c)*b,0>f||l+f>1)return void 0;y=e.dot(E,c)*b}return y}function f(e,t,r,n){var a=t*t-4*e*r;if(0>a)return void 0;if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);return 0===c?void 0:(n.root0=n.root1=c,n)}function y(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,g),l=e.dot(o,o),y=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,m=f(l,y,d,S);return n(m)?(a.start=m.root0,a.stop=m.root1,a):void 0}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 m(t,r,n,a,c){var l,f=a*a,y=c*c,m=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*y,h=c*(a*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+r.y),p=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*y+a*r.x+n,v=y*d(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),g=c*(a*d(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+r.z),w=[];if(0===g&&0===v){if(l=u.computeRealRoots(m,h,p),0===l.length)return w;var x=l[0],E=Math.sqrt(Math.max(1-x*x,0));if(w.push(new e(a,c*x,c*-E)),w.push(new e(a,c*x,c*E)),2===l.length){var S=l[1],M=Math.sqrt(Math.max(1-S*S,0));w.push(new e(a,c*S,c*-M)),w.push(new e(a,c*S,c*M))}return w}var b=g*g,T=v*v,A=m*m,z=g*v,O=A+T,N=2*(h*m+z),I=2*p*m+h*h-T+b,R=2*(p*h-z),P=p*p-b;if(0===O&&0===N&&0===I&&0===R)return w;l=s.computeRealRoots(O,N,I,R,P);var _=l.length;if(0===_)return w;for(var L=0;_>L;++L){var C,D=l[L],q=D*D,B=Math.max(1-q,0),U=Math.sqrt(B);C=i.sign(m)===i.sign(p)?d(m*q+p,h*D,i.EPSILON12):i.sign(p)===i.sign(h*D)?d(m*q,h*D+p,i.EPSILON12):d(m*q+h*D,p,i.EPSILON12);var F=d(v*D,g,i.EPSILON15),G=C*F;0>G?w.push(new e(a,c*D,c*U)):G>0?w.push(new e(a,c*D,c*-U)):0!==U?(w.push(new e(a,c*D,c*-U)),w.push(new e(a,c*D,c*U)),++L):w.push(new e(a,c*D,c*U))}return w}var h={};h.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)return void 0;var l=(-r.distance-e.dot(s,o))/c;return 0>l?void 0:(a=e.multiplyByScalar(u,l,a),e.add(o,a,a))};var p=new e,v=new e,g=new e,w=new e,x=new e;h.rayTriangle=function(t,r,a,i,o,u){var s=l(t,r,a,i,o);return!n(s)||0>s?void 0:(n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u))};var E=new c;h.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=E;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var f=l(c,a,i,o,u);return!n(f)||0>f||f>e.distance(t,r)?void 0:(n(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var S={root0:0,root1:0};h.raySphere=function(e,t,r){return r=y(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var M=new c;h.lineSegmentSphere=function(t,r,a,i){var o=M;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=y(o,a,i),!n(i)||i.stop<0||i.start>s?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i)};var b=new e,T=new e;h.rayEllipsoid=function(t,r){var n,a,i,o,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,b),l=e.multiplyComponents(s,t.direction,T),f=e.magnitudeSquared(c),y=e.dot(c,l);if(f>1){if(y>=0)return void 0;var d=y*y;if(n=f-1,a=e.magnitudeSquared(l),i=a*n,i>d)return void 0;if(d>i){o=y*y-i,u=-y+Math.sqrt(o);var m=u/a,h=n/u;return h>m?{start:m,stop:h}:{start:h,stop:m}}var p=Math.sqrt(n/a);return{start:p,stop:p}}return 1>f?(n=f-1,a=e.magnitudeSquared(l),i=a*n,o=y*y-i,u=-y+Math.sqrt(o),{start:0,stop:u/a}):0>y?(a=e.magnitudeSquared(l),{start:0,stop:-y/a}):void 0};var A=new e,z=new e,O=new e,N=new e,I=new e,R=new o,P=new o,_=new o,L=new o,C=new o,D=new o,q=new o,B=new e,U=new e,F=new t;h.grazingAltitudeLocation=function(t,r){var a=t.origin,u=t.direction,s=r.geodeticSurfaceNormal(a);if(e.dot(u,s)>=0)return a;var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u),f=e.normalize(l,A),y=e.mostOrthogonalAxis(l,N),d=e.normalize(e.cross(y,f,z),z),h=e.normalize(e.cross(f,d,O),O),p=R;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]=h.x,p[7]=h.y,p[8]=h.z;var v=o.transpose(p,P),g=o.fromScale(r.radii,_),w=o.fromScale(r.oneOverRadii,L),x=C;x[0]=0,x[1]=-u.z,x[2]=u.y,x[3]=u.z,x[4]=0,x[5]=-u.x,x[6]=-u.y,x[7]=u.x,x[8]=0;var E,S,M=o.multiply(o.multiply(v,w,D),x,D),b=o.multiply(o.multiply(M,g,q),p,q),T=o.multiplyByVector(M,a,I),G=m(b,e.negate(T,A),0,0,1),W=G.length;if(W>0){for(var V=e.clone(e.ZERO,U),Y=Number.NEGATIVE_INFINITY,k=0;W>k;++k){E=o.multiplyByVector(g,o.multiplyByVector(p,G[k],B),B);var j=e.normalize(e.subtract(E,a,N),N),H=e.dot(j,u);H>Y&&(Y=H,V=e.clone(E,V))}var Z=r.cartesianToCartographic(V,F);return Y=i.clamp(Y,0,1),S=e.magnitude(e.subtract(V,a,N))*Math.sqrt(1-Y*Y),S=c?-S:S,Z.height=S,r.cartographicToCartesian(Z)}return void 0};var G=new e;return h.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)return void 0;var l=e.dot(s,t),f=-(a.distance+l)/c;return 0>f||f>1?void 0:(e.multiplyByScalar(u,f,o),e.add(t,o,o),o)},h.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,y;if((1===l||2===l)&&(f=new e,y=new e),1===l){if(u)return h.lineSegmentPlane(t,r,a,f),h.lineSegmentPlane(t,n,a,y),{positions:[t,r,n,f,y],indices:[0,3,4,1,2,4,1,4,3]};if(s)return h.lineSegmentPlane(r,n,a,f),h.lineSegmentPlane(r,t,a,y),{positions:[t,r,n,f,y],indices:[1,3,4,2,0,4,2,4,3]};if(c)return h.lineSegmentPlane(n,t,a,f),h.lineSegmentPlane(n,r,a,y),{positions:[t,r,n,f,y],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return h.lineSegmentPlane(r,t,a,f),h.lineSegmentPlane(n,t,a,y),{positions:[t,r,n,f,y],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return h.lineSegmentPlane(n,r,a,f),h.lineSegmentPlane(t,r,a,y),{positions:[t,r,n,f,y],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return h.lineSegmentPlane(t,n,a,f),h.lineSegmentPlane(r,n,a,y),{positions:[t,r,n,f,y],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},h}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(t,r){this.normal=e.clone(t),this.distance=r};return r.fromPointNormal=function(n,a,i){var o=-e.dot(a,n);return t(i)?(e.clone(a,i.normal),i.distance=o,i):new r(a,o)},r.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},r}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};return r.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];o>u;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;a+1>l;l++)c[l]=0;for(var f=i+1,y=0;o>y;++y)f-c[n[y]]>i&&(c[n[y]]=f,++f);return(f-i+1)/(o/3)},r.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(;n>i;){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 y=r[f];a[y].numLiveTriangles&&(s=0,i-a[y].timeStamp+2*a[y].numLiveTriangles<=t&&(s=i-a[y].timeStamp),(s>l||-1===l)&&(l=s,c=y)),++f}return-1===c?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,y=o[f],d=c;if(t(u))l=u+1;else{for(;d>f;)y>l&&(l=y),++f,y=o[f];if(-1===l)return 0;++l}for(var m=[],h=0;l>h;h++)m[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var p=0;d>f;)m[o[f]].vertexTriangles.push(p),++m[o[f]].numLiveTriangles,m[o[f+1]].vertexTriangles.push(p),++m[o[f+1]].numLiveTriangles,m[o[f+2]].vertexTriangles.push(p),++m[o[f+2]].numLiveTriangles,++p,f+=3;var v=0,g=s+1;i=1;var w,x,E=[],S=[],M=0,b=[],T=c/3,A=[];for(h=0;T>h;h++)A[h]=!1;for(var z,O;-1!==v;){E=[],x=m[v],O=x.vertexTriangles.length;for(var N=0;O>N;++N)if(p=x.vertexTriangles[N],!A[p]){A[p]=!0,f=p+p+p;for(var I=0;3>I;++I)z=o[f],E.push(z),S.push(z),b[M]=z,++M,w=m[z],--w.numLiveTriangles,g-w.timeStamp>s&&(w.timeStamp=g,++g),++f}v=a(o,s,E,m,g,S,l)}return b},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,r,n,a,i,o,u,s,c,l,f,y,d,m,h,p,v,g,w,x,E,S,M,b){"use strict";function T(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function A(e){for(var t=e.length,r=6*(t/3),n=p.createTypedArray(t,r),a=0,i=0;t>i;i+=3,a+=6)T(n,a,e[i],e[i+1],e[i+2]);return n}function z(e){var t=e.length;if(t>=3){var r=6*(t-2),n=p.createTypedArray(t,r);T(n,0,e[0],e[1],e[2]);for(var a=6,i=3;t>i;++i,a+=6)T(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function O(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;t>o;++o,i+=6)T(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function N(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 I(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 R(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;n>i;i+=3)a.unpack(r,i,J),E.multiplyByPoint(e,J,J),a.pack(J,r,i)}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;n>i;i+=3)a.unpack(r,i,J),x.multiplyByVector(e,J,J),J=a.normalize(J,J),a.pack(J,r,i)}function _(e){var t,r=e.length,n={},a=e[0].geometry.attributes;for(t in a)if(a.hasOwnProperty(t)&&c(a[t])&&c(a[t].values)){for(var i=a[t],o=i.values.length,s=!0,l=1;r>l;++l){var f=e[l].geometry.attributes[t];if(!c(f)||i.componentDatatype!==f.componentDatatype||i.componentsPerAttribute!==f.componentsPerAttribute||i.normalize!==f.normalize){s=!1;break}o+=f.values.length}s&&(n[t]=new m({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:u.createTypedArray(i.componentDatatype,o)}))}return n}function L(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function C(e){var t=d.computeNumberOfVertices(e),r=p.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;t>a;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=M.TRIANGLES,e}function D(e){var t=d.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;t-1>a;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,t>a+2&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=M.TRIANGLES,e}function q(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function B(e){var t=d.computeNumberOfVertices(e),r=p.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;t>a;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=M.LINES,e}function U(e){var t=d.computeNumberOfVertices(e),r=p.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;t>a;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=M.LINES,e}function F(e){switch(e.primitiveType){case M.TRIANGLE_FAN:return C(e);case M.TRIANGLE_STRIP:return D(e);case M.TRIANGLES:return L(e);case M.LINE_STRIP:return B(e);case M.LINE_LOOP:return U(e);case M.LINES:return q(e)}return e}function G(e,t){Math.abs(e.y)<w.EPSILON11&&(e.y=t?-w.EPSILON11:w.EPSILON11)}function W(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,dt),e.y/(e.y-t.y),dt),r),a.clone(r,n),G(r,!0),G(n,!1)}function V(e,t,r){if(e.x>=0||t.x>=0||r.x>=0)return void 0;var n=e.y<0,a=t.y<0,i=r.y<0;G(e,n),G(t,a),G(r,i);var o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=gt.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(W(e,t,mt,pt),W(e,r,ht,vt),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(W(t,r,mt,pt),W(t,e,ht,vt),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(W(r,e,mt,pt),W(r,t,ht,vt),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,mt,pt),W(r,t,ht,vt),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(W(t,r,mt,pt),W(t,e,ht,vt),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(W(e,t,mt,pt),W(e,r,ht,vt),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=gt.positions;return s[0]=e,s[1]=t,s[2]=r,gt.length=3,(1===o||2===o)&&(s[3]=mt,s[4]=ht,s[5]=pt,s[6]=vt,gt.length=7),gt}function Y(e,r,i,o,u,s,l,f){if(c(u)||c(s)||c(l)||c(f)){var y,d,m,h,p,v,g,w,x,E,S,M,b=o.positions,T=b[0],A=b[1],z=b[2],O=wt,N=xt,I=Et,R=St,P=Mt,_=bt;c(u)&&(y=a.fromArray(u,3*e),d=a.fromArray(u,3*r),m=a.fromArray(u,3*i)),c(s)&&(h=a.fromArray(s,3*e),p=a.fromArray(s,3*r),v=a.fromArray(s,3*i)),c(l)&&(g=a.fromArray(l,3*e),w=a.fromArray(l,3*r),x=a.fromArray(l,3*i)),c(f)&&(E=n.fromArray(f,2*e),S=n.fromArray(f,2*r),M=n.fromArray(f,2*i));for(var L=3;L<b.length;++L){var C=b[L],D=t(C,T,A,z);if(c(u)){O=a.multiplyByScalar(y,D.x,O),N=a.multiplyByScalar(d,D.y,N),I=a.multiplyByScalar(m,D.z,I);var q=a.add(O,N,Tt);a.add(q,I,q),a.normalize(q,q),u.push(q.x,q.y,q.z)}if(c(s)){O=a.multiplyByScalar(h,D.x,O),N=a.multiplyByScalar(p,D.y,N),I=a.multiplyByScalar(v,D.z,I);var B=a.add(O,N,Tt);a.add(B,I,B),a.normalize(B,B),s.push(B.x,B.y,B.z)}if(c(l)){O=a.multiplyByScalar(g,D.x,O),N=a.multiplyByScalar(w,D.y,N),I=a.multiplyByScalar(x,D.z,I);var U=a.add(O,N,Tt);a.add(U,I,U),a.normalize(U,U),l.push(U.x,U.y,U.z)}if(c(f)){R=n.multiplyByScalar(E,D.x,R),P=n.multiplyByScalar(S,D.y,P),_=n.multiplyByScalar(M,D.z,_);var F=n.add(R,P,R);n.add(F,_,F),f.push(F.x,F.y)}}}}function k(e){for(var t=e.attributes,r=t.position.values,n=c(t.normal)?t.normal.values:void 0,i=c(t.binormal)?t.binormal.values:void 0,o=c(t.tangent)?t.tangent.values:void 0,s=c(t.st)?t.st.values:void 0,l=e.indices,f=Array.prototype.slice.call(r,0),y=c(n)?Array.prototype.slice.call(n,0):void 0,m=c(i)?Array.prototype.slice.call(i,0):void 0,h=c(o)?Array.prototype.slice.call(o,0):void 0,v=c(s)?Array.prototype.slice.call(s,0):void 0,g=[],w=l.length,x=0;w>x;x+=3){var E=l[x],S=l[x+1],M=l[x+2],b=a.fromArray(r,3*E),T=a.fromArray(r,3*S),A=a.fromArray(r,3*M),z=V(b,T,A);if(c(z))if(f[3*E+1]=z.positions[0].y,f[3*S+1]=z.positions[1].y,f[3*M+1]=z.positions[2].y,z.length>3){for(var O=f.length/3,N=0;N<z.indices.length;++N){var I=z.indices[N];3>I?g.push(l[x+I]):g.push(I-3+O)}for(var R=3;R<z.positions.length;++R){var P=z.positions[R];f.push(P.x,P.y,P.z)}Y(E,S,M,z,y,m,h,v)}else g.push(E,S,M);else g.push(E,S,M)}e.attributes.position.values=new Float64Array(f),c(y)&&(t.normal.values=u.createTypedArray(t.normal.componentDatatype,y)),c(m)&&(t.binormal.values=u.createTypedArray(t.binormal.componentDatatype,m)),c(h)&&(t.tangent.values=u.createTypedArray(t.tangent.componentDatatype,h)),c(v)&&(t.st.values=u.createTypedArray(t.st.componentDatatype,v));var _=d.computeNumberOfVertices(e);e.indices=p.createTypedArray(_,g)}function j(e){for(var t=e.attributes,r=t.position.values,n=e.indices,i=Array.prototype.slice.call(r,0),o=[],u=n.length,s=0;u>s;s+=2){var l=n[s],f=n[s+1],y=a.fromArray(r,3*l),m=a.fromArray(r,3*f);if(Math.abs(y.y)<w.EPSILON6&&(y.y=y.y<0?-w.EPSILON6:w.EPSILON6,i[3*l+1]=y.y),Math.abs(m.y)<w.EPSILON6&&(m.y=m.y<0?-w.EPSILON6:w.EPSILON6,i[3*f+1]=m.y),o.push(l),y.x<0||m.x<0){var h=g.lineSegmentPlane(y,m,At);if(c(h)){var v=a.multiplyByScalar(a.UNIT_Y,5*w.EPSILON9,zt);y.y<0&&a.negate(v,v);var x=i.length/3;o.push(x,x+1);var E=a.add(h,v,Ot);i.push(E.x,E.y,E.z),a.negate(v,v),a.add(h,v,E),i.push(E.x,E.y,E.z)}}o.push(f)}e.attributes.position.values=new Float64Array(i);var S=d.computeNumberOfVertices(e);e.indices=p.createTypedArray(S,o)}function H(e){var t=e.attributes,r=t.position.values,o=c(t.st)?t.st.values:void 0,s=c(t.prevPosition)?t.prevPosition.values:void 0,l=c(t.nextPosition)?t.nextPosition.values:void 0,f=c(t.expandAndWidth)?t.expandAndWidth.values:void 0,y=c(t.color)?t.color.values:void 0;e.indices;for(var m=Array.prototype.slice.call(r,0),h=c(o)?Array.prototype.slice.call(o,0):void 0,v=c(s)?Array.prototype.slice.call(s,0):void 0,x=c(l)?Array.prototype.slice.call(l,0):void 0,E=c(f)?Array.prototype.slice.call(f,0):void 0,S=c(y)?Array.prototype.slice.call(y,0):void 0,M=[],b=m.length/3,T=0;b>T;T+=4){var A=T,z=T+1,O=T+2,N=a.fromArray(m,3*A,Rt),I=a.fromArray(m,3*z,Pt),R=a.fromArray(m,3*O,_t),P=a.equals(N,I);Math.abs(N.y)<w.EPSILON6&&(N.y=R.y<0?-w.EPSILON6:w.EPSILON6,m[3*A+1]=N.y),Math.abs(R.y)<w.EPSILON6&&(R.y=N.y<0?-w.EPSILON6:w.EPSILON6,m[3*O+1]=R.y),m[3*z+1]=I.y=P?N.y:R.y;var _=!1;if(N.x<0||R.x<0){var L=g.lineSegmentPlane(N,R,At,Pt);if(c(L)){var C=a.multiplyByScalar(a.UNIT_Y,5*w.EPSILON9,Lt);N.y<0&&a.negate(C,C);var D=a.add(L,C,Ct);m.push(D.x,D.y,D.z),m.push(D.x,D.y,D.z),a.negate(C,C),a.add(L,C,D),m.push(D.x,D.y,D.z),m.push(D.x,D.y,D.z),v.push(N.x,N.y,N.z,N.x,N.y,N.z),v.push(N.x,N.y,N.z,N.x,N.y,N.z),x.push(R.x,R.y,R.z,R.x,R.y,R.z),x.push(R.x,R.y,R.z,R.x,R.y,R.z);var q=n.fromArray(E,2*A),B=Math.abs(q.y);E.push(-1,-B,1,-B),E.push(-1,B,1,B);var U=a.magnitudeSquared(a.subtract(L,N,Lt));if(U/=a.magnitudeSquared(a.subtract(R,N,Lt)),c(S)){var F=i.fromArray(S,4*A,Dt),G=i.fromArray(S,4*O,Dt),W=w.lerp(F.x,G.x,U),V=w.lerp(F.y,G.y,U),Y=w.lerp(F.z,G.z,U),k=w.lerp(F.w,G.w,U);S.push(W,V,Y,k),S.push(W,V,Y,k),S.push(W,V,Y,k),S.push(W,V,Y,k)}if(c(h)){var j=n.fromArray(h,2*A,Nt),H=n.fromArray(h,2*(T+3),It),Z=w.lerp(j.x,H.x,U);h.push(Z,j.y),h.push(Z,H.y),h.push(Z,j.y),h.push(Z,H.y)}_=!0}}if(_){var X=m.length/3-4;M.push(T,X,T+1),M.push(T+1,X,X+1),M.push(X+2,T+2,X+3),M.push(X+3,T+2,T+3)}else M.push(T,T+2,T+1),M.push(T+1,T+2,T+3)}t.position.values=new Float64Array(m),t.prevPosition.values=u.createTypedArray(t.prevPosition.componentDatatype,v),t.nextPosition.values=u.createTypedArray(t.nextPosition.componentDatatype,x),t.expandAndWidth.values=u.createTypedArray(t.expandAndWidth.componentDatatype,E),c(h)&&(t.st.values=u.createTypedArray(t.st.componentDatatype,h)),c(S)&&(t.color.values=u.createTypedArray(t.color.componentDatatype,S));var Q=d.computeNumberOfVertices(e);e.indices=p.createTypedArray(Q,M)}var Z={};Z.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case M.TRIANGLES:e.indices=A(t);break;case M.TRIANGLE_STRIP:e.indices=z(t);break;case M.TRIANGLE_FAN:e.indices=O(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=M.LINES}return e},Z.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,y=0;o>y;y+=3)l[f++]=a[y],l[f++]=a[y+1],l[f++]=a[y+2],l[f++]=a[y]+i[y]*n,l[f++]=a[y+1]+i[y+1]*n,l[f++]=a[y+2]+i[y+2]*n;var h,p=e.boundingSphere;return c(p)&&(h=new r(p.center,p.radius+n)),new d({attributes:{position:new m({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:M.LINES,boundingSphere:h}) -},Z.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;o>t;++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},Z.reorderForPreVertexCache=function(e){var t=d.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;t>a;a++)n[a]=-1;for(var i,o=r,s=o.length,l=p.createTypedArray(t,s),f=0,y=0,m=0;s>f;)i=n[o[f]],-1!==i?l[y]=i:(i=o[f],n[i]=m,l[y]=m,++m),++f,++y;e.indices=l;var h=e.attributes;for(var v in h)if(h.hasOwnProperty(v)&&c(h[v])&&c(h[v].values)){for(var g=h[v],w=g.values,x=0,E=g.componentsPerAttribute,S=u.createTypedArray(g.componentDatatype,m*E);t>x;){var M=n[x];if(-1!==M)for(a=0;E>a;a++)S[E*M+a]=w[E*x+a];++x}g.values=S}}return e},Z.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===M.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;n>i;i++)r[i]>a&&(a=r[i]);e.indices=b.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},Z.fitToUnsignedShortIndices=function(e){var t=[],r=d.computeNumberOfVertices(e);if(c(e.indices)&&r>w.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=N(e.attributes),s=e.indices,l=s.length;e.primitiveType===M.TRIANGLES?n=3:e.primitiveType===M.LINES?n=2:e.primitiveType===M.POINTS&&(n=1);for(var f=0;l>f;f+=n){for(var y=0;n>y;++y){var m=s[f+y],h=a[m];c(h)||(h=o++,a[m]=h,I(u,e.attributes,m)),i.push(h)}o+n>w.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere})),a=[],i=[],o=0,u=N(e.attributes))}0!==i.length&&t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere}))}else t.push(e);return t};var X=new a,Q=new o;Z.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new y;for(var s=i.ellipsoid,f=o.values,d=new Float64Array(f.length),h=0,p=0;p<f.length;p+=3){var v=a.fromArray(f,p,X),g=s.cartesianToCartographic(v,Q);if(!c(g))throw new l("Could not project point ("+v.x+", "+v.y+", "+v.z+") to 2D.");var w=i.project(g,X);d[h++]=w.x,d[h++]=w.y,d[h++]=w.z}return e.attributes[r]=o,e.attributes[n]=new m({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:d}),delete e.attributes[t],e};var K={high:0,low:0};Z.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;o>l;++l)f.encode(i[l],K),s[l]=K.high,c[l]=K.low;var y=a.componentsPerAttribute;return e.attributes[r]=new m({componentDatatype:u.FLOAT,componentsPerAttribute:y,values:s}),e.attributes[n]=new m({componentDatatype:u.FLOAT,componentsPerAttribute:y,values:c}),delete e.attributes[t],e};var J=new a,$=new E,et=new x;Z.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(E.equals(t,E.IDENTITY))return e;var n=e.geometry.attributes;R(t,n.position),R(t,n.prevPosition),R(t,n.nextPosition),(c(n.normal)||c(n.binormal)||c(n.tangent))&&(E.inverse(t,$),E.transpose($,$),E.getRotation($,et),P(et,n.normal),P(et,n.binormal),P(et,n.tangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=E.clone(E.IDENTITY),e};var tt=new a;Z.combine=function(e){var t,n,i,o,u=e.length;e[0].modelMatrix;var s,l,f,y=c(e[0].geometry.indices),m=e[0].geometry.primitiveType,h=_(e);for(t in h)if(h.hasOwnProperty(t))for(s=h[t].values,o=0,n=0;u>n;++n)for(l=e[n].geometry.attributes[t].values,f=l.length,i=0;f>i;++i)s[o++]=l[i];var v;if(y){var g=0;for(n=0;u>n;++n)g+=e[n].geometry.indices.length;var w=d.computeNumberOfVertices(new d({attributes:h,primitiveType:M.POINTS})),x=p.createTypedArray(w,g),E=0,S=0;for(n=0;u>n;++n){var b=e[n].geometry.indices,T=b.length;for(o=0;T>o;++o)x[E++]=S+b[o];S+=d.computeNumberOfVertices(e[n].geometry)}v=x}var A,z=new a,O=0;for(n=0;u>n;++n){if(A=e[n].geometry.boundingSphere,!c(A)){z=void 0;break}a.add(A.center,z,z)}if(c(z))for(a.divideByScalar(z,u,z),n=0;u>n;++n){A=e[n].geometry.boundingSphere;var N=a.magnitude(a.subtract(A.center,z,tt))+A.radius;N>O&&(O=N)}return new d({attributes:h,indices:v,primitiveType:m,boundingSphere:c(z)?new r(z,O):void 0})};var rt=new a,nt=new a,at=new a,it=new a;Z.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;i>f;f++)s[f]={indexOffset:0,count:0,currentCount:0};var y=0;for(f=0;o>f;f+=3){var d=t[f],h=t[f+1],p=t[f+2],v=3*d,g=3*h,w=3*p;nt.x=n[v],nt.y=n[v+1],nt.z=n[v+2],at.x=n[g],at.y=n[g+1],at.z=n[g+2],it.x=n[w],it.y=n[w+1],it.z=n[w+2],s[d].count++,s[h].count++,s[p].count++,a.subtract(at,nt,at),a.subtract(it,nt,it),c[y]=a.cross(at,it,new a),y++}var x=0;for(f=0;i>f;f++)s[f].indexOffset+=x,x+=s[f].count;y=0;var E;for(f=0;o>f;f+=3){E=s[t[f]];var S=E.indexOffset+E.currentCount;l[S]=y,E.currentCount++,E=s[t[f+1]],S=E.indexOffset+E.currentCount,l[S]=y,E.currentCount++,E=s[t[f+2]],S=E.indexOffset+E.currentCount,l[S]=y,E.currentCount++,y++}var M=new Float32Array(3*i);for(f=0;i>f;f++){var b=3*f;if(E=s[f],E.count>0){for(a.clone(a.ZERO,rt),y=0;y<E.count;y++)a.add(rt,c[l[E.indexOffset+y]],rt);a.normalize(rt,rt),M[b]=rt.x,M[b+1]=rt.y,M[b+2]=rt.z}else M[b]=0,M[b+1]=0,M[b+2]=1}return e.attributes.normal=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:M}),e};var ot=new a,ut=new a,st=new a;Z.computeBinormalAndTangent=function(e){e.attributes;for(var t=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,y,d;for(l=0;s>l;l+=3){var h=t[l],p=t[l+1],v=t[l+2];f=3*h,y=3*p,d=3*v;var g=2*h,w=2*p,x=2*v,E=r[f],S=r[f+1],M=r[f+2],b=i[g],T=i[g+1],A=i[w+1]-T,z=i[x+1]-T,O=1/((i[w]-b)*z-(i[x]-b)*A),N=(z*(r[y]-E)-A*(r[d]-E))*O,I=(z*(r[y+1]-S)-A*(r[d+1]-S))*O,R=(z*(r[y+2]-M)-A*(r[d+2]-M))*O;c[f]+=N,c[f+1]+=I,c[f+2]+=R,c[y]+=N,c[y+1]+=I,c[y+2]+=R,c[d]+=N,c[d+1]+=I,c[d+2]+=R}var P=new Float32Array(3*o),_=new Float32Array(3*o);for(l=0;o>l;l++){f=3*l,y=f+1,d=f+2;var L=a.fromArray(n,f,ot),C=a.fromArray(c,f,st),D=a.dot(L,C);a.multiplyByScalar(L,D,ut),a.normalize(a.subtract(C,ut,C),C),_[f]=C.x,_[y]=C.y,_[d]=C.z,a.normalize(a.cross(L,C,C),C),P[f]=C.x,P[y]=C.y,P[d]=C.z}return e.attributes.tangent=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:_}),e.attributes.binormal=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e};var ct=new n,lt=new a,ft=new a,yt=new a;Z.compressVertices=function(t){var r=t.attributes.normal,i=t.attributes.st;if(!c(r)&&!c(i))return t;var o,s,l,f,y=t.attributes.tangent,d=t.attributes.binormal;c(r)&&(o=r.values),c(i)&&(s=i.values),c(y)&&(l=y.values),d&&(f=d.values);var h=c(o)?o.length:s.length,p=c(o)?3:2,v=h/p,g=v,w=c(s)&&c(o)?2:1;w+=c(l)||c(f)?1:0,g*=w;for(var x=new Float32Array(g),E=0,S=0;v>S;++S){c(s)&&(n.fromArray(s,2*S,ct),x[E++]=e.compressTextureCoordinates(ct));var M=3*S;c(o)&&c(l)&&c(f)?(a.fromArray(o,M,lt),a.fromArray(l,M,ft),a.fromArray(f,M,yt),e.octPack(lt,ft,yt,ct),x[E++]=ct.x,x[E++]=ct.y):(c(o)&&(a.fromArray(o,M,lt),x[E++]=e.octEncodeFloat(lt)),c(l)&&(a.fromArray(l,M,lt),x[E++]=e.octEncodeFloat(lt)),c(f)&&(a.fromArray(f,M,lt),x[E++]=e.octEncodeFloat(lt)))}return t.attributes.compressedAttributes=new m({componentDatatype:u.FLOAT,componentsPerAttribute:w,values:x}),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 dt=new a,mt=new a,ht=new a,pt=new a,vt=new a,gt={positions:new Array(7),indices:new Array(9)},wt=new a,xt=new a,Et=new a,St=new n,Mt=new n,bt=new n,Tt=new a,At=S.fromPointNormal(a.ZERO,a.UNIT_Y),zt=new a,Ot=new a,Nt=new n,It=new n,Rt=new a,Pt=new a,_t=new a,Lt=new a,Ct=new a,Dt=new i;return new i,Z.wrapLongitude=function(e){var t=e.boundingSphere;if(c(t)){var n=t.center.x-t.radius;if(n>0||r.intersect(t,i.UNIT_Y)!==v.INTERSECTING)return e}if(e.geometryType!==h.NONE)switch(e.geometryType){case h.POLYLINES:H(e);break;case h.TRIANGLES:k(e);break;case h.LINES:j(e)}else F(e),e.primitiveType===M.TRIANGLES?k(e):e.primitiveType===M.LINES&&j(e);return e},Z}),define("Core/VertexFormat",["./defaultValue","./freezeObject"],function(e,t){"use strict";var r=function(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 r.POSITION_ONLY=t(new r({position:!0})),r.POSITION_AND_NORMAL=t(new r({position:!0,normal:!0})),r.POSITION_NORMAL_AND_ST=t(new r({position:!0,normal:!0,st:!0})),r.POSITION_AND_ST=t(new r({position:!0,st:!0})),r.POSITION_AND_COLOR=t(new r({position:!0,color:!0})),r.ALL=t(new r({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),r.DEFAULT=r.POSITION_NORMAL_AND_ST,r}),define("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,r,n,a,i,o,u,s,c,l,f,y,d,m,h,p,v,g,w,x,E){"use strict";function S(e,t,n){var i=t.vertexFormat,o=t.center,u=t.semiMajorAxis,c=t.ellipsoid,f=t.stRotation,m=n?2*(e.length/3):e.length/3,h=i.st?new Float32Array(2*m):void 0,p=i.normal?new Float32Array(3*m):void 0,v=i.tangent?new Float32Array(3*m):void 0,w=i.binormal?new Float32Array(3*m):void 0,E=0,S=C,M=D,b=q,T=new l(c),A=T.project(c.cartesianToCartographic(o,B),U),z=c.scaleToGeodeticSurface(o,O);c.geodeticSurfaceNormal(z,z);for(var R=x.fromAxisAngle(z,f,L),F=g.fromQuaternion(R,_),G=e.length,W=n?G:0,V=2*(W/3),Y=0;G>Y;Y+=3){var k=Y+1,j=Y+2,H=r.fromArray(e,Y,O);if(i.st){var Z=g.multiplyByVector(F,H,N),X=T.project(c.cartesianToCartographic(Z,B),I);r.subtract(X,A,X),P.x=(X.x+u)/(2*u),P.y=(X.y+u)/(2*u),n&&(h[E+V]=P.x,h[E+1+V]=P.y),h[E++]=P.x,h[E++]=P.y}S=c.geodeticSurfaceNormal(H,S),(i.normal||i.tangent||i.binormal)&&((i.tangent||i.binormal)&&(M=r.cross(r.UNIT_Z,S,M),g.multiplyByVector(F,M,M)),i.normal&&(p[Y]=S.x,p[k]=S.y,p[j]=S.z,n&&(p[Y+W]=-S.x,p[k+W]=-S.y,p[j+W]=-S.z)),i.tangent&&(v[Y]=M.x,v[k]=M.y,v[j]=M.z,n&&(v[Y+W]=-M.x,v[k+W]=-M.y,v[j+W]=-M.z)),i.binormal&&(b=r.cross(S,M,b),w[Y]=b.x,w[k]=b.y,w[j]=b.z,n&&(w[Y+W]=b.x,w[k+W]=b.y,w[j+W]=b.z)))}var Q=new d;if(i.position){var K=s.raisePositionsToHeight(e,t,n);Q.position=new y({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:K})}return i.st&&(Q.st=new y({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:h})),i.normal&&(Q.normal=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(Q.tangent=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),i.binormal&&(Q.binormal=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:w})),Q}function M(e){var t,r,n,a,i,o=new Array(2*e*(e+1)),u=0;for(a=1;e>a;++a){for(n=a*(a+1),t=(a-1)*a,o[u++]=n++,o[u++]=t,o[u++]=n,r=2*a,i=0;r-1>i;++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;r-1>a;++a)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;for(++t,++n,a=e-1;a>0;--a){for(o[u++]=t++,o[u++]=t,o[u++]=n,r=2*a,i=0;r-1>i;++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++}return o}function b(t){var n=t.center;F=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(n,F),t.height,F),F=r.add(n,F,F);var a=new e(F,t.semiMajorAxis),i=s.computeEllipsePositions(t,!0,!1),o=i.positions,u=i.numPts,c=S(o,t,!1),l=M(u);return l=p.createTypedArray(o.length/3,l),{boundingSphere:a,attributes:c,indices:l}}function T(e,t){var n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,u=t.ellipsoid,s=t.height,c=t.extrudedHeight,f=t.stRotation,m=2*(e.length/3),h=new Float64Array(3*m),p=n.st?new Float32Array(2*m):void 0,v=n.normal?new Float32Array(3*m):void 0,w=n.tangent?new Float32Array(3*m):void 0,E=n.binormal?new Float32Array(3*m):void 0,S=0,M=C,b=D,T=q,A=new l(u),z=A.project(u.cartesianToCartographic(i,B),U),F=u.scaleToGeodeticSurface(i,O);u.geodeticSurfaceNormal(F,F);for(var G=x.fromAxisAngle(F,f,L),W=g.fromQuaternion(G,_),V=e.length,Y=2*(V/3),k=0;V>k;k+=3){var j,H=k+1,Z=k+2,X=r.fromArray(e,k,O);if(n.st){var Q=g.multiplyByVector(W,X,N),K=A.project(u.cartesianToCartographic(Q,B),I);r.subtract(K,z,K),P.x=(K.x+o)/(2*o),P.y=(K.y+o)/(2*o),p[S+Y]=P.x,p[S+1+Y]=P.y,p[S++]=P.x,p[S++]=P.y}X=u.scaleToGeodeticSurface(X,X),j=r.clone(X,N),M=u.geodeticSurfaceNormal(X,M);var J=r.multiplyByScalar(M,s,R);if(X=r.add(X,J,X),J=r.multiplyByScalar(M,c,J),j=r.add(j,J,j),n.position&&(h[k+V]=j.x,h[H+V]=j.y,h[Z+V]=j.z,h[k]=X.x,h[H]=X.y,h[Z]=X.z),n.normal||n.tangent||n.binormal){T=r.clone(M,T);var $=r.fromArray(e,(k+3)%V,R);r.subtract($,X,$);var et=r.subtract(j,X,I);M=r.normalize(r.cross(et,$,M),M),n.normal&&(v[k]=M.x,v[H]=M.y,v[Z]=M.z,v[k+V]=M.x,v[H+V]=M.y,v[Z+V]=M.z),n.tangent&&(b=r.normalize(r.cross(T,M,b),b),w[k]=b.x,w[H]=b.y,w[Z]=b.z,w[k+V]=b.x,w[k+1+V]=b.y,w[k+2+V]=b.z),n.binormal&&(E[k]=T.x,E[H]=T.y,E[Z]=T.z,E[k+V]=T.x,E[H+V]=T.y,E[Z+V]=T.z)}}var tt=new d;return n.position&&(tt.position=new y({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:h})),n.st&&(tt.st=new y({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(tt.normal=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),n.tangent&&(tt.tangent=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:w})),n.binormal&&(tt.binormal=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:E})),tt}function A(e){for(var t,r,n,a,i=e.length/3,o=p.createTypedArray(i,6*i),u=0,s=0;i-1>s;s++)t=s,n=s+i,r=t+1,a=r+i,o[u++]=t,o[u++]=n,o[u++]=r,o[u++]=r,o[u++]=n,o[u++]=a;return t=i-1,n=s+i,r=0,a=r+i,o[u++]=t,o[u++]=n,o[u++]=r,o[u++]=r,o[u++]=n,o[u++]=a,o}function z(t){var n=t.center,a=t.ellipsoid,i=t.semiMajorAxis,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,O),t.height,O);G.center=r.add(n,o,G.center),G.radius=i,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,o),t.extrudedHeight,o),W.center=r.add(n,o,W.center),W.radius=i;var u=s.computeEllipsePositions(t,!0,!0),c=u.positions,l=u.numPts,y=u.outerPositions,d=e.union(G,W),v=S(c,t,!0),g=M(l),x=g.length;g.length=2*x;for(var E=c.length/3,b=0;x>b;b+=3)g[b+x]=g[b+2]+E,g[b+1+x]=g[b+1]+E,g[b+2+x]=g[b]+E;var z=p.createTypedArray(2*E/3,g),N=new f({attributes:v,indices:z,primitiveType:w.TRIANGLES}),I=T(y,t);g=A(y);var R=p.createTypedArray(2*y.length/3,g),P=new f({attributes:I,indices:R,primitiveType:w.TRIANGLES}),_=h.combine([new m({geometry:N}),new m({geometry:P})]);return{boundingSphere:d,attributes:_.attributes,indices:_.indices}}var O=new r,N=new r,I=new r,R=new r,P=new t,_=new g,L=new x,C=new r,D=new r,q=new r,B=new n,U=new r,F=new r,G=new e,W=new e,V=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.center,n=e.semiMajorAxis,a=e.semiMinorAxis,u=i(e.granularity,v.RADIANS_PER_DEGREE),s=i(e.height,0),l=e.extrudedHeight,f=o(l)&&!v.equalsEpsilon(s,l,1);this._center=r.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=a,this._ellipsoid=i(e.ellipsoid,c.WGS84),this._rotation=i(e.rotation,0),this._stRotation=i(e.stRotation,0),this._height=s,this._granularity=u,this._vertexFormat=i(e.vertexFormat,E.DEFAULT),this._extrudedHeight=l,this._extrude=f,this._workerName="createEllipseGeometry"};return V.createGeometry=function(e){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=z(r)):t=b(r),new f({attributes:t.attributes,indices:t.indices,primitiveType:w.TRIANGLES,boundingSphere:t.boundingSphere})},V}),define("Core/CircleGeometry",["./defaultValue","./defined","./DeveloperError","./EllipseGeometry"],function(e,t,r,n){"use strict";var a=function(t){t=e(t,e.EMPTY_OBJECT);var r=t.radius,a={center:t.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:t.ellipsoid,height:t.height,extrudedHeight:t.extrudedHeight,granularity:t.granularity,vertexFormat:t.vertexFormat,stRotation:t.stRotation};this._ellipseGeometry=new n(a),this._workerName="createCircleGeometry"};return a.createGeometry=function(e){return n.createGeometry(e._ellipseGeometry)},a}),define("Workers/createCircleGeometry",["../Core/Cartesian3","../Core/CircleGeometry","../Core/Ellipsoid"],function(e,t,r){"use strict";function n(n){return n._ellipseGeometry._center=e.clone(n._ellipseGeometry._center),n._ellipseGeometry._ellipsoid=r.clone(n._ellipseGeometry._ellipsoid),t.createGeometry(n)}return n})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";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(r){t=r.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=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:0>e?-1:0},a.signNotZero=function(e){return 0>e?-1:1},a.toSNorm=function(e){return Math.round(255*(.5*a.clamp(e,-1,1)+.5))},a.fromSNorm=function(e){return a.clamp(e,0,255)/255*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.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 a>=i||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;e>=n;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,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(r,n){t(n)||(n=new i);var a=r.clock,o=r.cone,u=e(r.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,r,n,a){return t(a)?(a.x=e,a.y=r,a.z=n,a):new i(e,r,n)},i.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z},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},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 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},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.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 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){i.normalize(e,s),i.normalize(t,c);var r=i.dot(s,c),n=i.magnitude(i.cross(s,c,s));return Math.atan2(n,r)};var l=new i;i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);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,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.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,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)},i.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},i.fromDegrees=function(e,t,r,n,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,r,n,o)};var E=new i,f=new i,d=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(r,n,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(n);E.x=c*Math.cos(r),E.y=c*Math.sin(r),E.z=Math.sin(n),E=i.normalize(E,E),i.multiplyComponents(s,E,f);var l=Math.sqrt(i.dot(E,f));return f=i.divideByScalar(f,l,f),E=i.multiplyByScalar(E,a,E),t(u)||(u=new i),i.add(f,E,u)},i.fromDegreesArray=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o++)n[o]=a.toRadians(e[o]);return i.fromRadiansArray(n,t,r)},i.fromRadiansArray=function(e,r,n){var a=e.length;t(n)?n.length=a/2:n=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];n[o/2]=i.fromRadians(u,s,0,r,n[o/2])}return n},i.fromDegreesArrayHeights=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o+=3)n[o]=a.toRadians(e[o]),n[o+1]=a.toRadians(e[o+1]),n[o+2]=e[o+2];return i.fromRadiansArrayHeights(n,t,r)},i.fromRadiansArrayHeights=function(e,r,n){var a=e.length;t(n)?n.length=a/3:n=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];n[o/3]=i.fromRadians(u,s,c,r,n[o/3])}return n},i.ZERO=n(new i(0,0,0)),i.UNIT_X=n(new i(1,0,0)),i.UNIT_Y=n(new i(0,1,0)),i.UNIT_Z=n(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,c){var l=r.x,E=r.y,f=r.z,d=a.x,m=a.y,_=a.z,h=l*l*d*d,y=E*E*m*m,p=f*f*_*_,T=h+y+p,R=Math.sqrt(1/T),A=e.multiplyByScalar(r,R,i);if(s>T)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,x,w,C,P,L,F,U,b,D=(1-R)*e.magnitude(r)/(.5*e.magnitude(I)),B=0;do{D-=B,g=1/(1+D*v),x=1/(1+D*N),w=1/(1+D*S),C=g*g,P=x*x,L=w*w,F=C*g,U=P*x,b=L*w,M=h*C+y*P+p*L-1,O=h*F*v+y*U*N+p*b*S;var z=-2*O;B=M/z}while(Math.abs(M)>n.EPSILON12);return t(c)?(c.x=l*g,c.y=E*x,c.z=f*w,c):new e(l*g,E*x,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),d=i.EPSILON1;return u.fromCartesian=function(t,n,a){var m=r(n)?n.oneOverRadii:E,_=r(n)?n.oneOverRadiiSquared:f,h=r(n)?n._centerToleranceSquared:d,y=o(t,m,_,h,c);if(r(y)){var p=e.multiplyComponents(t,_,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),v=i.sign(e.dot(T,t))*e.magnitude(T);return r(a)?(a.longitude=R,a.latitude=A,a.height=v,a):new u(R,A,v)}},u.clone=function(e,t){return r(e)?r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){a=r(a,0),e.pack(t._radii,n,a)},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;r>a;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,m=new e,_=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,m);if(n(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(r,i,_),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;r>a;++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}),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","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(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 u(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function s(e){for(var t=0,r=0;3>r;++r){var n=e[o.getElementIndex(d[r],f[r])];t+=2*n*n}return Math.sqrt(t)}function c(e,t){for(var r=i.EPSILON15,n=0,a=1,u=0;3>u;++u){var s=Math.abs(e[o.getElementIndex(d[u],f[u])]);s>n&&(a=u,n=s)}var c=1,l=0,E=f[a],m=d[a];if(Math.abs(e[o.getElementIndex(m,E)])>r){var _,h=e[o.getElementIndex(m,m)],y=e[o.getElementIndex(E,E)],p=e[o.getElementIndex(m,E)],T=(h-y)/2/p;_=0>T?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+_*_),l=_*c}return t=o.clone(o.IDENTITY,t),t[o.getElementIndex(E,E)]=t[o.getElementIndex(m,m)]=c,t[o.getElementIndex(m,E)]=l,t[o.getElementIndex(E,m)]=-l,t}o.packedLength=9,o.pack=function(e,r,n){n=t(n,0),r[n++]=e[0],r[n++]=e[1],r[n++]=e[2],r[n++]=e[3],r[n++]=e[4],r[n++]=e[5],r[n++]=e[6],r[n++]=e[7],r[n++]=e[8]},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[4]=e[n++],a[5]=e[n++],a[6]=e[n++],a[7]=e[n++],a[8]=e[n++],a},o.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},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[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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,u=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,d=e.w*e.w,m=n-s-E+d,_=2*(a-f),h=2*(i+l),y=2*(a+f),p=-n+s-E+d,T=2*(c-u),R=2*(i-l),A=2*(c+u),v=-n-s+E+d;return r(t)?(t[0]=m,t[1]=y,t[2]=R,t[3]=_,t[4]=p,t[5]=A,t[6]=h,t[7]=T,t[8]=v,t):new o(m,_,h,y,p,T,R,A,v)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,n,-a,0,a,n)},o.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 o(n,0,a,0,1,0,-a,0,n)},o.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 o(n,-a,0,a,n,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,r,n){n=o.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},o.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},o.setRow=function(e,t,r,n){return n=o.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var l=new e;o.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),r};var E=new e;o.getMaximumScale=function(t){return o.getScale(t,E),e.maximumComponent(E)},o.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},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[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},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[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},o.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},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[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},o.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},o.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},o.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 f=[1,0,0],d=[2,2,1],m=new o,_=new o;return o.computeEigenDecomposition=function(e,t){var n=i.EPSILON20,a=10,l=0,E=0;r(t)||(t={});for(var f=t.unitary=o.clone(o.IDENTITY,t.unitary),d=t.diagonal=o.clone(e,t.diagonal),h=n*u(d);a>E&&s(d)>h;)c(d,m),o.transpose(m,_),o.multiply(d,m,d),o.multiply(_,d,d),o.multiply(f,m,f),++l>2&&(++E,l=0);return 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[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},o.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)},o.inverse=function(e,t){var r=e[0],a=e[1],u=e[2],s=e[3],c=e[4],l=e[5],E=e[6],f=e[7],d=e[8],m=o.determinant(e);if(Math.abs(m)<=i.EPSILON15)throw new n("matrix is not invertible");t[0]=c*d-f*l,t[1]=f*u-a*d,t[2]=a*l-c*u,t[3]=E*l-s*d,t[4]=r*d-E*u,t[5]=s*u-r*l,t[6]=s*f-E*c,t[7]=E*a-r*f,t[8]=r*c-s*a;var _=1/m;return o.multiplyByScalar(t,_,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=a(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=a(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w},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.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.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(r){t=r.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(e,t,n,a,i,o,u,s,c,l,E,f,d,m,_,h){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(m,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(E,0),this[11]=r(_,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(f,0),this[15]=r(h,0)}c.packedLength=16,c.pack=function(e,t,n){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]},c.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new c),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},c.clone=function(e,t){return n(e)?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 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]):void 0},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,r,a){n(a)||(a=new c);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,l=t.x*t.y,E=t.x*t.z,f=t.x*t.w,d=t.y*t.y,m=t.y*t.z,_=t.y*t.w,h=t.z*t.z,y=t.z*t.w,p=t.w*t.w,T=s-d-h+p,R=2*(l-y),A=2*(E+_),v=2*(l+y),N=-s+d-h+p,S=2*(m-f),I=2*(E-_),M=2*(m+f),O=-s-d+h+p;return a[0]=T*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},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.IDENTITY,e,t)},c.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 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 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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,E=new e,f=new e;c.fromCamera=function(t,r){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,E),E),e.normalize(e.cross(E,l,f),f);var u=E.x,s=E.y,d=E.z,m=l.x,_=l.y,h=l.z,y=f.x,p=f.y,T=f.z,R=a.x,A=a.y,v=a.z,N=u*-R+s*-A+d*-v,S=y*-R+p*-A+T*-v,I=m*R+_*A+h*v; +return n(r)?(r[0]=u,r[1]=y,r[2]=-m,r[3]=0,r[4]=s,r[5]=p,r[6]=-_,r[7]=0,r[8]=d,r[9]=T,r[10]=-h,r[11]=0,r[12]=N,r[13]=S,r[14]=I,r[15]=1,r):new c(u,s,d,N,y,p,T,S,-m,-_,-h,I,0,0,0,1)},c.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},c.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},c.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,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]=E,o[11]=f,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},c.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},c.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,d=l,m=E,_=i+c,h=o+l,y=t+E,p=1;return a[0]=f,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]=m,a[11]=0,a[12]=_,a[13]=h,a[14]=y,a[15]=p,a},c.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]]},c.getElementIndex=function(e,t){return 4*e+t},c.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},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],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,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 d=new e;c.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 m=new e;c.getMaximumScale=function(t){return c.getScale(t,m),e.maximumComponent(m)},c.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],d=e[10],m=e[11],_=e[12],h=e[13],y=e[14],p=e[15],T=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],x=t[10],w=t[11],C=t[12],P=t[13],L=t[14],F=t[15],U=n*T+u*R+E*A+_*v,b=a*T+s*R+f*A+h*v,D=i*T+c*R+d*A+y*v,B=o*T+l*R+m*A+p*v,z=n*N+u*S+E*I+_*M,G=a*N+s*S+f*I+h*M,V=i*N+c*S+d*I+y*M,q=o*N+l*S+m*I+p*M,H=n*O+u*g+E*x+_*w,X=a*O+s*g+f*x+h*w,W=i*O+c*g+d*x+y*w,Y=o*O+l*g+m*x+p*w,k=n*C+u*P+E*L+_*F,K=a*C+s*P+f*L+h*F,Z=i*C+c*P+d*L+y*F,j=o*C+l*P+m*L+p*F;return r[0]=U,r[1]=b,r[2]=D,r[3]=B,r[4]=z,r[5]=G,r[6]=V,r[7]=q,r[8]=H,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],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=e[12],d=e[13],m=e[14],_=t[0],h=t[1],y=t[2],p=t[4],T=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*_+o*h+c*y,g=a*_+u*h+l*y,x=i*_+s*h+E*y,w=n*p+o*T+c*R,C=a*p+u*T+l*R,P=i*p+s*T+E*R,L=n*A+o*v+c*N,F=a*A+u*v+l*N,U=i*A+s*v+E*N,b=n*S+o*I+c*M+f,D=a*S+u*I+l*M+d,B=i*S+s*I+E*M+m;return r[0]=O,r[1]=g,r[2]=x,r[3]=0,r[4]=w,r[5]=C,r[6]=P,r[7]=0,r[8]=L,r[9]=F,r[10]=U,r[11]=0,r[12]=b,r[13]=D,r[14]=B,r[15]=1,r},c.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],d=t[1],m=t[2],_=t[3],h=t[4],y=t[5],p=t[6],T=t[7],R=t[8],A=n*f+o*d+c*m,v=a*f+u*d+l*m,N=i*f+s*d+E*m,S=n*_+o*h+c*y,I=a*_+u*h+l*y,M=i*_+s*h+E*y,O=n*p+o*T+c*R,g=a*p+u*T+l*R,x=i*p+s*T+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]=x,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,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;c.multiplyByUniformScale=function(e,t,r){return _.x=t,_.y=t,_.z=t,c.multiplyByScale(e,_,r)},c.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?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]=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)},c.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},c.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},c.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},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],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},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||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]},c.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},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 u,y=new u,p=new t,T=new t(0,0,0,1);return c.inverse=function(e,r){if(u.equalsEpsilon(c.getRotation(e,h),y,o.EPSILON7)&&t.equals(c.getRow(e,3,p),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],a=e[4],i=e[8],l=e[12],E=e[1],f=e[5],d=e[9],m=e[13],_=e[2],R=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,x=R*M,w=v*S,C=R*I,P=A*S,L=_*M,F=v*N,U=_*I,b=A*N,D=_*S,B=R*N,z=O*f+w*d+C*m-(g*f+x*d+P*m),G=g*E+L*d+b*m-(O*E+F*d+U*m),V=x*E+F*f+D*m-(w*E+L*f+B*m),q=P*E+U*f+B*d-(C*E+b*f+D*d),H=g*a+x*i+P*l-(O*a+w*i+C*l),X=O*n+F*i+U*l-(g*n+L*i+b*l),W=w*n+L*a+B*l-(x*n+F*a+D*l),Y=C*n+b*a+D*i-(P*n+U*a+B*i);O=i*m,g=l*d,x=a*m,w=l*f,C=a*d,P=i*f,L=n*m,F=l*E,U=n*d,b=i*E,D=n*f,B=a*E;var k=O*S+w*I+C*M-(g*S+x*I+P*M),K=g*N+L*I+b*M-(O*N+F*I+U*M),Z=x*N+F*S+D*M-(w*N+L*S+B*M),j=P*N+U*S+B*I-(C*N+b*S+D*I),Q=x*A+P*v+g*R-(C*v+O*R+w*A),J=U*v+O*_+F*A-(L*A+b*v+g*_),$=L*R+B*v+w*_-(D*v+x*_+F*R),ee=D*A+C*_+b*R-(U*R+B*A+P*_),te=n*z+a*G+i*V+l*q;if(Math.abs(te)<o.EPSILON20)throw new s("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]=H*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],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],E=e[12],f=e[13],d=e[14],m=-r*E-n*f-a*d,_=-i*E-o*f-u*d,h=-s*E-c*f-l*d;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]=m,t[13]=_,t[14]=h,t[15]=1,t},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,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/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/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){n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north},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 r>t&&(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;f>E;E++){var d=e[E];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var m=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,m),o=Math.max(o,m)}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.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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;i>a&&(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;i>a&&o>0?a+=u.TWO_PI:c>o&&a>0&&(o+=u.TWO_PI),i>a&&0>c?c+=u.TWO_PI:c>o&&0>i&&(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)&&l>=E)){var f=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(f>=d))return r(n)?(n.west=l,n.south=f,n.east=E,n.north=d,n):new s(l,f,E,d)}},s.union=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.west),n.south=Math.min(e.south,t.south),n.east=Math.max(e.east,t.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 r=t.longitude,n=t.latitude,a=e.west,i=e.east;return a>i&&(i+=u.TWO_PI,0>r&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(i>r||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,d=e.east,m=e.west,_=c;_.height=a,_.longitude=m,_.latitude=E,o[l]=n.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=n.cartographicToCartesian(_,o[l]),l++,_.latitude=f,o[l]=n.cartographicToCartesian(_,o[l]),l++,_.longitude=m,o[l]=n.cartographicToCartesian(_,o[l]),l++,0>E?_.latitude=E:f>0?_.latitude=f:_.latitude=0;for(var h=1;8>h;++h)_.longitude=-Math.PI+h*u.PI_OVER_TWO,s.contains(e,_)&&(o[l]=n.cartographicToCartesian(_,o[l]),l++);return 0===_.latitude&&(_.longitude=m,o[l]=n.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=n.cartographicToCartesian(_,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","./Plane","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,E,f){"use strict";function d(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var m=new e,_=new e,h=new e,y=new e,p=new e,T=new e,R=new e,A=new e,v=new e,N=new e,S=new e,I=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],R),i=e.clone(a,m),o=e.clone(a,_),u=e.clone(a,h),s=e.clone(a,y),c=e.clone(a,p),l=e.clone(a,T),E=t.length,f=1;E>f;f++){e.clone(t[f],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 x=e.magnitudeSquared(e.subtract(s,i,A)),w=e.magnitudeSquared(e.subtract(c,o,A)),C=e.magnitudeSquared(e.subtract(l,u,A)),P=i,L=s,F=x;w>F&&(F=w,P=o,L=c),C>F&&(F=C,P=u,L=l);var U=v;U.x=.5*(P.x+L.x),U.y=.5*(P.y+L.y),U.z=.5*(P.z+L.z);var b=e.magnitudeSquared(e.subtract(L,U,A)),D=Math.sqrt(b),B=N;B.x=i.x,B.y=o.y,B.z=u.z;var z=S;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,A),.5,I),V=0;for(f=0;E>f;f++){e.clone(t[f],a);var q=e.magnitude(e.subtract(a,G,A));q>V&&(V=q);var H=e.magnitudeSquared(e.subtract(a,U,A));if(H>b){var X=Math.sqrt(H);D=.5*(D+X),b=D*D;var W=X-D;U.x=(D*U.x+W*a.x)/X,U.y=(D*U.y+W*a.y)/X,U.z=(D*U.z+W*a.z)/X}}return V>D?(e.clone(U,r.center),r.radius=D):(e.clone(G,r.center),r.radius=V),r};var M=new o,O=new e,g=new e,x=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,M),f.southwest(t,x),x.height=i,f.northeast(t,w),w.height=o;var s=a.project(x,O),c=a.project(w,g),l=c.x-s.x,E=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(l*l+E*E+m*m);var _=u.center;return _.x=s.x+.5*l,_.y=s.y+.5*E,_.z=s.z+.5*m,u};var C=[];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,C)),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=R;u.x=t[0]+a.x,u.y=t[1]+a.y,u.z=t[2]+a.z;for(var s=e.clone(u,m),c=e.clone(u,_),l=e.clone(u,h),E=e.clone(u,y),f=e.clone(u,p),M=e.clone(u,T),O=t.length,g=0;O>g;g+=i){var x=t[g]+a.x,w=t[g+1]+a.y,C=t[g+2]+a.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>E.x&&e.clone(u,E),w<c.y&&e.clone(u,c),w>f.y&&e.clone(u,f),C<l.z&&e.clone(u,l),C>M.z&&e.clone(u,M)}var P=e.magnitudeSquared(e.subtract(E,s,A)),L=e.magnitudeSquared(e.subtract(f,c,A)),F=e.magnitudeSquared(e.subtract(M,l,A)),U=s,b=E,D=P;L>D&&(D=L,U=c,b=f),F>D&&(D=F,U=l,b=M);var B=v;B.x=.5*(U.x+b.x),B.y=.5*(U.y+b.y),B.z=.5*(U.z+b.z);var z=e.magnitudeSquared(e.subtract(b,B,A)),G=Math.sqrt(z),V=N;V.x=s.x,V.y=c.y,V.z=l.z;var q=S;q.x=E.x,q.y=f.y,q.z=M.z;var H=e.multiplyByScalar(e.add(V,q,A),.5,I),X=0;for(g=0;O>g;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,H,A));W>X&&(X=W);var Y=e.magnitudeSquared(e.subtract(u,B,A));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 X>G?(e.clone(B,o.center),o.radius=G):(e.clone(H,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=R;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,m),u=e.clone(i,_),s=e.clone(i,h),c=e.clone(i,y),l=e.clone(i,p),E=e.clone(i,T),f=t.length,M=0;f>M;M+=3){var O=t[M]+r[M],g=t[M+1]+r[M+1],x=t[M+2]+r[M+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>E.z&&e.clone(i,E)}var w=e.magnitudeSquared(e.subtract(c,o,A)),C=e.magnitudeSquared(e.subtract(l,u,A)),P=e.magnitudeSquared(e.subtract(E,s,A)),L=o,F=c,U=w;C>U&&(U=C,L=u,F=l),P>U&&(U=P,L=s,F=E);var b=v;b.x=.5*(L.x+F.x),b.y=.5*(L.y+F.y),b.z=.5*(L.z+F.z);var D=e.magnitudeSquared(e.subtract(F,b,A)),B=Math.sqrt(D),z=N;z.x=o.x,z.y=u.y,z.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=E.z;var V=e.multiplyByScalar(e.add(z,G,A),.5,I),q=0;for(M=0;f>M;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 H=e.magnitude(e.subtract(i,V,A));H>q&&(q=H);var X=e.magnitudeSquared(e.subtract(i,b,A));if(X>D){var W=Math.sqrt(X);B=.5*(B+W),D=B*B;var Y=W-B;b.x=(B*b.x+Y*i.x)/W,b.y=(B*b.y+Y*i.y)/W,b.z=(B*b.z+Y*i.z)/W}}return q>B?(e.clone(b,a.center),a.radius=B):(e.clone(V,a.center),a.radius=q),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;a>o;o++)i.push(t[o].center);r=d.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;a>o;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return r.radius=s,r};var L=new e,F=new e,U=new e;d.fromOrientedBoundingBox=function(t,r){n(r)||(r=new d);var a=t.halfAxes,i=c.getColumn(a,0,L),o=c.getColumn(a,1,F),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},d.clone=function(t,r){return n(t)?n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new d(t.center,t.radius):void 0},d.packedLength=4,d.pack=function(e,t,n){n=r(n,0);var a=e.center;t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius},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 b=new e,D=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,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),f=e.multiplyByScalar(c,(-o+E)/l,D);return e.add(f,i,f),e.clone(f,a.center),a.radius=E,a};var B=new e;d.expand=function(t,r,n){n=d.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,B));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-a>o?u.OUTSIDE:a>o?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 G=new e;d.computePlaneDistances=function(t,r,a,i){n(i)||(i=new s);var o=e.subtract(t.center,r,G),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var V=new e,q=new e,H=new e,X=new e,W=new e,Y=new t,k=new Array(8),K=0;8>K;++K)k[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,V),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,H);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),f=e.negate(c,X),m=k,_=m[0];e.add(s,l,_),e.add(_,c,_),_=m[1],e.add(s,l,_),e.add(_,f,_),_=m[2],e.add(s,E,_),e.add(_,f,_),_=m[3],e.add(s,E,_),e.add(_,c,_),e.negate(s,s),_=m[4],e.add(s,l,_),e.add(_,c,_),_=m[5],e.add(s,l,_),e.add(_,f,_),_=m[6],e.add(s,E,_),e.add(_,f,_),_=m[7],e.add(s,E,_),e.add(_,c,_);for(var h=m.length,y=0;h>y;++y){var p=m[y];e.add(o,p,p);var T=i.cartesianToCartographic(p,Y);n.project(T,p)}a=d.fromPoints(m,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,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){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n]=t.y},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.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.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("Renderer/WebGLConstants",["../Core/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/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(){return a.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?n.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(n.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",e(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;n>r;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(T)){T=!1;var e=/ Chrome\/([\.0-9]+)/.exec(p.userAgent);null!==e&&(T=!0,R=n(e[1]))}return T}function i(){return a()&&R}function o(){if(!t(A)&&(A=!1,!a()&&/ Safari\/[\.0-9]+/.test(p.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(p.userAgent);null!==e&&(A=!0,v=n(e[1]))}return A}function u(){return o()&&v}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(p.userAgent);null!==e&&(N=!0,S=n(e[1]),S.isNightly=!!e[2])}return N}function c(){return s()&&S}function l(){if(!t(I)){I=!1;var e;"Microsoft Internet Explorer"===p.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(p.userAgent),null!==e&&(I=!0,M=n(e[1]))):"Netscape"===p.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(p.userAgent),null!==e&&(I=!0,M=n(e[1])))}return I}function E(){return l()&&M}function f(){if(!t(O)){O=!1;var e=/Firefox\/([\.0-9]+)/.exec(p.userAgent);null!==e&&(O=!0,g=n(e[1]))}return O}function d(){return t(x)||(x=/Windows/i.test(p.appVersion)),x}function m(){return f()&&g}function _(){return t(w)||(w="undefined"!=typeof PointerEvent&&(!t(p.pointerEnabled)||p.pointerEnabled)),w}function h(){if(!t(P)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;P=t(r)&&""!==r,P&&(C=r)}return P}function y(){return h()?C:void 0}var p;p="undefined"!=typeof navigator?navigator:{};var T,R,A,v,N,S,I,M,O,g,x,w,C,P,L={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:E,isFirefox:f,firefoxVersion:m,isWindows:d,hardwareConcurrency:e(p.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:h,imageRenderingValue:y};return L.supportsFullscreen=function(){return r.supportsFullscreen()},L.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},L.supportsWebWorkers=function(){return"undefined"!=typeof Worker},L}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,r,n,a,i){"use strict";if(!a.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return r(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new n("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,r,a,i){switch(a=t(a,0),i=t(i,(r.byteLength-a)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(r,a,i);case o.UNSIGNED_BYTE:return new Uint8Array(r,a,i);case o.SHORT:return new Int16Array(r,a,i);case o.UNSIGNED_SHORT:return new Uint16Array(r,a,i);case o.FLOAT:return new Float32Array(r,a,i);case o.DOUBLE:return new Float64Array(r,a,i);default:throw new n("componentDatatype is not a valid value.")}},i(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,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],d=e[u.COLUMN1ROW1],m=e[u.COLUMN2ROW2],_=f+d+m;if(_>0)n=Math.sqrt(_+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 h=l,y=0;d>f&&(y=1),m>f&&m>d&&(y=2);var p=h[y],T=h[p];n=Math.sqrt(e[u.getElementIndex(y,y)]-e[u.getElementIndex(p,p)]-e[u.getElementIndex(T,T)]+1);var R=E;R[y]=.5*n,n=.5/n,c=(e[u.getElementIndex(T,p)]-e[u.getElementIndex(p,T)])*n,R[p]=(e[u.getElementIndex(p,y)]+e[u.getElementIndex(y,p)])*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 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 d=new e,m=new e,_=new s,h=new s,y=new s;s.packedLength=4,s.pack=function(e,r,n){n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w},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;i>a;a++){var o=3*a;s.unpack(e,4*(t+a),_),s.multiply(_,y,_),_.w<0&&s.negate(_,_),s.computeAxis(_,d);var u=s.computeAngle(_);n[o]=d.x*u,n[o+1]=d.y*u,n[o+2]=d.z*u}},s.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new s),e.fromArray(t,0,m);var u=e.magnitude(m);return s.unpack(n,4*i,h),0===u?s.clone(s.IDENTITY,_):s.fromAxisAngle(m,u,_),s.multiply(_,h,o)},s.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w):void 0},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,d=o*c+n*s-a*u+i*l,m=o*l-n*u-a*s-i*c;return r.x=E,r.y=f,r.z=d,r.w=m,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 p=new s;s.lerp=function(e,t,r,n){return p=s.multiplyByScalar(t,r,p),n=s.multiplyByScalar(e,1-r,n),s.add(p,n,n)};var T=new s,R=new s,A=new s;s.slerp=function(e,t,r,n){var a=s.dot(e,t),i=t;if(0>a&&(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),A=s.multiplyByScalar(i,Math.sin(r*u),A),n=s.add(R,A,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 v=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,v);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 M=new s,O=1.9011074535173003,g=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;7>P;++P){var L=P+1,F=2*L+1;g[P]=1/(L*F),x[P]=L/F}return g[7]=O/136,x[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,E=7;E>=0;--E)w[E]=(g[E]*c-x[E])*o,C[E]=(g[E]*l-x[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])))))))),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])))))))),m=s.multiplyByScalar(e,d,M);return s.multiplyByScalar(t,f,n),s.add(m,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/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,n){"use strict";function a(t,a,i,l,E,f,d,m,_,h){var y=t+a;e.multiplyByScalar(l,Math.cos(y),o),e.multiplyByScalar(i,Math.sin(y),u),e.add(o,u,o);var p=Math.cos(t);p*=p;var T=Math.sin(t);T*=T;var R=f/Math.sqrt(d*p+E*T),A=R/m;return n.fromAxisAngle(o,A,s),r.fromQuaternion(s,c),r.multiplyByVector(c,_,h),e.normalize(h,h),e.multiplyByScalar(h,m,h),h}var i={},o=new e,u=new e,s=new n,c=new r,l=new e,E=new e,f=new e,d=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,m=n?c:0,_=0;c>_;_+=3){var h=_+1,y=_+2,p=e.fromArray(t,_,l);a.scaleToGeodeticSurface(p,p);var T=e.clone(p,E),R=a.geodeticSurfaceNormal(p,d),A=e.multiplyByScalar(R,i,f);e.add(p,A,p),n&&(e.multiplyByScalar(R,o,A),e.add(T,A,T),s[_+m]=T.x,s[h+m]=T.y,s[y+m]=T.z),s[_]=p.x,s[h]=p.y,s[y]=p.z}return s};var m=new e,_=new e,h=new e;return i.computeEllipsePositions=function(r,n,i){var o=r.semiMinorAxis,u=r.semiMajorAxis,s=r.rotation,c=r.center,d=8*r.granularity,y=o*o,p=u*u,T=u*o,R=e.magnitude(c),A=e.normalize(c,m),v=e.cross(e.UNIT_Z,c,_);v=e.normalize(v,v);var N=e.cross(A,v,h),S=1+Math.ceil(t.PI_OVER_TWO/d),I=t.PI_OVER_TWO/(S-1),M=t.PI_OVER_TWO-S*I;0>M&&(S-=Math.ceil(Math.abs(M)/I));var O,g,x,w,C,P=2*(S*(S+2)),L=n?new Array(3*P):void 0,F=0,U=l,b=E,D=4*S*3,B=D-1,z=0,G=i?new Array(D):void 0;for(M=t.PI_OVER_TWO,U=a(M,s,N,v,y,T,p,R,A,U),n&&(L[F++]=U.x,L[F++]=U.y,L[F++]=U.z),i&&(G[B--]=U.z,G[B--]=U.y,G[B--]=U.x),M=t.PI_OVER_TWO-I,O=1;S+1>O;++O){if(U=a(M,s,N,v,y,T,p,R,A,U),b=a(Math.PI-M,s,N,v,y,T,p,R,A,b),n){for(L[F++]=U.x,L[F++]=U.y,L[F++]=U.z,x=2*O+2,g=1;x-1>g;++g)w=g/(x-1),C=e.lerp(U,b,w,f),L[F++]=C.x,L[F++]=C.y,L[F++]=C.z;L[F++]=b.x,L[F++]=b.y,L[F++]=b.z}i&&(G[B--]=U.z,G[B--]=U.y,G[B--]=U.x,G[z++]=b.x,G[z++]=b.y,G[z++]=b.z),M=t.PI_OVER_TWO-(O+1)*I}for(O=S;O>1;--O){if(M=t.PI_OVER_TWO-(O-1)*I,U=a(-M,s,N,v,y,T,p,R,A,U),b=a(M+Math.PI,s,N,v,y,T,p,R,A,b),n){for(L[F++]=U.x,L[F++]=U.y,L[F++]=U.z,x=2*(O-1)+2,g=1;x-1>g;++g)w=g/(x-1),C=e.lerp(U,b,w,f),L[F++]=C.x,L[F++]=C.y,L[F++]=C.z;L[F++]=b.x,L[F++]=b.y,L[F++]=b.z}i&&(G[B--]=U.z,G[B--]=U.y,G[B--]=U.x,G[z++]=b.x,G[z++]=b.y,G[z++]=b.z)}M=t.PI_OVER_TWO,U=a(-M,s,N,v,y,T,p,R,A,U);var V={};return n&&(L[F++]=U.x,L[F++]=U.y,L[F++]=U.z,V.positions=L,V.numPts=S),i&&(G[B--]=U.z,G[B--]=U.y,G[B--]=U.x,V.outerPositions=G),V},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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(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=void 0}return i.computeNumberOfVertices=function(e){var n=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(n!==o&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=o}return n},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.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=t.x,n=t.y;t.x=(1-Math.abs(n))*a.signNotZero(r),t.y=(1-Math.abs(r))*a.signNotZero(n)}return t.x=a.toSNorm(t.x),t.y=a.toSNorm(t.y),t},i.octDecode=function(e,r,n){if(n.x=a.fromSNorm(e),n.y=a.fromSNorm(r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var i=n.x;n.x=(1-Math.abs(n.y))*a.signNotZero(i),n.y=(1-Math.abs(i))*a.signNotZero(n.y)}return t.normalize(n,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 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=1===e.x?4095:4096*e.x|0,r=1===e.y?4095:4096*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096;return t.x=Math.floor(r)/4096,t.y=r-Math.floor(r),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,d,m,_,h,y,p;r(a.z)?(E=t.subtract(s,a,i),f=t.subtract(c,a,o),d=t.subtract(n,a,u),m=t.dot(E,E),_=t.dot(E,f),h=t.dot(E,d),y=t.dot(f,f),p=t.dot(f,d)):(E=e.subtract(s,a,i),f=e.subtract(c,a,o),d=e.subtract(n,a,u),m=e.dot(E,E),_=e.dot(E,f),h=e.dot(E,d),y=e.dot(f,f),p=e.dot(f,d));var T=1/(m*y-_*_);return l.y=(y*h-_*p)*T,l.z=(m*p-_*h)*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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,n){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,n):new Uint16Array(t,r,n)},n(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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,0>i?[i,0]:[0,i];var c=n*n,l=4*e*a,E=r(c,-l,t.EPSILON14);if(0>E)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,d=s*s,m=o*s-f,_=o*c-u*s,h=u*c-d,y=4*m*h-_*_;if(0>y){var p,T,R;f*E>=l*d?(p=o,T=m,R=-2*u*m+o*_):(p=c,T=h,R=-c*_+2*s*h);var A=0>R?-1:1,v=-A*Math.abs(p)*Math.sqrt(-y);i=-R+v;var N=i/2,S=0>N?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===v?-S:-T/S;return a=0>=T?S+I:-R/(S*S+I*I+T),f*E>=l*d?[(a-u)/o]:[-c/(a+s)]}var M=m,O=-2*u*m+o*_,g=h,x=-c*_+2*s*h,w=Math.sqrt(y),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-O)/3);a=2*Math.sqrt(-M);var L=Math.cos(P);i=a*L;var F=a*(-L/2-C*Math.sin(P)),U=i+F>2*u?i-u:F-u,b=o,D=U/b;P=Math.abs(Math.atan2(c*w,-x)/3),a=2*Math.sqrt(-g),L=Math.cos(P),i=a*L,F=a*(-L/2-C*Math.sin(P));var B=-c,z=2*s>i+F?i+s:F+s,G=B/z,V=b*z,q=-U*z-b*B,H=U*B,X=(s*q-u*H)/(-u*q+s*V);return X>=D?G>=D?G>=X?[D,X,G]:[D,G,X]:[G,D,X]:G>=D?[X,D,G]:G>=X?[X,G,D]:[G,X,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=0>u?-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,0>u?[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,d=E[E.length-1];if(Math.abs(d)<r.EPSILON14){var m=n.computeRealRoots(1,s,l);if(2===m.length){var _,h=m[0],y=m[1];if(h>=0&&y>=0){var p=Math.sqrt(h),T=Math.sqrt(y);return[f-T,f-p,f+p,f+T]}if(h>=0&&0>y)return _=Math.sqrt(h),[f-_,f+_];if(0>h&&y>=0)return _=Math.sqrt(y),[f-_,f+_]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,v=(s+d+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,d=e.computeRealRoots(1,l,E,f);if(d.length>0){var m,_,h=d[0],y=a-h,p=y*y,T=t/2,R=y/2,A=p-4*o,v=p+4*Math.abs(o),N=c-4*h,S=c+4*Math.abs(h);if(0>h||N*v>A*S){var I=Math.sqrt(N);m=I/2,_=0===I?0:(t*R-i)/I}else{var M=Math.sqrt(A);m=0===M?0:(t*R-i)/M,_=M/2}var O,g;0===T&&0===m?(O=0,g=0):r.sign(T)===r.sign(m)?(O=T+m,g=h/O):(g=T-m,O=h/g);var x,w;0===R&&0===_?(x=0,w=0):r.sign(R)===r.sign(_)?(x=R+_,w=o/x):(w=R-_,x=o/w);var C=n.computeRealRoots(1,O,x),P=n.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,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,d=a*a,m=d*a,_=u*c*E-4*s*f-4*e*l*E+18*e*t*r*f-27*i*E*E+256*o*m+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)+d*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return _},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,d=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>E?d+1:d,d+=0>f?d+1:d){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(t,n,a,o,u){u=r(u,!1);var s,c,l,E,f,d=t.origin,m=t.direction,_=e.subtract(a,n,h),A=e.subtract(o,n,y),v=e.cross(m,A,p),N=e.dot(_,v);if(u){if(N<i.EPSILON6)return;if(s=e.subtract(d,n,T),l=e.dot(s,v),0>l||l>N)return;if(c=e.cross(s,_,R),E=e.dot(m,c),0>E||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(d,n,T),l=e.dot(s,v)*S,0>l||l>1)return;if(c=e.cross(s,_,R),E=e.dot(m,c)*S,0>E||l+E>1)return;f=e.dot(A,c)*S}return f}function E(e,t,r,n){var a=t*t-4*e*r;if(!(0>a)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(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,p),l=e.dot(o,o),f=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,m=E(l,f,d,v);return n(m)?(a.start=m.root0,a.stop=m.root1,a):void 0}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 m(t,r,n,a,c){var l,E=a*a,f=c*c,m=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*f,_=c*(a*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+r.y),h=t[o.COLUMN0ROW0]*E+t[o.COLUMN2ROW2]*f+a*r.x+n,y=f*d(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),p=c*(a*d(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+r.z),T=[];if(0===p&&0===y){if(l=u.computeRealRoots(m,_,h),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],N=Math.sqrt(Math.max(1-v*v,0));T.push(new e(a,c*v,c*-N)),T.push(new e(a,c*v,c*N))}return T}var S=p*p,I=y*y,M=m*m,O=p*y,g=M+I,x=2*(_*m+O),w=2*h*m+_*_-I+S,C=2*(h*_-O),P=h*h-S;if(0===g&&0===x&&0===w&&0===C)return T;l=s.computeRealRoots(g,x,w,C,P);var L=l.length;if(0===L)return T;for(var F=0;L>F;++F){var U,b=l[F],D=b*b,B=Math.max(1-D,0),z=Math.sqrt(B);U=i.sign(m)===i.sign(h)?d(m*D+h,_*b,i.EPSILON12):i.sign(h)===i.sign(_*b)?d(m*D,_*b+h,i.EPSILON12):d(m*D+_*b,h,i.EPSILON12);var G=d(y*b,p,i.EPSILON15),V=U*G;0>V?T.push(new e(a,c*b,c*z)):V>0?T.push(new e(a,c*b,c*-z)):0!==z?(T.push(new e(a,c*b,c*-z)),T.push(new e(a,c*b,c*z)),++F):T.push(new e(a,c*b,c*z))}return T}var _={};_.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(!(0>l))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var h=new e,y=new e,p=new e,T=new e,R=new e;_.rayTriangle=function(t,r,a,i,o,u){var s=l(t,r,a,i,o);if(n(s)&&!(0>s))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new c;_.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 E=l(c,a,i,o,u);return!n(E)||0>E||E>e.distance(t,r)?void 0:(n(s)||(s=new e),e.multiplyByScalar(c.direction,E,s),e.add(c.origin,s,s))};var v={root0:0,root1:0};_.raySphere=function(e,t,r){return r=f(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var N=new c;_.lineSegmentSphere=function(t,r,a,i){var o=N,u=e.subtract(r,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=f(o,a,i),!n(i)||i.stop<0||i.start>s?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i)};var S=new e,I=new 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,I),E=e.magnitudeSquared(c),f=e.dot(c,l);if(E>1){if(f>=0)return;var d=f*f;if(n=E-1,a=e.magnitudeSquared(l),i=a*n,i>d)return;if(d>i){o=f*f-i,u=-f+Math.sqrt(o);var m=u/a,_=n/u;return _>m?{start:m,stop:_}:{start:_,stop:m}}var h=Math.sqrt(n/a);return{start:h,stop:h}}return 1>E?(n=E-1,a=e.magnitudeSquared(l),i=a*n,o=f*f-i,u=-f+Math.sqrt(o),{start:0,stop:u/a}):0>f?(a=e.magnitudeSquared(l),{start:0,stop:-f/a}):void 0};var M=new e,O=new e,g=new e,x=new e,w=new e,C=new o,P=new o,L=new o,F=new o,U=new o,b=new o,D=new o,B=new e,z=new e,G=new t;_.grazingAltitudeLocation=function(t,r){var a=t.origin,u=t.direction,s=r.geodeticSurfaceNormal(a,M);if(e.dot(u,s)>=0)return a;var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u,M),E=e.normalize(l,l),f=e.mostOrthogonalAxis(l,x),d=e.normalize(e.cross(f,E,O),O),_=e.normalize(e.cross(E,d,g),g),h=C;h[0]=E.x,h[1]=E.y,h[2]=E.z,h[3]=d.x,h[4]=d.y,h[5]=d.z,h[6]=_.x,h[7]=_.y,h[8]=_.z;var y=o.transpose(h,P),p=o.fromScale(r.radii,L),T=o.fromScale(r.oneOverRadii,F),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,T,b),R,b),S=o.multiply(o.multiply(N,p,D),h,D),I=o.multiplyByVector(N,a,w),V=m(S,e.negate(I,M),0,0,1),q=V.length;if(q>0){for(var H=e.clone(e.ZERO,z),X=Number.NEGATIVE_INFINITY,W=0;q>W;++W){A=o.multiplyByVector(p,o.multiplyByVector(h,V[W],B),B);var Y=e.normalize(e.subtract(A,a,x),x),k=e.dot(Y,u);k>X&&(X=k,H=e.clone(A,H))}var K=r.cartesianToCartographic(H,G);return X=i.clamp(X,0,1),v=e.magnitude(e.subtract(H,a,x))*Math.sqrt(1-X*X),v=c?-v:v,K.height=v,r.cartographicToCartesian(K,new e)}};var V=new e;return _.lineSegmentPlane=function(t,r,a,o){n(o)||(o=new e);var u=e.subtract(r,t,V),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(!(0>E||E>1))return e.multiplyByScalar(u,E,o),e.add(t,o,o),o}},_.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 _.lineSegmentPlane(t,r,a,E),_.lineSegmentPlane(t,n,a,f),{positions:[t,r,n,E,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return _.lineSegmentPlane(r,n,a,E),_.lineSegmentPlane(r,t,a,f),{positions:[t,r,n,E,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return _.lineSegmentPlane(n,t,a,E),_.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 _.lineSegmentPlane(r,t,a,E),_.lineSegmentPlane(n,t,a,f),{positions:[t,r,n,E,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return _.lineSegmentPlane(n,r,a,E),_.lineSegmentPlane(t,r,a,f),{positions:[t,r,n,E,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return _.lineSegmentPlane(t,n,a,E),_.lineSegmentPlane(r,n,a,f),{positions:[t,r,n,E,f],indices:[0,1,4,0,4,3,2,3,4]}}},_}),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];o>u;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;a+1>l;l++)c[l]=0;for(var E=i+1,f=0;o>f;++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(;n>i;){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||-1===l)&&(l=s,c=f)),++E}return-1===c?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],d=c;if(t(u))l=u+1;else{for(;d>E;)f>l&&(l=f),++E,f=o[E];if(-1===l)return 0;++l}for(var m=[],_=0;l>_;_++)m[_]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};E=0;for(var h=0;d>E;)m[o[E]].vertexTriangles.push(h),++m[o[E]].numLiveTriangles,m[o[E+1]].vertexTriangles.push(h),++m[o[E+1]].numLiveTriangles,m[o[E+2]].vertexTriangles.push(h),++m[o[E+2]].numLiveTriangles,++h,E+=3;var y=0,p=s+1;i=1;var T,R,A=[],v=[],N=0,S=[],I=c/3,M=[];for(_=0;I>_;_++)M[_]=!1;for(var O,g;-1!==y;){A=[],R=m[y],g=R.vertexTriangles.length;for(var x=0;g>x;++x)if(h=R.vertexTriangles[x],!M[h]){M[h]=!0,E=h+h+h;for(var w=0;3>w;++w)O=o[E],A.push(O),v.push(O),S[N]=O,++N,T=m[O],--T.numLiveTriangles,p-T.timeStamp>s&&(T.timeStamp=p,++p),++E}y=a(o,s,A,m,p,v,l)}return S},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,d,m,_,h,y,p,T,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 O(e){for(var t=e.length,r=t/3*6,n=y.createTypedArray(t,r),a=0,i=0;t>i;i+=3,a+=6)M(n,a,e[i],e[i+1],e[i+2]);return n}function g(e){var t=e.length;if(t>=3){var r=6*(t-2),n=y.createTypedArray(t,r);M(n,0,e[0],e[1],e[2]);for(var a=6,i=3;t>i;++i,a+=6)M(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;t>o;++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 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;n>i;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;n>i;i+=3)a.unpack(r,i,ie),A.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,r,i)}function F(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;n>E;++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 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,E,f=e.length,m=(e[0].modelMatrix,c(e[0][t].indices)),_=e[0][t].primitiveType,h=F(e,t);for(n in h)if(h.hasOwnProperty(n))for(s=h[n].values,u=0,i=0;f>i;++i)for(l=e[i][t].attributes[n].values,E=l.length,o=0;E>o;++o)s[u++]=l[o];var p;if(m){var T=0;for(i=0;f>i;++i)T+=e[i][t].indices.length;var R=d.computeNumberOfVertices(new d({attributes:h,primitiveType:S.POINTS})),A=y.createTypedArray(R,T),v=0,N=0;for(i=0;f>i;++i){var I=e[i][t].indices,M=I.length;for(u=0;M>u;++u)A[v++]=N+I[u];N+=d.computeNumberOfVertices(e[i][t])}p=A}var O,g=new a,x=0;for(i=0;f>i;++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;f>i;++i){O=e[i][t].boundingSphere;var w=a.magnitude(a.subtract(O.center,g,se))+O.radius;w>x&&(x=w)}return new d({attributes:h,indices:p,primitiveType:_,boundingSphere:c(g)?new r(g,x):void 0})}function b(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function D(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,a=3;t>a;++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=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;t-1>a;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,t>a+2&&(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=y.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function G(e){var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;t>a;++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=y.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;t>a;++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 b(e);case S.LINE_STRIP:return G(e);case S.LINE_LOOP:return V(e);case S.LINES:return z(e)}return e}function H(e,t){Math.abs(e.y)<R.EPSILON6&&(t?e.y=-R.EPSILON6:e.y=R.EPSILON6)}function X(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return H(e,e.y<0),H(t,t.y<0),void H(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=0>n;H(e,u),H(t,u),H(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),H(r,!0),H(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=Ie.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(W(e,t,Ae,Ne),W(e,r,ve,Se),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(W(t,r,Ae,Ne),W(t,e,ve,Se),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(W(r,e,Ae,Ne),W(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||(W(r,e,Ae,Ne),W(r,t,ve,Se),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(W(t,r,Ae,Ne),W(t,e,ve,Se),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(W(e,t,Ae,Ne),W(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=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 a=t[n];r[n]=new m({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new d({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 j(e,r,i,o,u,s,l,E,f,d,m){if(c(s)||c(l)||c(E)||c(f)){var _=a.fromArray(u,3*e,Me),h=a.fromArray(u,3*r,Oe),y=a.fromArray(u,3*i,ge),p=t(o,_,h,y,xe);if(c(s)){var T=a.fromArray(s,3*e,Me),R=a.fromArray(s,3*r,Oe),A=a.fromArray(s,3*i,ge);a.multiplyByScalar(T,p.x,T),a.multiplyByScalar(R,p.y,R),a.multiplyByScalar(A,p.z,A);var v=a.add(T,R,T);a.add(v,A,v),a.normalize(v,v),a.pack(v,d.normal.values,3*m)}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,p.x,N),a.multiplyByScalar(S,p.y,S),a.multiplyByScalar(I,p.z,I);var M=a.add(N,S,N);a.add(M,I,M),a.normalize(M,M),a.pack(M,d.binormal.values,3*m)}if(c(E)){var O=a.fromArray(E,3*e,Me),g=a.fromArray(E,3*r,Oe),x=a.fromArray(E,3*i,ge);a.multiplyByScalar(O,p.x,O),a.multiplyByScalar(g,p.y,g),a.multiplyByScalar(x,p.z,x);var w=a.add(O,g,O);a.add(w,x,w),a.normalize(w,w),a.pack(w,d.tangent.values,3*m)}if(c(f)){var C=n.fromArray(f,2*e,we),P=n.fromArray(f,2*r,Ce),L=n.fromArray(f,2*i,Pe);n.multiplyByScalar(C,p.x,C),n.multiplyByScalar(P,p.y,P),n.multiplyByScalar(L,p.z,L);var F=n.add(C,P,C);n.add(F,L,F),n.pack(F,d.st.values,2*m)}}}function Q(e,t,r,n,a,i){var o=e.position.values.length/3;if(-1!==a){var u=n[a],s=r[u];return-1===s?(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.binormal)?s.binormal.values:void 0,d=c(s.tangent)?s.tangent.values:void 0,m=c(s.st)?s.st.values:void 0,_=u.indices,h=K(u),y=K(u),p=[];p.length=l.length/3;var T=[];for(T.length=l.length/3,o=0;o<p.length;++o)p[o]=-1,T[o]=-1;var R=_.length;for(o=0;R>o;o+=3){var A=_[o],v=_[o+1],N=_[o+2],S=a.fromArray(l,3*A),I=a.fromArray(l,3*v),M=a.fromArray(l,3*N),O=Y(S,I,M);if(c(O)&&O.positions.length>3)for(var g=O.positions,x=O.indices,w=x.length,C=0;w>C;++C){var P=x[C],L=g[P];L.y<0?(t=y.attributes,r=y.indices,n=p):(t=h.attributes,r=h.indices,n=T),i=Q(t,r,n,_,3>P?o+P:-1,L),j(A,v,N,L,l,E,f,d,m,t,i)}else c(O)&&(S=O.positions[0],I=O.positions[1],M=O.positions[2]),S.y<0?(t=y.attributes,r=y.indices,n=p):(t=h.attributes,r=h.indices,n=T),i=Q(t,r,n,_,o,S),j(A,v,N,S,l,E,f,d,m,t,i),i=Q(t,r,n,_,o+1,I),j(A,v,N,I,l,E,f,d,m,t,i),i=Q(t,r,n,_,o+2,M),j(A,v,N,M,l,E,f,d,m,t,i)}Z(e,y,h)}function $(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;l>t;t+=2){var d=o[t],m=o[t+1],_=a.fromArray(i,3*d,Me),h=a.fromArray(i,3*m,Oe);Math.abs(_.y)<R.EPSILON6&&(_.y<0?_.y=-R.EPSILON6:_.y=R.EPSILON6),Math.abs(h.y)<R.EPSILON6&&(h.y<0?h.y=-R.EPSILON6:h.y=R.EPSILON6);var y=u.attributes,p=u.indices,A=f,v=s.attributes,N=s.indices,S=E,I=T.lineSegmentPlane(_,h,Le,ge);if(c(I)){var M=a.multiplyByScalar(a.UNIT_Y,5*R.EPSILON9,Fe);_.y<0&&(a.negate(M,M),y=s.attributes,p=s.indices,A=E,v=u.attributes,N=u.indices,S=f);var O=a.add(I,M,Ue);Q(y,p,A,o,t,_),Q(y,p,A,o,-1,O),a.negate(M,M),a.add(I,M,O),Q(v,N,S,o,-1,O),Q(v,N,S,o,t+1,h)}else{var g,x,w;_.y<0?(g=s.attributes,x=s.indices,w=E):(g=u.attributes,x=u.indices,w=f),Q(g,x,w,o,t,_),Q(g,x,w,o,t+1,h)}}Z(e,s,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,d=s.expandAndWidth.values,m=c(s.st)?s.st.values:void 0,_=c(s.color)?s.color.values:void 0,h=K(u),y=K(u),p=l.length/3;for(t=0;p>t;t+=4){var A=t,v=t+1,N=t+2,S=t+3,I=a.fromArray(l,3*A,Be),M=a.fromArray(l,3*v,ze),O=a.fromArray(l,3*N,Ge),g=a.fromArray(l,3*S,Ve);Math.abs(I.y)<R.EPSILON6&&(I.y=R.EPSILON6*(O.y<0?-1:1),M.y=I.y),Math.abs(O.y)<R.EPSILON6&&(O.y=R.EPSILON6*(I.y<0?-1:1),g.y=O.y);var x=h.attributes,w=h.indices,C=y.attributes,P=y.indices,L=T.lineSegmentPlane(I,O,Le,qe);if(c(L)){var F=a.multiplyByScalar(a.UNIT_Y,5*R.EPSILON9,He);I.y<0&&(a.negate(F,F),x=y.attributes,w=y.indices,C=h.attributes,P=h.indices);var U=a.add(L,F,Xe);for(x.position.values.push(I.x,I.y,I.z,M.x,M.y,M.z),x.position.values.push(U.x,U.y,U.z),x.position.values.push(U.x,U.y,U.z),a.negate(F,F),a.add(L,F,U),C.position.values.push(U.x,U.y,U.z),C.position.values.push(U.x,U.y,U.z),C.position.values.push(O.x,O.y,O.z,g.x,g.y,g.z),r=3*A;3*A+6>r;++r)x.prevPosition.values.push(E[r]);for(x.prevPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),C.prevPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),r=3*N;3*N+6>r;++r)C.prevPosition.values.push(E[r]);for(r=3*A;3*A+6>r;++r)x.nextPosition.values.push(f[r]);for(x.nextPosition.values.push(O.x,O.y,O.z,O.x,O.y,O.z),C.nextPosition.values.push(O.x,O.y,O.z,O.x,O.y,O.z),r=3*N;3*N+6>r;++r)C.nextPosition.values.push(f[r]);var b=n.fromArray(d,2*A,be),D=Math.abs(b.y);x.expandAndWidth.values.push(-1,D,1,D),x.expandAndWidth.values.push(-1,-D,1,-D),C.expandAndWidth.values.push(-1,D,1,D),C.expandAndWidth.values.push(-1,-D,1,-D);var B=a.magnitudeSquared(a.subtract(L,I,Ve));if(B/=a.magnitudeSquared(a.subtract(O,I,Ve)),c(_)){var z=i.fromArray(_,4*A,We),G=i.fromArray(_,4*N,We),V=R.lerp(z.x,G.x,B),q=R.lerp(z.y,G.y,B),H=R.lerp(z.z,G.z,B),X=R.lerp(z.w,G.w,B);for(r=4*A;4*A+8>r;++r)x.color.values.push(_[r]);for(x.color.values.push(V,q,H,X),x.color.values.push(V,q,H,X),C.color.values.push(V,q,H,X),C.color.values.push(V,q,H,X),r=4*N;4*N+8>r;++r)C.color.values.push(_[r])}if(c(m)){var W=n.fromArray(m,2*A,be),Y=n.fromArray(m,2*(t+3),De),k=R.lerp(W.x,Y.x,B);for(r=2*A;2*A+4>r;++r)x.st.values.push(m[r]);for(x.st.values.push(k,W.y),x.st.values.push(k,Y.y),C.st.values.push(k,W.y),C.st.values.push(k,Y.y),r=2*N;2*N+4>r;++r)C.st.values.push(m[r])}o=x.position.values.length/3-4,w.push(o,o+2,o+1),w.push(o+1,o+2,o+3),o=C.position.values.length/3-4,P.push(o,o+2,o+1),P.push(o+1,o+2,o+3)}else{var j,Q;for(I.y<0?(j=y.attributes,Q=y.indices):(j=h.attributes,Q=h.indices),j.position.values.push(I.x,I.y,I.z),j.position.values.push(M.x,M.y,M.z),j.position.values.push(O.x,O.y,O.z),j.position.values.push(g.x,g.y,g.z),r=3*t;3*t+12>r;++r)j.prevPosition.values.push(E[r]),j.nextPosition.values.push(f[r]);for(r=2*t;2*t+8>r;++r)j.expandAndWidth.values.push(d[r]),c(m)&&j.st.values.push(m[r]);if(c(_))for(r=4*t;4*t+16>r;++r)j.color.values.push(_[r]);o=j.position.values.length/3-4,Q.push(o,o+2,o+1),Q.push(o+1,o+2,o+3)}}Z(e,y,h)}var te={};te.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=g(t);break;case S.TRIANGLE_FAN:e.indices=x(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}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),E=0,f=0;o>f;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=e.boundingSphere;return c(h)&&(_=new r(h.center,h.radius+n)),new d({attributes:{position:new m({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:_})},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;o>t;++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=d.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;t>a;a++)n[a]=-1;for(var i,o=r,s=o.length,l=y.createTypedArray(t,s),E=0,f=0,m=0;s>E;)i=n[o[E]],-1!==i?l[f]=i:(i=o[E],n[i]=m,l[f]=m,++m),++E,++f;e.indices=l;var _=e.attributes;for(var h in _)if(_.hasOwnProperty(h)&&c(_[h])&&c(_[h].values)){for(var p=_[h],T=p.values,R=0,A=p.componentsPerAttribute,v=u.createTypedArray(p.componentDatatype,m*A);t>R;){var N=n[R];if(-1!==N)for(a=0;A>a;a++)v[A*N+a]=T[A*R+a];++R}p.values=v}}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;n>i;i++)r[i]>a&&(a=r[i]);e.indices=I.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},te.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;l>E;E+=n){for(var f=0;n>f;++f){var m=s[E+f],_=a[m];c(_)||(_=o++,a[m]=_,C(u,e.attributes,m)),i.push(_)}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 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,E=o.values,d=new Float64Array(E.length),_=0,h=0;h<E.length;h+=3){var y=a.fromArray(E,h,re),p=s.cartesianToCartographic(y,ne);if(!c(p))throw new l("Could not project point ("+y.x+", "+y.y+", "+y.z+") to 2D.");var T=i.project(p,re);d[_++]=T.x,d[_++]=T.y,d[_++]=T.z}return e.attributes[r]=o,e.attributes[n]=new m({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:d}),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;o>l;++l)E.encode(i[l],ae),s[l]=ae.high,c[l]=ae.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 ie=new a,oe=new v,ue=new A;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),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;n>a;++a){var i=e[a];c(i.geometry)?t.push(i):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;i>E;E++)s[E]={indexOffset:0,count:0,currentCount:0};var f=0;for(E=0;o>E;E+=3){var d=t[E],_=t[E+1],h=t[E+2],y=3*d,p=3*_,T=3*h;le.x=n[y],le.y=n[y+1],le.z=n[y+2],Ee.x=n[p],Ee.y=n[p+1],Ee.z=n[p+2],fe.x=n[T],fe.y=n[T+1],fe.z=n[T+2],s[d].count++,s[_].count++,s[h].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;i>E;E++)s[E].indexOffset+=R,R+=s[E].count;f=0;var A;for(E=0;o>E;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;i>E;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 m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var de=new a,me=new a,_e=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,d;for(l=0;s>l;l+=3){var _=t[l],h=t[l+1],y=t[l+2];E=3*_,f=3*h,d=3*y;var p=2*_,T=2*h,R=2*y,A=r[E],v=r[E+1],N=r[E+2],S=i[p],I=i[p+1],M=i[T+1]-I,O=i[R+1]-I,g=1/((i[T]-S)*O-(i[R]-S)*M),x=(O*(r[f]-A)-M*(r[d]-A))*g,w=(O*(r[f+1]-v)-M*(r[d+1]-v))*g,C=(O*(r[f+2]-N)-M*(r[d+2]-N))*g;c[E]+=x,c[E+1]+=w,c[E+2]+=C,c[f]+=x,c[f+1]+=w,c[f+2]+=C,c[d]+=x,c[d+1]+=w,c[d+2]+=C}var P=new Float32Array(3*o),L=new Float32Array(3*o);for(l=0;o>l;l++){E=3*l,f=E+1,d=E+2;var F=a.fromArray(n,E,de),U=a.fromArray(c,E,_e),b=a.dot(F,U);a.multiplyByScalar(F,b,me),a.normalize(a.subtract(U,me,U),U),L[E]=U.x,L[f]=U.y,L[d]=U.z,a.normalize(a.cross(F,U,U),U),P[E]=U.x,P[f]=U.y,P[d]=U.z}return e.attributes.tangent=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e.attributes.binormal=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e};var he=new n,ye=new a,pe=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,d=t.attributes.binormal;c(r)&&(o=r.values),c(i)&&(s=i.values),c(f)&&(l=f.values),d&&(E=d.values);var _=c(o)?o.length:s.length,h=c(o)?3:2,y=_/h,p=y,T=c(s)&&c(o)?2:1;T+=c(l)||c(E)?1:0,p*=T;for(var R=new Float32Array(p),A=0,v=0;y>v;++v){c(s)&&(n.fromArray(s,2*v,he),R[A++]=e.compressTextureCoordinates(he));var N=3*v;c(o)&&c(l)&&c(E)?(a.fromArray(o,N,ye),a.fromArray(l,N,pe),a.fromArray(E,N,Te),e.octPack(ye,pe,Te,he),R[A++]=he.x,R[A++]=he.y):(c(o)&&(a.fromArray(o,N,ye),R[A++]=e.octEncodeFloat(ye)),c(l)&&(a.fromArray(l,N,ye),R[A++]=e.octEncodeFloat(ye)),c(E)&&(a.fromArray(E,N,ye),R[A++]=e.octEncodeFloat(ye)))}return t.attributes.compressedAttributes=new m({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,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,xe=new a,we=new n,Ce=new n,Pe=new n,Le=N.fromPointNormal(a.ZERO,a.UNIT_Y),Fe=new a,Ue=new a,be=new n,De=new n,Be=new a,ze=new a,Ge=new a,Ve=new a,qe=new a,He=new a,Xe=new a,We=new i;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,N.ORIGIN_ZX_PLANE)!==p.INTERSECTING)return e}if(t.geometryType!==h.NONE)switch(t.geometryType){case h.POLYLINES:ee(e);break;case h.TRIANGLES:J(e);break;case h.LINES:$(e)}else q(t),t.primitiveType===S.TRIANGLES?J(e):t.primitiveType===S.LINES&&$(e);return e},te}),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){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},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){return t(e)?(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):void 0},a}),define("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,d,m,_,h,y,p,T,R,A){"use strict";function v(e,n,i){var o=n.vertexFormat,u=n.center,c=n.semiMajorAxis,E=n.semiMinorAxis,m=n.ellipsoid,_=n.stRotation,h=i?e.length/3*2:e.length/3,y=o.st?new Float32Array(2*h):void 0,T=o.normal?new Float32Array(3*h):void 0,A=o.tangent?new Float32Array(3*h):void 0,v=o.binormal?new Float32Array(3*h):void 0,N=0,S=b,I=D,M=B,O=new l(m),g=O.project(m.cartesianToCartographic(u,z),G),P=m.scaleToGeodeticSurface(u,x);m.geodeticSurfaceNormal(P,P);for(var H=R.fromAxisAngle(P,_,U),X=p.fromQuaternion(H,F),W=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,V),Y=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,q),k=e.length,K=i?k:0,Z=K/3*2,j=0;k>j;j+=3){var Q=j+1,J=j+2,$=r.fromArray(e,j,x);if(o.st){var ee=p.multiplyByVector(X,$,w),te=O.project(m.cartesianToCartographic(ee,z),C);r.subtract(te,g,te),L.x=(te.x+c)/(2*c),L.y=(te.y+E)/(2*E),W.x=Math.min(L.x,W.x),W.y=Math.min(L.y,W.y),Y.x=Math.max(L.x,Y.x),Y.y=Math.max(L.y,Y.y),i&&(y[N+Z]=L.x,y[N+1+Z]=L.y),y[N++]=L.x,y[N++]=L.y}S=m.geodeticSurfaceNormal($,S),(o.normal||o.tangent||o.binormal)&&((o.tangent||o.binormal)&&(I=r.normalize(r.cross(r.UNIT_Z,S,I),I),p.multiplyByVector(X,I,I)),o.normal&&(T[j]=S.x,T[Q]=S.y,T[J]=S.z,i&&(T[j+K]=-S.x,T[Q+K]=-S.y,T[J+K]=-S.z)),o.tangent&&(A[j]=I.x,A[Q]=I.y,A[J]=I.z,i&&(A[j+K]=-I.x,A[Q+K]=-I.y,A[J+K]=-I.z)),o.binormal&&(M=r.normalize(r.cross(S,I,M),M),v[j]=M.x,v[Q]=M.y,v[J]=M.z,i&&(v[j+K]=M.x,v[Q+K]=M.y,v[J+K]=M.z)))}if(o.st){k=y.length;for(var re=0;k>re;re+=2)y[re]=(y[re]-W.x)/(Y.x-W.x),y[re+1]=(y[re+1]-W.y)/(Y.y-W.y)}var ne=new d;if(o.position){var ae=s.raisePositionsToHeight(e,n,i);ne.position=new f({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:ae})}return o.st&&(ne.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:y})),o.normal&&(ne.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:T})),o.tangent&&(ne.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:A})),o.binormal&&(ne.binormal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),ne}function N(e){var t,r,n,a,i,o=new Array(12*(e*(e+1))-6),u=0;for(t=0,n=1,a=0;3>a;a++)o[u++]=n++,o[u++]=t,o[u++]=n;for(a=2;e+1>a;++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;r-1>i;++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;r-1>a;++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;r-1>i;++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;3>a;a++)o[u++]=t++,o[u++]=t,o[u++]=n;return o}function S(t){var n=t.center;H=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(n,H),t.height,H),H=r.add(n,H,H);var a=new e(H,t.semiMajorAxis),i=s.computeEllipsePositions(t,!0,!1),o=i.positions,u=i.numPts,c=v(o,t,!1),l=N(u);return l=h.createTypedArray(o.length/3,l),{boundingSphere:a,attributes:c,indices:l}}function I(e,n){var i=n.vertexFormat,o=n.center,u=n.semiMajorAxis,s=n.semiMinorAxis,c=n.ellipsoid,E=n.height,m=n.extrudedHeight,_=n.stRotation,h=e.length/3*2,y=new Float64Array(3*h),T=i.st?new Float32Array(2*h):void 0,A=i.normal?new Float32Array(3*h):void 0,v=i.tangent?new Float32Array(3*h):void 0,N=i.binormal?new Float32Array(3*h):void 0,S=0,I=b,M=D,O=B,g=new l(c),H=g.project(c.cartesianToCartographic(o,z),G),X=c.scaleToGeodeticSurface(o,x);c.geodeticSurfaceNormal(X,X);for(var W=R.fromAxisAngle(X,_,U),Y=p.fromQuaternion(W,F),k=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,V),K=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,q),Z=e.length,j=Z/3*2,Q=0;Z>Q;Q+=3){var J,$=Q+1,ee=Q+2,te=r.fromArray(e,Q,x);if(i.st){var re=p.multiplyByVector(Y,te,w),ne=g.project(c.cartesianToCartographic(re,z),C);r.subtract(ne,H,ne),L.x=(ne.x+u)/(2*u),L.y=(ne.y+s)/(2*s),k.x=Math.min(L.x,k.x),k.y=Math.min(L.y,k.y),K.x=Math.max(L.x,K.x),K.y=Math.max(L.y,K.y),T[S+j]=L.x,T[S+1+j]=L.y,T[S++]=L.x,T[S++]=L.y}te=c.scaleToGeodeticSurface(te,te),J=r.clone(te,w),I=c.geodeticSurfaceNormal(te,I);var ae=r.multiplyByScalar(I,E,P);if(te=r.add(te,ae,te),ae=r.multiplyByScalar(I,m,ae),J=r.add(J,ae,J),i.position&&(y[Q+Z]=J.x,y[$+Z]=J.y,y[ee+Z]=J.z,y[Q]=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,(Q+3)%Z,P);r.subtract(ie,te,ie);var oe=r.subtract(J,te,C);I=r.normalize(r.cross(oe,ie,I),I),i.normal&&(A[Q]=I.x,A[$]=I.y,A[ee]=I.z,A[Q+Z]=I.x,A[$+Z]=I.y,A[ee+Z]=I.z),i.tangent&&(M=r.normalize(r.cross(O,I,M),M),v[Q]=M.x,v[$]=M.y,v[ee]=M.z,v[Q+Z]=M.x,v[Q+1+Z]=M.y,v[Q+2+Z]=M.z),i.binormal&&(N[Q]=O.x,N[$]=O.y,N[ee]=O.z,N[Q+Z]=O.x,N[$+Z]=O.y,N[ee+Z]=O.z)}}if(i.st){Z=T.length;for(var ue=0;Z>ue;ue+=2)T[ue]=(T[ue]-k.x)/(K.x-k.x),T[ue+1]=(T[ue+1]-k.y)/(K.y-k.y)}var se=new d;return i.position&&(se.position=new f({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:y})),i.st&&(se.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:T})),i.normal&&(se.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:A})),i.tangent&&(se.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),i.binormal&&(se.binormal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:N})),se}function M(e){for(var t=e.length/3,r=h.createTypedArray(t,6*t),n=0,a=0;t>a;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 O(t){var n=t.center,a=t.ellipsoid,i=t.semiMajorAxis,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,x),t.height,x);X.center=r.add(n,o,X.center),X.radius=i,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,o),t.extrudedHeight,o),W.center=r.add(n,o,W.center),W.radius=i;var u=s.computeEllipsePositions(t,!0,!0),c=u.positions,l=u.numPts,f=u.outerPositions,d=e.union(X,W),y=v(c,t,!0),p=N(l),R=p.length;p.length=2*R;for(var A=c.length/3,S=0;R>S;S+=3)p[S+R]=p[S+2]+A,p[S+1+R]=p[S+1]+A,p[S+2+R]=p[S]+A;var O=h.createTypedArray(2*A/3,p),g=new E({attributes:y,indices:O,primitiveType:T.TRIANGLES}),w=I(f,t);p=M(f);var C=h.createTypedArray(2*f.length/3,p),P=new E({attributes:w,indices:C,primitiveType:T.TRIANGLES}),L=_.combineInstances([new m({geometry:g}),new m({geometry:P})]);return{boundingSphere:d,attributes:L[0].attributes,indices:L[0].indices}}function g(e){e=i(e,i.EMPTY_OBJECT);var t=e.center,n=i(e.ellipsoid,c.WGS84),a=e.semiMajorAxis,u=e.semiMinorAxis,s=i(e.granularity,y.RADIANS_PER_DEGREE),l=i(e.height,0),E=e.extrudedHeight,f=o(E)&&Math.abs(l-E)>1,d=i(e.vertexFormat,A.DEFAULT);this._center=r.clone(t),this._semiMajorAxis=a,this._semiMinorAxis=u,this._ellipsoid=c.clone(n),this._rotation=i(e.rotation,0),this._stRotation=i(e.stRotation,0),this._height=l,this._granularity=s,this._vertexFormat=A.clone(d),this._extrudedHeight=i(E,l),this._extrude=f,this._workerName="createEllipseGeometry"}var x=new r,w=new r,C=new r,P=new r,L=new t,F=new p,U=new R,b=new r,D=new r,B=new r,z=new n,G=new r,V=new t,q=new t,H=new r,X=new e,W=new e;g.packedLength=r.packedLength+c.packedLength+A.packedLength+8,g.pack=function(e,t,n){n=i(n,0),r.pack(e._center,t,n),n+=r.packedLength,c.pack(e._ellipsoid,t,n),n+=c.packedLength,A.pack(e._vertexFormat,t,n),n+=A.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};var Y=new r,k=new c,K=new A,Z={center:Y,ellipsoid:k,vertexFormat:K,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0};return g.unpack=function(e,t,n){t=i(t,0);var a=r.unpack(e,t,Y);t+=r.packedLength;var u=c.unpack(e,t,k);t+=c.packedLength;var s=A.unpack(e,t,K);t+=A.packedLength;var l=e[t++],E=e[t++],f=e[t++],d=e[t++],m=e[t++],_=e[t++],h=e[t++],y=1===e[t];return o(n)?(n._center=r.clone(a,n._center),n._ellipsoid=c.clone(u,n._ellipsoid),n._vertexFormat=A.clone(s,n._vertexFormat),n._semiMajorAxis=l,n._semiMinorAxis=E,n._rotation=f,n._stRotation=d,n._height=m,n._granularity=_,n._extrudedHeight=h,n._extrude=y,n):(Z.height=m,Z.extrudedHeight=h,Z.granularity=_,Z.stRotation=d,Z.rotation=f,Z.semiMajorAxis=l,Z.semiMinorAxis=E,new g(Z))},g.createGeometry=function(e){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=O(r)):t=S(r),new E({attributes:t.attributes,indices:t.indices,primitiveType:T.TRIANGLES,boundingSphere:t.boundingSphere})},g.createShadowVolume=function(e,t,r){var n=e._granularity,a=e._ellipsoid,i=t(n,a),o=r(n,a);return new g({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:a,stRotation:e._stRotation,granularity:n,extrudedHeight:i,height:o,vertexFormat:A.POSITION_ONLY})},g}),define("Core/CircleGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipseGeometry","./Ellipsoid","./Math","./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 a(n),this._workerName="createCircleGeometry"}s.packedLength=a.packedLength,s.pack=function(e,t,r){a.pack(e._ellipseGeometry,t,r)};var c=new a({center:new e,semiMajorAxis:1,semiMinorAxis:1}),l={center:new e,radius:void 0,ellipsoid:i.clone(i.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,o){var E=a.unpack(t,n,c);return l.center=e.clone(E._center,l.center),l.ellipsoid=i.clone(E._ellipsoid,l.ellipsoid),l.height=E._height,l.extrudedHeight=E._extrudedHeight,l.granularity=E._granularity,l.vertexFormat=u.clone(E._vertexFormat,l.vertexFormat),l.stRotation=E._stRotation,r(o)?(l.semiMajorAxis=E._semiMajorAxis,l.semiMinorAxis=E._semiMinorAxis,o._ellipseGeometry=new a(l),o):(l.radius=E._semiMajorAxis,new s(l))},s.createGeometry=function(e){return a.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})},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 diff --git a/Workers/createCircleOutlineGeometry.js b/Workers/createCircleOutlineGeometry.js index f42041a..a1656c1 100644 --- a/Workers/createCircleOutlineGeometry.js +++ b/Workers/createCircleOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -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";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(n){t=n.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:0>e?-1:0},n.signNotZero=function(e){return 0>e?-1:1},n.toSNorm=function(e){return Math.round(255*(.5*n.clamp(e,-1,1)+.5))},n.fromSNorm=function(e){return 2*(n.clamp(e,0,255)/255)-1},n.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},n.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},n.lerp=function(e,t,n){return(1-n)*e+n*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=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){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,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},n.negativePiToPi=function(e){for(var t=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+t)>e;)e+=i;if(-r>e)return-r;for(;e>r+t;)e-=i;return e>r?r:e},n.zeroToTwoPi=function(e){var t=e%n.TWO_PI;return 0>t?(t+n.TWO_PI)%n.TWO_PI:t},n.equalsEpsilon=function(e,n,r){return r=t(r,0),Math.abs(e-n)<=r};var r=[1];n.factorial=function(e){var t=r.length;if(e>=t)for(var n=r[t-1],i=t;e>=i;i++)r.push(n*i);return r[e]},n.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(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,n){return t>e?t:e>n?n:e};var i=new e;return n.setRandomNumberSeed=function(t){i=new e(t)},n.nextRandomNumber=function(){return i.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}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";var a=function(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)};a.fromSpherical=function(n,r){t(r)||(r=new a);var i=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(e,n,r,i){return t(i)?(i.x=e,i.y=n,i.z=r,i):new a(e,n,r)},a.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new a(e.x,e.y,e.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(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},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var u=new a;a.lerp=function(e,t,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){a.normalize(e,s),a.normalize(t,c);var n=a.dot(s,c),r=a.magnitude(a.cross(s,c,s));return Math.atan2(r,n)};var l=new a;a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,l);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):n.y<=n.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,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},a.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r&&Math.abs(e.z-n.z)<=r},a.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,h=r*u-i*o;return n.x=c,n.y=l,n.z=h,n},a.fromDegrees=function(e,t,n,r,o){var u=i.toRadians(e),s=i.toRadians(t);return a.fromRadians(u,s,n,r,o)};var h=new a,f=new a,d=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=e(i,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(r);h.x=c*Math.cos(n),h.y=c*Math.sin(n),h.z=Math.sin(r),h=a.normalize(h,h),a.multiplyComponents(s,h,f);var l=Math.sqrt(a.dot(h,f));return f=a.divideByScalar(f,l,f),h=a.multiplyByScalar(h,i,h),t(u)||(u=new a),a.add(f,h,u)},a.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=i.toRadians(e[o]);return a.fromRadiansArray(r,t,n)},a.fromRadiansArray=function(e,n,r){var i=e.length;t(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=a.fromRadians(u,s,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=i.toRadians(e[o]),r[o+1]=i.toRadians(e[o+1]),r[o+2]=e[o+2];return a.fromRadiansArrayHeights(r,t,n)},a.fromRadiansArrayHeights=function(e,n,r){var i=e.length;t(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=a.fromRadians(u,s,c,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";var a=function(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)};return a.fromRadians=function(n,r,i,o){return i=e(i,0),t(o)?(o.longitude=n,o.latitude=r,o.height=i,o):new a(n,r,i)},a.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),a.fromRadians(e,t,n,r)},a.clone=function(e,n){return t(e)?t(n)?(n.longitude=e.longitude,n.latitude=e.latitude,n.height=e.height,n):new a(e.longitude,e.latitude,e.height):void 0},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.longitude===n.longitude&&e.latitude===n.latitude&&e.height===n.height},a.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.longitude-n.longitude)<=r&&Math.abs(e.latitude-n.latitude)<=r&&Math.abs(e.height-n.height)<=r},a.ZERO=r(new a(0,0,0)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"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}var c=function(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,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))return void 0;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.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),c=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,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 l=new e,h=new e;c.prototype.cartographicToCartesian=function(t,n){var i=l,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)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;n>i;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var f=new e,d=new e,y=new e;c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,d);if(!r(a))return void 0;var o=this.geodeticSurfaceNormal(a,f),s=e.subtract(n,a,y),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),h=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=c,i.latitude=l,i.height=h,i):new t(c,l,h)},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;n>i;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};var m=new e,p=new e;return c.prototype.scaleToGeodeticSurface=function(t,n){var i=t.x,a=t.y,o=t.z,s=this._oneOverRadii,c=s.x,l=s.y,h=s.z,f=i*i*c*c,d=a*a*l*l,y=o*o*h*h,w=f+d+y,v=Math.sqrt(1/w),x=e.multiplyByScalar(t,v,m);if(w<this._centerToleranceSquared)return isFinite(v)?e.clone(x,n):void 0;var g=this._oneOverRadiiSquared,E=g.x,M=g.y,z=g.z,S=p;S.x=2*x.x*E,S.y=2*x.y*M,S.z=2*x.z*z;var O,_,T,I,N,R,b,A,P,C,L,U=(1-v)*e.magnitude(t)/(.5*e.magnitude(S)),q=0;do{U-=q,T=1/(1+U*E),I=1/(1+U*M),N=1/(1+U*z),R=T*T,b=I*I,A=N*N,P=R*T,C=b*I,L=A*N,O=f*R+d*b+y*A-1,_=f*P*E+d*C*M+y*L*z;var B=-2*_;q=O/B}while(Math.abs(O)>u.EPSILON12);return r(n)?(n.x=i*T,n.y=a*I,n.z=o*N,n):new e(i*T,a*I,o*N)},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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";var u=function(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";var t=function(t,n){this.start=e(t,0),this.stop=e(n,0)};return t}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";var i=function(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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 a=new i;i.distance=function(e,t){return i.subtract(e,t,a),i.magnitude(a)},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.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 o=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,o),r=i.multiplyByScalar(e,1-n,r),i.add(o,r,r)};var u=new i;return i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,u);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.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r&&Math.abs(e.z-n.z)<=r&&Math.abs(e.w-n.w)<=r},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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function u(e){for(var t=0,n=0;3>n;++n){var r=e[c.getElementIndex(d[n],f[n])];t+=2*r*r}return Math.sqrt(t)}function s(e,t){for(var n=a.EPSILON15,r=0,i=1,o=0;3>o;++o){var u=Math.abs(e[c.getElementIndex(d[o],f[o])]);u>r&&(i=o,r=u)}var s=1,l=0,h=f[i],y=d[i];if(Math.abs(e[c.getElementIndex(y,h)])>n){var m,p=e[c.getElementIndex(y,y)],w=e[c.getElementIndex(h,h)],v=e[c.getElementIndex(y,h)],x=(p-w)/2/v;m=0>x?-1/(-x+Math.sqrt(1+x*x)):1/(x+Math.sqrt(1+x*x)),s=1/Math.sqrt(1+m*m),l=m*s}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(h,h)]=t[c.getElementIndex(y,y)]=s,t[c.getElementIndex(y,h)]=l,t[c.getElementIndex(h,y)]=-l,t}var c=function(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)};c.clone=function(e,t){return n(e)?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 c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,r,i){return r=t(r,0),n(i)||(i=new c),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},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var r=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,l=e.y*e.w,h=e.z*e.z,f=e.z*e.w,d=e.w*e.w,y=r-u-h+d,m=2*(i-f),p=2*(a+l),w=2*(i+f),v=-r+u-h+d,x=2*(s-o),g=2*(a-l),E=2*(s+o),M=-r-u+h+d;return n(t)?(t[0]=y,t[1]=w,t[2]=g,t[3]=m,t[4]=v,t[5]=E,t[6]=p,t[7]=x,t[8]=M,t):new c(y,m,p,w,v,x,g,E,M)},c.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 c(e.x,0,0,0,e.y,0,0,0,e.z)},c.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 c(e,0,0,0,e,0,0,0,e)},c.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 c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.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 c(1,0,0,0,r,-i,0,i,r)},c.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 c(r,0,i,0,1,0,-i,0,r)},c.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 c(r,-i,0,i,r,0,0,0,1)},c.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]]},c.getElementIndex=function(e,t){return 3*e+t},c.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},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},c.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},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,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[3],t[4],t[5],l)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),n};var h=new e;c.getMaximumScale=function(t){return c.getScale(t,h),e.maximumComponent(h)},c.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],h=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]=h,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},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},c.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},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},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},c.transpose=function(e,t){var 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 f=[1,0,0],d=[2,2,1],y=new c,m=new c;return c.computeEigenDecomposition=function(e,t){var r=a.EPSILON20,i=10,l=0,h=0;n(t)||(t={});for(var f=t.unitary=c.clone(c.IDENTITY,t.unitary),d=t.diagonal=c.clone(e,t.diagonal),p=r*o(d);i>h&&u(d)>p;)s(d,y),c.transpose(y,m),c.multiply(d,y,d),c.multiply(m,d,d),c.multiply(f,y,f),++l>2&&(++h,l=0);return t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},c.determinant=function(e){var t=e[0],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)},c.inverse=function(e,t){var n=e[0],i=e[1],o=e[2],u=e[3],s=e[4],l=e[5],h=e[6],f=e[7],d=e[8],y=c.determinant(e);if(Math.abs(y)<=a.EPSILON15)throw new r("matrix is not invertible");t[0]=s*d-f*l,t[1]=f*o-i*d,t[2]=i*l-s*o,t[3]=h*l-u*d,t[4]=n*d-h*o,t[5]=u*o-n*l,t[6]=u*f-h*s,t[7]=h*i-n*f,t[8]=n*s-u*i;var m=1/y;return c.multiplyByScalar(t,m,t)},c.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]},c.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},c.IDENTITY=i(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(n){t=n.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s){"use strict";var c=function(e,t,r,i,a,o,u,s,c,l,h,f,d,y,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(y,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(h,0),this[11]=n(m,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(p,0)};c.packedLength=16,c.pack=function(e,t,r){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]},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){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new 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]):void 0},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,l=t.x*t.y,h=t.x*t.z,f=t.x*t.w,d=t.y*t.y,y=t.y*t.z,m=t.y*t.w,p=t.z*t.z,w=t.z*t.w,v=t.w*t.w,x=s-d-p+v,g=2*(l-w),E=2*(h+m),M=2*(l+w),z=-s+d-p+v,S=2*(y-f),O=2*(h-m),_=2*(y+f),T=-s-d+p+v;return i[0]=x*a,i[1]=M*a,i[2]=O*a,i[3]=0,i[4]=g*o,i[5]=z*o,i[6]=_*o,i[7]=0,i[8]=E*u,i[9]=S*u,i[10]=T*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.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 l=new e,h=new e,f=new e;c.fromCamera=function(t,n){var i=t.eye,a=t.target,o=t.up;e.normalize(e.subtract(a,i,l),l),e.normalize(e.cross(l,o,h),h),e.normalize(e.cross(h,l,f),f);var u=h.x,s=h.y,d=h.z,y=l.x,m=l.y,p=l.z,w=f.x,v=f.y,x=f.z,g=i.x,E=i.y,M=i.z,z=u*-g+s*-E+d*-M,S=w*-g+v*-E+x*-M,O=y*g+m*E+p*M;return r(n)?(n[0]=u,n[1]=w,n[2]=-y,n[3]=0,n[4]=s,n[5]=v,n[6]=-m,n[7]=0,n[8]=d,n[9]=x,n[10]=-p,n[11]=0,n[12]=z,n[13]=S,n[14]=O,n[15]=1,n):new c(u,s,d,z,w,v,x,S,-y,-m,-p,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),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},c.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,h=-(r+n)*s,f=-(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]=h,o[14]=f,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),c=(t+e)/(t-e),l=(r+n)/(r-n),h=-(a+i)/(a-i),f=-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]=h,o[11]=f,o[12]=0,o[13]=0,o[14]=d,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),c=(r+n)/(r-n),l=-1,h=-1,f=-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]=h,a[12]=0,a[13]=0,a[14]=f,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 c=.5*u,l=.5*s,h=.5*(r-t),f=c,d=l,y=h,m=a+c,p=o+l,w=t+h,v=1;return i[0]=f,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]=y,i[11]=0,i[12]=m,i[13]=p,i[14]=w,i[15]=v,i},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.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 d=new e;c.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 y=new e;c.getMaximumScale=function(t){return c.getScale(t,y),e.maximumComponent(y)},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],c=e[6],l=e[7],h=e[8],f=e[9],d=e[10],y=e[11],m=e[12],p=e[13],w=e[14],v=e[15],x=t[0],g=t[1],E=t[2],M=t[3],z=t[4],S=t[5],O=t[6],_=t[7],T=t[8],I=t[9],N=t[10],R=t[11],b=t[12],A=t[13],P=t[14],C=t[15],L=r*x+u*g+h*E+m*M,U=i*x+s*g+f*E+p*M,q=a*x+c*g+d*E+w*M,B=o*x+l*g+y*E+v*M,D=r*z+u*S+h*O+m*_,F=i*z+s*S+f*O+p*_,G=a*z+c*S+d*O+w*_,W=o*z+l*S+y*O+v*_,V=r*T+u*I+h*N+m*R,Y=i*T+s*I+f*N+p*R,j=a*T+c*I+d*N+w*R,k=o*T+l*I+y*N+v*R,H=r*b+u*A+h*P+m*C,Z=i*b+s*A+f*P+p*C,X=a*b+c*A+d*P+w*C,K=o*b+l*A+y*P+v*C;return n[0]=L,n[1]=U,n[2]=q,n[3]=B,n[4]=D,n[5]=F,n[6]=G,n[7]=W,n[8]=V,n[9]=Y,n[10]=j,n[11]=k,n[12]=H,n[13]=Z,n[14]=X,n[15]=K,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],c=e[8],l=e[9],h=e[10],f=e[12],d=e[13],y=e[14],m=t[0],p=t[1],w=t[2],v=t[4],x=t[5],g=t[6],E=t[8],M=t[9],z=t[10],S=t[12],O=t[13],_=t[14],T=r*m+o*p+c*w,I=i*m+u*p+l*w,N=a*m+s*p+h*w,R=r*v+o*x+c*g,b=i*v+u*x+l*g,A=a*v+s*x+h*g,P=r*E+o*M+c*z,C=i*E+u*M+l*z,L=a*E+s*M+h*z,U=r*S+o*O+c*_+f,q=i*S+u*O+l*_+d,B=a*S+s*O+h*_+y;return n[0]=T,n[1]=I,n[2]=N,n[3]=0,n[4]=R,n[5]=b,n[6]=A,n[7]=0,n[8]=P,n[9]=C,n[10]=L,n[11]=0,n[12]=U,n[13]=q,n[14]=B,n[15]=1,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 m=new e;c.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,c.multiplyByScale(e,m,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,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},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[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]},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 p=new u,w=new u,v=new t,x=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,p),w,o.EPSILON7)&&t.equals(c.getRow(e,3,v),x))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],l=e[12],h=e[1],f=e[5],d=e[9],y=e[13],m=e[2],g=e[6],E=e[10],M=e[14],z=e[3],S=e[7],O=e[11],_=e[15],T=E*_,I=M*O,N=g*_,R=M*S,b=g*O,A=E*S,P=m*_,C=M*z,L=m*O,U=E*z,q=m*S,B=g*z,D=T*f+R*d+b*y-(I*f+N*d+A*y),F=I*h+P*d+U*y-(T*h+C*d+L*y),G=N*h+C*f+q*y-(R*h+P*f+B*y),W=A*h+L*f+B*d-(b*h+U*f+q*d),V=I*i+N*a+A*l-(T*i+R*a+b*l),Y=T*r+C*a+L*l-(I*r+P*a+U*l),j=R*r+P*i+B*l-(N*r+C*i+q*l),k=b*r+U*i+q*a-(A*r+L*i+B*a);T=a*y,I=l*d,N=i*y,R=l*f,b=i*d,A=a*f,P=r*y,C=l*h,L=r*d,U=a*h,q=r*f,B=i*h;var H=T*S+R*O+b*_-(I*S+N*O+A*_),Z=I*z+P*O+U*_-(T*z+C*O+L*_),X=N*z+C*S+q*_-(R*z+P*S+B*_),K=A*z+L*S+B*O-(b*z+U*S+q*O),J=N*E+A*M+I*g-(b*M+T*g+R*E),Q=L*M+T*m+C*E-(P*E+U*M+I*m),$=P*g+B*M+R*m-(q*M+N*m+C*g),et=q*E+b*m+U*g-(L*g+B*E+A*m),tt=r*D+i*F+a*G+l*W;if(Math.abs(tt)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return tt=1/tt,n[0]=D*tt,n[1]=F*tt,n[2]=G*tt,n[3]=W*tt,n[4]=V*tt,n[5]=Y*tt,n[6]=j*tt,n[7]=k*tt,n[8]=H*tt,n[9]=Z*tt,n[10]=X*tt,n[11]=K*tt,n[12]=J*tt,n[13]=Q*tt,n[14]=$*tt,n[15]=et*tt,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],c=e[9],l=e[10],h=e[12],f=e[13],d=e[14],y=-n*h-r*f-i*d,m=-a*h-o*f-u*d,p=-s*h-c*f-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]=y,t[13]=m,t[14]=p,t[15]=1,t},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o){"use strict";var u=function(e,n,r,i){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(i,0)};u.fromDegrees=function(e,r,i,a,s){return e=o.toRadians(t(e,0)),r=o.toRadians(t(r,0)),i=o.toRadians(t(i,0)),a=o.toRadians(t(a,0)),n(s)?(s.west=e,s.south=r,s.east=i,s.north=a,s):new u(e,r,i,a)},u.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=e.length;c>s;s++){var l=e[s];r=Math.min(r,l.longitude),i=Math.max(i,l.longitude),a=Math.min(a,l.latitude),o=Math.max(o,l.latitude)}return n(t)?(t.west=r,t.south=a,t.east=i,t.north=o,t):new u(r,a,i,o)},u.packedLength=4,u.pack=function(e,n,r){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},u.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i.west=e[r++],i.south=e[r++],i.east=e[r++],i.north=e[r],i},u.clone=function(e,t){return n(e)?n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.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},u.validate=function(){},u.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)},u.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)},u.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)},u.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)},u.center=function(t,r){var i=t.east,a=t.west,u=.5*(a+i);return a>i&&(u=o.negativePiToPi(u+o.PI)),n(r)?(r.longitude=u,r.latitude=.5*(t.south+t.north),r.height=0,r):new e(u,.5*(t.south+t.north))},u.intersectWith=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),s=Math.min(e.north,t.north);return n(r)?(r.west=i,r.south=a,r.east=o,r.north=s,r):new u(i,a,o,s)},u.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},u.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var s=new e;return u.subsample=function(e,r,a,u){r=t(r,i.WGS84),a=t(a,0),n(u)||(u=[]);var c=0,l=e.north,h=e.south,f=e.east,d=e.west,y=s;y.height=a,y.longitude=d,y.latitude=l,u[c]=r.cartographicToCartesian(y,u[c]),c++,y.longitude=f,u[c]=r.cartographicToCartesian(y,u[c]),c++,y.latitude=h,u[c]=r.cartographicToCartesian(y,u[c]),c++,y.longitude=d,u[c]=r.cartographicToCartesian(y,u[c]),c++,y.latitude=0>l?l:h>0?h:0;for(var m=1;8>m;++m){var p=-Math.PI+m*o.PI_OVER_TWO;p>d&&f>p&&(y.longitude=p,u[c]=r.cartographicToCartesian(y,u[c]),c++)}return 0===y.latitude&&(y.longitude=d,u[c]=r.cartographicToCartesian(y,u[c]),c++,y.longitude=f,u[c]=r.cartographicToCartesian(y,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,c,l){"use strict";var h=function(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)},f=new e,d=new e,y=new e,m=new e,p=new e,w=new e,v=new e,x=new e,g=new e,E=new e,M=new e,z=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],v),a=e.clone(i,f),o=e.clone(i,d),u=e.clone(i,y),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,w),S=t.length,O=1;S>O;O++){e.clone(t[O],i);var _=i.x,T=i.y,I=i.z;_<a.x&&e.clone(i,a),_>s.x&&e.clone(i,s),T<o.y&&e.clone(i,o),T>c.y&&e.clone(i,c),I<u.z&&e.clone(i,u),I>l.z&&e.clone(i,l)}var N=e.magnitudeSquared(e.subtract(s,a,x)),R=e.magnitudeSquared(e.subtract(c,o,x)),b=e.magnitudeSquared(e.subtract(l,u,x)),A=a,P=s,C=N;R>C&&(C=R,A=o,P=c),b>C&&(C=b,A=u,P=l);var L=g;L.x=.5*(A.x+P.x),L.y=.5*(A.y+P.y),L.z=.5*(A.z+P.z);var U=e.magnitudeSquared(e.subtract(P,L,x)),q=Math.sqrt(U),B=E;B.x=a.x,B.y=o.y,B.z=u.z;var D=M;D.x=s.x,D.y=c.y,D.z=l.z;var F=e.multiplyByScalar(e.add(B,D,x),.5,z),G=0;for(O=0;S>O;O++){e.clone(t[O],i);var W=e.magnitude(e.subtract(i,F,x));W>G&&(G=W);var V=e.magnitudeSquared(e.subtract(i,L,x));if(V>U){var Y=Math.sqrt(V);q=.5*(q+Y),U=q*q;var j=Y-q;L.x=(q*L.x+j*i.x)/Y,L.y=(q*L.y+j*i.y)/Y,L.z=(q*L.z+j*i.z)/Y}}return G>q?(e.clone(L,n.center),n.radius=q):(e.clone(F,n.center),n.radius=G),n};var S=new o,O=new e,_=new e,T=new t,I=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,S),l.southwest(t,T),T.height=a,l.northeast(t,I),I.height=o;var s=i.project(T,O),c=i.project(I,_),f=c.x-s.x,d=c.y-s.y,y=c.z-s.z;u.radius=.5*Math.sqrt(f*f+d*d+y*y);var m=u.center;return m.x=s.x+.5*f,m.y=s.y+.5*d,m.z=s.z+.5*y,u};var N=[];h.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,N)),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=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,f),c=e.clone(u,d),l=e.clone(u,y),S=e.clone(u,m),O=e.clone(u,p),_=e.clone(u,w),T=t.length,I=0;T>I;I+=a){var N=t[I]+i.x,R=t[I+1]+i.y,b=t[I+2]+i.z;u.x=N,u.y=R,u.z=b,N<s.x&&e.clone(u,s),N>S.x&&e.clone(u,S),R<c.y&&e.clone(u,c),R>O.y&&e.clone(u,O),b<l.z&&e.clone(u,l),b>_.z&&e.clone(u,_)}var A=e.magnitudeSquared(e.subtract(S,s,x)),P=e.magnitudeSquared(e.subtract(O,c,x)),C=e.magnitudeSquared(e.subtract(_,l,x)),L=s,U=S,q=A;P>q&&(q=P,L=c,U=O),C>q&&(q=C,L=l,U=_);var B=g;B.x=.5*(L.x+U.x),B.y=.5*(L.y+U.y),B.z=.5*(L.z+U.z);var D=e.magnitudeSquared(e.subtract(U,B,x)),F=Math.sqrt(D),G=E;G.x=s.x,G.y=c.y,G.z=l.z;var W=M;W.x=S.x,W.y=O.y,W.z=_.z;var V=e.multiplyByScalar(e.add(G,W,x),.5,z),Y=0;for(I=0;T>I;I+=a){u.x=t[I]+i.x,u.y=t[I+1]+i.y,u.z=t[I+2]+i.z;var j=e.magnitude(e.subtract(u,V,x));j>Y&&(Y=j);var k=e.magnitudeSquared(e.subtract(u,B,x));if(k>D){var H=Math.sqrt(k);F=.5*(F+H),D=F*F;var Z=H-F;B.x=(F*B.x+Z*u.x)/H,B.y=(F*B.y+Z*u.y)/H,B.z=(F*B.z+Z*u.z)/H}}return Y>F?(e.clone(B,o.center),o.radius=F):(e.clone(V,o.center),o.radius=Y),o},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},h.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius):void 0},h.packedLength=4,h.pack=function(e,t,r){r=n(r,0);var i=e.center;t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius},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 R=new e,b=new e;h.union=function(t,n,i){r(i)||(i=new h);var a=t.center,o=n.center;e.add(a,o,b);var u=e.multiplyByScalar(b,.5,b),s=e.magnitude(e.subtract(a,u,R))+t.radius,c=e.magnitude(e.subtract(o,u,R))+n.radius;return i.radius=Math.max(s,c),e.clone(u,i.center),i};var A=new e;h.expand=function(t,n,r){r=h.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,A));return i>r.radius&&(r.radius=i),r},h.intersect=function(t,n){var r=t.center,i=t.radius,a=e.dot(n,r)+n.w;return-i>a?u.OUTSIDE:i>a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return r(n)||(n=new h),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var P=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,P);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return r(n)||(n=new h),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var C=new e;h.computePlaneDistances=function(t,n,i,a){r(a)||(a=new s);var o=e.subtract(t.center,n,C),u=e.multiplyByScalar(i,e.dot(i,o),C),c=e.magnitude(u);return a.start=c-t.radius,a.stop=c+t.radius,a};for(var L=new e,U=new e,q=new e,B=new e,D=new e,F=new t,G=new Array(8),W=0;8>W;++W)G[W]=new e;var V=new o;return h.projectTo2D=function(t,r,i){r=n(r,V);var a=r.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,L),c=e.cross(e.UNIT_Z,s,U);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 f=e.negate(l,D),d=e.negate(c,B),y=G,m=y[0];e.add(s,l,m),e.add(m,c,m),m=y[1],e.add(s,l,m),e.add(m,d,m),m=y[2],e.add(s,f,m),e.add(m,d,m),m=y[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=y[4],e.add(s,l,m),e.add(m,c,m),m=y[5],e.add(s,l,m),e.add(m,d,m),m=y[6],e.add(s,f,m),e.add(m,d,m),m=y[7],e.add(s,f,m),e.add(m,c,m);for(var p=y.length,w=0;p>w;++w){var v=y[w];e.add(o,v,v);var x=a.cartesianToCartographic(v,F);r.project(x,v)}i=h.fromPoints(y,i),o=i.center;var g=o.x,E=o.y,M=o.z;return o.x=M,o.y=g,o.z=E,i},h.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersect=function(e){return h.intersect(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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++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",e(document[i])?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",e(document[i])&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",e(document[i])?r.fullscreenElement=i:(i=s+"FullScreenElement",e(document[i])&&(r.fullscreenElement=i)),i=s+"fullscreenchange",e(document["on"+i])&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",e(document["on"+i])&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e){i.supportsFullscreen()&&e[r.requestFullscreen]()},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;r>n;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(y)){y=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(y=!0,m=r(e[1]))}return y}function a(){return i()&&m}function o(){if(!t(p)&&(p=!1,!i()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(p=!0,w=r(e[1]))}return p}function u(){return o()&&w}function s(){if(!t(v)){v=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(v=!0,x=r(e[1]),x.isNightly=!!e[2])}return v}function c(){return s()&&x}function l(){if(!t(g)){g=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(g=!0,E=r(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(g=!0,E=r(e[1])))}return g}function h(){return l()&&E}function f(){if(!t(M)){M=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(M=!0,z=r(e[1]))}return M}function d(){return f()&&z}var y,m,p,w,v,x,g,E,M,z,S={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:h,isFirefox:f,firefoxVersion:d,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};return S.supportsFullscreen=function(){return n.supportsFullscreen()},S.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},S.supportsWebWorkers=function(){return"undefined"!=typeof Worker},S}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,i){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return t(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(t,r,i,o){switch(i=e(i,0),o=e(o,(r.byteLength-i)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(r,i,o);case a.UNSIGNED_BYTE:return new Uint8Array(r,i,o);case a.SHORT:return new Int16Array(r,i,o);case a.UNSIGNED_SHORT:return new Uint16Array(r,i,o);case a.FLOAT:return new Float32Array(r,i,o);case a.DOUBLE:return new Float64Array(r,i,o);default:throw new n("componentDatatype is not a valid value.")}},i(a)}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,i,a,o,u){"use strict";var s=function(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)},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,h=c.z*o,f=Math.cos(a);return n(i)?(i.x=u,i.y=l,i.z=h,i.w=f,i):new s(u,l,h,f)};var l=[1,2,0],h=new Array(3);s.fromRotationMatrix=function(e,t){var r,i,a,o,c,f=e[u.COLUMN0ROW0],d=e[u.COLUMN1ROW1],y=e[u.COLUMN2ROW2],m=f+d+y;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,w=0;d>f&&(w=1),y>f&&y>d&&(w=2);var v=p[w],x=p[v];r=Math.sqrt(e[u.getElementIndex(w,w)]-e[u.getElementIndex(v,v)]-e[u.getElementIndex(x,x)]+1);var g=h;g[w]=.5*r,r=.5/r,c=(e[u.getElementIndex(x,v)]-e[u.getElementIndex(v,x)])*r,g[v]=(e[u.getElementIndex(v,w)]+e[u.getElementIndex(w,v)])*r,g[x]=(e[u.getElementIndex(x,w)]+e[u.getElementIndex(w,x)])*r,i=-g[0],a=-g[1],o=-g[2]}return n(t)?(t.x=i,t.y=a,t.z=o,t.w=c,t):new s(i,a,o,c)};var f=new e,d=new e,y=new s,m=new s,p=new s;s.packedLength=4,s.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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;a>i;i++){var o=3*i;s.unpack(e,4*(t+i),y),s.multiply(y,p,y),y.w<0&&s.negate(y,y),s.computeAxis(y,f);var u=s.computeAngle(y);r[o]=f.x*u,r[o+1]=f.y*u,r[o+2]=f.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,m),0===u?s.clone(s.IDENTITY,y):s.fromAxisAngle(d,u,y),s.multiply(y,m,o)},s.clone=function(e,t){return n(e)?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):void 0},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,h=o*u+r*l+i*c-a*s,f=o*s-r*c+i*l+a*u,d=o*c+r*s-i*u+a*l,y=o*l-r*u-i*s-a*c;return n.x=h,n.y=f,n.z=d,n.w=y,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 w=new s;s.lerp=function(e,t,n,r){return w=s.multiplyByScalar(t,n,w),r=s.multiplyByScalar(e,1-n,r),s.add(w,r,r)};var v=new s,x=new s,g=new s;s.slerp=function(e,t,n,r){var i=s.dot(e,t),a=t;if(0>i&&(i=-i,a=v=s.negate(t,v)),1-i<o.EPSILON6)return s.lerp(e,a,n,r);var u=Math.acos(i);return x=s.multiplyByScalar(e,Math.sin((1-n)*u),x),g=s.multiplyByScalar(a,Math.sin(n*u),g),r=s.add(x,g,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 E=new e,M=new e,z=new s,S=new s;s.computeInnerQuadrangle=function(t,n,r,i){var a=s.conjugate(n,z);s.multiply(a,r,S);var o=s.log(S,E);s.multiply(a,t,S);var u=s.log(S,M);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,z),s.multiply(n,z,i)},s.squad=function(e,t,n,r,i,a){var o=s.slerp(e,t,i,z),u=s.slerp(n,r,i,S);return s.slerp(o,u,2*i*(1-i),a)};for(var O=new s,_=1.9011074535173003,T=i.supportsTypedArrays()?new Float32Array(8):[],I=i.supportsTypedArrays()?new Float32Array(8):[],N=i.supportsTypedArrays()?new Float32Array(8):[],R=i.supportsTypedArrays()?new Float32Array(8):[],b=0;7>b;++b){var A=b+1,P=2*A+1;T[b]=1/(A*P),I[b]=A/P}return T[7]=_/136,I[7]=8*_/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,h=7;h>=0;--h)N[h]=(T[h]*c-I[h])*o,R[h]=(T[h]*l-I[h])*o;var f=i*n*(1+N[0]*(1+N[1]*(1+N[2]*(1+N[3]*(1+N[4]*(1+N[5]*(1+N[6]*(1+N[7])))))))),d=u*(1+R[0]*(1+R[1]*(1+R[2]*(1+R[3]*(1+R[4]*(1+R[5]*(1+R[6]*(1+R[7])))))))),y=s.multiplyByScalar(e,d,O);return s.multiplyByScalar(t,f,r),s.add(y,r,r)},s.fastSquad=function(e,t,n,r,i,a){var o=s.fastSlerp(e,t,i,z),u=s.fastSlerp(n,r,i,S);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,l,h,f,d,y,m,p){var w=t+i;e.multiplyByScalar(l,Math.cos(w),o),e.multiplyByScalar(a,Math.sin(w),u),e.add(o,u,o);var v=Math.cos(t);v*=v;var x=Math.sin(t);x*=x;var g=f/Math.sqrt(d*v+h*x),E=g/y;return r.fromAxisAngle(o,E,s),n.fromQuaternion(s,c),n.multiplyByVector(c,m,p),e.normalize(p,p),e.multiplyByScalar(p,y,p),p}var a={},o=new e,u=new e,s=new r,c=new n,l=new e,h=new e,f=new e,d=new e;a.raisePositionsToHeight=function(t,n,r){for(var i=n.ellipsoid,a=n.height,o=n.extrudedHeight,u=r?2*(t.length/3):t.length/3,s=new Float64Array(3*u),c=d,y=t.length,m=r?y:0,p=0;y>p;p+=3){var w,v=p+1,x=p+2,g=e.fromArray(t,p,l);g=i.scaleToGeodeticSurface(g,g),w=e.clone(g,h),c=i.geodeticSurfaceNormal(g,c);var E=e.multiplyByScalar(c,a,f);g=e.add(g,E,g),r&&(E=e.multiplyByScalar(c,o,E),w=e.add(w,E,w),s[p+m]=w.x,s[v+m]=w.y,s[x+m]=w.z),s[p]=g.x,s[v]=g.y,s[x]=g.z}return s};var y=new e,m=new e,p=new e;return a.computeEllipsePositions=function(n,r,a){var o=n.semiMinorAxis,u=n.semiMajorAxis,s=n.rotation,c=n.center,d=n.granularity,w=2.31,v=o*o,x=u*u,g=u*o,E=e.magnitude(c),M=e.normalize(c,y),z=e.cross(e.UNIT_Z,c,m);z=e.normalize(z,z);var S,O,_,T,I,N=e.cross(M,z,p),R=1+Math.ceil(t.PI_OVER_TWO/d),b=w/(R-1),A=2*R*(R+1),P=r?new Array(3*A):void 0,C=0,L=l,U=h,q=a?[]:void 0,B=a?[]:void 0,D=t.PI_OVER_TWO;for(S=0;R>S&&D>0;++S){if(L=i(D,s,N,z,v,g,x,E,M,L),U=i(Math.PI-D,s,N,z,v,g,x,E,M,U),r){for(P[C++]=L.x,P[C++]=L.y,P[C++]=L.z,_=2*S+2,O=1;_-1>O;++O)T=O/(_-1),I=e.lerp(L,U,T,f),P[C++]=I.x,P[C++]=I.y,P[C++]=I.z;P[C++]=U.x,P[C++]=U.y,P[C++]=U.z}a&&(B.unshift(L.x,L.y,L.z),0!==S&&q.push(U.x,U.y,U.z)),D=t.PI_OVER_TWO-(S+1)*b}for(R=S,S=R;S>0;--S){if(D=t.PI_OVER_TWO-(S-1)*b,L=i(-D,s,N,z,v,g,x,E,M,L),U=i(D+Math.PI,s,N,z,v,g,x,E,M,U),r){for(P[C++]=L.x,P[C++]=L.y,P[C++]=L.z,_=2*(S-1)+2,O=1;_-1>O;++O)T=O/(_-1),I=e.lerp(L,U,T,f),P[C++]=I.x,P[C++]=I.y,P[C++]=I.z;P[C++]=U.x,P[C++]=U.y,P[C++]=U.z}a&&(B.unshift(L.x,L.y,L.z),1!==S&&q.push(U.x,U.y,U.z))}var F={};return r&&(P.length!==C&&(A=C/3,P.length=C),F.positions=P,F.numPts=R),a&&(F.outerPositions=B.concat(q)),F},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"],function(e){"use strict";var t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===t.POINTS||e===t.LINES||e===t.LINE_LOOP||e===t.LINE_STRIP||e===t.TRIANGLES||e===t.TRIANGLE_STRIP||e===t.TRIANGLE_FAN}};return e(t)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";var a=function(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)};return a.computeNumberOfVertices=function(e){var r=-1;for(var i in e.attributes)if(e.attributes.hasOwnProperty(i)&&t(e.attributes[i])&&t(e.attributes[i].values)){var a=e.attributes[i],o=a.values.length/a.componentsPerAttribute; -if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(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"],function(e,t,n,r){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,i){return e>r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(i)}),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,c,l,h,f,d){"use strict";function y(r){var i=r.center;w=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(i,w),r.height,w),w=t.add(i,w,w);for(var a=new e(w,r.semiMajorAxis),u=o.computeEllipsePositions(r,!1,!0).outerPositions,s=new l({position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(u,r,!1)})}),f=u.length/3,d=h.createTypedArray(f,2*f),y=0,m=0;f-1>m;m++)d[y++]=m,d[y++]=m+1;return d[y++]=f-1,d[y++]=0,{boundingSphere:a,attributes:s,indices:d}}function m(i){var a=r(i.numberOfVerticalLines,16);a=Math.max(a,0);var u=i.center,s=i.ellipsoid,f=i.semiMajorAxis,d=t.multiplyByScalar(s.geodeticSurfaceNormal(u,p),i.height,p);v.center=t.add(u,d,v.center),v.radius=f,d=t.multiplyByScalar(s.geodeticSurfaceNormal(u,d),i.extrudedHeight,d),x.center=t.add(u,d,x.center),x.radius=f;var y=o.computeEllipsePositions(i,!1,!0).outerPositions,m=new l({position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(y,i,!0)})});y=m.position.values;var w=e.union(v,x),g=y.length/3,E=h.createTypedArray(g,2*g+2*a);g/=2;for(var M=0,z=0;g-1>z;z++)E[M++]=z,E[M++]=z+1,E[M++]=z+g,E[M++]=z+g+1;E[M++]=g-1,E[M++]=0,E[M++]=g+g-1,E[M++]=g;var S;if(a>0){var O=Math.min(a,g);S=Math.round(g/O)}var _=Math.min(S*a,g);if(a>0)for(z=0;_>z;z+=S)E[M++]=z,E[M++]=z+g;return{boundingSphere:w,attributes:m,indices:E}}var p=new t,w=new t,v=new e,x=new e,g=function(e){e=r(e,r.EMPTY_OBJECT);var n=e.center,a=e.semiMajorAxis,o=e.semiMinorAxis,s=r(e.granularity,f.RADIANS_PER_DEGREE),c=r(e.height,0),l=e.extrudedHeight,h=i(l)&&!f.equalsEpsilon(c,l,1);this._center=t.clone(n),this._semiMajorAxis=a,this._semiMinorAxis=o,this._ellipsoid=r(e.ellipsoid,u.WGS84),this._rotation=r(e.rotation,0),this._height=c,this._granularity=s,this._extrudedHeight=l,this._extrude=h,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"};return g.createGeometry=function(e){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=m(n)):t=y(n),new s({attributes:t.attributes,indices:t.indices,primitiveType:d.LINES,boundingSphere:t.boundingSphere})},g}),define("Core/CircleOutlineGeometry",["./defaultValue","./defined","./DeveloperError","./EllipseOutlineGeometry"],function(e,t,n,r){"use strict";var i=function(t){t=e(t,e.EMPTY_OBJECT);var n=t.radius,i={center:t.center,semiMajorAxis:n,semiMinorAxis:n,ellipsoid:t.ellipsoid,height:t.height,extrudedHeight:t.extrudedHeight,granularity:t.granularity,numberOfVerticalLines:t.numberOfVerticalLines};this._ellipseGeometry=new r(i),this._workerName="createCircleOutlineGeometry"};return i.createGeometry=function(e){return r.createGeometry(e._ellipseGeometry)},i}),define("Workers/createCircleOutlineGeometry",["../Core/Cartesian3","../Core/CircleOutlineGeometry","../Core/Ellipsoid"],function(e,t,n){"use strict";function r(r){return r._ellipseGeometry._center=e.clone(r._ellipseGeometry._center),r._ellipseGeometry._ellipsoid=n.clone(r._ellipseGeometry._ellipsoid),t.createGeometry(r)}return r})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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:0>e?-1:0},i.signNotZero=function(e){return 0>e?-1:1},i.toSNorm=function(e){return Math.round(255*(.5*i.clamp(e,-1,1)+.5))},i.fromSNorm=function(e){return i.clamp(e,0,255)/255*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.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 i>=a||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;e>=r;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}a.fromSpherical=function(n,r){t(r)||(r=new a);var i=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(e,n,r,i){return t(i)?(i.x=e,i.y=n,i.z=r,i):new a(e,n,r)},a.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new a(e.x,e.y,e.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 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},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var u=new a;a.lerp=function(e,t,n,r){return a.multiplyByScalar(t,n,u),r=a.multiplyByScalar(e,1-n,r),a.add(u,r,r)};var s=new a,E=new a;a.angleBetween=function(e,t){a.normalize(e,s),a.normalize(t,E);var n=a.dot(s,E),r=a.magnitude(a.cross(s,E,s));return Math.atan2(r,n)};var c=new a;a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,c);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):n.y<=n.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,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},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},a.equalsEpsilon=function(e,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)},a.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},a.fromDegrees=function(e,t,n,r,o){var u=i.toRadians(e),s=i.toRadians(t);return a.fromRadians(u,s,n,r,o)};var _=new a,l=new a,R=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=e(i,0);var s=t(o)?o.radiiSquared:R,E=Math.cos(r);_.x=E*Math.cos(n),_.y=E*Math.sin(n),_.z=Math.sin(r),_=a.normalize(_,_),a.multiplyComponents(s,_,l);var c=Math.sqrt(a.dot(_,l));return l=a.divideByScalar(l,c,l),_=a.multiplyByScalar(_,i,_),t(u)||(u=new a),a.add(l,_,u)},a.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=i.toRadians(e[o]);return a.fromRadiansArray(r,t,n)},a.fromRadiansArray=function(e,n,r){var i=e.length;t(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=a.fromRadians(u,s,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=i.toRadians(e[o]),r[o+1]=i.toRadians(e[o+1]),r[o+2]=e[o+2];return a.fromRadiansArrayHeights(r,t,n)},a.fromRadiansArrayHeights=function(e,n,r){var i=e.length;t(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=e[o],s=e[o+1],E=e[o+2];r[o/3]=a.fromRadians(u,s,E,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),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,R=i.x,T=i.y,A=i.z,d=c*c*R*R,h=_*_*T*T,f=l*l*A*A,N=d+h+f,I=Math.sqrt(1/N),S=e.multiplyByScalar(n,I,a);if(s>N)return isFinite(I)?e.clone(S,E):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,L,U,x,w,v,g,F,P,B,D=(1-I)*e.magnitude(n)/(.5*e.magnitude(O)),z=0;do{D-=z,L=1/(1+D*m),U=1/(1+D*M),x=1/(1+D*y),w=L*L,v=U*U,g=x*x,F=w*L,P=v*U,B=g*x,p=d*w+h*v+f*g-1,C=d*F*m+h*P*M+f*B*y;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return t(E)?(E.x=c*L,E.y=_*U,E.z=l*x,E):new e(c*L,_*U,l*x)}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),R=a.EPSILON1;return u.fromCartesian=function(t,r,i){var T=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:l,d=n(r)?r._centerToleranceSquared:R,h=o(t,T,A,d,E);if(n(h)){var f=e.multiplyComponents(t,A,s);f=e.normalize(f,f);var N=e.subtract(t,h,c),I=Math.atan2(f.y,f.x),S=Math.asin(f.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){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){i=n(i,0),e.pack(t._radii,r,i)},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;n>i;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var R=new e,T=new e,A=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,T);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),s=e.subtract(n,a,A),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;n>i;++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}),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","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(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 u(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;3>n;++n){var r=e[o.getElementIndex(R[n],l[n])];t+=2*r*r}return Math.sqrt(t)}function E(e,t){for(var n=a.EPSILON15,r=0,i=1,u=0;3>u;++u){var s=Math.abs(e[o.getElementIndex(R[u],l[u])]);s>r&&(i=u,r=s)}var E=1,c=0,_=l[i],T=R[i];if(Math.abs(e[o.getElementIndex(T,_)])>n){var A,d=e[o.getElementIndex(T,T)],h=e[o.getElementIndex(_,_)],f=e[o.getElementIndex(T,_)],N=(d-h)/2/f;A=0>N?-1/(-N+Math.sqrt(1+N*N)):1/(N+Math.sqrt(1+N*N)),E=1/Math.sqrt(1+A*A),c=A*E}return t=o.clone(o.IDENTITY,t),t[o.getElementIndex(_,_)]=t[o.getElementIndex(T,T)]=E,t[o.getElementIndex(T,_)]=c,t[o.getElementIndex(_,T)]=-c,t}o.packedLength=9,o.pack=function(e,n,r){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]},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[4]=e[r++],i[5]=e[r++],i[6]=e[r++],i[7]=e[r++],i[8]=e[r++],i},o.clone=function(e,t){return n(e)?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 o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},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[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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var r=e.x*e.x,i=e.x*e.y,a=e.x*e.z,u=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,R=e.w*e.w,T=r-s-_+R,A=2*(i-l),d=2*(a+c),h=2*(i+l),f=-r+s-_+R,N=2*(E-u),I=2*(a-c),S=2*(E+u),m=-r-s+_+R;return n(t)?(t[0]=T,t[1]=h,t[2]=I,t[3]=A,t[4]=f,t[5]=S,t[6]=d,t[7]=N,t[8]=m,t):new o(T,A,d,h,f,N,I,S,m)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,r,-i,0,i,r)},o.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 o(r,0,i,0,1,0,-i,0,r)},o.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 o(r,-i,0,i,r,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},o.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},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var c=new e;o.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],c)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],c)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],c)),n};var _=new e;o.getMaximumScale=function(t){return o.getScale(t,_),e.maximumComponent(_)},o.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},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[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},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[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},o.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},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[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},o.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},o.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},o.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 l=[1,0,0],R=[2,2,1],T=new o,A=new o;return o.computeEigenDecomposition=function(e,t){var r=a.EPSILON20,i=10,c=0,_=0;n(t)||(t={});for(var l=t.unitary=o.clone(o.IDENTITY,t.unitary),R=t.diagonal=o.clone(e,t.diagonal),d=r*u(R);i>_&&s(R)>d;)E(R,T),o.transpose(T,A),o.multiply(R,T,R),o.multiply(A,R,R),o.multiply(l,T,l),++c>2&&(++_,c=0);return 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[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},o.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)},o.inverse=function(e,t){var n=e[0],i=e[1],u=e[2],s=e[3],E=e[4],c=e[5],_=e[6],l=e[7],R=e[8],T=o.determinant(e);if(Math.abs(T)<=a.EPSILON15)throw new r("matrix is not invertible");t[0]=E*R-l*c,t[1]=l*u-i*R,t[2]=i*c-E*u,t[3]=_*c-s*R,t[4]=n*R-_*u,t[5]=s*u-n*c,t[6]=s*l-_*E,t[7]=_*i-n*l,t[8]=n*E-s*i;var A=1/T;return o.multiplyByScalar(t,A,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=i(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=i(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},a.packedLength=4,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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.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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s){"use strict";function E(e,t,r,i,a,o,u,s,E,c,_,l,R,T,A,d){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(E,0),this[3]=n(R,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(c,0),this[7]=n(T,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(s,0),this[14]=n(l,0),this[15]=n(d,0)}E.packedLength=16,E.pack=function(e,t,r){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]},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){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new 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]):void 0},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,_=t.x*t.z,l=t.x*t.w,R=t.y*t.y,T=t.y*t.z,A=t.y*t.w,d=t.z*t.z,h=t.z*t.w,f=t.w*t.w,N=s-R-d+f,I=2*(c-h),S=2*(_+A),m=2*(c+h),M=-s+R-d+f,y=2*(T-l),O=2*(_-A),p=2*(T+l),C=-s-R+d+f;return i[0]=N*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]=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(u.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 c=new e,_=new e,l=new e;E.fromCamera=function(t,n){var i=t.eye,a=t.target,o=t.up;e.normalize(e.subtract(a,i,c),c),e.normalize(e.cross(c,o,_),_),e.normalize(e.cross(_,c,l),l);var u=_.x,s=_.y,R=_.z,T=c.x,A=c.y,d=c.z,h=l.x,f=l.y,N=l.z,I=i.x,S=i.y,m=i.z,M=u*-I+s*-S+R*-m,y=h*-I+f*-S+N*-m,O=T*I+A*S+d*m; +return r(n)?(n[0]=u,n[1]=h,n[2]=-T,n[3]=0,n[4]=s,n[5]=f,n[6]=-A,n[7]=0,n[8]=R,n[9]=N,n[10]=-d,n[11]=0,n[12]=M,n[13]=y,n[14]=O,n[15]=1,n):new E(u,s,R,M,h,f,N,y,-T,-A,-d,O,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),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},E.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},E.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,R=-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]=R,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),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},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 E=.5*u,c=.5*s,_=.5*(r-t),l=E,R=c,T=_,A=a+E,d=o+c,h=t+_,f=1;return i[0]=l,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]=T,i[11]=0,i[12]=A,i[13]=d,i[14]=h,i[15]=f,i},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 R=new e;E.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 T=new e;E.getMaximumScale=function(t){return E.getScale(t,T),e.maximumComponent(T)},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],E=e[6],c=e[7],_=e[8],l=e[9],R=e[10],T=e[11],A=e[12],d=e[13],h=e[14],f=e[15],N=t[0],I=t[1],S=t[2],m=t[3],M=t[4],y=t[5],O=t[6],p=t[7],C=t[8],L=t[9],U=t[10],x=t[11],w=t[12],v=t[13],g=t[14],F=t[15],P=r*N+u*I+_*S+A*m,B=i*N+s*I+l*S+d*m,D=a*N+E*I+R*S+h*m,z=o*N+c*I+T*S+f*m,G=r*M+u*y+_*O+A*p,b=i*M+s*y+l*O+d*p,V=a*M+E*y+R*O+h*p,X=o*M+c*y+T*O+f*p,H=r*C+u*L+_*U+A*x,W=i*C+s*L+l*U+d*x,q=a*C+E*L+R*U+h*x,Y=o*C+c*L+T*U+f*x,K=r*w+u*v+_*g+A*F,k=i*w+s*v+l*g+d*F,Z=a*w+E*v+R*g+h*F,j=o*w+c*v+T*g+f*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]=Z,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],E=e[8],c=e[9],_=e[10],l=e[12],R=e[13],T=e[14],A=t[0],d=t[1],h=t[2],f=t[4],N=t[5],I=t[6],S=t[8],m=t[9],M=t[10],y=t[12],O=t[13],p=t[14],C=r*A+o*d+E*h,L=i*A+u*d+c*h,U=a*A+s*d+_*h,x=r*f+o*N+E*I,w=i*f+u*N+c*I,v=a*f+s*N+_*I,g=r*S+o*m+E*M,F=i*S+u*m+c*M,P=a*S+s*m+_*M,B=r*y+o*O+E*p+l,D=i*y+u*O+c*p+R,z=a*y+s*O+_*p+T;return n[0]=C,n[1]=L,n[2]=U,n[3]=0,n[4]=x,n[5]=w,n[6]=v,n[7]=0,n[8]=g,n[9]=F,n[10]=P,n[11]=0,n[12]=B,n[13]=D,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],E=e[8],c=e[9],_=e[10],l=t[0],R=t[1],T=t[2],A=t[3],d=t[4],h=t[5],f=t[6],N=t[7],I=t[8],S=r*l+o*R+E*T,m=i*l+u*R+c*T,M=a*l+s*R+_*T,y=r*A+o*d+E*h,O=i*A+u*d+c*h,p=a*A+s*d+_*h,C=r*f+o*N+E*I,L=i*f+u*N+c*I,U=a*f+s*N+_*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]=L,n[10]=U,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 A=new e;E.multiplyByUniformScale=function(e,t,n){return A.x=t,A.y=t,A.z=t,E.multiplyByScale(e,A,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,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},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 u,h=new u,f=new t,N=new t(0,0,0,1);return E.inverse=function(e,n){if(u.equalsEpsilon(E.getRotation(e,d),h,o.EPSILON7)&&t.equals(E.getRow(e,3,f),N))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],c=e[12],_=e[1],l=e[5],R=e[9],T=e[13],A=e[2],I=e[6],S=e[10],m=e[14],M=e[3],y=e[7],O=e[11],p=e[15],C=S*p,L=m*O,U=I*p,x=m*y,w=I*O,v=S*y,g=A*p,F=m*M,P=A*O,B=S*M,D=A*y,z=I*M,G=C*l+x*R+w*T-(L*l+U*R+v*T),b=L*_+g*R+B*T-(C*_+F*R+P*T),V=U*_+F*l+D*T-(x*_+g*l+z*T),X=v*_+P*l+z*R-(w*_+B*l+D*R),H=L*i+U*a+v*c-(C*i+x*a+w*c),W=C*r+F*a+P*c-(L*r+g*a+B*c),q=x*r+g*i+z*c-(U*r+F*i+D*c),Y=w*r+B*i+D*a-(v*r+P*i+z*a);C=a*T,L=c*R,U=i*T,x=c*l,w=i*R,v=a*l,g=r*T,F=c*_,P=r*R,B=a*_,D=r*l,z=i*_;var K=C*y+x*O+w*p-(L*y+U*O+v*p),k=L*M+g*O+B*p-(C*M+F*O+P*p),Z=U*M+F*y+D*p-(x*M+g*y+z*p),j=v*M+P*y+z*O-(w*M+B*y+D*O),Q=U*S+v*m+L*I-(w*m+C*I+x*S),J=P*m+C*A+F*S-(g*S+B*m+L*A),$=g*I+z*m+x*A-(D*m+U*A+F*I),ee=D*S+w*A+B*I-(P*I+z*S+v*A),te=r*G+i*b+a*V+c*X;if(Math.abs(te)<o.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]=Z*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],E=e[9],c=e[10],_=e[12],l=e[13],R=e[14],T=-n*_-r*l-i*R,A=-a*_-o*l-u*R,d=-s*_-E*l-c*R;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]=T,t[13]=A,t[14]=d,t[15]=1,t},E.IDENTITY=a(new E(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),E.ZERO=a(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,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/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}),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){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},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 n>t&&(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 R=e[_];r=Math.min(r,R.longitude),i=Math.max(i,R.longitude),E=Math.min(E,R.latitude),c=Math.max(c,R.latitude);var T=R.longitude>=0?R.longitude:R.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=E,t.east=i,t.north=c,t):new s(r,E,i,c)},s.clone=function(e,t){return n(e)?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):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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;a>i&&(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;a>i&&o>0?i+=u.TWO_PI:E>o&&i>0&&(o+=u.TWO_PI),a>i&&0>E?E+=u.TWO_PI:E>o&&0>a&&(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),R=Math.min(e.north,t.north);if(!(l>=R))return n(r)?(r.west=c,r.south=l,r.east=_,r.north=R,r):new s(c,l,_,R)}},s.union=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.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 i>a&&(a+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(a>n||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,R=e.east,T=e.west,A=E;A.height=i,A.longitude=T,A.latitude=_,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.latitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=T,o[c]=r.cartographicToCartesian(A,o[c]),c++,0>_?A.latitude=_:l>0?A.latitude=l:A.latitude=0;for(var d=1;8>d;++d)A.longitude=-Math.PI+d*u.PI_OVER_TWO,s.contains(e,A)&&(o[c]=r.cartographicToCartesian(A,o[c]),c++);return 0===A.latitude&&(A.longitude=T,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=r.cartographicToCartesian(A,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","./Plane","./Rectangle"],function(e,t,n,r,i,a,o,u,s,E,c,_,l){"use strict";function R(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var T=new e,A=new e,d=new e,h=new e,f=new e,N=new e,I=new e,S=new e,m=new e,M=new e,y=new e,O=new e;R.fromPoints=function(t,n){if(r(n)||(n=new R),!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],I),a=e.clone(i,T),o=e.clone(i,A),u=e.clone(i,d),s=e.clone(i,h),E=e.clone(i,f),c=e.clone(i,N),_=t.length,l=1;_>l;l++){e.clone(t[l],i);var p=i.x,C=i.y,L=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),L<u.z&&e.clone(i,u),L>c.z&&e.clone(i,c)}var U=e.magnitudeSquared(e.subtract(s,a,S)),x=e.magnitudeSquared(e.subtract(E,o,S)),w=e.magnitudeSquared(e.subtract(c,u,S)),v=a,g=s,F=U;x>F&&(F=x,v=o,g=E),w>F&&(F=w,v=u,g=c);var P=m;P.x=.5*(v.x+g.x),P.y=.5*(v.y+g.y),P.z=.5*(v.z+g.z);var B=e.magnitudeSquared(e.subtract(g,P,S)),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,S),.5,O),V=0;for(l=0;_>l;l++){e.clone(t[l],i);var X=e.magnitude(e.subtract(i,b,S));X>V&&(V=X);var H=e.magnitudeSquared(e.subtract(i,P,S));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 V>D?(e.clone(P,n.center),n.radius=D):(e.clone(b,n.center),n.radius=V),n};var p=new o,C=new e,L=new e,U=new t,x=new t;R.fromRectangle2D=function(e,t,n){return R.fromRectangleWithHeights2D(e,t,0,0,n)},R.fromRectangleWithHeights2D=function(t,i,a,o,u){if(r(u)||(u=new R),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=n(i,p),l.southwest(t,U),U.height=a,l.northeast(t,x),x.height=o;var s=i.project(U,C),E=i.project(x,L),c=E.x-s.x,_=E.y-s.y,T=E.z-s.z;u.radius=.5*Math.sqrt(c*c+_*_+T*T);var A=u.center;return A.x=s.x+.5*c,A.y=s.y+.5*_,A.z=s.z+.5*T,u};var w=[];R.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,w)),R.fromPoints(u,o)},R.fromVertices=function(t,i,a,o){if(r(o)||(o=new R),!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=I;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,A),c=e.clone(u,d),_=e.clone(u,h),l=e.clone(u,f),p=e.clone(u,N),C=t.length,L=0;C>L;L+=a){var U=t[L]+i.x,x=t[L+1]+i.y,w=t[L+2]+i.z;u.x=U,u.y=x,u.z=w,U<s.x&&e.clone(u,s),U>_.x&&e.clone(u,_),x<E.y&&e.clone(u,E),x>l.y&&e.clone(u,l),w<c.z&&e.clone(u,c),w>p.z&&e.clone(u,p)}var v=e.magnitudeSquared(e.subtract(_,s,S)),g=e.magnitudeSquared(e.subtract(l,E,S)),F=e.magnitudeSquared(e.subtract(p,c,S)),P=s,B=_,D=v;g>D&&(D=g,P=E,B=l),F>D&&(D=F,P=c,B=p);var z=m;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,S)),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=l.y,X.z=p.z;var H=e.multiplyByScalar(e.add(V,X,S),.5,O),W=0;for(L=0;C>L;L+=a){u.x=t[L]+i.x,u.y=t[L+1]+i.y,u.z=t[L+2]+i.z;var q=e.magnitude(e.subtract(u,H,S));q>W&&(W=q);var Y=e.magnitudeSquared(e.subtract(u,z,S));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 W>b?(e.clone(z,o.center),o.radius=b):(e.clone(H,o.center),o.radius=W),o},R.fromEncodedCartesianVertices=function(t,n,i){if(r(i)||(i=new R),!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=I;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,A),s=e.clone(a,d),E=e.clone(a,h),c=e.clone(a,f),_=e.clone(a,N),l=t.length,p=0;l>p;p+=3){var C=t[p]+n[p],L=t[p+1]+n[p+1],U=t[p+2]+n[p+2];a.x=C,a.y=L,a.z=U,C<o.x&&e.clone(a,o),C>E.x&&e.clone(a,E),L<u.y&&e.clone(a,u),L>c.y&&e.clone(a,c),U<s.z&&e.clone(a,s),U>_.z&&e.clone(a,_)}var x=e.magnitudeSquared(e.subtract(E,o,S)),w=e.magnitudeSquared(e.subtract(c,u,S)),v=e.magnitudeSquared(e.subtract(_,s,S)),g=o,F=E,P=x;w>P&&(P=w,g=u,F=c),v>P&&(P=v,g=s,F=_);var B=m;B.x=.5*(g.x+F.x),B.y=.5*(g.y+F.y),B.z=.5*(g.z+F.z);var D=e.magnitudeSquared(e.subtract(F,B,S)),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,S),.5,O),X=0;for(p=0;l>p;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,S));H>X&&(X=H);var W=e.magnitudeSquared(e.subtract(a,B,S));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 X>z?(e.clone(B,i.center),i.radius=z):(e.clone(V,i.center),i.radius=X),i},R.fromCornerPoints=function(t,n,i){r(i)||(i=new R);var a=i.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,n),i},R.fromEllipsoid=function(t,n){return r(n)||(n=new R),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var v=new e;R.fromBoundingSpheres=function(t,n){if(r(n)||(n=new R),!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 R.clone(t[0],n);if(2===i)return R.union(t[0],t[1],n);for(var a=[],o=0;i>o;o++)a.push(t[o].center);n=R.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;i>o;o++){var E=t[o];s=Math.max(s,e.distance(u,E.center,v)+E.radius)}return n.radius=s,n};var g=new e,F=new e,P=new e;R.fromOrientedBoundingBox=function(t,n){r(n)||(n=new R);var i=t.halfAxes,a=E.getColumn(i,0,g),o=E.getColumn(i,1,F),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},R.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new R(t.center,t.radius):void 0},R.packedLength=4,R.pack=function(e,t,r){r=n(r,0);var i=e.center;t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius},R.unpack=function(e,t,i){t=n(t,0),r(i)||(i=new R);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var B=new e,D=new e;R.union=function(t,n,i){r(i)||(i=new R);var a=t.center,o=t.radius,u=n.center,s=n.radius,E=e.subtract(u,a,B),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),l=e.multiplyByScalar(E,(-o+_)/c,D);return e.add(l,a,l),e.clone(l,i.center),i.radius=_,i};var z=new e;R.expand=function(t,n,r){r=R.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,z));return i>r.radius&&(r.radius=i),r},R.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return-i>o?u.OUTSIDE:i>o?u.INTERSECTING:u.INSIDE},R.transform=function(e,t,n){return r(n)||(n=new R),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var G=new e;R.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,G);return e.magnitudeSquared(r)-t.radius*t.radius},R.transformWithoutScale=function(e,t,n){return r(n)||(n=new R),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;R.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 V=new e,X=new e,H=new e,W=new e,q=new e,Y=new t,K=new Array(8),k=0;8>k;++k)K[k]=new e;var Z=new o;return R.projectTo2D=function(t,r,i){r=n(r,Z);var a=r.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,V),E=e.cross(e.UNIT_Z,s,X);e.normalize(E,E);var c=e.cross(s,E,H);e.normalize(c,c),e.multiplyByScalar(s,u,s),e.multiplyByScalar(c,u,c),e.multiplyByScalar(E,u,E);var _=e.negate(c,q),l=e.negate(E,W),T=K,A=T[0];e.add(s,c,A),e.add(A,E,A),A=T[1],e.add(s,c,A),e.add(A,l,A),A=T[2],e.add(s,_,A),e.add(A,l,A),A=T[3],e.add(s,_,A),e.add(A,E,A),e.negate(s,s),A=T[4],e.add(s,c,A),e.add(A,E,A),A=T[5],e.add(s,c,A),e.add(A,l,A),A=T[6],e.add(s,_,A),e.add(A,l,A),A=T[7],e.add(s,_,A),e.add(A,E,A);for(var d=T.length,h=0;d>h;++h){var f=T[h];e.add(o,f,f);var N=a.cartesianToCartographic(f,Y);r.project(N,f)}i=R.fromPoints(T,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},R.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},R.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},R.prototype.intersectPlane=function(e){return R.intersectPlane(this,e)},R.prototype.distanceSquaredTo=function(e){return R.distanceSquaredTo(this,e)},R.prototype.computePlaneDistances=function(e,t,n){return R.computePlaneDistances(this,e,t,n)},R.prototype.isOccluded=function(e){return R.isOccluded(this,e)},R.prototype.equals=function(e){return R.equals(this,e)},R.prototype.clone=function(e){return R.clone(this,e)},R}),define("Renderer/WebGLConstants",["../Core/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/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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++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",e(document[i])?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",e(document[i])&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",e(document[i])?r.fullscreenElement=i:(i=s+"FullScreenElement",e(document[i])&&(r.fullscreenElement=i)),i=s+"fullscreenchange",e(document["on"+i])&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",e(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;r>n;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(N)){N=!1;var e=/ Chrome\/([\.0-9]+)/.exec(f.userAgent);null!==e&&(N=!0,I=r(e[1]))}return N}function a(){return i()&&I}function o(){if(!t(S)&&(S=!1,!i()&&/ Safari\/[\.0-9]+/.test(f.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(f.userAgent);null!==e&&(S=!0,m=r(e[1]))}return S}function u(){return o()&&m}function s(){if(!t(M)){M=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(f.userAgent);null!==e&&(M=!0,y=r(e[1]),y.isNightly=!!e[2])}return M}function E(){return s()&&y}function c(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===f.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(f.userAgent),null!==e&&(O=!0,p=r(e[1]))):"Netscape"===f.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(f.userAgent),null!==e&&(O=!0,p=r(e[1])))}return O}function _(){return c()&&p}function l(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(f.userAgent);null!==e&&(C=!0,L=r(e[1]))}return C}function R(){return t(U)||(U=/Windows/i.test(f.appVersion)),U}function T(){return l()&&L}function A(){return t(x)||(x="undefined"!=typeof PointerEvent&&(!t(f.pointerEnabled)||f.pointerEnabled)),x}function d(){if(!t(v)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;v=t(n)&&""!==n,v&&(w=n)}return v}function h(){return d()?w:void 0}var f;f="undefined"!=typeof navigator?navigator:{};var N,I,S,m,M,y,O,p,C,L,U,x,w,v,g={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:c,internetExplorerVersion:_,isFirefox:l,firefoxVersion:T,isWindows:R,hardwareConcurrency:e(f.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:d,imageRenderingValue:h};return g.supportsFullscreen=function(){return n.supportsFullscreen()},g.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},g.supportsWebWorkers=function(){return"undefined"!=typeof Worker},g}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,i,a){"use strict";if(!i.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return n(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,n,i,a){switch(i=t(i,0),a=t(a,(n.byteLength-i)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,i,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,i,a);case o.SHORT:return new Int16Array(n,i,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,i,a);case o.FLOAT:return new Float32Array(n,i,a);case o.DOUBLE:return new Float64Array(n,i,a);default:throw new r("componentDatatype is not a valid value.")}},a(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],R=e[u.COLUMN1ROW1],T=e[u.COLUMN2ROW2],A=l+R+T;if(A>0)r=Math.sqrt(A+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 d=c,h=0;R>l&&(h=1),T>l&&T>R&&(h=2);var f=d[h],N=d[f];r=Math.sqrt(e[u.getElementIndex(h,h)]-e[u.getElementIndex(f,f)]-e[u.getElementIndex(N,N)]+1);var I=_;I[h]=.5*r,r=.5/r,E=(e[u.getElementIndex(N,f)]-e[u.getElementIndex(f,N)])*r,I[f]=(e[u.getElementIndex(f,h)]+e[u.getElementIndex(h,f)])*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=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 R=new e,T=new e,A=new s,d=new s,h=new s;s.packedLength=4,s.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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,h),s.conjugate(h,h);for(var i=0,a=n-t+1;a>i;i++){var o=3*i;s.unpack(e,4*(t+i),A),s.multiply(A,h,A),A.w<0&&s.negate(A,A),s.computeAxis(A,R);var u=s.computeAngle(A);r[o]=R.x*u,r[o+1]=R.y*u,r[o+2]=R.z*u}},s.unpackInterpolationResult=function(t,r,i,a,o){n(o)||(o=new s),e.fromArray(t,0,T);var u=e.magnitude(T);return s.unpack(r,4*a,d),0===u?s.clone(s.IDENTITY,A):s.fromAxisAngle(T,u,A),s.multiply(A,d,o)},s.clone=function(e,t){return n(e)?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):void 0},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,R=o*E+r*s-i*u+a*c,T=o*c-r*u-i*s-a*E;return n.x=_,n.y=l,n.z=R,n.w=T,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 f=new s;s.lerp=function(e,t,n,r){return f=s.multiplyByScalar(t,n,f),r=s.multiplyByScalar(e,1-n,r),s.add(f,r,r)};var N=new s,I=new s,S=new s;s.slerp=function(e,t,n,r){var i=s.dot(e,t),a=t;if(0>i&&(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),S=s.multiplyByScalar(a,Math.sin(n*u),S),r=s.add(I,S,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 m=new e,M=new e,y=new s,O=new s;s.computeInnerQuadrangle=function(t,n,r,i){var a=s.conjugate(n,y);s.multiply(a,r,O);var o=s.log(O,m);s.multiply(a,t,O);var u=s.log(O,M);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,y),s.multiply(n,y,i)},s.squad=function(e,t,n,r,i,a){var o=s.slerp(e,t,i,y),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,L=i.supportsTypedArrays()?new Float32Array(8):[],U=i.supportsTypedArrays()?new Float32Array(8):[],x=i.supportsTypedArrays()?new Float32Array(8):[],w=i.supportsTypedArrays()?new Float32Array(8):[],v=0;7>v;++v){var g=v+1,F=2*g+1;L[v]=1/(g*F),U[v]=g/F}return L[7]=C/136,U[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;--_)x[_]=(L[_]*E-U[_])*o,w[_]=(L[_]*c-U[_])*o;var l=i*n*(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=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])))))))),T=s.multiplyByScalar(e,R,p);return s.multiplyByScalar(t,l,r),s.add(T,r,r)},s.fastSquad=function(e,t,n,r,i,a){var o=s.fastSlerp(e,t,i,y),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,R,T,A,d){var h=t+i;e.multiplyByScalar(c,Math.cos(h),o),e.multiplyByScalar(a,Math.sin(h),u),e.add(o,u,o);var f=Math.cos(t);f*=f;var N=Math.sin(t);N*=N;var I=l/Math.sqrt(R*f+_*N),S=I/T;return r.fromAxisAngle(o,S,s),n.fromQuaternion(s,E),n.multiplyByVector(E,A,d),e.normalize(d,d),e.multiplyByScalar(d,T,d),d}var a={},o=new e,u=new e,s=new r,E=new n,c=new e,_=new e,l=new e,R=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,T=r?E:0,A=0;E>A;A+=3){var d=A+1,h=A+2,f=e.fromArray(t,A,c);i.scaleToGeodeticSurface(f,f);var N=e.clone(f,_),I=i.geodeticSurfaceNormal(f,R),S=e.multiplyByScalar(I,a,l);e.add(f,S,f),r&&(e.multiplyByScalar(I,o,S),e.add(N,S,N),s[A+T]=N.x,s[d+T]=N.y,s[h+T]=N.z),s[A]=f.x,s[d]=f.y,s[h]=f.z}return s};var T=new e,A=new e,d=new e;return a.computeEllipsePositions=function(n,r,a){var o=n.semiMinorAxis,u=n.semiMajorAxis,s=n.rotation,E=n.center,R=8*n.granularity,h=o*o,f=u*u,N=u*o,I=e.magnitude(E),S=e.normalize(E,T),m=e.cross(e.UNIT_Z,E,A);m=e.normalize(m,m);var M=e.cross(S,m,d),y=1+Math.ceil(t.PI_OVER_TWO/R),O=t.PI_OVER_TWO/(y-1),p=t.PI_OVER_TWO-y*O;0>p&&(y-=Math.ceil(Math.abs(p)/O));var C,L,U,x,w,v=2*(y*(y+2)),g=r?new Array(3*v):void 0,F=0,P=c,B=_,D=4*y*3,z=D-1,G=0,b=a?new Array(D):void 0;for(p=t.PI_OVER_TWO,P=i(p,s,M,m,h,N,f,I,S,P),r&&(g[F++]=P.x,g[F++]=P.y,g[F++]=P.z),a&&(b[z--]=P.z,b[z--]=P.y,b[z--]=P.x),p=t.PI_OVER_TWO-O,C=1;y+1>C;++C){if(P=i(p,s,M,m,h,N,f,I,S,P),B=i(Math.PI-p,s,M,m,h,N,f,I,S,B),r){for(g[F++]=P.x,g[F++]=P.y,g[F++]=P.z,U=2*C+2,L=1;U-1>L;++L)x=L/(U-1),w=e.lerp(P,B,x,l),g[F++]=w.x,g[F++]=w.y,g[F++]=w.z;g[F++]=B.x,g[F++]=B.y,g[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=y;C>1;--C){if(p=t.PI_OVER_TWO-(C-1)*O,P=i(-p,s,M,m,h,N,f,I,S,P),B=i(p+Math.PI,s,M,m,h,N,f,I,S,B),r){for(g[F++]=P.x,g[F++]=P.y,g[F++]=P.z,U=2*(C-1)+2,L=1;U-1>L;++L)x=L/(U-1),w=e.lerp(P,B,x,l),g[F++]=w.x,g[F++]=w.y,g[F++]=w.z;g[F++]=B.x,g[F++]=B.y,g[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,M,m,h,N,f,I,S,P);var V={};return r&&(g[F++]=P.x,g[F++]=P.y,g[F++]=P.z,V.positions=g,V.numPts=y),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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(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=void 0}return a.computeNumberOfVertices=function(e){var r=-1;for(var i in e.attributes)if(e.attributes.hasOwnProperty(i)&&t(e.attributes[i])&&t(e.attributes[i].values)){var a=e.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===a.UNSIGNED_BYTE||e===a.UNSIGNED_SHORT||e===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,r){return e>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,r):new Uint16Array(t,n,r)},r(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,R){"use strict";function T(r){var i=r.center;f=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(i,f),r.height,f),f=t.add(i,f,f);for(var a=new e(f,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,R=_.createTypedArray(l,2*l),T=0,A=0;l>A;++A)R[T++]=A,R[T++]=(A+1)%l;return{boundingSphere:a,attributes:s,indices:R}}function A(i){var a=r(i.numberOfVerticalLines,16);a=Math.max(a,0);var u=i.center,s=i.ellipsoid,l=i.semiMajorAxis,R=t.multiplyByScalar(s.geodeticSurfaceNormal(u,h),i.height,h);N.center=t.add(u,R,N.center),N.radius=l,R=t.multiplyByScalar(s.geodeticSurfaceNormal(u,R),i.extrudedHeight,R),I.center=t.add(u,R,I.center),I.radius=l;var T=o.computeEllipsePositions(i,!1,!0).outerPositions,A=new c({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(T,i,!0)})});T=A.position.values;var d=e.union(N,I),f=T.length/3,S=_.createTypedArray(f,2*f+2*a);f/=2;var m,M=0;for(m=0;f>m;++m)S[M++]=m,S[M++]=(m+1)%f,S[M++]=m+f,S[M++]=(m+1)%f+f;var y;if(a>0){var O=Math.min(a,f);y=Math.round(f/O)}var p=Math.min(y*a,f);if(a>0)for(m=0;p>m;m+=y)S[M++]=m,S[M++]=m+f;return{boundingSphere:d,attributes:A,indices:S}}function d(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,R=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=R,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var h=new t,f=new t,N=new e,I=new e;d.packedLength=t.packedLength+u.packedLength+9,d.pack=function(e,n,a){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};var S=new t,m=new u,M={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 d.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++],R=e[n++],T=e[n++],A=e[n++],h=1===e[n++],f=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=R,a._extrudedHeight=T?A:void 0,a._extrude=h,a._numberOfVerticalLines=f,a):(M.height=l,M.extrudedHeight=T?A:void 0,M.granularity=R,M.rotation=_,M.semiMajorAxis=E,M.semiMinorAxis=c,M.numberOfVerticalLines=f,new d(M))},d.createGeometry=function(e){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=A(n)):t=T(n),new s({attributes:t.attributes,indices:t.indices,primitiveType:R.LINES,boundingSphere:t.boundingSphere})},d}),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){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 diff --git a/Workers/createCorridorGeometry.js b/Workers/createCorridorGeometry.js index 221eec0..a5f3dd2 100644 --- a/Workers/createCorridorGeometry.js +++ b/Workers/createCorridorGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,8 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};r.EPSILON1=.1,r.EPSILON2=.01,r.EPSILON3=.001,r.EPSILON4=1e-4,r.EPSILON5=1e-5,r.EPSILON6=1e-6,r.EPSILON7=1e-7,r.EPSILON8=1e-8,r.EPSILON9=1e-9,r.EPSILON10=1e-10,r.EPSILON11=1e-11,r.EPSILON12=1e-12,r.EPSILON13=1e-13,r.EPSILON14=1e-14,r.EPSILON15=1e-15,r.EPSILON16=1e-16,r.EPSILON17=1e-17,r.EPSILON18=1e-18,r.EPSILON19=1e-19,r.EPSILON20=1e-20,r.GRAVITATIONALPARAMETER=3986004418e5,r.SOLAR_RADIUS=6955e5,r.LUNAR_RADIUS=1737400,r.SIXTY_FOUR_KILOBYTES=65536,r.sign=function(e){return e>0?1:0>e?-1:0},r.signNotZero=function(e){return 0>e?-1:1},r.toSNorm=function(e){return Math.round(255*(.5*r.clamp(e,-1,1)+.5))},r.fromSNorm=function(e){return 2*(r.clamp(e,0,255)/255)-1},r.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},r.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},r.lerp=function(e,t,r){return(1-r)*e+r*t},r.PI=Math.PI,r.ONE_OVER_PI=1/Math.PI,r.PI_OVER_TWO=.5*Math.PI,r.PI_OVER_THREE=Math.PI/3,r.PI_OVER_FOUR=Math.PI/4,r.PI_OVER_SIX=Math.PI/6,r.THREE_PI_OVER_TWO=.5*3*Math.PI,r.TWO_PI=2*Math.PI,r.ONE_OVER_TWO_PI=1/(2*Math.PI),r.RADIANS_PER_DEGREE=Math.PI/180,r.DEGREES_PER_RADIAN=180/Math.PI,r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600,r.toRadians=function(e){return e*r.RADIANS_PER_DEGREE},r.toDegrees=function(e){return e*r.DEGREES_PER_RADIAN},r.convertLongitudeRange=function(e){var t=r.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},r.negativePiToPi=function(e){for(var t=r.EPSILON10,n=r.PI,a=r.TWO_PI;-(n+t)>e;)e+=a;if(-n>e)return-n;for(;e>n+t;)e-=a;return e>n?n:e},r.zeroToTwoPi=function(e){var t=e%r.TWO_PI;return 0>t?(t+r.TWO_PI)%r.TWO_PI:t},r.equalsEpsilon=function(e,r,n){return n=t(n,0),Math.abs(e-r)<=n};var n=[1];r.factorial=function(e){var t=n.length;if(e>=t)for(var r=n[t-1],a=t;e>=a;a++)n.push(r*a);return n[e]},r.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},r.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},r.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},r.clamp=function(e,t,r){return t>e?t:e>r?r:e};var a=new e;return r.setRandomNumberSeed=function(t){a=new e(t)},r.nextRandomNumber=function(){return a.random()},r.acosClamped=function(e){return Math.acos(r.clamp(e,-1,1))},r.asinClamped=function(e){return Math.asin(r.clamp(e,-1,1))},r}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i=function(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)};i.fromSpherical=function(r,n){t(n)||(n=new i);var a=r.clock,o=r.cone,u=e(r.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,r,n,a){return t(a)?(a.x=e,a.y=r,a.z=n,a):new i(e,r,n)},i.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z},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},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 o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(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},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.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 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){i.normalize(e,s),i.normalize(t,c);var r=i.dot(s,c),n=i.magnitude(i.cross(s,c,s));return Math.atan2(n,r)};var l=new i;i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);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,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z},i.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n},i.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},i.fromDegrees=function(e,t,r,n,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,r,n,o)};var f=new i,d=new i,h=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(r,n,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:h,c=Math.cos(n);f.x=c*Math.cos(r),f.y=c*Math.sin(r),f.z=Math.sin(n),f=i.normalize(f,f),i.multiplyComponents(s,f,d);var l=Math.sqrt(i.dot(f,d));return d=i.divideByScalar(d,l,d),f=i.multiplyByScalar(f,a,f),t(u)||(u=new i),i.add(d,f,u)},i.fromDegreesArray=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o++)n[o]=a.toRadians(e[o]);return i.fromRadiansArray(n,t,r)},i.fromRadiansArray=function(e,r,n){var a=e.length;t(n)?n.length=a/2:n=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];n[o/2]=i.fromRadians(u,s,0,r,n[o/2])}return n},i.fromDegreesArrayHeights=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o+=3)n[o]=a.toRadians(e[o]),n[o+1]=a.toRadians(e[o+1]),n[o+2]=e[o+2];return i.fromRadiansArrayHeights(n,t,r)},i.fromRadiansArrayHeights=function(e,r,n){var a=e.length;t(n)?n.length=a/3:n=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];n[o/3]=i.fromRadians(u,s,c,r,n[o/3])}return n},i.ZERO=n(new i(0,0,0)),i.UNIT_X=n(new i(1,0,0)),i.UNIT_Y=n(new i(0,1,0)),i.UNIT_Z=n(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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i=function(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)};return i.fromRadians=function(r,n,a,o){return a=e(a,0),t(o)?(o.longitude=r,o.latitude=n,o.height=a,o):new i(r,n,a)},i.fromDegrees=function(e,t,r,n){return e=a.toRadians(e),t=a.toRadians(t),i.fromRadians(e,t,r,n)},i.clone=function(e,r){return t(e)?t(r)?(r.longitude=e.longitude,r.latitude=e.latitude,r.height=e.height,r):new i(e.longitude,e.latitude,e.height):void 0},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.longitude===r.longitude&&e.latitude===r.latitude&&e.height===r.height},i.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.longitude-r.longitude)<=n&&Math.abs(e.latitude-r.latitude)<=n&&Math.abs(e.height-r.height)<=n},i.ZERO=n(new i(0,0,0)),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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},i}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(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}var c=function(e,t,r){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,s(this,e,t,r)};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(t,r){if(!n(t))return void 0;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 c(a.x,a.y,a.z)},c.fromCartesian3=function(e,t){return n(t)||(t=new c),n(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=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.prototype.geocentricSurfaceNormal=e.normalize,c.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)},c.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var l=new e,f=new e;c.prototype.cartographicToCartesian=function(t,r){var a=l,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)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;r>a;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,h=new e,m=new e;c.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,h);if(!n(i))return void 0;var o=this.geodeticSurfaceNormal(i,d),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)},c.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;r>a;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t};var y=new e,p=new e;return c.prototype.scaleToGeodeticSurface=function(t,r){var a=t.x,i=t.y,o=t.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,d=a*a*c*c,h=i*i*l*l,m=o*o*f*f,v=d+h+m,g=Math.sqrt(1/v),w=e.multiplyByScalar(t,g,y);if(v<this._centerToleranceSquared)return isFinite(g)?e.clone(w,r):void 0;var E=this._oneOverRadiiSquared,x=E.x,S=E.y,M=E.z,O=p;O.x=2*w.x*x,O.y=2*w.y*S,O.z=2*w.z*M;var _,T,P,A,R,N,z,C,b,I,D,U=(1-g)*e.magnitude(t)/(.5*e.magnitude(O)),L=0;do{U-=L,P=1/(1+U*x),A=1/(1+U*S),R=1/(1+U*M),N=P*P,z=A*A,C=R*R,b=N*P,I=z*A,D=C*R,_=d*N+h*z+m*C-1,T=d*b*x+h*I*S+m*D*M;var q=-2*T;L=_/q}while(Math.abs(_)>u.EPSILON12);return n(r)?(r.x=a*P,r.y=i*A,r.z=o*R,r):new e(a*P,i*A,o*R)},c.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)},c.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},c.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},c.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";var u=function(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";var t=function(t,r){this.start=e(t,0),this.stop=e(r,0)};return t}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";var a=function(t,r,n,a){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(a,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){return t(e)?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):void 0},a.packedLength=4,a.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w},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.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 i=new a;a.distance=function(e,t){return a.subtract(e,t,i),a.magnitude(i)},a.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.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.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 o=new a;a.lerp=function(e,t,r,n){return a.multiplyByScalar(t,r,o),n=a.multiplyByScalar(e,1-r,n),a.add(o,n,n)};var u=new a;return a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,u);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.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n&&Math.abs(e.w-r.w)<=n},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){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function u(e){for(var t=0,r=0;3>r;++r){var n=e[c.getElementIndex(h[r],d[r])];t+=2*n*n}return Math.sqrt(t)}function s(e,t){for(var r=i.EPSILON15,n=0,a=1,o=0;3>o;++o){var u=Math.abs(e[c.getElementIndex(h[o],d[o])]);u>n&&(a=o,n=u)}var s=1,l=0,f=d[a],m=h[a];if(Math.abs(e[c.getElementIndex(m,f)])>r){var y,p=e[c.getElementIndex(m,m)],v=e[c.getElementIndex(f,f)],g=e[c.getElementIndex(m,f)],w=(p-v)/2/g;y=0>w?-1/(-w+Math.sqrt(1+w*w)):1/(w+Math.sqrt(1+w*w)),s=1/Math.sqrt(1+y*y),l=y*s}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(f,f)]=t[c.getElementIndex(m,m)]=s,t[c.getElementIndex(m,f)]=l,t[c.getElementIndex(f,m)]=-l,t}var c=function(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)};c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,n,a){return n=t(n,0),r(a)||(a=new c),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},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,s=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,m=n-u-f+h,y=2*(a-d),p=2*(i+l),v=2*(a+d),g=-n+u-f+h,w=2*(s-o),E=2*(i-l),x=2*(s+o),S=-n-u+f+h;return r(t)?(t[0]=m,t[1]=v,t[2]=E,t[3]=y,t[4]=g,t[5]=x,t[6]=p,t[7]=w,t[8]=S,t):new c(m,y,p,v,g,w,E,x,S)},c.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new c(e.x,0,0,0,e.y,0,0,0,e.z)},c.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new c(e,0,0,0,e,0,0,0,e)},c.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.fromRotationX=function(e,t){var n=Math.cos(e),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 c(1,0,0,0,n,-a,0,a,n)},c.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 c(n,0,a,0,1,0,-a,0,n)},c.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 c(n,-a,0,a,n,0,0,0,1)},c.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},c.getElementIndex=function(e,t){return 3*e+t},c.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},c.setColumn=function(e,t,r,n){n=c.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},c.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},c.setRow=function(e,t,r,n){return n=c.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var l=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),r};var f=new e;c.getMaximumScale=function(t){return c.getScale(t,f),e.maximumComponent(f)},c.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],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},c.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},c.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},c.multiplyByVector=function(e,t,r){var n=t.x,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},c.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},c.transpose=function(e,t){var r=e[0],n=e[3],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],h=[2,2,1],m=new c,y=new c;return c.computeEigenDecomposition=function(e,t){var n=i.EPSILON20,a=10,l=0,f=0;r(t)||(t={});for(var d=t.unitary=c.clone(c.IDENTITY,t.unitary),h=t.diagonal=c.clone(e,t.diagonal),p=n*o(h);a>f&&u(h)>p;)s(h,m),c.transpose(m,y),c.multiply(h,m,h),c.multiply(y,h,h),c.multiply(d,m,d),++l>2&&(++f,l=0);return t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},c.determinant=function(e){var t=e[0],r=e[3],n=e[6],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)},c.inverse=function(e,t){var r=e[0],a=e[1],o=e[2],u=e[3],s=e[4],l=e[5],f=e[6],d=e[7],h=e[8],m=c.determinant(e);if(Math.abs(m)<=i.EPSILON15)throw new n("matrix is not invertible");t[0]=s*h-d*l,t[1]=d*o-a*h,t[2]=a*l-s*o,t[3]=f*l-u*h,t[4]=r*h-f*o,t[5]=u*o-r*l,t[6]=u*d-f*s,t[7]=f*a-r*d,t[8]=r*s-u*a;var y=1/m;return c.multiplyByScalar(t,y,t)},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},c.IDENTITY=a(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s){"use strict";var c=function(e,t,n,a,i,o,u,s,c,l,f,d,h,m,y,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(m,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(y,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(d,0),this[15]=r(p,0)};c.packedLength=16,c.pack=function(e,t,n){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]},c.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new c),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},c.clone=function(e,t){return n(e)?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 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]):void 0},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,r,a){n(a)||(a=new c);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,l=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,m=t.y*t.z,y=t.y*t.w,p=t.z*t.z,v=t.z*t.w,g=t.w*t.w,w=s-h-p+g,E=2*(l-v),x=2*(f+y),S=2*(l+v),M=-s+h-p+g,O=2*(m-d),_=2*(f-y),T=2*(m+d),P=-s-h+p+g;return a[0]=w*i,a[1]=S*i,a[2]=_*i,a[3]=0,a[4]=E*o,a[5]=M*o,a[6]=T*o,a[7]=0,a[8]=x*u,a[9]=O*u,a[10]=P*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.IDENTITY,e,t)},c.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 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 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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,f=new e,d=new e;c.fromCamera=function(t,r){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,d),d);var u=f.x,s=f.y,h=f.z,m=l.x,y=l.y,p=l.z,v=d.x,g=d.y,w=d.z,E=a.x,x=a.y,S=a.z,M=u*-E+s*-x+h*-S,O=v*-E+g*-x+w*-S,_=m*E+y*x+p*S;return n(r)?(r[0]=u,r[1]=v,r[2]=-m,r[3]=0,r[4]=s,r[5]=g,r[6]=-y,r[7]=0,r[8]=h,r[9]=w,r[10]=-p,r[11]=0,r[12]=M,r[13]=O,r[14]=_,r[15]=1,r):new c(u,s,h,M,v,g,w,O,-m,-y,-p,_,0,0,0,1)},c.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},c.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},c.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},c.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},c.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,m=f,y=i+c,p=o+l,v=t+f,g=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]=m,a[11]=0,a[12]=y,a[13]=p,a[14]=v,a[15]=g,a},c.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]]},c.getElementIndex=function(e,t){return 4*e+t},c.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},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.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},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 h=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],h)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],h)),r};var m=new e;c.getMaximumScale=function(t){return c.getScale(t,m),e.maximumComponent(m)},c.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],m=e[11],y=e[12],p=e[13],v=e[14],g=e[15],w=t[0],E=t[1],x=t[2],S=t[3],M=t[4],O=t[5],_=t[6],T=t[7],P=t[8],A=t[9],R=t[10],N=t[11],z=t[12],C=t[13],b=t[14],I=t[15],D=n*w+u*E+f*x+y*S,U=a*w+s*E+d*x+p*S,L=i*w+c*E+h*x+v*S,q=o*w+l*E+m*x+g*S,B=n*M+u*O+f*_+y*T,F=a*M+s*O+d*_+p*T,W=i*M+c*O+h*_+v*T,G=o*M+l*O+m*_+g*T,V=n*P+u*A+f*R+y*N,j=a*P+s*A+d*R+p*N,Y=i*P+c*A+h*R+v*N,k=o*P+l*A+m*R+g*N,H=n*z+u*C+f*b+y*I,X=a*z+s*C+d*b+p*I,Z=i*z+c*C+h*b+v*I,J=o*z+l*C+m*b+g*I;return r[0]=D,r[1]=U,r[2]=L,r[3]=q,r[4]=B,r[5]=F,r[6]=W,r[7]=G,r[8]=V,r[9]=j,r[10]=Y,r[11]=k,r[12]=H,r[13]=X,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],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],m=e[14],y=t[0],p=t[1],v=t[2],g=t[4],w=t[5],E=t[6],x=t[8],S=t[9],M=t[10],O=t[12],_=t[13],T=t[14],P=n*y+o*p+c*v,A=a*y+u*p+l*v,R=i*y+s*p+f*v,N=n*g+o*w+c*E,z=a*g+u*w+l*E,C=i*g+s*w+f*E,b=n*x+o*S+c*M,I=a*x+u*S+l*M,D=i*x+s*S+f*M,U=n*O+o*_+c*T+d,L=a*O+u*_+l*T+h,q=i*O+s*_+f*T+m;return r[0]=P,r[1]=A,r[2]=R,r[3]=0,r[4]=N,r[5]=z,r[6]=C,r[7]=0,r[8]=b,r[9]=I,r[10]=D,r[11]=0,r[12]=U,r[13]=L,r[14]=q,r[15]=1,r},c.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;c.multiplyByUniformScale=function(e,t,r){return y.x=t,y.y=t,y.z=t,c.multiplyByScale(e,y,r)},c.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?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]=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)},c.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},c.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},c.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},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],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},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||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]&&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]},c.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},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 p=new u,v=new u,g=new t,w=new t(0,0,0,1);return c.inverse=function(e,r){if(u.equalsEpsilon(c.getRotation(e,p),v,o.EPSILON7)&&t.equals(c.getRow(e,3,g),w))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],l=e[12],f=e[1],d=e[5],h=e[9],m=e[13],y=e[2],E=e[6],x=e[10],S=e[14],M=e[3],O=e[7],_=e[11],T=e[15],P=x*T,A=S*_,R=E*T,N=S*O,z=E*_,C=x*O,b=y*T,I=S*M,D=y*_,U=x*M,L=y*O,q=E*M,B=P*d+N*h+z*m-(A*d+R*h+C*m),F=A*f+b*h+U*m-(P*f+I*h+D*m),W=R*f+I*d+L*m-(N*f+b*d+q*m),G=C*f+D*d+q*h-(z*f+U*d+L*h),V=A*a+R*i+C*l-(P*a+N*i+z*l),j=P*n+I*i+D*l-(A*n+b*i+U*l),Y=N*n+b*a+q*l-(R*n+I*a+L*l),k=z*n+U*a+L*i-(C*n+D*a+q*i);P=i*m,A=l*h,R=a*m,N=l*d,z=a*h,C=i*d,b=n*m,I=l*f,D=n*h,U=i*f,L=n*d,q=a*f;var H=P*O+N*_+z*T-(A*O+R*_+C*T),X=A*M+b*_+U*T-(P*M+I*_+D*T),Z=R*M+I*O+L*T-(N*M+b*O+q*T),J=C*M+D*O+q*_-(z*M+U*O+L*_),Q=R*x+C*S+A*E-(z*S+P*E+N*x),K=D*S+P*y+I*x-(b*x+U*S+A*y),$=b*E+q*S+N*y-(L*S+R*y+I*E),et=L*x+z*y+U*E-(D*E+q*x+C*y),tt=n*B+a*F+i*W+l*G;if(Math.abs(tt)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return tt=1/tt,r[0]=B*tt,r[1]=F*tt,r[2]=W*tt,r[3]=G*tt,r[4]=V*tt,r[5]=j*tt,r[6]=Y*tt,r[7]=k*tt,r[8]=H*tt,r[9]=X*tt,r[10]=Z*tt,r[11]=J*tt,r[12]=Q*tt,r[13]=K*tt,r[14]=$*tt,r[15]=et*tt,r},c.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],m=-r*f-n*d-a*h,y=-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]=m,t[13]=y,t[14]=p,t[15]=1,t},c.IDENTITY=i(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o){"use strict";var u=function(e,r,n,a){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(a,0)};u.fromDegrees=function(e,n,a,i,s){return e=o.toRadians(t(e,0)),n=o.toRadians(t(n,0)),a=o.toRadians(t(a,0)),i=o.toRadians(t(i,0)),r(s)?(s.west=e,s.south=n,s.east=a,s.north=i,s):new u(e,n,a,i)},u.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=e.length;c>s;s++){var l=e[s];n=Math.min(n,l.longitude),a=Math.max(a,l.longitude),i=Math.min(i,l.latitude),o=Math.max(o,l.latitude)}return r(t)?(t.west=n,t.south=i,t.east=a,t.north=o,t):new u(n,i,a,o)},u.packedLength=4,u.pack=function(e,r,n){n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north},u.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new u),a.west=e[n++],a.south=e[n++],a.east=e[n++],a.north=e[n],a},u.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},u.validate=function(){},u.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},u.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},u.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},u.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},u.center=function(t,n){var a=t.east,i=t.west,u=.5*(i+a);return i>a&&(u=o.negativePiToPi(u+o.PI)),r(n)?(n.longitude=u,n.latitude=.5*(t.south+t.north),n.height=0,n):new e(u,.5*(t.south+t.north))},u.intersectWith=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),s=Math.min(e.north,t.north);return r(n)?(n.west=a,n.south=i,n.east=o,n.north=s,n):new u(a,i,o,s)},u.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},u.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var s=new e;return u.subsample=function(e,n,i,u){n=t(n,a.WGS84),i=t(i,0),r(u)||(u=[]);var c=0,l=e.north,f=e.south,d=e.east,h=e.west,m=s;m.height=i,m.longitude=h,m.latitude=l,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.latitude=f,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:f>0?f:0;for(var y=1;8>y;++y){var p=-Math.PI+y*o.PI_OVER_TWO;p>h&&d>p&&(m.longitude=p,u[c]=n.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=h,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=n.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=i(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l){"use strict";var f=function(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)},d=new e,h=new e,m=new e,y=new e,p=new e,v=new e,g=new e,w=new e,E=new e,x=new e,S=new e,M=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],g),i=e.clone(a,d),o=e.clone(a,h),u=e.clone(a,m),s=e.clone(a,y),c=e.clone(a,p),l=e.clone(a,v),O=t.length,_=1;O>_;_++){e.clone(t[_],a);var T=a.x,P=a.y,A=a.z;T<i.x&&e.clone(a,i),T>s.x&&e.clone(a,s),P<o.y&&e.clone(a,o),P>c.y&&e.clone(a,c),A<u.z&&e.clone(a,u),A>l.z&&e.clone(a,l)}var R=e.magnitudeSquared(e.subtract(s,i,w)),N=e.magnitudeSquared(e.subtract(c,o,w)),z=e.magnitudeSquared(e.subtract(l,u,w)),C=i,b=s,I=R;N>I&&(I=N,C=o,b=c),z>I&&(I=z,C=u,b=l);var D=E;D.x=.5*(C.x+b.x),D.y=.5*(C.y+b.y),D.z=.5*(C.z+b.z);var U=e.magnitudeSquared(e.subtract(b,D,w)),L=Math.sqrt(U),q=x;q.x=i.x,q.y=o.y,q.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var F=e.multiplyByScalar(e.add(q,B,w),.5,M),W=0;for(_=0;O>_;_++){e.clone(t[_],a);var G=e.magnitude(e.subtract(a,F,w));G>W&&(W=G);var V=e.magnitudeSquared(e.subtract(a,D,w));if(V>U){var j=Math.sqrt(V);L=.5*(L+j),U=L*L;var Y=j-L;D.x=(L*D.x+Y*a.x)/j,D.y=(L*D.y+Y*a.y)/j,D.z=(L*D.z+Y*a.z)/j}}return W>L?(e.clone(D,r.center),r.radius=L):(e.clone(F,r.center),r.radius=W),r};var O=new o,_=new e,T=new e,P=new t,A=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,O),l.southwest(t,P),P.height=i,l.northeast(t,A),A.height=o;var s=a.project(P,_),c=a.project(A,T),d=c.x-s.x,h=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(d*d+h*h+m*m);var y=u.center;return y.x=s.x+.5*d,y.y=s.y+.5*h,y.z=s.z+.5*m,u};var R=[];f.fromRectangle3D=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0);var u;return n(e)&&(u=l.subsample(e,t,a,R)),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=g;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,h),l=e.clone(u,m),O=e.clone(u,y),_=e.clone(u,p),T=e.clone(u,v),P=t.length,A=0;P>A;A+=i){var R=t[A]+a.x,N=t[A+1]+a.y,z=t[A+2]+a.z;u.x=R,u.y=N,u.z=z,R<s.x&&e.clone(u,s),R>O.x&&e.clone(u,O),N<c.y&&e.clone(u,c),N>_.y&&e.clone(u,_),z<l.z&&e.clone(u,l),z>T.z&&e.clone(u,T)}var C=e.magnitudeSquared(e.subtract(O,s,w)),b=e.magnitudeSquared(e.subtract(_,c,w)),I=e.magnitudeSquared(e.subtract(T,l,w)),D=s,U=O,L=C;b>L&&(L=b,D=c,U=_),I>L&&(L=I,D=l,U=T);var q=E;q.x=.5*(D.x+U.x),q.y=.5*(D.y+U.y),q.z=.5*(D.z+U.z);var B=e.magnitudeSquared(e.subtract(U,q,w)),F=Math.sqrt(B),W=x;W.x=s.x,W.y=c.y,W.z=l.z;var G=S;G.x=O.x,G.y=_.y,G.z=T.z;var V=e.multiplyByScalar(e.add(W,G,w),.5,M),j=0;for(A=0;P>A;A+=i){u.x=t[A]+a.x,u.y=t[A+1]+a.y,u.z=t[A+2]+a.z;var Y=e.magnitude(e.subtract(u,V,w));Y>j&&(j=Y);var k=e.magnitudeSquared(e.subtract(u,q,w));if(k>B){var H=Math.sqrt(k);F=.5*(F+H),B=F*F;var X=H-F;q.x=(F*q.x+X*u.x)/H,q.y=(F*q.y+X*u.y)/H,q.z=(F*q.z+X*u.z)/H}}return j>F?(e.clone(q,o.center),o.radius=F):(e.clone(V,o.center),o.radius=j),o},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},f.clone=function(t,r){return n(t)?n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius):void 0},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var a=e.center;t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius},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 N=new e,z=new e;f.union=function(t,r,a){n(a)||(a=new f);var i=t.center,o=r.center;e.add(i,o,z);var u=e.multiplyByScalar(z,.5,z),s=e.magnitude(e.subtract(i,u,N))+t.radius,c=e.magnitude(e.subtract(o,u,N))+r.radius;return a.radius=Math.max(s,c),e.clone(u,a.center),a};var C=new e;f.expand=function(t,r,n){n=f.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,C));return a>n.radius&&(n.radius=a),n},f.intersect=function(t,r){var n=t.center,a=t.radius,i=e.dot(r,n)+r.w;return-a>i?u.OUTSIDE:a>i?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=c.getMaximumScale(t)*e.radius,r};var 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=c.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var I=new e;f.computePlaneDistances=function(t,r,a,i){n(i)||(i=new s);var o=e.subtract(t.center,r,I),u=e.multiplyByScalar(a,e.dot(a,o),I),c=e.magnitude(u);return i.start=c-t.radius,i.stop=c+t.radius,i};for(var D=new e,U=new e,L=new e,q=new e,B=new e,F=new t,W=new Array(8),G=0;8>G;++G)W[G]=new e;var V=new o;return f.projectTo2D=function(t,n,a){n=r(n,V);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,D),c=e.cross(e.UNIT_Z,s,U);e.normalize(c,c);var l=e.cross(s,c,L);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var d=e.negate(l,B),h=e.negate(c,q),m=W,y=m[0];e.add(s,l,y),e.add(y,c,y),y=m[1],e.add(s,l,y),e.add(y,h,y),y=m[2],e.add(s,d,y),e.add(y,h,y),y=m[3],e.add(s,d,y),e.add(y,c,y),e.negate(s,s),y=m[4],e.add(s,l,y),e.add(y,c,y),y=m[5],e.add(s,l,y),e.add(y,h,y),y=m[6],e.add(s,d,y),e.add(y,h,y),y=m[7],e.add(s,d,y),e.add(y,c,y);for(var p=m.length,v=0;p>v;++v){var g=m[v];e.add(o,g,g);var w=i.cartesianToCartographic(g,F);n.project(w,g)}a=f.fromPoints(m,a),o=a.center;var E=o.x,x=o.y,S=o.z;return o.x=S,o.y=E,o.z=x,a},f.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersect=function(e){return f.intersect(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){return a.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?n.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(n.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e){a.supportsFullscreen()&&e[n.requestFullscreen]()},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;n>r;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(m)){m=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(m=!0,y=n(e[1]))}return m}function i(){return a()&&y}function o(){if(!t(p)&&(p=!1,!a()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(p=!0,v=n(e[1]))}return p}function u(){return o()&&v}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(g=!0,w=n(e[1]),w.isNightly=!!e[2])}return g}function c(){return s()&&w}function l(){if(!t(E)){E=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(E=!0,x=n(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(E=!0,x=n(e[1])))}return E}function f(){return l()&&x}function d(){if(!t(S)){S=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(S=!0,M=n(e[1]))}return S}function h(){return d()&&M}var m,y,p,v,g,w,E,x,S,M,O={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:d,firefoxVersion:h,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};return O.supportsFullscreen=function(){return r.supportsFullscreen()},O.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},O.supportsWebWorkers=function(){return"undefined"!=typeof Worker},O}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,r,n,a){"use strict";if(!n.supportsTypedArrays())return{};var i={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},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 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.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.FLOAT:return new Float32Array(t);case i.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},i.createArrayBufferView=function(t,n,a,o){switch(a=e(a,0),o=e(o,(n.byteLength-a)/i.getSizeInBytes(t)),t){case i.BYTE:return new Int8Array(n,a,o);case i.UNSIGNED_BYTE:return new Uint8Array(n,a,o);case i.SHORT:return new Int16Array(n,a,o);case i.UNSIGNED_SHORT:return new Uint16Array(n,a,o);case i.FLOAT:return new Float32Array(n,a,o);case i.DOUBLE:return new Float64Array(n,a,o);default:throw new r("componentDatatype is not a valid value.")}},a(i)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(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/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){var t=e._uSquared,r=e._ellipsoid.maximumRadius,n=e._ellipsoid.minimumRadius,a=(r-n)/r,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,m=Math.sqrt(h),y=t/4,p=y*y,v=p*y,g=p*p,w=1+y-3*p/4+5*v/4-175*g/64,E=1-y+15*p/8-35*v/8,x=1-3*y+35*p/4,S=1-5*y,M=w*l-E*Math.sin(2*l)*y/2-x*Math.sin(4*l)*p/16-S*Math.sin(6*l)*v/48-5*Math.sin(8*l)*g/512,O=e._constants;O.a=r,O.b=n,O.f=a,O.cosineHeading=i,O.sineHeading=o,O.tanU=u,O.cosineU=s,O.sineU=c,O.sigma=l,O.sineAlpha=f,O.sineSquaredAlpha=d,O.cosineSquaredAlpha=h,O.cosineAlpha=m,O.u2Over4=y,O.u4Over16=p,O.u6Over64=v,O.u8Over256=g,O.a0=w,O.a1=E,O.a2=x,O.a3=S,O.distanceRatio=M}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,r,n,a,i,o){var u=c(e,r);return(1-u)*e*t*(n+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,r,n,a,i,o){var s,c,f,d,h,m=(t-r)/t,y=i-n,p=Math.atan((1-m)*Math.tan(a)),v=Math.atan((1-m)*Math.tan(o)),g=Math.cos(p),w=Math.sin(p),E=Math.cos(v),x=Math.sin(v),S=g*E,M=g*x,O=w*x,_=w*E,T=y,P=u.TWO_PI,A=Math.cos(T),R=Math.sin(T);do{A=Math.cos(T),R=Math.sin(T);var N=M-_*A;f=Math.sqrt(E*E*R*R+N*N),c=O+S*A,s=Math.atan2(f,c);var z;0===f?(z=0,d=1):(z=S*R/f,d=1-z*z),P=T,h=c-2*O/d,isNaN(h)&&(h=0),T=y+l(m,z,d,s,f,c,h)}while(Math.abs(T-P)>u.EPSILON12);var C=d*(t*t-r*r)/(r*r),b=1+C*(4096+C*(C*(320-175*C)-768))/16384,I=C*(256+C*(C*(74-47*C)-128))/1024,D=h*h,U=I*f*(h+I*(c*(2*D-1)-I*h*(4*f*f-3)*(4*D-3)/6)/4),L=r*b*(s-U),q=Math.atan2(E*R,M-_*A),B=Math.atan2(g*R,M*A-_);e._distance=L,e._startHeading=q,e._endHeading=B,e._uSquared=C}function d(r,n,a,i){e.normalize(i.cartographicToCartesian(n,m),h),e.normalize(i.cartographicToCartesian(a,m),m),f(r,i.maximumRadius,i.minimumRadius,n.longitude,n.latitude,a.longitude,a.latitude),n.height=0,a.height=0,r._start=t.clone(n,r._start),r._end=t.clone(a,r._end),s(r)}var h=new e,m=new e,y=function(e,a,i){var u=r(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,n(e)&&n(a)&&d(this,e,a,u)};return a(y.prototype,{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}}}),y.prototype.setEndPoints=function(e,t){d(this,e,t,this._ellipsoid)},y.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},y.prototype.interpolateUsingSurfaceDistance=function(e,r){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),m=i*i,y=i*m,p=a.u8Over256,v=a.u2Over4,g=a.u6Over64,w=a.u4Over16,E=2*y*p*o/3+i*(1-v+7*w/4-15*g/4+579*p/64-(w-15*g/4+187*p/16)*o-(5*g/4-115*p/16)*u-29*p*s/16)+(v/2-w+71*g/32-85*p/16)*c+(5*w/16-5*g/4+383*p/96)*f-m*((g-11*p/2)*c+5*p*f/2)+(29*g/96-29*p/16)*d+539*p*h/1536,x=Math.asin(Math.sin(E)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(x));E-=a.sigma;var M=Math.cos(2*a.sigma+E),O=Math.sin(E),_=Math.cos(E),T=a.cosineU*_,P=a.sineU*O,A=Math.atan2(O*a.sineHeading,T-P*a.cosineHeading),R=A-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,E,O,_,M);return n(r)?(r.longitude=this._start.longitude+R,r.latitude=S,r.height=0,r):new t(this._start.longitude+R,S,0)},y}),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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,0>i?[i,0]:[0,i];var c=n*n,l=4*e*a,f=r(c,-l,t.EPSILON14);if(0>f)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,m=o*s-d,y=o*c-u*s,p=u*c-h,v=4*m*p-y*y;if(0>v){var g,w,E;d*f>=l*h?(g=o,w=m,E=-2*u*m+o*y):(g=c,w=p,E=-c*y+2*s*p);var x=0>E?-1:1,S=-x*Math.abs(g)*Math.sqrt(-v);i=-E+S;var M=i/2,O=0>M?-Math.pow(-M,1/3):Math.pow(M,1/3),_=i===S?-O:-w/O;return a=0>=w?O+_:-E/(O*O+_*_+w),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var T=m,P=-2*u*m+o*y,A=p,R=-c*y+2*s*p,N=Math.sqrt(v),z=Math.sqrt(3)/2,C=Math.abs(Math.atan2(o*N,-P)/3);a=2*Math.sqrt(-T);var b=Math.cos(C);i=a*b;var I=a*(-b/2-z*Math.sin(C)),D=i+I>2*u?i-u:I-u,U=o,L=D/U;C=Math.abs(Math.atan2(c*N,-R)/3),a=2*Math.sqrt(-A),b=Math.cos(C),i=a*b,I=a*(-b/2-z*Math.sin(C));var q=-c,B=2*s>i+I?i+s:I+s,F=q/B,W=U*B,G=-D*B-U*q,V=D*q,j=(s*G-u*V)/(-u*G+s*W);return j>=L?F>=L?F>=j?[L,j,F]:[L,F,j]:[F,L,j]:F>=L?[j,L,F]:F>=j?[j,F,L]:[F,j,L]}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=0>u?-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,0>u?[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 m=n.computeRealRoots(1,s,l);if(2===m.length){var y,p=m[0],v=m[1];if(p>=0&&v>=0){var g=Math.sqrt(p),w=Math.sqrt(v);return[d-w,d-g,d+g,d+w]}if(p>=0&&0>v)return y=Math.sqrt(p),[d-y,d+y];if(0>p&&v>=0)return y=Math.sqrt(v),[d-y,d+y]}return[]}if(h>0){var E=Math.sqrt(h),x=(s+h-c/E)/2,S=(s+h+c/E)/2,M=n.computeRealRoots(1,E,x),O=n.computeRealRoots(1,-E,S);return 0!==M.length?(M[0]+=d,M[1]+=d,0!==O.length?(O[0]+=d,O[1]+=d,M[1]<=O[0]?[M[0],M[1],O[0],O[1]]:O[1]<=M[0]?[O[0],O[1],M[0],M[1]]:M[0]>=O[0]&&M[1]<=O[1]?[O[0],M[0],M[1],O[1]]:O[0]>=M[0]&&O[1]<=M[1]?[M[0],O[0],O[1],M[1]]:M[0]>O[0]&&M[0]<O[1]?[O[0],M[0],O[1],M[1]]:[M[0],O[0],M[1],O[1]]):M):0!==O.length?(O[0]+=d,O[1]+=d,O):[]}}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 m,y,p=h[0],v=a-p,g=v*v,w=t/2,E=v/2,x=g-4*o,S=g+4*Math.abs(o),M=c-4*p,O=c+4*Math.abs(p);if(0>p||M*S>x*O){var _=Math.sqrt(M);m=_/2,y=0===_?0:(t*E-i)/_}else{var T=Math.sqrt(x);m=0===T?0:(t*E-i)/T,y=T/2}var P,A;0===w&&0===m?(P=0,A=0):r.sign(w)===r.sign(m)?(P=w+m,A=p/P):(A=w-m,P=p/A);var R,N;0===E&&0===y?(R=0,N=0):r.sign(E)===r.sign(y)?(R=E+y,N=o/R):(N=E-y,R=o/N);var z=n.computeRealRoots(1,P,R),C=n.computeRealRoots(1,A,N);if(0!==z.length)return 0!==C.length?z[1]<=C[0]?[z[0],z[1],C[0],C[1]]:C[1]<=z[0]?[C[0],C[1],z[0],z[1]]:z[0]>=C[0]&&z[1]<=C[1]?[C[0],z[0],z[1],C[1]]:C[0]>=z[0]&&C[1]<=z[1]?[z[0],C[0],C[1],z[1]]:z[0]>C[0]&&z[0]<C[1]?[C[0],z[0],C[1],z[1]]:[z[0],C[0],z[1],C[1]]:z;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,m=h*a,y=u*c*f-4*s*d-4*e*l*f+18*e*t*r*d-27*i*f*f+256*o*m+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 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,d=s/t,h=0>c?1:0;switch(h+=0>l?h+1:h,h+=0>f?h+1:h,h+=0>d?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 void 0}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=function(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n};return n.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},n}),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(t,n,a,o,u){u=r(u,!1);var s,c,l,f,d,h=t.origin,m=t.direction,y=e.subtract(a,n,p),x=e.subtract(o,n,v),S=e.cross(m,x,g),M=e.dot(y,S);if(u){if(M<i.EPSILON6)return void 0;if(s=e.subtract(h,n,w),l=e.dot(s,S),0>l||l>M)return void 0;if(c=e.cross(s,y,E),f=e.dot(m,c),0>f||l+f>M)return void 0;d=e.dot(x,c)/M}else{if(Math.abs(M)<i.EPSILON6)return void 0;var O=1/M;if(s=e.subtract(h,n,w),l=e.dot(s,S)*O,0>l||l>1)return void 0;if(c=e.cross(s,y,E),f=e.dot(m,c)*O,0>f||l+f>1)return void 0;d=e.dot(x,c)*O}return d}function f(e,t,r,n){var a=t*t-4*e*r;if(0>a)return void 0;if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);return 0===c?void 0:(n.root0=n.root1=c,n)}function d(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,g),l=e.dot(o,o),d=2*e.dot(o,c),h=e.magnitudeSquared(c)-s,m=f(l,d,h,S);return n(m)?(a.start=m.root0,a.stop=m.root1,a):void 0}function h(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 m(t,r,n,a,c){var l,f=a*a,d=c*c,m=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*d,y=c*(a*h(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+r.y),p=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*d+a*r.x+n,v=d*h(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),g=c*(a*h(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+r.z),w=[];if(0===g&&0===v){if(l=u.computeRealRoots(m,y,p),0===l.length)return w;var E=l[0],x=Math.sqrt(Math.max(1-E*E,0));if(w.push(new e(a,c*E,c*-x)),w.push(new e(a,c*E,c*x)),2===l.length){var S=l[1],M=Math.sqrt(Math.max(1-S*S,0));w.push(new e(a,c*S,c*-M)),w.push(new e(a,c*S,c*M))}return w}var O=g*g,_=v*v,T=m*m,P=g*v,A=T+_,R=2*(y*m+P),N=2*p*m+y*y-_+O,z=2*(p*y-P),C=p*p-O;if(0===A&&0===R&&0===N&&0===z)return w;l=s.computeRealRoots(A,R,N,z,C);var b=l.length;if(0===b)return w;for(var I=0;b>I;++I){var D,U=l[I],L=U*U,q=Math.max(1-L,0),B=Math.sqrt(q);D=i.sign(m)===i.sign(p)?h(m*L+p,y*U,i.EPSILON12):i.sign(p)===i.sign(y*U)?h(m*L,y*U+p,i.EPSILON12):h(m*L+y*U,p,i.EPSILON12);var F=h(v*U,g,i.EPSILON15),W=D*F;0>W?w.push(new e(a,c*U,c*B)):W>0?w.push(new e(a,c*U,c*-B)):0!==B?(w.push(new e(a,c*U,c*-B)),w.push(new e(a,c*U,c*B)),++I):w.push(new e(a,c*U,c*B))}return w}var y={};y.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)return void 0;var l=(-r.distance-e.dot(s,o))/c;return 0>l?void 0:(a=e.multiplyByScalar(u,l,a),e.add(o,a,a))};var p=new e,v=new e,g=new e,w=new e,E=new e;y.rayTriangle=function(t,r,a,i,o,u){var s=l(t,r,a,i,o);return!n(s)||0>s?void 0:(n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u))};var x=new c;y.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=x;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var f=l(c,a,i,o,u);return!n(f)||0>f||f>e.distance(t,r)?void 0:(n(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var S={root0:0,root1:0};y.raySphere=function(e,t,r){return r=d(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var M=new c;y.lineSegmentSphere=function(t,r,a,i){var o=M;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=d(o,a,i),!n(i)||i.stop<0||i.start>s?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i)};var O=new e,_=new e;y.rayEllipsoid=function(t,r){var n,a,i,o,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,O),l=e.multiplyComponents(s,t.direction,_),f=e.magnitudeSquared(c),d=e.dot(c,l);if(f>1){if(d>=0)return void 0;var h=d*d;if(n=f-1,a=e.magnitudeSquared(l),i=a*n,i>h)return void 0;if(h>i){o=d*d-i,u=-d+Math.sqrt(o);var m=u/a,y=n/u;return y>m?{start:m,stop:y}:{start:y,stop:m}}var p=Math.sqrt(n/a);return{start:p,stop:p}}return 1>f?(n=f-1,a=e.magnitudeSquared(l),i=a*n,o=d*d-i,u=-d+Math.sqrt(o),{start:0,stop:u/a}):0>d?(a=e.magnitudeSquared(l),{start:0,stop:-d/a}):void 0};var T=new e,P=new e,A=new e,R=new e,N=new e,z=new o,C=new o,b=new o,I=new o,D=new o,U=new o,L=new o,q=new e,B=new e,F=new t;y.grazingAltitudeLocation=function(t,r){var a=t.origin,u=t.direction,s=r.geodeticSurfaceNormal(a);if(e.dot(u,s)>=0)return a;var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u),f=e.normalize(l,T),d=e.mostOrthogonalAxis(l,R),h=e.normalize(e.cross(d,f,P),P),y=e.normalize(e.cross(f,h,A),A),p=z;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]=y.x,p[7]=y.y,p[8]=y.z;var v=o.transpose(p,C),g=o.fromScale(r.radii,b),w=o.fromScale(r.oneOverRadii,I),E=D;E[0]=0,E[1]=-u.z,E[2]=u.y,E[3]=u.z,E[4]=0,E[5]=-u.x,E[6]=-u.y,E[7]=u.x,E[8]=0;var x,S,M=o.multiply(o.multiply(v,w,U),E,U),O=o.multiply(o.multiply(M,g,L),p,L),_=o.multiplyByVector(M,a,N),W=m(O,e.negate(_,T),0,0,1),G=W.length;if(G>0){for(var V=e.clone(e.ZERO,B),j=Number.NEGATIVE_INFINITY,Y=0;G>Y;++Y){x=o.multiplyByVector(g,o.multiplyByVector(p,W[Y],q),q);var k=e.normalize(e.subtract(x,a,R),R),H=e.dot(k,u);H>j&&(j=H,V=e.clone(x,V))}var X=r.cartesianToCartographic(V,F);return j=i.clamp(j,0,1),S=e.magnitude(e.subtract(V,a,R))*Math.sqrt(1-j*j),S=c?-S:S,X.height=S,r.cartographicToCartesian(X)}return void 0};var W=new e;return y.lineSegmentPlane=function(t,r,a,o){n(o)||(o=new e);var u=e.subtract(r,t,W),s=a.normal,c=e.dot(s,u);if(Math.abs(c)<i.EPSILON6)return void 0;var l=e.dot(s,t),f=-(a.distance+l)/c;return 0>f||f>1?void 0:(e.multiplyByScalar(u,f,o),e.add(t,o,o),o)},y.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 y.lineSegmentPlane(t,r,a,f),y.lineSegmentPlane(t,n,a,d),{positions:[t,r,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return y.lineSegmentPlane(r,n,a,f),y.lineSegmentPlane(r,t,a,d),{positions:[t,r,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return y.lineSegmentPlane(n,t,a,f),y.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 y.lineSegmentPlane(r,t,a,f),y.lineSegmentPlane(n,t,a,d),{positions:[t,r,n,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return y.lineSegmentPlane(n,r,a,f),y.lineSegmentPlane(t,r,a,d),{positions:[t,r,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return y.lineSegmentPlane(t,n,a,f),y.lineSegmentPlane(r,n,a,d),{positions:[t,r,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},y}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(t,r){this.normal=e.clone(t),this.distance=r};return r.fromPointNormal=function(n,a,i){var o=-e.dot(a,n);return t(i)?(e.clone(a,i.normal),i.distance=o,i):new r(a,o)},r.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},r}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(e,t,r){var n,a=new Array(e);if(t===r){for(n=0;e>n;n++)a[n]=t;return a}var i=r-t,o=i/e;for(n=1;e>n;n++){var u=t+n*o;a[n]=u}return a[0]=t,a}function h(t,r,n,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,P),l=a.scaleToGeodeticSurface(r,A),f=m.numberOfPoints(t,r,n),h=a.cartesianToCartographic(c,O),y=a.cartesianToCartographic(l,_),p=d(f,i,o);R.setEndPoints(h,y);var v=R.surfaceDistance/f,g=s;h.height=i;var w=a.cartographicToCartesian(h,T);e.pack(w,u,g),g+=3;for(var E=1;f>E;E++){var x=R.interpolateUsingSurfaceDistance(E*v,_);x.height=p[E],w=a.cartographicToCartesian(x,T),e.pack(w,u,g),g+=3}return g}var m={};m.numberOfPoints=function(t,r,n){var a=e.angleBetween(t,r);return Math.ceil(a/n)};var y=new t;m.extractHeights=function(e,t){for(var r=e.length,n=new Array(r),a=0;r>a;a++){var i=e[a];n[a]=t.cartesianToCartographic(i,y).height}return n};var p=new l,v=new e,g=new e,w=new f(e.ZERO,0),E=new e,x=new f(e.ZERO,0),S=new e,M=new e,O=new t,_=new t,T=new e,P=new e,A=new e,R=new o;return m.wrapLongitude=function(t,a){var i=[],o=[];if(n(t)&&t.length>0){a=r(a,l.IDENTITY);var s=l.inverseTransformation(a,p),c=l.multiplyByPoint(s,e.ZERO,v),d=l.multiplyByPointAsVector(s,e.UNIT_Y,g),h=f.fromPointNormal(c,d,w),m=l.multiplyByPointAsVector(s,e.UNIT_X,E),y=f.fromPointNormal(c,m,x),O=1;i.push(e.clone(t[0]));for(var _=i[0],T=t.length,P=1;T>P;++P){var A=t[P];if(f.getPointDistance(y,_)<0||f.getPointDistance(y,A)<0){var R=u.lineSegmentPlane(_,A,h,S);if(n(R)){var N=e.multiplyByScalar(d,5e-9,M);f.getPointDistance(h,_)<0&&e.negate(N,N),i.push(e.add(R,N,new e)),o.push(O+1),e.negate(N,N),i.push(e.add(R,N,new e)),O=1}}i.push(e.clone(t[P])),O++,_=A}o.push(O)}return{positions:i,lengths:o}},m.removeDuplicates=function(t){var r=t.length;if(2>r)return void 0;var n,a,i;for(n=1;r>n&&(a=t[n-1],i=t[n],!e.equals(a,i));++n);if(n===r)return void 0;var o=[];for(o.push(t[0]);r>n;++n)a=t[n-1],i=t[n],e.equals(a,i)||o.push(e.clone(i));return o},m.generateArc=function(t){n(t)||(t={});var a,o,u,l=t.positions,f=r(t.ellipsoid,i.WGS84),d=r(t.height,0),y=r(t.granularity,c.RADIANS_PER_DEGREE),p=l.length,v=0;for(a=0;p-1>a;a++)o=l[a],u=l[a+1],v+=m.numberOfPoints(o,u,y);v++;var g=3*v,w=new Array(g),E=0;for(a=0;p-1>a;a++){o=l[a],u=l[a+1];var x,S;s(d)?(x=d[a],S=d[a+1]):(x=d,S=d),E=h(o,u,y,f,x,S,w,E)}var M=l[p-1],_=f.cartesianToCartographic(M,O);_.height=s(d)?d[p-1]:d;var P=f.cartographicToCartesian(_,T);return e.pack(P,w,g-3),w},m.generateCartesianArc=function(t){for(var r=m.generateArc(t),n=r.length/3,a=new Array(n),i=0;n>i;i++)a[i]=e.unpack(r,3*i);return a},m}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i=function(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){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n]=t.y},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.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.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.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.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n},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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.x+", "+this.y+")"},i}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,r,n,a){"use strict";var i=function(n,a,i){this.minimum=e.clone(t(n,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),r(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,n){if(r(n)||(n=new i),!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 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;f>d;d++){var h=t[d],m=h.x,y=h.y,p=h.z;a=Math.min(m,a),s=Math.max(m,s),o=Math.min(y,o),c=Math.max(y,c),u=Math.min(p,u),l=Math.max(p,l)}var v=n.minimum;v.x=a,v.y=o,v.z=u;var g=n.maximum;g.x=s,g.y=c,g.z=l;var w=e.add(v,g,n.center);return e.multiplyByScalar(w,.5,w),n},i.clone=function(t,n){return r(t)?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 i(t.minimum,t.maximum):void 0},i.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 i.intersect=function(t,r){o=e.subtract(t.maximum,t.minimum,o);var n=e.multiplyByScalar(o,.5,o),i=n.x*Math.abs(r.x)+n.y*Math.abs(r.y)+n.z*Math.abs(r.z),u=e.dot(t.center,r)+r.w;return u-i>0?a.INSIDE:0>u+i?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersect=function(e){return i.intersect(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),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(n){return i(n)}});return r}function i(e){var r=new n(function(r,n){try{return n?t(n(e)):i(e)}catch(a){return i(a)}});return r}function o(){function e(e,t,r){return d(e,t,r)}function r(e){return m(e)}function a(e){return m(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,m;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(t){n.progress(t)}}: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 y(f,e),e},m=function(e){return e=t(e),d=e.then,m=t,h=v,y(l,e),f=l=x,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){y(e)}function s(e){m(e)}var c,l,f,d,h,m,y,p,g,w;if(g=t.length>>>0,c=Math.max(0,Math.min(r,g)),f=[],l=g-c+1,d=[],h=o(),c)for(p=h.progress,y=function(e){d.push(e),--l||(m=y=v,h.reject(d))},m=function(e){f.push(e),--c||(m=y=v,h.resolve(f))},w=0;g>w;++w)w in t&&e(t[w],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,g).then(t,r,n)}function f(){return d(arguments,g)}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;a>s;s++)s in t?u(t[s],s):--i;else c.resolve(n);return c.promise})}function h(t,r){var n=E.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)})})},w.apply(t,n)})}function m(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 y(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 v(){}function g(e){return e}var w,E,x;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=m,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(x,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(x,t)})})}},E=[].slice,w=[].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(;a>i;++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(){"use strict";var e=function(e,t,r){for(var n,a,i=0,o=e.length-1;o>=i;)if(n=~~((i+o)/2),a=r(e[n],t),0>a)i=n+1;else{if(!(a>0))return n;o=n-1}return~(o+1)};return e}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";var e=function(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,m,y,p,v;if("%%"==e)return"%";for(var g=!1,w="",E=!1,x=!1,S=" ",M=s.length,O=0;s&&M>O;O++)switch(s.charAt(O)){case" ":w=" ";break;case"+":w="+";break;case"-":g=!0;break;case"'":S=s.charAt(O+1);break;case"0":E=!0;break;case"#":x=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(c=-c,g=!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,v=n?t[n.slice(0,-1)]:t[r++],d){case"s":return u(String(v),g,c,f,E,S);case"c":return u(String.fromCharCode(+v),g,c,f,E);case"b":return o(v,2,x,g,c,f,E);case"o":return o(v,8,x,g,c,f,E);case"x":return o(v,16,x,g,c,f,E);case"X":return o(v,16,x,g,c,f,E).toUpperCase();case"u":return o(v,10,x,g,c,f,E);case"i":case"d":return h=+v||0,h=Math.round(h-h%1),m=0>h?"-":w,v=m+a(String(Math.abs(h)),f,"0",!1),i(v,m,g,c,E);case"e":case"E":case"f":case"F":case"g":case"G":return h=+v,m=0>h?"-":w,y=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],v=m+Math.abs(h)[y](f),i(v,m,g,c,E)[p]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";var e=function(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(){"use strict";function e(e){return 0===e%4&&0!==e%100||0===e%400}return e}),define("Core/LeapSecond",[],function(){"use strict";var e=function(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 R.compare(e.julianDate,t.julianDate)}function f(e){g.julianDate=e;var r=R.leapSeconds,n=t(r,g,l);0>n&&(n=~n),n>=r.length&&(n=r.length-1);var a=r[n].offset;if(n>0){var i=R.secondsDifference(r[n].julianDate,e);i>a&&(n--,a=r[n].offset)}R.addSeconds(e,a,e)}function d(e,r){g.julianDate=e;var n=R.leapSeconds,a=t(n,g,l);if(0>a&&(a=~a),0===a)return R.addSeconds(e,-n[0].offset,r);if(a>=n.length)return R.addSeconds(e,-n[a-1].offset,r);var i=R.secondsDifference(n[a].julianDate,e);return 0===i?R.addSeconds(e,-n[a].offset,r):1>=i?void 0:R.addSeconds(e,-n[--a].offset,r)}function h(e,t,r){var n=0|t/s.SECONDS_PER_DAY;return e+=n,t-=s.SECONDS_PER_DAY*n,0>t&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function m(e,t,r,n,a,i,o){var u=0|(t-14)/12,c=e+4800+u,l=(0|1461*c/4)+(0|367*(t-2-12*u)/12)-(0|3*((c+100)/100)/4)+r-32075;n-=12,0>n&&(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]}var y=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,g=new u,w=/^(\d{4})$/,E=/^(\d{4})-(\d{2})$/,x=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,M=/^(\d{4})-?(\d{2})-?(\d{2})$/,O=/([Z+\-])?(\d{2})?:?(\d{2})?$/,_=/^(\d{2})(\.\d+)?/.source+O.source,T=/^(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,P=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,A="Invalid ISO 8601 date.",R=function(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)};R.fromDate=function(e,t){var r=m(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 R(r[0],r[1],c.UTC)},R.fromIso8601=function(e,t){e=e.replace(",",".");var r,i,u,s=e.split("T"),l=1,d=1,y=0,g=0,O=0,N=0,z=s[0],C=s[1];if(!n(z))throw new a(A);var b;if(s=z.match(M),null!==s){if(b=z.split("-").length-1,b>0&&2!==b)throw new a(A);r=+s[1],l=+s[2],d=+s[3]}else if(s=z.match(E),null!==s)r=+s[1],l=+s[2];else if(s=z.match(w),null!==s)r=+s[1];else{var I;if(s=z.match(x),null!==s){if(r=+s[1],I=+s[2],u=o(r),1>I||u&&I>366||!u&&I>365)throw new a(A)}else{if(s=z.match(S),null===s)throw new a(A);r=+s[1];var D=+s[2],U=+s[3]||0;if(b=z.split("-").length-1,b>0&&(!n(s[3])&&1!==b||n(s[3])&&2!==b))throw new a(A);var L=new Date(Date.UTC(r,0,4));I=7*D+U-L.getUTCDay()-3}i=new Date(Date.UTC(r,0,1)),i.setUTCDate(I),l=i.getUTCMonth()+1,d=i.getUTCDate()}if(u=o(r),1>l||l>12||1>d||(2!==l||!u)&&d>p[l-1]||u&&2===l&&d>v)throw new a(A);var q;if(n(C)){if(s=C.match(P),null!==s){if(b=C.split(":").length-1,b>0&&2!==b&&3!==b)throw new a(A);y=+s[1],g=+s[2],O=+s[3],N=1e3*+(s[4]||0),q=5}else if(s=C.match(T),null!==s){if(b=C.split(":").length-1,b>0&&1!==b)throw new a(A);y=+s[1],g=+s[2],O=60*+(s[3]||0),q=4}else{if(s=C.match(_),null===s)throw new a(A);y=+s[1],g=60*+(s[2]||0),q=3}if(g>=60||O>=61||y>24||24===y&&(g>0||O>0||N>0))throw new a(A);var B=s[q],F=+s[q+1],W=+(s[q+2]||0);switch(B){case"+":y-=F,g-=W;break;case"-":y+=F,g+=W;break;case"Z":break;default:g+=new Date(Date.UTC(r,l-1,d,y,g)).getTimezoneOffset()}}else g+=new Date(Date.UTC(r,l-1,d)).getTimezoneOffset();var G=60===O;for(G&&O--;g>=60;)g-=60,y++;for(;y>=24;)y-=24,d++;for(i=u&&2===l?v:p[l-1];d>i;)d-=i,l++,l>12&&(l-=12,r++),i=u&&2===l?v:p[l-1];for(;0>g;)g+=60,y--;for(;0>y;)y+=24,d--;for(;1>d;)l--,1>l&&(l+=12,r--),i=u&&2===l?v:p[l-1],d+=i;var V=m(r,l,d,y,g,O,N);return n(t)?(h(V[0],V[1],t),f(t)):t=new R(V[0],V[1],c.UTC),G&&R.addSeconds(t,1,t),t},R.now=function(e){return R.fromDate(new Date,e)};var N=new R(0,0,c.TAI);return R.toGregorianDate=function(e,t){var r=!1,a=d(e,N);n(a)||(R.addSeconds(e,-1,N),a=d(N,N),r=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=0|o+68569,l=0|4*c/146097;c=0|c-(0|(146097*l+3)/4);var f=0|4e3*(c+1)/1461001;c=0|c-(0|1461*f/4)+31;var h=0|80*c/2447,m=0|c-(0|2447*h/80);c=0|h/11;var y=0|h+2-12*c,p=0|100*(l-49)+f+c,v=0|u/s.SECONDS_PER_HOUR,g=u-v*s.SECONDS_PER_HOUR,w=0|g/s.SECONDS_PER_MINUTE;g-=w*s.SECONDS_PER_MINUTE;var E=0|g,x=(g-E)/s.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),r&&(E+=1),n(t)?(t.year=p,t.month=y,t.day=m,t.hour=v,t.minute=w,t.second=E,t.millisecond=x,t.isLeapSecond=r,t):new i(p,y,m,v,w,E,x,r)},R.toDate=function(e){var t=R.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))},R.toIso8601=function(t,r){var a,i=R.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))},R.clone=function(e,t){return n(e)?n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new R(e.dayNumber,e.secondsOfDay,c.TAI):void 0},R.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},R.equals=function(e,t){return e===t||n(e)&&n(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},R.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(R.secondsDifference(e,t))<=r},R.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},R.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},R.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,n=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+n},R.computeTaiMinusUtc=function(e){g.julianDate=e;var r=R.leapSeconds,n=t(r,g,l);return 0>n&&(n=~n,--n,0>n&&(n=0)),r[n].offset},R.addSeconds=function(e,t,r){return h(e.dayNumber,e.secondsOfDay+t,r)},R.addMinutes=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,n,r)},R.addHours=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,n,r)},R.addDays=function(e,t,r){var n=e.dayNumber+t;return h(n,e.secondsOfDay,r)},R.lessThan=function(e,t){return R.compare(e,t)<0},R.lessThanOrEquals=function(e,t){return R.compare(e,t)<=0},R.greaterThan=function(e,t){return R.compare(e,t)>0},R.greaterThanOrEquals=function(e,t){return R.compare(e,t)>=0},R.prototype.clone=function(e){return R.clone(this,e)},R.prototype.equals=function(e){return R.equals(this,e)},R.prototype.equalsEpsilon=function(e,t){return R.equalsEpsilon(this,e,t)},R.prototype.toString=function(){return R.toIso8601(this)},R.leapSeconds=[new u(new R(2441317,43210,c.TAI),10),new u(new R(2441499,43211,c.TAI),11),new u(new R(2441683,43212,c.TAI),12),new u(new R(2442048,43213,c.TAI),13),new u(new R(2442413,43214,c.TAI),14),new u(new R(2442778,43215,c.TAI),15),new u(new R(2443144,43216,c.TAI),16),new u(new R(2443509,43217,c.TAI),17),new u(new R(2443874,43218,c.TAI),18),new u(new R(2444239,43219,c.TAI),19),new u(new R(2444786,43220,c.TAI),20),new u(new R(2445151,43221,c.TAI),21),new u(new R(2445516,43222,c.TAI),22),new u(new R(2446247,43223,c.TAI),23),new u(new R(2447161,43224,c.TAI),24),new u(new R(2447892,43225,c.TAI),25),new u(new R(2448257,43226,c.TAI),26),new u(new R(2448804,43227,c.TAI),27),new u(new R(2449169,43228,c.TAI),28),new u(new R(2449534,43229,c.TAI),29),new u(new R(2450083,43230,c.TAI),30),new u(new R(2450630,43231,c.TAI),31),new u(new R(2451179,43232,c.TAI),32),new u(new R(2453736,43233,c.TAI),33),new u(new R(2454832,43234,c.TAI),34),new u(new R(2456109,43235,c.TAI),35)],R}),define("Core/clone",["./defaultValue"],function(e){"use strict";var t=function(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";var e=function(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";var r=function(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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,r,n,a,i){"use strict";function o(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function u(e,t){for(var r=o(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 s(e,r){r=t(r,"");var a=e[1],i=!!e[2],s=e[3];switch(r){case"":case"text":return o(i,s);case"arraybuffer":return u(i,s);case"blob":var c=u(i,s);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(o(i,s),a);case"json":return JSON.parse(o(i,s));default:throw new n("Unhandled responseType: "+r)}}var c=function(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,a=t(r.method,"GET"),i=r.data,o=r.headers,u=r.overrideMimeType,s=r.withCredentials;return e(r.url,function(t){var r=e.defer();return c.load(t,n,a,i,o,r,u,s),r.promise})},l=/^data:(.*?)(;base64)?,(.*)$/;return c.load=function(e,t,n,o,u,c,f,d){var h=l.exec(e);if(null!==h)return c.resolve(s(h,t)),void 0;var m=new XMLHttpRequest;if(r(f)&&r(m.overrideMimeType)&&m.overrideMimeType(f),m.open(n,e,!0),r(u))for(var y in u)u.hasOwnProperty(y)&&m.setRequestHeader(y,u[y]);r(t)&&(m.responseType=t),r(d)&&(m.withCredentials=d),m.onload=function(){200===m.status?r(m.response)?c.resolve(m.response):r(m.responseXML)&&m.responseXML.hasChildNodes()?c.resolve(m.responseXML):r(m.responseText)?c.resolve(m.responseText):c.reject(new i("unknown XMLHttpRequest response type.")):c.reject(new a(m.status,m.response,m.getAllResponseHeaders()))},m.onerror=function(){c.reject(new a)},m.send(o)},c.defaultLoad=c.load,c}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";var r=function(r,n){return e({url:r,headers:t(n)?n.headers:void 0,overrideMimeType:t(n)?n.overrideMimeType:void 0,withCredentials:t(n)?n.withCredentials:void 0})};return r}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";var a={Accept:"application/json,*/*;q=0.01"},i=function(r,i){return t(i)||(i={}),t(i.headers)?t(i.headers.Accept)||(i.headers=e(i.headers),i.headers.Accept=a.Accept):i.headers=a,n(r,i).then(function(e){return JSON.parse(e)})};return i}),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(e,t){return o.compare(e.julianDate,t) -}function h(e,r){if(!n(r.columnNames))return e._dataError="Error in loaded EOP data: The columnNames property is required.",void 0;if(!n(r.samples))return e._dataError="Error in loaded EOP data: The samples property is required.",void 0;var a=r.columnNames.indexOf("modifiedJulianDateUtc"),i=r.columnNames.indexOf("xPoleWanderRadians"),s=r.columnNames.indexOf("yPoleWanderRadians"),c=r.columnNames.indexOf("ut1MinusUtcSeconds"),h=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),m=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),y=r.columnNames.indexOf("taiMinusUtcSeconds");if(0>a||0>i||0>s||0>c||0>h||0>m||0>y)return e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns",void 0;var p=e._samples=r.samples,v=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=m,e._taiMinusUtcSecondsColumn=y,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var g,w=e._addNewLeapSeconds,E=0,x=p.length;x>E;E+=e._columnCount){var S=p[E+a],M=p[E+y],O=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,_=new o(O,M,f.TAI);if(v.push(_),w){if(M!==g&&n(g)){var T=o.leapSeconds,P=t(T,_,d);if(0>P){var A=new u(_,M);T.splice(~P,0,A)}}g=M}}}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 y(e,t,r){return t+e*(r-t)}function p(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,p=r[d+e._ut1MinusUtcSecondsColumn],v=r[h+e._ut1MinusUtcSecondsColumn],g=v-p;if(g>.5||-.5>g){var w=r[d+e._taiMinusUtcSecondsColumn],E=r[h+e._taiMinusUtcSecondsColumn];w!==E&&(l.equals(n)?p=v:v-=E-w)}return u.xPoleWander=y(f,r[d+e._xPoleWanderRadiansColumn],r[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=y(f,r[d+e._yPoleWanderRadiansColumn],r[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=y(f,r[d+e._xCelestialPoleOffsetRadiansColumn],r[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=y(f,r[d+e._yCelestialPoleOffsetRadiansColumn],r[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=y(f,p,v),u}var v=function(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))h(this,t.data);else if(n(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){h(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else h(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})};return v.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}}),v.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},v.prototype.compute=function(e,r){if(!n(this._samples)){if(n(this._dataError))throw new c(this._dataError);return void 0}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),m=!n(d),y=m||o.greaterThanOrEquals(d,e);if(h&&y)return s=u,!m&&d.equals(e)&&++s,l=s+1,p(this,i,this._samples,e,s,l,r),r}var v=t(i,e,o.compare,this._dateColumn);return v>=0?(v<i.length-1&&i[v+1].equals(e)&&++v,s=v,l=v):(l=~v,s=l-1,0>s&&(s=0)),this._lastIndex=s,p(this,i,this._samples,e,s,l,r),r},v}),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()):(r.path=t.authority&&""==t.path?"/"+this.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];for(n&&t.shift(),""==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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","require"],function(e,t,r,n){"use strict";function a(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;r>t;++t){var n=e[t].getAttribute("src"),a=f.exec(n);if(null!==a)return a[1]}return void 0}function i(){if(t(s))return s;var n;if(n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:a(),!t(n))throw new r("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return s=new e(n).resolve(new e(document.location.href))}function o(e){return n.toUrl("../"+e)}function u(t){return new e(t).resolve(i()).toString()}var s,c,l,f=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i,d=function(e){t(c)||(c=t(n.toUrl)?o:u),t(l)||(l=document.createElement("a"));var r=c(e);return l.href=r,l.href=l.href,l.href};return d._cesiumScriptRegex=f,d}),define("Core/Iau2006XysSample",[],function(){"use strict";var e=function(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,t,r){var n=f;return n.dayNumber=t,n.secondsOfDay=r,i.daysDifference(n,e._sampleZeroDateTT)}function c(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=3*a*r._samplesPerXysFile,u=0,s=n.length;s>u;++u)t[o+u]=n[u];i.resolve()}),i.promise}var l=function(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;t>=s;++s){n[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;t>=c;++c)c!==s&&(n[s]*=s-c);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)},f=new i(0,0,u.TAI);return l.prototype.preload=function(t,r,n,a){var i=s(this,t,r),o=s(this,n,a),u=0|i/this._stepSizeDays-this._interpolationOrder/2;0>u&&(u=0);var l=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var f=0|u/this._samplesPerXysFile,d=0|l/this._samplesPerXysFile,h=[],m=f;d>=m;++m)h.push(c(this,m));return e.all(h)},l.prototype.computeXysRadians=function(e,t,r){var i=s(this,e,t);if(0>i)return void 0;var o=0|i/this._stepSizeDays;if(o>=this._totalSamples)return void 0;var u=this._interpolationOrder,l=o-(0|u/2);0>l&&(l=0);var f=l+u;f>=this._totalSamples&&(f=this._totalSamples-1,l=f-u,0>l&&(l=0));var d=!1,h=this._samples;if(n(h[3*l])||(c(this,0|l/this._samplesPerXysFile),d=!0),n(h[3*f])||(c(this,0|f/this._samplesPerXysFile),d=!0),d)return void 0;n(r)?(r.x=0,r.y=0,r.s=0):r=new a(0,0,0);var m,y,p=i-l*this._stepSizeDays,v=this._work,g=this._denominators,w=this._coef,E=this._xTable;for(m=0;u>=m;++m)v[m]=p-E[m];for(m=0;u>=m;++m){for(w[m]=1,y=0;u>=y;++y)y!==m&&(w[m]*=v[y]);w[m]*=g[m];var x=3*(l+m);r.x+=w[m]*h[x++],r.y+=w[m]*h[x++],r.s+=w[m]*h[x]}return r},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./TimeConstants"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,m,y,p){"use strict";var v={},g=new r,w=new r,E=new r;v.eastNorthUpToFixedFrame=function(e,t,n){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return i(n)?(n[0]=0,n[1]=1,n[2]=0,n[3]=0,n[4]=-o,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=o,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new y(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=g,s=w,l=E;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),i(n)?(n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=l.x,n[5]=l.y,n[6]=l.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 y(s.x,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var x=new r,S=new r,M=new r;v.northEastDownToFixedFrame=function(e,t,n){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return i(n)?(n[0]=-o,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]=-o,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new y(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=x,s=S,l=M;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),i(n)?(n[0]=l.x,n[1]=l.y,n[2]=l.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 y(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},v.northUpEastToFixedFrame=function(e,t,n){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return i(n)?(n[0]=-o,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=o,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 y(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=g,s=w,l=E;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),i(n)?(n[0]=l.x,n[1]=l.y,n[2]=l.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 y(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 O=24110.54841,_=8640184.812866,T=.093104,P=-62e-7,A=1.1772758384668e-19,R=72921158553e-15,N=h.TWO_PI/86400,z=new d;v.computeTemeToPseudoFixedMatrix=function(e,t){z=d.addSeconds(e,-d.computeTaiMinusUtc(e),z);var r,n=z.dayNumber,a=z.secondsOfDay,o=n-2451545;r=a>=43200?(o+.5)/p.DAYS_PER_JULIAN_CENTURY:(o-.5)/p.DAYS_PER_JULIAN_CENTURY;var u=O+r*(_+r*(T+r*P)),s=u*N%h.TWO_PI,c=R+A*(n-2451545.5),l=(a+.5*p.SECONDS_PER_DAY)%p.SECONDS_PER_DAY,f=s+c*l,y=Math.cos(f),v=Math.sin(f);return i(t)?(t[0]=y,t[1]=-v,t[2]=0,t[3]=v,t[4]=y,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(y,v,0,-v,y,0,0,0,1)},v.iau2006XysData=new l,v.earthOrientationParameters=u.NONE;var C=32.184,b=2451545;v.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+C,a=t.stop.dayNumber,i=t.stop.secondsOfDay+C,o=v.iau2006XysData.preload(r,n,a,i),u=v.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},v.computeIcrfToFixedMatrix=function(e,t){i(t)||(t=new m);var r=v.computeFixedToIcrfMatrix(e,t);return i(r)?m.transpose(r,t):void 0};var I=new f(0,0,0),D=new s(0,0,0,0,0,0),U=new m,L=new m;v.computeFixedToIcrfMatrix=function(e,t){i(t)||(t=new m);var r=v.earthOrientationParameters.compute(e,D);if(!i(r))return void 0;var n=e.dayNumber,a=e.secondsOfDay+C,o=v.iau2006XysData.computeXysRadians(n,a,I);if(!i(o))return void 0;var u=o.x+r.xPoleOffset,s=o.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=U;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(-o.s,L),y=m.multiply(l,f,U),g=e.dayNumber,w=e.secondsOfDay-d.computeTaiMinusUtc(e)+r.ut1MinusUtc,E=g-2451545,x=w/p.SECONDS_PER_DAY,S=.779057273264+x+.00273781191135448*(E+x);S=S%1*h.TWO_PI;var M=m.fromRotationZ(S,L),O=m.multiply(y,M,U),_=Math.cos(r.xPoleWander),T=Math.cos(r.yPoleWander),P=Math.sin(r.xPoleWander),A=Math.sin(r.yPoleWander),R=n-b+a/p.SECONDS_PER_DAY;R/=36525;var N=-47e-6*R*h.RADIANS_PER_DEGREE/3600,z=Math.cos(N),q=Math.sin(N),B=L;return B[0]=_*z,B[1]=_*q,B[2]=P,B[3]=-T*q+A*P*z,B[4]=T*z+A*P*q,B[5]=-A*_,B[6]=-A*q-T*P*z,B[7]=A*z-T*P*q,B[8]=T*_,m.multiply(O,B,t)};var q=new n;return 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,o){i(o)||(o=new t);var u=q;return y.multiplyByVector(e,n.fromElements(a.x,a.y,a.z,1,u),u),n.multiplyByScalar(u,1/u.w,u),y.multiplyByVector(r,u,u),t.fromCartesian4(u,o)},v}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h){"use strict";var m=new n,y=function(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var n=h.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=r.fromCartesian4(l.getColumn(n,0,m)),this._yAxis=r.fromCartesian4(l.getColumn(n,1,m));var i=r.fromCartesian4(l.getColumn(n,2,m));this._plane=f.fromPointNormal(e,i)};o(y.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}}});var p=new e;y.fromPoints=function(t,r){var n=e.fromPoints(t,p);return new y(n.center,r)};var v=new d,g=new r;y.prototype.projectPointOntoPlane=function(e,n){var a=v;a.origin=e,r.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,g);if(i(o)||(r.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,g)),i(o)){var u=r.subtract(o,this._origin,o),s=r.dot(this._xAxis,u),l=r.dot(this._yAxis,u);return i(n)?(n.x=s,n.y=l,n):new t(s,l)}return void 0},y.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var r=0,n=e.length,a=0;n>a;a++){var o=this.projectPointOntoPlane(e[a],t[r]);i(o)&&(t[r]=o,r++)}return t.length=r,t};var w=new r;return y.prototype.projectPointsOntoEllipsoid=function(e,t){var n=e.length;i(t)?t.length=n:t=new Array(n);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=w,l=0;n>l;++l){var f=e[l];r.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new r);var d=r.add(o,c,t[l]);r.multiplyByScalar(s,f.y,c),r.add(d,c,d),a.scaleToGeocentricSurface(d,d)}return t},y}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,n,a,i,o,u){"use strict";var s=function(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)},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],m=e[u.COLUMN2ROW2],y=d+h+m;if(y>0)n=Math.sqrt(y+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,v=0;h>d&&(v=1),m>d&&m>h&&(v=2);var g=p[v],w=p[g];n=Math.sqrt(e[u.getElementIndex(v,v)]-e[u.getElementIndex(g,g)]-e[u.getElementIndex(w,w)]+1);var E=f;E[v]=.5*n,n=.5/n,c=(e[u.getElementIndex(w,g)]-e[u.getElementIndex(g,w)])*n,E[g]=(e[u.getElementIndex(g,v)]+e[u.getElementIndex(v,g)])*n,E[w]=(e[u.getElementIndex(w,v)]+e[u.getElementIndex(v,w)])*n,a=-E[0],i=-E[1],o=-E[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 e,h=new e,m=new s,y=new s,p=new s;s.packedLength=4,s.pack=function(e,r,n){n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w},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,p),s.conjugate(p,p);for(var a=0,i=r-t+1;i>a;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,d);var u=s.computeAngle(m);n[o]=d.x*u,n[o+1]=d.y*u,n[o+2]=d.z*u}},s.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new s),e.fromArray(t,0,h);var u=e.magnitude(h);return s.unpack(n,4*i,y),0===u?s.clone(s.IDENTITY,m):s.fromAxisAngle(h,u,m),s.multiply(m,y,o)},s.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w):void 0},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,m=o*l-n*u-a*s-i*c;return r.x=f,r.y=d,r.z=h,r.w=m,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 v=new s;s.lerp=function(e,t,r,n){return v=s.multiplyByScalar(t,r,v),n=s.multiplyByScalar(e,1-r,n),s.add(v,n,n)};var g=new s,w=new s,E=new s;s.slerp=function(e,t,r,n){var a=s.dot(e,t),i=t;if(0>a&&(a=-a,i=g=s.negate(t,g)),1-a<o.EPSILON6)return s.lerp(e,i,r,n);var u=Math.acos(a);return w=s.multiplyByScalar(e,Math.sin((1-r)*u),w),E=s.multiplyByScalar(i,Math.sin(r*u),E),n=s.add(w,E,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 x=new e,S=new e,M=new s,O=new s;s.computeInnerQuadrangle=function(t,r,n,a){var i=s.conjugate(r,M);s.multiply(i,n,O);var o=s.log(O,x);s.multiply(i,t,O);var u=s.log(O,S);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,M),s.multiply(r,M,a)},s.squad=function(e,t,r,n,a,i){var o=s.slerp(e,t,a,M),u=s.slerp(r,n,a,O);return s.slerp(o,u,2*a*(1-a),i)};for(var _=new s,T=1.9011074535173003,P=a.supportsTypedArrays()?new Float32Array(8):[],A=a.supportsTypedArrays()?new Float32Array(8):[],R=a.supportsTypedArrays()?new Float32Array(8):[],N=a.supportsTypedArrays()?new Float32Array(8):[],z=0;7>z;++z){var C=z+1,b=2*C+1;P[z]=1/(C*b),A[z]=C/b}return P[7]=T/136,A[7]=8*T/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)R[f]=(P[f]*c-A[f])*o,N[f]=(P[f]*l-A[f])*o;var d=a*r*(1+R[0]*(1+R[1]*(1+R[2]*(1+R[3]*(1+R[4]*(1+R[5]*(1+R[6]*(1+R[7])))))))),h=u*(1+N[0]*(1+N[1]*(1+N[2]*(1+N[3]*(1+N[4]*(1+N[5]*(1+N[6]*(1+N[7])))))))),m=s.multiplyByScalar(e,h,_);return s.multiplyByScalar(t,d,n),s.add(m,n,n)},s.fastSquad=function(e,t,r,n,a,i){var o=s.fastSlerp(e,t,a,M),u=s.fastSlerp(r,n,a,O);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/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(e,t){for(var r=new Array(e.length),n=0;n<e.length;n++){var a=e[n];I=t.cartesianToCartographic(a,I),r[n]=I.height,e[n]=t.scaleToGeodeticSurface(a,a)}return r}function h(e,r,n,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(r===n){for(i=0;c>i;i++)l[i]=r;return l.push(n),l}var f=n-r,d=f/c;for(i=1;c>i;i++){var h=r+i*d;l[i]=h}return l[0]=r,l.push(n),l}function m(r,n,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,r,H),H),c=u.projectPointOntoPlane(t.add(a,n,X),X),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function y(e,r,n,a,i,o,c,l){var d=F,h=W;U=f.eastNorthUpToFixedFrame(e,i,U),d=s.multiplyByPointAsVector(U,D,d),d=t.normalize(d,d);var y=m(d,r,e,i);q=u.fromRotationZ(y,q),G.z=o,U=s.multiplyTransformation(U,s.fromRotationTranslation(q,G,L),U);var p=B;p[0]=c;for(var v=0;l>v;v++)for(var g=0;g<n.length;g+=3)h=t.fromArray(n,g,h),h=u.multiplyByVector(p,h,h),h=s.multiplyByPoint(U,h,h),a.push(h.x,h.y,h.z);return a}function p(e,r,n,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,V);a=y(c,r,n,a,i,o[s/3],u,1)}return a}function v(e,t){var r=e.length,n=new Array(6*r),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];n[a++]=u.x-i,n[a++]=0,n[a++]=u.y-o;for(var s=1;r>s;s++){u=e[s];var c=u.x-i,l=u.y-o;n[a++]=c,n[a++]=0,n[a++]=l,n[a++]=c,n[a++]=0,n[a++]=l}return u=e[0],n[a++]=u.x-i,n[a++]=0,n[a++]=u.y-o,n}function g(e,t){for(var r=e.length,n=new Array(3*r),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;r>u;u++)n[a++]=e[u].x-i,n[a++]=0,n[a++]=e[u].y-o;return n}function w(e,r,n,i,s,c,f,d,h,m){var p,v=t.angleBetween(t.subtract(r,e,z),t.subtract(n,e,C)),g=i===a.BEVELED?0:Math.ceil(v/o.toRadians(5));p=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,z),v/(g+1),j),k):u.fromQuaternion(l.fromAxisAngle(e,v/(g+1),j),k);var w,E;if(r=t.clone(r,Y),g>0)for(var x=m?2:1,S=0;g>S;S++)r=u.multiplyByVector(p,r,r),w=t.subtract(r,e,z),w=t.normalize(w,w),s||(w=t.negate(w,w)),E=c.scaleToGeodeticSurface(r,C),f=y(E,w,d,f,c,h,1,x);else w=t.subtract(r,e,z),w=t.normalize(w,w),s||(w=t.negate(w,w)),E=c.scaleToGeodeticSurface(r,C),f=y(E,w,d,f,c,h,1,1),n=t.clone(n,Y),w=t.subtract(n,e,z),w=t.normalize(w,w),s||(w=t.negate(w,w)),E=c.scaleToGeodeticSurface(n,C),f=y(E,w,d,f,c,h,1,1);return f}function E(e,t){return o.equalsEpsilon(e.latitude,t.latitude,o.EPSILON6)&&o.equalsEpsilon(e.longitude,t.longitude,o.EPSILON6)}var x=[new t,new t],S=new t,M=new t,O=new t,_=new t,T=new t,P=new t,A=new t,R=new t,N=new t,z=new t,C=new t,b={},I=new n,D=new t(-1,0,0),U=new s,L=new s,q=new u,B=u.IDENTITY.clone(),F=new t,W=new r,G=new t,V=new t,j=new l,Y=new t,k=new u;b.removeDuplicatesFromShape=function(t){for(var r=t.length,n=[],a=r-1,i=0;r>i;a=i++){var o=t[a],u=t[i];e.equals(o,u)||n.push(u)}return n};var H=new t,X=new t;b.angleIsGreaterThanPi=function(e,r,n,a){var o=new i(n,a),u=o.projectPointOntoPlane(t.add(n,e,H),H),s=o.projectPointOntoPlane(t.add(n,r,X),X);return s.x*u.y-s.y*u.x>=0};var Z=new n,J=new n;return b.removeDuplicatesFromPositions=function(e,t){var r=e.length;if(2>r)return e.slice(0);var n=[];n.push(e[0]);for(var a=1;r>a;++a){var i=e[a-1],o=e[a],u=t.cartesianToCartographic(i,Z),s=t.cartesianToCartographic(o,J);E(u,s)||n.push(o)}return n},b.computePositions=function(e,r,n,i,u){var s=i._ellipsoid,l=d(e,s),f=i._granularity,m=i._cornerType,E=u?v(r,n):g(r,n),C=u?g(r,n):void 0,I=n.height/2,D=n.width/2,U=e.length,L=[],q=u?[]:void 0,B=S,F=M,W=O,G=_,V=T,j=P,Y=A,k=R,H=N,X=e[0],Z=e[1];G=s.geodeticSurfaceNormal(X,G),B=t.subtract(Z,X,B),B=t.normalize(B,B),k=t.cross(G,B,k),k=t.normalize(k,k);var J=l[0],Q=l[1];u&&(q=y(X,k,C,q,s,J+I,1,1)),H=t.clone(X,H),X=Z,F=t.negate(B,F);for(var K,$,et=1;U-1>et;et++){var tt=u?2:1;Z=e[et+1],B=t.subtract(Z,X,B),B=t.normalize(B,B),W=t.add(B,F,W),W=t.normalize(W,W),G=s.geodeticSurfaceNormal(X,G);var rt=!t.equalsEpsilon(t.negate(W,z),G,o.EPSILON2);if(rt){W=t.cross(W,G,W),W=t.cross(G,W,W),W=t.normalize(W,W);var nt=1/Math.max(.25,t.magnitude(t.cross(W,F,z))),at=b.angleIsGreaterThanPi(B,F,X,s);at?(V=t.add(X,t.multiplyByScalar(W,nt*D,W),V),j=t.add(V,t.multiplyByScalar(k,D,j),j),x[0]=t.clone(H,x[0]),x[1]=t.clone(j,x[1]),K=h(x,J+I,Q+I,f),$=c.generateArc({positions:x,granularity:f,ellipsoid:s}),L=p($,k,E,L,s,K,1),k=t.cross(G,B,k),k=t.normalize(k,k),Y=t.add(V,t.multiplyByScalar(k,D,Y),Y),m===a.ROUNDED||m===a.BEVELED?w(V,j,Y,m,at,s,L,E,Q+I,u):(W=t.negate(W,W),L=y(X,W,E,L,s,Q+I,nt,tt)),H=t.clone(Y,H)):(V=t.add(X,t.multiplyByScalar(W,nt*D,W),V),j=t.add(V,t.multiplyByScalar(k,-D,j),j),x[0]=t.clone(H,x[0]),x[1]=t.clone(j,x[1]),K=h(x,J+I,Q+I,f),$=c.generateArc({positions:x,granularity:f,ellipsoid:s}),L=p($,k,E,L,s,K,1),k=t.cross(G,B,k),k=t.normalize(k,k),Y=t.add(V,t.multiplyByScalar(k,-D,Y),Y),m===a.ROUNDED||m===a.BEVELED?w(V,j,Y,m,at,s,L,E,Q+I,u):L=y(X,W,E,L,s,Q+I,nt,tt),H=t.clone(Y,H)),F=t.negate(B,F)}else L=y(H,k,E,L,s,J+I,1,1),H=X;J=Q,Q=l[et+1],X=Z}x[0]=t.clone(H,x[0]),x[1]=t.clone(X,x[1]),K=h(x,J+I,Q+I,f),$=c.generateArc({positions:x,granularity:f,ellipsoid:s}),L=p($,k,E,L,s,K,1),u&&(q=y(X,k,C,q,s,Q+I,1,1)),U=L.length;var it=u?U+q.length:U,ot=new Float64Array(it);return ot.set(L),u&&ot.set(q,U),ot},b}),define("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./isArray","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(r,n,o,u,c){var l=e.angleBetween(e.subtract(n,r,y),e.subtract(o,r,p)),f=u===t.BEVELED?1:Math.ceil(l/a.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 m;m=c?i.fromQuaternion(s.fromAxisAngle(e.negate(r,y),l/f,N),z):i.fromQuaternion(s.fromAxisAngle(r,l/f,N),z);var v=0;n=e.clone(n,y);for(var g=0;f>g;g++)n=i.multiplyByVector(m,n,n),h[v++]=n.x,h[v++]=n.y,h[v++]=n.z;return h}function l(r){var n=E,a=x,i=S,o=r[1];a=e.fromArray(r[1],o.length-3,a),i=e.fromArray(r[0],0,i),n=e.multiplyByScalar(e.add(a,i,n),.5,n);var u=c(n,a,i,t.ROUNDED,!1),s=r.length-1,l=r[s-1];o=r[s],a=e.fromArray(l,l.length-3,a),i=e.fromArray(o,0,i),n=e.multiplyByScalar(e.add(a,i,n),.5,n);var f=c(n,a,i,t.ROUNDED,!1);return[u,f]}function f(t,r,n,a){var i=y;return a?i=e.add(t,r,i):(r=e.negate(r,r),i=e.add(t,r,i)),[i.x,i.y,i.z,n.x,n.y,n.z]}function d(t,r,n,a){for(var i=new Array(t.length),o=new Array(t.length),u=e.multiplyByScalar(r,n,y),s=e.negate(u,p),c=0,l=t.length-1,f=0;f<t.length;f+=3){var d=e.fromArray(t,f,v),h=e.add(d,s,g);i[c++]=h.x,i[c++]=h.y,i[c++]=h.z;var m=e.add(d,u,g);o[l--]=m.z,o[l--]=m.y,o[l--]=m.x}return a.push(i,o),a}function h(e,t){for(var r=0;r<e.length;r++)e[r]=t.scaleToGeodeticSurface(e[r],e[r]);return e}var m={},y=new e,p=new e,v=new e,g=new e,w=[new e,new e],E=new e,x=new e,S=new e,M=new e,O=new e,_=new e,T=new e,P=new e,A=new e,R=new e,N=new s,z=new i;m.addAttribute=function(e,t,n,a){var i=t.x,o=t.y,u=t.z;r(n)&&(e[n]=i,e[n+1]=o,e[n+2]=u),r(a)&&(e[a]=u,e[a-1]=o,e[a-2]=i)},m.computePositions=function(r){var n=r.granularity,i=r.positions,s=r.ellipsoid;i=h(i,s);var m=r.width/2,p=r.cornerType,v=r.saveAttributes,g=E,N=x,z=S,C=M,b=O,I=_,D=T,U=P,L=A,q=R,B=[],F=v?[]:void 0,W=v?[]:void 0,G=i[0],V=i[1];N=e.normalize(e.subtract(V,G,N),N),g=s.geodeticSurfaceNormal(G,g),C=e.normalize(e.cross(g,N,C),C),v&&(F.push(C.x,C.y,C.z),W.push(g.x,g.y,g.z)),D=e.clone(G,D),G=V,z=e.negate(N,z);var j,Y,k=[],H=i.length;for(Y=1;H-1>Y;Y++){g=s.geodeticSurfaceNormal(G,g),V=i[Y+1],N=e.normalize(e.subtract(V,G,N),N),b=e.normalize(e.add(N,z,b),b);var X=!e.equalsEpsilon(e.negate(b,y),g,a.EPSILON2);if(X){b=e.cross(b,g,b),b=e.cross(g,b,b);var Z=m/Math.max(.25,e.magnitude(e.cross(b,z,y))),J=u.angleIsGreaterThanPi(N,z,G,s);b=e.multiplyByScalar(b,Z,b),J?(U=e.add(G,b,U),q=e.add(U,e.multiplyByScalar(C,m,q),q),L=e.add(U,e.multiplyByScalar(C,2*m,L),L),w[0]=e.clone(D,w[0]),w[1]=e.clone(q,w[1]),j=o.generateArc({positions:w,granularity:n,ellipsoid:s}),B=d(j,C,m,B),v&&(F.push(C.x,C.y,C.z),W.push(g.x,g.y,g.z)),I=e.clone(L,I),C=e.normalize(e.cross(g,N,C),C),L=e.add(U,e.multiplyByScalar(C,2*m,L),L),D=e.add(U,e.multiplyByScalar(C,m,D),D),p===t.ROUNDED||p===t.BEVELED?k.push({leftPositions:c(U,I,L,p,J)}):k.push({leftPositions:f(G,e.negate(b,b),L,J)})):(L=e.add(G,b,L),q=e.add(L,e.negate(e.multiplyByScalar(C,m,q),q),q),U=e.add(L,e.negate(e.multiplyByScalar(C,2*m,U),U),U),w[0]=e.clone(D,w[0]),w[1]=e.clone(q,w[1]),j=o.generateArc({positions:w,granularity:n,ellipsoid:s}),B=d(j,C,m,B),v&&(F.push(C.x,C.y,C.z),W.push(g.x,g.y,g.z)),I=e.clone(U,I),C=e.normalize(e.cross(g,N,C),C),U=e.add(L,e.negate(e.multiplyByScalar(C,2*m,U),U),U),D=e.add(L,e.negate(e.multiplyByScalar(C,m,D),D),D),p===t.ROUNDED||p===t.BEVELED?k.push({rightPositions:c(L,I,U,p,J)}):k.push({rightPositions:f(G,b,U,J)})),z=e.negate(N,z) -}G=V}g=s.geodeticSurfaceNormal(G,g),w[0]=e.clone(D,w[0]),w[1]=e.clone(G,w[1]),j=o.generateArc({positions:w,granularity:n,ellipsoid:s}),B=d(j,C,m,B),v&&(F.push(C.x,C.y,C.z),W.push(g.x,g.y,g.z));var Q;return p===t.ROUNDED&&(Q=l(B)),{positions:B,corners:k,lefts:F,normals:W,endPositions:Q}};var C=new e,b=new e;return m.scaleToGeodeticHeight=function(t,r,a,i){var o=t.length,u=n(i)?i:new Array(t.length);u.length=t.length;for(var s=r,c=0;o>c;c+=3){var l=a.scaleToGeodeticSurface(e.fromArray(t,c,b),b),f=C;0!==r&&(f=a.geodeticSurfaceNormal(l,f),f=e.multiplyByScalar(f,s,f),l=e.add(l,f,l)),u[c]=l.x,u[c+1]=l.y,u[c+2]=l.z}return u},m}),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"],function(e){"use strict";var t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===t.POINTS||e===t.LINES||e===t.LINE_LOOP||e===t.LINE_STRIP||e===t.TRIANGLES||e===t.TRIANGLE_STRIP||e===t.TRIANGLE_FAN}};return e(t)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,a){"use strict";var i=function(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)};return i.computeNumberOfVertices=function(e){var n=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(n!==o&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=o}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(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"],function(e,t,r,n){"use strict";var a={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,a){return e>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(a)}),define("Core/VertexFormat",["./defaultValue","./freezeObject"],function(e,t){"use strict";var r=function(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 r.POSITION_ONLY=t(new r({position:!0})),r.POSITION_AND_NORMAL=t(new r({position:!0,normal:!0})),r.POSITION_NORMAL_AND_ST=t(new r({position:!0,normal:!0,st:!0})),r.POSITION_AND_ST=t(new r({position:!0,st:!0})),r.POSITION_AND_COLOR=t(new r({position:!0,color:!0})),r.ALL=t(new r({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),r.DEFAULT=r.POSITION_NORMAL_AND_ST,r}),define("Core/CorridorGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,m,y,p){"use strict";function v(e,r,n,i,o,u){var s=e.normals,c=e.tangents,l=e.binormals,f=t.normalize(t.cross(n,r,A),A);u.normal&&a.addAttribute(s,r,i,o),u.binormal&&a.addAttribute(l,n,i,o),u.tangent&&a.addAttribute(c,f,i,o)}function g(e,n,i){var u,s,c,m=e.positions,y=e.corners,p=e.endPositions,g=e.lefts,w=e.normals,E=new f,x=0,T=0,N=0;for(s=0;s<m.length;s+=2)c=m[s].length-3,x+=c,N+=2*c,T+=m[s+1].length-3;for(x+=3,T+=3,s=0;s<y.length;s++){u=y[s];var z=y[s].leftPositions;o(z)?(c=z.length,x+=c,N+=c):(c=y[s].rightPositions.length,T+=c,N+=c)}var C,b=o(p);b&&(C=p[0].length-3,x+=C,T+=C,C/=3,N+=6*C);var I,D,U,L,q,B,F=x+T,W=new Float64Array(F),G=n.normal?new Float32Array(F):void 0,V=n.tangent?new Float32Array(F):void 0,j=n.binormal?new Float32Array(F):void 0,Y={normals:G,tangents:V,binormals:j},k=0,H=F-1,X=S,Z=M,J=C/2,Q=d.createTypedArray(F/3,N),K=0;if(b){B=O,q=_;var $=p[0];for(X=t.fromArray(w,0,X),Z=t.fromArray(g,0,Z),s=0;J>s;s++)B=t.fromArray($,3*(J-1-s),B),q=t.fromArray($,3*(J+s),q),a.addAttribute(W,q,k),a.addAttribute(W,B,void 0,H),v(Y,X,Z,k,H,n),D=k/3,L=D+1,I=(H-2)/3,U=I-1,Q[K++]=I,Q[K++]=D,Q[K++]=U,Q[K++]=U,Q[K++]=D,Q[K++]=L,k+=3,H-=3}var et=0,tt=0,rt=m[et++],nt=m[et++];W.set(rt,k),W.set(nt,H-nt.length+1),Z=t.fromArray(g,tt,Z);var at,it;for(c=nt.length-3,s=0;c>s;s+=3)at=i.geodeticSurfaceNormal(t.fromArray(rt,s,A),A),it=i.geodeticSurfaceNormal(t.fromArray(nt,c-s,R),R),X=t.normalize(t.add(at,it,X),X),v(Y,X,Z,k,H,n),D=k/3,L=D+1,I=(H-2)/3,U=I-1,Q[K++]=I,Q[K++]=D,Q[K++]=U,Q[K++]=U,Q[K++]=D,Q[K++]=L,k+=3,H-=3;for(at=i.geodeticSurfaceNormal(t.fromArray(rt,c,A),A),it=i.geodeticSurfaceNormal(t.fromArray(nt,c,R),R),X=t.normalize(t.add(at,it,X),X),tt+=3,s=0;s<y.length;s++){var ot;u=y[s];var ut,st,ct=u.leftPositions,lt=u.rightPositions,ft=P,dt=O,ht=_;if(X=t.fromArray(w,tt,X),o(ct)){for(v(Y,X,Z,void 0,H,n),H-=3,ut=L,st=U,ot=0;ot<ct.length/3;ot++)ft=t.fromArray(ct,3*ot,ft),Q[K++]=ut,Q[K++]=st-ot-1,Q[K++]=st-ot,a.addAttribute(W,ft,void 0,H),dt=t.fromArray(W,3*(st-ot-1),dt),ht=t.fromArray(W,3*ut,ht),Z=t.normalize(t.subtract(dt,ht,Z),Z),v(Y,X,Z,void 0,H,n),H-=3;ft=t.fromArray(W,3*ut,ft),dt=t.subtract(t.fromArray(W,3*st,dt),ft,dt),ht=t.subtract(t.fromArray(W,3*(st-ot),ht),ft,ht),Z=t.normalize(t.add(dt,ht,Z),Z),v(Y,X,Z,k,void 0,n),k+=3}else{for(v(Y,X,Z,k,void 0,n),k+=3,ut=U,st=L,ot=0;ot<lt.length/3;ot++)ft=t.fromArray(lt,3*ot,ft),Q[K++]=ut,Q[K++]=st+ot,Q[K++]=st+ot+1,a.addAttribute(W,ft,k),dt=t.fromArray(W,3*ut,dt),ht=t.fromArray(W,3*(st+ot),ht),Z=t.normalize(t.subtract(dt,ht,Z),Z),v(Y,X,Z,k,void 0,n),k+=3;ft=t.fromArray(W,3*ut,ft),dt=t.subtract(t.fromArray(W,3*(st+ot),dt),ft,dt),ht=t.subtract(t.fromArray(W,3*st,ht),ft,ht),Z=t.normalize(t.negate(t.add(ht,dt,Z),Z),Z),v(Y,X,Z,void 0,H,n),H-=3}for(rt=m[et++],nt=m[et++],rt.splice(0,3),nt.splice(nt.length-3,3),W.set(rt,k),W.set(nt,H-nt.length+1),c=nt.length-3,tt+=3,Z=t.fromArray(g,tt,Z),ot=0;ot<nt.length;ot+=3)at=i.geodeticSurfaceNormal(t.fromArray(rt,ot,A),A),it=i.geodeticSurfaceNormal(t.fromArray(nt,c-ot,R),R),X=t.normalize(t.add(at,it,X),X),v(Y,X,Z,k,H,n),L=k/3,D=L-1,U=(H-2)/3,I=U+1,Q[K++]=I,Q[K++]=D,Q[K++]=U,Q[K++]=U,Q[K++]=D,Q[K++]=L,k+=3,H-=3;k-=3,H+=3}if(X=t.fromArray(w,w.length-3,X),v(Y,X,Z,k,H,n),b){k+=3,H-=3,B=O,q=_;var mt=p[1];for(s=0;J>s;s++)B=t.fromArray(mt,3*(C-s-1),B),q=t.fromArray(mt,3*s,q),a.addAttribute(W,B,void 0,H),a.addAttribute(W,q,k),v(Y,X,Z,k,H,n),L=k/3,D=L-1,U=(H-2)/3,I=U+1,Q[K++]=I,Q[K++]=D,Q[K++]=U,Q[K++]=U,Q[K++]=D,Q[K++]=L,k+=3,H-=3}if(E.position=new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:W}),n.st){var yt,pt,vt=new Float32Array(2*(F/3)),gt=0;if(b){x/=3,T/=3;var wt=Math.PI/(C+1);pt=1/(x-C+1),yt=1/(T-C+1);var Et,xt=C/2;for(s=xt+1;C+1>s;s++)Et=h.PI_OVER_TWO+wt*s,vt[gt++]=yt*(1+Math.cos(Et)),vt[gt++]=.5*(1+Math.sin(Et));for(s=1;T-C+1>s;s++)vt[gt++]=s*yt,vt[gt++]=0;for(s=C;s>xt;s--)Et=h.PI_OVER_TWO-s*wt,vt[gt++]=1-yt*(1+Math.cos(Et)),vt[gt++]=.5*(1+Math.sin(Et));for(s=xt;s>0;s--)Et=h.PI_OVER_TWO-wt*s,vt[gt++]=1-pt*(1+Math.cos(Et)),vt[gt++]=.5*(1+Math.sin(Et));for(s=x-C;s>0;s--)vt[gt++]=s*pt,vt[gt++]=1;for(s=1;xt+1>s;s++)Et=h.PI_OVER_TWO+wt*s,vt[gt++]=pt*(1+Math.cos(Et)),vt[gt++]=.5*(1+Math.sin(Et))}else{for(x/=3,T/=3,pt=1/(x-1),yt=1/(T-1),s=0;T>s;s++)vt[gt++]=s*yt,vt[gt++]=0;for(s=x;s>0;s--)vt[gt++]=(s-1)*pt,vt[gt++]=1}E.st=new l({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:vt})}return n.normal&&(E.normal=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:Y.normals})),n.tangent&&(E.tangent=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:Y.tangents})),n.binormal&&(E.binormal=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:Y.binormals})),{attributes:E,indices:Q}}function w(e,r){if(!(r.normal||r.binormal||r.tangent||r.st))return e;var n,i,o=e.position.values;(r.normal||r.binormal)&&(n=e.normal.values,i=e.binormal.values);var u,s=e.position.values.length/18,c=3*s,l=2*s,f=2*c;if(r.normal||r.binormal||r.tangent){var d=r.normal?new Float32Array(6*c):void 0,h=r.binormal?new Float32Array(6*c):void 0,m=r.tangent?new Float32Array(6*c):void 0,y=S,p=M,v=O,g=_,w=T,E=P,x=f;for(u=0;c>u;u+=3){var A=x+f;y=t.fromArray(o,u,y),p=t.fromArray(o,u+c,p),v=t.fromArray(o,(u+3)%c,v),p=t.subtract(p,y,p),v=t.subtract(v,y,v),g=t.normalize(t.cross(p,v,g),g),r.normal&&(a.addAttribute(d,g,A),a.addAttribute(d,g,A+3),a.addAttribute(d,g,x),a.addAttribute(d,g,x+3)),(r.tangent||r.binormal)&&(E=t.fromArray(n,u,E),r.binormal&&(a.addAttribute(h,E,A),a.addAttribute(h,E,A+3),a.addAttribute(h,E,x),a.addAttribute(h,E,x+3)),r.tangent&&(w=t.normalize(t.cross(E,g,w),w),a.addAttribute(m,w,A),a.addAttribute(m,w,A+3),a.addAttribute(m,w,x),a.addAttribute(m,w,x+3))),x+=6}if(r.normal){for(d.set(n),u=0;c>u;u+=3)d[u+c]=-n[u],d[u+c+1]=-n[u+1],d[u+c+2]=-n[u+2];e.normal.values=d}else e.normal=void 0;if(r.binormal?(h.set(i),h.set(i,c),e.binormal.values=h):e.binormal=void 0,r.tangent){var R=e.tangent.values;m.set(R),m.set(R,c),e.tangent.values=m}}if(r.st){var N=e.st.values,z=new Float32Array(6*l);z.set(N),z.set(N,l);for(var C=2*l,b=0;2>b;b++){for(z[C++]=N[0],z[C++]=N[1],u=2;l>u;u+=2){var I=N[u],D=N[u+1];z[C++]=I,z[C++]=D,z[C++]=I,z[C++]=D}z[C++]=N[0],z[C++]=N[1]}e.st.values=z}return e}function E(e,t,r){r[t++]=e[0],r[t++]=e[1],r[t++]=e[2];for(var n=3;n<e.length;n+=3){var a=e[n],i=e[n+1],o=e[n+2];r[t++]=a,r[t++]=i,r[t++]=o,r[t++]=a,r[t++]=i,r[t++]=o}return r[t++]=e[0],r[t++]=e[1],r[t++]=e[2],r}function x(e,t){var r=new p({position:t.positon,normal:t.normal||t.binormal,tangent:t.tangent,binormal:t.normal||t.binormal,st:t.st}),n=e.ellipsoid,i=a.computePositions(e),o=g(i,r,n),u=e.height,s=e.extrudedHeight,c=o.attributes,l=o.indices,f=c.position.values,h=f.length,m=new Float64Array(6*h),y=new Float64Array(h);y.set(f);var v=new Float64Array(4*h);f=a.scaleToGeodeticHeight(f,u,n,f),v=E(f,0,v),y=a.scaleToGeodeticHeight(y,s,n,y),v=E(y,2*h,v),m.set(f),m.set(y,h),m.set(v,2*h),c.position.values=m,h/=3;var x,S=l.length,M=h+h,O=d.createTypedArray(m.length/3,2*S+3*M);O.set(l);var _=S;for(x=0;S>x;x+=3){var T=l[x],P=l[x+1],A=l[x+2];O[_++]=A+h,O[_++]=P+h,O[_++]=T+h}c=w(c,t);var R,N,z,C;for(x=0;M>x;x+=2)R=x+M,N=R+M,z=R+1,C=N+1,O[_++]=R,O[_++]=N,O[_++]=z,O[_++]=z,O[_++]=N,O[_++]=C;return{attributes:c,indices:O}}var S=new t,M=new t,O=new t,_=new t,T=new t,P=new t,A=new t,R=new t,N=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.positions,r=e.width;this._positions=t,this._width=r,this._ellipsoid=i(e.ellipsoid,s.WGS84),this._height=i(e.height,0),this._extrudedHeight=i(e.extrudedHeight,this._height),this._cornerType=i(e.cornerType,n.ROUNDED),this._vertexFormat=i(e.vertexFormat,p.DEFAULT),this._granularity=i(e.granularity,h.RADIANS_PER_DEGREE),this._workerName="createCorridorGeometry"};return N.createGeometry=function(t){var r=t._positions,n=t._height,i=t._extrudedHeight,u=n!==i,s=m.removeDuplicates(r);o(s)||(s=r);var l,f=t._ellipsoid,d=t._vertexFormat,h={ellipsoid:f,positions:s,width:t._width,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!0};if(u){var p=Math.max(n,i);i=Math.min(n,i),n=p,h.height=n,h.extrudedHeight=i,l=x(h,d)}else{var v=a.computePositions(h);l=g(v,d,f),l.attributes.position.values=a.scaleToGeodeticHeight(l.attributes.position.values,n,f,l.attributes.position.values)}var w=l.attributes,E=e.fromVertices(w.position.values,void 0,3);return d.position||(l.attributes.position.values=void 0),new c({attributes:w,indices:l.indices,primitiveType:y.TRIANGLES,boundingSphere:E})},N}),define("Workers/createCorridorGeometry",["../Core/CorridorGeometry","../Core/Ellipsoid"],function(e,t){"use strict";function r(r){return r._ellipsoid=t.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}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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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:0>e?-1:0},a.signNotZero=function(e){return 0>e?-1:1},a.toSNorm=function(e){return Math.round(255*(.5*a.clamp(e,-1,1)+.5))},a.fromSNorm=function(e){return a.clamp(e,0,255)/255*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.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 a>=i||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;e>=r;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}i.fromSpherical=function(n,r){t(r)||(r=new i);var a=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(o),r},i.fromElements=function(e,n,r,a){return t(a)?(a.x=e,a.y=n,a.z=r,a):new i(e,n,r)},i.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 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},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},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 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){i.normalize(e,s),i.normalize(t,c);var n=i.dot(s,c),r=i.magnitude(i.cross(s,c,s));return Math.atan2(r,n)};var l=new i;i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):n.y<=n.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,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},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},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)},i.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,d=r*u-a*o;return n.x=c,n.y=l,n.z=d,n},i.fromDegrees=function(e,t,n,r,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,n,r,o)};var d=new i,f=new i,h=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(n,r,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:h,c=Math.cos(r);d.x=c*Math.cos(n),d.y=c*Math.sin(n),d.z=Math.sin(r),d=i.normalize(d,d),i.multiplyComponents(s,d,f);var l=Math.sqrt(i.dot(d,f));return f=i.divideByScalar(f,l,f),d=i.multiplyByScalar(d,a,d),t(u)||(u=new i),i.add(f,d,u)},i.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=a.toRadians(e[o]);return i.fromRadiansArray(r,t,n)},i.fromRadiansArray=function(e,n,r){var a=e.length;t(r)?r.length=a/2:r=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=i.fromRadians(u,s,0,n,r[o/2])}return r},i.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=a.toRadians(e[o]),r[o+1]=a.toRadians(e[o+1]),r[o+2]=e[o+2];return i.fromRadiansArrayHeights(r,t,n)},i.fromRadiansArrayHeights=function(e,n,r){var a=e.length;t(r)?r.length=a/3:r=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=i.fromRadians(u,s,c,n,r[o/3])}return r},i.ZERO=r(new i(0,0,0)),i.UNIT_X=r(new i(1,0,0)),i.UNIT_Y=r(new i(0,1,0)),i.UNIT_Z=r(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,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},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,d=n.y,f=n.z,h=a.x,E=a.y,m=a.z,_=l*l*h*h,y=d*d*E*E,p=f*f*m*m,T=_+y+p,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(s>T)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 M,g,I,w,C,P,x,D,U,L,F,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(O)),z=0;do{B-=z,I=1/(1+B*S),w=1/(1+B*v),C=1/(1+B*N),P=I*I,x=w*w,D=C*C,U=P*I,L=x*w,F=D*C,M=_*P+y*x+p*D-1,g=_*U*S+y*L*v+p*F*N;var b=-2*g;z=M/b}while(Math.abs(M)>r.EPSILON12);return t(c)?(c.x=l*I,c.y=d*w,c.z=f*C,c):new e(l*I,d*w,f*C)}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,d=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 E=n(r)?r.oneOverRadii:d,m=n(r)?r.oneOverRadiiSquared:f,_=n(r)?r._centerToleranceSquared:h,y=o(t,E,m,_,c);if(n(y)){var p=e.multiplyComponents(t,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),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){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){a=n(a,0),e.pack(t._radii,r,a)},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 d=new e,f=new e;l.prototype.cartographicToCartesian=function(t,n){var a=d,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;n>a;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),d=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=d,a):new t(c,l,d)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;n>a;++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}),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","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(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 u(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;3>n;++n){var r=e[o.getElementIndex(h[n],f[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=i.EPSILON15,r=0,a=1,u=0;3>u;++u){var s=Math.abs(e[o.getElementIndex(h[u],f[u])]);s>r&&(a=u,r=s)}var c=1,l=0,d=f[a],E=h[a];if(Math.abs(e[o.getElementIndex(E,d)])>n){var m,_=e[o.getElementIndex(E,E)],y=e[o.getElementIndex(d,d)],p=e[o.getElementIndex(E,d)],T=(_-y)/2/p;m=0>T?-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=o.clone(o.IDENTITY,t),t[o.getElementIndex(d,d)]=t[o.getElementIndex(E,E)]=c,t[o.getElementIndex(E,d)]=l,t[o.getElementIndex(d,E)]=-l,t}o.packedLength=9,o.pack=function(e,n,r){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]},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},o.clone=function(e,t){return n(e)?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 o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},o.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,u=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,d=e.z*e.z,f=e.z*e.w,h=e.w*e.w,E=r-s-d+h,m=2*(a-f),_=2*(i+l),y=2*(a+f),p=-r+s-d+h,T=2*(c-u),R=2*(i-l),A=2*(c+u),S=-r-s+d+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]=S,t):new o(E,m,_,y,p,T,R,A,S)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,r,-a,0,a,r)},o.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 o(r,0,a,0,1,0,-a,0,r)},o.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 o(r,-a,0,a,r,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},o.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},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;o.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 d=new e;o.getMaximumScale=function(t){return o.getScale(t,d),e.maximumComponent(d)},o.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],d=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]=d,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[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},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[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},o.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},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[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},o.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},o.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},o.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 f=[1,0,0],h=[2,2,1],E=new o,m=new o;return o.computeEigenDecomposition=function(e,t){var r=i.EPSILON20,a=10,l=0,d=0;n(t)||(t={});for(var f=t.unitary=o.clone(o.IDENTITY,t.unitary),h=t.diagonal=o.clone(e,t.diagonal),_=r*u(h);a>d&&s(h)>_;)c(h,E),o.transpose(E,m),o.multiply(h,E,h),o.multiply(m,h,h),o.multiply(f,E,f),++l>2&&(++d,l=0);return 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[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},o.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)},o.inverse=function(e,t){var n=e[0],a=e[1],u=e[2],s=e[3],c=e[4],l=e[5],d=e[6],f=e[7],h=e[8],E=o.determinant(e);if(Math.abs(E)<=i.EPSILON15)throw new r("matrix is not invertible");t[0]=c*h-f*l,t[1]=f*u-a*h,t[2]=a*l-c*u,t[3]=d*l-s*h,t[4]=n*h-d*u,t[5]=s*u-n*l,t[6]=s*f-d*c,t[7]=d*a-n*f,t[8]=n*c-s*a;var m=1/E;return o.multiplyByScalar(t,m,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=a(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=a(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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.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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a,i,o,u,s,c,l,d,f,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(d,0),this[11]=n(m,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(_,0)}c.packedLength=16,c.pack=function(e,t,r){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]},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),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},c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[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]):void 0},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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new c);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,l=t.x*t.y,d=t.x*t.z,f=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*(l-y),A=2*(d+m),S=2*(l+y),v=-s+h-_+p,N=2*(E-f),O=2*(d-m),M=2*(E+f),g=-s-h+_+p;return a[0]=T*i,a[1]=S*i,a[2]=O*i,a[3]=0,a[4]=R*o,a[5]=v*o,a[6]=M*o,a[7]=0,a[8]=A*u,a[9]=N*u,a[10]=g*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.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 l=new e,d=new e,f=new e;c.fromCamera=function(t,n){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,d),d),e.normalize(e.cross(d,l,f),f);var u=d.x,s=d.y,h=d.z,E=l.x,m=l.y,_=l.z,y=f.x,p=f.y,T=f.z,R=a.x,A=a.y,S=a.z,v=u*-R+s*-A+h*-S,N=y*-R+p*-A+T*-S,O=E*R+m*A+_*S; +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]=h,n[9]=T,n[10]=-_,n[11]=0,n[12]=v,n[13]=N,n[14]=O,n[15]=1,n):new c(u,s,h,v,y,p,T,N,-E,-m,-_,O,0,0,0,1)},c.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},c.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,d=-(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]=d,o[14]=f,o[15]=1,o},c.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),d=-(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]=d,o[11]=f,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},c.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,d=-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]=d,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},c.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,d=.5*(r-t),f=c,h=l,E=d,m=i+c,_=o+l,y=t+d,p=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]=E,a[11]=0,a[12]=m,a[13]=_,a[14]=y,a[15]=p,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,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},c.setColumn=function(e,t,n,r){r=c.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},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],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},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 h=new e;c.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[4],t[5],t[6],h)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],h)),n};var E=new e;c.getMaximumScale=function(t){return c.getScale(t,E),e.maximumComponent(E)},c.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],d=e[8],f=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],S=t[3],v=t[4],N=t[5],O=t[6],M=t[7],g=t[8],I=t[9],w=t[10],C=t[11],P=t[12],x=t[13],D=t[14],U=t[15],L=r*T+u*R+d*A+m*S,F=a*T+s*R+f*A+_*S,B=i*T+c*R+h*A+y*S,z=o*T+l*R+E*A+p*S,b=r*v+u*N+d*O+m*M,G=a*v+s*N+f*O+_*M,q=i*v+c*N+h*O+y*M,W=o*v+l*N+E*O+p*M,X=r*g+u*I+d*w+m*C,H=a*g+s*I+f*w+_*C,V=i*g+c*I+h*w+y*C,Y=o*g+l*I+E*w+p*C,k=r*P+u*x+d*D+m*U,j=a*P+s*x+f*D+_*U,Z=i*P+c*x+h*D+y*U,K=o*P+l*x+E*D+p*U;return n[0]=L,n[1]=F,n[2]=B,n[3]=z,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]=j,n[14]=Z,n[15]=K,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],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],d=e[10],f=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],S=t[9],v=t[10],N=t[12],O=t[13],M=t[14],g=r*m+o*_+c*y,I=a*m+u*_+l*y,w=i*m+s*_+d*y,C=r*p+o*T+c*R,P=a*p+u*T+l*R,x=i*p+s*T+d*R,D=r*A+o*S+c*v,U=a*A+u*S+l*v,L=i*A+s*S+d*v,F=r*N+o*O+c*M+f,B=a*N+u*O+l*M+h,z=i*N+s*O+d*M+E;return n[0]=g,n[1]=I,n[2]=w,n[3]=0,n[4]=C,n[5]=P,n[6]=x,n[7]=0,n[8]=D,n[9]=U,n[10]=L,n[11]=0,n[12]=F,n[13]=B,n[14]=z,n[15]=1,n},c.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],d=e[10],f=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*f+o*h+c*E,S=a*f+u*h+l*E,v=i*f+s*h+d*E,N=r*m+o*_+c*y,O=a*m+u*_+l*y,M=i*m+s*_+d*y,g=r*p+o*T+c*R,I=a*p+u*T+l*R,w=i*p+s*T+d*R;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=O,n[6]=M,n[7]=0,n[8]=g,n[9]=I,n[10]=w,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,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;c.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,c.multiplyByScale(e,m,n)},c.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?c.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)},c.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},c.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},c.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},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],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},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 _=new u,y=new u,p=new t,T=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,_),y,o.EPSILON7)&&t.equals(c.getRow(e,3,p),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],l=e[12],d=e[1],f=e[5],h=e[9],E=e[13],m=e[2],R=e[6],A=e[10],S=e[14],v=e[3],N=e[7],O=e[11],M=e[15],g=A*M,I=S*O,w=R*M,C=S*N,P=R*O,x=A*N,D=m*M,U=S*v,L=m*O,F=A*v,B=m*N,z=R*v,b=g*f+C*h+P*E-(I*f+w*h+x*E),G=I*d+D*h+F*E-(g*d+U*h+L*E),q=w*d+U*f+B*E-(C*d+D*f+z*E),W=x*d+L*f+z*h-(P*d+F*f+B*h),X=I*a+w*i+x*l-(g*a+C*i+P*l),H=g*r+U*i+L*l-(I*r+D*i+F*l),V=C*r+D*a+z*l-(w*r+U*a+B*l),Y=P*r+F*a+B*i-(x*r+L*a+z*i);g=i*E,I=l*h,w=a*E,C=l*f,P=a*h,x=i*f,D=r*E,U=l*d,L=r*h,F=i*d,B=r*f,z=a*d;var k=g*N+C*O+P*M-(I*N+w*O+x*M),j=I*v+D*O+F*M-(g*v+U*O+L*M),Z=w*v+U*N+B*M-(C*v+D*N+z*M),K=x*v+L*N+z*O-(P*v+F*N+B*O),J=w*A+x*S+I*R-(P*S+g*R+C*A),Q=L*S+g*m+U*A-(D*A+F*S+I*m),$=D*R+z*S+C*m-(B*S+w*m+U*R),ee=B*A+P*m+F*R-(L*R+z*A+x*m),te=r*b+a*G+i*q+l*W;if(Math.abs(te)<o.EPSILON20)throw new s("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]=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},c.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],d=e[12],f=e[13],h=e[14],E=-n*d-r*f-a*h,m=-i*d-o*f-u*h,_=-s*d-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]=E,t[13]=m,t[14]=_,t[15]=1,t},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,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/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/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){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},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 n>t&&(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,d=0,f=e.length;f>d;d++){var h=e[d];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.clone=function(e,t){return n(e)?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):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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;i>a&&(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;i>a&&o>0?a+=u.TWO_PI:c>o&&a>0&&(o+=u.TWO_PI),i>a&&0>c?c+=u.TWO_PI:c>o&&0>i&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),d=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&l>=d)){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=d,r.north=h,r):new s(l,f,d,h)}},s.union=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.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,a=e.west,i=e.east;return a>i&&(i+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(i>n||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,d=e.north,f=e.south,h=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=d,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.latitude=f,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=r.cartographicToCartesian(m,o[l]),l++,0>d?m.latitude=d:f>0?m.latitude=f: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","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,d,f){"use strict";function h(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var E=new e,m=new e,_=new e,y=new e,p=new e,T=new e,R=new e,A=new e,S=new e,v=new e,N=new e,O=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],R),i=e.clone(a,E),o=e.clone(a,m),u=e.clone(a,_),s=e.clone(a,y),c=e.clone(a,p),l=e.clone(a,T),d=t.length,f=1;d>f;f++){e.clone(t[f],a);var M=a.x,g=a.y,I=a.z;M<i.x&&e.clone(a,i),M>s.x&&e.clone(a,s),g<o.y&&e.clone(a,o),g>c.y&&e.clone(a,c),I<u.z&&e.clone(a,u),I>l.z&&e.clone(a,l)}var w=e.magnitudeSquared(e.subtract(s,i,A)),C=e.magnitudeSquared(e.subtract(c,o,A)),P=e.magnitudeSquared(e.subtract(l,u,A)),x=i,D=s,U=w;C>U&&(U=C,x=o,D=c),P>U&&(U=P,x=u,D=l);var L=S;L.x=.5*(x.x+D.x),L.y=.5*(x.y+D.y),L.z=.5*(x.z+D.z);var F=e.magnitudeSquared(e.subtract(D,L,A)),B=Math.sqrt(F),z=v;z.x=i.x,z.y=o.y,z.z=u.z;var b=N;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(z,b,A),.5,O),q=0;for(f=0;d>f;f++){e.clone(t[f],a);var W=e.magnitude(e.subtract(a,G,A));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(a,L,A));if(X>F){var H=Math.sqrt(X);B=.5*(B+H),F=B*B;var V=H-B;L.x=(B*L.x+V*a.x)/H,L.y=(B*L.y+V*a.y)/H,L.z=(B*L.z+V*a.z)/H}}return q>B?(e.clone(L,n.center),n.radius=B):(e.clone(G,n.center),n.radius=q),n};var M=new o,g=new e,I=new e,w=new t,C=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,M),f.southwest(t,w),w.height=i,f.northeast(t,C),C.height=o;var s=a.project(w,g),c=a.project(C,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 m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*d,m.z=s.z+.5*E,u};var P=[];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,P)),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=R;u.x=t[0]+a.x,u.y=t[1]+a.y,u.z=t[2]+a.z;for(var s=e.clone(u,E),c=e.clone(u,m),l=e.clone(u,_),d=e.clone(u,y),f=e.clone(u,p),M=e.clone(u,T),g=t.length,I=0;g>I;I+=i){var w=t[I]+a.x,C=t[I+1]+a.y,P=t[I+2]+a.z;u.x=w,u.y=C,u.z=P,w<s.x&&e.clone(u,s),w>d.x&&e.clone(u,d),C<c.y&&e.clone(u,c),C>f.y&&e.clone(u,f),P<l.z&&e.clone(u,l),P>M.z&&e.clone(u,M)}var x=e.magnitudeSquared(e.subtract(d,s,A)),D=e.magnitudeSquared(e.subtract(f,c,A)),U=e.magnitudeSquared(e.subtract(M,l,A)),L=s,F=d,B=x;D>B&&(B=D,L=c,F=f),U>B&&(B=U,L=l,F=M);var z=S;z.x=.5*(L.x+F.x),z.y=.5*(L.y+F.y),z.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,z,A)),G=Math.sqrt(b),q=v;q.x=s.x,q.y=c.y,q.z=l.z;var W=N;W.x=d.x,W.y=f.y,W.z=M.z;var X=e.multiplyByScalar(e.add(q,W,A),.5,O),H=0;for(I=0;g>I;I+=i){u.x=t[I]+a.x,u.y=t[I+1]+a.y,u.z=t[I+2]+a.z;var V=e.magnitude(e.subtract(u,X,A));V>H&&(H=V);var Y=e.magnitudeSquared(e.subtract(u,z,A));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 H>G?(e.clone(z,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),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=R;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,m),s=e.clone(i,_),c=e.clone(i,y),l=e.clone(i,p),d=e.clone(i,T),f=t.length,M=0;f>M;M+=3){var g=t[M]+n[M],I=t[M+1]+n[M+1],w=t[M+2]+n[M+2];i.x=g,i.y=I,i.z=w,g<o.x&&e.clone(i,o),g>c.x&&e.clone(i,c),I<u.y&&e.clone(i,u),I>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>d.z&&e.clone(i,d)}var C=e.magnitudeSquared(e.subtract(c,o,A)),P=e.magnitudeSquared(e.subtract(l,u,A)),x=e.magnitudeSquared(e.subtract(d,s,A)),D=o,U=c,L=C;P>L&&(L=P,D=u,U=l),x>L&&(L=x,D=s,U=d);var F=S;F.x=.5*(D.x+U.x),F.y=.5*(D.y+U.y),F.z=.5*(D.z+U.z);var B=e.magnitudeSquared(e.subtract(U,F,A)),z=Math.sqrt(B),b=v;b.x=o.x,b.y=u.y,b.z=s.z;var G=N;G.x=c.x,G.y=l.y,G.z=d.z;var q=e.multiplyByScalar(e.add(b,G,A),.5,O),W=0;for(M=0;f>M;M+=3){i.x=t[M]+n[M],i.y=t[M+1]+n[M+1],i.z=t[M+2]+n[M+2];var X=e.magnitude(e.subtract(i,q,A));X>W&&(W=X);var H=e.magnitudeSquared(e.subtract(i,F,A));if(H>B){var V=Math.sqrt(H);z=.5*(z+V),B=z*z;var Y=V-z;F.x=(z*F.x+Y*i.x)/V,F.y=(z*F.y+Y*i.y)/V,F.z=(z*F.z+Y*i.z)/V}}return W>z?(e.clone(F,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 x=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;a>o;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;a>o;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,x)+c.radius)}return n.radius=s,n};var D=new e,U=new e,L=new e;h.fromOrientedBoundingBox=function(t,n){r(n)||(n=new h);var a=t.halfAxes,i=c.getColumn(a,0,D),o=c.getColumn(a,1,U),u=c.getColumn(a,2,L),s=e.magnitude(i),l=e.magnitude(o),d=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,d),n},h.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius):void 0},h.packedLength=4,h.pack=function(e,t,r){r=n(r,0);var a=e.center;t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius},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 F=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,F),l=e.magnitude(c);if(o>=l+s)return t.clone(a),a;if(s>=l+o)return n.clone(a),a;var d=.5*(o+l+s),f=e.multiplyByScalar(c,(-o+d)/l,B);return e.add(f,i,f),e.clone(f,a.center),a.radius=d,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-a>o?u.OUTSIDE:a>o?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 G=new e;h.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,G),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,W=new e,X=new e,H=new e,V=new e,Y=new t,k=new Array(8),j=0;8>j;++j)k[j]=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,q),c=e.cross(e.UNIT_Z,s,W);e.normalize(c,c);var l=e.cross(s,c,X);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var d=e.negate(l,V),f=e.negate(c,H),E=k,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,f,m),m=E[2],e.add(s,d,m),e.add(m,f,m),m=E[3],e.add(s,d,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,f,m),m=E[6],e.add(s,d,m),e.add(m,f,m),m=E[7],e.add(s,d,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,Y);r.project(T,p)}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("Renderer/WebGLConstants",["../Core/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/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(){return a.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?r.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(r.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",e(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;r>n;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(T)){T=!1;var e=/ Chrome\/([\.0-9]+)/.exec(p.userAgent);null!==e&&(T=!0,R=r(e[1]))}return T}function i(){return a()&&R}function o(){if(!t(A)&&(A=!1,!a()&&/ Safari\/[\.0-9]+/.test(p.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(p.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function u(){return o()&&S}function s(){if(!t(v)){v=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(p.userAgent);null!==e&&(v=!0,N=r(e[1]),N.isNightly=!!e[2])}return v}function c(){return s()&&N}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===p.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(p.userAgent),null!==e&&(O=!0,M=r(e[1]))):"Netscape"===p.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(p.userAgent),null!==e&&(O=!0,M=r(e[1])))}return O}function d(){return l()&&M}function f(){if(!t(g)){g=!1;var e=/Firefox\/([\.0-9]+)/.exec(p.userAgent);null!==e&&(g=!0,I=r(e[1]))}return g}function h(){return t(w)||(w=/Windows/i.test(p.appVersion)),w}function E(){return f()&&I}function m(){return t(C)||(C="undefined"!=typeof PointerEvent&&(!t(p.pointerEnabled)||p.pointerEnabled)),C}function _(){if(!t(x)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;x=t(n)&&""!==n,x&&(P=n)}return x}function y(){return _()?P:void 0}var p;p="undefined"!=typeof navigator?navigator:{};var T,R,A,S,v,N,O,M,g,I,w,C,P,x,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:d,isFirefox:f,firefoxVersion:E,isWindows:h,hardwareConcurrency:e(p.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:_,imageRenderingValue:y};return D.supportsFullscreen=function(){return n.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,a,i){"use strict";if(!a.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return n(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,n,a,i){switch(a=t(a,0),i=t(i,(n.byteLength-a)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,a,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,a,i);case o.SHORT:return new Int16Array(n,a,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,a,i);case o.FLOAT:return new Float32Array(n,a,i);case o.DOUBLE:return new Float64Array(n,a,i);default:throw new r("componentDatatype is not a valid value.")}},i(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(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/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),d=s*o,f=d*d,h=1-f,E=Math.sqrt(h),m=t/4,_=m*m,y=_*m,p=_*_,T=1+m-3*_/4+5*y/4-175*p/64,R=1-m+15*_/8-35*y/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)*y/48-5*Math.sin(8*l)*p/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=d,N.sineSquaredAlpha=f,N.cosineSquaredAlpha=h,N.cosineAlpha=E,N.u2Over4=m,N.u4Over16=_,N.u6Over64=y,N.u8Over256=p,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 d(e,t,n,r,a,i,o){var s,c,d,f,h,E=(t-n)/t,m=i-r,_=Math.atan((1-E)*Math.tan(a)),y=Math.atan((1-E)*Math.tan(o)),p=Math.cos(_),T=Math.sin(_),R=Math.cos(y),A=Math.sin(y),S=p*R,v=p*A,N=T*A,O=T*R,M=m,g=u.TWO_PI,I=Math.cos(M),w=Math.sin(M);do{I=Math.cos(M),w=Math.sin(M);var C=v-O*I;d=Math.sqrt(R*R*w*w+C*C),c=N+S*I,s=Math.atan2(d,c);var P;0===d?(P=0,f=1):(P=S*w/d,f=1-P*P),g=M,h=c-2*N/f,isNaN(h)&&(h=0),M=m+l(E,P,f,s,d,c,h)}while(Math.abs(M-g)>u.EPSILON12);var x=f*(t*t-n*n)/(n*n),D=1+x*(4096+x*(x*(320-175*x)-768))/16384,U=x*(256+x*(x*(74-47*x)-128))/1024,L=h*h,F=U*d*(h+U*(c*(2*L-1)-U*h*(4*d*d-3)*(4*L-3)/6)/4),B=n*D*(s-F),z=Math.atan2(R*w,v-O*I),b=Math.atan2(p*w,v*I-O);e._distance=B,e._startHeading=z,e._endHeading=b,e._uSquared=x}function f(n,r,a,i){e.normalize(i.cartographicToCartesian(r,m),E),e.normalize(i.cartographicToCartesian(a,m),m);d(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)&&f(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){f(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),d=Math.sin(4*i),f=Math.sin(6*i),h=Math.sin(8*i),E=i*i,m=i*E,_=a.u8Over256,y=a.u2Over4,p=a.u6Over64,T=a.u4Over16,R=2*m*_*o/3+i*(1-y+7*T/4-15*p/4+579*_/64-(T-15*p/4+187*_/16)*o-(5*p/4-115*_/16)*u-29*_*s/16)+(y/2-T+71*p/32-85*_/16)*c+(5*T/16-5*p/4+383*_/96)*d-E*((p-11*_/2)*c+5*_*d/2)+(29*p/96-29*_/16)*f+539*_*h/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),M=a.cosineU*O,g=a.sineU*N,I=Math.atan2(N*a.sineHeading,M-g*a.cosineHeading),w=I-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,N,O,v);return r(n)?(n.longitude=this._start.longitude+w,n.latitude=S,n.height=0,n):new t(this._start.longitude+w,S,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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,0>i?[i,0]:[0,i];var c=r*r,l=4*e*a,d=n(c,-l,t.EPSILON14);if(0>d)return[];var f=-.5*n(r,t.sign(r)*Math.sqrt(d),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,d=u*c,f=u*u,h=s*s,E=o*s-f,m=o*c-u*s,_=u*c-h,y=4*E*_-m*m;if(0>y){var p,T,R;f*d>=l*h?(p=o,T=E,R=-2*u*E+o*m):(p=c,T=_,R=-c*m+2*s*_);var A=0>R?-1:1,S=-A*Math.abs(p)*Math.sqrt(-y);i=-R+S;var v=i/2,N=0>v?-Math.pow(-v,1/3):Math.pow(v,1/3),O=i===S?-N:-T/N;return a=0>=T?N+O:-R/(N*N+O*O+T),f*d>=l*h?[(a-u)/o]:[-c/(a+s)]}var M=E,g=-2*u*E+o*m,I=_,w=-c*m+2*s*_,C=Math.sqrt(y),P=Math.sqrt(3)/2,x=Math.abs(Math.atan2(o*C,-g)/3);a=2*Math.sqrt(-M);var D=Math.cos(x);i=a*D;var U=a*(-D/2-P*Math.sin(x)),L=i+U>2*u?i-u:U-u,F=o,B=L/F;x=Math.abs(Math.atan2(c*C,-w)/3),a=2*Math.sqrt(-I),D=Math.cos(x),i=a*D,U=a*(-D/2-P*Math.sin(x));var z=-c,b=2*s>i+U?i+s:U+s,G=z/b,q=F*b,W=-L*b-F*z,X=L*z,H=(s*W-u*X)/(-u*W+s*q);return H>=B?G>=B?G>=H?[B,H,G]:[B,G,H]:[G,B,H]:G>=B?[H,B,G]:G>=H?[H,G,B]:[G,H,B]}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=0>u?-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,0>u?[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,d=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(d.length>0){var f=-t/4,h=d[d.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[f-T,f-p,f+p,f+T]}if(_>=0&&0>y)return m=Math.sqrt(_),[f-m,f+m];if(0>_&&y>=0)return m=Math.sqrt(y),[f-m,f+m]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,S=(s+h+c/R)/2,v=r.computeRealRoots(1,R,A),N=r.computeRealRoots(1,-R,S);return 0!==v.length?(v[0]+=f,v[1]+=f,0!==N.length?(N[0]+=f,N[1]+=f,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]+=f,N[1]+=f,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,d=i*t+s-4*o,f=c*o-i*a*t+u,h=e.computeRealRoots(1,l,d,f);if(h.length>0){var E,m,_=h[0],y=a-_,p=y*y,T=t/2,R=y/2,A=p-4*o,S=p+4*Math.abs(o),v=c-4*_,N=c+4*Math.abs(_);if(0>_||v*S>A*N){var O=Math.sqrt(v);E=O/2,m=0===O?0:(t*R-i)/O}else{var M=Math.sqrt(A);E=0===M?0:(t*R-i)/M,m=M/2}var g,I;0===T&&0===E?(g=0,I=0):n.sign(T)===n.sign(E)?(g=T+E,I=_/g):(I=T-E,g=_/I);var w,C;0===R&&0===m?(w=0,C=0):n.sign(R)===n.sign(m)?(w=R+m,C=o/w):(C=R-m,w=o/C);var P=r.computeRealRoots(1,g,w),x=r.computeRealRoots(1,I,C);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,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,d=r*r,f=d*r,h=a*a,E=h*a,m=u*c*d-4*s*f-4*e*l*d+18*e*t*n*f-27*i*d*d+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*d+144*i*n*d)+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,d=u/t,f=s/t,h=0>c?1:0;switch(h+=0>l?h+1:h,h+=0>d?h+1:h,h+=0>f?h+1:h){case 0:return a(c,l,d,f);case 1:return i(c,l,d,f);case 2:return i(c,l,d,f);case 3:return a(c,l,d,f);case 4:return a(c,l,d,f);case 5:return i(c,l,d,f);case 6:return a(c,l,d,f);case 7:return a(c,l,d,f);case 8:return i(c,l,d,f);case 9:return a(c,l,d,f);case 10:return a(c,l,d,f);case 11:return i(c,l,d,f);case 12:return a(c,l,d,f);case 13:return a(c,l,d,f);case 14:return a(c,l,d,f);case 15:return a(c,l,d,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","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(t,r,a,o,u){u=n(u,!1);var s,c,l,d,f,h=t.origin,E=t.direction,m=e.subtract(a,r,_),A=e.subtract(o,r,y),S=e.cross(E,A,p),v=e.dot(m,S);if(u){if(v<i.EPSILON6)return;if(s=e.subtract(h,r,T),l=e.dot(s,S),0>l||l>v)return;if(c=e.cross(s,m,R),d=e.dot(E,c),0>d||l+d>v)return;f=e.dot(A,c)/v}else{if(Math.abs(v)<i.EPSILON6)return;var N=1/v;if(s=e.subtract(h,r,T),l=e.dot(s,S)*N,0>l||l>1)return;if(c=e.cross(s,m,R),d=e.dot(E,c)*N,0>d||l+d>1)return;f=e.dot(A,c)*N}return f}function d(e,t,n,r){var a=t*t-4*e*n;if(!(0>a)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(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),l=e.dot(o,o),f=2*e.dot(o,c),h=e.magnitudeSquared(c)-s,E=d(l,f,h,S);return r(E)?(a.start=E.root0,a.stop=E.root1,a):void 0}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 E(t,n,r,a,c){var l,d=a*a,f=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*f,m=c*(a*h(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),_=t[o.COLUMN0ROW0]*d+t[o.COLUMN2ROW2]*f+a*n.x+r,y=f*h(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),p=c*(a*h(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 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=p*p,O=y*y,M=E*E,g=p*y,I=M+O,w=2*(m*E+g),C=2*_*E+m*m-O+N,P=2*(_*m-g),x=_*_-N;if(0===I&&0===w&&0===C&&0===P)return T;l=s.computeRealRoots(I,w,C,P,x);var D=l.length;if(0===D)return T;for(var U=0;D>U;++U){var L,F=l[U],B=F*F,z=Math.max(1-B,0),b=Math.sqrt(z);L=i.sign(E)===i.sign(_)?h(E*B+_,m*F,i.EPSILON12):i.sign(_)===i.sign(m*F)?h(E*B,m*F+_,i.EPSILON12):h(E*B+m*F,_,i.EPSILON12);var G=h(y*F,p,i.EPSILON15),q=L*G;0>q?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 m={};m.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(!(0>l))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var _=new e,y=new e,p=new e,T=new e,R=new e;m.rayTriangle=function(t,n,a,i,o,u){var s=l(t,n,a,i,o);if(r(s)&&!(0>s))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new c;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 d=l(c,a,i,o,u);return!r(d)||0>d||d>e.distance(t,n)?void 0:(r(s)||(s=new e),e.multiplyByScalar(c.direction,d,s),e.add(c.origin,s,s))};var S={root0:0,root1:0};m.raySphere=function(e,t,n){return n=f(e,t,n),!r(n)||n.stop<0?void 0:(n.start=Math.max(n.start,0),n)};var v=new c;m.lineSegmentSphere=function(t,n,a,i){var o=v,u=e.subtract(n,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=f(o,a,i),!r(i)||i.stop<0||i.start>s?void 0:(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,i,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,N),l=e.multiplyComponents(s,t.direction,O),d=e.magnitudeSquared(c),f=e.dot(c,l);if(d>1){if(f>=0)return;var h=f*f;if(r=d-1,a=e.magnitudeSquared(l),i=a*r,i>h)return;if(h>i){o=f*f-i,u=-f+Math.sqrt(o);var E=u/a,m=r/u;return m>E?{start:E,stop:m}:{start:m,stop:E}}var _=Math.sqrt(r/a);return{start:_,stop:_}}return 1>d?(r=d-1,a=e.magnitudeSquared(l),i=a*r,o=f*f-i,u=-f+Math.sqrt(o),{start:0,stop:u/a}):0>f?(a=e.magnitudeSquared(l),{start:0,stop:-f/a}):void 0};var M=new e,g=new e,I=new e,w=new e,C=new e,P=new o,x=new o,D=new o,U=new o,L=new o,F=new o,B=new o,z=new e,b=new e,G=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction,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),d=e.normalize(l,l),f=e.mostOrthogonalAxis(l,w),h=e.normalize(e.cross(f,d,g),g),m=e.normalize(e.cross(d,h,I),I),_=P;_[0]=d.x,_[1]=d.y,_[2]=d.z,_[3]=h.x,_[4]=h.y,_[5]=h.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var y=o.transpose(_,x),p=o.fromScale(n.radii,D),T=o.fromScale(n.oneOverRadii,U),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 A,S,v=o.multiply(o.multiply(y,T,F),R,F),N=o.multiply(o.multiply(v,p,B),_,B),O=o.multiplyByVector(v,a,C),q=E(N,e.negate(O,M),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,b),H=Number.NEGATIVE_INFINITY,V=0;W>V;++V){A=o.multiplyByVector(p,o.multiplyByVector(_,q[V],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,u);k>H&&(H=k,X=e.clone(A,X))}var j=n.cartesianToCartographic(X,G);return H=i.clamp(H,0,1),S=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-H*H),S=c?-S:S,j.height=S,n.cartographicToCartesian(j,new e)}};var q=new e;return m.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),d=-(a.distance+l)/c;if(!(0>d||d>1))return e.multiplyByScalar(u,d,o),e.add(t,o,o),o}},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 d,f;if((1===l||2===l)&&(d=new e,f=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,d),m.lineSegmentPlane(t,r,a,f),{positions:[t,n,r,d,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,d),m.lineSegmentPlane(n,t,a,f),{positions:[t,n,r,d,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,d),m.lineSegmentPlane(r,n,a,f),{positions:[t,n,r,d,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,d),m.lineSegmentPlane(r,t,a,f),{positions:[t,n,r,d,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,d),m.lineSegmentPlane(t,n,a,f),{positions:[t,n,r,d,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,d),m.lineSegmentPlane(n,r,a,f),{positions:[t,n,r,d,f],indices:[0,1,4,0,4,3,2,3,4]}}},m}),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,d){"use strict";function f(e,t,n){var r=N;r.length=e;var a;if(t===n){for(a=0;e>a;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;e>a;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,I),l=a.scaleToGeodeticSurface(n,w),d=E.numberOfPoints(t,n,r),h=a.cartesianToCartographic(c,O),m=a.cartesianToCartographic(l,M),_=f(d,i,o);C.setEndPoints(h,m);var y=C.surfaceDistance/d,p=s;h.height=i;var T=a.cartographicToCartesian(h,g);e.pack(T,u,p),p+=3;for(var R=1;d>R;R++){var A=C.interpolateUsingSurfaceDistance(R*y,M);A.height=_[R],T=a.cartographicToCartesian(A,g),e.pack(T,u,p),p+=3}return p}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;n>a;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,m).height}return r};var _=new l,y=new e,p=new e,T=new d(e.ZERO,0),R=new e,A=new d(e.ZERO,0),S=new e,v=new e,N=[],O=new t,M=new t,g=new e,I=new e,w=new e,C=new o;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,y),f=l.multiplyByPointAsVector(s,e.UNIT_Y,p),h=d.fromPointNormal(c,f,T),E=l.multiplyByPointAsVector(s,e.UNIT_X,R),m=d.fromPointNormal(c,E,A),N=1;i.push(e.clone(t[0]));for(var O=i[0],M=t.length,g=1;M>g;++g){var I=t[g];if(d.getPointDistance(m,O)<0||d.getPointDistance(m,I)<0){var w=u.lineSegmentPlane(O,I,h,S);if(r(w)){var C=e.multiplyByScalar(f,5e-9,v);d.getPointDistance(h,O)<0&&e.negate(C,C),i.push(e.add(w,C,new e)),o.push(N+1),e.negate(C,C),i.push(e.add(w,C,new e)),N=1}}i.push(e.clone(t[g])),N++,O=I}o.push(N)}return{positions:i,lengths:o}};var P=c.EPSILON10;return E.removeDuplicates=function(t){var n=t.length;if(2>n)return t;var r,a,i;for(r=1;n>r&&(a=t[r-1],i=t[r],!e.equalsEpsilon(a,i,P));++r);if(r===n)return t;for(var o=t.slice(0,r);n>r;++r)i=t[r],e.equalsEpsilon(a,i,P)||(o.push(e.clone(i)),a=i);return 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);if(1>o)return[];if(1===o){var d=u.scaleToGeodeticSurface(a[0],I);if(0!==l){var f=u.geodeticSurfaceNormal(d,g);e.multiplyByScalar(f,l,f),e.add(d,f,d)}return[d.x,d.y,d.z]}var m=t.minDistance;if(!r(m)){var _=n(t.granularity,c.RADIANS_PER_DEGREE);m=c.chordLength(_,u.maximumRadius)}var y,p=0;for(y=0;o-1>y;y++)p+=E.numberOfPoints(a[y],a[y+1],m);var T=3*(p+1),R=new Array(T),A=0,S=s(l);for(y=0;o-1>y;y++){var v=a[y],M=a[y+1],w=S?l[y]:l,C=S?l[y+1]:l;A=h(v,M,m,u,w,C,R,A)}N.length=0;var P=a[o-1],x=u.cartesianToCartographic(P,O);x.height=S?l[o-1]:l;var D=u.cartographicToCartesian(x,g);return e.pack(D,R,T-3),R},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;r>i;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){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},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.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.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,d=t.length,f=1;d>f;f++){var h=t[f],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){return n(t)?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):void 0},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:0>s+u?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(r){return i(r)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(a){return i(a)}});return n}function o(){function e(e,t,n){return f(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,d,f,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=[],d=[],f=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(t){r.progress(t)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),d.push(a),r.promise},h=function(e){return m(d,e),e},E=function(e){return e=t(e),f=e.then,E=t,h=y,m(l,e),d=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,d,f,h,E,m,_,p,T;if(p=t.length>>>0,c=Math.max(0,Math.min(n,p)),d=[],l=p-c+1,f=[],h=o(),c)for(_=h.progress,m=function(e){f.push(e),--l||(E=m=y,h.reject(f))},E=function(e){d.push(e),--c||(E=m=y,h.resolve(d))},T=0;p>T;++T)T in t&&e(t[T],s,u,_);else h.resolve(d);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),f(e,p).then(t,n,r)}function d(){return f(arguments,p)}function f(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;a>s;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=d,e.all=l,e.map=f,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(;a>i;++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;o>=i;)if(r=~~((i+o)/2),a=n(e[r],t),0>a)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,d,f){var h,E,m,_,y;if("%%"==e)return"%";for(var p=!1,T="",R=!1,A=!1,S=" ",v=s.length,N=0;s&&v>N;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":p=!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,0>c&&(c=-c,p=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(d=d?"*"==d?+t[n++]:"*"==d.charAt(0)?+t[d.slice(1,-1)]:+d:"fFeE".indexOf(f)>-1?6:"d"==f?0:void 0,y=r?t[r.slice(0,-1)]:t[n++],f){case"s":return u(String(y),p,c,d,R,S);case"c":return u(String.fromCharCode(+y),p,c,d,R);case"b":return o(y,2,A,p,c,d,R);case"o":return o(y,8,A,p,c,d,R);case"x":return o(y,16,A,p,c,d,R);case"X":return o(y,16,A,p,c,d,R).toUpperCase();case"u":return o(y,10,A,p,c,d,R);case"i":case"d":return h=+y||0,h=Math.round(h-h%1),E=0>h?"-":T,y=E+a(String(Math.abs(h)),d,"0",!1),i(y,E,p,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+y,E=0>h?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(f.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(f)%2],y=E+Math.abs(h)[m](d),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 d(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);0>r&&(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 f(e,n){T.julianDate=e;var r=m.leapSeconds,a=t(r,T,l);if(0>a&&(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):1>=i?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,0>t&&(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,0>r&&(r+=24);var d=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return d>=43200&&(l-=1),[l,d]}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&&d(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})$/,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})?$/,M=/^(\d{2})(\.\d+)?/.source+O.source,g=/^(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,I=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,w="Invalid ISO 8601 date.";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),d(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,i,u,s=e.split("T"),l=1,f=1,_=0,T=0,O=0,C=0,P=s[0],x=s[1];if(!r(P))throw new a(w);var D;if(s=P.match(N),null!==s){if(D=P.split("-").length-1,D>0&&2!==D)throw new a(w);n=+s[1],l=+s[2],f=+s[3]}else if(s=P.match(A),null!==s)n=+s[1],l=+s[2];else if(s=P.match(R),null!==s)n=+s[1];else{var U;if(s=P.match(S),null!==s){if(n=+s[1],U=+s[2],u=o(n),1>U||u&&U>366||!u&&U>365)throw new a(w)}else{if(s=P.match(v),null===s)throw new a(w);n=+s[1];var L=+s[2],F=+s[3]||0;if(D=P.split("-").length-1,D>0&&(!r(s[3])&&1!==D||r(s[3])&&2!==D))throw new a(w);var B=new Date(Date.UTC(n,0,4));U=7*L+F-B.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(U),l=i.getUTCMonth()+1,f=i.getUTCDate()}if(u=o(n),1>l||l>12||1>f||(2!==l||!u)&&f>y[l-1]||u&&2===l&&f>p)throw new a(w);var z;if(r(x)){if(s=x.match(I),null!==s){if(D=x.split(":").length-1,D>0&&2!==D&&3!==D)throw new a(w);_=+s[1],T=+s[2],O=+s[3],C=1e3*+(s[4]||0),z=5}else if(s=x.match(g),null!==s){if(D=x.split(":").length-1,D>2)throw new a(w);_=+s[1],T=+s[2],O=60*+(s[3]||0),z=4}else{if(s=x.match(M),null===s)throw new a(w);_=+s[1],T=60*+(s[2]||0),z=3}if(T>=60||O>=61||_>24||24===_&&(T>0||O>0||C>0))throw new a(w);var b=s[z],G=+s[z+1],q=+(s[z+2]||0);switch(b){case"+":_-=G,T-=q;break;case"-":_+=G,T+=q;break;case"Z":break;default:T+=new Date(Date.UTC(n,l-1,f,_,T)).getTimezoneOffset()}}else T+=new Date(n,l-1,f).getTimezoneOffset();var W=60===O;for(W&&O--;T>=60;)T-=60,_++;for(;_>=24;)_-=24,f++;for(i=u&&2===l?p:y[l-1];f>i;)f-=i,l++,l>12&&(l-=12,n++),i=u&&2===l?p:y[l-1];for(;0>T;)T+=60,_--;for(;0>_;)_+=24,f--;for(;1>f;)l--,1>l&&(l+=12,n--),i=u&&2===l?p:y[l-1],f+=i;var X=E(n,l,f,_,T,O,C);return r(t)?(h(X[0],X[1],t),d(t)):t=new m(X[0],X[1],c.UTC),W&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var C=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=f(e,C);r(a)||(m.addSeconds(e,-1,C),a=f(C,C),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 d=4e3*(c+1)/1461001|0;c=c-(1461*d/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)+d+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,S=(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=S,t.isLeapSecond=n,t):new i(y,_,E,p,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){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI):void 0},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 0>r&&(r=~r,--r,0>r&&(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)],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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,n,r,a,i){"use strict";function o(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,u=n.headers,s=n.overrideMimeType,c=n.withCredentials;return e(n.url,function(t){var n=e.defer();return o.load(t,r,a,i,u,n,s,c),n.promise})}function u(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function s(e,t){for(var n=u(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 c(e,n){n=t(n,"");var a=e[1],i=!!e[2],o=e[3];switch(n){case"":case"text":return u(i,o);case"arraybuffer":return s(i,o);case"blob":var c=s(i,o);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(u(i,o),a);case"json":return JSON.parse(u(i,o));default:throw new r("Unhandled responseType: "+n)}}var l=/^data:(.*?)(;base64)?,(.*)$/;return o.load=function(e,t,r,o,u,s,d,f){var h=l.exec(e);if(null!==h)return void s.resolve(c(h,t));var E=new XMLHttpRequest;if(n(d)&&n(E.overrideMimeType)&&E.overrideMimeType(d),E.open(r,e,!0),n(u))for(var m in u)u.hasOwnProperty(m)&&E.setRequestHeader(m,u[m]);n(t)&&(E.responseType=t),n(f)&&(E.withCredentials=f),E.onload=function(){E.status>=200&&E.status<300?n(E.response)?s.resolve(E.response):n(E.responseXML)&&E.responseXML.hasChildNodes()?s.resolve(E.responseXML):n(E.responseText)?s.resolve(E.responseText):s.reject(new i("unknown XMLHttpRequest response type.")):s.reject(new a(E.status,E.response,E.getAllResponseHeaders()))},E.onerror=function(e){s.reject(new a)},E.send(o)},o.defaultLoad=o.load,o}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";function n(n,r){return e({url:n,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return n}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)||(a={}),t(a.headers)?t(a.headers.Accept)||(a.headers=e(a.headers),a.headers.Accept=i.Accept):a.headers=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,d){"use strict";function f(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"),f=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(0>a||0>i||0>s||0>c||0>f||0>E||0>m)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=f,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;A>R;R+=e._columnCount){var S=_[R+a],v=_[R+m],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,O=new o(N,v,d.TAI);if(y.push(O),T){if(v!==p&&r(p)){var M=o.leapSeconds,g=t(M,O,h);if(0>g){var I=new u(O,v);M.splice(~g,0,I)}}p=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 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 d=o.secondsDifference(r,c)/o.secondsDifference(l,c),f=a*s,h=i*s,E=n[f+e._ut1MinusUtcSecondsColumn],y=n[h+e._ut1MinusUtcSecondsColumn],p=y-E;if(p>.5||-.5>p){var T=n[f+e._taiMinusUtcSecondsColumn],R=n[h+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=y:y-=R-T)}return u.xPoleWander=_(d,n[f+e._xPoleWanderRadiansColumn],n[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(d,n[f+e._yPoleWanderRadiansColumn],n[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(d,n[f+e._xCelestialPoleOffsetRadiansColumn],n[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(d,n[f+e._yCelestialPoleOffsetRadiansColumn],n[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(d,E,y),u}return f.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}}),f.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},f.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 d=i[u],f=i[u+1],h=o.lessThanOrEquals(d,e),E=!r(f),m=E||o.greaterThanOrEquals(f,e);if(h&&m)return s=u,!E&&f.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,0>s&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},f}),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/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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","require"],function(e,t,n,r,a){"use strict";function i(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),a=h.exec(r);if(null!==a)return a[1]}}function o(){if(t(l))return l;var a;if(a="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:i(),!t(a))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new e(r(a))}function u(e){return a.toUrl("../"+e)}function s(t){return new e(t).resolve(o()).toString()}function c(e){t(d)||(d=t(a.toUrl)?u:s),t(f)||(f=document.createElement("a"));var n=d(e);return f.href=n,f.href=f.href,f.href}var l,d,f,h=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=h,c.setBaseUrl=function(t){l=new e(t).resolve(new e(document.location.href))},c}),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;t>=s;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;t>=c;++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=d;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;s>u;++u)t[o+u]=r[u];i.resolve()}),i.promise}var d=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;0>u&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var d=u/this._samplesPerXysFile|0,f=s/this._samplesPerXysFile|0,h=[],E=d;f>=E;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(0>i)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);0>s&&(s=0);var d=s+u;d>=this._totalSamples&&(d=this._totalSamples-1,s=d-u,0>s&&(s=0));var f=!1,h=this._samples;if(r(h[3*s])||(l(this,s/this._samplesPerXysFile|0),f=!0),r(h[3*d])||(l(this,d/this._samplesPerXysFile|0),f=!0),!f){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;u>=E;++E)y[E]=_-R[E];for(E=0;u>=E;++E){for(T[E]=1,m=0;u>=m;++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/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,d=c.z*o,f=Math.cos(i);return n(a)?(a.x=u,a.y=l,a.z=d,a.w=f,a):new s(u,l,d,f)};var l=[1,2,0],d=new Array(3);s.fromRotationMatrix=function(e,t){var r,a,i,o,c,f=e[u.COLUMN0ROW0],h=e[u.COLUMN1ROW1],E=e[u.COLUMN2ROW2],m=f+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>f&&(y=1),E>f&&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=d;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 f=new s;s.fromHeadingPitchRoll=function(t,n,r,a){var i=s.fromAxisAngle(e.UNIT_X,r,f),o=s.fromAxisAngle(e.UNIT_Y,-n,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,E=new e,m=new s,_=new s,y=new s;s.packedLength=4,s.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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;i>a;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){return n(e)?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):void 0},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,d=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,E=o*l-r*u-a*s-i*c;return n.x=d,n.y=f,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(0>a&&(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,O=new s;s.computeInnerQuadrangle=function(t,n,r,a){var i=s.conjugate(n,N);s.multiply(i,r,O);var o=s.log(O,S);s.multiply(i,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,a)},s.squad=function(e,t,n,r,a,i){var o=s.slerp(e,t,a,N),u=s.slerp(n,r,a,O);return s.slerp(o,u,2*a*(1-a),i)};for(var M=new s,g=1.9011074535173003,I=a.supportsTypedArrays()?new Float32Array(8):[],w=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],P=a.supportsTypedArrays()?new Float32Array(8):[],x=0;7>x;++x){var D=x+1,U=2*D+1;I[x]=1/(D*U),w[x]=D/U}return I[7]=g/136,w[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,d=7;d>=0;--d)C[d]=(I[d]*c-w[d])*o,P[d]=(I[d]*l-w[d])*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+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,M);return s.multiplyByScalar(t,f,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,O);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","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,h,E,m,_,y){"use strict";var p={},T=new n,R=new n,A=new n;p.eastNorthUpToFixedFrame=function(e,t,r){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return i(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=T,s=R,l=A;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.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 m(s.x,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var S=new n,v=new n,N=new n;p.northEastDownToFixedFrame=function(e,t,r){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return i(r)?(r[0]=-o,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]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=S,s=v,l=N;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.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 m(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},p.northUpEastToFixedFrame=function(e,t,r){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return i(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=o,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(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=T,s=R,l=A;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(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 m(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 O=new _,M=new n(1,1,1),g=new m;p.headingPitchRollToFixedFrame=function(e,t,r,a,i,o){var u=_.fromHeadingPitchRoll(t,r,a,O),s=m.fromTranslationQuaternionRotationScale(n.ZERO,u,M,g);return o=p.eastNorthUpToFixedFrame(e,i,o),m.multiply(o,s,o)};var I=new m,w=new E;p.headingPitchRollQuaternion=function(e,t,n,r,a,i){var o=p.headingPitchRollToFixedFrame(e,t,n,r,a,I),u=m.getRotation(o,w);return _.fromRotationMatrix(u,i)};var C=24110.54841,P=8640184.812866,x=.093104,D=-62e-7,U=1.1772758384668e-19,L=72921158553e-15,F=h.TWO_PI/86400,B=new f;p.computeTemeToPseudoFixedMatrix=function(e,t){B=f.addSeconds(e,-f.computeTaiMinusUtc(e),B);var n,r=B.dayNumber,a=B.secondsOfDay,o=r-2451545;n=a>=43200?(o+.5)/y.DAYS_PER_JULIAN_CENTURY:(o-.5)/y.DAYS_PER_JULIAN_CENTURY;var u=C+n*(P+n*(x+n*D)),s=u*F%h.TWO_PI,c=L+U*(r-2451545.5),l=(a+.5*y.SECONDS_PER_DAY)%y.SECONDS_PER_DAY,d=s+c*l,m=Math.cos(d),_=Math.sin(d);return i(t)?(t[0]=m,t[1]=-_,t[2]=0,t[3]=_,t[4]=m,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(m,_,0,-_,m,0,0,0,1)},p.iau2006XysData=new l,p.earthOrientationParameters=u.NONE;var z=32.184,b=2451545;p.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+z,a=t.stop.dayNumber,i=t.stop.secondsOfDay+z,o=p.iau2006XysData.preload(n,r,a,i),u=p.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},p.computeIcrfToFixedMatrix=function(e,t){i(t)||(t=new E);var n=p.computeFixedToIcrfMatrix(e,t);if(i(n))return E.transpose(n,t)};var G=new d(0,0,0),q=new s(0,0,0,0,0,0),W=new E,X=new E;p.computeFixedToIcrfMatrix=function(e,t){i(t)||(t=new E);var n=p.earthOrientationParameters.compute(e,q);if(i(n)){var r=e.dayNumber,a=e.secondsOfDay+z,o=p.iau2006XysData.computeXysRadians(r,a,G);if(i(o)){var u=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=W;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 d=E.fromRotationZ(-o.s,X),m=E.multiply(l,d,W),_=e.dayNumber,T=e.secondsOfDay-f.computeTaiMinusUtc(e)+n.ut1MinusUtc,R=_-2451545,A=T/y.SECONDS_PER_DAY,S=.779057273264+A+.00273781191135448*(R+A);S=S%1*h.TWO_PI;var v=E.fromRotationZ(S,X),N=E.multiply(m,v,W),O=Math.cos(n.xPoleWander),M=Math.cos(n.yPoleWander),g=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),w=r-b+a/y.SECONDS_PER_DAY;w/=36525;var C=-47e-6*w*h.RADIANS_PER_DEGREE/3600,P=Math.cos(C),x=Math.sin(C),D=X;return D[0]=O*P,D[1]=O*x,D[2]=g,D[3]=-M*x+I*g*P,D[4]=M*P+I*g*x,D[5]=-I*O,D[6]=-I*x-M*g*P,D[7]=I*P-M*g*x,D[8]=M*O,E.multiply(N,D,t)}}};var H=new r;p.pointToWindowCoordinates=function(e,t,n,r){return r=p.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},p.pointToGLWindowCoordinates=function(e,n,a,o){i(o)||(o=new t);var u=H;return m.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,u),u),r.multiplyByScalar(u,1/u.w,u),m.multiplyByVector(n,u,u),t.fromCartesian4(u,o)};var V=new n,Y=new n,k=new n;return p.rotationMatrixFromPositionVelocity=function(e,t,r,o){var u=a(r,c.WGS84).geodeticSurfaceNormal(e,V),s=n.cross(t,u,Y);n.equalsEpsilon(s,n.ZERO,h.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var l=n.cross(s,t,k);return n.cross(t,l,s),n.negate(s,s),i(o)||(o=new E),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=s.x,o[4]=s.y,o[5]=s.z,o[6]=l.x,o[7]=l.y,o[8]=l.z,o},p}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix3","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,h,E){"use strict";function m(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(d.getColumn(r,0,_)),this._yAxis=n.fromCartesian4(d.getColumn(r,1,_));var i=n.fromCartesian4(d.getColumn(r,2,_));this._plane=f.fromPointNormal(e,i)}var _=new r;o(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 y=new e;m.fromPoints=function(t,n){var r=e.fromPoints(t,y);return new m(r.center,n)};var p=new h,T=new n;m.prototype.projectPointOntoPlane=function(e,r){var a=p;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,T);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,T)),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)}},m.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;r>a;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},m.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,T);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,T));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},m.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;n>r;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var R=new n;return m.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=R,l=0;r>l;++l){var d=e[l];n.multiplyByScalar(u,d.x,c),i(t[l])||(t[l]=new n);var f=n.add(o,c,t[l]);n.multiplyByScalar(s,d.y,c),n.add(f,c,f),a.scaleToGeocentricSurface(f,f)}return t},m}),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,d){"use strict";function f(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;c>i;i++)l[i]=n;return l.push(r),l}var d=r-n,f=d/c;for(i=1;c>i;i++){var h=n+i*f;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 f=b,h=G;L=d.eastNorthUpToFixedFrame(e,i,L),f=s.multiplyByPointAsVector(L,U,f),f=t.normalize(f,f);var m=E(f,n,e,i);B=u.fromRotationZ(m,B),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(B,q,F),L);var _=z;_[0]=c;for(var y=0;l>y;y++)for(var p=0;p<r.length;p+=3)h=t.fromArray(r,p,h),h=u.multiplyByVector(_,h,h),h=s.multiplyByPoint(L,h,h),a.push(h.x,h.y,h.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=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;n>s;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 p(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;n>u;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,d,f,h,E){var _,y=t.angleBetween(t.subtract(n,e,C),t.subtract(r,e,P)),p=i===a.BEVELED?0:Math.ceil(y/o.toRadians(5));_=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,C),y/(p+1),X),V):u.fromQuaternion(l.fromAxisAngle(e,y/(p+1),X),V);var T,R;if(n=t.clone(n,H),p>0)for(var A=E?2:1,S=0;p>S;S++)n=u.multiplyByVector(_,n,n),T=t.subtract(n,e,C),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,P),d=m(R,T,f,d,c,h,1,A);else T=t.subtract(n,e,C),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,P),d=m(R,T,f,d,c,h,1,1),r=t.clone(r,H),T=t.subtract(r,e,C),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(r,P),d=m(R,T,f,d,c,h,1,1);return d}var R=[new t,new t],A=new t,S=new t,v=new t,N=new t,O=new t,M=new t,g=new t,I=new t,w=new t,C=new t,P=new t,x={},D=new r,U=new t(-1,0,0),L=new s,F=new s,B=new u,z=u.IDENTITY.clone(),b=new t,G=new n,q=new t,W=new t,X=new l,H=new t,V=new u;x.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;n>i;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;x.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 j=new t,Z=new t;return x.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=f(e,s),d=i._granularity,E=i._cornerType,P=u?y(n,r):p(n,r),D=u?p(n,r):void 0,U=r.height/2,L=r.width/2,F=e.length,B=[],z=u?[]:void 0,b=A,G=S,q=v,W=N,X=O,H=M,V=g,Y=I,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=m(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;F-1>ne;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),j);t.subtract(b,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),Z);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,C))),se=x.angleIsGreaterThanPi(b,G,K,s);se?(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),H=t.add(X,t.multiplyByScalar(Y,L,H),H),R[0]=t.clone(k,R[0]),R[1]=t.clone(H,R[1]),ee=h(R,Q+U,$+U,d),te=c.generateArc({positions:R,granularity:d,ellipsoid:s}),B=_(te,Y,P,B,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),V=t.add(X,t.multiplyByScalar(Y,L,V),V),E===a.ROUNDED||E===a.BEVELED?T(X,H,V,E,se,s,B,P,$+U,u):(q=t.negate(q,q),B=m(K,q,P,B,s,$+U,ue,re)),k=t.clone(V,k)):(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),H=t.add(X,t.multiplyByScalar(Y,-L,H),H),R[0]=t.clone(k,R[0]),R[1]=t.clone(H,R[1]),ee=h(R,Q+U,$+U,d),te=c.generateArc({positions:R,granularity:d,ellipsoid:s}),B=_(te,Y,P,B,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),V=t.add(X,t.multiplyByScalar(Y,-L,V),V),E===a.ROUNDED||E===a.BEVELED?T(X,H,V,E,se,s,B,P,$+U,u):B=m(K,q,P,B,s,$+U,ue,re),k=t.clone(V,k)),G=t.negate(b,G)}else B=m(k,Y,P,B,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,d),te=c.generateArc({positions:R,granularity:d,ellipsoid:s}),B=_(te,Y,P,B,s,ee,1),u&&(z=m(K,Y,D,z,s,$+U,1,1)),F=B.length;var ce=u?F+z.length:F,le=new Float64Array(ce);return le.set(B),u&&le.set(z,F),le},x}),define("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./isArray","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(n,r,o,u,c){var l=e.angleBetween(e.subtract(r,n,m),e.subtract(o,n,_)),d=u===t.BEVELED?1:Math.ceil(l/a.toRadians(5))+1,f=3*d,h=new Array(f);h[f-3]=o.x,h[f-2]=o.y,h[f-1]=o.z;var E;E=c?i.fromQuaternion(s.fromAxisAngle(e.negate(n,m),l/d,C),P):i.fromQuaternion(s.fromAxisAngle(n,l/d,C),P);var y=0;r=e.clone(r,m);for(var p=0;d>p;p++)r=i.multiplyByVector(E,r,r),h[y++]=r.x,h[y++]=r.y,h[y++]=r.z;return h}function l(n){var r=R,a=A,i=S,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=c(r,a,i,t.ROUNDED,!1),s=n.length-1,l=n[s-1];o=n[s],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 d=c(r,a,i,t.ROUNDED,!1);return[u,d]}function d(t,n,r,a){var i=m;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,m),s=e.negate(u,_),c=0,l=t.length-1,d=0;d<t.length;d+=3){var f=e.fromArray(t,d,y),h=e.add(f,s,p);i[c++]=h.x,i[c++]=h.y,i[c++]=h.z;var E=e.add(f,u,p);o[l--]=E.z,o[l--]=E.y,o[l--]=E.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 E={},m=new e,_=new e,y=new e,p=new e,T=[new e,new e],R=new e,A=new e,S=new e,v=new e,N=new e,O=new e,M=new e,g=new e,I=new e,w=new e,C=new s,P=new i;E.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 x=new e,D=new e;E.computePositions=function(n){var r=n.granularity,i=n.positions,s=n.ellipsoid;i=h(i,s);var E=n.width/2,_=n.cornerType,y=n.saveAttributes,p=R,C=A,P=S,U=v,L=N,F=O,B=M,z=g,b=I,G=w,q=[],W=y?[]:void 0,X=y?[]:void 0,H=i[0],V=i[1];C=e.normalize(e.subtract(V,H,C),C),p=s.geodeticSurfaceNormal(H,p),U=e.normalize(e.cross(p,C,U),U),y&&(W.push(U.x,U.y,U.z),X.push(p.x,p.y,p.z)),B=e.clone(H,B),H=V,P=e.negate(C,P);var Y,k,j=[],Z=i.length;for(k=1;Z-1>k;k++){p=s.geodeticSurfaceNormal(H,p),V=i[k+1],C=e.normalize(e.subtract(V,H,C),C),L=e.normalize(e.add(C,P,L),L);var K=e.multiplyByScalar(p,e.dot(C,p),x);e.subtract(C,K,K),e.normalize(K,K);var J=e.multiplyByScalar(p,e.dot(P,p),D);e.subtract(P,J,J),e.normalize(J,J);var Q=!a.equalsEpsilon(Math.abs(e.dot(K,J)),1,a.EPSILON7);if(Q){L=e.cross(L,p,L),L=e.cross(p,L,L),L=e.normalize(L,L);var $=E/Math.max(.25,e.magnitude(e.cross(L,P,m))),ee=u.angleIsGreaterThanPi(C,P,H,s);L=e.multiplyByScalar(L,$,L),ee?(z=e.add(H,L,z),G=e.add(z,e.multiplyByScalar(U,E,G),G),b=e.add(z,e.multiplyByScalar(U,2*E,b),b),T[0]=e.clone(B,T[0]),T[1]=e.clone(G,T[1]),Y=o.generateArc({positions:T,granularity:r,ellipsoid:s}),q=f(Y,U,E,q),y&&(W.push(U.x,U.y,U.z),X.push(p.x,p.y,p.z)),F=e.clone(b,F),U=e.normalize(e.cross(p,C,U),U),b=e.add(z,e.multiplyByScalar(U,2*E,b),b),B=e.add(z,e.multiplyByScalar(U,E,B),B),_===t.ROUNDED||_===t.BEVELED?j.push({leftPositions:c(z,F,b,_,ee)}):j.push({leftPositions:d(H,e.negate(L,L),b,ee)})):(b=e.add(H,L,b),G=e.add(b,e.negate(e.multiplyByScalar(U,E,G),G),G),z=e.add(b,e.negate(e.multiplyByScalar(U,2*E,z),z),z),T[0]=e.clone(B,T[0]),T[1]=e.clone(G,T[1]),Y=o.generateArc({positions:T,granularity:r,ellipsoid:s}),q=f(Y,U,E,q),y&&(W.push(U.x,U.y,U.z),X.push(p.x,p.y,p.z)),F=e.clone(z,F),U=e.normalize(e.cross(p,C,U),U),z=e.add(b,e.negate(e.multiplyByScalar(U,2*E,z),z),z),B=e.add(b,e.negate(e.multiplyByScalar(U,E,B),B),B),_===t.ROUNDED||_===t.BEVELED?j.push({rightPositions:c(b,F,z,_,ee)}):j.push({rightPositions:d(H,L,z,ee)})),P=e.negate(C,P)}H=V}p=s.geodeticSurfaceNormal(H,p),T[0]=e.clone(B,T[0]),T[1]=e.clone(H,T[1]),Y=o.generateArc({positions:T,granularity:r,ellipsoid:s}),q=f(Y,U,E,q),y&&(W.push(U.x,U.y,U.z),X.push(p.x,p.y,p.z));var te;return _===t.ROUNDED&&(te=l(q)),{positions:q,corners:j,lefts:W,normals:X,endPositions:te}};var U=new e,L=new e;return E.scaleToGeodeticHeight=function(t,n,a,i){var o=t.length,u=r(i)?i:new Array(t.length);u.length=t.length;for(var s=n,c=0;o>c;c+=3){var l=a.scaleToGeodeticSurface(e.fromArray(t,c,L),L),d=U;0!==n&&(d=a.geodeticSurfaceNormal(l,d),d=e.multiplyByScalar(d,s,d),l=e.add(l,d,l)),u[c]=l.x,u[c+1]=l.y,u[c+2]=l.z}return u},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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(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=void 0}return i.computeNumberOfVertices=function(e){var r=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,r){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,r):new Uint16Array(t,n,r)},r(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.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){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},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){return t(e)?(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):void 0},a}),define("Core/CorridorGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,h,E,m,_){"use strict";function y(e,n,r,i,o,u){var s=e.normals,c=e.tangents,l=e.binormals,d=t.normalize(t.cross(r,n,w),w);u.normal&&a.addAttribute(s,n,i,o),u.binormal&&a.addAttribute(l,r,i,o),u.tangent&&a.addAttribute(c,d,i,o)}function p(e,r,i){var u,s,c,E=e.positions,m=e.corners,_=e.endPositions,p=e.lefts,T=e.normals,R=new d,A=0,S=0,g=0;for(s=0;s<E.length;s+=2)c=E[s].length-3,A+=c,g+=2*c,S+=E[s+1].length-3;for(A+=3,S+=3,s=0;s<m.length;s++){u=m[s];var P=m[s].leftPositions;o(P)?(c=P.length,A+=c,g+=c):(c=m[s].rightPositions.length,S+=c,g+=c)}var x,D=o(_);D&&(x=_[0].length-3,A+=x,S+=x,x/=3,g+=6*x);var U,L,F,B,z,b,G=A+S,q=new Float64Array(G),W=r.normal?new Float32Array(G):void 0,X=r.tangent?new Float32Array(G):void 0,H=r.binormal?new Float32Array(G):void 0,V={normals:W,tangents:X,binormals:H},Y=0,k=G-1,j=v,Z=N,K=x/2,J=f.createTypedArray(G/3,g),Q=0;if(D){b=O,z=M;var $=_[0];for(j=t.fromArray(T,0,j),Z=t.fromArray(p,0,Z),s=0;K>s;s++)b=t.fromArray($,3*(K-1-s),b),z=t.fromArray($,3*(K+s),z),a.addAttribute(q,z,Y),a.addAttribute(q,b,void 0,k),y(V,j,Z,Y,k,r),L=Y/3,B=L+1,U=(k-2)/3,F=U-1,J[Q++]=U,J[Q++]=L,J[Q++]=F,J[Q++]=F,J[Q++]=L,J[Q++]=B,Y+=3,k-=3}var ee=0,te=0,ne=E[ee++],re=E[ee++];q.set(ne,Y),q.set(re,k-re.length+1),Z=t.fromArray(p,te,Z);var ae,ie;for(c=re.length-3,s=0;c>s;s+=3)ae=i.geodeticSurfaceNormal(t.fromArray(ne,s,w),w),ie=i.geodeticSurfaceNormal(t.fromArray(re,c-s,C),C),j=t.normalize(t.add(ae,ie,j),j),y(V,j,Z,Y,k,r),L=Y/3,B=L+1,U=(k-2)/3,F=U-1,J[Q++]=U,J[Q++]=L,J[Q++]=F,J[Q++]=F,J[Q++]=L,J[Q++]=B,Y+=3,k-=3;for(ae=i.geodeticSurfaceNormal(t.fromArray(ne,c,w),w),ie=i.geodeticSurfaceNormal(t.fromArray(re,c,C),C),j=t.normalize(t.add(ae,ie,j),j),te+=3,s=0;s<m.length;s++){var oe;u=m[s];var ue,se,ce=u.leftPositions,le=u.rightPositions,de=I,fe=O,he=M;if(j=t.fromArray(T,te,j),o(ce)){for(y(V,j,Z,void 0,k,r),k-=3,ue=B,se=F,oe=0;oe<ce.length/3;oe++)de=t.fromArray(ce,3*oe,de),J[Q++]=ue,J[Q++]=se-oe-1,J[Q++]=se-oe,a.addAttribute(q,de,void 0,k),fe=t.fromArray(q,3*(se-oe-1),fe),he=t.fromArray(q,3*ue,he),Z=t.normalize(t.subtract(fe,he,Z),Z),y(V,j,Z,void 0,k,r),k-=3;de=t.fromArray(q,3*ue,de),fe=t.subtract(t.fromArray(q,3*se,fe),de,fe),he=t.subtract(t.fromArray(q,3*(se-oe),he),de,he),Z=t.normalize(t.add(fe,he,Z),Z),y(V,j,Z,Y,void 0,r),Y+=3}else{for(y(V,j,Z,Y,void 0,r),Y+=3,ue=F,se=B,oe=0;oe<le.length/3;oe++)de=t.fromArray(le,3*oe,de),J[Q++]=ue,J[Q++]=se+oe,J[Q++]=se+oe+1,a.addAttribute(q,de,Y),fe=t.fromArray(q,3*ue,fe),he=t.fromArray(q,3*(se+oe),he),Z=t.normalize(t.subtract(fe,he,Z),Z),y(V,j,Z,Y,void 0,r),Y+=3;de=t.fromArray(q,3*ue,de),fe=t.subtract(t.fromArray(q,3*(se+oe),fe),de,fe),he=t.subtract(t.fromArray(q,3*se,he),de,he),Z=t.normalize(t.negate(t.add(he,fe,Z),Z),Z),y(V,j,Z,void 0,k,r),k-=3}for(ne=E[ee++],re=E[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,Z=t.fromArray(p,te,Z),oe=0;oe<re.length;oe+=3)ae=i.geodeticSurfaceNormal(t.fromArray(ne,oe,w),w),ie=i.geodeticSurfaceNormal(t.fromArray(re,c-oe,C),C),j=t.normalize(t.add(ae,ie,j),j),y(V,j,Z,Y,k,r),B=Y/3,L=B-1,F=(k-2)/3,U=F+1,J[Q++]=U,J[Q++]=L,J[Q++]=F,J[Q++]=F,J[Q++]=L,J[Q++]=B,Y+=3,k-=3;Y-=3,k+=3}if(j=t.fromArray(T,T.length-3,j),y(V,j,Z,Y,k,r),D){Y+=3,k-=3,b=O,z=M;var Ee=_[1];for(s=0;K>s;s++)b=t.fromArray(Ee,3*(x-s-1),b),z=t.fromArray(Ee,3*s,z),a.addAttribute(q,b,void 0,k),a.addAttribute(q,z,Y),y(V,j,Z,Y,k,r),B=Y/3,L=B-1,F=(k-2)/3,U=F+1,J[Q++]=U,J[Q++]=L,J[Q++]=F,J[Q++]=F,J[Q++]=L,J[Q++]=B,Y+=3,k-=3}if(R.position=new l({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:q}),r.st){var me,_e,ye=new Float32Array(G/3*2),pe=0;if(D){A/=3,S/=3;var Te=Math.PI/(x+1);_e=1/(A-x+1),me=1/(S-x+1);var Re,Ae=x/2;for(s=Ae+1;x+1>s;s++)Re=h.PI_OVER_TWO+Te*s,ye[pe++]=me*(1+Math.cos(Re)),ye[pe++]=.5*(1+Math.sin(Re));for(s=1;S-x+1>s;s++)ye[pe++]=s*me,ye[pe++]=0;for(s=x;s>Ae;s--)Re=h.PI_OVER_TWO-s*Te,ye[pe++]=1-me*(1+Math.cos(Re)),ye[pe++]=.5*(1+Math.sin(Re));for(s=Ae;s>0;s--)Re=h.PI_OVER_TWO-Te*s,ye[pe++]=1-_e*(1+Math.cos(Re)),ye[pe++]=.5*(1+Math.sin(Re));for(s=A-x;s>0;s--)ye[pe++]=s*_e,ye[pe++]=1;for(s=1;Ae+1>s;s++)Re=h.PI_OVER_TWO+Te*s, +ye[pe++]=_e*(1+Math.cos(Re)),ye[pe++]=.5*(1+Math.sin(Re))}else{for(A/=3,S/=3,_e=1/(A-1),me=1/(S-1),s=0;S>s;s++)ye[pe++]=s*me,ye[pe++]=0;for(s=A;s>0;s--)ye[pe++]=(s-1)*_e,ye[pe++]=1}R.st=new l({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:ye})}return r.normal&&(R.normal=new l({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:V.normals})),r.tangent&&(R.tangent=new l({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:V.tangents})),r.binormal&&(R.binormal=new l({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:V.binormals})),{attributes:R,indices:J}}function T(e,n){if(!(n.normal||n.binormal||n.tangent||n.st))return e;var r,i,o=e.position.values;(n.normal||n.binormal)&&(r=e.normal.values,i=e.binormal.values);var u,s=e.position.values.length/18,c=3*s,l=2*s,d=2*c;if(n.normal||n.binormal||n.tangent){var f=n.normal?new Float32Array(6*c):void 0,h=n.binormal?new Float32Array(6*c):void 0,E=n.tangent?new Float32Array(6*c):void 0,m=v,_=N,y=O,p=M,T=g,R=I,A=d;for(u=0;c>u;u+=3){var S=A+d;m=t.fromArray(o,u,m),_=t.fromArray(o,u+c,_),y=t.fromArray(o,(u+3)%c,y),_=t.subtract(_,m,_),y=t.subtract(y,m,y),p=t.normalize(t.cross(_,y,p),p),n.normal&&(a.addAttribute(f,p,S),a.addAttribute(f,p,S+3),a.addAttribute(f,p,A),a.addAttribute(f,p,A+3)),(n.tangent||n.binormal)&&(R=t.fromArray(r,u,R),n.binormal&&(a.addAttribute(h,R,S),a.addAttribute(h,R,S+3),a.addAttribute(h,R,A),a.addAttribute(h,R,A+3)),n.tangent&&(T=t.normalize(t.cross(R,p,T),T),a.addAttribute(E,T,S),a.addAttribute(E,T,S+3),a.addAttribute(E,T,A),a.addAttribute(E,T,A+3))),A+=6}if(n.normal){for(f.set(r),u=0;c>u;u+=3)f[u+c]=-r[u],f[u+c+1]=-r[u+1],f[u+c+2]=-r[u+2];e.normal.values=f}else e.normal=void 0;if(n.binormal?(h.set(i),h.set(i,c),e.binormal.values=h):e.binormal=void 0,n.tangent){var w=e.tangent.values;E.set(w),E.set(w,c),e.tangent.values=E}}if(n.st){var C=e.st.values,P=new Float32Array(6*l);P.set(C),P.set(C,l);for(var x=2*l,D=0;2>D;D++){for(P[x++]=C[0],P[x++]=C[1],u=2;l>u;u+=2){var U=C[u],L=C[u+1];P[x++]=U,P[x++]=L,P[x++]=U,P[x++]=L}P[x++]=C[0],P[x++]=C[1]}e.st.values=P}return e}function R(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 A(e,t){var n=new _({position:t.positon,normal:t.normal||t.binormal,tangent:t.tangent,binormal:t.normal||t.binormal,st:t.st}),r=e.ellipsoid,i=a.computePositions(e),o=p(i,n,r),u=e.height,s=e.extrudedHeight,c=o.attributes,l=o.indices,d=c.position.values,h=d.length,E=new Float64Array(6*h),m=new Float64Array(h);m.set(d);var y=new Float64Array(4*h);d=a.scaleToGeodeticHeight(d,u,r,d),y=R(d,0,y),m=a.scaleToGeodeticHeight(m,s,r,m),y=R(m,2*h,y),E.set(d),E.set(m,h),E.set(y,2*h),c.position.values=E,h/=3;var A,S=l.length,v=h+h,N=f.createTypedArray(E.length/3,2*S+3*v);N.set(l);var O=S;for(A=0;S>A;A+=3){var M=l[A],g=l[A+1],I=l[A+2];N[O++]=I+h,N[O++]=g+h,N[O++]=M+h}c=T(c,t);var w,C,P,x;for(A=0;v>A;A+=2)w=A+v,C=w+v,P=w+1,x=C+1,N[O++]=w,N[O++]=C,N[O++]=P,N[O++]=P,N[O++]=C,N[O++]=x;return{attributes:c,indices:N}}function S(e){e=i(e,i.EMPTY_OBJECT);var n=e.positions,a=e.width;this._positions=n,this._ellipsoid=s.clone(i(e.ellipsoid,s.WGS84)),this._vertexFormat=_.clone(i(e.vertexFormat,_.DEFAULT)),this._width=a,this._height=i(e.height,0),this._extrudedHeight=i(e.extrudedHeight,this._height),this._cornerType=i(e.cornerType,r.ROUNDED),this._granularity=i(e.granularity,h.RADIANS_PER_DEGREE),this._workerName="createCorridorGeometry",this.packedLength=1+n.length*t.packedLength+s.packedLength+_.packedLength+5}var v=new t,N=new t,O=new t,M=new t,g=new t,I=new t,w=new t,C=new t;S.pack=function(e,n,r){r=i(r,0);var a=e._positions,o=a.length;n[r++]=o;for(var u=0;o>u;++u,r+=t.packedLength)t.pack(a[u],n,r);s.pack(e._ellipsoid,n,r),r+=s.packedLength,_.pack(e._vertexFormat,n,r),r+=_.packedLength,n[r++]=e._width,n[r++]=e._height,n[r++]=e._extrudedHeight,n[r++]=e._cornerType,n[r]=e._granularity};var P=s.clone(s.UNIT_SPHERE),x=new _,D={positions:void 0,ellipsoid:P,vertexFormat:x,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return S.unpack=function(e,n,r){n=i(n,0);for(var a=e[n++],u=new Array(a),c=0;a>c;++c,n+=t.packedLength)u[c]=t.unpack(e,n);var l=s.unpack(e,n,P);n+=s.packedLength;var d=_.unpack(e,n,x);n+=_.packedLength;var f=e[n++],h=e[n++],E=e[n++],m=e[n++],y=e[n];return o(r)?(r._positions=u,r._ellipsoid=s.clone(l,r._ellipsoid),r._vertexFormat=_.clone(d,r._vertexFormat),r._width=f,r._height=h,r._extrudedHeight=E,r._cornerType=m,r._granularity=y,r):(D.positions=u,D.width=f,D.height=h,D.extrudedHeight=E,D.cornerType=m,D.granularity=y,new S(D))},S.createGeometry=function(t){var n=t._positions,r=t._height,i=t._extrudedHeight,o=r!==i,u=E.removeDuplicates(n);if(!(u.length<2)){var s,l=t._ellipsoid,d=t._vertexFormat,f={ellipsoid:l,positions:u,width:t._width,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!0};if(o){var h=Math.max(r,i);i=Math.min(r,i),r=h,f.height=r,f.extrudedHeight=i,s=A(f,d)}else{var _=a.computePositions(f);s=p(_,d,l),s.attributes.position.values=a.scaleToGeodeticHeight(s.attributes.position.values,r,l,s.attributes.position.values)}var y=s.attributes,T=e.fromVertices(y.position.values,void 0,3);return d.position||(s.attributes.position.values=void 0),new c({attributes:y,indices:s.indices,primitiveType:m.TRIANGLES,boundingSphere:T})}},S.createShadowVolume=function(e,t,n){var r=e._granularity,a=e._ellipsoid,i=t(r,a),o=n(r,a);return new S({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:a,granularity:r,extrudedHeight:i,height:o,vertexFormat:_.POSITION_ONLY})},S}),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/Workers/createCorridorOutlineGeometry.js b/Workers/createCorridorOutlineGeometry.js index dadaa04..d3ca5ab 100644 --- a/Workers/createCorridorOutlineGeometry.js +++ b/Workers/createCorridorOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,8 +222,8 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(n){t=n.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:0>e?-1:0},n.signNotZero=function(e){return 0>e?-1:1},n.toSNorm=function(e){return Math.round(255*(.5*n.clamp(e,-1,1)+.5))},n.fromSNorm=function(e){return 2*(n.clamp(e,0,255)/255)-1},n.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},n.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},n.lerp=function(e,t,n){return(1-n)*e+n*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=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){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,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},n.negativePiToPi=function(e){for(var t=n.EPSILON10,r=n.PI,a=n.TWO_PI;-(r+t)>e;)e+=a;if(-r>e)return-r;for(;e>r+t;)e-=a;return e>r?r:e},n.zeroToTwoPi=function(e){var t=e%n.TWO_PI;return 0>t?(t+n.TWO_PI)%n.TWO_PI:t},n.equalsEpsilon=function(e,n,r){return r=t(r,0),Math.abs(e-n)<=r};var r=[1];n.factorial=function(e){var t=r.length;if(e>=t)for(var n=r[t-1],a=t;e>=a;a++)r.push(n*a);return r[e]},n.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(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,n){return t>e?t:e>n?n: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}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i=function(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)};i.fromSpherical=function(n,r){t(r)||(r=new i);var a=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(o),r},i.fromElements=function(e,n,r,a){return t(a)?(a.x=e,a.y=n,a.z=r,a):new i(e,n,r)},i.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(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},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},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 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){i.normalize(e,s),i.normalize(t,c);var n=i.dot(s,c),r=i.magnitude(i.cross(s,c,s));return Math.atan2(r,n)};var l=new i;i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):n.y<=n.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,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},i.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r&&Math.abs(e.z-n.z)<=r},i.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},i.fromDegrees=function(e,t,n,r,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,n,r,o)};var f=new i,d=new i,h=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(n,r,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:h,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=i.normalize(f,f),i.multiplyComponents(s,f,d);var l=Math.sqrt(i.dot(f,d));return d=i.divideByScalar(d,l,d),f=i.multiplyByScalar(f,a,f),t(u)||(u=new i),i.add(d,f,u)},i.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=a.toRadians(e[o]);return i.fromRadiansArray(r,t,n)},i.fromRadiansArray=function(e,n,r){var a=e.length;t(r)?r.length=a/2:r=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=i.fromRadians(u,s,0,n,r[o/2])}return r},i.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=a.toRadians(e[o]),r[o+1]=a.toRadians(e[o+1]),r[o+2]=e[o+2];return i.fromRadiansArrayHeights(r,t,n)},i.fromRadiansArrayHeights=function(e,n,r){var a=e.length;t(r)?r.length=a/3:r=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=i.fromRadians(u,s,c,n,r[o/3])}return r},i.ZERO=r(new i(0,0,0)),i.UNIT_X=r(new i(1,0,0)),i.UNIT_Y=r(new i(0,1,0)),i.UNIT_Z=r(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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i=function(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)};return i.fromRadians=function(n,r,a,o){return a=e(a,0),t(o)?(o.longitude=n,o.latitude=r,o.height=a,o):new i(n,r,a)},i.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),i.fromRadians(e,t,n,r)},i.clone=function(e,n){return t(e)?t(n)?(n.longitude=e.longitude,n.latitude=e.latitude,n.height=e.height,n):new i(e.longitude,e.latitude,e.height):void 0},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.longitude===n.longitude&&e.latitude===n.latitude&&e.height===n.height},i.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.longitude-n.longitude)<=r&&Math.abs(e.latitude-n.latitude)<=r&&Math.abs(e.height-n.height)<=r},i.ZERO=r(new i(0,0,0)),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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},i}),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"],function(e,t,n,r,a,i,o,u){"use strict";function s(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}var c=function(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,s(this,e,t,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(t,n){if(!r(t))return void 0;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 c(a.x,a.y,a.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.prototype.geocentricSurfaceNormal=e.normalize,c.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)},c.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,f=new e;c.prototype.cartographicToCartesian=function(t,n){var a=l,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)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;n>a;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,h=new e,m=new e;c.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,h);if(!r(i))return void 0;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)},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;n>a;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t};var y=new e,p=new e;return c.prototype.scaleToGeodeticSurface=function(t,n){var a=t.x,i=t.y,o=t.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,d=a*a*c*c,h=i*i*l*l,m=o*o*f*f,v=d+h+m,g=Math.sqrt(1/v),w=e.multiplyByScalar(t,g,y);if(v<this._centerToleranceSquared)return isFinite(g)?e.clone(w,n):void 0;var E=this._oneOverRadiiSquared,x=E.x,S=E.y,M=E.z,O=p;O.x=2*w.x*x,O.y=2*w.y*S,O.z=2*w.z*M;var _,T,P,R,z,N,C,I,A,b,D,U=(1-g)*e.magnitude(t)/(.5*e.magnitude(O)),q=0;do{U-=q,P=1/(1+U*x),R=1/(1+U*S),z=1/(1+U*M),N=P*P,C=R*R,I=z*z,A=N*P,b=C*R,D=I*z,_=d*N+h*C+m*I-1,T=d*A*x+h*b*S+m*D*M;var L=-2*T;q=_/L}while(Math.abs(_)>u.EPSILON12);return r(n)?(n.x=a*P,n.y=i*R,n.z=o*z,n):new e(a*P,i*R,o*z)},c.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)},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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";var u=function(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";var t=function(t,n){this.start=e(t,0),this.stop=e(n,0)};return t}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";var a=function(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,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){return t(e)?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):void 0},a.packedLength=4,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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 i=new a;a.distance=function(e,t){return a.subtract(e,t,i),a.magnitude(i)},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.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 o=new a;a.lerp=function(e,t,n,r){return a.multiplyByScalar(t,n,o),r=a.multiplyByScalar(e,1-n,r),a.add(o,r,r)};var u=new a;return a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,u);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.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r&&Math.abs(e.z-n.z)<=r&&Math.abs(e.w-n.w)<=r},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){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function u(e){for(var t=0,n=0;3>n;++n){var r=e[c.getElementIndex(h[n],d[n])];t+=2*r*r}return Math.sqrt(t)}function s(e,t){for(var n=i.EPSILON15,r=0,a=1,o=0;3>o;++o){var u=Math.abs(e[c.getElementIndex(h[o],d[o])]);u>r&&(a=o,r=u)}var s=1,l=0,f=d[a],m=h[a];if(Math.abs(e[c.getElementIndex(m,f)])>n){var y,p=e[c.getElementIndex(m,m)],v=e[c.getElementIndex(f,f)],g=e[c.getElementIndex(m,f)],w=(p-v)/2/g;y=0>w?-1/(-w+Math.sqrt(1+w*w)):1/(w+Math.sqrt(1+w*w)),s=1/Math.sqrt(1+y*y),l=y*s}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(f,f)]=t[c.getElementIndex(m,m)]=s,t[c.getElementIndex(m,f)]=l,t[c.getElementIndex(f,m)]=-l,t}var c=function(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)};c.clone=function(e,t){return n(e)?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 c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new c),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},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var 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,s=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,m=r-u-f+h,y=2*(a-d),p=2*(i+l),v=2*(a+d),g=-r+u-f+h,w=2*(s-o),E=2*(i-l),x=2*(s+o),S=-r-u+f+h;return n(t)?(t[0]=m,t[1]=v,t[2]=E,t[3]=y,t[4]=g,t[5]=x,t[6]=p,t[7]=w,t[8]=S,t):new c(m,y,p,v,g,w,E,x,S)},c.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 c(e.x,0,0,0,e.y,0,0,0,e.z)},c.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 c(e,0,0,0,e,0,0,0,e)},c.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 c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.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 c(1,0,0,0,r,-a,0,a,r)},c.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 c(r,0,a,0,1,0,-a,0,r)},c.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 c(r,-a,0,a,r,0,0,0,1)},c.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]]},c.getElementIndex=function(e,t){return 3*e+t},c.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},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},c.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},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,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[3],t[4],t[5],l)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),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]*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},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},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},c.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},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},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},c.transpose=function(e,t){var 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],h=[2,2,1],m=new c,y=new c;return c.computeEigenDecomposition=function(e,t){var r=i.EPSILON20,a=10,l=0,f=0;n(t)||(t={});for(var d=t.unitary=c.clone(c.IDENTITY,t.unitary),h=t.diagonal=c.clone(e,t.diagonal),p=r*o(h);a>f&&u(h)>p;)s(h,m),c.transpose(m,y),c.multiply(h,m,h),c.multiply(y,h,h),c.multiply(d,m,d),++l>2&&(++f,l=0);return t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},c.determinant=function(e){var t=e[0],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)},c.inverse=function(e,t){var n=e[0],a=e[1],o=e[2],u=e[3],s=e[4],l=e[5],f=e[6],d=e[7],h=e[8],m=c.determinant(e);if(Math.abs(m)<=i.EPSILON15)throw new r("matrix is not invertible");t[0]=s*h-d*l,t[1]=d*o-a*h,t[2]=a*l-s*o,t[3]=f*l-u*h,t[4]=n*h-f*o,t[5]=u*o-n*l,t[6]=u*d-f*s,t[7]=f*a-n*d,t[8]=n*s-u*a;var y=1/m;return c.multiplyByScalar(t,y,t)},c.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]},c.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},c.IDENTITY=a(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(n){t=n.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s){"use strict";var c=function(e,t,r,a,i,o,u,s,c,l,f,d,h,m,y,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(m,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(y,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(d,0),this[15]=n(p,0)};c.packedLength=16,c.pack=function(e,t,r){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]},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),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},c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[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]):void 0},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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new c);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,l=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,m=t.y*t.z,y=t.y*t.w,p=t.z*t.z,v=t.z*t.w,g=t.w*t.w,w=s-h-p+g,E=2*(l-v),x=2*(f+y),S=2*(l+v),M=-s+h-p+g,O=2*(m-d),_=2*(f-y),T=2*(m+d),P=-s-h+p+g;return a[0]=w*i,a[1]=S*i,a[2]=_*i,a[3]=0,a[4]=E*o,a[5]=M*o,a[6]=T*o,a[7]=0,a[8]=x*u,a[9]=O*u,a[10]=P*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.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 l=new e,f=new e,d=new e;c.fromCamera=function(t,n){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,d),d);var u=f.x,s=f.y,h=f.z,m=l.x,y=l.y,p=l.z,v=d.x,g=d.y,w=d.z,E=a.x,x=a.y,S=a.z,M=u*-E+s*-x+h*-S,O=v*-E+g*-x+w*-S,_=m*E+y*x+p*S;return r(n)?(n[0]=u,n[1]=v,n[2]=-m,n[3]=0,n[4]=s,n[5]=g,n[6]=-y,n[7]=0,n[8]=h,n[9]=w,n[10]=-p,n[11]=0,n[12]=M,n[13]=O,n[14]=_,n[15]=1,n):new c(u,s,h,M,v,g,w,O,-m,-y,-p,_,0,0,0,1)},c.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},c.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},c.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},c.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},c.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,m=f,y=i+c,p=o+l,v=t+f,g=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]=m,a[11]=0,a[12]=y,a[13]=p,a[14]=v,a[15]=g,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,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},c.setColumn=function(e,t,n,r){r=c.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},c.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},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 h=new e;c.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[4],t[5],t[6],h)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],h)),n};var m=new e;c.getMaximumScale=function(t){return c.getScale(t,m),e.maximumComponent(m)},c.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],m=e[11],y=e[12],p=e[13],v=e[14],g=e[15],w=t[0],E=t[1],x=t[2],S=t[3],M=t[4],O=t[5],_=t[6],T=t[7],P=t[8],R=t[9],z=t[10],N=t[11],C=t[12],I=t[13],A=t[14],b=t[15],D=r*w+u*E+f*x+y*S,U=a*w+s*E+d*x+p*S,q=i*w+c*E+h*x+v*S,L=o*w+l*E+m*x+g*S,B=r*M+u*O+f*_+y*T,W=a*M+s*O+d*_+p*T,F=i*M+c*O+h*_+v*T,G=o*M+l*O+m*_+g*T,V=r*P+u*R+f*z+y*N,j=a*P+s*R+d*z+p*N,Y=i*P+c*R+h*z+v*N,k=o*P+l*R+m*z+g*N,H=r*C+u*I+f*A+y*b,X=a*C+s*I+d*A+p*b,Z=i*C+c*I+h*A+v*b,J=o*C+l*I+m*A+g*b;return n[0]=D,n[1]=U,n[2]=q,n[3]=L,n[4]=B,n[5]=W,n[6]=F,n[7]=G,n[8]=V,n[9]=j,n[10]=Y,n[11]=k,n[12]=H,n[13]=X,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],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],m=e[14],y=t[0],p=t[1],v=t[2],g=t[4],w=t[5],E=t[6],x=t[8],S=t[9],M=t[10],O=t[12],_=t[13],T=t[14],P=r*y+o*p+c*v,R=a*y+u*p+l*v,z=i*y+s*p+f*v,N=r*g+o*w+c*E,C=a*g+u*w+l*E,I=i*g+s*w+f*E,A=r*x+o*S+c*M,b=a*x+u*S+l*M,D=i*x+s*S+f*M,U=r*O+o*_+c*T+d,q=a*O+u*_+l*T+h,L=i*O+s*_+f*T+m;return n[0]=P,n[1]=R,n[2]=z,n[3]=0,n[4]=N,n[5]=C,n[6]=I,n[7]=0,n[8]=A,n[9]=b,n[10]=D,n[11]=0,n[12]=U,n[13]=q,n[14]=L,n[15]=1,n},c.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;c.multiplyByUniformScale=function(e,t,n){return y.x=t,y.y=t,y.z=t,c.multiplyByScale(e,y,n)},c.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?c.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)},c.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},c.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},c.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},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],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},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[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]},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 p=new u,v=new u,g=new t,w=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,p),v,o.EPSILON7)&&t.equals(c.getRow(e,3,g),w))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],l=e[12],f=e[1],d=e[5],h=e[9],m=e[13],y=e[2],E=e[6],x=e[10],S=e[14],M=e[3],O=e[7],_=e[11],T=e[15],P=x*T,R=S*_,z=E*T,N=S*O,C=E*_,I=x*O,A=y*T,b=S*M,D=y*_,U=x*M,q=y*O,L=E*M,B=P*d+N*h+C*m-(R*d+z*h+I*m),W=R*f+A*h+U*m-(P*f+b*h+D*m),F=z*f+b*d+q*m-(N*f+A*d+L*m),G=I*f+D*d+L*h-(C*f+U*d+q*h),V=R*a+z*i+I*l-(P*a+N*i+C*l),j=P*r+b*i+D*l-(R*r+A*i+U*l),Y=N*r+A*a+L*l-(z*r+b*a+q*l),k=C*r+U*a+q*i-(I*r+D*a+L*i);P=i*m,R=l*h,z=a*m,N=l*d,C=a*h,I=i*d,A=r*m,b=l*f,D=r*h,U=i*f,q=r*d,L=a*f;var H=P*O+N*_+C*T-(R*O+z*_+I*T),X=R*M+A*_+U*T-(P*M+b*_+D*T),Z=z*M+b*O+q*T-(N*M+A*O+L*T),J=I*M+D*O+L*_-(C*M+U*O+q*_),Q=z*x+I*S+R*E-(C*S+P*E+N*x),K=D*S+P*y+b*x-(A*x+U*S+R*y),$=A*E+L*S+N*y-(q*S+z*y+b*E),et=q*x+C*y+U*E-(D*E+L*x+I*y),tt=r*B+a*W+i*F+l*G;if(Math.abs(tt)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return tt=1/tt,n[0]=B*tt,n[1]=W*tt,n[2]=F*tt,n[3]=G*tt,n[4]=V*tt,n[5]=j*tt,n[6]=Y*tt,n[7]=k*tt,n[8]=H*tt,n[9]=X*tt,n[10]=Z*tt,n[11]=J*tt,n[12]=Q*tt,n[13]=K*tt,n[14]=$*tt,n[15]=et*tt,n},c.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],m=-n*f-r*d-a*h,y=-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]=m,t[13]=y,t[14]=p,t[15]=1,t},c.IDENTITY=i(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o){"use strict";var u=function(e,n,r,a){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(a,0)};u.fromDegrees=function(e,r,a,i,s){return e=o.toRadians(t(e,0)),r=o.toRadians(t(r,0)),a=o.toRadians(t(a,0)),i=o.toRadians(t(i,0)),n(s)?(s.west=e,s.south=r,s.east=a,s.north=i,s):new u(e,r,a,i)},u.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=e.length;c>s;s++){var l=e[s];r=Math.min(r,l.longitude),a=Math.max(a,l.longitude),i=Math.min(i,l.latitude),o=Math.max(o,l.latitude)}return n(t)?(t.west=r,t.south=i,t.east=a,t.north=o,t):new u(r,i,a,o)},u.packedLength=4,u.pack=function(e,n,r){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},u.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new u),a.west=e[r++],a.south=e[r++],a.east=e[r++],a.north=e[r],a},u.clone=function(e,t){return n(e)?n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.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},u.validate=function(){},u.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)},u.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)},u.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)},u.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)},u.center=function(t,r){var a=t.east,i=t.west,u=.5*(i+a);return i>a&&(u=o.negativePiToPi(u+o.PI)),n(r)?(r.longitude=u,r.latitude=.5*(t.south+t.north),r.height=0,r):new e(u,.5*(t.south+t.north))},u.intersectWith=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),s=Math.min(e.north,t.north);return n(r)?(r.west=a,r.south=i,r.east=o,r.north=s,r):new u(a,i,o,s)},u.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},u.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var s=new e;return u.subsample=function(e,r,i,u){r=t(r,a.WGS84),i=t(i,0),n(u)||(u=[]);var c=0,l=e.north,f=e.south,d=e.east,h=e.west,m=s;m.height=i,m.longitude=h,m.latitude=l,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:f>0?f:0;for(var y=1;8>y;++y){var p=-Math.PI+y*o.PI_OVER_TWO;p>h&&d>p&&(m.longitude=p,u[c]=r.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=i(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";var f=function(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)},d=new e,h=new e,m=new e,y=new e,p=new e,v=new e,g=new e,w=new e,E=new e,x=new e,S=new e,M=new e;f.fromPoints=function(t,n){if(r(n)||(n=new f),!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],g),i=e.clone(a,d),o=e.clone(a,h),u=e.clone(a,m),s=e.clone(a,y),c=e.clone(a,p),l=e.clone(a,v),O=t.length,_=1;O>_;_++){e.clone(t[_],a);var T=a.x,P=a.y,R=a.z;T<i.x&&e.clone(a,i),T>s.x&&e.clone(a,s),P<o.y&&e.clone(a,o),P>c.y&&e.clone(a,c),R<u.z&&e.clone(a,u),R>l.z&&e.clone(a,l)}var z=e.magnitudeSquared(e.subtract(s,i,w)),N=e.magnitudeSquared(e.subtract(c,o,w)),C=e.magnitudeSquared(e.subtract(l,u,w)),I=i,A=s,b=z;N>b&&(b=N,I=o,A=c),C>b&&(b=C,I=u,A=l);var D=E;D.x=.5*(I.x+A.x),D.y=.5*(I.y+A.y),D.z=.5*(I.z+A.z);var U=e.magnitudeSquared(e.subtract(A,D,w)),q=Math.sqrt(U),L=x;L.x=i.x,L.y=o.y,L.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var W=e.multiplyByScalar(e.add(L,B,w),.5,M),F=0;for(_=0;O>_;_++){e.clone(t[_],a);var G=e.magnitude(e.subtract(a,W,w));G>F&&(F=G);var V=e.magnitudeSquared(e.subtract(a,D,w));if(V>U){var j=Math.sqrt(V);q=.5*(q+j),U=q*q;var Y=j-q;D.x=(q*D.x+Y*a.x)/j,D.y=(q*D.y+Y*a.y)/j,D.z=(q*D.z+Y*a.z)/j}}return F>q?(e.clone(D,n.center),n.radius=q):(e.clone(W,n.center),n.radius=F),n};var O=new o,_=new e,T=new e,P=new t,R=new t;f.fromRectangle2D=function(e,t,n){return f.fromRectangleWithHeights2D(e,t,0,0,n)},f.fromRectangleWithHeights2D=function(t,a,i,o,u){if(r(u)||(u=new f),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=n(a,O),l.southwest(t,P),P.height=i,l.northeast(t,R),R.height=o;var s=a.project(P,_),c=a.project(R,T),d=c.x-s.x,h=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(d*d+h*h+m*m);var y=u.center;return y.x=s.x+.5*d,y.y=s.y+.5*h,y.z=s.z+.5*m,u};var z=[];f.fromRectangle3D=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0);var u;return r(e)&&(u=l.subsample(e,t,a,z)),f.fromPoints(u,o)},f.fromVertices=function(t,a,i,o){if(r(o)||(o=new f),!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=g;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,h),l=e.clone(u,m),O=e.clone(u,y),_=e.clone(u,p),T=e.clone(u,v),P=t.length,R=0;P>R;R+=i){var z=t[R]+a.x,N=t[R+1]+a.y,C=t[R+2]+a.z;u.x=z,u.y=N,u.z=C,z<s.x&&e.clone(u,s),z>O.x&&e.clone(u,O),N<c.y&&e.clone(u,c),N>_.y&&e.clone(u,_),C<l.z&&e.clone(u,l),C>T.z&&e.clone(u,T)}var I=e.magnitudeSquared(e.subtract(O,s,w)),A=e.magnitudeSquared(e.subtract(_,c,w)),b=e.magnitudeSquared(e.subtract(T,l,w)),D=s,U=O,q=I;A>q&&(q=A,D=c,U=_),b>q&&(q=b,D=l,U=T);var L=E;L.x=.5*(D.x+U.x),L.y=.5*(D.y+U.y),L.z=.5*(D.z+U.z);var B=e.magnitudeSquared(e.subtract(U,L,w)),W=Math.sqrt(B),F=x;F.x=s.x,F.y=c.y,F.z=l.z;var G=S;G.x=O.x,G.y=_.y,G.z=T.z;var V=e.multiplyByScalar(e.add(F,G,w),.5,M),j=0;for(R=0;P>R;R+=i){u.x=t[R]+a.x,u.y=t[R+1]+a.y,u.z=t[R+2]+a.z;var Y=e.magnitude(e.subtract(u,V,w));Y>j&&(j=Y);var k=e.magnitudeSquared(e.subtract(u,L,w));if(k>B){var H=Math.sqrt(k);W=.5*(W+H),B=W*W;var X=H-W;L.x=(W*L.x+X*u.x)/H,L.y=(W*L.y+X*u.y)/H,L.z=(W*L.z+X*u.z)/H}}return j>W?(e.clone(L,o.center),o.radius=W):(e.clone(V,o.center),o.radius=j),o},f.fromCornerPoints=function(t,n,a){r(a)||(a=new f);var i=a.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,n),a},f.fromEllipsoid=function(t,n){return r(n)||(n=new f),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n},f.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new f(t.center,t.radius):void 0},f.packedLength=4,f.pack=function(e,t,r){r=n(r,0);var a=e.center;t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius},f.unpack=function(e,t,a){t=n(t,0),r(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 N=new e,C=new e;f.union=function(t,n,a){r(a)||(a=new f);var i=t.center,o=n.center;e.add(i,o,C);var u=e.multiplyByScalar(C,.5,C),s=e.magnitude(e.subtract(i,u,N))+t.radius,c=e.magnitude(e.subtract(o,u,N))+n.radius;return a.radius=Math.max(s,c),e.clone(u,a.center),a};var I=new e;f.expand=function(t,n,r){r=f.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,I));return a>r.radius&&(r.radius=a),r},f.intersect=function(t,n){var r=t.center,a=t.radius,i=e.dot(n,r)+n.w;return-a>i?u.OUTSIDE:a>i?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var A=new e;f.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,A);return e.magnitudeSquared(r)-t.radius*t.radius},f.transformWithoutScale=function(e,t,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;f.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.multiplyByScalar(a,e.dot(a,o),b),c=e.magnitude(u);return i.start=c-t.radius,i.stop=c+t.radius,i};for(var D=new e,U=new e,q=new e,L=new e,B=new e,W=new t,F=new Array(8),G=0;8>G;++G)F[G]=new e;var V=new o;return f.projectTo2D=function(t,r,a){r=n(r,V);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,D),c=e.cross(e.UNIT_Z,s,U);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 d=e.negate(l,B),h=e.negate(c,L),m=F,y=m[0];e.add(s,l,y),e.add(y,c,y),y=m[1],e.add(s,l,y),e.add(y,h,y),y=m[2],e.add(s,d,y),e.add(y,h,y),y=m[3],e.add(s,d,y),e.add(y,c,y),e.negate(s,s),y=m[4],e.add(s,l,y),e.add(y,c,y),y=m[5],e.add(s,l,y),e.add(y,h,y),y=m[6],e.add(s,d,y),e.add(y,h,y),y=m[7],e.add(s,d,y),e.add(y,c,y);for(var p=m.length,v=0;p>v;++v){var g=m[v];e.add(o,g,g);var w=i.cartesianToCartographic(g,W);r.project(w,g)}a=f.fromPoints(m,a),o=a.center;var E=o.x,x=o.y,S=o.z;return o.x=S,o.y=E,o.z=x,a},f.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},f.prototype.intersect=function(e){return f.intersect(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var 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(){return a.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?r.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(r.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e){a.supportsFullscreen()&&e[r.requestFullscreen]()},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;r>n;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(m)){m=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(m=!0,y=r(e[1]))}return m}function i(){return a()&&y}function o(){if(!t(p)&&(p=!1,!a()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(p=!0,v=r(e[1]))}return p}function u(){return o()&&v}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(g=!0,w=r(e[1]),w.isNightly=!!e[2])}return g}function c(){return s()&&w}function l(){if(!t(E)){E=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(E=!0,x=r(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(E=!0,x=r(e[1])))}return E}function f(){return l()&&x}function d(){if(!t(S)){S=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function h(){return d()&&M}var m,y,p,v,g,w,E,x,S,M,O={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:d,firefoxVersion:h,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};return O.supportsFullscreen=function(){return n.supportsFullscreen()},O.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},O.supportsWebWorkers=function(){return"undefined"!=typeof Worker},O}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,a){"use strict";if(!r.supportsTypedArrays())return{};var i={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},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 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.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.FLOAT:return new Float32Array(t);case i.DOUBLE:return new Float64Array(t);default:throw new n("componentDatatype is not a valid value.")}},i.createArrayBufferView=function(t,r,a,o){switch(a=e(a,0),o=e(o,(r.byteLength-a)/i.getSizeInBytes(t)),t){case i.BYTE:return new Int8Array(r,a,o);case i.UNSIGNED_BYTE:return new Uint8Array(r,a,o);case i.SHORT:return new Int16Array(r,a,o);case i.UNSIGNED_SHORT:return new Uint16Array(r,a,o);case i.FLOAT:return new Float32Array(r,a,o);case i.DOUBLE:return new Float64Array(r,a,o);default:throw new n("componentDatatype is not a valid value.")}},a(i)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(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/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,m=Math.sqrt(h),y=t/4,p=y*y,v=p*y,g=p*p,w=1+y-3*p/4+5*v/4-175*g/64,E=1-y+15*p/8-35*v/8,x=1-3*y+35*p/4,S=1-5*y,M=w*l-E*Math.sin(2*l)*y/2-x*Math.sin(4*l)*p/16-S*Math.sin(6*l)*v/48-5*Math.sin(8*l)*g/512,O=e._constants;O.a=n,O.b=r,O.f=a,O.cosineHeading=i,O.sineHeading=o,O.tanU=u,O.cosineU=s,O.sineU=c,O.sigma=l,O.sineAlpha=f,O.sineSquaredAlpha=d,O.cosineSquaredAlpha=h,O.cosineAlpha=m,O.u2Over4=y,O.u4Over16=p,O.u6Over64=v,O.u8Over256=g,O.a0=w,O.a1=E,O.a2=x,O.a3=S,O.distanceRatio=M}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,m=(t-n)/t,y=i-r,p=Math.atan((1-m)*Math.tan(a)),v=Math.atan((1-m)*Math.tan(o)),g=Math.cos(p),w=Math.sin(p),E=Math.cos(v),x=Math.sin(v),S=g*E,M=g*x,O=w*x,_=w*E,T=y,P=u.TWO_PI,R=Math.cos(T),z=Math.sin(T);do{R=Math.cos(T),z=Math.sin(T);var N=M-_*R;f=Math.sqrt(E*E*z*z+N*N),c=O+S*R,s=Math.atan2(f,c);var C;0===f?(C=0,d=1):(C=S*z/f,d=1-C*C),P=T,h=c-2*O/d,isNaN(h)&&(h=0),T=y+l(m,C,d,s,f,c,h)}while(Math.abs(T-P)>u.EPSILON12);var I=d*(t*t-n*n)/(n*n),A=1+I*(4096+I*(I*(320-175*I)-768))/16384,b=I*(256+I*(I*(74-47*I)-128))/1024,D=h*h,U=b*f*(h+b*(c*(2*D-1)-b*h*(4*f*f-3)*(4*D-3)/6)/4),q=n*A*(s-U),L=Math.atan2(E*z,M-_*R),B=Math.atan2(g*z,M*R-_);e._distance=q,e._startHeading=L,e._endHeading=B,e._uSquared=I}function d(n,r,a,i){e.normalize(i.cartographicToCartesian(r,m),h),e.normalize(i.cartographicToCartesian(a,m),m),f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),r.height=0,a.height=0,n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),s(n)}var h=new e,m=new e,y=function(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)};return a(y.prototype,{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}}}),y.prototype.setEndPoints=function(e,t){d(this,e,t,this._ellipsoid)},y.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},y.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),m=i*i,y=i*m,p=a.u8Over256,v=a.u2Over4,g=a.u6Over64,w=a.u4Over16,E=2*y*p*o/3+i*(1-v+7*w/4-15*g/4+579*p/64-(w-15*g/4+187*p/16)*o-(5*g/4-115*p/16)*u-29*p*s/16)+(v/2-w+71*g/32-85*p/16)*c+(5*w/16-5*g/4+383*p/96)*f-m*((g-11*p/2)*c+5*p*f/2)+(29*g/96-29*p/16)*d+539*p*h/1536,x=Math.asin(Math.sin(E)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(x));E-=a.sigma;var M=Math.cos(2*a.sigma+E),O=Math.sin(E),_=Math.cos(E),T=a.cosineU*_,P=a.sineU*O,R=Math.atan2(O*a.sineHeading,T-P*a.cosineHeading),z=R-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,E,O,_,M);return r(n)?(n.longitude=this._start.longitude+z,n.latitude=S,n.height=0,n):new t(this._start.longitude+z,S,0)},y}),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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,0>i?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(0>f)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,m=o*s-d,y=o*c-u*s,p=u*c-h,v=4*m*p-y*y;if(0>v){var g,w,E;d*f>=l*h?(g=o,w=m,E=-2*u*m+o*y):(g=c,w=p,E=-c*y+2*s*p);var x=0>E?-1:1,S=-x*Math.abs(g)*Math.sqrt(-v);i=-E+S;var M=i/2,O=0>M?-Math.pow(-M,1/3):Math.pow(M,1/3),_=i===S?-O:-w/O;return a=0>=w?O+_:-E/(O*O+_*_+w),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var T=m,P=-2*u*m+o*y,R=p,z=-c*y+2*s*p,N=Math.sqrt(v),C=Math.sqrt(3)/2,I=Math.abs(Math.atan2(o*N,-P)/3);a=2*Math.sqrt(-T);var A=Math.cos(I);i=a*A;var b=a*(-A/2-C*Math.sin(I)),D=i+b>2*u?i-u:b-u,U=o,q=D/U;I=Math.abs(Math.atan2(c*N,-z)/3),a=2*Math.sqrt(-R),A=Math.cos(I),i=a*A,b=a*(-A/2-C*Math.sin(I));var L=-c,B=2*s>i+b?i+s:b+s,W=L/B,F=U*B,G=-D*B-U*L,V=D*L,j=(s*G-u*V)/(-u*G+s*F);return j>=q?W>=q?W>=j?[q,j,W]:[q,W,j]:[W,q,j]:W>=q?[j,q,W]:W>=j?[j,W,q]:[W,j,q]}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=0>u?-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,0>u?[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 m=r.computeRealRoots(1,s,l);if(2===m.length){var y,p=m[0],v=m[1];if(p>=0&&v>=0){var g=Math.sqrt(p),w=Math.sqrt(v);return[d-w,d-g,d+g,d+w]}if(p>=0&&0>v)return y=Math.sqrt(p),[d-y,d+y];if(0>p&&v>=0)return y=Math.sqrt(v),[d-y,d+y]}return[]}if(h>0){var E=Math.sqrt(h),x=(s+h-c/E)/2,S=(s+h+c/E)/2,M=r.computeRealRoots(1,E,x),O=r.computeRealRoots(1,-E,S);return 0!==M.length?(M[0]+=d,M[1]+=d,0!==O.length?(O[0]+=d,O[1]+=d,M[1]<=O[0]?[M[0],M[1],O[0],O[1]]:O[1]<=M[0]?[O[0],O[1],M[0],M[1]]:M[0]>=O[0]&&M[1]<=O[1]?[O[0],M[0],M[1],O[1]]:O[0]>=M[0]&&O[1]<=M[1]?[M[0],O[0],O[1],M[1]]:M[0]>O[0]&&M[0]<O[1]?[O[0],M[0],O[1],M[1]]:[M[0],O[0],M[1],O[1]]):M):0!==O.length?(O[0]+=d,O[1]+=d,O):[]}}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 m,y,p=h[0],v=a-p,g=v*v,w=t/2,E=v/2,x=g-4*o,S=g+4*Math.abs(o),M=c-4*p,O=c+4*Math.abs(p);if(0>p||M*S>x*O){var _=Math.sqrt(M);m=_/2,y=0===_?0:(t*E-i)/_}else{var T=Math.sqrt(x);m=0===T?0:(t*E-i)/T,y=T/2}var P,R;0===w&&0===m?(P=0,R=0):n.sign(w)===n.sign(m)?(P=w+m,R=p/P):(R=w-m,P=p/R);var z,N;0===E&&0===y?(z=0,N=0):n.sign(E)===n.sign(y)?(z=E+y,N=o/z):(N=E-y,z=o/N);var C=r.computeRealRoots(1,P,z),I=r.computeRealRoots(1,R,N);if(0!==C.length)return 0!==I.length?C[1]<=I[0]?[C[0],C[1],I[0],I[1]]:I[1]<=C[0]?[I[0],I[1],C[0],C[1]]:C[0]>=I[0]&&C[1]<=I[1]?[I[0],C[0],C[1],I[1]]:I[0]>=C[0]&&I[1]<=C[1]?[C[0],I[0],I[1],C[1]]:C[0]>I[0]&&C[0]<I[1]?[I[0],C[0],I[1],C[1]]:[C[0],I[0],C[1],I[1]]:C;if(0!==I.length)return I}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,m=h*a,y=u*c*f-4*s*d-4*e*l*f+18*e*t*n*d-27*i*f*f+256*o*m+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 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,d=s/t,h=0>c?1:0;switch(h+=0>l?h+1:h,h+=0>f?h+1:h,h+=0>d?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 void 0}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r=function(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 r.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},r}),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(t,r,a,o,u){u=n(u,!1);var s,c,l,f,d,h=t.origin,m=t.direction,y=e.subtract(a,r,p),x=e.subtract(o,r,v),S=e.cross(m,x,g),M=e.dot(y,S);if(u){if(M<i.EPSILON6)return void 0;if(s=e.subtract(h,r,w),l=e.dot(s,S),0>l||l>M)return void 0;if(c=e.cross(s,y,E),f=e.dot(m,c),0>f||l+f>M)return void 0;d=e.dot(x,c)/M}else{if(Math.abs(M)<i.EPSILON6)return void 0;var O=1/M;if(s=e.subtract(h,r,w),l=e.dot(s,S)*O,0>l||l>1)return void 0;if(c=e.cross(s,y,E),f=e.dot(m,c)*O,0>f||l+f>1)return void 0;d=e.dot(x,c)*O}return d}function f(e,t,n,r){var a=t*t-4*e*n;if(0>a)return void 0;if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);return 0===c?void 0:(r.root0=r.root1=c,r)}function d(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,g),l=e.dot(o,o),d=2*e.dot(o,c),h=e.magnitudeSquared(c)-s,m=f(l,d,h,S);return r(m)?(a.start=m.root0,a.stop=m.root1,a):void 0}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 m(t,n,r,a,c){var l,f=a*a,d=c*c,m=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*d,y=c*(a*h(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),p=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*d+a*n.x+r,v=d*h(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),g=c*(a*h(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),w=[];if(0===g&&0===v){if(l=u.computeRealRoots(m,y,p),0===l.length)return w;var E=l[0],x=Math.sqrt(Math.max(1-E*E,0));if(w.push(new e(a,c*E,c*-x)),w.push(new e(a,c*E,c*x)),2===l.length){var S=l[1],M=Math.sqrt(Math.max(1-S*S,0));w.push(new e(a,c*S,c*-M)),w.push(new e(a,c*S,c*M))}return w}var O=g*g,_=v*v,T=m*m,P=g*v,R=T+_,z=2*(y*m+P),N=2*p*m+y*y-_+O,C=2*(p*y-P),I=p*p-O;if(0===R&&0===z&&0===N&&0===C)return w;l=s.computeRealRoots(R,z,N,C,I);var A=l.length;if(0===A)return w;for(var b=0;A>b;++b){var D,U=l[b],q=U*U,L=Math.max(1-q,0),B=Math.sqrt(L);D=i.sign(m)===i.sign(p)?h(m*q+p,y*U,i.EPSILON12):i.sign(p)===i.sign(y*U)?h(m*q,y*U+p,i.EPSILON12):h(m*q+y*U,p,i.EPSILON12);var W=h(v*U,g,i.EPSILON15),F=D*W;0>F?w.push(new e(a,c*U,c*B)):F>0?w.push(new e(a,c*U,c*-B)):0!==B?(w.push(new e(a,c*U,c*-B)),w.push(new e(a,c*U,c*B)),++b):w.push(new e(a,c*U,c*B))}return w}var y={};y.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)return void 0;var l=(-n.distance-e.dot(s,o))/c;return 0>l?void 0:(a=e.multiplyByScalar(u,l,a),e.add(o,a,a))};var p=new e,v=new e,g=new e,w=new e,E=new e;y.rayTriangle=function(t,n,a,i,o,u){var s=l(t,n,a,i,o);return!r(s)||0>s?void 0:(r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u))};var x=new c;y.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=x;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var f=l(c,a,i,o,u);return!r(f)||0>f||f>e.distance(t,n)?void 0:(r(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var S={root0:0,root1:0};y.raySphere=function(e,t,n){return n=d(e,t,n),!r(n)||n.stop<0?void 0:(n.start=Math.max(n.start,0),n)};var M=new c;y.lineSegmentSphere=function(t,n,a,i){var o=M;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=d(o,a,i),!r(i)||i.stop<0||i.start>s?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i)};var O=new e,_=new e;y.rayEllipsoid=function(t,n){var r,a,i,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,O),l=e.multiplyComponents(s,t.direction,_),f=e.magnitudeSquared(c),d=e.dot(c,l);if(f>1){if(d>=0)return void 0;var h=d*d;if(r=f-1,a=e.magnitudeSquared(l),i=a*r,i>h)return void 0;if(h>i){o=d*d-i,u=-d+Math.sqrt(o);var m=u/a,y=r/u;return y>m?{start:m,stop:y}:{start:y,stop:m}}var p=Math.sqrt(r/a);return{start:p,stop:p}}return 1>f?(r=f-1,a=e.magnitudeSquared(l),i=a*r,o=d*d-i,u=-d+Math.sqrt(o),{start:0,stop:u/a}):0>d?(a=e.magnitudeSquared(l),{start:0,stop:-d/a}):void 0};var T=new e,P=new e,R=new e,z=new e,N=new e,C=new o,I=new o,A=new o,b=new o,D=new o,U=new o,q=new o,L=new e,B=new e,W=new t;y.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction,s=n.geodeticSurfaceNormal(a);if(e.dot(u,s)>=0)return a;var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u),f=e.normalize(l,T),d=e.mostOrthogonalAxis(l,z),h=e.normalize(e.cross(d,f,P),P),y=e.normalize(e.cross(f,h,R),R),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]=y.x,p[7]=y.y,p[8]=y.z;var v=o.transpose(p,I),g=o.fromScale(n.radii,A),w=o.fromScale(n.oneOverRadii,b),E=D;E[0]=0,E[1]=-u.z,E[2]=u.y,E[3]=u.z,E[4]=0,E[5]=-u.x,E[6]=-u.y,E[7]=u.x,E[8]=0;var x,S,M=o.multiply(o.multiply(v,w,U),E,U),O=o.multiply(o.multiply(M,g,q),p,q),_=o.multiplyByVector(M,a,N),F=m(O,e.negate(_,T),0,0,1),G=F.length;if(G>0){for(var V=e.clone(e.ZERO,B),j=Number.NEGATIVE_INFINITY,Y=0;G>Y;++Y){x=o.multiplyByVector(g,o.multiplyByVector(p,F[Y],L),L);var k=e.normalize(e.subtract(x,a,z),z),H=e.dot(k,u);H>j&&(j=H,V=e.clone(x,V))}var X=n.cartesianToCartographic(V,W);return j=i.clamp(j,0,1),S=e.magnitude(e.subtract(V,a,z))*Math.sqrt(1-j*j),S=c?-S:S,X.height=S,n.cartographicToCartesian(X)}return void 0};var F=new e;return y.lineSegmentPlane=function(t,n,a,o){r(o)||(o=new e);var u=e.subtract(n,t,F),s=a.normal,c=e.dot(s,u);if(Math.abs(c)<i.EPSILON6)return void 0;var l=e.dot(s,t),f=-(a.distance+l)/c;return 0>f||f>1?void 0:(e.multiplyByScalar(u,f,o),e.add(t,o,o),o)},y.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 y.lineSegmentPlane(t,n,a,f),y.lineSegmentPlane(t,r,a,d),{positions:[t,n,r,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return y.lineSegmentPlane(n,r,a,f),y.lineSegmentPlane(n,t,a,d),{positions:[t,n,r,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return y.lineSegmentPlane(r,t,a,f),y.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 y.lineSegmentPlane(n,t,a,f),y.lineSegmentPlane(r,t,a,d),{positions:[t,n,r,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return y.lineSegmentPlane(r,n,a,f),y.lineSegmentPlane(t,n,a,d),{positions:[t,n,r,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return y.lineSegmentPlane(t,r,a,f),y.lineSegmentPlane(n,r,a,d),{positions:[t,n,r,f,d],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},y}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var n=function(t,n){this.normal=e.clone(t),this.distance=n};return n.fromPointNormal=function(r,a,i){var o=-e.dot(a,r);return t(i)?(e.clone(a,i.normal),i.distance=o,i):new n(a,o)},n.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},n}),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,a=new Array(e);if(t===n){for(r=0;e>r;r++)a[r]=t;return a}var i=n-t,o=i/e;for(r=1;e>r;r++){var u=t+r*o;a[r]=u}return a[0]=t,a}function h(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,P),l=a.scaleToGeodeticSurface(n,R),f=m.numberOfPoints(t,n,r),h=a.cartesianToCartographic(c,O),y=a.cartesianToCartographic(l,_),p=d(f,i,o);z.setEndPoints(h,y);var v=z.surfaceDistance/f,g=s;h.height=i;var w=a.cartographicToCartesian(h,T);e.pack(w,u,g),g+=3;for(var E=1;f>E;E++){var x=z.interpolateUsingSurfaceDistance(E*v,_);x.height=p[E],w=a.cartographicToCartesian(x,T),e.pack(w,u,g),g+=3}return g}var m={};m.numberOfPoints=function(t,n,r){var a=e.angleBetween(t,n);return Math.ceil(a/r)};var y=new t;m.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;n>a;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,y).height}return r};var p=new l,v=new e,g=new e,w=new f(e.ZERO,0),E=new e,x=new f(e.ZERO,0),S=new e,M=new e,O=new t,_=new t,T=new e,P=new e,R=new e,z=new o;return m.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,v),d=l.multiplyByPointAsVector(s,e.UNIT_Y,g),h=f.fromPointNormal(c,d,w),m=l.multiplyByPointAsVector(s,e.UNIT_X,E),y=f.fromPointNormal(c,m,x),O=1;i.push(e.clone(t[0]));for(var _=i[0],T=t.length,P=1;T>P;++P){var R=t[P];if(f.getPointDistance(y,_)<0||f.getPointDistance(y,R)<0){var z=u.lineSegmentPlane(_,R,h,S);if(r(z)){var N=e.multiplyByScalar(d,5e-9,M);f.getPointDistance(h,_)<0&&e.negate(N,N),i.push(e.add(z,N,new e)),o.push(O+1),e.negate(N,N),i.push(e.add(z,N,new e)),O=1}}i.push(e.clone(t[P])),O++,_=R}o.push(O)}return{positions:i,lengths:o}},m.removeDuplicates=function(t){var n=t.length;if(2>n)return void 0;var r,a,i;for(r=1;n>r&&(a=t[r-1],i=t[r],!e.equals(a,i));++r);if(r===n)return void 0;var o=[];for(o.push(t[0]);n>r;++r)a=t[r-1],i=t[r],e.equals(a,i)||o.push(e.clone(i));return o},m.generateArc=function(t){r(t)||(t={});var a,o,u,l=t.positions,f=n(t.ellipsoid,i.WGS84),d=n(t.height,0),y=n(t.granularity,c.RADIANS_PER_DEGREE),p=l.length,v=0;for(a=0;p-1>a;a++)o=l[a],u=l[a+1],v+=m.numberOfPoints(o,u,y);v++;var g=3*v,w=new Array(g),E=0;for(a=0;p-1>a;a++){o=l[a],u=l[a+1];var x,S;s(d)?(x=d[a],S=d[a+1]):(x=d,S=d),E=h(o,u,y,f,x,S,w,E)}var M=l[p-1],_=f.cartesianToCartographic(M,O);_.height=s(d)?d[p-1]:d;var P=f.cartographicToCartesian(_,T);return e.pack(P,w,g-3),w},m.generateCartesianArc=function(t){for(var n=m.generateArc(t),r=n.length/3,a=new Array(r),i=0;r>i;i++)a[i]=e.unpack(n,3*i);return a},m}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i=function(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){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},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.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.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.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.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r},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){return i.equalsEpsilon(this,e,t)},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";var i=function(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;f>d;d++){var h=t[d],m=h.x,y=h.y,p=h.z;a=Math.min(m,a),s=Math.max(m,s),o=Math.min(y,o),c=Math.max(y,c),u=Math.min(p,u),l=Math.max(p,l)}var v=r.minimum;v.x=a,v.y=o,v.z=u;var g=r.maximum;g.x=s,g.y=c,g.z=l;var w=e.add(v,g,r.center);return e.multiplyByScalar(w,.5,w),r},i.clone=function(t,r){return n(t)?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):void 0},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.intersect=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=r.x*Math.abs(n.x)+r.y*Math.abs(n.y)+r.z*Math.abs(n.z),u=e.dot(t.center,n)+n.w;return u-i>0?a.INSIDE:0>u+i?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersect=function(e){return i.intersect(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(r){return i(r)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(a){return i(a)}});return n}function o(){function e(e,t,n){return d(e,t,n)}function n(e){return m(e)}function a(e){return m(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,m;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(t){r.progress(t)}}: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 y(f,e),e},m=function(e){return e=t(e),d=e.then,m=t,h=v,y(l,e),f=l=x,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){y(e)}function s(e){m(e)}var c,l,f,d,h,m,y,p,g,w;if(g=t.length>>>0,c=Math.max(0,Math.min(n,g)),f=[],l=g-c+1,d=[],h=o(),c)for(p=h.progress,y=function(e){d.push(e),--l||(m=y=v,h.reject(d))},m=function(e){f.push(e),--c||(m=y=v,h.resolve(f))},w=0;g>w;++w)w in t&&e(t[w],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,g).then(t,n,r)}function f(){return d(arguments,g)}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;a>s;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function h(t,n){var r=E.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)})})},w.apply(t,r)})}function m(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 y(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 v(){}function g(e){return e}var w,E,x;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=m,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(x,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(x,t)})})}},E=[].slice,w=[].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(;a>i;++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(){"use strict";var e=function(e,t,n){for(var r,a,i=0,o=e.length-1;o>=i;)if(r=~~((i+o)/2),a=n(e[r],t),0>a)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)};return e}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";var e=function(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,m,y,p,v;if("%%"==e)return"%";for(var g=!1,w="",E=!1,x=!1,S=" ",M=s.length,O=0;s&&M>O;O++)switch(s.charAt(O)){case" ":w=" ";break;case"+":w="+";break;case"-":g=!0;break;case"'":S=s.charAt(O+1);break;case"0":E=!0;break;case"#":x=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(c=-c,g=!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,v=r?t[r.slice(0,-1)]:t[n++],d){case"s":return u(String(v),g,c,f,E,S);case"c":return u(String.fromCharCode(+v),g,c,f,E);case"b":return o(v,2,x,g,c,f,E);case"o":return o(v,8,x,g,c,f,E);case"x":return o(v,16,x,g,c,f,E);case"X":return o(v,16,x,g,c,f,E).toUpperCase();case"u":return o(v,10,x,g,c,f,E);case"i":case"d":return h=+v||0,h=Math.round(h-h%1),m=0>h?"-":w,v=m+a(String(Math.abs(h)),f,"0",!1),i(v,m,g,c,E);case"e":case"E":case"f":case"F":case"g":case"G":return h=+v,m=0>h?"-":w,y=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],v=m+Math.abs(h)[y](f),i(v,m,g,c,E)[p]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";var e=function(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(){"use strict";function e(e){return 0===e%4&&0!==e%100||0===e%400}return e}),define("Core/LeapSecond",[],function(){"use strict";var e=function(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 z.compare(e.julianDate,t.julianDate)}function f(e){g.julianDate=e;var n=z.leapSeconds,r=t(n,g,l);0>r&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=z.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}z.addSeconds(e,a,e)}function d(e,n){g.julianDate=e;var r=z.leapSeconds,a=t(r,g,l);if(0>a&&(a=~a),0===a)return z.addSeconds(e,-r[0].offset,n);if(a>=r.length)return z.addSeconds(e,-r[a-1].offset,n);var i=z.secondsDifference(r[a].julianDate,e);return 0===i?z.addSeconds(e,-r[a].offset,n):1>=i?void 0:z.addSeconds(e,-r[--a].offset,n)}function h(e,t,n){var r=0|t/s.SECONDS_PER_DAY;return e+=r,t-=s.SECONDS_PER_DAY*r,0>t&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function m(e,t,n,r,a,i,o){var u=0|(t-14)/12,c=e+4800+u,l=(0|1461*c/4)+(0|367*(t-2-12*u)/12)-(0|3*((c+100)/100)/4)+n-32075;r-=12,0>r&&(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]}var y=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,g=new u,w=/^(\d{4})$/,E=/^(\d{4})-(\d{2})$/,x=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,M=/^(\d{4})-?(\d{2})-?(\d{2})$/,O=/([Z+\-])?(\d{2})?:?(\d{2})?$/,_=/^(\d{2})(\.\d+)?/.source+O.source,T=/^(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,P=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,R="Invalid ISO 8601 date.",z=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,h(a,t,this),r===c.UTC&&f(this)};z.fromDate=function(e,t){var n=m(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 z(n[0],n[1],c.UTC)},z.fromIso8601=function(e,t){e=e.replace(",",".");var n,i,u,s=e.split("T"),l=1,d=1,y=0,g=0,O=0,N=0,C=s[0],I=s[1];if(!r(C))throw new a(R);var A;if(s=C.match(M),null!==s){if(A=C.split("-").length-1,A>0&&2!==A)throw new a(R);n=+s[1],l=+s[2],d=+s[3]}else if(s=C.match(E),null!==s)n=+s[1],l=+s[2];else if(s=C.match(w),null!==s)n=+s[1];else{var b;if(s=C.match(x),null!==s){if(n=+s[1],b=+s[2],u=o(n),1>b||u&&b>366||!u&&b>365)throw new a(R)}else{if(s=C.match(S),null===s)throw new a(R);n=+s[1];var D=+s[2],U=+s[3]||0;if(A=C.split("-").length-1,A>0&&(!r(s[3])&&1!==A||r(s[3])&&2!==A))throw new a(R);var q=new Date(Date.UTC(n,0,4));b=7*D+U-q.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(b),l=i.getUTCMonth()+1,d=i.getUTCDate()}if(u=o(n),1>l||l>12||1>d||(2!==l||!u)&&d>p[l-1]||u&&2===l&&d>v)throw new a(R);var L;if(r(I)){if(s=I.match(P),null!==s){if(A=I.split(":").length-1,A>0&&2!==A&&3!==A)throw new a(R);y=+s[1],g=+s[2],O=+s[3],N=1e3*+(s[4]||0),L=5}else if(s=I.match(T),null!==s){if(A=I.split(":").length-1,A>0&&1!==A)throw new a(R);y=+s[1],g=+s[2],O=60*+(s[3]||0),L=4}else{if(s=I.match(_),null===s)throw new a(R);y=+s[1],g=60*+(s[2]||0),L=3}if(g>=60||O>=61||y>24||24===y&&(g>0||O>0||N>0))throw new a(R);var B=s[L],W=+s[L+1],F=+(s[L+2]||0);switch(B){case"+":y-=W,g-=F;break;case"-":y+=W,g+=F;break;case"Z":break;default:g+=new Date(Date.UTC(n,l-1,d,y,g)).getTimezoneOffset()}}else g+=new Date(Date.UTC(n,l-1,d)).getTimezoneOffset();var G=60===O;for(G&&O--;g>=60;)g-=60,y++;for(;y>=24;)y-=24,d++;for(i=u&&2===l?v:p[l-1];d>i;)d-=i,l++,l>12&&(l-=12,n++),i=u&&2===l?v:p[l-1];for(;0>g;)g+=60,y--;for(;0>y;)y+=24,d--;for(;1>d;)l--,1>l&&(l+=12,n--),i=u&&2===l?v:p[l-1],d+=i;var V=m(n,l,d,y,g,O,N);return r(t)?(h(V[0],V[1],t),f(t)):t=new z(V[0],V[1],c.UTC),G&&z.addSeconds(t,1,t),t},z.now=function(e){return z.fromDate(new Date,e)};var N=new z(0,0,c.TAI);return z.toGregorianDate=function(e,t){var n=!1,a=d(e,N);r(a)||(z.addSeconds(e,-1,N),a=d(N,N),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=0|o+68569,l=0|4*c/146097;c=0|c-(0|(146097*l+3)/4);var f=0|4e3*(c+1)/1461001;c=0|c-(0|1461*f/4)+31;var h=0|80*c/2447,m=0|c-(0|2447*h/80);c=0|h/11;var y=0|h+2-12*c,p=0|100*(l-49)+f+c,v=0|u/s.SECONDS_PER_HOUR,g=u-v*s.SECONDS_PER_HOUR,w=0|g/s.SECONDS_PER_MINUTE;g-=w*s.SECONDS_PER_MINUTE;var E=0|g,x=(g-E)/s.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),n&&(E+=1),r(t)?(t.year=p,t.month=y,t.day=m,t.hour=v,t.minute=w,t.second=E,t.millisecond=x,t.isLeapSecond=n,t):new i(p,y,m,v,w,E,x,n)},z.toDate=function(e){var t=z.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))},z.toIso8601=function(t,n){var a,i=z.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))},z.clone=function(e,t){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new z(e.dayNumber,e.secondsOfDay,c.TAI):void 0},z.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},z.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},z.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(z.secondsDifference(e,t))<=n},z.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},z.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},z.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},z.computeTaiMinusUtc=function(e){g.julianDate=e;var n=z.leapSeconds,r=t(n,g,l);return 0>r&&(r=~r,--r,0>r&&(r=0)),n[r].offset},z.addSeconds=function(e,t,n){return h(e.dayNumber,e.secondsOfDay+t,n)},z.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,r,n)},z.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,r,n)},z.addDays=function(e,t,n){var r=e.dayNumber+t;return h(r,e.secondsOfDay,n)},z.lessThan=function(e,t){return z.compare(e,t)<0},z.lessThanOrEquals=function(e,t){return z.compare(e,t)<=0},z.greaterThan=function(e,t){return z.compare(e,t)>0},z.greaterThanOrEquals=function(e,t){return z.compare(e,t)>=0},z.prototype.clone=function(e){return z.clone(this,e)},z.prototype.equals=function(e){return z.equals(this,e)},z.prototype.equalsEpsilon=function(e,t){return z.equalsEpsilon(this,e,t)},z.prototype.toString=function(){return z.toIso8601(this)},z.leapSeconds=[new u(new z(2441317,43210,c.TAI),10),new u(new z(2441499,43211,c.TAI),11),new u(new z(2441683,43212,c.TAI),12),new u(new z(2442048,43213,c.TAI),13),new u(new z(2442413,43214,c.TAI),14),new u(new z(2442778,43215,c.TAI),15),new u(new z(2443144,43216,c.TAI),16),new u(new z(2443509,43217,c.TAI),17),new u(new z(2443874,43218,c.TAI),18),new u(new z(2444239,43219,c.TAI),19),new u(new z(2444786,43220,c.TAI),20),new u(new z(2445151,43221,c.TAI),21),new u(new z(2445516,43222,c.TAI),22),new u(new z(2446247,43223,c.TAI),23),new u(new z(2447161,43224,c.TAI),24),new u(new z(2447892,43225,c.TAI),25),new u(new z(2448257,43226,c.TAI),26),new u(new z(2448804,43227,c.TAI),27),new u(new z(2449169,43228,c.TAI),28),new u(new z(2449534,43229,c.TAI),29),new u(new z(2450083,43230,c.TAI),30),new u(new z(2450630,43231,c.TAI),31),new u(new z(2451179,43232,c.TAI),32),new u(new z(2453736,43233,c.TAI),33),new u(new z(2454832,43234,c.TAI),34),new u(new z(2456109,43235,c.TAI),35)],z}),define("Core/clone",["./defaultValue"],function(e){"use strict";var t=function(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";var e=function(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";var n=function(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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,n,r,a,i){"use strict";function o(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function u(e,t){for(var n=o(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 s(e,n){n=t(n,"");var a=e[1],i=!!e[2],s=e[3];switch(n){case"":case"text":return o(i,s);case"arraybuffer":return u(i,s);case"blob":var c=u(i,s);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(o(i,s),a);case"json":return JSON.parse(o(i,s));default:throw new r("Unhandled responseType: "+n)}}var c=function(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,u=n.overrideMimeType,s=n.withCredentials;return e(n.url,function(t){var n=e.defer();return c.load(t,r,a,i,o,n,u,s),n.promise})},l=/^data:(.*?)(;base64)?,(.*)$/;return c.load=function(e,t,r,o,u,c,f,d){var h=l.exec(e);if(null!==h)return c.resolve(s(h,t)),void 0;var m=new XMLHttpRequest;if(n(f)&&n(m.overrideMimeType)&&m.overrideMimeType(f),m.open(r,e,!0),n(u))for(var y in u)u.hasOwnProperty(y)&&m.setRequestHeader(y,u[y]);n(t)&&(m.responseType=t),n(d)&&(m.withCredentials=d),m.onload=function(){200===m.status?n(m.response)?c.resolve(m.response):n(m.responseXML)&&m.responseXML.hasChildNodes()?c.resolve(m.responseXML):n(m.responseText)?c.resolve(m.responseText):c.reject(new i("unknown XMLHttpRequest response type.")):c.reject(new a(m.status,m.response,m.getAllResponseHeaders()))},m.onerror=function(){c.reject(new a)},m.send(o)},c.defaultLoad=c.load,c}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";var n=function(n,r){return e({url:n,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})};return n}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";var a={Accept:"application/json,*/*;q=0.01"},i=function(n,i){return t(i)||(i={}),t(i.headers)?t(i.headers.Accept)||(i.headers=e(i.headers),i.headers.Accept=a.Accept):i.headers=a,r(n,i).then(function(e){return JSON.parse(e)})};return i}),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(e,t){return o.compare(e.julianDate,t) -}function h(e,n){if(!r(n.columnNames))return e._dataError="Error in loaded EOP data: The columnNames property is required.",void 0;if(!r(n.samples))return e._dataError="Error in loaded EOP data: The samples property is required.",void 0;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"),m=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),y=n.columnNames.indexOf("taiMinusUtcSeconds");if(0>a||0>i||0>s||0>c||0>h||0>m||0>y)return e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns",void 0;var p=e._samples=n.samples,v=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=m,e._taiMinusUtcSecondsColumn=y,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var g,w=e._addNewLeapSeconds,E=0,x=p.length;x>E;E+=e._columnCount){var S=p[E+a],M=p[E+y],O=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,_=new o(O,M,f.TAI);if(v.push(_),w){if(M!==g&&r(g)){var T=o.leapSeconds,P=t(T,_,d);if(0>P){var R=new u(_,M);T.splice(~P,0,R)}}g=M}}}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 y(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,p=n[d+e._ut1MinusUtcSecondsColumn],v=n[h+e._ut1MinusUtcSecondsColumn],g=v-p;if(g>.5||-.5>g){var w=n[d+e._taiMinusUtcSecondsColumn],E=n[h+e._taiMinusUtcSecondsColumn];w!==E&&(l.equals(r)?p=v:v-=E-w)}return u.xPoleWander=y(f,n[d+e._xPoleWanderRadiansColumn],n[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=y(f,n[d+e._yPoleWanderRadiansColumn],n[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=y(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=y(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=y(f,p,v),u}var v=function(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))h(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){h(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else h(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})};return v.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}}),v.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},v.prototype.compute=function(e,n){if(!r(this._samples)){if(r(this._dataError))throw new c(this._dataError);return void 0}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),m=!r(d),y=m||o.greaterThanOrEquals(d,e);if(h&&y)return s=u,!m&&d.equals(e)&&++s,l=s+1,p(this,i,this._samples,e,s,l,n),n}var v=t(i,e,o.compare,this._dateColumn);return v>=0?(v<i.length-1&&i[v+1].equals(e)&&++v,s=v,l=v):(l=~v,s=l-1,0>s&&(s=0)),this._lastIndex=s,p(this,i,this._samples,e,s,l,n),n},v}),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()):(n.path=t.authority&&""==t.path?"/"+this.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];for(r&&t.shift(),""==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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","require"],function(e,t,n,r){"use strict";function a(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),a=f.exec(r);if(null!==a)return a[1]}return void 0}function i(){if(t(s))return s;var r;if(r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:a(),!t(r))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return s=new e(r).resolve(new e(document.location.href))}function o(e){return r.toUrl("../"+e)}function u(t){return new e(t).resolve(i()).toString()}var s,c,l,f=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i,d=function(e){t(c)||(c=t(r.toUrl)?o:u),t(l)||(l=document.createElement("a"));var n=c(e);return l.href=n,l.href=l.href,l.href};return d._cesiumScriptRegex=f,d}),define("Core/Iau2006XysSample",[],function(){"use strict";var e=function(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,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function c(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=3*a*n._samplesPerXysFile,u=0,s=r.length;s>u;++u)t[o+u]=r[u];i.resolve()}),i.promise}var l=function(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;t>=s;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;t>=c;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)},f=new i(0,0,u.TAI);return l.prototype.preload=function(t,n,r,a){var i=s(this,t,n),o=s(this,r,a),u=0|i/this._stepSizeDays-this._interpolationOrder/2;0>u&&(u=0);var l=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var f=0|u/this._samplesPerXysFile,d=0|l/this._samplesPerXysFile,h=[],m=f;d>=m;++m)h.push(c(this,m));return e.all(h)},l.prototype.computeXysRadians=function(e,t,n){var i=s(this,e,t);if(0>i)return void 0;var o=0|i/this._stepSizeDays;if(o>=this._totalSamples)return void 0;var u=this._interpolationOrder,l=o-(0|u/2);0>l&&(l=0);var f=l+u;f>=this._totalSamples&&(f=this._totalSamples-1,l=f-u,0>l&&(l=0));var d=!1,h=this._samples;if(r(h[3*l])||(c(this,0|l/this._samplesPerXysFile),d=!0),r(h[3*f])||(c(this,0|f/this._samplesPerXysFile),d=!0),d)return void 0;r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var m,y,p=i-l*this._stepSizeDays,v=this._work,g=this._denominators,w=this._coef,E=this._xTable;for(m=0;u>=m;++m)v[m]=p-E[m];for(m=0;u>=m;++m){for(w[m]=1,y=0;u>=y;++y)y!==m&&(w[m]*=v[y]);w[m]*=g[m];var x=3*(l+m);n.x+=w[m]*h[x++],n.y+=w[m]*h[x++],n.s+=w[m]*h[x]}return n},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,m,y,p){"use strict";var v={},g=new n,w=new n,E=new n;v.eastNorthUpToFixedFrame=function(e,t,r){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return i(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=g,s=w,l=E;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.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,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var x=new n,S=new n,M=new n;v.northEastDownToFixedFrame=function(e,t,r){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return i(r)?(r[0]=-o,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]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=x,s=S,l=M;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.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(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},v.northUpEastToFixedFrame=function(e,t,r){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return i(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=o,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(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=g,s=w,l=E;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(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 y(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 O=24110.54841,_=8640184.812866,T=.093104,P=-62e-7,R=1.1772758384668e-19,z=72921158553e-15,N=h.TWO_PI/86400,C=new d;v.computeTemeToPseudoFixedMatrix=function(e,t){C=d.addSeconds(e,-d.computeTaiMinusUtc(e),C);var n,r=C.dayNumber,a=C.secondsOfDay,o=r-2451545;n=a>=43200?(o+.5)/p.DAYS_PER_JULIAN_CENTURY:(o-.5)/p.DAYS_PER_JULIAN_CENTURY;var u=O+n*(_+n*(T+n*P)),s=u*N%h.TWO_PI,c=z+R*(r-2451545.5),l=(a+.5*p.SECONDS_PER_DAY)%p.SECONDS_PER_DAY,f=s+c*l,y=Math.cos(f),v=Math.sin(f);return i(t)?(t[0]=y,t[1]=-v,t[2]=0,t[3]=v,t[4]=y,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(y,v,0,-v,y,0,0,0,1)},v.iau2006XysData=new l,v.earthOrientationParameters=u.NONE;var I=32.184,A=2451545;v.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+I,a=t.stop.dayNumber,i=t.stop.secondsOfDay+I,o=v.iau2006XysData.preload(n,r,a,i),u=v.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},v.computeIcrfToFixedMatrix=function(e,t){i(t)||(t=new m);var n=v.computeFixedToIcrfMatrix(e,t);return i(n)?m.transpose(n,t):void 0};var b=new f(0,0,0),D=new s(0,0,0,0,0,0),U=new m,q=new m;v.computeFixedToIcrfMatrix=function(e,t){i(t)||(t=new m);var n=v.earthOrientationParameters.compute(e,D);if(!i(n))return void 0;var r=e.dayNumber,a=e.secondsOfDay+I,o=v.iau2006XysData.computeXysRadians(r,a,b);if(!i(o))return void 0;var u=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=U;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(-o.s,q),y=m.multiply(l,f,U),g=e.dayNumber,w=e.secondsOfDay-d.computeTaiMinusUtc(e)+n.ut1MinusUtc,E=g-2451545,x=w/p.SECONDS_PER_DAY,S=.779057273264+x+.00273781191135448*(E+x);S=S%1*h.TWO_PI;var M=m.fromRotationZ(S,q),O=m.multiply(y,M,U),_=Math.cos(n.xPoleWander),T=Math.cos(n.yPoleWander),P=Math.sin(n.xPoleWander),R=Math.sin(n.yPoleWander),z=r-A+a/p.SECONDS_PER_DAY;z/=36525;var N=-47e-6*z*h.RADIANS_PER_DEGREE/3600,C=Math.cos(N),L=Math.sin(N),B=q;return B[0]=_*C,B[1]=_*L,B[2]=P,B[3]=-T*L+R*P*C,B[4]=T*C+R*P*L,B[5]=-R*_,B[6]=-R*L-T*P*C,B[7]=R*C-T*P*L,B[8]=T*_,m.multiply(O,B,t)};var L=new r;return v.pointToWindowCoordinates=function(e,t,n,r){return r=v.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},v.pointToGLWindowCoordinates=function(e,n,a,o){i(o)||(o=new t);var u=L;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,o)},v}),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";var m=new r,y=function(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)};o(y.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}}});var p=new e;y.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new y(r.center,n)};var v=new d,g=new n;y.prototype.projectPointOntoPlane=function(e,r){var a=v;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,g);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,g)),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)}return void 0},y.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;r>a;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t};var w=new n;return y.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=w,l=0;r>l;++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},y}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u){"use strict";var s=function(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)},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],m=e[u.COLUMN2ROW2],y=d+h+m;if(y>0)r=Math.sqrt(y+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,v=0;h>d&&(v=1),m>d&&m>h&&(v=2);var g=p[v],w=p[g];r=Math.sqrt(e[u.getElementIndex(v,v)]-e[u.getElementIndex(g,g)]-e[u.getElementIndex(w,w)]+1);var E=f;E[v]=.5*r,r=.5/r,c=(e[u.getElementIndex(w,g)]-e[u.getElementIndex(g,w)])*r,E[g]=(e[u.getElementIndex(g,v)]+e[u.getElementIndex(v,g)])*r,E[w]=(e[u.getElementIndex(w,v)]+e[u.getElementIndex(v,w)])*r,a=-E[0],i=-E[1],o=-E[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 e,h=new e,m=new s,y=new s,p=new s;s.packedLength=4,s.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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;i>a;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,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,a,i,o){n(o)||(o=new s),e.fromArray(t,0,h);var u=e.magnitude(h);return s.unpack(r,4*i,y),0===u?s.clone(s.IDENTITY,m):s.fromAxisAngle(h,u,m),s.multiply(m,y,o)},s.clone=function(e,t){return n(e)?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):void 0},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,m=o*l-r*u-a*s-i*c;return n.x=f,n.y=d,n.z=h,n.w=m,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 v=new s;s.lerp=function(e,t,n,r){return v=s.multiplyByScalar(t,n,v),r=s.multiplyByScalar(e,1-n,r),s.add(v,r,r)};var g=new s,w=new s,E=new s;s.slerp=function(e,t,n,r){var a=s.dot(e,t),i=t;if(0>a&&(a=-a,i=g=s.negate(t,g)),1-a<o.EPSILON6)return s.lerp(e,i,n,r);var u=Math.acos(a);return w=s.multiplyByScalar(e,Math.sin((1-n)*u),w),E=s.multiplyByScalar(i,Math.sin(n*u),E),r=s.add(w,E,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 x=new e,S=new e,M=new s,O=new s;s.computeInnerQuadrangle=function(t,n,r,a){var i=s.conjugate(n,M);s.multiply(i,r,O);var o=s.log(O,x);s.multiply(i,t,O);var u=s.log(O,S);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,O);return s.slerp(o,u,2*a*(1-a),i)};for(var _=new s,T=1.9011074535173003,P=a.supportsTypedArrays()?new Float32Array(8):[],R=a.supportsTypedArrays()?new Float32Array(8):[],z=a.supportsTypedArrays()?new Float32Array(8):[],N=a.supportsTypedArrays()?new Float32Array(8):[],C=0;7>C;++C){var I=C+1,A=2*I+1;P[C]=1/(I*A),R[C]=I/A}return P[7]=T/136,R[7]=8*T/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)z[f]=(P[f]*c-R[f])*o,N[f]=(P[f]*l-R[f])*o;var d=a*n*(1+z[0]*(1+z[1]*(1+z[2]*(1+z[3]*(1+z[4]*(1+z[5]*(1+z[6]*(1+z[7])))))))),h=u*(1+N[0]*(1+N[1]*(1+N[2]*(1+N[3]*(1+N[4]*(1+N[5]*(1+N[6]*(1+N[7])))))))),m=s.multiplyByScalar(e,h,_);return s.multiplyByScalar(t,d,r),s.add(m,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,O);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/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];b=t.cartesianToCartographic(a,b),n[r]=b.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;c>i;i++)l[i]=n;return l.push(r),l}var f=r-n,d=f/c;for(i=1;c>i;i++){var h=n+i*d;l[i]=h}return l[0]=n,l.push(r),l}function m(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,H),H),c=u.projectPointOntoPlane(t.add(a,r,X),X),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function y(e,n,r,a,i,o,c,l){var d=W,h=F;U=f.eastNorthUpToFixedFrame(e,i,U),d=s.multiplyByPointAsVector(U,D,d),d=t.normalize(d,d);var y=m(d,n,e,i);L=u.fromRotationZ(y,L),G.z=o,U=s.multiplyTransformation(U,s.fromRotationTranslation(L,G,q),U);var p=B;p[0]=c;for(var v=0;l>v;v++)for(var g=0;g<r.length;g+=3)h=t.fromArray(r,g,h),h=u.multiplyByVector(p,h,h),h=s.multiplyByPoint(U,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,V);a=y(c,n,r,a,i,o[s/3],u,1)}return a}function v(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;n>s;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 g(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;n>u;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function w(e,n,r,i,s,c,f,d,h,m){var p,v=t.angleBetween(t.subtract(n,e,C),t.subtract(r,e,I)),g=i===a.BEVELED?0:Math.ceil(v/o.toRadians(5));p=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,C),v/(g+1),j),k):u.fromQuaternion(l.fromAxisAngle(e,v/(g+1),j),k);var w,E;if(n=t.clone(n,Y),g>0)for(var x=m?2:1,S=0;g>S;S++)n=u.multiplyByVector(p,n,n),w=t.subtract(n,e,C),w=t.normalize(w,w),s||(w=t.negate(w,w)),E=c.scaleToGeodeticSurface(n,I),f=y(E,w,d,f,c,h,1,x);else w=t.subtract(n,e,C),w=t.normalize(w,w),s||(w=t.negate(w,w)),E=c.scaleToGeodeticSurface(n,I),f=y(E,w,d,f,c,h,1,1),r=t.clone(r,Y),w=t.subtract(r,e,C),w=t.normalize(w,w),s||(w=t.negate(w,w)),E=c.scaleToGeodeticSurface(r,I),f=y(E,w,d,f,c,h,1,1);return f}function E(e,t){return o.equalsEpsilon(e.latitude,t.latitude,o.EPSILON6)&&o.equalsEpsilon(e.longitude,t.longitude,o.EPSILON6)}var x=[new t,new t],S=new t,M=new t,O=new t,_=new t,T=new t,P=new t,R=new t,z=new t,N=new t,C=new t,I=new t,A={},b=new r,D=new t(-1,0,0),U=new s,q=new s,L=new u,B=u.IDENTITY.clone(),W=new t,F=new n,G=new t,V=new t,j=new l,Y=new t,k=new u;A.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;n>i;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var H=new t,X=new t;A.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,H),H),s=o.projectPointOntoPlane(t.add(r,n,X),X);return s.x*u.y-s.y*u.x>=0};var Z=new r,J=new r;return A.removeDuplicatesFromPositions=function(e,t){var n=e.length;if(2>n)return e.slice(0);var r=[];r.push(e[0]);for(var a=1;n>a;++a){var i=e[a-1],o=e[a],u=t.cartesianToCartographic(i,Z),s=t.cartesianToCartographic(o,J);E(u,s)||r.push(o)}return r},A.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=d(e,s),f=i._granularity,m=i._cornerType,E=u?v(n,r):g(n,r),I=u?g(n,r):void 0,b=r.height/2,D=r.width/2,U=e.length,q=[],L=u?[]:void 0,B=S,W=M,F=O,G=_,V=T,j=P,Y=R,k=z,H=N,X=e[0],Z=e[1];G=s.geodeticSurfaceNormal(X,G),B=t.subtract(Z,X,B),B=t.normalize(B,B),k=t.cross(G,B,k),k=t.normalize(k,k);var J=l[0],Q=l[1];u&&(L=y(X,k,I,L,s,J+b,1,1)),H=t.clone(X,H),X=Z,W=t.negate(B,W);for(var K,$,et=1;U-1>et;et++){var tt=u?2:1;Z=e[et+1],B=t.subtract(Z,X,B),B=t.normalize(B,B),F=t.add(B,W,F),F=t.normalize(F,F),G=s.geodeticSurfaceNormal(X,G);var nt=!t.equalsEpsilon(t.negate(F,C),G,o.EPSILON2);if(nt){F=t.cross(F,G,F),F=t.cross(G,F,F),F=t.normalize(F,F);var rt=1/Math.max(.25,t.magnitude(t.cross(F,W,C))),at=A.angleIsGreaterThanPi(B,W,X,s);at?(V=t.add(X,t.multiplyByScalar(F,rt*D,F),V),j=t.add(V,t.multiplyByScalar(k,D,j),j),x[0]=t.clone(H,x[0]),x[1]=t.clone(j,x[1]),K=h(x,J+b,Q+b,f),$=c.generateArc({positions:x,granularity:f,ellipsoid:s}),q=p($,k,E,q,s,K,1),k=t.cross(G,B,k),k=t.normalize(k,k),Y=t.add(V,t.multiplyByScalar(k,D,Y),Y),m===a.ROUNDED||m===a.BEVELED?w(V,j,Y,m,at,s,q,E,Q+b,u):(F=t.negate(F,F),q=y(X,F,E,q,s,Q+b,rt,tt)),H=t.clone(Y,H)):(V=t.add(X,t.multiplyByScalar(F,rt*D,F),V),j=t.add(V,t.multiplyByScalar(k,-D,j),j),x[0]=t.clone(H,x[0]),x[1]=t.clone(j,x[1]),K=h(x,J+b,Q+b,f),$=c.generateArc({positions:x,granularity:f,ellipsoid:s}),q=p($,k,E,q,s,K,1),k=t.cross(G,B,k),k=t.normalize(k,k),Y=t.add(V,t.multiplyByScalar(k,-D,Y),Y),m===a.ROUNDED||m===a.BEVELED?w(V,j,Y,m,at,s,q,E,Q+b,u):q=y(X,F,E,q,s,Q+b,rt,tt),H=t.clone(Y,H)),W=t.negate(B,W)}else q=y(H,k,E,q,s,J+b,1,1),H=X;J=Q,Q=l[et+1],X=Z}x[0]=t.clone(H,x[0]),x[1]=t.clone(X,x[1]),K=h(x,J+b,Q+b,f),$=c.generateArc({positions:x,granularity:f,ellipsoid:s}),q=p($,k,E,q,s,K,1),u&&(L=y(X,k,I,L,s,Q+b,1,1)),U=q.length;var it=u?U+L.length:U,ot=new Float64Array(it);return ot.set(q),u&&ot.set(L,U),ot},A}),define("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./isArray","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(n,r,o,u,c){var l=e.angleBetween(e.subtract(r,n,y),e.subtract(o,n,p)),f=u===t.BEVELED?1:Math.ceil(l/a.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 m;m=c?i.fromQuaternion(s.fromAxisAngle(e.negate(n,y),l/f,N),C):i.fromQuaternion(s.fromAxisAngle(n,l/f,N),C);var v=0;r=e.clone(r,y);for(var g=0;f>g;g++)r=i.multiplyByVector(m,r,r),h[v++]=r.x,h[v++]=r.y,h[v++]=r.z;return h}function l(n){var r=E,a=x,i=S,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=c(r,a,i,t.ROUNDED,!1),s=n.length-1,l=n[s-1];o=n[s],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=c(r,a,i,t.ROUNDED,!1);return[u,f]}function f(t,n,r,a){var i=y;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 d(t,n,r,a){for(var i=new Array(t.length),o=new Array(t.length),u=e.multiplyByScalar(n,r,y),s=e.negate(u,p),c=0,l=t.length-1,f=0;f<t.length;f+=3){var d=e.fromArray(t,f,v),h=e.add(d,s,g);i[c++]=h.x,i[c++]=h.y,i[c++]=h.z;var m=e.add(d,u,g);o[l--]=m.z,o[l--]=m.y,o[l--]=m.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 m={},y=new e,p=new e,v=new e,g=new e,w=[new e,new e],E=new e,x=new e,S=new e,M=new e,O=new e,_=new e,T=new e,P=new e,R=new e,z=new e,N=new s,C=new i;m.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)},m.computePositions=function(n){var r=n.granularity,i=n.positions,s=n.ellipsoid;i=h(i,s);var m=n.width/2,p=n.cornerType,v=n.saveAttributes,g=E,N=x,C=S,I=M,A=O,b=_,D=T,U=P,q=R,L=z,B=[],W=v?[]:void 0,F=v?[]:void 0,G=i[0],V=i[1];N=e.normalize(e.subtract(V,G,N),N),g=s.geodeticSurfaceNormal(G,g),I=e.normalize(e.cross(g,N,I),I),v&&(W.push(I.x,I.y,I.z),F.push(g.x,g.y,g.z)),D=e.clone(G,D),G=V,C=e.negate(N,C);var j,Y,k=[],H=i.length;for(Y=1;H-1>Y;Y++){g=s.geodeticSurfaceNormal(G,g),V=i[Y+1],N=e.normalize(e.subtract(V,G,N),N),A=e.normalize(e.add(N,C,A),A);var X=!e.equalsEpsilon(e.negate(A,y),g,a.EPSILON2);if(X){A=e.cross(A,g,A),A=e.cross(g,A,A);var Z=m/Math.max(.25,e.magnitude(e.cross(A,C,y))),J=u.angleIsGreaterThanPi(N,C,G,s);A=e.multiplyByScalar(A,Z,A),J?(U=e.add(G,A,U),L=e.add(U,e.multiplyByScalar(I,m,L),L),q=e.add(U,e.multiplyByScalar(I,2*m,q),q),w[0]=e.clone(D,w[0]),w[1]=e.clone(L,w[1]),j=o.generateArc({positions:w,granularity:r,ellipsoid:s}),B=d(j,I,m,B),v&&(W.push(I.x,I.y,I.z),F.push(g.x,g.y,g.z)),b=e.clone(q,b),I=e.normalize(e.cross(g,N,I),I),q=e.add(U,e.multiplyByScalar(I,2*m,q),q),D=e.add(U,e.multiplyByScalar(I,m,D),D),p===t.ROUNDED||p===t.BEVELED?k.push({leftPositions:c(U,b,q,p,J)}):k.push({leftPositions:f(G,e.negate(A,A),q,J)})):(q=e.add(G,A,q),L=e.add(q,e.negate(e.multiplyByScalar(I,m,L),L),L),U=e.add(q,e.negate(e.multiplyByScalar(I,2*m,U),U),U),w[0]=e.clone(D,w[0]),w[1]=e.clone(L,w[1]),j=o.generateArc({positions:w,granularity:r,ellipsoid:s}),B=d(j,I,m,B),v&&(W.push(I.x,I.y,I.z),F.push(g.x,g.y,g.z)),b=e.clone(U,b),I=e.normalize(e.cross(g,N,I),I),U=e.add(q,e.negate(e.multiplyByScalar(I,2*m,U),U),U),D=e.add(q,e.negate(e.multiplyByScalar(I,m,D),D),D),p===t.ROUNDED||p===t.BEVELED?k.push({rightPositions:c(q,b,U,p,J)}):k.push({rightPositions:f(G,A,U,J)})),C=e.negate(N,C) -}G=V}g=s.geodeticSurfaceNormal(G,g),w[0]=e.clone(D,w[0]),w[1]=e.clone(G,w[1]),j=o.generateArc({positions:w,granularity:r,ellipsoid:s}),B=d(j,I,m,B),v&&(W.push(I.x,I.y,I.z),F.push(g.x,g.y,g.z));var Q;return p===t.ROUNDED&&(Q=l(B)),{positions:B,corners:k,lefts:W,normals:F,endPositions:Q}};var I=new e,A=new e;return m.scaleToGeodeticHeight=function(t,n,a,i){var o=t.length,u=r(i)?i:new Array(t.length);u.length=t.length;for(var s=n,c=0;o>c;c+=3){var l=a.scaleToGeodeticSurface(e.fromArray(t,c,A),A),f=I;0!==n&&(f=a.geodeticSurfaceNormal(l,f),f=e.multiplyByScalar(f,s,f),l=e.add(l,f,l)),u[c]=l.x,u[c+1]=l.y,u[c+2]=l.z}return u},m}),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"],function(e){"use strict";var t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===t.POINTS||e===t.LINES||e===t.LINE_LOOP||e===t.LINE_STRIP||e===t.TRIANGLES||e===t.TRIANGLE_STRIP||e===t.TRIANGLE_FAN}};return e(t)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";var i=function(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)};return i.computeNumberOfVertices=function(e){var r=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(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"],function(e,t,n,r){"use strict";var a={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,a){return e>r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(a)}),define("Core/CorridorOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,m,y){"use strict";function p(e,i){var u,s,c,h=[],m=e.positions,y=e.corners,p=e.endPositions,v=new f,x=0,S=0,M=0;for(s=0;s<m.length;s+=2)c=m[s].length-3,x+=c,M+=4*(c/3),S+=m[s+1].length-3;for(x+=3,S+=3,s=0;s<y.length;s++){u=y[s];var O=y[s].leftPositions;o(O)?(c=O.length,x+=c,M+=2*(c/3)):(c=y[s].rightPositions.length,S+=c,M+=2*(c/3))}var _,T=o(p);T&&(_=p[0].length-3,x+=_,S+=_,_/=3,M+=4*_);var P,R,z,N,C,I,A=x+S,b=new Float64Array(A),D=0,U=A-1,q=_/2,L=d.createTypedArray(A/3,M+4),B=0;if(L[B++]=D/3,L[B++]=(U-2)/3,T){h.push(D/3),I=g,C=w;var W=p[0];for(s=0;q>s;s++)I=t.fromArray(W,3*(q-1-s),I),C=t.fromArray(W,3*(q+s),C),a.addAttribute(b,C,D),a.addAttribute(b,I,void 0,U),R=D/3,N=R+1,P=(U-2)/3,z=P-1,L[B++]=P,L[B++]=z,L[B++]=R,L[B++]=N,D+=3,U-=3}var F=0,G=m[F++],V=m[F++];for(b.set(G,D),b.set(V,U-V.length+1),c=V.length-3,h.push(D/3,(U-2)/3),s=0;c>s;s+=3)R=D/3,N=R+1,P=(U-2)/3,z=P-1,L[B++]=P,L[B++]=z,L[B++]=R,L[B++]=N,D+=3,U-=3;for(s=0;s<y.length;s++){var j;u=y[s];var Y,k=u.leftPositions,H=u.rightPositions,X=E;if(o(k)){for(U-=3,Y=z,h.push(N),j=0;j<k.length/3;j++)X=t.fromArray(k,3*j,X),L[B++]=Y-j-1,L[B++]=Y-j,a.addAttribute(b,X,void 0,U),U-=3;h.push(Y-Math.floor(k.length/6)),i===r.BEVELED&&h.push((U-2)/3+1),D+=3}else{for(D+=3,Y=N,h.push(z),j=0;j<H.length/3;j++)X=t.fromArray(H,3*j,X),L[B++]=Y+j,L[B++]=Y+j+1,a.addAttribute(b,X,D),D+=3;h.push(Y+Math.floor(H.length/6)),i===r.BEVELED&&h.push(D/3-1),U-=3}for(G=m[F++],V=m[F++],G.splice(0,3),V.splice(V.length-3,3),b.set(G,D),b.set(V,U-V.length+1),c=V.length-3,j=0;j<V.length;j+=3)N=D/3,R=N-1,z=(U-2)/3,P=z+1,L[B++]=P,L[B++]=z,L[B++]=R,L[B++]=N,D+=3,U-=3;D-=3,U+=3,h.push(D/3,(U-2)/3)}if(T){D+=3,U-=3,I=g,C=w;var Z=p[1];for(s=0;q>s;s++)I=t.fromArray(Z,3*(_-s-1),I),C=t.fromArray(Z,3*s,C),a.addAttribute(b,I,void 0,U),a.addAttribute(b,C,D),N=D/3,R=N-1,z=(U-2)/3,P=z+1,L[B++]=P,L[B++]=z,L[B++]=R,L[B++]=N,D+=3,U-=3;h.push(D/3)}else h.push(D/3,(U-2)/3);return L[B++]=D/3,L[B++]=(U-2)/3,v.position=new l({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:b}),{attributes:v,indices:L,wallIndices:h}}function v(e){var t=e.ellipsoid,n=a.computePositions(e),r=p(n,e.cornerType),i=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 m=new Float64Array(2*f);l=a.scaleToGeodeticHeight(l,o,t,l),h=a.scaleToGeodeticHeight(h,u,t,h),m.set(l),m.set(h,f),s.position.values=m,f/=3;var y,v=c.length,g=d.createTypedArray(m.length/3,2*(v+i.length));g.set(c);var w=v;for(y=0;v>y;y+=2){var E=c[y],x=c[y+1];g[w++]=E+f,g[w++]=x+f}var S,M;for(y=0;y<i.length;y++)S=i[y],M=S+f,g[w++]=S,g[w++]=M;return{attributes:s,indices:g}}var g=new t,w=new t,E=new t,x=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.positions,n=e.width;this._positions=t,this._width=n,this._ellipsoid=i(e.ellipsoid,s.WGS84),this._height=i(e.height,0),this._extrudedHeight=i(e.extrudedHeight,this._height),this._cornerType=i(e.cornerType,r.ROUNDED),this._granularity=i(e.granularity,h.RADIANS_PER_DEGREE),this._workerName="createCorridorOutlineGeometry"};return x.createGeometry=function(t){var n=t._positions,r=t._height,i=t._extrudedHeight,u=r!==i,s=m.removeDuplicates(n);o(s)||(s=n);var l,f=t._ellipsoid,d={ellipsoid:f,positions:s,width:t._width,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!1};if(u){var h=Math.max(r,i);i=Math.min(r,i),r=h,d.height=r,d.extrudedHeight=i,l=v(d)}else{var g=a.computePositions(d);l=p(g,d.cornerType),l.attributes.position.values=a.scaleToGeodeticHeight(l.attributes.position.values,r,f,l.attributes.position.values)}var w=l.attributes,E=e.fromVertices(w.position.values,void 0,3);return new c({attributes:w,indices:l.indices,primitiveType:y.LINES,boundingSphere:E})},x}),define("Workers/createCorridorOutlineGeometry",["../Core/CorridorOutlineGeometry","../Core/Ellipsoid"],function(e,t){"use strict";function n(n){return n._ellipsoid=t.clone(n._ellipsoid),e.createGeometry(n)}return n})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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:0>e?-1:0},a.signNotZero=function(e){return 0>e?-1:1},a.toSNorm=function(e){return Math.round(255*(.5*a.clamp(e,-1,1)+.5))},a.fromSNorm=function(e){return a.clamp(e,0,255)/255*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.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 a>=i||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;e>=r;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}i.fromSpherical=function(n,r){t(r)||(r=new i);var a=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(o),r},i.fromElements=function(e,n,r,a){return t(a)?(a.x=e,a.y=n,a.z=r,a):new i(e,n,r)},i.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 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},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},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 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){i.normalize(e,s),i.normalize(t,c);var n=i.dot(s,c),r=i.magnitude(i.cross(s,c,s));return Math.atan2(r,n)};var l=new i;i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):n.y<=n.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,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},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},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)},i.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,d=r*u-a*o;return n.x=c,n.y=l,n.z=d,n},i.fromDegrees=function(e,t,n,r,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,n,r,o)};var d=new i,f=new i,E=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(n,r,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:E,c=Math.cos(r);d.x=c*Math.cos(n),d.y=c*Math.sin(n),d.z=Math.sin(r),d=i.normalize(d,d),i.multiplyComponents(s,d,f);var l=Math.sqrt(i.dot(d,f));return f=i.divideByScalar(f,l,f),d=i.multiplyByScalar(d,a,d),t(u)||(u=new i),i.add(f,d,u)},i.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=a.toRadians(e[o]);return i.fromRadiansArray(r,t,n)},i.fromRadiansArray=function(e,n,r){var a=e.length;t(r)?r.length=a/2:r=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=i.fromRadians(u,s,0,n,r[o/2])}return r},i.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=a.toRadians(e[o]),r[o+1]=a.toRadians(e[o+1]),r[o+2]=e[o+2];return i.fromRadiansArrayHeights(r,t,n)},i.fromRadiansArrayHeights=function(e,n,r){var a=e.length;t(r)?r.length=a/3:r=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=i.fromRadians(u,s,c,n,r[o/3])}return r},i.ZERO=r(new i(0,0,0)),i.UNIT_X=r(new i(1,0,0)),i.UNIT_Y=r(new i(0,1,0)),i.UNIT_Z=r(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,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},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,d=n.y,f=n.z,E=a.x,h=a.y,_=a.z,m=l*l*E*E,p=d*d*h*h,y=f*f*_*_,T=m+p+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(s>T)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,N=u.y,v=u.z,M=o;M.x=A.x*S*2,M.y=A.y*N*2,M.z=A.z*v*2;var O,I,g,w,C,P,x,U,D,L,F,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(M)),z=0;do{B-=z,g=1/(1+B*S),w=1/(1+B*N),C=1/(1+B*v),P=g*g,x=w*w,U=C*C,D=P*g,L=x*w,F=U*C,O=m*P+p*x+y*U-1,I=m*D*S+p*L*N+y*F*v;var b=-2*I;z=O/b}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=l*g,c.y=d*w,c.z=f*C,c):new e(l*g,d*w,f*C)}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,d=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),E=i.EPSILON1;return u.fromCartesian=function(t,r,a){var h=n(r)?r.oneOverRadii:d,_=n(r)?r.oneOverRadiiSquared:f,m=n(r)?r._centerToleranceSquared:E,p=o(t,h,_,m,c);if(n(p)){var y=e.multiplyComponents(t,_,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){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){a=n(a,0),e.pack(t._radii,r,a)},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 d=new e,f=new e;l.prototype.cartographicToCartesian=function(t,n){var a=d,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;n>a;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var E=new e,h=new e,_=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,h);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),d=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=d,a):new t(c,l,d)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;n>a;++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}),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","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(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 u(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;3>n;++n){var r=e[o.getElementIndex(E[n],f[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=i.EPSILON15,r=0,a=1,u=0;3>u;++u){var s=Math.abs(e[o.getElementIndex(E[u],f[u])]);s>r&&(a=u,r=s)}var c=1,l=0,d=f[a],h=E[a];if(Math.abs(e[o.getElementIndex(h,d)])>n){var _,m=e[o.getElementIndex(h,h)],p=e[o.getElementIndex(d,d)],y=e[o.getElementIndex(h,d)],T=(m-p)/2/y;_=0>T?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+_*_),l=_*c}return t=o.clone(o.IDENTITY,t),t[o.getElementIndex(d,d)]=t[o.getElementIndex(h,h)]=c,t[o.getElementIndex(h,d)]=l,t[o.getElementIndex(d,h)]=-l,t}o.packedLength=9,o.pack=function(e,n,r){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]},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},o.clone=function(e,t){return n(e)?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 o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},o.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,u=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,d=e.z*e.z,f=e.z*e.w,E=e.w*e.w,h=r-s-d+E,_=2*(a-f),m=2*(i+l),p=2*(a+f),y=-r+s-d+E,T=2*(c-u),R=2*(i-l),A=2*(c+u),S=-r-s+d+E;return n(t)?(t[0]=h,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 o(h,_,m,p,y,T,R,A,S)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,r,-a,0,a,r)},o.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 o(r,0,a,0,1,0,-a,0,r)},o.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 o(r,-a,0,a,r,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},o.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},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;o.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 d=new e;o.getMaximumScale=function(t){return o.getScale(t,d),e.maximumComponent(d)},o.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],d=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]=d,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[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},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[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},o.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},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[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},o.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},o.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},o.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 f=[1,0,0],E=[2,2,1],h=new o,_=new o;return o.computeEigenDecomposition=function(e,t){var r=i.EPSILON20,a=10,l=0,d=0;n(t)||(t={});for(var f=t.unitary=o.clone(o.IDENTITY,t.unitary),E=t.diagonal=o.clone(e,t.diagonal),m=r*u(E);a>d&&s(E)>m;)c(E,h),o.transpose(h,_),o.multiply(E,h,E),o.multiply(_,E,E),o.multiply(f,h,f),++l>2&&(++d,l=0);return 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[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},o.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)},o.inverse=function(e,t){var n=e[0],a=e[1],u=e[2],s=e[3],c=e[4],l=e[5],d=e[6],f=e[7],E=e[8],h=o.determinant(e);if(Math.abs(h)<=i.EPSILON15)throw new r("matrix is not invertible");t[0]=c*E-f*l,t[1]=f*u-a*E,t[2]=a*l-c*u,t[3]=d*l-s*E,t[4]=n*E-d*u,t[5]=s*u-n*l,t[6]=s*f-d*c,t[7]=d*a-n*f,t[8]=n*c-s*a;var _=1/h;return o.multiplyByScalar(t,_,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=a(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=a(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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.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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a,i,o,u,s,c,l,d,f,E,h,_,m){this[0]=n(e,0),this[1]=n(i,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(h,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(d,0),this[11]=n(_,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(m,0)}c.packedLength=16,c.pack=function(e,t,r){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]},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),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},c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[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]):void 0},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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new c);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,l=t.x*t.y,d=t.x*t.z,f=t.x*t.w,E=t.y*t.y,h=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*(l-p),A=2*(d+_),S=2*(l+p),N=-s+E-m+y,v=2*(h-f),M=2*(d-_),O=2*(h+f),I=-s-E+m+y;return a[0]=T*i,a[1]=S*i,a[2]=M*i,a[3]=0,a[4]=R*o,a[5]=N*o,a[6]=O*o,a[7]=0,a[8]=A*u,a[9]=v*u,a[10]=I*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.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 l=new e,d=new e,f=new e;c.fromCamera=function(t,n){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,d),d),e.normalize(e.cross(d,l,f),f);var u=d.x,s=d.y,E=d.z,h=l.x,_=l.y,m=l.z,p=f.x,y=f.y,T=f.z,R=a.x,A=a.y,S=a.z,N=u*-R+s*-A+E*-S,v=p*-R+y*-A+T*-S,M=h*R+_*A+m*S; +return r(n)?(n[0]=u,n[1]=p,n[2]=-h,n[3]=0,n[4]=s,n[5]=y,n[6]=-_,n[7]=0,n[8]=E,n[9]=T,n[10]=-m,n[11]=0,n[12]=N,n[13]=v,n[14]=M,n[15]=1,n):new c(u,s,E,N,p,y,T,v,-h,-_,-m,M,0,0,0,1)},c.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},c.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,d=-(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]=d,o[14]=f,o[15]=1,o},c.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),d=-(i+a)/(i-a),f=-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]=d,o[11]=f,o[12]=0,o[13]=0,o[14]=E,o[15]=0,o},c.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,d=-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]=d,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},c.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,d=.5*(r-t),f=c,E=l,h=d,_=i+c,m=o+l,p=t+d,y=1;return a[0]=f,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]=h,a[11]=0,a[12]=_,a[13]=m,a[14]=p,a[15]=y,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,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},c.setColumn=function(e,t,n,r){r=c.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},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],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},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 E=new e;c.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 h=new e;c.getMaximumScale=function(t){return c.getScale(t,h),e.maximumComponent(h)},c.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],d=e[8],f=e[9],E=e[10],h=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],N=t[4],v=t[5],M=t[6],O=t[7],I=t[8],g=t[9],w=t[10],C=t[11],P=t[12],x=t[13],U=t[14],D=t[15],L=r*T+u*R+d*A+_*S,F=a*T+s*R+f*A+m*S,B=i*T+c*R+E*A+p*S,z=o*T+l*R+h*A+y*S,b=r*N+u*v+d*M+_*O,G=a*N+s*v+f*M+m*O,q=i*N+c*v+E*M+p*O,X=o*N+l*v+h*M+y*O,W=r*I+u*g+d*w+_*C,H=a*I+s*g+f*w+m*C,V=i*I+c*g+E*w+p*C,Y=o*I+l*g+h*w+y*C,k=r*P+u*x+d*U+_*D,j=a*P+s*x+f*U+m*D,Z=i*P+c*x+E*U+p*D,K=o*P+l*x+h*U+y*D;return n[0]=L,n[1]=F,n[2]=B,n[3]=z,n[4]=b,n[5]=G,n[6]=q,n[7]=X,n[8]=W,n[9]=H,n[10]=V,n[11]=Y,n[12]=k,n[13]=j,n[14]=Z,n[15]=K,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],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],d=e[10],f=e[12],E=e[13],h=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],N=t[10],v=t[12],M=t[13],O=t[14],I=r*_+o*m+c*p,g=a*_+u*m+l*p,w=i*_+s*m+d*p,C=r*y+o*T+c*R,P=a*y+u*T+l*R,x=i*y+s*T+d*R,U=r*A+o*S+c*N,D=a*A+u*S+l*N,L=i*A+s*S+d*N,F=r*v+o*M+c*O+f,B=a*v+u*M+l*O+E,z=i*v+s*M+d*O+h;return n[0]=I,n[1]=g,n[2]=w,n[3]=0,n[4]=C,n[5]=P,n[6]=x,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=B,n[14]=z,n[15]=1,n},c.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],d=e[10],f=t[0],E=t[1],h=t[2],_=t[3],m=t[4],p=t[5],y=t[6],T=t[7],R=t[8],A=r*f+o*E+c*h,S=a*f+u*E+l*h,N=i*f+s*E+d*h,v=r*_+o*m+c*p,M=a*_+u*m+l*p,O=i*_+s*m+d*p,I=r*y+o*T+c*R,g=a*y+u*T+l*R,w=i*y+s*T+d*R;return n[0]=A,n[1]=S,n[2]=N,n[3]=0,n[4]=v,n[5]=M,n[6]=O,n[7]=0,n[8]=I,n[9]=g,n[10]=w,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,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;c.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,c.multiplyByScale(e,_,n)},c.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?c.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)},c.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},c.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},c.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},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],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},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 m=new u,p=new u,y=new t,T=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,m),p,o.EPSILON7)&&t.equals(c.getRow(e,3,y),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],l=e[12],d=e[1],f=e[5],E=e[9],h=e[13],_=e[2],R=e[6],A=e[10],S=e[14],N=e[3],v=e[7],M=e[11],O=e[15],I=A*O,g=S*M,w=R*O,C=S*v,P=R*M,x=A*v,U=_*O,D=S*N,L=_*M,F=A*N,B=_*v,z=R*N,b=I*f+C*E+P*h-(g*f+w*E+x*h),G=g*d+U*E+F*h-(I*d+D*E+L*h),q=w*d+D*f+B*h-(C*d+U*f+z*h),X=x*d+L*f+z*E-(P*d+F*f+B*E),W=g*a+w*i+x*l-(I*a+C*i+P*l),H=I*r+D*i+L*l-(g*r+U*i+F*l),V=C*r+U*a+z*l-(w*r+D*a+B*l),Y=P*r+F*a+B*i-(x*r+L*a+z*i);I=i*h,g=l*E,w=a*h,C=l*f,P=a*E,x=i*f,U=r*h,D=l*d,L=r*E,F=i*d,B=r*f,z=a*d;var k=I*v+C*M+P*O-(g*v+w*M+x*O),j=g*N+U*M+F*O-(I*N+D*M+L*O),Z=w*N+D*v+B*O-(C*N+U*v+z*O),K=x*N+L*v+z*M-(P*N+F*v+B*M),J=w*A+x*S+g*R-(P*S+I*R+C*A),Q=L*S+I*_+D*A-(U*A+F*S+g*_),$=U*R+z*S+C*_-(B*S+w*_+D*R),ee=B*A+P*_+F*R-(L*R+z*A+x*_),te=r*b+a*G+i*q+l*X;if(Math.abs(te)<o.EPSILON20)throw new s("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]=X*te,n[4]=W*te,n[5]=H*te,n[6]=V*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},c.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],d=e[12],f=e[13],E=e[14],h=-n*d-r*f-a*E,_=-i*d-o*f-u*E,m=-s*d-c*f-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]=h,t[13]=_,t[14]=m,t[15]=1,t},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,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/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/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){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},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 n>t&&(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,d=0,f=e.length;f>d;d++){var E=e[d];r=Math.min(r,E.longitude),a=Math.max(a,E.longitude),c=Math.min(c,E.latitude),l=Math.max(l,E.latitude);var h=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;i=Math.min(i,h),o=Math.max(o,h)}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.clone=function(e,t){return n(e)?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):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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;i>a&&(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;i>a&&o>0?a+=u.TWO_PI:c>o&&a>0&&(o+=u.TWO_PI),i>a&&0>c?c+=u.TWO_PI:c>o&&0>i&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),d=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&l>=d)){var f=Math.max(e.south,t.south),E=Math.min(e.north,t.north);if(!(f>=E))return n(r)?(r.west=l,r.south=f,r.east=d,r.north=E,r):new s(l,f,d,E)}},s.union=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.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,a=e.west,i=e.east;return a>i&&(i+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(i>n||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,d=e.north,f=e.south,E=e.east,h=e.west,_=c;_.height=a,_.longitude=h,_.latitude=d,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.longitude=E,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.latitude=f,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.longitude=h,o[l]=r.cartographicToCartesian(_,o[l]),l++,0>d?_.latitude=d:f>0?_.latitude=f:_.latitude=0;for(var m=1;8>m;++m)_.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,_)&&(o[l]=r.cartographicToCartesian(_,o[l]),l++);return 0===_.latitude&&(_.longitude=h,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.longitude=E,o[l]=r.cartographicToCartesian(_,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","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,d,f){"use strict";function E(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=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,N=new e,v=new e,M=new e;E.fromPoints=function(t,n){if(r(n)||(n=new E),!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],R),i=e.clone(a,h),o=e.clone(a,_),u=e.clone(a,m),s=e.clone(a,p),c=e.clone(a,y),l=e.clone(a,T),d=t.length,f=1;d>f;f++){e.clone(t[f],a);var O=a.x,I=a.y,g=a.z;O<i.x&&e.clone(a,i),O>s.x&&e.clone(a,s),I<o.y&&e.clone(a,o),I>c.y&&e.clone(a,c),g<u.z&&e.clone(a,u),g>l.z&&e.clone(a,l)}var w=e.magnitudeSquared(e.subtract(s,i,A)),C=e.magnitudeSquared(e.subtract(c,o,A)),P=e.magnitudeSquared(e.subtract(l,u,A)),x=i,U=s,D=w;C>D&&(D=C,x=o,U=c),P>D&&(D=P,x=u,U=l);var L=S;L.x=.5*(x.x+U.x),L.y=.5*(x.y+U.y),L.z=.5*(x.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,A)),B=Math.sqrt(F),z=N;z.x=i.x,z.y=o.y,z.z=u.z;var b=v;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(z,b,A),.5,M),q=0;for(f=0;d>f;f++){e.clone(t[f],a);var X=e.magnitude(e.subtract(a,G,A));X>q&&(q=X);var W=e.magnitudeSquared(e.subtract(a,L,A));if(W>F){var H=Math.sqrt(W);B=.5*(B+H),F=B*B;var V=H-B;L.x=(B*L.x+V*a.x)/H,L.y=(B*L.y+V*a.y)/H,L.z=(B*L.z+V*a.z)/H}}return q>B?(e.clone(L,n.center),n.radius=B):(e.clone(G,n.center),n.radius=q),n};var O=new o,I=new e,g=new e,w=new t,C=new t;E.fromRectangle2D=function(e,t,n){return E.fromRectangleWithHeights2D(e,t,0,0,n)},E.fromRectangleWithHeights2D=function(t,a,i,o,u){if(r(u)||(u=new E),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=n(a,O),f.southwest(t,w),w.height=i,f.northeast(t,C),C.height=o;var s=a.project(w,I),c=a.project(C,g),l=c.x-s.x,d=c.y-s.y,h=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+h*h);var _=u.center;return _.x=s.x+.5*l,_.y=s.y+.5*d,_.z=s.z+.5*h,u};var P=[];E.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,P)),E.fromPoints(u,o)},E.fromVertices=function(t,a,i,o){if(r(o)||(o=new E),!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=R;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,_),l=e.clone(u,m),d=e.clone(u,p),f=e.clone(u,y),O=e.clone(u,T),I=t.length,g=0;I>g;g+=i){var w=t[g]+a.x,C=t[g+1]+a.y,P=t[g+2]+a.z;u.x=w,u.y=C,u.z=P,w<s.x&&e.clone(u,s),w>d.x&&e.clone(u,d),C<c.y&&e.clone(u,c),C>f.y&&e.clone(u,f),P<l.z&&e.clone(u,l),P>O.z&&e.clone(u,O)}var x=e.magnitudeSquared(e.subtract(d,s,A)),U=e.magnitudeSquared(e.subtract(f,c,A)),D=e.magnitudeSquared(e.subtract(O,l,A)),L=s,F=d,B=x;U>B&&(B=U,L=c,F=f),D>B&&(B=D,L=l,F=O);var z=S;z.x=.5*(L.x+F.x),z.y=.5*(L.y+F.y),z.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,z,A)),G=Math.sqrt(b),q=N;q.x=s.x,q.y=c.y,q.z=l.z;var X=v;X.x=d.x,X.y=f.y,X.z=O.z;var W=e.multiplyByScalar(e.add(q,X,A),.5,M),H=0;for(g=0;I>g;g+=i){u.x=t[g]+a.x,u.y=t[g+1]+a.y,u.z=t[g+2]+a.z;var V=e.magnitude(e.subtract(u,W,A));V>H&&(H=V);var Y=e.magnitudeSquared(e.subtract(u,z,A));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 H>G?(e.clone(z,o.center),o.radius=G):(e.clone(W,o.center),o.radius=H),o},E.fromEncodedCartesianVertices=function(t,n,a){if(r(a)||(a=new E),!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=R;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,_),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,y),d=e.clone(i,T),f=t.length,O=0;f>O;O+=3){var I=t[O]+n[O],g=t[O+1]+n[O+1],w=t[O+2]+n[O+2];i.x=I,i.y=g,i.z=w,I<o.x&&e.clone(i,o),I>c.x&&e.clone(i,c),g<u.y&&e.clone(i,u),g>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>d.z&&e.clone(i,d)}var C=e.magnitudeSquared(e.subtract(c,o,A)),P=e.magnitudeSquared(e.subtract(l,u,A)),x=e.magnitudeSquared(e.subtract(d,s,A)),U=o,D=c,L=C;P>L&&(L=P,U=u,D=l),x>L&&(L=x,U=s,D=d);var F=S;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,F,A)),z=Math.sqrt(B),b=N;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=d.z;var q=e.multiplyByScalar(e.add(b,G,A),.5,M),X=0;for(O=0;f>O;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 W=e.magnitude(e.subtract(i,q,A));W>X&&(X=W);var H=e.magnitudeSquared(e.subtract(i,F,A));if(H>B){var V=Math.sqrt(H);z=.5*(z+V),B=z*z;var Y=V-z;F.x=(z*F.x+Y*i.x)/V,F.y=(z*F.y+Y*i.y)/V,F.z=(z*F.z+Y*i.z)/V}}return X>z?(e.clone(F,a.center),a.radius=z):(e.clone(q,a.center),a.radius=X),a},E.fromCornerPoints=function(t,n,a){r(a)||(a=new E);var i=a.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,n),a},E.fromEllipsoid=function(t,n){return r(n)||(n=new E),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var x=new e;E.fromBoundingSpheres=function(t,n){if(r(n)||(n=new E),!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 E.clone(t[0],n);if(2===a)return E.union(t[0],t[1],n);for(var i=[],o=0;a>o;o++)i.push(t[o].center);n=E.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;a>o;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,x)+c.radius)}return n.radius=s,n};var U=new e,D=new e,L=new e;E.fromOrientedBoundingBox=function(t,n){r(n)||(n=new E);var a=t.halfAxes,i=c.getColumn(a,0,U),o=c.getColumn(a,1,D),u=c.getColumn(a,2,L),s=e.magnitude(i),l=e.magnitude(o),d=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,d),n},E.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new E(t.center,t.radius):void 0},E.packedLength=4,E.pack=function(e,t,r){r=n(r,0);var a=e.center;t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius},E.unpack=function(e,t,a){t=n(t,0),r(a)||(a=new E);var i=a.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],a.radius=e[t],a};var F=new e,B=new e;E.union=function(t,n,a){r(a)||(a=new E);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,F),l=e.magnitude(c);if(o>=l+s)return t.clone(a),a;if(s>=l+o)return n.clone(a),a;var d=.5*(o+l+s),f=e.multiplyByScalar(c,(-o+d)/l,B);return e.add(f,i,f),e.clone(f,a.center),a.radius=d,a};var z=new e;E.expand=function(t,n,r){r=E.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,z));return a>r.radius&&(r.radius=a),r},E.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return-a>o?u.OUTSIDE:a>o?u.INTERSECTING:u.INSIDE},E.transform=function(e,t,n){return r(n)||(n=new E),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var b=new e;E.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,b);return e.magnitudeSquared(r)-t.radius*t.radius},E.transformWithoutScale=function(e,t,n){return r(n)||(n=new E),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;E.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,G),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,X=new e,W=new e,H=new e,V=new e,Y=new t,k=new Array(8),j=0;8>j;++j)k[j]=new e;var Z=new o;return E.projectTo2D=function(t,r,a){r=n(r,Z);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,q),c=e.cross(e.UNIT_Z,s,X);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 d=e.negate(l,V),f=e.negate(c,H),h=k,_=h[0];e.add(s,l,_),e.add(_,c,_),_=h[1],e.add(s,l,_),e.add(_,f,_),_=h[2],e.add(s,d,_),e.add(_,f,_),_=h[3],e.add(s,d,_),e.add(_,c,_),e.negate(s,s),_=h[4],e.add(s,l,_),e.add(_,c,_),_=h[5],e.add(s,l,_),e.add(_,f,_),_=h[6],e.add(s,d,_),e.add(_,f,_),_=h[7],e.add(s,d,_),e.add(_,c,_);for(var m=h.length,p=0;m>p;++p){var y=h[p];e.add(o,y,y);var T=i.cartesianToCartographic(y,Y);r.project(T,y)}a=E.fromPoints(h,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},E.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},E.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},E.prototype.intersectPlane=function(e){return E.intersectPlane(this,e)},E.prototype.distanceSquaredTo=function(e){return E.distanceSquaredTo(this,e)},E.prototype.computePlaneDistances=function(e,t,n){return E.computePlaneDistances(this,e,t,n)},E.prototype.isOccluded=function(e){return E.isOccluded(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.prototype.clone=function(e){return E.clone(this,e)},E}),define("Renderer/WebGLConstants",["../Core/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/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(){return a.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?r.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(r.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",e(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;r>n;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(T)){T=!1;var e=/ Chrome\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(T=!0,R=r(e[1]))}return T}function i(){return a()&&R}function o(){if(!t(A)&&(A=!1,!a()&&/ Safari\/[\.0-9]+/.test(y.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(y.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(y.userAgent);null!==e&&(N=!0,v=r(e[1]),v.isNightly=!!e[2])}return N}function c(){return s()&&v}function l(){if(!t(M)){M=!1;var e;"Microsoft Internet Explorer"===y.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(y.userAgent),null!==e&&(M=!0,O=r(e[1]))):"Netscape"===y.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(y.userAgent),null!==e&&(M=!0,O=r(e[1])))}return M}function d(){return l()&&O}function f(){if(!t(I)){I=!1;var e=/Firefox\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(I=!0,g=r(e[1]))}return I}function E(){return t(w)||(w=/Windows/i.test(y.appVersion)),w}function h(){return f()&&g}function _(){return t(C)||(C="undefined"!=typeof PointerEvent&&(!t(y.pointerEnabled)||y.pointerEnabled)),C}function m(){if(!t(x)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;x=t(n)&&""!==n,x&&(P=n)}return x}function p(){return m()?P:void 0}var y;y="undefined"!=typeof navigator?navigator:{};var T,R,A,S,N,v,M,O,I,g,w,C,P,x,U={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:d,isFirefox:f,firefoxVersion:h,isWindows:E,hardwareConcurrency:e(y.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:m,imageRenderingValue:p};return U.supportsFullscreen=function(){return n.supportsFullscreen()},U.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},U.supportsWebWorkers=function(){return"undefined"!=typeof Worker},U}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,a,i){"use strict";if(!a.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return n(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,n,a,i){switch(a=t(a,0),i=t(i,(n.byteLength-a)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,a,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,a,i);case o.SHORT:return new Int16Array(n,a,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,a,i);case o.FLOAT:return new Float32Array(n,a,i);case o.DOUBLE:return new Float64Array(n,a,i);default:throw new r("componentDatatype is not a valid value.")}},i(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(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/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),d=s*o,f=d*d,E=1-f,h=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*_,N=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,v=e._constants;v.a=n,v.b=r,v.f=a,v.cosineHeading=i,v.sineHeading=o,v.tanU=u,v.cosineU=s,v.sineU=c,v.sigma=l,v.sineAlpha=d,v.sineSquaredAlpha=f,v.cosineSquaredAlpha=E,v.cosineAlpha=h,v.u2Over4=_,v.u4Over16=m,v.u6Over64=p,v.u8Over256=y,v.a0=T,v.a1=R,v.a2=A,v.a3=S,v.distanceRatio=N}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 d(e,t,n,r,a,i,o){var s,c,d,f,E,h=(t-n)/t,_=i-r,m=Math.atan((1-h)*Math.tan(a)),p=Math.atan((1-h)*Math.tan(o)),y=Math.cos(m),T=Math.sin(m),R=Math.cos(p),A=Math.sin(p),S=y*R,N=y*A,v=T*A,M=T*R,O=_,I=u.TWO_PI,g=Math.cos(O),w=Math.sin(O);do{g=Math.cos(O),w=Math.sin(O);var C=N-M*g;d=Math.sqrt(R*R*w*w+C*C),c=v+S*g,s=Math.atan2(d,c);var P;0===d?(P=0,f=1):(P=S*w/d,f=1-P*P),I=O,E=c-2*v/f,isNaN(E)&&(E=0),O=_+l(h,P,f,s,d,c,E)}while(Math.abs(O-I)>u.EPSILON12);var x=f*(t*t-n*n)/(n*n),U=1+x*(4096+x*(x*(320-175*x)-768))/16384,D=x*(256+x*(x*(74-47*x)-128))/1024,L=E*E,F=D*d*(E+D*(c*(2*L-1)-D*E*(4*d*d-3)*(4*L-3)/6)/4),B=n*U*(s-F),z=Math.atan2(R*w,N-M*g),b=Math.atan2(y*w,N*g-M);e._distance=B,e._startHeading=z,e._endHeading=b,e._uSquared=x}function f(n,r,a,i){e.normalize(i.cartographicToCartesian(r,_),h),e.normalize(i.cartographicToCartesian(a,_),_);d(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)&&f(this,e,a,u)}var h=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){f(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),d=Math.sin(4*i),f=Math.sin(6*i),E=Math.sin(8*i),h=i*i,_=i*h,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)*d-h*((y-11*m/2)*c+5*m*d/2)+(29*y/96-29*m/16)*f+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 N=Math.cos(2*a.sigma+R),v=Math.sin(R),M=Math.cos(R),O=a.cosineU*M,I=a.sineU*v,g=Math.atan2(v*a.sineHeading,O-I*a.cosineHeading),w=g-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,v,M,N);return r(n)?(n.longitude=this._start.longitude+w,n.latitude=S,n.height=0,n):new t(this._start.longitude+w,S,0)},E}),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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,0>i?[i,0]:[0,i];var c=r*r,l=4*e*a,d=n(c,-l,t.EPSILON14);if(0>d)return[];var f=-.5*n(r,t.sign(r)*Math.sqrt(d),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,d=u*c,f=u*u,E=s*s,h=o*s-f,_=o*c-u*s,m=u*c-E,p=4*h*m-_*_;if(0>p){var y,T,R;f*d>=l*E?(y=o,T=h,R=-2*u*h+o*_):(y=c,T=m,R=-c*_+2*s*m);var A=0>R?-1:1,S=-A*Math.abs(y)*Math.sqrt(-p);i=-R+S;var N=i/2,v=0>N?-Math.pow(-N,1/3):Math.pow(N,1/3),M=i===S?-v:-T/v;return a=0>=T?v+M:-R/(v*v+M*M+T),f*d>=l*E?[(a-u)/o]:[-c/(a+s)]}var O=h,I=-2*u*h+o*_,g=m,w=-c*_+2*s*m,C=Math.sqrt(p),P=Math.sqrt(3)/2,x=Math.abs(Math.atan2(o*C,-I)/3);a=2*Math.sqrt(-O);var U=Math.cos(x);i=a*U;var D=a*(-U/2-P*Math.sin(x)),L=i+D>2*u?i-u:D-u,F=o,B=L/F;x=Math.abs(Math.atan2(c*C,-w)/3),a=2*Math.sqrt(-g),U=Math.cos(x),i=a*U,D=a*(-U/2-P*Math.sin(x));var z=-c,b=2*s>i+D?i+s:D+s,G=z/b,q=F*b,X=-L*b-F*z,W=L*z,H=(s*X-u*W)/(-u*X+s*q);return H>=B?G>=B?G>=H?[B,H,G]:[B,G,H]:[G,B,H]:G>=B?[H,B,G]:G>=H?[H,G,B]:[G,H,B]}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=0>u?-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,0>u?[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,d=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(d.length>0){var f=-t/4,E=d[d.length-1];if(Math.abs(E)<n.EPSILON14){var h=r.computeRealRoots(1,s,l);if(2===h.length){var _,m=h[0],p=h[1];if(m>=0&&p>=0){var y=Math.sqrt(m),T=Math.sqrt(p);return[f-T,f-y,f+y,f+T]}if(m>=0&&0>p)return _=Math.sqrt(m),[f-_,f+_];if(0>m&&p>=0)return _=Math.sqrt(p),[f-_,f+_]}return[]}if(E>0){var R=Math.sqrt(E),A=(s+E-c/R)/2,S=(s+E+c/R)/2,N=r.computeRealRoots(1,R,A),v=r.computeRealRoots(1,-R,S);return 0!==N.length?(N[0]+=f,N[1]+=f,0!==v.length?(v[0]+=f,v[1]+=f,N[1]<=v[0]?[N[0],N[1],v[0],v[1]]:v[1]<=N[0]?[v[0],v[1],N[0],N[1]]:N[0]>=v[0]&&N[1]<=v[1]?[v[0],N[0],N[1],v[1]]:v[0]>=N[0]&&v[1]<=N[1]?[N[0],v[0],v[1],N[1]]:N[0]>v[0]&&N[0]<v[1]?[v[0],N[0],v[1],N[1]]:[N[0],v[0],N[1],v[1]]):N):0!==v.length?(v[0]+=f,v[1]+=f,v):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,d=i*t+s-4*o,f=c*o-i*a*t+u,E=e.computeRealRoots(1,l,d,f);if(E.length>0){var h,_,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),N=c-4*m,v=c+4*Math.abs(m);if(0>m||N*S>A*v){var M=Math.sqrt(N);h=M/2,_=0===M?0:(t*R-i)/M}else{var O=Math.sqrt(A);h=0===O?0:(t*R-i)/O,_=O/2}var I,g;0===T&&0===h?(I=0,g=0):n.sign(T)===n.sign(h)?(I=T+h,g=m/I):(g=T-h,I=m/g);var w,C;0===R&&0===_?(w=0,C=0):n.sign(R)===n.sign(_)?(w=R+_,C=o/w):(C=R-_,w=o/C);var P=r.computeRealRoots(1,I,w),x=r.computeRealRoots(1,g,C);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,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,d=r*r,f=d*r,E=a*a,h=E*a,_=u*c*d-4*s*f-4*e*l*d+18*e*t*n*f-27*i*d*d+256*o*h+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*d+144*i*n*d)+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,d=u/t,f=s/t,E=0>c?1:0;switch(E+=0>l?E+1:E,E+=0>d?E+1:E,E+=0>f?E+1:E){case 0:return a(c,l,d,f);case 1:return i(c,l,d,f);case 2:return i(c,l,d,f);case 3:return a(c,l,d,f);case 4:return a(c,l,d,f);case 5:return i(c,l,d,f);case 6:return a(c,l,d,f);case 7:return a(c,l,d,f);case 8:return i(c,l,d,f);case 9:return a(c,l,d,f);case 10:return a(c,l,d,f);case 11:return i(c,l,d,f);case 12:return a(c,l,d,f);case 13:return a(c,l,d,f);case 14:return a(c,l,d,f);case 15:return a(c,l,d,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","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(t,r,a,o,u){u=n(u,!1);var s,c,l,d,f,E=t.origin,h=t.direction,_=e.subtract(a,r,m),A=e.subtract(o,r,p),S=e.cross(h,A,y),N=e.dot(_,S);if(u){if(N<i.EPSILON6)return;if(s=e.subtract(E,r,T),l=e.dot(s,S),0>l||l>N)return;if(c=e.cross(s,_,R),d=e.dot(h,c),0>d||l+d>N)return;f=e.dot(A,c)/N}else{if(Math.abs(N)<i.EPSILON6)return;var v=1/N;if(s=e.subtract(E,r,T),l=e.dot(s,S)*v,0>l||l>1)return;if(c=e.cross(s,_,R),d=e.dot(h,c)*v,0>d||l+d>1)return;f=e.dot(A,c)*v}return f}function d(e,t,n,r){var a=t*t-4*e*n;if(!(0>a)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(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),l=e.dot(o,o),f=2*e.dot(o,c),E=e.magnitudeSquared(c)-s,h=d(l,f,E,S);return r(h)?(a.start=h.root0,a.stop=h.root1,a):void 0}function E(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,d=a*a,f=c*c,h=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*f,_=c*(a*E(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),m=t[o.COLUMN0ROW0]*d+t[o.COLUMN2ROW2]*f+a*n.x+r,p=f*E(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),y=c*(a*E(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===p){if(l=u.computeRealRoots(h,_,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 v=y*y,M=p*p,O=h*h,I=y*p,g=O+M,w=2*(_*h+I),C=2*m*h+_*_-M+v,P=2*(m*_-I),x=m*m-v;if(0===g&&0===w&&0===C&&0===P)return T;l=s.computeRealRoots(g,w,C,P,x);var U=l.length;if(0===U)return T;for(var D=0;U>D;++D){var L,F=l[D],B=F*F,z=Math.max(1-B,0),b=Math.sqrt(z);L=i.sign(h)===i.sign(m)?E(h*B+m,_*F,i.EPSILON12):i.sign(m)===i.sign(_*F)?E(h*B,_*F+m,i.EPSILON12):E(h*B+_*F,m,i.EPSILON12);var G=E(p*F,y,i.EPSILON15),q=L*G;0>q?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 _={};_.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(!(0>l))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var m=new e,p=new e,y=new e,T=new e,R=new e;_.rayTriangle=function(t,n,a,i,o,u){var s=l(t,n,a,i,o);if(r(s)&&!(0>s))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new c;_.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 d=l(c,a,i,o,u);return!r(d)||0>d||d>e.distance(t,n)?void 0:(r(s)||(s=new e),e.multiplyByScalar(c.direction,d,s),e.add(c.origin,s,s))};var S={root0:0,root1:0};_.raySphere=function(e,t,n){return n=f(e,t,n),!r(n)||n.stop<0?void 0:(n.start=Math.max(n.start,0),n)};var N=new c;_.lineSegmentSphere=function(t,n,a,i){var o=N,u=e.subtract(n,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=f(o,a,i),!r(i)||i.stop<0||i.start>s?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i)};var v=new e,M=new 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,M),d=e.magnitudeSquared(c),f=e.dot(c,l);if(d>1){if(f>=0)return;var E=f*f;if(r=d-1,a=e.magnitudeSquared(l),i=a*r,i>E)return;if(E>i){o=f*f-i,u=-f+Math.sqrt(o);var h=u/a,_=r/u;return _>h?{start:h,stop:_}:{start:_,stop:h}}var m=Math.sqrt(r/a);return{start:m,stop:m}}return 1>d?(r=d-1,a=e.magnitudeSquared(l),i=a*r,o=f*f-i,u=-f+Math.sqrt(o),{start:0,stop:u/a}):0>f?(a=e.magnitudeSquared(l),{start:0,stop:-f/a}):void 0};var O=new e,I=new e,g=new e,w=new e,C=new e,P=new o,x=new o,U=new o,D=new o,L=new o,F=new o,B=new o,z=new e,b=new e,G=new t;_.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction,s=n.geodeticSurfaceNormal(a,O);if(e.dot(u,s)>=0)return a;var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u,O),d=e.normalize(l,l),f=e.mostOrthogonalAxis(l,w),E=e.normalize(e.cross(f,d,I),I),_=e.normalize(e.cross(d,E,g),g),m=P;m[0]=d.x,m[1]=d.y,m[2]=d.z,m[3]=E.x,m[4]=E.y,m[5]=E.z,m[6]=_.x,m[7]=_.y,m[8]=_.z;var p=o.transpose(m,x),y=o.fromScale(n.radii,U),T=o.fromScale(n.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 A,S,N=o.multiply(o.multiply(p,T,F),R,F),v=o.multiply(o.multiply(N,y,B),m,B),M=o.multiplyByVector(N,a,C),q=h(v,e.negate(M,O),0,0,1),X=q.length;if(X>0){for(var W=e.clone(e.ZERO,b),H=Number.NEGATIVE_INFINITY,V=0;X>V;++V){A=o.multiplyByVector(y,o.multiplyByVector(m,q[V],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,u);k>H&&(H=k,W=e.clone(A,W))}var j=n.cartesianToCartographic(W,G);return H=i.clamp(H,0,1),S=e.magnitude(e.subtract(W,a,w))*Math.sqrt(1-H*H),S=c?-S:S,j.height=S,n.cartographicToCartesian(j,new e)}};var q=new e;return _.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),d=-(a.distance+l)/c;if(!(0>d||d>1))return e.multiplyByScalar(u,d,o),e.add(t,o,o),o}},_.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 d,f;if((1===l||2===l)&&(d=new e,f=new e),1===l){if(u)return _.lineSegmentPlane(t,n,a,d),_.lineSegmentPlane(t,r,a,f),{positions:[t,n,r,d,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return _.lineSegmentPlane(n,r,a,d),_.lineSegmentPlane(n,t,a,f),{positions:[t,n,r,d,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return _.lineSegmentPlane(r,t,a,d),_.lineSegmentPlane(r,n,a,f),{positions:[t,n,r,d,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return _.lineSegmentPlane(n,t,a,d),_.lineSegmentPlane(r,t,a,f),{positions:[t,n,r,d,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return _.lineSegmentPlane(r,n,a,d),_.lineSegmentPlane(t,n,a,f),{positions:[t,n,r,d,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return _.lineSegmentPlane(t,r,a,d),_.lineSegmentPlane(n,r,a,f),{positions:[t,n,r,d,f],indices:[0,1,4,0,4,3,2,3,4]}}},_}),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,d){"use strict";function f(e,t,n){var r=v;r.length=e;var a;if(t===n){for(a=0;e>a;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;e>a;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,w),d=h.numberOfPoints(t,n,r),E=a.cartesianToCartographic(c,M),_=a.cartesianToCartographic(l,O),m=f(d,i,o);C.setEndPoints(E,_);var p=C.surfaceDistance/d,y=s;E.height=i;var T=a.cartographicToCartesian(E,I);e.pack(T,u,y),y+=3;for(var R=1;d>R;R++){var A=C.interpolateUsingSurfaceDistance(R*p,O);A.height=m[R],T=a.cartographicToCartesian(A,I),e.pack(T,u,y),y+=3}return y}var h={};h.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var _=new t;h.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;n>a;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 d(e.ZERO,0),R=new e,A=new d(e.ZERO,0),S=new e,N=new e,v=[],M=new t,O=new t,I=new e,g=new e,w=new e,C=new o;h.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),f=l.multiplyByPointAsVector(s,e.UNIT_Y,y),E=d.fromPointNormal(c,f,T),h=l.multiplyByPointAsVector(s,e.UNIT_X,R),_=d.fromPointNormal(c,h,A),v=1;i.push(e.clone(t[0]));for(var M=i[0],O=t.length,I=1;O>I;++I){var g=t[I];if(d.getPointDistance(_,M)<0||d.getPointDistance(_,g)<0){var w=u.lineSegmentPlane(M,g,E,S);if(r(w)){var C=e.multiplyByScalar(f,5e-9,N);d.getPointDistance(E,M)<0&&e.negate(C,C),i.push(e.add(w,C,new e)),o.push(v+1),e.negate(C,C),i.push(e.add(w,C,new e)),v=1}}i.push(e.clone(t[I])),v++,M=g}o.push(v)}return{positions:i,lengths:o}};var P=c.EPSILON10;return h.removeDuplicates=function(t){var n=t.length;if(2>n)return t;var r,a,i;for(r=1;n>r&&(a=t[r-1],i=t[r],!e.equalsEpsilon(a,i,P));++r);if(r===n)return t;for(var o=t.slice(0,r);n>r;++r)i=t[r],e.equalsEpsilon(a,i,P)||(o.push(e.clone(i)),a=i);return o},h.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0);if(1>o)return[];if(1===o){var d=u.scaleToGeodeticSurface(a[0],g);if(0!==l){var f=u.geodeticSurfaceNormal(d,I);e.multiplyByScalar(f,l,f),e.add(d,f,d)}return[d.x,d.y,d.z]}var _=t.minDistance;if(!r(_)){var m=n(t.granularity,c.RADIANS_PER_DEGREE);_=c.chordLength(m,u.maximumRadius)}var p,y=0;for(p=0;o-1>p;p++)y+=h.numberOfPoints(a[p],a[p+1],_);var T=3*(y+1),R=new Array(T),A=0,S=s(l);for(p=0;o-1>p;p++){var N=a[p],O=a[p+1],w=S?l[p]:l,C=S?l[p+1]:l;A=E(N,O,_,u,w,C,R,A)}v.length=0;var P=a[o-1],x=u.cartesianToCartographic(P,M);x.height=S?l[o-1]:l;var U=u.cartographicToCartesian(x,I);return e.pack(U,R,T-3),R},h.generateCartesianArc=function(t){for(var n=h.generateArc(t),r=n.length/3,a=new Array(r),i=0;r>i;i++)a[i]=e.unpack(n,3*i);return a},h}),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){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},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.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.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,d=t.length,f=1;d>f;f++){var E=t[f],h=E.x,_=E.y,m=E.z;a=Math.min(h,a),s=Math.max(h,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){return n(t)?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):void 0},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:0>s+u?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(r){return i(r)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(a){return i(a)}});return n}function o(){function e(e,t,n){return f(e,t,n)}function n(e){return h(e)}function a(e){return h(i(e))}function u(e){return E(e)}var s,c,l,d,f,E,h;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],d=[],f=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(t){r.progress(t)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),d.push(a),r.promise},E=function(e){return _(d,e),e},h=function(e){return e=t(e),f=e.then,h=t,E=p,_(l,e),d=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){h(e)}var c,l,d,f,E,h,_,m,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),d=[],l=y-c+1,f=[],E=o(),c)for(m=E.progress,_=function(e){f.push(e),--l||(h=_=p,E.reject(f))},h=function(e){d.push(e),--c||(h=_=p,E.resolve(d))},T=0;y>T;++T)T in t&&e(t[T],s,u,m);else E.resolve(d);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),f(e,y).then(t,n,r)}function d(){return f(arguments,y)}function f(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;a>s;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 h(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=d,e.all=l,e.map=f,e.reduce=E,e.any=c,e.some=s,e.chain=h,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(;a>i;++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;o>=i;)if(r=~~((i+o)/2),a=n(e[r],t),0>a)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,d,f){var E,h,_,m,p;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",N=s.length,v=0;s&&N>v;v++)switch(s.charAt(v)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(v+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,0>c&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(d=d?"*"==d?+t[n++]:"*"==d.charAt(0)?+t[d.slice(1,-1)]:+d:"fFeE".indexOf(f)>-1?6:"d"==f?0:void 0,p=r?t[r.slice(0,-1)]:t[n++],f){case"s":return u(String(p),y,c,d,R,S);case"c":return u(String.fromCharCode(+p),y,c,d,R);case"b":return o(p,2,A,y,c,d,R);case"o":return o(p,8,A,y,c,d,R);case"x":return o(p,16,A,y,c,d,R);case"X":return o(p,16,A,y,c,d,R).toUpperCase();case"u":return o(p,10,A,y,c,d,R);case"i":case"d":return E=+p||0,E=Math.round(E-E%1),h=0>E?"-":T,p=h+a(String(Math.abs(E)),d,"0",!1),i(p,h,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return E=+p,h=0>E?"-":T,_=["toExponential","toFixed","toPrecision"]["efg".indexOf(f.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(f)%2],p=h+Math.abs(E)[_](d),i(p,h,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 d(e){T.julianDate=e;var n=_.leapSeconds,r=t(n,T,l);0>r&&(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 f(e,n){T.julianDate=e;var r=_.leapSeconds,a=t(r,T,l);if(0>a&&(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):1>=i?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,0>t&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function h(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,0>r&&(r+=24);var d=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return d>=43200&&(l-=1),[l,d]}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&&d(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})$/,N=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,v=/^(\d{4})-?(\d{2})-?(\d{2})$/,M=/([Z+\-])?(\d{2})?:?(\d{2})?$/,O=/^(\d{2})(\.\d+)?/.source+M.source,I=/^(\d{2}):?(\d{2})(\.\d+)?/.source+M.source,g=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+M.source,w="Invalid ISO 8601 date.";_.fromDate=function(e,t){var n=h(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(E(n[0],n[1],t),d(t),t):new _(n[0],n[1],c.UTC)},_.fromIso8601=function(e,t){e=e.replace(",",".");var n,i,u,s=e.split("T"),l=1,f=1,m=0,T=0,M=0,C=0,P=s[0],x=s[1];if(!r(P))throw new a(w);var U;if(s=P.match(v),null!==s){if(U=P.split("-").length-1,U>0&&2!==U)throw new a(w);n=+s[1],l=+s[2],f=+s[3]}else if(s=P.match(A),null!==s)n=+s[1],l=+s[2];else if(s=P.match(R),null!==s)n=+s[1];else{var D;if(s=P.match(S),null!==s){if(n=+s[1],D=+s[2],u=o(n),1>D||u&&D>366||!u&&D>365)throw new a(w)}else{if(s=P.match(N),null===s)throw new a(w);n=+s[1];var L=+s[2],F=+s[3]||0;if(U=P.split("-").length-1,U>0&&(!r(s[3])&&1!==U||r(s[3])&&2!==U))throw new a(w);var B=new Date(Date.UTC(n,0,4));D=7*L+F-B.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(D),l=i.getUTCMonth()+1,f=i.getUTCDate()}if(u=o(n),1>l||l>12||1>f||(2!==l||!u)&&f>p[l-1]||u&&2===l&&f>y)throw new a(w);var z;if(r(x)){if(s=x.match(g),null!==s){if(U=x.split(":").length-1,U>0&&2!==U&&3!==U)throw new a(w);m=+s[1],T=+s[2],M=+s[3],C=1e3*+(s[4]||0),z=5}else if(s=x.match(I),null!==s){if(U=x.split(":").length-1,U>2)throw new a(w);m=+s[1],T=+s[2],M=60*+(s[3]||0),z=4}else{if(s=x.match(O),null===s)throw new a(w);m=+s[1],T=60*+(s[2]||0),z=3}if(T>=60||M>=61||m>24||24===m&&(T>0||M>0||C>0))throw new a(w);var b=s[z],G=+s[z+1],q=+(s[z+2]||0);switch(b){case"+":m-=G,T-=q;break;case"-":m+=G,T+=q;break;case"Z":break;default:T+=new Date(Date.UTC(n,l-1,f,m,T)).getTimezoneOffset()}}else T+=new Date(n,l-1,f).getTimezoneOffset();var X=60===M;for(X&&M--;T>=60;)T-=60,m++;for(;m>=24;)m-=24,f++;for(i=u&&2===l?y:p[l-1];f>i;)f-=i,l++,l>12&&(l-=12,n++),i=u&&2===l?y:p[l-1];for(;0>T;)T+=60,m--;for(;0>m;)m+=24,f--;for(;1>f;)l--,1>l&&(l+=12,n--),i=u&&2===l?y:p[l-1],f+=i;var W=h(n,l,f,m,T,M,C);return r(t)?(E(W[0],W[1],t),d(t)):t=new _(W[0],W[1],c.UTC),X&&_.addSeconds(t,1,t),t},_.now=function(e){return _.fromDate(new Date,e)};var C=new _(0,0,c.TAI);return _.toGregorianDate=function(e,t){var n=!1,a=f(e,C);r(a)||(_.addSeconds(e,-1,C),a=f(C,C),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 d=4e3*(c+1)/1461001|0;c=c-(1461*d/4|0)+31|0;var E=80*c/2447|0,h=c-(2447*E/80|0)|0;c=E/11|0;var m=E+2-12*c|0,p=100*(l-49)+d+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=h,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(p,m,h,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){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new _(e.dayNumber,e.secondsOfDay,c.TAI):void 0},_.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 0>r&&(r=~r,--r,0>r&&(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)],_}),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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,n,r,a,i){"use strict";function o(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,u=n.headers,s=n.overrideMimeType,c=n.withCredentials;return e(n.url,function(t){var n=e.defer();return o.load(t,r,a,i,u,n,s,c),n.promise})}function u(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function s(e,t){for(var n=u(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 c(e,n){n=t(n,"");var a=e[1],i=!!e[2],o=e[3];switch(n){case"":case"text":return u(i,o);case"arraybuffer":return s(i,o);case"blob":var c=s(i,o);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(u(i,o),a);case"json":return JSON.parse(u(i,o));default:throw new r("Unhandled responseType: "+n)}}var l=/^data:(.*?)(;base64)?,(.*)$/;return o.load=function(e,t,r,o,u,s,d,f){var E=l.exec(e);if(null!==E)return void s.resolve(c(E,t));var h=new XMLHttpRequest;if(n(d)&&n(h.overrideMimeType)&&h.overrideMimeType(d),h.open(r,e,!0),n(u))for(var _ in u)u.hasOwnProperty(_)&&h.setRequestHeader(_,u[_]);n(t)&&(h.responseType=t),n(f)&&(h.withCredentials=f),h.onload=function(){h.status>=200&&h.status<300?n(h.response)?s.resolve(h.response):n(h.responseXML)&&h.responseXML.hasChildNodes()?s.resolve(h.responseXML):n(h.responseText)?s.resolve(h.responseText):s.reject(new i("unknown XMLHttpRequest response type.")):s.reject(new a(h.status,h.response,h.getAllResponseHeaders()))},h.onerror=function(e){s.reject(new a)},h.send(o)},o.defaultLoad=o.load,o}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";function n(n,r){return e({url:n,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return n}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)||(a={}),t(a.headers)?t(a.headers.Accept)||(a.headers=e(a.headers),a.headers.Accept=i.Accept):a.headers=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,d){"use strict";function f(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))h(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){h(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else h(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function E(e,t){return o.compare(e.julianDate,t)}function h(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"),f=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),h=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),_=n.columnNames.indexOf("taiMinusUtcSeconds");if(0>a||0>i||0>s||0>c||0>f||0>h||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=f,e._yCelestialPoleOffsetRadiansColumn=h,e._taiMinusUtcSecondsColumn=_,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=m.length;A>R;R+=e._columnCount){var S=m[R+a],N=m[R+_],v=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,M=new o(v,N,d.TAI);if(p.push(M),T){if(N!==y&&r(y)){var O=o.leapSeconds,I=t(O,M,E);if(0>I){var g=new u(M,N);O.splice(~I,0,g)}}y=N}}}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 d=o.secondsDifference(r,c)/o.secondsDifference(l,c),f=a*s,E=i*s,h=n[f+e._ut1MinusUtcSecondsColumn],p=n[E+e._ut1MinusUtcSecondsColumn],y=p-h;if(y>.5||-.5>y){var T=n[f+e._taiMinusUtcSecondsColumn],R=n[E+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?h=p:p-=R-T)}return u.xPoleWander=m(d,n[f+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),u.yPoleWander=m(d,n[f+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),u.xPoleOffset=m(d,n[f+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=m(d,n[f+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=m(d,h,p),u}return f.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}}),f.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},f.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 d=i[u],f=i[u+1],E=o.lessThanOrEquals(d,e),h=!r(f),_=h||o.greaterThanOrEquals(f,e);if(E&&_)return s=u,!h&&f.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,0>s&&(s=0)),this._lastIndex=s,p(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},f}),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/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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","require"],function(e,t,n,r,a){"use strict";function i(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function o(){if(t(l))return l;var a;if(a="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:i(),!t(a))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new e(r(a))}function u(e){return a.toUrl("../"+e)}function s(t){return new e(t).resolve(o()).toString()}function c(e){t(d)||(d=t(a.toUrl)?u:s),t(f)||(f=document.createElement("a"));var n=d(e);return f.href=n,f.href=f.href,f.href}var l,d,f,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=E,c.setBaseUrl=function(t){l=new e(t).resolve(new e(document.location.href))},c}),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;t>=s;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;t>=c;++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=d;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;s>u;++u)t[o+u]=r[u];i.resolve()}),i.promise}var d=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;0>u&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var d=u/this._samplesPerXysFile|0,f=s/this._samplesPerXysFile|0,E=[],h=d;f>=h;++h)E.push(l(this,h));return e.all(E)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(0>i)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);0>s&&(s=0);var d=s+u;d>=this._totalSamples&&(d=this._totalSamples-1,s=d-u,0>s&&(s=0));var f=!1,E=this._samples;if(r(E[3*s])||(l(this,s/this._samplesPerXysFile|0),f=!0),r(E[3*d])||(l(this,d/this._samplesPerXysFile|0),f=!0),!f){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var h,_,m=i-s*this._stepSizeDays,p=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(h=0;u>=h;++h)p[h]=m-R[h];for(h=0;u>=h;++h){for(T[h]=1,_=0;u>=_;++_)_!==h&&(T[h]*=p[_]);T[h]*=y[h];var A=3*(s+h); +n.x+=T[h]*E[A++],n.y+=T[h]*E[A++],n.s+=T[h]*E[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,d=c.z*o,f=Math.cos(i);return n(a)?(a.x=u,a.y=l,a.z=d,a.w=f,a):new s(u,l,d,f)};var l=[1,2,0],d=new Array(3);s.fromRotationMatrix=function(e,t){var r,a,i,o,c,f=e[u.COLUMN0ROW0],E=e[u.COLUMN1ROW1],h=e[u.COLUMN2ROW2],_=f+E+h;if(_>0)r=Math.sqrt(_+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,p=0;E>f&&(p=1),h>f&&h>E&&(p=2);var y=m[p],T=m[y];r=Math.sqrt(e[u.getElementIndex(p,p)]-e[u.getElementIndex(y,y)]-e[u.getElementIndex(T,T)]+1);var R=d;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 f=new s;s.fromHeadingPitchRoll=function(t,n,r,a){var i=s.fromAxisAngle(e.UNIT_X,r,f),o=s.fromAxisAngle(e.UNIT_Y,-n,a);a=s.multiply(o,i,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,f);return s.multiply(u,a,a)};var E=new e,h=new e,_=new s,m=new s,p=new s;s.packedLength=4,s.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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;i>a;a++){var o=3*a;s.unpack(e,4*(t+a),_),s.multiply(_,p,_),_.w<0&&s.negate(_,_),s.computeAxis(_,E);var u=s.computeAngle(_);r[o]=E.x*u,r[o+1]=E.y*u,r[o+2]=E.z*u}},s.unpackInterpolationResult=function(t,r,a,i,o){n(o)||(o=new s),e.fromArray(t,0,h);var u=e.magnitude(h);return s.unpack(r,4*i,m),0===u?s.clone(s.IDENTITY,_):s.fromAxisAngle(h,u,_),s.multiply(_,m,o)},s.clone=function(e,t){return n(e)?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):void 0},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,d=o*u+r*l+a*c-i*s,f=o*s-r*c+a*l+i*u,E=o*c+r*s-a*u+i*l,h=o*l-r*u-a*s-i*c;return n.x=d,n.y=f,n.z=E,n.w=h,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(0>a&&(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,v=new s,M=new s;s.computeInnerQuadrangle=function(t,n,r,a){var i=s.conjugate(n,v);s.multiply(i,r,M);var o=s.log(M,S);s.multiply(i,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,v),s.multiply(n,v,a)},s.squad=function(e,t,n,r,a,i){var o=s.slerp(e,t,a,v),u=s.slerp(n,r,a,M);return s.slerp(o,u,2*a*(1-a),i)};for(var O=new s,I=1.9011074535173003,g=a.supportsTypedArrays()?new Float32Array(8):[],w=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],P=a.supportsTypedArrays()?new Float32Array(8):[],x=0;7>x;++x){var U=x+1,D=2*U+1;g[x]=1/(U*D),w[x]=U/D}return g[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,d=7;d>=0;--d)C[d]=(g[d]*c-w[d])*o,P[d]=(g[d]*l-w[d])*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])))))))),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])))))))),h=s.multiplyByScalar(e,E,O);return s.multiplyByScalar(t,f,r),s.add(h,r,r)},s.fastSquad=function(e,t,n,r,a,i){var o=s.fastSlerp(e,t,a,v),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","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,E,h,_,m,p){"use strict";var y={},T=new n,R=new n,A=new n;y.eastNorthUpToFixedFrame=function(e,t,r){if(E.equalsEpsilon(e.x,0,E.EPSILON14)&&E.equalsEpsilon(e.y,0,E.EPSILON14)){var o=E.sign(e.z);return i(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=T,s=R,l=A;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.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,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var S=new n,N=new n,v=new n;y.northEastDownToFixedFrame=function(e,t,r){if(E.equalsEpsilon(e.x,0,E.EPSILON14)&&E.equalsEpsilon(e.y,0,E.EPSILON14)){var o=E.sign(e.z);return i(r)?(r[0]=-o,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]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=S,s=N,l=v;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.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 _(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},y.northUpEastToFixedFrame=function(e,t,r){if(E.equalsEpsilon(e.x,0,E.EPSILON14)&&E.equalsEpsilon(e.y,0,E.EPSILON14)){var o=E.sign(e.z);return i(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=o,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 _(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=T,s=R,l=A;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(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 _(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 M=new m,O=new n(1,1,1),I=new _;y.headingPitchRollToFixedFrame=function(e,t,r,a,i,o){var u=m.fromHeadingPitchRoll(t,r,a,M),s=_.fromTranslationQuaternionRotationScale(n.ZERO,u,O,I);return o=y.eastNorthUpToFixedFrame(e,i,o),_.multiply(o,s,o)};var g=new _,w=new h;y.headingPitchRollQuaternion=function(e,t,n,r,a,i){var o=y.headingPitchRollToFixedFrame(e,t,n,r,a,g),u=_.getRotation(o,w);return m.fromRotationMatrix(u,i)};var C=24110.54841,P=8640184.812866,x=.093104,U=-62e-7,D=1.1772758384668e-19,L=72921158553e-15,F=E.TWO_PI/86400,B=new f;y.computeTemeToPseudoFixedMatrix=function(e,t){B=f.addSeconds(e,-f.computeTaiMinusUtc(e),B);var n,r=B.dayNumber,a=B.secondsOfDay,o=r-2451545;n=a>=43200?(o+.5)/p.DAYS_PER_JULIAN_CENTURY:(o-.5)/p.DAYS_PER_JULIAN_CENTURY;var u=C+n*(P+n*(x+n*U)),s=u*F%E.TWO_PI,c=L+D*(r-2451545.5),l=(a+.5*p.SECONDS_PER_DAY)%p.SECONDS_PER_DAY,d=s+c*l,_=Math.cos(d),m=Math.sin(d);return i(t)?(t[0]=_,t[1]=-m,t[2]=0,t[3]=m,t[4]=_,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new h(_,m,0,-m,_,0,0,0,1)},y.iau2006XysData=new l,y.earthOrientationParameters=u.NONE;var z=32.184,b=2451545;y.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+z,a=t.stop.dayNumber,i=t.stop.secondsOfDay+z,o=y.iau2006XysData.preload(n,r,a,i),u=y.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},y.computeIcrfToFixedMatrix=function(e,t){i(t)||(t=new h);var n=y.computeFixedToIcrfMatrix(e,t);if(i(n))return h.transpose(n,t)};var G=new d(0,0,0),q=new s(0,0,0,0,0,0),X=new h,W=new h;y.computeFixedToIcrfMatrix=function(e,t){i(t)||(t=new h);var n=y.earthOrientationParameters.compute(e,q);if(i(n)){var r=e.dayNumber,a=e.secondsOfDay+z,o=y.iau2006XysData.computeXysRadians(r,a,G);if(i(o)){var u=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=X;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 d=h.fromRotationZ(-o.s,W),_=h.multiply(l,d,X),m=e.dayNumber,T=e.secondsOfDay-f.computeTaiMinusUtc(e)+n.ut1MinusUtc,R=m-2451545,A=T/p.SECONDS_PER_DAY,S=.779057273264+A+.00273781191135448*(R+A);S=S%1*E.TWO_PI;var N=h.fromRotationZ(S,W),v=h.multiply(_,N,X),M=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),I=Math.sin(n.xPoleWander),g=Math.sin(n.yPoleWander),w=r-b+a/p.SECONDS_PER_DAY;w/=36525;var C=-47e-6*w*E.RADIANS_PER_DEGREE/3600,P=Math.cos(C),x=Math.sin(C),U=W;return U[0]=M*P,U[1]=M*x,U[2]=I,U[3]=-O*x+g*I*P,U[4]=O*P+g*I*x,U[5]=-g*M,U[6]=-g*x-O*I*P,U[7]=g*P-O*I*x,U[8]=O*M,h.multiply(v,U,t)}}};var H=new r;y.pointToWindowCoordinates=function(e,t,n,r){return r=y.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},y.pointToGLWindowCoordinates=function(e,n,a,o){i(o)||(o=new t);var u=H;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,o)};var V=new n,Y=new n,k=new n;return y.rotationMatrixFromPositionVelocity=function(e,t,r,o){var u=a(r,c.WGS84).geodeticSurfaceNormal(e,V),s=n.cross(t,u,Y);n.equalsEpsilon(s,n.ZERO,E.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var l=n.cross(s,t,k);return n.cross(t,l,s),n.negate(s,s),i(o)||(o=new h),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=s.x,o[4]=s.y,o[5]=s.z,o[6]=l.x,o[7]=l.y,o[8]=l.z,o},y}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix3","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,E,h){"use strict";function _(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(d.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(d.getColumn(r,1,m));var i=n.fromCartesian4(d.getColumn(r,2,m));this._plane=f.fromPointNormal(e,i)}var m=new r;o(_.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;_.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new _(r.center,n)};var y=new E,T=new n;_.prototype.projectPointOntoPlane=function(e,r){var a=y;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,T);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,T)),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)}},_.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;r>a;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},_.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,T);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,T));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},_.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;n>r;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var R=new n;return _.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=R,l=0;r>l;++l){var d=e[l];n.multiplyByScalar(u,d.x,c),i(t[l])||(t[l]=new n);var f=n.add(o,c,t[l]);n.multiplyByScalar(s,d.y,c),n.add(f,c,f),a.scaleToGeocentricSurface(f,f)}return t},_}),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,d){"use strict";function f(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 E(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;c>i;i++)l[i]=n;return l.push(r),l}var d=r-n,f=d/c;for(i=1;c>i;i++){var E=n+i*f;l[i]=E}return l[0]=n,l.push(r),l}function h(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 f=b,E=G;L=d.eastNorthUpToFixedFrame(e,i,L),f=s.multiplyByPointAsVector(L,D,f),f=t.normalize(f,f);var _=h(f,n,e,i);B=u.fromRotationZ(_,B),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(B,q,F),L);var m=z;m[0]=c;for(var p=0;l>p;p++)for(var y=0;y<r.length;y+=3)E=t.fromArray(r,y,E),E=u.multiplyByVector(m,E,E),E=s.multiplyByPoint(L,E,E),a.push(E.x,E.y,E.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,X);a=_(c,n,r,a,i,o[s/3],u,1)}return a}function p(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;n>s;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;n>u;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,d,f,E,h){var m,p=t.angleBetween(t.subtract(n,e,C),t.subtract(r,e,P)),y=i===a.BEVELED?0:Math.ceil(p/o.toRadians(5));m=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,C),p/(y+1),W),V):u.fromQuaternion(l.fromAxisAngle(e,p/(y+1),W),V);var T,R;if(n=t.clone(n,H),y>0)for(var A=h?2:1,S=0;y>S;S++)n=u.multiplyByVector(m,n,n),T=t.subtract(n,e,C),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,P),d=_(R,T,f,d,c,E,1,A);else T=t.subtract(n,e,C),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,P),d=_(R,T,f,d,c,E,1,1),r=t.clone(r,H),T=t.subtract(r,e,C),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(r,P),d=_(R,T,f,d,c,E,1,1);return d}var R=[new t,new t],A=new t,S=new t,N=new t,v=new t,M=new t,O=new t,I=new t,g=new t,w=new t,C=new t,P=new t,x={},U=new r,D=new t(-1,0,0),L=new s,F=new s,B=new u,z=u.IDENTITY.clone(),b=new t,G=new n,q=new t,X=new t,W=new l,H=new t,V=new u;x.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;n>i;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;x.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 j=new t,Z=new t;return x.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=f(e,s),d=i._granularity,h=i._cornerType,P=u?p(n,r):y(n,r),U=u?y(n,r):void 0,D=r.height/2,L=r.width/2,F=e.length,B=[],z=u?[]:void 0,b=A,G=S,q=N,X=v,W=M,H=O,V=I,Y=g,k=w,K=e[0],J=e[1];X=s.geodeticSurfaceNormal(K,X),b=t.subtract(J,K,b),b=t.normalize(b,b),Y=t.cross(X,b,Y),Y=t.normalize(Y,Y);var Q=l[0],$=l[1];u&&(z=_(K,Y,U,z,s,Q+D,1,1)),k=t.clone(K,k),K=J,G=t.negate(b,G);for(var ee,te,ne=1;F-1>ne;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),X=s.geodeticSurfaceNormal(K,X);var ae=t.multiplyByScalar(X,t.dot(b,X),j);t.subtract(b,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(X,t.dot(G,X),Z);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,X,q),q=t.cross(X,q,q),q=t.normalize(q,q);var ue=1/Math.max(.25,t.magnitude(t.cross(q,G,C))),se=x.angleIsGreaterThanPi(b,G,K,s);se?(W=t.add(K,t.multiplyByScalar(q,ue*L,q),W),H=t.add(W,t.multiplyByScalar(Y,L,H),H),R[0]=t.clone(k,R[0]),R[1]=t.clone(H,R[1]),ee=E(R,Q+D,$+D,d),te=c.generateArc({positions:R,granularity:d,ellipsoid:s}),B=m(te,Y,P,B,s,ee,1),Y=t.cross(X,b,Y),Y=t.normalize(Y,Y),V=t.add(W,t.multiplyByScalar(Y,L,V),V),h===a.ROUNDED||h===a.BEVELED?T(W,H,V,h,se,s,B,P,$+D,u):(q=t.negate(q,q),B=_(K,q,P,B,s,$+D,ue,re)),k=t.clone(V,k)):(W=t.add(K,t.multiplyByScalar(q,ue*L,q),W),H=t.add(W,t.multiplyByScalar(Y,-L,H),H),R[0]=t.clone(k,R[0]),R[1]=t.clone(H,R[1]),ee=E(R,Q+D,$+D,d),te=c.generateArc({positions:R,granularity:d,ellipsoid:s}),B=m(te,Y,P,B,s,ee,1),Y=t.cross(X,b,Y),Y=t.normalize(Y,Y),V=t.add(W,t.multiplyByScalar(Y,-L,V),V),h===a.ROUNDED||h===a.BEVELED?T(W,H,V,h,se,s,B,P,$+D,u):B=_(K,q,P,B,s,$+D,ue,re),k=t.clone(V,k)),G=t.negate(b,G)}else B=_(k,Y,P,B,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=E(R,Q+D,$+D,d),te=c.generateArc({positions:R,granularity:d,ellipsoid:s}),B=m(te,Y,P,B,s,ee,1),u&&(z=_(K,Y,U,z,s,$+D,1,1)),F=B.length;var ce=u?F+z.length:F,le=new Float64Array(ce);return le.set(B),u&&le.set(z,F),le},x}),define("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./isArray","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(n,r,o,u,c){var l=e.angleBetween(e.subtract(r,n,_),e.subtract(o,n,m)),d=u===t.BEVELED?1:Math.ceil(l/a.toRadians(5))+1,f=3*d,E=new Array(f);E[f-3]=o.x,E[f-2]=o.y,E[f-1]=o.z;var h;h=c?i.fromQuaternion(s.fromAxisAngle(e.negate(n,_),l/d,C),P):i.fromQuaternion(s.fromAxisAngle(n,l/d,C),P);var p=0;r=e.clone(r,_);for(var y=0;d>y;y++)r=i.multiplyByVector(h,r,r),E[p++]=r.x,E[p++]=r.y,E[p++]=r.z;return E}function l(n){var r=R,a=A,i=S,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=c(r,a,i,t.ROUNDED,!1),s=n.length-1,l=n[s-1];o=n[s],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 d=c(r,a,i,t.ROUNDED,!1);return[u,d]}function d(t,n,r,a){var i=_;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,_),s=e.negate(u,m),c=0,l=t.length-1,d=0;d<t.length;d+=3){var f=e.fromArray(t,d,p),E=e.add(f,s,y);i[c++]=E.x,i[c++]=E.y,i[c++]=E.z;var h=e.add(f,u,y);o[l--]=h.z,o[l--]=h.y,o[l--]=h.x}return a.push(i,o),a}function E(e,t){for(var n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}var h={},_=new e,m=new e,p=new e,y=new e,T=[new e,new e],R=new e,A=new e,S=new e,N=new e,v=new e,M=new e,O=new e,I=new e,g=new e,w=new e,C=new s,P=new i;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 x=new e,U=new e;h.computePositions=function(n){var r=n.granularity,i=n.positions,s=n.ellipsoid;i=E(i,s);var h=n.width/2,m=n.cornerType,p=n.saveAttributes,y=R,C=A,P=S,D=N,L=v,F=M,B=O,z=I,b=g,G=w,q=[],X=p?[]:void 0,W=p?[]:void 0,H=i[0],V=i[1];C=e.normalize(e.subtract(V,H,C),C),y=s.geodeticSurfaceNormal(H,y),D=e.normalize(e.cross(y,C,D),D),p&&(X.push(D.x,D.y,D.z),W.push(y.x,y.y,y.z)),B=e.clone(H,B),H=V,P=e.negate(C,P);var Y,k,j=[],Z=i.length;for(k=1;Z-1>k;k++){y=s.geodeticSurfaceNormal(H,y),V=i[k+1],C=e.normalize(e.subtract(V,H,C),C),L=e.normalize(e.add(C,P,L),L);var K=e.multiplyByScalar(y,e.dot(C,y),x);e.subtract(C,K,K),e.normalize(K,K);var J=e.multiplyByScalar(y,e.dot(P,y),U);e.subtract(P,J,J),e.normalize(J,J);var Q=!a.equalsEpsilon(Math.abs(e.dot(K,J)),1,a.EPSILON7);if(Q){L=e.cross(L,y,L),L=e.cross(y,L,L),L=e.normalize(L,L);var $=h/Math.max(.25,e.magnitude(e.cross(L,P,_))),ee=u.angleIsGreaterThanPi(C,P,H,s);L=e.multiplyByScalar(L,$,L),ee?(z=e.add(H,L,z),G=e.add(z,e.multiplyByScalar(D,h,G),G),b=e.add(z,e.multiplyByScalar(D,2*h,b),b),T[0]=e.clone(B,T[0]),T[1]=e.clone(G,T[1]),Y=o.generateArc({positions:T,granularity:r,ellipsoid:s}),q=f(Y,D,h,q),p&&(X.push(D.x,D.y,D.z),W.push(y.x,y.y,y.z)),F=e.clone(b,F),D=e.normalize(e.cross(y,C,D),D),b=e.add(z,e.multiplyByScalar(D,2*h,b),b),B=e.add(z,e.multiplyByScalar(D,h,B),B),m===t.ROUNDED||m===t.BEVELED?j.push({leftPositions:c(z,F,b,m,ee)}):j.push({leftPositions:d(H,e.negate(L,L),b,ee)})):(b=e.add(H,L,b),G=e.add(b,e.negate(e.multiplyByScalar(D,h,G),G),G),z=e.add(b,e.negate(e.multiplyByScalar(D,2*h,z),z),z),T[0]=e.clone(B,T[0]),T[1]=e.clone(G,T[1]),Y=o.generateArc({positions:T,granularity:r,ellipsoid:s}),q=f(Y,D,h,q),p&&(X.push(D.x,D.y,D.z),W.push(y.x,y.y,y.z)),F=e.clone(z,F),D=e.normalize(e.cross(y,C,D),D),z=e.add(b,e.negate(e.multiplyByScalar(D,2*h,z),z),z),B=e.add(b,e.negate(e.multiplyByScalar(D,h,B),B),B),m===t.ROUNDED||m===t.BEVELED?j.push({rightPositions:c(b,F,z,m,ee)}):j.push({rightPositions:d(H,L,z,ee)})),P=e.negate(C,P)}H=V}y=s.geodeticSurfaceNormal(H,y),T[0]=e.clone(B,T[0]),T[1]=e.clone(H,T[1]),Y=o.generateArc({positions:T,granularity:r,ellipsoid:s}),q=f(Y,D,h,q),p&&(X.push(D.x,D.y,D.z),W.push(y.x,y.y,y.z));var te;return m===t.ROUNDED&&(te=l(q)),{positions:q,corners:j,lefts:X,normals:W,endPositions:te}};var D=new e,L=new e;return h.scaleToGeodeticHeight=function(t,n,a,i){var o=t.length,u=r(i)?i:new Array(t.length);u.length=t.length;for(var s=n,c=0;o>c;c+=3){var l=a.scaleToGeodeticSurface(e.fromArray(t,c,L),L),d=D;0!==n&&(d=a.geodeticSurfaceNormal(l,d),d=e.multiplyByScalar(d,s,d),l=e.add(l,d,l)),u[c]=l.x,u[c+1]=l.y,u[c+2]=l.z}return u},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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(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=void 0}return i.computeNumberOfVertices=function(e){var r=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,r){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,r):new Uint16Array(t,n,r)},r(i)}),define("Core/CorridorOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,E,h,_){"use strict";function m(e,i){var u,s,c,E=[],h=e.positions,_=e.corners,m=e.endPositions,p=new d,y=0,S=0,N=0;for(s=0;s<h.length;s+=2)c=h[s].length-3,y+=c,N+=c/3*4,S+=h[s+1].length-3;for(y+=3,S+=3,s=0;s<_.length;s++){u=_[s];var v=_[s].leftPositions;o(v)?(c=v.length,y+=c,N+=c/3*2):(c=_[s].rightPositions.length,S+=c,N+=c/3*2)}var M,O=o(m);O&&(M=m[0].length-3,y+=M,S+=M,M/=3,N+=4*M);var I,g,w,C,P,x,U=y+S,D=new Float64Array(U),L=0,F=U-1,B=M/2,z=f.createTypedArray(U/3,N+4),b=0;if(z[b++]=L/3,z[b++]=(F-2)/3,O){E.push(L/3),x=T,P=R;var G=m[0];for(s=0;B>s;s++)x=t.fromArray(G,3*(B-1-s),x),P=t.fromArray(G,3*(B+s),P),a.addAttribute(D,P,L),a.addAttribute(D,x,void 0,F),g=L/3,C=g+1,I=(F-2)/3,w=I-1,z[b++]=I,z[b++]=w,z[b++]=g,z[b++]=C,L+=3,F-=3}var q=0,X=h[q++],W=h[q++];for(D.set(X,L),D.set(W,F-W.length+1),c=W.length-3,E.push(L/3,(F-2)/3),s=0;c>s;s+=3)g=L/3,C=g+1,I=(F-2)/3,w=I-1,z[b++]=I,z[b++]=w,z[b++]=g,z[b++]=C,L+=3,F-=3;for(s=0;s<_.length;s++){var H;u=_[s];var V,Y=u.leftPositions,k=u.rightPositions,j=A;if(o(Y)){for(F-=3,V=w,E.push(C),H=0;H<Y.length/3;H++)j=t.fromArray(Y,3*H,j),z[b++]=V-H-1,z[b++]=V-H,a.addAttribute(D,j,void 0,F),F-=3;E.push(V-Math.floor(Y.length/6)),i===r.BEVELED&&E.push((F-2)/3+1),L+=3}else{for(L+=3,V=C,E.push(w),H=0;H<k.length/3;H++)j=t.fromArray(k,3*H,j),z[b++]=V+H,z[b++]=V+H+1,a.addAttribute(D,j,L),L+=3;E.push(V+Math.floor(k.length/6)),i===r.BEVELED&&E.push(L/3-1),F-=3}for(X=h[q++],W=h[q++],X.splice(0,3),W.splice(W.length-3,3),D.set(X,L),D.set(W,F-W.length+1),c=W.length-3,H=0;H<W.length;H+=3)C=L/3,g=C-1,w=(F-2)/3,I=w+1,z[b++]=I,z[b++]=w,z[b++]=g,z[b++]=C,L+=3,F-=3;L-=3,F+=3,E.push(L/3,(F-2)/3)}if(O){L+=3,F-=3,x=T,P=R;var Z=m[1];for(s=0;B>s;s++)x=t.fromArray(Z,3*(M-s-1),x),P=t.fromArray(Z,3*s,P),a.addAttribute(D,x,void 0,F),a.addAttribute(D,P,L),C=L/3,g=C-1,w=(F-2)/3,I=w+1,z[b++]=I,z[b++]=w,z[b++]=g,z[b++]=C,L+=3,F-=3;E.push(L/3)}else E.push(L/3,(F-2)/3);return z[b++]=L/3,z[b++]=(F-2)/3,p.position=new l({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:D}),{attributes:p,indices:z,wallIndices:E}}function p(e){var t=e.ellipsoid,n=a.computePositions(e),r=m(n,e.cornerType),i=r.wallIndices,o=e.height,u=e.extrudedHeight,s=r.attributes,c=r.indices,l=s.position.values,d=l.length,E=new Float64Array(d);E.set(l);var h=new Float64Array(2*d);l=a.scaleToGeodeticHeight(l,o,t,l),E=a.scaleToGeodeticHeight(E,u,t,E),h.set(l),h.set(E,d),s.position.values=h,d/=3;var _,p=c.length,y=f.createTypedArray(h.length/3,2*(p+i.length));y.set(c);var T=p;for(_=0;p>_;_+=2){var R=c[_],A=c[_+1];y[T++]=R+d,y[T++]=A+d}var S,N;for(_=0;_<i.length;_++)S=i[_],N=S+d,y[T++]=S,y[T++]=N;return{attributes:s,indices:y}}function y(e){e=i(e,i.EMPTY_OBJECT);var n=e.positions,a=e.width;this._positions=n,this._ellipsoid=s.clone(i(e.ellipsoid,s.WGS84)),this._width=a,this._height=i(e.height,0),this._extrudedHeight=i(e.extrudedHeight,this._height),this._cornerType=i(e.cornerType,r.ROUNDED),this._granularity=i(e.granularity,E.RADIANS_PER_DEGREE),this._workerName="createCorridorOutlineGeometry",this.packedLength=1+n.length*t.packedLength+s.packedLength+5}var T=new t,R=new t,A=new t;y.pack=function(e,n,r){r=i(r,0);var a=e._positions,o=a.length;n[r++]=o;for(var u=0;o>u;++u,r+=t.packedLength)t.pack(a[u],n,r);s.pack(e._ellipsoid,n,r),r+=s.packedLength,n[r++]=e._width,n[r++]=e._height,n[r++]=e._extrudedHeight,n[r++]=e._cornerType,n[r]=e._granularity};var S=s.clone(s.UNIT_SPHERE),N={positions:void 0,ellipsoid:S,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return y.unpack=function(e,n,r){n=i(n,0);for(var a=e[n++],u=new Array(a),c=0;a>c;++c,n+=t.packedLength)u[c]=t.unpack(e,n);var l=s.unpack(e,n,S);n+=s.packedLength;var d=e[n++],f=e[n++],E=e[n++],h=e[n++],_=e[n];return o(r)?(r._positions=u,r._ellipsoid=s.clone(l,r._ellipsoid),r._width=d,r._height=f,r._extrudedHeight=E,r._cornerType=h,r._granularity=_,r):(N.positions=u,N.width=d,N.height=f,N.extrudedHeight=E,N.cornerType=h,N.granularity=_,new y(N))},y.createGeometry=function(t){var n=t._positions,r=t._height,i=t._extrudedHeight,o=r!==i,u=h.removeDuplicates(n);if(!(u.length<2)){var s,l=t._ellipsoid,d={ellipsoid:l,positions:u,width:t._width,cornerType:t._cornerType,granularity:t._granularity,saveAttributes:!1};if(o){var f=Math.max(r,i);i=Math.min(r,i),r=f,d.height=r,d.extrudedHeight=i,s=p(d)}else{var E=a.computePositions(d);s=m(E,d.cornerType),s.attributes.position.values=a.scaleToGeodeticHeight(s.attributes.position.values,r,l,s.attributes.position.values)}var y=s.attributes,T=e.fromVertices(y.position.values,void 0,3);return new c({attributes:y,indices:s.indices,primitiveType:_.LINES,boundingSphere:T})}},y}),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/Workers/createCylinderGeometry.js b/Workers/createCylinderGeometry.js index a822cc4..f8e9dc6 100644 --- a/Workers/createCylinderGeometry.js +++ b/Workers/createCylinderGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -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";var t=function(t){return void 0!==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";var e=function(t,e){return void 0!==t?t:e};return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";var e=function(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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("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^=2636928640&t<<7,t^=4022730752&t<<15,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){"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(t){return t>0?1:0>t?-1:0},n.signNotZero=function(t){return 0>t?-1:1},n.toSNorm=function(t){return Math.round(255*(.5*n.clamp(t,-1,1)+.5))},n.fromSNorm=function(t){return 2*(n.clamp(t,0,255)/255)-1},n.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},n.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},n.lerp=function(t,e,n){return(1-n)*t+n*e},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(t){return t*n.RADIANS_PER_DEGREE},n.toDegrees=function(t){return t*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(t){var e=n.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},n.negativePiToPi=function(t){for(var e=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+e)>t;)t+=i;if(-r>t)return-r;for(;t>r+e;)t-=i;return t>r?r:t},n.zeroToTwoPi=function(t){var e=t%n.TWO_PI;return 0>e?(e+n.TWO_PI)%n.TWO_PI:e},n.equalsEpsilon=function(t,n,r){return r=e(r,0),Math.abs(t-n)<=r};var r=[1];n.factorial=function(t){var e=r.length;if(t>=e)for(var n=r[e-1],i=e;t>=i;i++)r.push(n*i);return r[t]},n.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},n.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},n.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},n.clamp=function(t,e,n){return e>t?e:t>n?n:t};var i=new t;return n.setRandomNumberSeed=function(e){i=new t(e)},n.nextRandomNumber=function(){return i.random()},n.acosClamped=function(t){return Math.acos(n.clamp(t,-1,1))},n.asinClamped=function(t){return Math.asin(n.clamp(t,-1,1))},n}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)};a.fromSpherical=function(n,r){e(r)||(r=new a);var i=n.clock,o=n.cone,u=t(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(t,n,r,i){return e(i)?(i.x=t,i.y=n,i.z=r,i):new a(t,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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.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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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 s=new a,c=new a;a.angleBetween=function(t,e){a.normalize(t,s),a.normalize(e,c);var n=a.dot(s,c),r=a.magnitude(a.cross(s,c,s));return Math.atan2(r,n)};var l=new a;a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,l);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):n.y<=n.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r},a.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,s=e.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},a.fromDegrees=function(t,e,n,r,o){var u=i.toRadians(t),s=i.toRadians(e);return a.fromRadians(u,s,n,r,o)};var f=new a,h=new a,d=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=t(i,0);var s=e(o)?o.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=a.normalize(f,f),a.multiplyComponents(s,f,h);var l=Math.sqrt(a.dot(f,h));return h=a.divideByScalar(h,l,h),f=a.multiplyByScalar(f,i,f),e(u)||(u=new a),a.add(h,f,u)},a.fromDegreesArray=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=i.toRadians(t[o]);return a.fromRadiansArray(r,e,n)},a.fromRadiansArray=function(t,n,r){var i=t.length;e(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],s=t[o+1];r[o/2]=a.fromRadians(u,s,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o+=3)r[o]=i.toRadians(t[o]),r[o+1]=i.toRadians(t[o+1]),r[o+2]=t[o+2];return a.fromRadiansArrayHeights(r,e,n)},a.fromRadiansArrayHeights=function(t,n,r){var i=t.length;e(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],s=t[o+1],c=t[o+2];r[o/3]=a.fromRadians(u,s,c,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)};return a.fromRadians=function(n,r,i,o){return i=t(i,0),e(o)?(o.longitude=n,o.latitude=r,o.height=i,o):new a(n,r,i)},a.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),a.fromRadians(t,e,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new a(t.longitude,t.latitude,t.height):void 0},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.longitude-n.longitude)<=r&&Math.abs(t.latitude-n.latitude)<=r&&Math.abs(t.height-n.height)<=r},a.ZERO=r(new a(0,0,0)),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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),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"],function(t,e,n,r,i,a,o,u){"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}var c=function(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,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))return void 0;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.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),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=s,n.z=c,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 l=new t,f=new t;c.prototype.cartographicToCartesian=function(e,n){var i=l,a=f;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;n>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var h=new t,d=new t,m=new t;c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,d);if(!r(a))return void 0;var o=this.geodeticSurfaceNormal(a,h),s=t.subtract(n,a,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(t.dot(s,n))*t.magnitude(s);return r(i)?(i.longitude=c,i.latitude=l,i.height=f,i):new e(c,l,f)},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;n>i;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e};var y=new t,p=new t;return c.prototype.scaleToGeodeticSurface=function(e,n){var i=e.x,a=e.y,o=e.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,h=i*i*c*c,d=a*a*l*l,m=o*o*f*f,v=h+d+m,w=Math.sqrt(1/v),x=t.multiplyByScalar(e,w,y);if(v<this._centerToleranceSquared)return isFinite(w)?t.clone(x,n):void 0;var E=this._oneOverRadiiSquared,g=E.x,M=E.y,S=E.z,z=p;z.x=2*x.x*g,z.y=2*x.y*M,z.z=2*x.z*S;var O,T,_,N,I,R,b,A,C,P,L,U=(1-w)*t.magnitude(e)/(.5*t.magnitude(z)),q=0;do{U-=q,_=1/(1+U*g),N=1/(1+U*M),I=1/(1+U*S),R=_*_,b=N*N,A=I*I,C=R*_,P=b*N,L=A*I,O=h*R+d*b+m*A-1,T=h*C*g+d*P*M+m*L*S;var D=-2*T;q=O/D}while(Math.abs(O)>u.EPSILON12);return r(n)?(n.x=i*_,n.y=a*N,n.z=o*I,n):new t(i*_,a*N,o*I)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,s,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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";var u=function(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";var e=function(e,n){this.start=t(e,0),this.stop=t(n,0)};return e}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";var i=function(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)};i.fromElements=function(t,n,r,a,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=a,o):new i(t,n,r,a)},i.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 i(t.red,t.green,t.blue,t.alpha)},i.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new i(t.x,t.y,t.z,t.w):void 0},i.packedLength=4,i.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r++],a.w=n[r],a},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,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},i.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},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 a=new i;i.distance=function(t,e){return i.subtract(t,e,a),i.magnitude(a)},i.normalize=function(t,e){var n=i.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,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,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},i.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},i.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},i.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},i.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},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 o=new i;i.lerp=function(t,e,n,r){return i.multiplyByScalar(e,n,o),r=i.multiplyByScalar(t,1-n,r),i.add(o,r,r)};var u=new i;return i.mostOrthogonalAxis=function(t,e){var n=i.normalize(t,u);return i.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?i.clone(i.UNIT_X,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e):n.y<=n.z?n.y<=n.w?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e)},i.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},i.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r&&Math.abs(t.w-n.w)<=r},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(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e){return i.equalsEpsilon(this,t,e)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t){for(var e=0,n=0;9>n;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function u(t){for(var e=0,n=0;3>n;++n){var r=t[c.getElementIndex(d[n],h[n])];e+=2*r*r}return Math.sqrt(e)}function s(t,e){for(var n=a.EPSILON15,r=0,i=1,o=0;3>o;++o){var u=Math.abs(t[c.getElementIndex(d[o],h[o])]);u>r&&(i=o,r=u)}var s=1,l=0,f=h[i],m=d[i];if(Math.abs(t[c.getElementIndex(m,f)])>n){var y,p=t[c.getElementIndex(m,m)],v=t[c.getElementIndex(f,f)],w=t[c.getElementIndex(m,f)],x=(p-v)/2/w;y=0>x?-1/(-x+Math.sqrt(1+x*x)):1/(x+Math.sqrt(1+x*x)),s=1/Math.sqrt(1+y*y),l=y*s}return e=c.clone(c.IDENTITY,e),e[c.getElementIndex(f,f)]=e[c.getElementIndex(m,m)]=s,e[c.getElementIndex(m,f)]=l,e[c.getElementIndex(f,m)]=-l,e}var c=function(t,n,r,i,a,o,u,s,c){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(s,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(c,0)};c.clone=function(t,e){return n(t)?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 c(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},c.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new c),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},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[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 c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},c.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,u=t.y*t.y,s=t.y*t.z,l=t.y*t.w,f=t.z*t.z,h=t.z*t.w,d=t.w*t.w,m=r-u-f+d,y=2*(i-h),p=2*(a+l),v=2*(i+h),w=-r+u-f+d,x=2*(s-o),E=2*(a-l),g=2*(s+o),M=-r-u+f+d;return n(e)?(e[0]=m,e[1]=v,e[2]=E,e[3]=y,e[4]=w,e[5]=g,e[6]=p,e[7]=x,e[8]=M,e):new c(m,y,p,v,w,x,E,g,M)},c.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 c(t.x,0,0,0,t.y,0,0,0,t.z)},c.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 c(t,0,0,0,t,0,0,0,t)},c.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 c(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},c.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 c(1,0,0,0,r,-i,0,i,r)},c.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 c(r,0,i,0,1,0,-i,0,r)},c.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 c(r,-i,0,i,r,0,0,0,1)},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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},c.getElementIndex=function(t,e){return 3*t+e},c.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},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},c.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},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,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[3],e[4],e[5],l)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],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]*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],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],c=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],f=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]=s,n[6]=c,n[7]=l,n[8]=f,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},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},c.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,s=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=s,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},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},c.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],s=t[2],c=t[5],l=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=s,e[7]=c,e[8]=l,e};var h=[1,0,0],d=[2,2,1],m=new c,y=new c;return c.computeEigenDecomposition=function(t,e){var r=a.EPSILON20,i=10,l=0,f=0;n(e)||(e={});for(var h=e.unitary=c.clone(c.IDENTITY,e.unitary),d=e.diagonal=c.clone(t,e.diagonal),p=r*o(d);i>f&&u(d)>p;)s(d,m),c.transpose(m,y),c.multiply(d,m,d),c.multiply(y,d,d),c.multiply(h,m,h),++l>2&&(++f,l=0);return 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},c.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],s=t[5],c=t[8];return e*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},c.inverse=function(t,e){var n=t[0],i=t[1],o=t[2],u=t[3],s=t[4],l=t[5],f=t[6],h=t[7],d=t[8],m=c.determinant(t);if(Math.abs(m)<=a.EPSILON15)throw new r("matrix is not invertible");e[0]=s*d-h*l,e[1]=h*o-i*d,e[2]=i*l-s*o,e[3]=f*l-u*d,e[4]=n*d-f*o,e[5]=u*o-n*l,e[6]=u*h-f*s,e[7]=f*i-n*h,e[8]=n*s-u*i;var y=1/m;return c.multiplyByScalar(e,y,e)},c.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]},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},c.IDENTITY=i(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(t){"use strict";var e=function(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,s){"use strict";var c=function(t,e,r,i,a,o,u,s,c,l,f,h,d,m,y,p){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(e,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(m,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(y,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(p,0)};c.packedLength=16,c.pack=function(t,e,r){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]},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){return r(t)?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]):void 0},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,s=e.x*e.x,l=e.x*e.y,f=e.x*e.z,h=e.x*e.w,d=e.y*e.y,m=e.y*e.z,y=e.y*e.w,p=e.z*e.z,v=e.z*e.w,w=e.w*e.w,x=s-d-p+w,E=2*(l-v),g=2*(f+y),M=2*(l+v),S=-s+d-p+w,z=2*(m-h),O=2*(f-y),T=2*(m+h),_=-s-d+p+w;return i[0]=x*a,i[1]=M*a,i[2]=O*a,i[3]=0,i[4]=E*o,i[5]=S*o,i[6]=T*o,i[7]=0,i[8]=g*u,i[9]=z*u,i[10]=_*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},c.fromTranslation=function(t,e){return c.fromRotationTranslation(u.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 l=new t,f=new t,h=new t;c.fromCamera=function(e,n){var i=e.eye,a=e.target,o=e.up;t.normalize(t.subtract(a,i,l),l),t.normalize(t.cross(l,o,f),f),t.normalize(t.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,m=l.x,y=l.y,p=l.z,v=h.x,w=h.y,x=h.z,E=i.x,g=i.y,M=i.z,S=u*-E+s*-g+d*-M,z=v*-E+w*-g+x*-M,O=m*E+y*g+p*M;return r(n)?(n[0]=u,n[1]=v,n[2]=-m,n[3]=0,n[4]=s,n[5]=w,n[6]=-y,n[7]=0,n[8]=d,n[9]=x,n[10]=-p,n[11]=0,n[12]=S,n[13]=z,n[14]=O,n[15]=1,n):new c(u,s,d,S,v,w,x,z,-m,-y,-p,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,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},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),s=1/(r-n),c=1/(a-i),l=-(e+t)*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},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),s=2*i/(r-n),c=(e+t)/(e-t),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},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),s=(e+t)/(e-t),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},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),s=n(t.height,0);e=n(e,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-e),h=c,d=l,m=f,y=a+c,p=o+l,v=e+f,w=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]=m,i[11]=0,i[12]=y,i[13]=p,i[14]=v,i[15]=w,i},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.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 d=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],d)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],d)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],d)),n};var m=new t;c.getMaximumScale=function(e){return c.getScale(e,m),t.maximumComponent(m)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],s=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],m=t[11],y=t[12],p=t[13],v=t[14],w=t[15],x=e[0],E=e[1],g=e[2],M=e[3],S=e[4],z=e[5],O=e[6],T=e[7],_=e[8],N=e[9],I=e[10],R=e[11],b=e[12],A=e[13],C=e[14],P=e[15],L=r*x+u*E+f*g+y*M,U=i*x+s*E+h*g+p*M,q=a*x+c*E+d*g+v*M,D=o*x+l*E+m*g+w*M,B=r*S+u*z+f*O+y*T,F=i*S+s*z+h*O+p*T,G=a*S+c*z+d*O+v*T,W=o*S+l*z+m*O+w*T,V=r*_+u*N+f*I+y*R,Y=i*_+s*N+h*I+p*R,k=a*_+c*N+d*I+v*R,j=o*_+l*N+m*I+w*R,H=r*b+u*A+f*C+y*P,Z=i*b+s*A+h*C+p*P,X=a*b+c*A+d*C+v*P,K=o*b+l*A+m*C+w*P;return n[0]=L,n[1]=U,n[2]=q,n[3]=D,n[4]=B,n[5]=F,n[6]=G,n[7]=W,n[8]=V,n[9]=Y,n[10]=k,n[11]=j,n[12]=H,n[13]=Z,n[14]=X,n[15]=K,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],s=t[6],c=t[8],l=t[9],f=t[10],h=t[12],d=t[13],m=t[14],y=e[0],p=e[1],v=e[2],w=e[4],x=e[5],E=e[6],g=e[8],M=e[9],S=e[10],z=e[12],O=e[13],T=e[14],_=r*y+o*p+c*v,N=i*y+u*p+l*v,I=a*y+s*p+f*v,R=r*w+o*x+c*E,b=i*w+u*x+l*E,A=a*w+s*x+f*E,C=r*g+o*M+c*S,P=i*g+u*M+l*S,L=a*g+s*M+f*S,U=r*z+o*O+c*T+h,q=i*z+u*O+l*T+d,D=a*z+s*O+f*T+m;return n[0]=_,n[1]=N,n[2]=I,n[3]=0,n[4]=R,n[5]=b,n[6]=A,n[7]=0,n[8]=C,n[9]=P,n[10]=L,n[11]=0,n[12]=U,n[13]=q,n[14]=D,n[15]=1,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],s=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]=s,n[15]=t[15],n};var y=new t;c.multiplyByUniformScale=function(t,e,n){return y.x=e,y.y=e,y.z=e,c.multiplyByScale(t,y,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,s=t[1]*r+t[5]*i+t[9]*a+t[13]*o,c=t[2]*r+t[6]*i+t[10]*a+t[14]*o,l=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,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,s=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=s,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],s=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=s,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[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[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]},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 p=new u,v=new u,w=new e,x=new e(0,0,0,1);return c.inverse=function(t,n){if(u.equalsEpsilon(c.getRotation(t,p),v,o.EPSILON7)&&e.equals(c.getRow(t,3,w),x))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],l=t[12],f=t[1],h=t[5],d=t[9],m=t[13],y=t[2],E=t[6],g=t[10],M=t[14],S=t[3],z=t[7],O=t[11],T=t[15],_=g*T,N=M*O,I=E*T,R=M*z,b=E*O,A=g*z,C=y*T,P=M*S,L=y*O,U=g*S,q=y*z,D=E*S,B=_*h+R*d+b*m-(N*h+I*d+A*m),F=N*f+C*d+U*m-(_*f+P*d+L*m),G=I*f+P*h+q*m-(R*f+C*h+D*m),W=A*f+L*h+D*d-(b*f+U*h+q*d),V=N*i+I*a+A*l-(_*i+R*a+b*l),Y=_*r+P*a+L*l-(N*r+C*a+U*l),k=R*r+C*i+D*l-(I*r+P*i+q*l),j=b*r+U*i+q*a-(A*r+L*i+D*a);_=a*m,N=l*d,I=i*m,R=l*h,b=i*d,A=a*h,C=r*m,P=l*f,L=r*d,U=a*f,q=r*h,D=i*f;var H=_*z+R*O+b*T-(N*z+I*O+A*T),Z=N*S+C*O+U*T-(_*S+P*O+L*T),X=I*S+P*z+q*T-(R*S+C*z+D*T),K=A*S+L*z+D*O-(b*S+U*z+q*O),J=I*g+A*M+N*E-(b*M+_*E+R*g),Q=L*M+_*y+P*g-(C*g+U*M+N*y),$=C*E+D*M+R*y-(q*M+I*y+P*E),te=q*g+b*y+U*E-(L*E+D*g+A*y),ee=r*B+i*F+a*G+l*W;if(Math.abs(ee)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return ee=1/ee,n[0]=B*ee,n[1]=F*ee,n[2]=G*ee,n[3]=W*ee,n[4]=V*ee,n[5]=Y*ee,n[6]=k*ee,n[7]=j*ee,n[8]=H*ee,n[9]=Z*ee,n[10]=X*ee,n[11]=K*ee,n[12]=J*ee,n[13]=Q*ee,n[14]=$*ee,n[15]=te*ee,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],s=t[8],c=t[9],l=t[10],f=t[12],h=t[13],d=t[14],m=-n*f-r*h-i*d,y=-a*f-o*h-u*d,p=-s*f-c*h-l*d;return e[0]=n,e[1]=a,e[2]=s,e[3]=0,e[4]=r,e[5]=o,e[6]=c,e[7]=0,e[8]=i,e[9]=u,e[10]=l,e[11]=0,e[12]=m,e[13]=y,e[14]=p,e[15]=1,e},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";var u=function(t,n,r,i){this.west=e(t,0),this.south=e(n,0),this.east=e(r,0),this.north=e(i,0)};u.fromDegrees=function(t,r,i,a,s){return t=o.toRadians(e(t,0)),r=o.toRadians(e(r,0)),i=o.toRadians(e(i,0)),a=o.toRadians(e(a,0)),n(s)?(s.west=t,s.south=r,s.east=i,s.north=a,s):new u(t,r,i,a)},u.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=t.length;c>s;s++){var l=t[s];r=Math.min(r,l.longitude),i=Math.max(i,l.longitude),a=Math.min(a,l.latitude),o=Math.max(o,l.latitude)}return n(e)?(e.west=r,e.south=a,e.east=i,e.north=o,e):new u(r,a,i,o)},u.packedLength=4,u.pack=function(t,n,r){r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i.west=t[r++],i.south=t[r++],i.east=t[r++],i.north=t[r],i},u.clone=function(t,e){return n(t)?n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new u(t.west,t.south,t.east,t.north):void 0},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.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},u.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},u.validate=function(){},u.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)},u.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)},u.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)},u.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)},u.center=function(e,r){var i=e.east,a=e.west,u=.5*(a+i);return a>i&&(u=o.negativePiToPi(u+o.PI)),n(r)?(r.longitude=u,r.latitude=.5*(e.south+e.north),r.height=0,r):new t(u,.5*(e.south+e.north))},u.intersectWith=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),s=Math.min(t.north,e.north);return n(r)?(r.west=i,r.south=a,r.east=o,r.north=s,r):new u(i,a,o,s)},u.contains=function(t,e){return e.longitude>=t.west&&e.longitude<=t.east&&e.latitude>=t.south&&e.latitude<=t.north},u.isEmpty=function(t){return t.west>=t.east||t.south>=t.north};var s=new t;return u.subsample=function(t,r,a,u){r=e(r,i.WGS84),a=e(a,0),n(u)||(u=[]);var c=0,l=t.north,f=t.south,h=t.east,d=t.west,m=s;m.height=a,m.longitude=d,m.latitude=l,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:f>0?f:0;for(var y=1;8>y;++y){var p=-Math.PI+y*o.PI_OVER_TWO;p>d&&h>p&&(m.longitude=p,u[c]=r.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,s,c,l){"use strict";var f=function(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)},h=new t,d=new t,m=new t,y=new t,p=new t,v=new t,w=new t,x=new t,E=new t,g=new t,M=new t,S=new t;f.fromPoints=function(e,n){if(r(n)||(n=new f),!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],w),a=t.clone(i,h),o=t.clone(i,d),u=t.clone(i,m),s=t.clone(i,y),c=t.clone(i,p),l=t.clone(i,v),z=e.length,O=1;z>O;O++){t.clone(e[O],i);var T=i.x,_=i.y,N=i.z;T<a.x&&t.clone(i,a),T>s.x&&t.clone(i,s),_<o.y&&t.clone(i,o),_>c.y&&t.clone(i,c),N<u.z&&t.clone(i,u),N>l.z&&t.clone(i,l)}var I=t.magnitudeSquared(t.subtract(s,a,x)),R=t.magnitudeSquared(t.subtract(c,o,x)),b=t.magnitudeSquared(t.subtract(l,u,x)),A=a,C=s,P=I;R>P&&(P=R,A=o,C=c),b>P&&(P=b,A=u,C=l);var L=E;L.x=.5*(A.x+C.x),L.y=.5*(A.y+C.y),L.z=.5*(A.z+C.z);var U=t.magnitudeSquared(t.subtract(C,L,x)),q=Math.sqrt(U),D=g;D.x=a.x,D.y=o.y,D.z=u.z;var B=M;B.x=s.x,B.y=c.y,B.z=l.z;var F=t.multiplyByScalar(t.add(D,B,x),.5,S),G=0;for(O=0;z>O;O++){t.clone(e[O],i);var W=t.magnitude(t.subtract(i,F,x));W>G&&(G=W);var V=t.magnitudeSquared(t.subtract(i,L,x));if(V>U){var Y=Math.sqrt(V);q=.5*(q+Y),U=q*q;var k=Y-q;L.x=(q*L.x+k*i.x)/Y,L.y=(q*L.y+k*i.y)/Y,L.z=(q*L.z+k*i.z)/Y}}return G>q?(t.clone(L,n.center),n.radius=q):(t.clone(F,n.center),n.radius=G),n};var z=new o,O=new t,T=new t,_=new e,N=new e;f.fromRectangle2D=function(t,e,n){return f.fromRectangleWithHeights2D(t,e,0,0,n)},f.fromRectangleWithHeights2D=function(e,i,a,o,u){if(r(u)||(u=new f),!r(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;i=n(i,z),l.southwest(e,_),_.height=a,l.northeast(e,N),N.height=o;var s=i.project(_,O),c=i.project(N,T),h=c.x-s.x,d=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(h*h+d*d+m*m);var y=u.center;return y.x=s.x+.5*h,y.y=s.y+.5*d,y.z=s.z+.5*m,u};var I=[];f.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=l.subsample(t,e,i,I)),f.fromPoints(u,o)},f.fromVertices=function(e,i,a,o){if(r(o)||(o=new f),!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=w;u.x=e[0]+i.x,u.y=e[1]+i.y,u.z=e[2]+i.z;for(var s=t.clone(u,h),c=t.clone(u,d),l=t.clone(u,m),z=t.clone(u,y),O=t.clone(u,p),T=t.clone(u,v),_=e.length,N=0;_>N;N+=a){var I=e[N]+i.x,R=e[N+1]+i.y,b=e[N+2]+i.z;u.x=I,u.y=R,u.z=b,I<s.x&&t.clone(u,s),I>z.x&&t.clone(u,z),R<c.y&&t.clone(u,c),R>O.y&&t.clone(u,O),b<l.z&&t.clone(u,l),b>T.z&&t.clone(u,T)}var A=t.magnitudeSquared(t.subtract(z,s,x)),C=t.magnitudeSquared(t.subtract(O,c,x)),P=t.magnitudeSquared(t.subtract(T,l,x)),L=s,U=z,q=A;C>q&&(q=C,L=c,U=O),P>q&&(q=P,L=l,U=T);var D=E;D.x=.5*(L.x+U.x),D.y=.5*(L.y+U.y),D.z=.5*(L.z+U.z);var B=t.magnitudeSquared(t.subtract(U,D,x)),F=Math.sqrt(B),G=g;G.x=s.x,G.y=c.y,G.z=l.z;var W=M;W.x=z.x,W.y=O.y,W.z=T.z;var V=t.multiplyByScalar(t.add(G,W,x),.5,S),Y=0;for(N=0;_>N;N+=a){u.x=e[N]+i.x,u.y=e[N+1]+i.y,u.z=e[N+2]+i.z;var k=t.magnitude(t.subtract(u,V,x));k>Y&&(Y=k);var j=t.magnitudeSquared(t.subtract(u,D,x));if(j>B){var H=Math.sqrt(j);F=.5*(F+H),B=F*F;var Z=H-F;D.x=(F*D.x+Z*u.x)/H,D.y=(F*D.y+Z*u.y)/H,D.z=(F*D.z+Z*u.z)/H}}return Y>F?(t.clone(D,o.center),o.radius=F):(t.clone(V,o.center),o.radius=Y),o},f.fromCornerPoints=function(e,n,i){r(i)||(i=new f);var a=i.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),i.radius=t.distance(a,n),i},f.fromEllipsoid=function(e,n){return r(n)||(n=new f),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n},f.clone=function(e,n){return r(e)?r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new f(e.center,e.radius):void 0},f.packedLength=4,f.pack=function(t,e,r){r=n(r,0);var i=t.center;e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius},f.unpack=function(t,e,i){e=n(e,0),r(i)||(i=new f);var a=i.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],i.radius=t[e],i};var R=new t,b=new t;f.union=function(e,n,i){r(i)||(i=new f);var a=e.center,o=n.center;t.add(a,o,b);var u=t.multiplyByScalar(b,.5,b),s=t.magnitude(t.subtract(a,u,R))+e.radius,c=t.magnitude(t.subtract(o,u,R))+n.radius;return i.radius=Math.max(s,c),t.clone(u,i.center),i};var A=new t;f.expand=function(e,n,r){r=f.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,A));return i>r.radius&&(r.radius=i),r},f.intersect=function(e,n){var r=e.center,i=e.radius,a=t.dot(n,r)+n.w;return-i>a?u.OUTSIDE:i>a?u.INTERSECTING:u.INSIDE},f.transform=function(t,e,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var C=new t;f.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,C);return t.magnitudeSquared(r)-e.radius*e.radius},f.transformWithoutScale=function(t,e,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var P=new t;f.computePlaneDistances=function(e,n,i,a){r(a)||(a=new s);var o=t.subtract(e.center,n,P),u=t.multiplyByScalar(i,t.dot(i,o),P),c=t.magnitude(u);return a.start=c-e.radius,a.stop=c+e.radius,a};for(var L=new t,U=new t,q=new t,D=new t,B=new t,F=new e,G=new Array(8),W=0;8>W;++W)G[W]=new t;var V=new o;return f.projectTo2D=function(e,r,i){r=n(r,V);var a=r.ellipsoid,o=e.center,u=e.radius,s=a.geodeticSurfaceNormal(o,L),c=t.cross(t.UNIT_Z,s,U);t.normalize(c,c);var l=t.cross(s,c,q);t.normalize(l,l),t.multiplyByScalar(s,u,s),t.multiplyByScalar(l,u,l),t.multiplyByScalar(c,u,c);var h=t.negate(l,B),d=t.negate(c,D),m=G,y=m[0];t.add(s,l,y),t.add(y,c,y),y=m[1],t.add(s,l,y),t.add(y,d,y),y=m[2],t.add(s,h,y),t.add(y,d,y),y=m[3],t.add(s,h,y),t.add(y,c,y),t.negate(s,s),y=m[4],t.add(s,l,y),t.add(y,c,y),y=m[5],t.add(s,l,y),t.add(y,d,y),y=m[6],t.add(s,h,y),t.add(y,d,y),y=m[7],t.add(s,h,y),t.add(y,c,y);for(var p=m.length,v=0;p>v;++v){var w=m[v];t.add(o,w,w);var x=a.cartesianToCartographic(w,F);r.project(x,w)}i=f.fromPoints(m,i),o=i.center;var E=o.x,g=o.y,M=o.z;return o.x=M,o.y=E,o.z=g,i},f.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},f.prototype.intersect=function(t){return f.intersect(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/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(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){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n):new a(t.x,t.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r]=e.y},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.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.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.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 s=new a,c=new a;a.angleBetween=function(t,e){return a.normalize(t,s),a.normalize(e,c),i.acosClamped(a.dot(s,c))};var l=new a;return a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,l);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.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r},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){return a.equalsEpsilon(this,t,e)},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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof e[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",t(document[i])?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",t(document[i])&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",t(document[i])?r.fullscreenElement=i:(i=s+"FullScreenElement",t(document[i])&&(r.fullscreenElement=i)),i=s+"fullscreenchange",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t){i.supportsFullscreen()&&t[r.requestFullscreen]()},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;r>n;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(m)){m=!1;var t=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(m=!0,y=r(t[1]))}return m}function a(){return i()&&y}function o(){if(!e(p)&&(p=!1,!i()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(p=!0,v=r(t[1]))}return p}function u(){return o()&&v}function s(){if(!e(w)){w=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==t&&(w=!0,x=r(t[1]),x.isNightly=!!t[2])}return w}function c(){return s()&&x}function l(){if(!e(E)){E=!1;var t;"Microsoft Internet Explorer"===navigator.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(E=!0,g=r(t[1]))):"Netscape"===navigator.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(E=!0,g=r(t[1])))}return E}function f(){return l()&&g}function h(){if(!e(M)){M=!1;var t=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(M=!0,S=r(t[1]))}return M}function d(){return h()&&S}var m,y,p,v,w,x,E,g,M,S,z={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:d,hardwareConcurrency:t(navigator.hardwareConcurrency,3)};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,e,n,r,i){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(t){switch(t){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(t){return t instanceof Int8Array?a.BYTE:t instanceof Uint8Array?a.UNSIGNED_BYTE:t instanceof Int16Array?a.SHORT:t instanceof Uint16Array?a.UNSIGNED_SHORT:t instanceof Float32Array?a.FLOAT:t instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(t){return e(t)&&(t===a.BYTE||t===a.UNSIGNED_BYTE||t===a.SHORT||t===a.UNSIGNED_SHORT||t===a.FLOAT||t===a.DOUBLE)},a.createTypedArray=function(t,e){switch(t){case a.BYTE:return new Int8Array(e);case a.UNSIGNED_BYTE:return new Uint8Array(e);case a.SHORT:return new Int16Array(e);case a.UNSIGNED_SHORT:return new Uint16Array(e);case a.FLOAT:return new Float32Array(e);case a.DOUBLE:return new Float64Array(e);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(e,r,i,o){switch(i=t(i,0),o=t(o,(r.byteLength-i)/a.getSizeInBytes(e)),e){case a.BYTE:return new Int8Array(r,i,o);case a.UNSIGNED_BYTE:return new Uint8Array(r,i,o);case a.SHORT:return new Int16Array(r,i,o);case a.UNSIGNED_SHORT:return new Uint16Array(r,i,o);case a.FLOAT:return new Float32Array(r,i,o);case a.DOUBLE:return new Float64Array(r,i,o);default:throw new n("componentDatatype is not a valid value.")}},i(a)}),define("Core/CylinderGeometryLibrary",["./Math"],function(t){"use strict";var e={};return e.computePositions=function(e,n,r,i,a){var o,u=.5*e,s=-u,c=i+i,l=a?2*c:c,f=new Float64Array(3*l),h=0,d=0,m=a?3*c:0,y=a?3*(c+i):3*i;for(o=0;i>o;o++){var p=o/i*t.TWO_PI,v=Math.cos(p),w=Math.sin(p),x=v*r,E=w*r,g=v*n,M=w*n;f[d+m]=x,f[d+m+1]=E,f[d+m+2]=s,f[d+y]=g,f[d+y+1]=M,f[d+y+2]=u,d+=3,a&&(f[h++]=x,f[h++]=E,f[h++]=s,f[h++]=g,f[h++]=M,f[h++]=u)}return f},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"],function(t){"use strict";var e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(t){return t===e.POINTS||t===e.LINES||t===e.LINE_LOOP||t===e.LINE_STRIP||t===e.TRIANGLES||t===e.TRIANGLE_STRIP||t===e.TRIANGLE_FAN}};return t(e)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";var a=function(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)};return a.computeNumberOfVertices=function(t){var r=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&e(t.attributes[i])&&e(t.attributes[i].values)){var a=t.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t){"use strict";var e=function(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 e}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";var e=function(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"],function(t,e,n,r){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,i){return t>r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(i)}),define("Core/VertexFormat",["./defaultValue","./freezeObject"],function(t,e){"use strict";var n=function(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 n.POSITION_ONLY=e(new n({position:!0})),n.POSITION_AND_NORMAL=e(new n({position:!0,normal:!0})),n.POSITION_NORMAL_AND_ST=e(new n({position:!0,normal:!0,st:!0})),n.POSITION_AND_ST=e(new n({position:!0,st:!0})),n.POSITION_AND_COLOR=e(new n({position:!0,color:!0})),n.ALL=e(new n({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),n.DEFAULT=n.POSITION_NORMAL_AND_ST,n}),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,s,c,l,f,h,d,m){"use strict";var y=new e,p=new n,v=new n,w=new n,x=new n,E=function(t){t=a(t,a.EMPTY_OBJECT);var e=t.length,n=t.topRadius,r=t.bottomRadius,i=a(t.vertexFormat,m.DEFAULT),o=a(t.slices,128);this._length=e,this._topRadius=n,this._bottomRadius=r,this._vertexFormat=i,this._slices=o,this._workerName="createCylinderGeometry"};return E.createGeometry=function(a){var o,u=a._length,m=a._topRadius,E=a._bottomRadius,g=a._vertexFormat,M=a._slices,S=M+M,z=M+S,O=S+S,T=i.computePositions(u,m,E,M,!0),_=g.st?new Float32Array(2*O):void 0,N=g.normal?new Float32Array(3*O):void 0,I=g.tangent?new Float32Array(3*O):void 0,R=g.binormal?new Float32Array(3*O):void 0,b=g.normal||g.tangent||g.binormal;if(b){var A=g.tangent||g.binormal,C=0,P=0,L=0,U=p;U.z=0;var q=w,D=v;for(o=0;M>o;o++){var B=o/M*h.TWO_PI,F=Math.cos(B),G=Math.sin(B);b&&(U.x=F,U.y=G,A&&(q=n.normalize(n.cross(n.UNIT_Z,U,q),q)),g.normal&&(N[C++]=F,N[C++]=G,N[C++]=0,N[C++]=F,N[C++]=G,N[C++]=0),g.tangent&&(I[P++]=q.x,I[P++]=q.y,I[P++]=q.z,I[P++]=q.x,I[P++]=q.y,I[P++]=q.z),g.binormal&&(D=n.normalize(n.cross(U,q,D),D),R[L++]=D.x,R[L++]=D.y,R[L++]=D.z,R[L++]=D.x,R[L++]=D.y,R[L++]=D.z))}for(o=0;M>o;o++)g.normal&&(N[C++]=0,N[C++]=0,N[C++]=-1),g.tangent&&(I[P++]=1,I[P++]=0,I[P++]=0),g.binormal&&(R[L++]=0,R[L++]=-1,R[L++]=0);for(o=0;M>o;o++)g.normal&&(N[C++]=0,N[C++]=0,N[C++]=1),g.tangent&&(I[P++]=1,I[P++]=0,I[P++]=0),g.binormal&&(R[L++]=0,R[L++]=1,R[L++]=0)}var W=12*M-12,V=f.createTypedArray(O,W),Y=0,k=0;for(o=0;M-1>o;o++)V[Y++]=k,V[Y++]=k+2,V[Y++]=k+3,V[Y++]=k,V[Y++]=k+3,V[Y++]=k+1,k+=2;for(V[Y++]=S-2,V[Y++]=0,V[Y++]=1,V[Y++]=S-2,V[Y++]=1,V[Y++]=S-1,o=1;M-1>o;o++)V[Y++]=S+o+1,V[Y++]=S+o,V[Y++]=S;for(o=1;M-1>o;o++)V[Y++]=z,V[Y++]=z+o,V[Y++]=z+o+1;var j=0;if(g.st){var H=Math.max(m,E);for(o=0;O>o;o++){var Z=n.fromArray(T,3*o,x);_[j++]=(Z.x+H)/(2*H),_[j++]=(Z.y+H)/(2*H)}}var X=new l;g.position&&(X.position=new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:T})),g.normal&&(X.normal=new c({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:N})),g.tangent&&(X.tangent=new c({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:I})),g.binormal&&(X.binormal=new c({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R})),g.st&&(X.st=new c({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:_})),y.x=.5*u,y.y=Math.max(E,m);var K=new t(n.ZERO,e.magnitude(y));return new s({attributes:X,indices:V,primitiveType:d.TRIANGLES,boundingSphere:K})},E}),define("Workers/createCylinderGeometry",["../Core/CylinderGeometry"],function(t){"use strict"; -return t.createGeometry})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==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(n){e=n.stack}this.stack=e}return 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("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:0>t?-1:0},i.signNotZero=function(t){return 0>t?-1:1},i.toSNorm=function(t){return Math.round(255*(.5*i.clamp(t,-1,1)+.5))},i.fromSNorm=function(t){return i.clamp(t,0,255)/255*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.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 i>=a||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;t>=r;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 e>t?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";function a(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}a.fromSpherical=function(n,r){e(r)||(r=new a);var i=n.clock,o=n.cone,u=t(n.magnitude,1),E=u*Math.sin(o);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(t,n,r,i){return e(i)?(i.x=t,i.y=n,i.z=r,i):new a(t,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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){a.normalize(t,E),a.normalize(e,s);var n=a.dot(E,s),r=a.magnitude(a.cross(E,s,E));return Math.atan2(r,n)};var c=new a;a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,c);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):n.y<=n.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},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)},a.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},a.fromDegrees=function(t,e,n,r,o){var u=i.toRadians(t),E=i.toRadians(e);return a.fromRadians(u,E,n,r,o)};var _=new a,R=new a,l=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=t(i,0);var E=e(o)?o.radiiSquared:l,s=Math.cos(r);_.x=s*Math.cos(n),_.y=s*Math.sin(n),_.z=Math.sin(r),_=a.normalize(_,_),a.multiplyComponents(E,_,R);var c=Math.sqrt(a.dot(_,R));return R=a.divideByScalar(R,c,R),_=a.multiplyByScalar(_,i,_),e(u)||(u=new a),a.add(R,_,u)},a.fromDegreesArray=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=i.toRadians(t[o]);return a.fromRadiansArray(r,e,n)},a.fromRadiansArray=function(t,n,r){var i=t.length;e(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],E=t[o+1];r[o/2]=a.fromRadians(u,E,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o+=3)r[o]=i.toRadians(t[o]),r[o+1]=i.toRadians(t[o+1]),r[o+2]=t[o+2];return a.fromRadiansArrayHeights(r,e,n)},a.fromRadiansArrayHeights=function(t,n,r){var i=t.length;e(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],E=t[o+1],s=t[o+2];r[o/3]=a.fromRadians(u,E,s,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(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+")"},a}),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,R=n.z,l=i.x,T=i.y,A=i.z,f=c*c*l*l,N=_*_*T*T,d=R*R*A*A,h=f+N+d,I=Math.sqrt(1/h),S=t.multiplyByScalar(n,I,a);if(E>h)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,x,w,D,B,g=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{g-=z,U=1/(1+g*m),L=1/(1+g*M),F=1/(1+g*O),P=U*U,v=L*L,x=F*F,w=P*U,D=v*L,B=x*F,p=f*P+N*v+d*x-1,C=f*w*m+N*D*M+d*B*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=R*F,s):new t(c*U,_*L,R*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),R=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),l=a.EPSILON1;return u.fromCartesian=function(e,r,i){var T=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:R,f=n(r)?r._centerToleranceSquared:l,N=o(e,T,A,f,s);if(n(N)){var d=t.multiplyComponents(e,A,E);d=t.normalize(d,d);var h=t.subtract(e,N,c),I=Math.atan2(d.y,d.x),S=Math.asin(d.z),m=a.sign(t.dot(h,e))*t.magnitude(h);return n(i)?(i.longitude=I,i.latitude=S,i.height=m,i):new u(I,S,m)}},u.clone=function(t,e){return n(t)?n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height):void 0},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}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,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){i=n(i,0),t.pack(e._radii,r,i)},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,R=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=R;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;n>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var l=new t,T=new t,A=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,T);if(r(a)){var o=this.geodeticSurfaceNormal(a,l),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;n>i;++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}),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","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(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 u(t){for(var e=0,n=0;9>n;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function E(t){for(var e=0,n=0;3>n;++n){var r=t[o.getElementIndex(l[n],R[n])];e+=2*r*r}return Math.sqrt(e)}function s(t,e){for(var n=a.EPSILON15,r=0,i=1,u=0;3>u;++u){var E=Math.abs(t[o.getElementIndex(l[u],R[u])]);E>r&&(i=u,r=E)}var s=1,c=0,_=R[i],T=l[i];if(Math.abs(t[o.getElementIndex(T,_)])>n){var A,f=t[o.getElementIndex(T,T)],N=t[o.getElementIndex(_,_)],d=t[o.getElementIndex(T,_)],h=(f-N)/2/d;A=0>h?-1/(-h+Math.sqrt(1+h*h)):1/(h+Math.sqrt(1+h*h)),s=1/Math.sqrt(1+A*A),c=A*s}return e=o.clone(o.IDENTITY,e),e[o.getElementIndex(_,_)]=e[o.getElementIndex(T,T)]=s,e[o.getElementIndex(T,_)]=c,e[o.getElementIndex(_,T)]=-c,e}o.packedLength=9,o.pack=function(t,n,r){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]},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),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},o.clone=function(t,e){return n(t)?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 o(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},o.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new o),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},o.fromColumnMajorArray=function(t,e){return o.clone(t,e)},o.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 o(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},o.fromQuaternion=function(t,e){var r=t.x*t.x,i=t.x*t.y,a=t.x*t.z,u=t.x*t.w,E=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,R=t.z*t.w,l=t.w*t.w,T=r-E-_+l,A=2*(i-R),f=2*(a+c),N=2*(i+R),d=-r+E-_+l,h=2*(s-u),I=2*(a-c),S=2*(s+u),m=-r-E+_+l;return n(e)?(e[0]=T,e[1]=N,e[2]=I,e[3]=A,e[4]=d,e[5]=S,e[6]=f,e[7]=h,e[8]=m,e):new o(T,A,f,N,d,h,I,S,m)},o.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 o(t.x,0,0,0,t.y,0,0,0,t.z)},o.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 o(t,0,0,0,t,0,0,0,t)},o.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 o(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},o.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 o(1,0,0,0,r,-i,0,i,r)},o.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 o(r,0,i,0,1,0,-i,0,r)},o.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 o(r,-i,0,i,r,0,0,0,1)},o.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]]},o.getElementIndex=function(t,e){return 3*t+e},o.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},o.setColumn=function(t,e,n,r){r=o.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},o.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},o.setRow=function(t,e,n,r){return r=o.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var c=new t;o.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],c)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],c)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],c)),n};var _=new t;o.getMaximumScale=function(e){return o.getScale(e,_),t.maximumComponent(_)},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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],T=new o,A=new o;return o.computeEigenDecomposition=function(t,e){var r=a.EPSILON20,i=10,c=0,_=0;n(e)||(e={});for(var R=e.unitary=o.clone(o.IDENTITY,e.unitary),l=e.diagonal=o.clone(t,e.diagonal),f=r*u(l);i>_&&E(l)>f;)s(l,T),o.transpose(T,A),o.multiply(l,T,l),o.multiply(A,l,l),o.multiply(R,T,R),++c>2&&(++_,c=0);return e},o.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},o.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)},o.inverse=function(t,e){var n=t[0],i=t[1],u=t[2],E=t[3],s=t[4],c=t[5],_=t[6],R=t[7],l=t[8],T=o.determinant(t);if(Math.abs(T)<=a.EPSILON15)throw new r("matrix is not invertible");e[0]=s*l-R*c,e[1]=R*u-i*l,e[2]=i*c-s*u,e[3]=_*c-E*l,e[4]=n*l-_*u,e[5]=E*u-n*c,e[6]=E*R-_*s,e[7]=_*i-n*R,e[8]=n*s-E*i;var A=1/T;return o.multiplyByScalar(e,A,e)},o.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]},o.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},o.IDENTITY=i(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=i(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.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]},o.prototype.equalsEpsilon=function(t,e){return o.equalsEpsilon(this,t,e)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return e(t)?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):void 0},a.packedLength=4,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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.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.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(n){e=n.stack}this.stack=e}return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(t,e,r,i,a,o,u,E,s,c,_,R,l,T,A,f){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(T,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(R,0),this[15]=n(f,0)}s.packedLength=16,s.pack=function(t,e,r){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]},s.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new s),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},s.clone=function(t,e){return r(t)?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 s(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]):void 0},s.fromArray=s.unpack,s.fromColumnMajorArray=function(t,e){return s.clone(t,e)},s.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 s(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])},s.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 s(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)},s.fromTranslationQuaternionRotationScale=function(t,e,n,i){r(i)||(i=new s);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,c=e.x*e.y,_=e.x*e.z,R=e.x*e.w,l=e.y*e.y,T=e.y*e.z,A=e.y*e.w,f=e.z*e.z,N=e.z*e.w,d=e.w*e.w,h=E-l-f+d,I=2*(c-N),S=2*(_+A),m=2*(c+N),M=-E+l-f+d,O=2*(T-R),y=2*(_-A),p=2*(T+R),C=-E-l+f+d;return i[0]=h*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},s.fromTranslationRotationScale=function(t,e){return s.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},s.fromTranslation=function(t,e){return s.fromRotationTranslation(u.IDENTITY,t,e)},s.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 s(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},s.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 s(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var c=new t,_=new t,R=new t;s.fromCamera=function(e,n){var i=e.eye,a=e.target,o=e.up;t.normalize(t.subtract(a,i,c),c),t.normalize(t.cross(c,o,_),_),t.normalize(t.cross(_,c,R),R);var u=_.x,E=_.y,l=_.z,T=c.x,A=c.y,f=c.z,N=R.x,d=R.y,h=R.z,I=i.x,S=i.y,m=i.z,M=u*-I+E*-S+l*-m,O=N*-I+d*-S+h*-m,y=T*I+A*S+f*m; +return r(n)?(n[0]=u,n[1]=N,n[2]=-T,n[3]=0,n[4]=E,n[5]=d,n[6]=-A,n[7]=0,n[8]=l,n[9]=h,n[10]=-f,n[11]=0,n[12]=M,n[13]=O,n[14]=y,n[15]=1,n):new s(u,E,l,M,N,d,h,O,-T,-A,-f,y,0,0,0,1)},s.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},s.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,R=-(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]=R,o[15]=1,o},s.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),R=-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]=R,o[12]=0,o[13]=0,o[14]=l,o[15]=0,o},s.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,R=-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]=R,a[15]=0,a},s.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),R=s,l=c,T=_,A=a+s,f=o+c,N=e+_,d=1;return i[0]=R,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]=T,i[11]=0,i[12]=A,i[13]=f,i[14]=N,i[15]=d,i},s.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]]},s.getElementIndex=function(t,e){return 4*t+e},s.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},s.setColumn=function(t,e,n,r){r=s.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},s.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},s.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},s.setRow=function(t,e,n,r){return r=s.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;s.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 T=new t;s.getMaximumScale=function(e){return s.getScale(e,T),t.maximumComponent(T)},s.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],R=t[9],l=t[10],T=t[11],A=t[12],f=t[13],N=t[14],d=t[15],h=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],x=e[14],w=e[15],D=r*h+u*I+_*S+A*m,B=i*h+E*I+R*S+f*m,g=a*h+s*I+l*S+N*m,z=o*h+c*I+T*S+d*m,G=r*M+u*O+_*y+A*p,b=i*M+E*O+R*y+f*p,X=a*M+s*O+l*y+N*p,V=o*M+c*O+T*y+d*p,q=r*C+u*U+_*L+A*F,H=i*C+E*U+R*L+f*F,W=a*C+s*U+l*L+N*F,Y=o*C+c*U+T*L+d*F,K=r*P+u*v+_*x+A*w,k=i*P+E*v+R*x+f*w,Z=a*P+s*v+l*x+N*w,j=o*P+c*v+T*x+d*w;return n[0]=D,n[1]=B,n[2]=g,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},s.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},s.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},s.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],R=t[12],l=t[13],T=t[14],A=e[0],f=e[1],N=e[2],d=e[4],h=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*A+o*f+s*N,U=i*A+u*f+c*N,L=a*A+E*f+_*N,F=r*d+o*h+s*I,P=i*d+u*h+c*I,v=a*d+E*h+_*I,x=r*S+o*m+s*M,w=i*S+u*m+c*M,D=a*S+E*m+_*M,B=r*O+o*y+s*p+R,g=i*O+u*y+c*p+l,z=a*O+E*y+_*p+T;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]=w,n[10]=D,n[11]=0,n[12]=B,n[13]=g,n[14]=z,n[15]=1,n},s.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],R=e[0],l=e[1],T=e[2],A=e[3],f=e[4],N=e[5],d=e[6],h=e[7],I=e[8],S=r*R+o*l+s*T,m=i*R+u*l+c*T,M=a*R+E*l+_*T,O=r*A+o*f+s*N,y=i*A+u*f+c*N,p=a*A+E*f+_*N,C=r*d+o*h+s*I,U=i*d+u*h+c*I,L=a*d+E*h+_*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},s.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;s.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,s.multiplyByScale(t,A,n)},s.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?s.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)},s.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},s.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},s.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},s.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},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[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},s.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},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[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},s.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]},s.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},s.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},s.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 f=new u,N=new u,d=new e,h=new e(0,0,0,1);return s.inverse=function(t,n){if(u.equalsEpsilon(s.getRotation(t,f),N,o.EPSILON7)&&e.equals(s.getRow(t,3,d),h))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],c=t[12],_=t[1],R=t[5],l=t[9],T=t[13],A=t[2],I=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=I*p,F=m*O,P=I*y,v=S*O,x=A*p,w=m*M,D=A*y,B=S*M,g=A*O,z=I*M,G=C*R+F*l+P*T-(U*R+L*l+v*T),b=U*_+x*l+B*T-(C*_+w*l+D*T),X=L*_+w*R+g*T-(F*_+x*R+z*T),V=v*_+D*R+z*l-(P*_+B*R+g*l),q=U*i+L*a+v*c-(C*i+F*a+P*c),H=C*r+w*a+D*c-(U*r+x*a+B*c),W=F*r+x*i+z*c-(L*r+w*i+g*c),Y=P*r+B*i+g*a-(v*r+D*i+z*a);C=a*T,U=c*l,L=i*T,F=c*R,P=i*l,v=a*R,x=r*T,w=c*_,D=r*l,B=a*_,g=r*R,z=i*_;var K=C*O+F*y+P*p-(U*O+L*y+v*p),k=U*M+x*y+B*p-(C*M+w*y+D*p),Z=L*M+w*O+g*p-(F*M+x*O+z*p),j=v*M+D*O+z*y-(P*M+B*O+g*y),Q=L*S+v*m+U*I-(P*m+C*I+F*S),J=D*m+C*A+w*S-(x*S+B*m+U*A),$=x*I+z*m+F*A-(g*m+L*A+w*I),tt=g*S+P*A+B*I-(D*I+z*S+v*A),et=r*G+i*b+a*X+c*V;if(Math.abs(et)<o.EPSILON20)throw new E("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},s.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],R=t[13],l=t[14],T=-n*_-r*R-i*l,A=-a*_-o*R-u*l,f=-E*_-s*R-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]=T,e[13]=A,e[14]=f,e[15]=1,e},s.IDENTITY=a(new s(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),s.ZERO=a(new s(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN0ROW3=3,s.COLUMN1ROW0=4,s.COLUMN1ROW1=5,s.COLUMN1ROW2=6,s.COLUMN1ROW3=7,s.COLUMN2ROW0=8,s.COLUMN2ROW1=9,s.COLUMN2ROW2=10,s.COLUMN2ROW3=11,s.COLUMN3ROW0=12,s.COLUMN3ROW1=13,s.COLUMN3ROW2=14,s.COLUMN3ROW3=15,s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.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]},s.prototype.equalsEpsilon=function(t,e){return s.equalsEpsilon(this,t,e)},s.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},s}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function i(e,n){this.normal=t.clone(e),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-t.dot(r,n);return e(a)?(t.clone(r,a.normal),a.distance=o,a):new i(r,o)};var a=new t;return i.fromCartesian4=function(n,r){var o=t.fromCartesian4(n,a),u=n.w;return e(r)?(t.clone(o,r.normal),r.distance=u,r):new i(o,u)},i.getPointDistance=function(e,n){return t.dot(e.normal,n)+e.distance},i.ORIGIN_XY_PLANE=r(new i(t.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=r(new i(t.UNIT_X,0)),i.ORIGIN_ZX_PLANE=r(new i(t.UNIT_Y,0)),i}),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){r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north},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 n>e&&(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,R=t.length;R>_;_++){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 T=l.longitude>=0?l.longitude:l.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(e)?(e.west=r,e.south=s,e.east=i,e.north=c,e):new E(r,s,i,c)},E.clone=function(t,e){return n(t)?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):void 0},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;a>i&&(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;a>i&&o>0?i+=u.TWO_PI:s>o&&i>0&&(o+=u.TWO_PI),a>i&&0>s?s+=u.TWO_PI:s>o&&0>a&&(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 R=Math.max(t.south,e.south),l=Math.min(t.north,e.north);if(!(R>=l))return n(r)?(r.west=c,r.south=R,r.east=_,r.north=l,r):new E(c,R,_,l)}},E.union=function(t,e,r){return n(r)||(r=new E),r.west=Math.min(t.west,e.west),r.south=Math.min(t.south,e.south),r.east=Math.max(t.east,e.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 i>a&&(a+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(a>n||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,R=t.south,l=t.east,T=t.west,A=s;A.height=i,A.longitude=T,A.latitude=_,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.latitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=T,o[c]=r.cartographicToCartesian(A,o[c]),c++,0>_?A.latitude=_:R>0?A.latitude=R:A.latitude=0;for(var f=1;8>f;++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=T,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=l,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","./Plane","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_,R){"use strict";function l(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var T=new t,A=new t,f=new t,N=new t,d=new t,h=new t,I=new t,S=new t,m=new t,M=new t,O=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],I),a=t.clone(i,T),o=t.clone(i,A),u=t.clone(i,f),E=t.clone(i,N),s=t.clone(i,d),c=t.clone(i,h),_=e.length,R=1;_>R;R++){t.clone(e[R],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,S)),F=t.magnitudeSquared(t.subtract(s,o,S)),P=t.magnitudeSquared(t.subtract(c,u,S)),v=a,x=E,w=L;F>w&&(w=F,v=o,x=s),P>w&&(w=P,v=u,x=c);var D=m;D.x=.5*(v.x+x.x),D.y=.5*(v.y+x.y),D.z=.5*(v.z+x.z);var B=t.magnitudeSquared(t.subtract(x,D,S)),g=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,S),.5,y),X=0;for(R=0;_>R;R++){t.clone(e[R],i);var V=t.magnitude(t.subtract(i,b,S));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(i,D,S));if(q>B){var H=Math.sqrt(q);g=.5*(g+H),B=g*g;var W=H-g;D.x=(g*D.x+W*i.x)/H,D.y=(g*D.y+W*i.y)/H,D.z=(g*D.z+W*i.z)/H}}return X>g?(t.clone(D,n.center),n.radius=g):(t.clone(b,n.center),n.radius=X),n};var p=new o,C=new t,U=new t,L=new e,F=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,p),R.southwest(e,L),L.height=a,R.northeast(e,F),F.height=o;var E=i.project(L,C),s=i.project(F,U),c=s.x-E.x,_=s.y-E.y,T=s.z-E.z;u.radius=.5*Math.sqrt(c*c+_*_+T*T);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*_,A.z=E.z+.5*T,u};var P=[];l.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=R.subsample(t,e,i,P)),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=I;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,A),c=t.clone(u,f),_=t.clone(u,N),R=t.clone(u,d),p=t.clone(u,h),C=e.length,U=0;C>U;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>R.y&&t.clone(u,R),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var v=t.magnitudeSquared(t.subtract(_,E,S)),x=t.magnitudeSquared(t.subtract(R,s,S)),w=t.magnitudeSquared(t.subtract(p,c,S)),D=E,B=_,g=v;x>g&&(g=x,D=s,B=R),w>g&&(g=w,D=c,B=p);var z=m;z.x=.5*(D.x+B.x),z.y=.5*(D.y+B.y),z.z=.5*(D.z+B.z);var G=t.magnitudeSquared(t.subtract(B,z,S)),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=R.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,S),.5,y),H=0;for(U=0;C>U;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,S));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,S));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 H>b?(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=I;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,A),E=t.clone(a,f),s=t.clone(a,N),c=t.clone(a,d),_=t.clone(a,h),R=e.length,p=0;R>p;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,S)),P=t.magnitudeSquared(t.subtract(c,u,S)),v=t.magnitudeSquared(t.subtract(_,E,S)),x=o,w=s,D=F;P>D&&(D=P,x=u,w=c),v>D&&(D=v,x=E,w=_);var B=m;B.x=.5*(x.x+w.x),B.y=.5*(x.y+w.y),B.z=.5*(x.z+w.z);var g=t.magnitudeSquared(t.subtract(w,B,S)),z=Math.sqrt(g),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,S),.5,y),V=0;for(p=0;R>p;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,S));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(a,B,S));if(H>g){var W=Math.sqrt(H);z=.5*(z+W),g=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 V>z?(t.clone(B,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 v=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;i>o;o++)a.push(e[o].center);n=l.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;i>o;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,v)+s.radius)}return n.radius=E,n};var x=new t,w=new t,D=new t;l.fromOrientedBoundingBox=function(e,n){r(n)||(n=new l);var i=e.halfAxes,a=s.getColumn(i,0,x),o=s.getColumn(i,1,w),u=s.getColumn(i,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},l.clone=function(e,n){return r(e)?r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new l(e.center,e.radius):void 0},l.packedLength=4,l.pack=function(t,e,r){r=n(r,0);var i=t.center;e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius},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 B=new t,g=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,B),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,g);return t.add(R,a,R),t.clone(R,i.center),i.radius=_,i};var z=new t;l.expand=function(e,n,r){r=l.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,z));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-i>o?u.OUTSIDE:i>o?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 G=new t;l.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,G);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 b=new t;l.computePlaneDistances=function(e,n,i,a){r(a)||(a=new E);var o=t.subtract(e.center,n,b),u=t.dot(i,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var X=new t,V=new t,q=new t,H=new t,W=new t,Y=new e,K=new Array(8),k=0;8>k;++k)K[k]=new t;var Z=new o;return l.projectTo2D=function(e,r,i){r=n(r,Z);var a=r.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,X),s=t.cross(t.UNIT_Z,E,V);t.normalize(s,s);var c=t.cross(E,s,q);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),T=K,A=T[0];t.add(E,c,A),t.add(A,s,A),A=T[1],t.add(E,c,A),t.add(A,R,A),A=T[2],t.add(E,_,A),t.add(A,R,A),A=T[3],t.add(E,_,A),t.add(A,s,A),t.negate(E,E),A=T[4],t.add(E,c,A),t.add(A,s,A),A=T[5],t.add(E,c,A),t.add(A,R,A),A=T[6],t.add(E,_,A),t.add(A,R,A),A=T[7],t.add(E,_,A),t.add(A,s,A);for(var f=T.length,N=0;f>N;++N){var d=T[N];t.add(o,d,d);var h=a.cartesianToCartographic(d,Y);r.project(h,d)}i=l.fromPoints(T,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){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n):new a(t.x,t.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r]=e.y},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.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.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("Renderer/WebGLConstants",["../Core/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/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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++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",t(document[i])?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",t(document[i])&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",t(document[i])?r.fullscreenElement=i:(i=E+"FullScreenElement",t(document[i])&&(r.fullscreenElement=i)),i=E+"fullscreenchange",t(document["on"+i])&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",t(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;r>n;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(h)){h=!1;var t=/ Chrome\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(h=!0,I=r(t[1]))}return h}function a(){return i()&&I}function o(){if(!e(S)&&(S=!1,!i()&&/ Safari\/[\.0-9]+/.test(d.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(S=!0,m=r(t[1]))}return S}function u(){return o()&&m}function E(){if(!e(M)){M=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(d.userAgent);null!==t&&(M=!0,O=r(t[1]),O.isNightly=!!t[2])}return M}function s(){return E()&&O}function c(){if(!e(y)){y=!1;var t;"Microsoft Internet Explorer"===d.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(d.userAgent),null!==t&&(y=!0,p=r(t[1]))):"Netscape"===d.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(d.userAgent),null!==t&&(y=!0,p=r(t[1])))}return y}function _(){return c()&&p}function R(){if(!e(C)){C=!1;var t=/Firefox\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(C=!0,U=r(t[1]))}return C}function l(){return e(L)||(L=/Windows/i.test(d.appVersion)),L}function T(){return R()&&U}function A(){return e(F)||(F="undefined"!=typeof PointerEvent&&(!e(d.pointerEnabled)||d.pointerEnabled)),F}function f(){if(!e(v)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;v=e(n)&&""!==n,v&&(P=n)}return v}function N(){return f()?P:void 0}var d;d="undefined"!=typeof navigator?navigator:{};var h,I,S,m,M,O,y,p,C,U,L,F,P,v,x={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isFirefox:R,firefoxVersion:T,isWindows:l,hardwareConcurrency:t(d.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:f,imageRenderingValue:N};return x.supportsFullscreen=function(){return n.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,e,n,r,i,a){"use strict";if(!i.supportsTypedArrays())return{};var o={BYTE:t.BYTE,UNSIGNED_BYTE:t.UNSIGNED_BYTE,SHORT:t.SHORT,UNSIGNED_SHORT:t.UNSIGNED_SHORT,FLOAT:t.FLOAT,DOUBLE:t.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},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 Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return n(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||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.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(t,n,i,a){switch(i=e(i,0),a=e(a,(n.byteLength-i)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,i,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,i,a);case o.SHORT:return new Int16Array(n,i,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,i,a);case o.FLOAT:return new Float32Array(n,i,a);case o.DOUBLE:return new Float64Array(n,i,a);default:throw new r("componentDatatype is not a valid value.")}},a(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),R=0,l=0,T=a?3*s:0,A=a?3*(s+i):3*i;for(o=0;i>o;o++){var f=o/i*t.TWO_PI,N=Math.cos(f),d=Math.sin(f),h=N*r,I=d*r,S=N*n,m=d*n;_[l+T]=h,_[l+T+1]=I,_[l+T+2]=E,_[l+A]=S,_[l+A+1]=m,_[l+A+2]=u,l+=3,a&&(_[R++]=h,_[R++]=I,_[R++]=E,_[R++]=S,_[R++]=m,_[R++]=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",["../Renderer/WebGLConstants","./freezeObject"],function(t,e){"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(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 e(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=void 0}return a.computeNumberOfVertices=function(t){var r=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&e(t.attributes[i])&&e(t.attributes[i].values)){var a=t.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a={UNSIGNED_BYTE:t.UNSIGNED_BYTE,UNSIGNED_SHORT:t.UNSIGNED_SHORT,UNSIGNED_INT:t.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(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,n,r){return t>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,r):new Uint16Array(e,n,r)},r(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){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},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){return e(t)?(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):void 0},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,_,R,l,T){"use strict";function A(t){t=a(t,a.EMPTY_OBJECT);var e=t.length,n=t.topRadius,r=t.bottomRadius,i=a(t.vertexFormat,T.DEFAULT),o=a(t.slices,128);this._length=e,this._topRadius=n,this._bottomRadius=r,this._vertexFormat=T.clone(i),this._slices=o,this._workerName="createCylinderGeometry"}var f=new e,N=new n,d=new n,h=new n,I=new n;A.packedLength=T.packedLength+4,A.pack=function(t,e,n){n=a(n,0),T.pack(t._vertexFormat,e,n),n+=T.packedLength,e[n++]=t._length,e[n++]=t._topRadius,e[n++]=t._bottomRadius,e[n]=t._slices};var S=new T,m={vertexFormat:S,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0};return A.unpack=function(t,e,n){e=a(e,0);var r=T.unpack(t,e,S);e+=T.packedLength;var i=t[e++],u=t[e++],E=t[e++],s=t[e];return o(n)?(n._vertexFormat=T.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 A(m))},A.createGeometry=function(a){var o,u=a._length,T=a._topRadius,A=a._bottomRadius,S=a._vertexFormat,m=a._slices,M=m+m,O=m+M,y=M+M,p=i.computePositions(u,T,A,m,!0),C=S.st?new Float32Array(2*y):void 0,U=S.normal?new Float32Array(3*y):void 0,L=S.tangent?new Float32Array(3*y):void 0,F=S.binormal?new Float32Array(3*y):void 0,P=S.normal||S.tangent||S.binormal;if(P){var v=S.tangent||S.binormal,x=0,w=0,D=0,B=N;B.z=0;var g=h,z=d;for(o=0;m>o;o++){var G=o/m*R.TWO_PI,b=Math.cos(G),X=Math.sin(G);P&&(B.x=b,B.y=X,v&&(g=n.normalize(n.cross(n.UNIT_Z,B,g),g)),S.normal&&(U[x++]=b,U[x++]=X,U[x++]=0,U[x++]=b,U[x++]=X,U[x++]=0),S.tangent&&(L[w++]=g.x,L[w++]=g.y,L[w++]=g.z,L[w++]=g.x,L[w++]=g.y,L[w++]=g.z),S.binormal&&(z=n.normalize(n.cross(B,g,z),z),F[D++]=z.x,F[D++]=z.y,F[D++]=z.z,F[D++]=z.x,F[D++]=z.y,F[D++]=z.z))}for(o=0;m>o;o++)S.normal&&(U[x++]=0,U[x++]=0,U[x++]=-1),S.tangent&&(L[w++]=1,L[w++]=0,L[w++]=0),S.binormal&&(F[D++]=0,F[D++]=-1,F[D++]=0);for(o=0;m>o;o++)S.normal&&(U[x++]=0,U[x++]=0,U[x++]=1),S.tangent&&(L[w++]=1,L[w++]=0,L[w++]=0),S.binormal&&(F[D++]=0,F[D++]=1,F[D++]=0)}var V=12*m-12,q=_.createTypedArray(y,V),H=0,W=0;for(o=0;m-1>o;o++)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,o=1;m-1>o;o++)q[H++]=M+o+1,q[H++]=M+o,q[H++]=M;for(o=1;m-1>o;o++)q[H++]=O,q[H++]=O+o,q[H++]=O+o+1;var Y=0;if(S.st){var K=Math.max(T,A);for(o=0;y>o;o++){var k=n.fromArray(p,3*o,I);C[Y++]=(k.x+K)/(2*K),C[Y++]=(k.y+K)/(2*K)}}var Z=new c;S.position&&(Z.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})),S.normal&&(Z.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:U})),S.tangent&&(Z.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:L})),S.binormal&&(Z.binormal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:F})),S.st&&(Z.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:C})),f.x=.5*u,f.y=Math.max(A,T);var j=new t(n.ZERO,e.magnitude(f));return new E({attributes:Z,indices:q,primitiveType:l.TRIANGLES,boundingSphere:j})},A}),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/Workers/createCylinderOutlineGeometry.js b/Workers/createCylinderOutlineGeometry.js index ec82caf..dcb6d69 100644 --- a/Workers/createCylinderOutlineGeometry.js +++ b/Workers/createCylinderOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,5 +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";var t=function(t){return void 0!==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";var e=function(t,e){return void 0!==t?t:e};return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";var e=function(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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("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^=2636928640&t<<7,t^=4022730752&t<<15,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){"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(t){return t>0?1:0>t?-1:0},n.signNotZero=function(t){return 0>t?-1:1},n.toSNorm=function(t){return Math.round(255*(.5*n.clamp(t,-1,1)+.5))},n.fromSNorm=function(t){return 2*(n.clamp(t,0,255)/255)-1},n.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},n.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},n.lerp=function(t,e,n){return(1-n)*t+n*e},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(t){return t*n.RADIANS_PER_DEGREE},n.toDegrees=function(t){return t*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(t){var e=n.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},n.negativePiToPi=function(t){for(var e=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+e)>t;)t+=i;if(-r>t)return-r;for(;t>r+e;)t-=i;return t>r?r:t},n.zeroToTwoPi=function(t){var e=t%n.TWO_PI;return 0>e?(e+n.TWO_PI)%n.TWO_PI:e},n.equalsEpsilon=function(t,n,r){return r=e(r,0),Math.abs(t-n)<=r};var r=[1];n.factorial=function(t){var e=r.length;if(t>=e)for(var n=r[e-1],i=e;t>=i;i++)r.push(n*i);return r[t]},n.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},n.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},n.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},n.clamp=function(t,e,n){return e>t?e:t>n?n:t};var i=new t;return n.setRandomNumberSeed=function(e){i=new t(e)},n.nextRandomNumber=function(){return i.random()},n.acosClamped=function(t){return Math.acos(n.clamp(t,-1,1))},n.asinClamped=function(t){return Math.asin(n.clamp(t,-1,1))},n}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)};a.fromSpherical=function(n,r){e(r)||(r=new a);var i=n.clock,o=n.cone,u=t(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(t,n,r,i){return e(i)?(i.x=t,i.y=n,i.z=r,i):new a(t,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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.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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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 s=new a,c=new a;a.angleBetween=function(t,e){a.normalize(t,s),a.normalize(e,c);var n=a.dot(s,c),r=a.magnitude(a.cross(s,c,s));return Math.atan2(r,n)};var l=new a;a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,l);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):n.y<=n.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r},a.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,s=e.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},a.fromDegrees=function(t,e,n,r,o){var u=i.toRadians(t),s=i.toRadians(e);return a.fromRadians(u,s,n,r,o)};var f=new a,h=new a,d=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=t(i,0);var s=e(o)?o.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=a.normalize(f,f),a.multiplyComponents(s,f,h);var l=Math.sqrt(a.dot(f,h));return h=a.divideByScalar(h,l,h),f=a.multiplyByScalar(f,i,f),e(u)||(u=new a),a.add(h,f,u)},a.fromDegreesArray=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=i.toRadians(t[o]);return a.fromRadiansArray(r,e,n)},a.fromRadiansArray=function(t,n,r){var i=t.length;e(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],s=t[o+1];r[o/2]=a.fromRadians(u,s,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o+=3)r[o]=i.toRadians(t[o]),r[o+1]=i.toRadians(t[o+1]),r[o+2]=t[o+2];return a.fromRadiansArrayHeights(r,e,n)},a.fromRadiansArrayHeights=function(t,n,r){var i=t.length;e(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],s=t[o+1],c=t[o+2];r[o/3]=a.fromRadians(u,s,c,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)};return a.fromRadians=function(n,r,i,o){return i=t(i,0),e(o)?(o.longitude=n,o.latitude=r,o.height=i,o):new a(n,r,i)},a.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),a.fromRadians(t,e,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new a(t.longitude,t.latitude,t.height):void 0},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.longitude-n.longitude)<=r&&Math.abs(t.latitude-n.latitude)<=r&&Math.abs(t.height-n.height)<=r},a.ZERO=r(new a(0,0,0)),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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),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"],function(t,e,n,r,i,a,o,u){"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}var c=function(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,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))return void 0;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.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),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=s,n.z=c,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 l=new t,f=new t;c.prototype.cartographicToCartesian=function(e,n){var i=l,a=f;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;n>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var h=new t,d=new t,m=new t;c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,d);if(!r(a))return void 0;var o=this.geodeticSurfaceNormal(a,h),s=t.subtract(n,a,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(t.dot(s,n))*t.magnitude(s);return r(i)?(i.longitude=c,i.latitude=l,i.height=f,i):new e(c,l,f)},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;n>i;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e};var y=new t,p=new t;return c.prototype.scaleToGeodeticSurface=function(e,n){var i=e.x,a=e.y,o=e.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,h=i*i*c*c,d=a*a*l*l,m=o*o*f*f,v=h+d+m,w=Math.sqrt(1/v),x=t.multiplyByScalar(e,w,y);if(v<this._centerToleranceSquared)return isFinite(w)?t.clone(x,n):void 0;var E=this._oneOverRadiiSquared,g=E.x,M=E.y,S=E.z,z=p;z.x=2*x.x*g,z.y=2*x.y*M,z.z=2*x.z*S;var O,T,R,_,N,I,b,A,C,P,L,U=(1-w)*t.magnitude(e)/(.5*t.magnitude(z)),q=0;do{U-=q,R=1/(1+U*g),_=1/(1+U*M),N=1/(1+U*S),I=R*R,b=_*_,A=N*N,C=I*R,P=b*_,L=A*N,O=h*I+d*b+m*A-1,T=h*C*g+d*P*M+m*L*S;var D=-2*T;q=O/D}while(Math.abs(O)>u.EPSILON12);return r(n)?(n.x=i*R,n.y=a*_,n.z=o*N,n):new t(i*R,a*_,o*N)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,s,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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";var u=function(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";var e=function(e,n){this.start=t(e,0),this.stop=t(n,0)};return e}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";var i=function(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)};i.fromElements=function(t,n,r,a,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=a,o):new i(t,n,r,a)},i.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 i(t.red,t.green,t.blue,t.alpha)},i.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new i(t.x,t.y,t.z,t.w):void 0},i.packedLength=4,i.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r++],a.w=n[r],a},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,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},i.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},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 a=new i;i.distance=function(t,e){return i.subtract(t,e,a),i.magnitude(a)},i.normalize=function(t,e){var n=i.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,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,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},i.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},i.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},i.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},i.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},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 o=new i;i.lerp=function(t,e,n,r){return i.multiplyByScalar(e,n,o),r=i.multiplyByScalar(t,1-n,r),i.add(o,r,r)};var u=new i;return i.mostOrthogonalAxis=function(t,e){var n=i.normalize(t,u);return i.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?i.clone(i.UNIT_X,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e):n.y<=n.z?n.y<=n.w?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e)},i.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},i.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r&&Math.abs(t.w-n.w)<=r},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(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e){return i.equalsEpsilon(this,t,e)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t){for(var e=0,n=0;9>n;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function u(t){for(var e=0,n=0;3>n;++n){var r=t[c.getElementIndex(d[n],h[n])];e+=2*r*r}return Math.sqrt(e)}function s(t,e){for(var n=a.EPSILON15,r=0,i=1,o=0;3>o;++o){var u=Math.abs(t[c.getElementIndex(d[o],h[o])]);u>r&&(i=o,r=u)}var s=1,l=0,f=h[i],m=d[i];if(Math.abs(t[c.getElementIndex(m,f)])>n){var y,p=t[c.getElementIndex(m,m)],v=t[c.getElementIndex(f,f)],w=t[c.getElementIndex(m,f)],x=(p-v)/2/w;y=0>x?-1/(-x+Math.sqrt(1+x*x)):1/(x+Math.sqrt(1+x*x)),s=1/Math.sqrt(1+y*y),l=y*s}return e=c.clone(c.IDENTITY,e),e[c.getElementIndex(f,f)]=e[c.getElementIndex(m,m)]=s,e[c.getElementIndex(m,f)]=l,e[c.getElementIndex(f,m)]=-l,e}var c=function(t,n,r,i,a,o,u,s,c){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(s,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(c,0)};c.clone=function(t,e){return n(t)?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 c(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},c.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new c),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},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[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 c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},c.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,u=t.y*t.y,s=t.y*t.z,l=t.y*t.w,f=t.z*t.z,h=t.z*t.w,d=t.w*t.w,m=r-u-f+d,y=2*(i-h),p=2*(a+l),v=2*(i+h),w=-r+u-f+d,x=2*(s-o),E=2*(a-l),g=2*(s+o),M=-r-u+f+d;return n(e)?(e[0]=m,e[1]=v,e[2]=E,e[3]=y,e[4]=w,e[5]=g,e[6]=p,e[7]=x,e[8]=M,e):new c(m,y,p,v,w,x,E,g,M)},c.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 c(t.x,0,0,0,t.y,0,0,0,t.z)},c.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 c(t,0,0,0,t,0,0,0,t)},c.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 c(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},c.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 c(1,0,0,0,r,-i,0,i,r)},c.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 c(r,0,i,0,1,0,-i,0,r)},c.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 c(r,-i,0,i,r,0,0,0,1)},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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},c.getElementIndex=function(t,e){return 3*t+e},c.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},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},c.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},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,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[3],e[4],e[5],l)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],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]*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],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],c=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],f=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]=s,n[6]=c,n[7]=l,n[8]=f,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},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},c.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,s=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=s,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},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},c.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],s=t[2],c=t[5],l=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=s,e[7]=c,e[8]=l,e};var h=[1,0,0],d=[2,2,1],m=new c,y=new c;return c.computeEigenDecomposition=function(t,e){var r=a.EPSILON20,i=10,l=0,f=0;n(e)||(e={});for(var h=e.unitary=c.clone(c.IDENTITY,e.unitary),d=e.diagonal=c.clone(t,e.diagonal),p=r*o(d);i>f&&u(d)>p;)s(d,m),c.transpose(m,y),c.multiply(d,m,d),c.multiply(y,d,d),c.multiply(h,m,h),++l>2&&(++f,l=0);return 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},c.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],s=t[5],c=t[8];return e*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},c.inverse=function(t,e){var n=t[0],i=t[1],o=t[2],u=t[3],s=t[4],l=t[5],f=t[6],h=t[7],d=t[8],m=c.determinant(t);if(Math.abs(m)<=a.EPSILON15)throw new r("matrix is not invertible");e[0]=s*d-h*l,e[1]=h*o-i*d,e[2]=i*l-s*o,e[3]=f*l-u*d,e[4]=n*d-f*o,e[5]=u*o-n*l,e[6]=u*h-f*s,e[7]=f*i-n*h,e[8]=n*s-u*i;var y=1/m;return c.multiplyByScalar(e,y,e)},c.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]},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},c.IDENTITY=i(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(t){"use strict";var e=function(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,s){"use strict";var c=function(t,e,r,i,a,o,u,s,c,l,f,h,d,m,y,p){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(e,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(m,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(y,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(p,0)};c.packedLength=16,c.pack=function(t,e,r){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]},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){return r(t)?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]):void 0},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,s=e.x*e.x,l=e.x*e.y,f=e.x*e.z,h=e.x*e.w,d=e.y*e.y,m=e.y*e.z,y=e.y*e.w,p=e.z*e.z,v=e.z*e.w,w=e.w*e.w,x=s-d-p+w,E=2*(l-v),g=2*(f+y),M=2*(l+v),S=-s+d-p+w,z=2*(m-h),O=2*(f-y),T=2*(m+h),R=-s-d+p+w;return i[0]=x*a,i[1]=M*a,i[2]=O*a,i[3]=0,i[4]=E*o,i[5]=S*o,i[6]=T*o,i[7]=0,i[8]=g*u,i[9]=z*u,i[10]=R*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},c.fromTranslation=function(t,e){return c.fromRotationTranslation(u.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 l=new t,f=new t,h=new t;c.fromCamera=function(e,n){var i=e.eye,a=e.target,o=e.up;t.normalize(t.subtract(a,i,l),l),t.normalize(t.cross(l,o,f),f),t.normalize(t.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,m=l.x,y=l.y,p=l.z,v=h.x,w=h.y,x=h.z,E=i.x,g=i.y,M=i.z,S=u*-E+s*-g+d*-M,z=v*-E+w*-g+x*-M,O=m*E+y*g+p*M;return r(n)?(n[0]=u,n[1]=v,n[2]=-m,n[3]=0,n[4]=s,n[5]=w,n[6]=-y,n[7]=0,n[8]=d,n[9]=x,n[10]=-p,n[11]=0,n[12]=S,n[13]=z,n[14]=O,n[15]=1,n):new c(u,s,d,S,v,w,x,z,-m,-y,-p,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,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},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),s=1/(r-n),c=1/(a-i),l=-(e+t)*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},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),s=2*i/(r-n),c=(e+t)/(e-t),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},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),s=(e+t)/(e-t),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},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),s=n(t.height,0);e=n(e,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-e),h=c,d=l,m=f,y=a+c,p=o+l,v=e+f,w=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]=m,i[11]=0,i[12]=y,i[13]=p,i[14]=v,i[15]=w,i},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.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 d=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],d)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],d)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],d)),n};var m=new t;c.getMaximumScale=function(e){return c.getScale(e,m),t.maximumComponent(m)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],s=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],m=t[11],y=t[12],p=t[13],v=t[14],w=t[15],x=e[0],E=e[1],g=e[2],M=e[3],S=e[4],z=e[5],O=e[6],T=e[7],R=e[8],_=e[9],N=e[10],I=e[11],b=e[12],A=e[13],C=e[14],P=e[15],L=r*x+u*E+f*g+y*M,U=i*x+s*E+h*g+p*M,q=a*x+c*E+d*g+v*M,D=o*x+l*E+m*g+w*M,B=r*S+u*z+f*O+y*T,F=i*S+s*z+h*O+p*T,G=a*S+c*z+d*O+v*T,W=o*S+l*z+m*O+w*T,V=r*R+u*_+f*N+y*I,Y=i*R+s*_+h*N+p*I,k=a*R+c*_+d*N+v*I,j=o*R+l*_+m*N+w*I,H=r*b+u*A+f*C+y*P,Z=i*b+s*A+h*C+p*P,X=a*b+c*A+d*C+v*P,K=o*b+l*A+m*C+w*P;return n[0]=L,n[1]=U,n[2]=q,n[3]=D,n[4]=B,n[5]=F,n[6]=G,n[7]=W,n[8]=V,n[9]=Y,n[10]=k,n[11]=j,n[12]=H,n[13]=Z,n[14]=X,n[15]=K,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],s=t[6],c=t[8],l=t[9],f=t[10],h=t[12],d=t[13],m=t[14],y=e[0],p=e[1],v=e[2],w=e[4],x=e[5],E=e[6],g=e[8],M=e[9],S=e[10],z=e[12],O=e[13],T=e[14],R=r*y+o*p+c*v,_=i*y+u*p+l*v,N=a*y+s*p+f*v,I=r*w+o*x+c*E,b=i*w+u*x+l*E,A=a*w+s*x+f*E,C=r*g+o*M+c*S,P=i*g+u*M+l*S,L=a*g+s*M+f*S,U=r*z+o*O+c*T+h,q=i*z+u*O+l*T+d,D=a*z+s*O+f*T+m;return n[0]=R,n[1]=_,n[2]=N,n[3]=0,n[4]=I,n[5]=b,n[6]=A,n[7]=0,n[8]=C,n[9]=P,n[10]=L,n[11]=0,n[12]=U,n[13]=q,n[14]=D,n[15]=1,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],s=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]=s,n[15]=t[15],n};var y=new t;c.multiplyByUniformScale=function(t,e,n){return y.x=e,y.y=e,y.z=e,c.multiplyByScale(t,y,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,s=t[1]*r+t[5]*i+t[9]*a+t[13]*o,c=t[2]*r+t[6]*i+t[10]*a+t[14]*o,l=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,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,s=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=s,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],s=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=s,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[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[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]},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 p=new u,v=new u,w=new e,x=new e(0,0,0,1);return c.inverse=function(t,n){if(u.equalsEpsilon(c.getRotation(t,p),v,o.EPSILON7)&&e.equals(c.getRow(t,3,w),x))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],l=t[12],f=t[1],h=t[5],d=t[9],m=t[13],y=t[2],E=t[6],g=t[10],M=t[14],S=t[3],z=t[7],O=t[11],T=t[15],R=g*T,_=M*O,N=E*T,I=M*z,b=E*O,A=g*z,C=y*T,P=M*S,L=y*O,U=g*S,q=y*z,D=E*S,B=R*h+I*d+b*m-(_*h+N*d+A*m),F=_*f+C*d+U*m-(R*f+P*d+L*m),G=N*f+P*h+q*m-(I*f+C*h+D*m),W=A*f+L*h+D*d-(b*f+U*h+q*d),V=_*i+N*a+A*l-(R*i+I*a+b*l),Y=R*r+P*a+L*l-(_*r+C*a+U*l),k=I*r+C*i+D*l-(N*r+P*i+q*l),j=b*r+U*i+q*a-(A*r+L*i+D*a);R=a*m,_=l*d,N=i*m,I=l*h,b=i*d,A=a*h,C=r*m,P=l*f,L=r*d,U=a*f,q=r*h,D=i*f;var H=R*z+I*O+b*T-(_*z+N*O+A*T),Z=_*S+C*O+U*T-(R*S+P*O+L*T),X=N*S+P*z+q*T-(I*S+C*z+D*T),K=A*S+L*z+D*O-(b*S+U*z+q*O),J=N*g+A*M+_*E-(b*M+R*E+I*g),Q=L*M+R*y+P*g-(C*g+U*M+_*y),$=C*E+D*M+I*y-(q*M+N*y+P*E),te=q*g+b*y+U*E-(L*E+D*g+A*y),ee=r*B+i*F+a*G+l*W;if(Math.abs(ee)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return ee=1/ee,n[0]=B*ee,n[1]=F*ee,n[2]=G*ee,n[3]=W*ee,n[4]=V*ee,n[5]=Y*ee,n[6]=k*ee,n[7]=j*ee,n[8]=H*ee,n[9]=Z*ee,n[10]=X*ee,n[11]=K*ee,n[12]=J*ee,n[13]=Q*ee,n[14]=$*ee,n[15]=te*ee,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],s=t[8],c=t[9],l=t[10],f=t[12],h=t[13],d=t[14],m=-n*f-r*h-i*d,y=-a*f-o*h-u*d,p=-s*f-c*h-l*d;return e[0]=n,e[1]=a,e[2]=s,e[3]=0,e[4]=r,e[5]=o,e[6]=c,e[7]=0,e[8]=i,e[9]=u,e[10]=l,e[11]=0,e[12]=m,e[13]=y,e[14]=p,e[15]=1,e},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";var u=function(t,n,r,i){this.west=e(t,0),this.south=e(n,0),this.east=e(r,0),this.north=e(i,0)};u.fromDegrees=function(t,r,i,a,s){return t=o.toRadians(e(t,0)),r=o.toRadians(e(r,0)),i=o.toRadians(e(i,0)),a=o.toRadians(e(a,0)),n(s)?(s.west=t,s.south=r,s.east=i,s.north=a,s):new u(t,r,i,a)},u.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=t.length;c>s;s++){var l=t[s];r=Math.min(r,l.longitude),i=Math.max(i,l.longitude),a=Math.min(a,l.latitude),o=Math.max(o,l.latitude)}return n(e)?(e.west=r,e.south=a,e.east=i,e.north=o,e):new u(r,a,i,o)},u.packedLength=4,u.pack=function(t,n,r){r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i.west=t[r++],i.south=t[r++],i.east=t[r++],i.north=t[r],i},u.clone=function(t,e){return n(t)?n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new u(t.west,t.south,t.east,t.north):void 0},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.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},u.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},u.validate=function(){},u.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)},u.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)},u.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)},u.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)},u.center=function(e,r){var i=e.east,a=e.west,u=.5*(a+i);return a>i&&(u=o.negativePiToPi(u+o.PI)),n(r)?(r.longitude=u,r.latitude=.5*(e.south+e.north),r.height=0,r):new t(u,.5*(e.south+e.north))},u.intersectWith=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),s=Math.min(t.north,e.north);return n(r)?(r.west=i,r.south=a,r.east=o,r.north=s,r):new u(i,a,o,s)},u.contains=function(t,e){return e.longitude>=t.west&&e.longitude<=t.east&&e.latitude>=t.south&&e.latitude<=t.north},u.isEmpty=function(t){return t.west>=t.east||t.south>=t.north};var s=new t;return u.subsample=function(t,r,a,u){r=e(r,i.WGS84),a=e(a,0),n(u)||(u=[]);var c=0,l=t.north,f=t.south,h=t.east,d=t.west,m=s;m.height=a,m.longitude=d,m.latitude=l,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:f>0?f:0;for(var y=1;8>y;++y){var p=-Math.PI+y*o.PI_OVER_TWO;p>d&&h>p&&(m.longitude=p,u[c]=r.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,s,c,l){"use strict";var f=function(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)},h=new t,d=new t,m=new t,y=new t,p=new t,v=new t,w=new t,x=new t,E=new t,g=new t,M=new t,S=new t;f.fromPoints=function(e,n){if(r(n)||(n=new f),!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],w),a=t.clone(i,h),o=t.clone(i,d),u=t.clone(i,m),s=t.clone(i,y),c=t.clone(i,p),l=t.clone(i,v),z=e.length,O=1;z>O;O++){t.clone(e[O],i);var T=i.x,R=i.y,_=i.z;T<a.x&&t.clone(i,a),T>s.x&&t.clone(i,s),R<o.y&&t.clone(i,o),R>c.y&&t.clone(i,c),_<u.z&&t.clone(i,u),_>l.z&&t.clone(i,l)}var N=t.magnitudeSquared(t.subtract(s,a,x)),I=t.magnitudeSquared(t.subtract(c,o,x)),b=t.magnitudeSquared(t.subtract(l,u,x)),A=a,C=s,P=N;I>P&&(P=I,A=o,C=c),b>P&&(P=b,A=u,C=l);var L=E;L.x=.5*(A.x+C.x),L.y=.5*(A.y+C.y),L.z=.5*(A.z+C.z);var U=t.magnitudeSquared(t.subtract(C,L,x)),q=Math.sqrt(U),D=g;D.x=a.x,D.y=o.y,D.z=u.z;var B=M;B.x=s.x,B.y=c.y,B.z=l.z;var F=t.multiplyByScalar(t.add(D,B,x),.5,S),G=0;for(O=0;z>O;O++){t.clone(e[O],i);var W=t.magnitude(t.subtract(i,F,x));W>G&&(G=W);var V=t.magnitudeSquared(t.subtract(i,L,x));if(V>U){var Y=Math.sqrt(V);q=.5*(q+Y),U=q*q;var k=Y-q;L.x=(q*L.x+k*i.x)/Y,L.y=(q*L.y+k*i.y)/Y,L.z=(q*L.z+k*i.z)/Y}}return G>q?(t.clone(L,n.center),n.radius=q):(t.clone(F,n.center),n.radius=G),n};var z=new o,O=new t,T=new t,R=new e,_=new e;f.fromRectangle2D=function(t,e,n){return f.fromRectangleWithHeights2D(t,e,0,0,n)},f.fromRectangleWithHeights2D=function(e,i,a,o,u){if(r(u)||(u=new f),!r(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;i=n(i,z),l.southwest(e,R),R.height=a,l.northeast(e,_),_.height=o;var s=i.project(R,O),c=i.project(_,T),h=c.x-s.x,d=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(h*h+d*d+m*m);var y=u.center;return y.x=s.x+.5*h,y.y=s.y+.5*d,y.z=s.z+.5*m,u};var N=[];f.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=l.subsample(t,e,i,N)),f.fromPoints(u,o)},f.fromVertices=function(e,i,a,o){if(r(o)||(o=new f),!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=w;u.x=e[0]+i.x,u.y=e[1]+i.y,u.z=e[2]+i.z;for(var s=t.clone(u,h),c=t.clone(u,d),l=t.clone(u,m),z=t.clone(u,y),O=t.clone(u,p),T=t.clone(u,v),R=e.length,_=0;R>_;_+=a){var N=e[_]+i.x,I=e[_+1]+i.y,b=e[_+2]+i.z;u.x=N,u.y=I,u.z=b,N<s.x&&t.clone(u,s),N>z.x&&t.clone(u,z),I<c.y&&t.clone(u,c),I>O.y&&t.clone(u,O),b<l.z&&t.clone(u,l),b>T.z&&t.clone(u,T)}var A=t.magnitudeSquared(t.subtract(z,s,x)),C=t.magnitudeSquared(t.subtract(O,c,x)),P=t.magnitudeSquared(t.subtract(T,l,x)),L=s,U=z,q=A;C>q&&(q=C,L=c,U=O),P>q&&(q=P,L=l,U=T);var D=E;D.x=.5*(L.x+U.x),D.y=.5*(L.y+U.y),D.z=.5*(L.z+U.z);var B=t.magnitudeSquared(t.subtract(U,D,x)),F=Math.sqrt(B),G=g;G.x=s.x,G.y=c.y,G.z=l.z;var W=M;W.x=z.x,W.y=O.y,W.z=T.z;var V=t.multiplyByScalar(t.add(G,W,x),.5,S),Y=0;for(_=0;R>_;_+=a){u.x=e[_]+i.x,u.y=e[_+1]+i.y,u.z=e[_+2]+i.z;var k=t.magnitude(t.subtract(u,V,x));k>Y&&(Y=k);var j=t.magnitudeSquared(t.subtract(u,D,x));if(j>B){var H=Math.sqrt(j);F=.5*(F+H),B=F*F;var Z=H-F;D.x=(F*D.x+Z*u.x)/H,D.y=(F*D.y+Z*u.y)/H,D.z=(F*D.z+Z*u.z)/H}}return Y>F?(t.clone(D,o.center),o.radius=F):(t.clone(V,o.center),o.radius=Y),o},f.fromCornerPoints=function(e,n,i){r(i)||(i=new f);var a=i.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),i.radius=t.distance(a,n),i},f.fromEllipsoid=function(e,n){return r(n)||(n=new f),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n},f.clone=function(e,n){return r(e)?r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new f(e.center,e.radius):void 0},f.packedLength=4,f.pack=function(t,e,r){r=n(r,0);var i=t.center;e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius},f.unpack=function(t,e,i){e=n(e,0),r(i)||(i=new f);var a=i.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],i.radius=t[e],i};var I=new t,b=new t;f.union=function(e,n,i){r(i)||(i=new f);var a=e.center,o=n.center;t.add(a,o,b);var u=t.multiplyByScalar(b,.5,b),s=t.magnitude(t.subtract(a,u,I))+e.radius,c=t.magnitude(t.subtract(o,u,I))+n.radius;return i.radius=Math.max(s,c),t.clone(u,i.center),i};var A=new t;f.expand=function(e,n,r){r=f.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,A));return i>r.radius&&(r.radius=i),r},f.intersect=function(e,n){var r=e.center,i=e.radius,a=t.dot(n,r)+n.w;return-i>a?u.OUTSIDE:i>a?u.INTERSECTING:u.INSIDE},f.transform=function(t,e,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var C=new t;f.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,C);return t.magnitudeSquared(r)-e.radius*e.radius},f.transformWithoutScale=function(t,e,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var P=new t;f.computePlaneDistances=function(e,n,i,a){r(a)||(a=new s);var o=t.subtract(e.center,n,P),u=t.multiplyByScalar(i,t.dot(i,o),P),c=t.magnitude(u);return a.start=c-e.radius,a.stop=c+e.radius,a};for(var L=new t,U=new t,q=new t,D=new t,B=new t,F=new e,G=new Array(8),W=0;8>W;++W)G[W]=new t;var V=new o;return f.projectTo2D=function(e,r,i){r=n(r,V);var a=r.ellipsoid,o=e.center,u=e.radius,s=a.geodeticSurfaceNormal(o,L),c=t.cross(t.UNIT_Z,s,U);t.normalize(c,c);var l=t.cross(s,c,q);t.normalize(l,l),t.multiplyByScalar(s,u,s),t.multiplyByScalar(l,u,l),t.multiplyByScalar(c,u,c);var h=t.negate(l,B),d=t.negate(c,D),m=G,y=m[0];t.add(s,l,y),t.add(y,c,y),y=m[1],t.add(s,l,y),t.add(y,d,y),y=m[2],t.add(s,h,y),t.add(y,d,y),y=m[3],t.add(s,h,y),t.add(y,c,y),t.negate(s,s),y=m[4],t.add(s,l,y),t.add(y,c,y),y=m[5],t.add(s,l,y),t.add(y,d,y),y=m[6],t.add(s,h,y),t.add(y,d,y),y=m[7],t.add(s,h,y),t.add(y,c,y);for(var p=m.length,v=0;p>v;++v){var w=m[v];t.add(o,w,w);var x=a.cartesianToCartographic(w,F);r.project(x,w)}i=f.fromPoints(m,i),o=i.center;var E=o.x,g=o.y,M=o.z;return o.x=M,o.y=E,o.z=g,i},f.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},f.prototype.intersect=function(t){return f.intersect(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/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(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){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n):new a(t.x,t.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r]=e.y},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.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.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.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 s=new a,c=new a;a.angleBetween=function(t,e){return a.normalize(t,s),a.normalize(e,c),i.acosClamped(a.dot(s,c))};var l=new a;return a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,l);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.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r},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){return a.equalsEpsilon(this,t,e)},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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof e[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",t(document[i])?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",t(document[i])&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",t(document[i])?r.fullscreenElement=i:(i=s+"FullScreenElement",t(document[i])&&(r.fullscreenElement=i)),i=s+"fullscreenchange",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t){i.supportsFullscreen()&&t[r.requestFullscreen]()},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;r>n;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(m)){m=!1;var t=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(m=!0,y=r(t[1]))}return m}function a(){return i()&&y}function o(){if(!e(p)&&(p=!1,!i()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(p=!0,v=r(t[1]))}return p}function u(){return o()&&v}function s(){if(!e(w)){w=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==t&&(w=!0,x=r(t[1]),x.isNightly=!!t[2])}return w}function c(){return s()&&x}function l(){if(!e(E)){E=!1;var t;"Microsoft Internet Explorer"===navigator.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(E=!0,g=r(t[1]))):"Netscape"===navigator.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(E=!0,g=r(t[1])))}return E}function f(){return l()&&g}function h(){if(!e(M)){M=!1;var t=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(M=!0,S=r(t[1]))}return M}function d(){return h()&&S}var m,y,p,v,w,x,E,g,M,S,z={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:d,hardwareConcurrency:t(navigator.hardwareConcurrency,3)};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,e,n,r,i){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(t){switch(t){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(t){return t instanceof Int8Array?a.BYTE:t instanceof Uint8Array?a.UNSIGNED_BYTE:t instanceof Int16Array?a.SHORT:t instanceof Uint16Array?a.UNSIGNED_SHORT:t instanceof Float32Array?a.FLOAT:t instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(t){return e(t)&&(t===a.BYTE||t===a.UNSIGNED_BYTE||t===a.SHORT||t===a.UNSIGNED_SHORT||t===a.FLOAT||t===a.DOUBLE)},a.createTypedArray=function(t,e){switch(t){case a.BYTE:return new Int8Array(e);case a.UNSIGNED_BYTE:return new Uint8Array(e);case a.SHORT:return new Int16Array(e);case a.UNSIGNED_SHORT:return new Uint16Array(e);case a.FLOAT:return new Float32Array(e);case a.DOUBLE:return new Float64Array(e);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(e,r,i,o){switch(i=t(i,0),o=t(o,(r.byteLength-i)/a.getSizeInBytes(e)),e){case a.BYTE:return new Int8Array(r,i,o);case a.UNSIGNED_BYTE:return new Uint8Array(r,i,o);case a.SHORT:return new Int16Array(r,i,o);case a.UNSIGNED_SHORT:return new Uint16Array(r,i,o);case a.FLOAT:return new Float32Array(r,i,o);case a.DOUBLE:return new Float64Array(r,i,o);default:throw new n("componentDatatype is not a valid value.")}},i(a)}),define("Core/CylinderGeometryLibrary",["./Math"],function(t){"use strict";var e={};return e.computePositions=function(e,n,r,i,a){var o,u=.5*e,s=-u,c=i+i,l=a?2*c:c,f=new Float64Array(3*l),h=0,d=0,m=a?3*c:0,y=a?3*(c+i):3*i;for(o=0;i>o;o++){var p=o/i*t.TWO_PI,v=Math.cos(p),w=Math.sin(p),x=v*r,E=w*r,g=v*n,M=w*n;f[d+m]=x,f[d+m+1]=E,f[d+m+2]=s,f[d+y]=g,f[d+y+1]=M,f[d+y+2]=u,d+=3,a&&(f[h++]=x,f[h++]=E,f[h++]=s,f[h++]=g,f[h++]=M,f[h++]=u)}return f},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"],function(t){"use strict";var e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(t){return t===e.POINTS||t===e.LINES||t===e.LINE_LOOP||t===e.LINE_STRIP||t===e.TRIANGLES||t===e.TRIANGLE_STRIP||t===e.TRIANGLE_FAN}};return t(e)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";var a=function(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)};return a.computeNumberOfVertices=function(t){var r=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&e(t.attributes[i])&&e(t.attributes[i].values)){var a=t.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t){"use strict";var e=function(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 e}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";var e=function(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"],function(t,e,n,r){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,i){return t>r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(i)}),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,s,c,l,f,h){"use strict";var d=new e,m=function(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"};return m.createGeometry=function(a){var o,u=a._length,m=a._topRadius,y=a._bottomRadius,p=a._slices,v=a._numberOfVerticalLines,w=2*p,x=i.computePositions(u,m,y,p,!1),E=2*p;if(v>0){var g=Math.min(v,p);o=Math.round(p/g),E+=g}for(var M=f.createTypedArray(w,2*E),S=0,z=0;p-1>z;z++)M[S++]=z,M[S++]=z+1,M[S++]=z+p,M[S++]=z+1+p;if(M[S++]=p-1,M[S++]=0,M[S++]=p+p-1,M[S++]=p,v>0)for(z=0;p>z;z+=o)M[S++]=z,M[S++]=z+p;var O=new l;O.position=new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:x}),d.x=.5*u,d.y=Math.max(y,m);var T=new t(n.ZERO,e.magnitude(d));return new s({attributes:O,indices:M,primitiveType:h.LINES,boundingSphere:T})},m}),define("Workers/createCylinderOutlineGeometry",["../Core/CylinderOutlineGeometry"],function(t){"use strict";return t.createGeometry})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==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(n){e=n.stack}this.stack=e}return 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("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:0>t?-1:0},i.signNotZero=function(t){return 0>t?-1:1},i.toSNorm=function(t){return Math.round(255*(.5*i.clamp(t,-1,1)+.5))},i.fromSNorm=function(t){return i.clamp(t,0,255)/255*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.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 i>=a||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;t>=r;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 e>t?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";function a(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}a.fromSpherical=function(n,r){e(r)||(r=new a);var i=n.clock,o=n.cone,u=t(n.magnitude,1),E=u*Math.sin(o);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(t,n,r,i){return e(i)?(i.x=t,i.y=n,i.z=r,i):new a(t,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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){a.normalize(t,E),a.normalize(e,s);var n=a.dot(E,s),r=a.magnitude(a.cross(E,s,E));return Math.atan2(r,n)};var c=new a;a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,c);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):n.y<=n.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},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)},a.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},a.fromDegrees=function(t,e,n,r,o){var u=i.toRadians(t),E=i.toRadians(e);return a.fromRadians(u,E,n,r,o)};var _=new a,R=new a,T=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=t(i,0);var E=e(o)?o.radiiSquared:T,s=Math.cos(r);_.x=s*Math.cos(n),_.y=s*Math.sin(n),_.z=Math.sin(r),_=a.normalize(_,_),a.multiplyComponents(E,_,R);var c=Math.sqrt(a.dot(_,R));return R=a.divideByScalar(R,c,R),_=a.multiplyByScalar(_,i,_),e(u)||(u=new a),a.add(R,_,u)},a.fromDegreesArray=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=i.toRadians(t[o]);return a.fromRadiansArray(r,e,n)},a.fromRadiansArray=function(t,n,r){var i=t.length;e(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],E=t[o+1];r[o/2]=a.fromRadians(u,E,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o+=3)r[o]=i.toRadians(t[o]),r[o+1]=i.toRadians(t[o+1]),r[o+2]=t[o+2];return a.fromRadiansArrayHeights(r,e,n)},a.fromRadiansArrayHeights=function(t,n,r){var i=t.length;e(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],E=t[o+1],s=t[o+2];r[o/3]=a.fromRadians(u,E,s,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(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+")"},a}),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,R=n.z,T=i.x,l=i.y,A=i.z,f=c*c*T*T,d=_*_*l*l,N=R*R*A*A,h=f+d+N,I=Math.sqrt(1/h),S=t.multiplyByScalar(n,I,a);if(E>h)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 C,p,U,L,F,P,v,x,D,B,w,g=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{g-=z,U=1/(1+g*M),L=1/(1+g*m),F=1/(1+g*O),P=U*U,v=L*L,x=F*F,D=P*U,B=v*L,w=x*F,C=f*P+d*v+N*x-1,p=f*D*M+d*B*m+N*w*O;var G=-2*p;z=C/G}while(Math.abs(C)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=R*F,s):new t(c*U,_*L,R*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),R=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),T=a.EPSILON1;return u.fromCartesian=function(e,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:R,f=n(r)?r._centerToleranceSquared:T,d=o(e,l,A,f,s);if(n(d)){var N=t.multiplyComponents(e,A,E);N=t.normalize(N,N);var h=t.subtract(e,d,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=a.sign(t.dot(h,e))*t.magnitude(h);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(t,e){return n(t)?n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height):void 0},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}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,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){i=n(i,0),t.pack(e._radii,r,i)},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,R=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=R;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;n>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var T=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,T),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;n>i;++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}),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","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(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 u(t){for(var e=0,n=0;9>n;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function E(t){for(var e=0,n=0;3>n;++n){var r=t[o.getElementIndex(T[n],R[n])];e+=2*r*r}return Math.sqrt(e)}function s(t,e){for(var n=a.EPSILON15,r=0,i=1,u=0;3>u;++u){var E=Math.abs(t[o.getElementIndex(T[u],R[u])]);E>r&&(i=u,r=E)}var s=1,c=0,_=R[i],l=T[i];if(Math.abs(t[o.getElementIndex(l,_)])>n){var A,f=t[o.getElementIndex(l,l)],d=t[o.getElementIndex(_,_)],N=t[o.getElementIndex(l,_)],h=(f-d)/2/N;A=0>h?-1/(-h+Math.sqrt(1+h*h)):1/(h+Math.sqrt(1+h*h)),s=1/Math.sqrt(1+A*A),c=A*s}return e=o.clone(o.IDENTITY,e),e[o.getElementIndex(_,_)]=e[o.getElementIndex(l,l)]=s,e[o.getElementIndex(l,_)]=c,e[o.getElementIndex(_,l)]=-c,e}o.packedLength=9,o.pack=function(t,n,r){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]},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),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},o.clone=function(t,e){return n(t)?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 o(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},o.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new o),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},o.fromColumnMajorArray=function(t,e){return o.clone(t,e)},o.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 o(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},o.fromQuaternion=function(t,e){var r=t.x*t.x,i=t.x*t.y,a=t.x*t.z,u=t.x*t.w,E=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,R=t.z*t.w,T=t.w*t.w,l=r-E-_+T,A=2*(i-R),f=2*(a+c),d=2*(i+R),N=-r+E-_+T,h=2*(s-u),I=2*(a-c),S=2*(s+u),M=-r-E+_+T;return n(e)?(e[0]=l,e[1]=d,e[2]=I,e[3]=A,e[4]=N,e[5]=S,e[6]=f,e[7]=h,e[8]=M,e):new o(l,A,f,d,N,h,I,S,M)},o.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 o(t.x,0,0,0,t.y,0,0,0,t.z)},o.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 o(t,0,0,0,t,0,0,0,t)},o.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 o(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},o.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 o(1,0,0,0,r,-i,0,i,r)},o.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 o(r,0,i,0,1,0,-i,0,r)},o.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 o(r,-i,0,i,r,0,0,0,1)},o.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]]},o.getElementIndex=function(t,e){return 3*t+e},o.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},o.setColumn=function(t,e,n,r){r=o.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},o.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},o.setRow=function(t,e,n,r){return r=o.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var c=new t;o.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],c)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],c)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],c)),n};var _=new t;o.getMaximumScale=function(e){return o.getScale(e,_),t.maximumComponent(_)},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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],T=[2,2,1],l=new o,A=new o;return o.computeEigenDecomposition=function(t,e){var r=a.EPSILON20,i=10,c=0,_=0;n(e)||(e={});for(var R=e.unitary=o.clone(o.IDENTITY,e.unitary),T=e.diagonal=o.clone(t,e.diagonal),f=r*u(T);i>_&&E(T)>f;)s(T,l),o.transpose(l,A),o.multiply(T,l,T),o.multiply(A,T,T),o.multiply(R,l,R),++c>2&&(++_,c=0);return e},o.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},o.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)},o.inverse=function(t,e){var n=t[0],i=t[1],u=t[2],E=t[3],s=t[4],c=t[5],_=t[6],R=t[7],T=t[8],l=o.determinant(t);if(Math.abs(l)<=a.EPSILON15)throw new r("matrix is not invertible");e[0]=s*T-R*c,e[1]=R*u-i*T,e[2]=i*c-s*u,e[3]=_*c-E*T,e[4]=n*T-_*u,e[5]=E*u-n*c,e[6]=E*R-_*s,e[7]=_*i-n*R,e[8]=n*s-E*i;var A=1/l;return o.multiplyByScalar(e,A,e)},o.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]},o.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},o.IDENTITY=i(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=i(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.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]},o.prototype.equalsEpsilon=function(t,e){return o.equalsEpsilon(this,t,e)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return e(t)?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):void 0},a.packedLength=4,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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.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.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(n){e=n.stack}this.stack=e}return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(t,e,r,i,a,o,u,E,s,c,_,R,T,l,A,f){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(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(R,0),this[15]=n(f,0)}s.packedLength=16,s.pack=function(t,e,r){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]},s.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new s),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},s.clone=function(t,e){return r(t)?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 s(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]):void 0},s.fromArray=s.unpack,s.fromColumnMajorArray=function(t,e){return s.clone(t,e)},s.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 s(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])},s.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 s(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)},s.fromTranslationQuaternionRotationScale=function(t,e,n,i){r(i)||(i=new s);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,c=e.x*e.y,_=e.x*e.z,R=e.x*e.w,T=e.y*e.y,l=e.y*e.z,A=e.y*e.w,f=e.z*e.z,d=e.z*e.w,N=e.w*e.w,h=E-T-f+N,I=2*(c-d),S=2*(_+A),M=2*(c+d),m=-E+T-f+N,O=2*(l-R),y=2*(_-A),C=2*(l+R),p=-E-T+f+N;return i[0]=h*a,i[1]=M*a,i[2]=y*a,i[3]=0,i[4]=I*o,i[5]=m*o,i[6]=C*o,i[7]=0,i[8]=S*u,i[9]=O*u,i[10]=p*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},s.fromTranslationRotationScale=function(t,e){return s.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},s.fromTranslation=function(t,e){return s.fromRotationTranslation(u.IDENTITY,t,e)},s.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 s(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},s.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 s(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var c=new t,_=new t,R=new t;s.fromCamera=function(e,n){var i=e.eye,a=e.target,o=e.up;t.normalize(t.subtract(a,i,c),c),t.normalize(t.cross(c,o,_),_),t.normalize(t.cross(_,c,R),R);var u=_.x,E=_.y,T=_.z,l=c.x,A=c.y,f=c.z,d=R.x,N=R.y,h=R.z,I=i.x,S=i.y,M=i.z,m=u*-I+E*-S+T*-M,O=d*-I+N*-S+h*-M,y=l*I+A*S+f*M; +return r(n)?(n[0]=u,n[1]=d,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=T,n[9]=h,n[10]=-f,n[11]=0,n[12]=m,n[13]=O,n[14]=y,n[15]=1,n):new s(u,E,T,m,d,N,h,O,-l,-A,-f,y,0,0,0,1)},s.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},s.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,R=-(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]=R,o[15]=1,o},s.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),R=-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]=R,o[12]=0,o[13]=0,o[14]=T,o[15]=0,o},s.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,R=-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]=R,a[15]=0,a},s.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),R=s,T=c,l=_,A=a+s,f=o+c,d=e+_,N=1;return i[0]=R,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]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=d,i[15]=N,i},s.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]]},s.getElementIndex=function(t,e){return 4*t+e},s.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},s.setColumn=function(t,e,n,r){r=s.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},s.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},s.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},s.setRow=function(t,e,n,r){return r=s.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var T=new t;s.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[4],e[5],e[6],T)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],T)),n};var l=new t;s.getMaximumScale=function(e){return s.getScale(e,l),t.maximumComponent(l)},s.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],R=t[9],T=t[10],l=t[11],A=t[12],f=t[13],d=t[14],N=t[15],h=e[0],I=e[1],S=e[2],M=e[3],m=e[4],O=e[5],y=e[6],C=e[7],p=e[8],U=e[9],L=e[10],F=e[11],P=e[12],v=e[13],x=e[14],D=e[15],B=r*h+u*I+_*S+A*M,w=i*h+E*I+R*S+f*M,g=a*h+s*I+T*S+d*M,z=o*h+c*I+l*S+N*M,G=r*m+u*O+_*y+A*C,b=i*m+E*O+R*y+f*C,X=a*m+s*O+T*y+d*C,V=o*m+c*O+l*y+N*C,q=r*p+u*U+_*L+A*F,H=i*p+E*U+R*L+f*F,W=a*p+s*U+T*L+d*F,Y=o*p+c*U+l*L+N*F,K=r*P+u*v+_*x+A*D,Z=i*P+E*v+R*x+f*D,k=a*P+s*v+T*x+d*D,j=o*P+c*v+l*x+N*D;return n[0]=B,n[1]=w,n[2]=g,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]=Z,n[14]=k,n[15]=j,n},s.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},s.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},s.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],R=t[12],T=t[13],l=t[14],A=e[0],f=e[1],d=e[2],N=e[4],h=e[5],I=e[6],S=e[8],M=e[9],m=e[10],O=e[12],y=e[13],C=e[14],p=r*A+o*f+s*d,U=i*A+u*f+c*d,L=a*A+E*f+_*d,F=r*N+o*h+s*I,P=i*N+u*h+c*I,v=a*N+E*h+_*I,x=r*S+o*M+s*m,D=i*S+u*M+c*m,B=a*S+E*M+_*m,w=r*O+o*y+s*C+R,g=i*O+u*y+c*C+T,z=a*O+E*y+_*C+l;return n[0]=p,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]=D,n[10]=B,n[11]=0,n[12]=w,n[13]=g,n[14]=z,n[15]=1,n},s.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],R=e[0],T=e[1],l=e[2],A=e[3],f=e[4],d=e[5],N=e[6],h=e[7],I=e[8],S=r*R+o*T+s*l,M=i*R+u*T+c*l,m=a*R+E*T+_*l,O=r*A+o*f+s*d,y=i*A+u*f+c*d,C=a*A+E*f+_*d,p=r*N+o*h+s*I,U=i*N+u*h+c*I,L=a*N+E*h+_*I;return n[0]=S,n[1]=M,n[2]=m,n[3]=0,n[4]=O,n[5]=y,n[6]=C,n[7]=0,n[8]=p,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},s.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;s.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,s.multiplyByScale(t,A,n)},s.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?s.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)},s.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},s.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},s.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},s.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},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[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},s.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},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[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},s.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]},s.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},s.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},s.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 f=new u,d=new u,N=new e,h=new e(0,0,0,1);return s.inverse=function(t,n){if(u.equalsEpsilon(s.getRotation(t,f),d,o.EPSILON7)&&e.equals(s.getRow(t,3,N),h))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],c=t[12],_=t[1],R=t[5],T=t[9],l=t[13],A=t[2],I=t[6],S=t[10],M=t[14],m=t[3],O=t[7],y=t[11],C=t[15],p=S*C,U=M*y,L=I*C,F=M*O,P=I*y,v=S*O,x=A*C,D=M*m,B=A*y,w=S*m,g=A*O,z=I*m,G=p*R+F*T+P*l-(U*R+L*T+v*l),b=U*_+x*T+w*l-(p*_+D*T+B*l),X=L*_+D*R+g*l-(F*_+x*R+z*l),V=v*_+B*R+z*T-(P*_+w*R+g*T),q=U*i+L*a+v*c-(p*i+F*a+P*c),H=p*r+D*a+B*c-(U*r+x*a+w*c),W=F*r+x*i+z*c-(L*r+D*i+g*c),Y=P*r+w*i+g*a-(v*r+B*i+z*a);p=a*l,U=c*T,L=i*l,F=c*R,P=i*T,v=a*R,x=r*l,D=c*_,B=r*T,w=a*_,g=r*R,z=i*_;var K=p*O+F*y+P*C-(U*O+L*y+v*C),Z=U*m+x*y+w*C-(p*m+D*y+B*C),k=L*m+D*O+g*C-(F*m+x*O+z*C),j=v*m+B*O+z*y-(P*m+w*O+g*y),Q=L*S+v*M+U*I-(P*M+p*I+F*S),J=B*M+p*A+D*S-(x*S+w*M+U*A),$=x*I+z*M+F*A-(g*M+L*A+D*I),tt=g*S+P*A+w*I-(B*I+z*S+v*A),et=r*G+i*b+a*X+c*V;if(Math.abs(et)<o.EPSILON20)throw new E("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]=Z*et,n[10]=k*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},s.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],R=t[13],T=t[14],l=-n*_-r*R-i*T,A=-a*_-o*R-u*T,f=-E*_-s*R-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]=l,e[13]=A,e[14]=f,e[15]=1,e},s.IDENTITY=a(new s(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),s.ZERO=a(new s(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN0ROW3=3,s.COLUMN1ROW0=4,s.COLUMN1ROW1=5,s.COLUMN1ROW2=6,s.COLUMN1ROW3=7,s.COLUMN2ROW0=8,s.COLUMN2ROW1=9,s.COLUMN2ROW2=10,s.COLUMN2ROW3=11,s.COLUMN3ROW0=12,s.COLUMN3ROW1=13,s.COLUMN3ROW2=14,s.COLUMN3ROW3=15,s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.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]},s.prototype.equalsEpsilon=function(t,e){return s.equalsEpsilon(this,t,e)},s.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},s}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function i(e,n){this.normal=t.clone(e),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-t.dot(r,n);return e(a)?(t.clone(r,a.normal),a.distance=o,a):new i(r,o)};var a=new t;return i.fromCartesian4=function(n,r){var o=t.fromCartesian4(n,a),u=n.w;return e(r)?(t.clone(o,r.normal),r.distance=u,r):new i(o,u)},i.getPointDistance=function(e,n){return t.dot(e.normal,n)+e.distance},i.ORIGIN_XY_PLANE=r(new i(t.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=r(new i(t.UNIT_X,0)),i.ORIGIN_ZX_PLANE=r(new i(t.UNIT_Y,0)),i}),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){r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north},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 n>e&&(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,R=t.length;R>_;_++){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 l=T.longitude>=0?T.longitude:T.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.clone=function(t,e){return n(t)?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):void 0},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;a>i&&(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;a>i&&o>0?i+=u.TWO_PI:s>o&&i>0&&(o+=u.TWO_PI),a>i&&0>s?s+=u.TWO_PI:s>o&&0>a&&(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 R=Math.max(t.south,e.south),T=Math.min(t.north,e.north);if(!(R>=T))return n(r)?(r.west=c,r.south=R,r.east=_,r.north=T,r):new E(c,R,_,T)}},E.union=function(t,e,r){return n(r)||(r=new E),r.west=Math.min(t.west,e.west),r.south=Math.min(t.south,e.south),r.east=Math.max(t.east,e.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 i>a&&(a+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(a>n||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,R=t.south,T=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=T,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.latitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,0>_?A.latitude=_:R>0?A.latitude=R:A.latitude=0;for(var f=1;8>f;++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=T,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","./Plane","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_,R){"use strict";function T(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var l=new t,A=new t,f=new t,d=new t,N=new t,h=new t,I=new t,S=new t,M=new t,m=new t,O=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],I),a=t.clone(i,l),o=t.clone(i,A),u=t.clone(i,f),E=t.clone(i,d),s=t.clone(i,N),c=t.clone(i,h),_=e.length,R=1;_>R;R++){t.clone(e[R],i);var C=i.x,p=i.y,U=i.z;C<a.x&&t.clone(i,a),C>E.x&&t.clone(i,E),p<o.y&&t.clone(i,o),p>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,S)),F=t.magnitudeSquared(t.subtract(s,o,S)),P=t.magnitudeSquared(t.subtract(c,u,S)),v=a,x=E,D=L;F>D&&(D=F,v=o,x=s),P>D&&(D=P,v=u,x=c);var B=M;B.x=.5*(v.x+x.x),B.y=.5*(v.y+x.y),B.z=.5*(v.z+x.z);var w=t.magnitudeSquared(t.subtract(x,B,S)),g=Math.sqrt(w),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,S),.5,y),X=0;for(R=0;_>R;R++){t.clone(e[R],i);var V=t.magnitude(t.subtract(i,b,S));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(i,B,S));if(q>w){var H=Math.sqrt(q);g=.5*(g+H),w=g*g;var W=H-g;B.x=(g*B.x+W*i.x)/H,B.y=(g*B.y+W*i.y)/H,B.z=(g*B.z+W*i.z)/H}}return X>g?(t.clone(B,n.center),n.radius=g):(t.clone(b,n.center),n.radius=X),n};var C=new o,p=new t,U=new t,L=new e,F=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,C),R.southwest(e,L),L.height=a,R.northeast(e,F),F.height=o;var E=i.project(L,p),s=i.project(F,U),c=s.x-E.x,_=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+_*_+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*_,A.z=E.z+.5*l,u};var P=[];T.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=R.subsample(t,e,i,P)),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=I;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,A),c=t.clone(u,f),_=t.clone(u,d),R=t.clone(u,N),C=t.clone(u,h),p=e.length,U=0;p>U;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>R.y&&t.clone(u,R),P<c.z&&t.clone(u,c),P>C.z&&t.clone(u,C)}var v=t.magnitudeSquared(t.subtract(_,E,S)),x=t.magnitudeSquared(t.subtract(R,s,S)),D=t.magnitudeSquared(t.subtract(C,c,S)),B=E,w=_,g=v;x>g&&(g=x,B=s,w=R),D>g&&(g=D,B=c,w=C);var z=M;z.x=.5*(B.x+w.x),z.y=.5*(B.y+w.y),z.z=.5*(B.z+w.z);var G=t.magnitudeSquared(t.subtract(w,z,S)),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=R.y,V.z=C.z;var q=t.multiplyByScalar(t.add(X,V,S),.5,y),H=0;for(U=0;p>U;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,S));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,S));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 H>b?(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=I;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,A),E=t.clone(a,f),s=t.clone(a,d),c=t.clone(a,N),_=t.clone(a,h),R=e.length,C=0;R>C;C+=3){var p=e[C]+n[C],U=e[C+1]+n[C+1],L=e[C+2]+n[C+2];a.x=p,a.y=U,a.z=L,p<o.x&&t.clone(a,o),p>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,S)),P=t.magnitudeSquared(t.subtract(c,u,S)),v=t.magnitudeSquared(t.subtract(_,E,S)),x=o,D=s,B=F;P>B&&(B=P,x=u,D=c),v>B&&(B=v,x=E,D=_);var w=M;w.x=.5*(x.x+D.x),w.y=.5*(x.y+D.y),w.z=.5*(x.z+D.z);var g=t.magnitudeSquared(t.subtract(D,w,S)),z=Math.sqrt(g),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,S),.5,y),V=0;for(C=0;R>C;C+=3){a.x=e[C]+n[C],a.y=e[C+1]+n[C+1],a.z=e[C+2]+n[C+2];var q=t.magnitude(t.subtract(a,X,S));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(a,w,S));if(H>g){var W=Math.sqrt(H);z=.5*(z+W),g=z*z;var Y=W-z;w.x=(z*w.x+Y*a.x)/W,w.y=(z*w.y+Y*a.y)/W,w.z=(z*w.z+Y*a.z)/W}}return V>z?(t.clone(w,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 v=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;i>o;o++)a.push(e[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;i>o;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,v)+s.radius)}return n.radius=E,n};var x=new t,D=new t,B=new t;T.fromOrientedBoundingBox=function(e,n){r(n)||(n=new T);var i=e.halfAxes,a=s.getColumn(i,0,x),o=s.getColumn(i,1,D),u=s.getColumn(i,2,B),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){return r(e)?r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius):void 0},T.packedLength=4,T.pack=function(t,e,r){r=n(r,0);var i=t.center;e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius},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,g=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,g);return t.add(R,a,R),t.clone(R,i.center),i.radius=_,i};var z=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,z));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-i>o?u.OUTSIDE:i>o?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 G=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,G);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 b=new t;T.computePlaneDistances=function(e,n,i,a){r(a)||(a=new E);var o=t.subtract(e.center,n,b),u=t.dot(i,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var X=new t,V=new t,q=new t,H=new t,W=new t,Y=new e,K=new Array(8),Z=0;8>Z;++Z)K[Z]=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,X),s=t.cross(t.UNIT_Z,E,V);t.normalize(s,s);var c=t.cross(E,s,q);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=K,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,d=0;f>d;++d){var N=l[d];t.add(o,N,N);var h=a.cartesianToCartographic(N,Y);r.project(h,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){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n):new a(t.x,t.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r]=e.y},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.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.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("Renderer/WebGLConstants",["../Core/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/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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++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",t(document[i])?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",t(document[i])&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",t(document[i])?r.fullscreenElement=i:(i=E+"FullScreenElement",t(document[i])&&(r.fullscreenElement=i)),i=E+"fullscreenchange",t(document["on"+i])&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",t(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;r>n;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(h)){h=!1;var t=/ Chrome\/([\.0-9]+)/.exec(N.userAgent);null!==t&&(h=!0,I=r(t[1]))}return h}function a(){return i()&&I}function o(){if(!e(S)&&(S=!1,!i()&&/ Safari\/[\.0-9]+/.test(N.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(N.userAgent);null!==t&&(S=!0,M=r(t[1]))}return S}function u(){return o()&&M}function E(){if(!e(m)){m=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(N.userAgent);null!==t&&(m=!0,O=r(t[1]),O.isNightly=!!t[2])}return m}function s(){return E()&&O}function c(){if(!e(y)){y=!1;var t;"Microsoft Internet Explorer"===N.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(N.userAgent),null!==t&&(y=!0,C=r(t[1]))):"Netscape"===N.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(N.userAgent),null!==t&&(y=!0,C=r(t[1])))}return y}function _(){return c()&&C}function R(){if(!e(p)){p=!1;var t=/Firefox\/([\.0-9]+)/.exec(N.userAgent);null!==t&&(p=!0,U=r(t[1]))}return p}function T(){return e(L)||(L=/Windows/i.test(N.appVersion)),L}function l(){return R()&&U}function A(){return e(F)||(F="undefined"!=typeof PointerEvent&&(!e(N.pointerEnabled)||N.pointerEnabled)),F}function f(){if(!e(v)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;v=e(n)&&""!==n,v&&(P=n)}return v}function d(){return f()?P:void 0}var N;N="undefined"!=typeof navigator?navigator:{};var h,I,S,M,m,O,y,C,p,U,L,F,P,v,x={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isFirefox:R,firefoxVersion:l,isWindows:T,hardwareConcurrency:t(N.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:f,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/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,e,n,r,i,a){"use strict";if(!i.supportsTypedArrays())return{};var o={BYTE:t.BYTE,UNSIGNED_BYTE:t.UNSIGNED_BYTE,SHORT:t.SHORT,UNSIGNED_SHORT:t.UNSIGNED_SHORT,FLOAT:t.FLOAT,DOUBLE:t.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},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 Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return n(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||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.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(t,n,i,a){switch(i=e(i,0),a=e(a,(n.byteLength-i)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,i,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,i,a);case o.SHORT:return new Int16Array(n,i,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,i,a);case o.FLOAT:return new Float32Array(n,i,a);case o.DOUBLE:return new Float64Array(n,i,a);default:throw new r("componentDatatype is not a valid value.")}},a(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),R=0,T=0,l=a?3*s:0,A=a?3*(s+i):3*i;for(o=0;i>o;o++){var f=o/i*t.TWO_PI,d=Math.cos(f),N=Math.sin(f),h=d*r,I=N*r,S=d*n,M=N*n;_[T+l]=h,_[T+l+1]=I,_[T+l+2]=E,_[T+A]=S,_[T+A+1]=M,_[T+A+2]=u,T+=3,a&&(_[R++]=h,_[R++]=I,_[R++]=E,_[R++]=S,_[R++]=M,_[R++]=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",["../Renderer/WebGLConstants","./freezeObject"],function(t,e){"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(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 e(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=void 0}return a.computeNumberOfVertices=function(t){var r=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&e(t.attributes[i])&&e(t.attributes[i].values)){var a=t.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a={UNSIGNED_BYTE:t.UNSIGNED_BYTE,UNSIGNED_SHORT:t.UNSIGNED_SHORT,UNSIGNED_INT:t.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(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,n,r){return t>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,r):new Uint16Array(e,n,r)},r(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,_,R){"use strict";function T(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;T.packedLength=5,T.pack=function(t,e,n){n=a(n,0),e[n++]=t._length,e[n++]=t._topRadius,e[n++]=t._bottomRadius,e[n++]=t._slices,e[n]=t._numberOfVerticalLines};var A={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0};return T.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):(A.length=r,A.topRadius=i,A.bottomRadius=u,A.slices=E,A.numberOfVerticalLines=s,new T(A))},T.createGeometry=function(a){var o,u=a._length,T=a._topRadius,A=a._bottomRadius,f=a._slices,d=a._numberOfVerticalLines,N=2*f,h=i.computePositions(u,T,A,f,!1),I=2*f;if(d>0){var S=Math.min(d,f);o=Math.round(f/S),I+=S}for(var M=_.createTypedArray(N,2*I),m=0,O=0;f-1>O;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,d>0)for(O=0;f>O;O+=o)M[m++]=O,M[m++]=O+f;var y=new c;y.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:h}),l.x=.5*u,l.y=Math.max(A,T);var C=new t(n.ZERO,e.magnitude(l));return new E({attributes:y,indices:M,primitiveType:R.LINES,boundingSphere:C})},T}),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 diff --git a/Workers/createEllipseGeometry.js b/Workers/createEllipseGeometry.js index 27afcef..31eb4e0 100644 --- a/Workers/createEllipseGeometry.js +++ b/Workers/createEllipseGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +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";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};r.EPSILON1=.1,r.EPSILON2=.01,r.EPSILON3=.001,r.EPSILON4=1e-4,r.EPSILON5=1e-5,r.EPSILON6=1e-6,r.EPSILON7=1e-7,r.EPSILON8=1e-8,r.EPSILON9=1e-9,r.EPSILON10=1e-10,r.EPSILON11=1e-11,r.EPSILON12=1e-12,r.EPSILON13=1e-13,r.EPSILON14=1e-14,r.EPSILON15=1e-15,r.EPSILON16=1e-16,r.EPSILON17=1e-17,r.EPSILON18=1e-18,r.EPSILON19=1e-19,r.EPSILON20=1e-20,r.GRAVITATIONALPARAMETER=3986004418e5,r.SOLAR_RADIUS=6955e5,r.LUNAR_RADIUS=1737400,r.SIXTY_FOUR_KILOBYTES=65536,r.sign=function(e){return e>0?1:0>e?-1:0},r.signNotZero=function(e){return 0>e?-1:1},r.toSNorm=function(e){return Math.round(255*(.5*r.clamp(e,-1,1)+.5))},r.fromSNorm=function(e){return 2*(r.clamp(e,0,255)/255)-1},r.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},r.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},r.lerp=function(e,t,r){return(1-r)*e+r*t},r.PI=Math.PI,r.ONE_OVER_PI=1/Math.PI,r.PI_OVER_TWO=.5*Math.PI,r.PI_OVER_THREE=Math.PI/3,r.PI_OVER_FOUR=Math.PI/4,r.PI_OVER_SIX=Math.PI/6,r.THREE_PI_OVER_TWO=.5*3*Math.PI,r.TWO_PI=2*Math.PI,r.ONE_OVER_TWO_PI=1/(2*Math.PI),r.RADIANS_PER_DEGREE=Math.PI/180,r.DEGREES_PER_RADIAN=180/Math.PI,r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600,r.toRadians=function(e){return e*r.RADIANS_PER_DEGREE},r.toDegrees=function(e){return e*r.DEGREES_PER_RADIAN},r.convertLongitudeRange=function(e){var t=r.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},r.negativePiToPi=function(e){for(var t=r.EPSILON10,n=r.PI,a=r.TWO_PI;-(n+t)>e;)e+=a;if(-n>e)return-n;for(;e>n+t;)e-=a;return e>n?n:e},r.zeroToTwoPi=function(e){var t=e%r.TWO_PI;return 0>t?(t+r.TWO_PI)%r.TWO_PI:t},r.equalsEpsilon=function(e,r,n){return n=t(n,0),Math.abs(e-r)<=n};var n=[1];r.factorial=function(e){var t=n.length;if(e>=t)for(var r=n[t-1],a=t;e>=a;a++)n.push(r*a);return n[e]},r.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},r.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},r.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},r.clamp=function(e,t,r){return t>e?t:e>r?r:e};var a=new e;return r.setRandomNumberSeed=function(t){a=new e(t)},r.nextRandomNumber=function(){return a.random()},r.acosClamped=function(e){return Math.acos(r.clamp(e,-1,1))},r.asinClamped=function(e){return Math.asin(r.clamp(e,-1,1))},r}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i=function(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)};i.fromSpherical=function(r,n){t(n)||(n=new i);var a=r.clock,o=r.cone,u=e(r.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,r,n,a){return t(a)?(a.x=e,a.y=r,a.z=n,a):new i(e,r,n)},i.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z},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},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 o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(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},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.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 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){i.normalize(e,s),i.normalize(t,c);var r=i.dot(s,c),n=i.magnitude(i.cross(s,c,s));return Math.atan2(n,r)};var l=new i;i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);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,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z},i.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n},i.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},i.fromDegrees=function(e,t,r,n,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,r,n,o)};var f=new i,y=new i,d=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(r,n,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(n);f.x=c*Math.cos(r),f.y=c*Math.sin(r),f.z=Math.sin(n),f=i.normalize(f,f),i.multiplyComponents(s,f,y);var l=Math.sqrt(i.dot(f,y));return y=i.divideByScalar(y,l,y),f=i.multiplyByScalar(f,a,f),t(u)||(u=new i),i.add(y,f,u)},i.fromDegreesArray=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o++)n[o]=a.toRadians(e[o]);return i.fromRadiansArray(n,t,r)},i.fromRadiansArray=function(e,r,n){var a=e.length;t(n)?n.length=a/2:n=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];n[o/2]=i.fromRadians(u,s,0,r,n[o/2])}return n},i.fromDegreesArrayHeights=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o+=3)n[o]=a.toRadians(e[o]),n[o+1]=a.toRadians(e[o+1]),n[o+2]=e[o+2];return i.fromRadiansArrayHeights(n,t,r)},i.fromRadiansArrayHeights=function(e,r,n){var a=e.length;t(n)?n.length=a/3:n=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];n[o/3]=i.fromRadians(u,s,c,r,n[o/3])}return n},i.ZERO=n(new i(0,0,0)),i.UNIT_X=n(new i(1,0,0)),i.UNIT_Y=n(new i(0,1,0)),i.UNIT_Z=n(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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i=function(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)};return i.fromRadians=function(r,n,a,o){return a=e(a,0),t(o)?(o.longitude=r,o.latitude=n,o.height=a,o):new i(r,n,a)},i.fromDegrees=function(e,t,r,n){return e=a.toRadians(e),t=a.toRadians(t),i.fromRadians(e,t,r,n)},i.clone=function(e,r){return t(e)?t(r)?(r.longitude=e.longitude,r.latitude=e.latitude,r.height=e.height,r):new i(e.longitude,e.latitude,e.height):void 0},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.longitude===r.longitude&&e.latitude===r.latitude&&e.height===r.height},i.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.longitude-r.longitude)<=n&&Math.abs(e.latitude-r.latitude)<=n&&Math.abs(e.height-r.height)<=n},i.ZERO=n(new i(0,0,0)),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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},i}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(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}var c=function(e,t,r){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,s(this,e,t,r)};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(t,r){if(!n(t))return void 0;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 c(a.x,a.y,a.z)},c.fromCartesian3=function(e,t){return n(t)||(t=new c),n(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=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.prototype.geocentricSurfaceNormal=e.normalize,c.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)},c.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var l=new e,f=new e;c.prototype.cartographicToCartesian=function(t,r){var a=l,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)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;r>a;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var y=new e,d=new e,m=new e;c.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,d);if(!n(i))return void 0;var o=this.geodeticSurfaceNormal(i,y),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)},c.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;r>a;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t};var h=new e,p=new e;return c.prototype.scaleToGeodeticSurface=function(t,r){var a=t.x,i=t.y,o=t.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,y=a*a*c*c,d=i*i*l*l,m=o*o*f*f,v=y+d+m,g=Math.sqrt(1/v),w=e.multiplyByScalar(t,g,h);if(v<this._centerToleranceSquared)return isFinite(g)?e.clone(w,r):void 0;var x=this._oneOverRadiiSquared,E=x.x,S=x.y,M=x.z,b=p;b.x=2*w.x*E,b.y=2*w.y*S,b.z=2*w.z*M;var T,A,z,O,N,I,R,P,_,L,C,D=(1-g)*e.magnitude(t)/(.5*e.magnitude(b)),q=0;do{D-=q,z=1/(1+D*E),O=1/(1+D*S),N=1/(1+D*M),I=z*z,R=O*O,P=N*N,_=I*z,L=R*O,C=P*N,T=y*I+d*R+m*P-1,A=y*_*E+d*L*S+m*C*M;var B=-2*A;q=T/B}while(Math.abs(T)>u.EPSILON12);return n(r)?(r.x=a*z,r.y=i*O,r.z=o*N,r):new e(a*z,i*O,o*N)},c.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)},c.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},c.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},c.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";var u=function(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";var t=function(t,r){this.start=e(t,0),this.stop=e(r,0)};return t}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";var a=function(t,r,n,a){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(a,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){return t(e)?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):void 0},a.packedLength=4,a.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w},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.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 i=new a;a.distance=function(e,t){return a.subtract(e,t,i),a.magnitude(i)},a.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.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.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 o=new a;a.lerp=function(e,t,r,n){return a.multiplyByScalar(t,r,o),n=a.multiplyByScalar(e,1-r,n),a.add(o,n,n)};var u=new a;return a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,u);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.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n&&Math.abs(e.w-r.w)<=n},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){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function u(e){for(var t=0,r=0;3>r;++r){var n=e[c.getElementIndex(d[r],y[r])];t+=2*n*n}return Math.sqrt(t)}function s(e,t){for(var r=i.EPSILON15,n=0,a=1,o=0;3>o;++o){var u=Math.abs(e[c.getElementIndex(d[o],y[o])]);u>n&&(a=o,n=u)}var s=1,l=0,f=y[a],m=d[a];if(Math.abs(e[c.getElementIndex(m,f)])>r){var h,p=e[c.getElementIndex(m,m)],v=e[c.getElementIndex(f,f)],g=e[c.getElementIndex(m,f)],w=(p-v)/2/g;h=0>w?-1/(-w+Math.sqrt(1+w*w)):1/(w+Math.sqrt(1+w*w)),s=1/Math.sqrt(1+h*h),l=h*s}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(f,f)]=t[c.getElementIndex(m,m)]=s,t[c.getElementIndex(m,f)]=l,t[c.getElementIndex(f,m)]=-l,t}var c=function(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)};c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,n,a){return n=t(n,0),r(a)||(a=new c),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},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,s=e.y*e.z,l=e.y*e.w,f=e.z*e.z,y=e.z*e.w,d=e.w*e.w,m=n-u-f+d,h=2*(a-y),p=2*(i+l),v=2*(a+y),g=-n+u-f+d,w=2*(s-o),x=2*(i-l),E=2*(s+o),S=-n-u+f+d;return r(t)?(t[0]=m,t[1]=v,t[2]=x,t[3]=h,t[4]=g,t[5]=E,t[6]=p,t[7]=w,t[8]=S,t):new c(m,h,p,v,g,w,x,E,S)},c.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new c(e.x,0,0,0,e.y,0,0,0,e.z)},c.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new c(e,0,0,0,e,0,0,0,e)},c.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.fromRotationX=function(e,t){var n=Math.cos(e),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 c(1,0,0,0,n,-a,0,a,n)},c.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 c(n,0,a,0,1,0,-a,0,n)},c.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 c(n,-a,0,a,n,0,0,0,1)},c.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},c.getElementIndex=function(e,t){return 3*e+t},c.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},c.setColumn=function(e,t,r,n){n=c.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},c.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},c.setRow=function(e,t,r,n){return n=c.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var l=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),r};var f=new e;c.getMaximumScale=function(t){return c.getScale(t,f),e.maximumComponent(f)},c.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],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},c.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},c.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},c.multiplyByVector=function(e,t,r){var n=t.x,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},c.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},c.transpose=function(e,t){var r=e[0],n=e[3],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 y=[1,0,0],d=[2,2,1],m=new c,h=new c;return c.computeEigenDecomposition=function(e,t){var n=i.EPSILON20,a=10,l=0,f=0;r(t)||(t={});for(var y=t.unitary=c.clone(c.IDENTITY,t.unitary),d=t.diagonal=c.clone(e,t.diagonal),p=n*o(d);a>f&&u(d)>p;)s(d,m),c.transpose(m,h),c.multiply(d,m,d),c.multiply(h,d,d),c.multiply(y,m,y),++l>2&&(++f,l=0);return t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},c.determinant=function(e){var t=e[0],r=e[3],n=e[6],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)},c.inverse=function(e,t){var r=e[0],a=e[1],o=e[2],u=e[3],s=e[4],l=e[5],f=e[6],y=e[7],d=e[8],m=c.determinant(e);if(Math.abs(m)<=i.EPSILON15)throw new n("matrix is not invertible");t[0]=s*d-y*l,t[1]=y*o-a*d,t[2]=a*l-s*o,t[3]=f*l-u*d,t[4]=r*d-f*o,t[5]=u*o-r*l,t[6]=u*y-f*s,t[7]=f*a-r*y,t[8]=r*s-u*a;var h=1/m;return c.multiplyByScalar(t,h,t)},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},c.IDENTITY=a(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s){"use strict";var c=function(e,t,n,a,i,o,u,s,c,l,f,y,d,m,h,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(m,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(h,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(y,0),this[15]=r(p,0)};c.packedLength=16,c.pack=function(e,t,n){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]},c.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new c),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},c.clone=function(e,t){return n(e)?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 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]):void 0},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,r,a){n(a)||(a=new c);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,l=t.x*t.y,f=t.x*t.z,y=t.x*t.w,d=t.y*t.y,m=t.y*t.z,h=t.y*t.w,p=t.z*t.z,v=t.z*t.w,g=t.w*t.w,w=s-d-p+g,x=2*(l-v),E=2*(f+h),S=2*(l+v),M=-s+d-p+g,b=2*(m-y),T=2*(f-h),A=2*(m+y),z=-s-d+p+g;return a[0]=w*i,a[1]=S*i,a[2]=T*i,a[3]=0,a[4]=x*o,a[5]=M*o,a[6]=A*o,a[7]=0,a[8]=E*u,a[9]=b*u,a[10]=z*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.IDENTITY,e,t)},c.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 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 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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,f=new e,y=new e;c.fromCamera=function(t,r){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,y),y);var u=f.x,s=f.y,d=f.z,m=l.x,h=l.y,p=l.z,v=y.x,g=y.y,w=y.z,x=a.x,E=a.y,S=a.z,M=u*-x+s*-E+d*-S,b=v*-x+g*-E+w*-S,T=m*x+h*E+p*S;return n(r)?(r[0]=u,r[1]=v,r[2]=-m,r[3]=0,r[4]=s,r[5]=g,r[6]=-h,r[7]=0,r[8]=d,r[9]=w,r[10]=-p,r[11]=0,r[12]=M,r[13]=b,r[14]=T,r[15]=1,r):new c(u,s,d,M,v,g,w,b,-m,-h,-p,T,0,0,0,1)},c.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},c.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,y=-(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]=y,o[15]=1,o},c.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),y=-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]=y,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},c.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,y=-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]=y,i[15]=0,i},c.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),y=c,d=l,m=f,h=i+c,p=o+l,v=t+f,g=1;return a[0]=y,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]=m,a[11]=0,a[12]=h,a[13]=p,a[14]=v,a[15]=g,a},c.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]]},c.getElementIndex=function(e,t){return 4*e+t},c.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},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.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},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 d=new e;c.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 m=new e;c.getMaximumScale=function(t){return c.getScale(t,m),e.maximumComponent(m)},c.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],y=e[9],d=e[10],m=e[11],h=e[12],p=e[13],v=e[14],g=e[15],w=t[0],x=t[1],E=t[2],S=t[3],M=t[4],b=t[5],T=t[6],A=t[7],z=t[8],O=t[9],N=t[10],I=t[11],R=t[12],P=t[13],_=t[14],L=t[15],C=n*w+u*x+f*E+h*S,D=a*w+s*x+y*E+p*S,q=i*w+c*x+d*E+v*S,B=o*w+l*x+m*E+g*S,U=n*M+u*b+f*T+h*A,F=a*M+s*b+y*T+p*A,G=i*M+c*b+d*T+v*A,W=o*M+l*b+m*T+g*A,V=n*z+u*O+f*N+h*I,Y=a*z+s*O+y*N+p*I,k=i*z+c*O+d*N+v*I,j=o*z+l*O+m*N+g*I,H=n*R+u*P+f*_+h*L,Z=a*R+s*P+y*_+p*L,X=i*R+c*P+d*_+v*L,Q=o*R+l*P+m*_+g*L;return r[0]=C,r[1]=D,r[2]=q,r[3]=B,r[4]=U,r[5]=F,r[6]=G,r[7]=W,r[8]=V,r[9]=Y,r[10]=k,r[11]=j,r[12]=H,r[13]=Z,r[14]=X,r[15]=Q,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],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],y=e[12],d=e[13],m=e[14],h=t[0],p=t[1],v=t[2],g=t[4],w=t[5],x=t[6],E=t[8],S=t[9],M=t[10],b=t[12],T=t[13],A=t[14],z=n*h+o*p+c*v,O=a*h+u*p+l*v,N=i*h+s*p+f*v,I=n*g+o*w+c*x,R=a*g+u*w+l*x,P=i*g+s*w+f*x,_=n*E+o*S+c*M,L=a*E+u*S+l*M,C=i*E+s*S+f*M,D=n*b+o*T+c*A+y,q=a*b+u*T+l*A+d,B=i*b+s*T+f*A+m;return r[0]=z,r[1]=O,r[2]=N,r[3]=0,r[4]=I,r[5]=R,r[6]=P,r[7]=0,r[8]=_,r[9]=L,r[10]=C,r[11]=0,r[12]=D,r[13]=q,r[14]=B,r[15]=1,r},c.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 h=new e;c.multiplyByUniformScale=function(e,t,r){return h.x=t,h.y=t,h.z=t,c.multiplyByScale(e,h,r)},c.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?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]=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)},c.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},c.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},c.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},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],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},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||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]&&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]},c.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},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 p=new u,v=new u,g=new t,w=new t(0,0,0,1);return c.inverse=function(e,r){if(u.equalsEpsilon(c.getRotation(e,p),v,o.EPSILON7)&&t.equals(c.getRow(e,3,g),w))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],l=e[12],f=e[1],y=e[5],d=e[9],m=e[13],h=e[2],x=e[6],E=e[10],S=e[14],M=e[3],b=e[7],T=e[11],A=e[15],z=E*A,O=S*T,N=x*A,I=S*b,R=x*T,P=E*b,_=h*A,L=S*M,C=h*T,D=E*M,q=h*b,B=x*M,U=z*y+I*d+R*m-(O*y+N*d+P*m),F=O*f+_*d+D*m-(z*f+L*d+C*m),G=N*f+L*y+q*m-(I*f+_*y+B*m),W=P*f+C*y+B*d-(R*f+D*y+q*d),V=O*a+N*i+P*l-(z*a+I*i+R*l),Y=z*n+L*i+C*l-(O*n+_*i+D*l),k=I*n+_*a+B*l-(N*n+L*a+q*l),j=R*n+D*a+q*i-(P*n+C*a+B*i);z=i*m,O=l*d,N=a*m,I=l*y,R=a*d,P=i*y,_=n*m,L=l*f,C=n*d,D=i*f,q=n*y,B=a*f;var H=z*b+I*T+R*A-(O*b+N*T+P*A),Z=O*M+_*T+D*A-(z*M+L*T+C*A),X=N*M+L*b+q*A-(I*M+_*b+B*A),Q=P*M+C*b+B*T-(R*M+D*b+q*T),K=N*E+P*S+O*x-(R*S+z*x+I*E),J=C*S+z*h+L*E-(_*E+D*S+O*h),$=_*x+B*S+I*h-(q*S+N*h+L*x),et=q*E+R*h+D*x-(C*x+B*E+P*h),tt=n*U+a*F+i*G+l*W;if(Math.abs(tt)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return tt=1/tt,r[0]=U*tt,r[1]=F*tt,r[2]=G*tt,r[3]=W*tt,r[4]=V*tt,r[5]=Y*tt,r[6]=k*tt,r[7]=j*tt,r[8]=H*tt,r[9]=Z*tt,r[10]=X*tt,r[11]=Q*tt,r[12]=K*tt,r[13]=J*tt,r[14]=$*tt,r[15]=et*tt,r},c.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],y=e[13],d=e[14],m=-r*f-n*y-a*d,h=-i*f-o*y-u*d,p=-s*f-c*y-l*d;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]=m,t[13]=h,t[14]=p,t[15]=1,t},c.IDENTITY=i(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o){"use strict";var u=function(e,r,n,a){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(a,0)};u.fromDegrees=function(e,n,a,i,s){return e=o.toRadians(t(e,0)),n=o.toRadians(t(n,0)),a=o.toRadians(t(a,0)),i=o.toRadians(t(i,0)),r(s)?(s.west=e,s.south=n,s.east=a,s.north=i,s):new u(e,n,a,i)},u.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=e.length;c>s;s++){var l=e[s];n=Math.min(n,l.longitude),a=Math.max(a,l.longitude),i=Math.min(i,l.latitude),o=Math.max(o,l.latitude)}return r(t)?(t.west=n,t.south=i,t.east=a,t.north=o,t):new u(n,i,a,o)},u.packedLength=4,u.pack=function(e,r,n){n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north},u.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new u),a.west=e[n++],a.south=e[n++],a.east=e[n++],a.north=e[n],a},u.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},u.validate=function(){},u.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},u.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},u.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},u.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},u.center=function(t,n){var a=t.east,i=t.west,u=.5*(i+a);return i>a&&(u=o.negativePiToPi(u+o.PI)),r(n)?(n.longitude=u,n.latitude=.5*(t.south+t.north),n.height=0,n):new e(u,.5*(t.south+t.north))},u.intersectWith=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),s=Math.min(e.north,t.north);return r(n)?(n.west=a,n.south=i,n.east=o,n.north=s,n):new u(a,i,o,s)},u.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},u.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var s=new e;return u.subsample=function(e,n,i,u){n=t(n,a.WGS84),i=t(i,0),r(u)||(u=[]);var c=0,l=e.north,f=e.south,y=e.east,d=e.west,m=s;m.height=i,m.longitude=d,m.latitude=l,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.longitude=y,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.latitude=f,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:f>0?f:0;for(var h=1;8>h;++h){var p=-Math.PI+h*o.PI_OVER_TWO;p>d&&y>p&&(m.longitude=p,u[c]=n.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=d,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.longitude=y,u[c]=n.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=i(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l){"use strict";var f=function(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)},y=new e,d=new e,m=new e,h=new e,p=new e,v=new e,g=new e,w=new e,x=new e,E=new e,S=new e,M=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],g),i=e.clone(a,y),o=e.clone(a,d),u=e.clone(a,m),s=e.clone(a,h),c=e.clone(a,p),l=e.clone(a,v),b=t.length,T=1;b>T;T++){e.clone(t[T],a);var A=a.x,z=a.y,O=a.z;A<i.x&&e.clone(a,i),A>s.x&&e.clone(a,s),z<o.y&&e.clone(a,o),z>c.y&&e.clone(a,c),O<u.z&&e.clone(a,u),O>l.z&&e.clone(a,l)}var N=e.magnitudeSquared(e.subtract(s,i,w)),I=e.magnitudeSquared(e.subtract(c,o,w)),R=e.magnitudeSquared(e.subtract(l,u,w)),P=i,_=s,L=N;I>L&&(L=I,P=o,_=c),R>L&&(L=R,P=u,_=l);var C=x;C.x=.5*(P.x+_.x),C.y=.5*(P.y+_.y),C.z=.5*(P.z+_.z);var D=e.magnitudeSquared(e.subtract(_,C,w)),q=Math.sqrt(D),B=E;B.x=i.x,B.y=o.y,B.z=u.z;var U=S;U.x=s.x,U.y=c.y,U.z=l.z;var F=e.multiplyByScalar(e.add(B,U,w),.5,M),G=0;for(T=0;b>T;T++){e.clone(t[T],a);var W=e.magnitude(e.subtract(a,F,w));W>G&&(G=W);var V=e.magnitudeSquared(e.subtract(a,C,w));if(V>D){var Y=Math.sqrt(V);q=.5*(q+Y),D=q*q;var k=Y-q;C.x=(q*C.x+k*a.x)/Y,C.y=(q*C.y+k*a.y)/Y,C.z=(q*C.z+k*a.z)/Y}}return G>q?(e.clone(C,r.center),r.radius=q):(e.clone(F,r.center),r.radius=G),r};var b=new o,T=new e,A=new e,z=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,b),l.southwest(t,z),z.height=i,l.northeast(t,O),O.height=o;var s=a.project(z,T),c=a.project(O,A),y=c.x-s.x,d=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(y*y+d*d+m*m);var h=u.center;return h.x=s.x+.5*y,h.y=s.y+.5*d,h.z=s.z+.5*m,u};var N=[];f.fromRectangle3D=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0);var u;return n(e)&&(u=l.subsample(e,t,a,N)),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=g;u.x=t[0]+a.x,u.y=t[1]+a.y,u.z=t[2]+a.z;for(var s=e.clone(u,y),c=e.clone(u,d),l=e.clone(u,m),b=e.clone(u,h),T=e.clone(u,p),A=e.clone(u,v),z=t.length,O=0;z>O;O+=i){var N=t[O]+a.x,I=t[O+1]+a.y,R=t[O+2]+a.z;u.x=N,u.y=I,u.z=R,N<s.x&&e.clone(u,s),N>b.x&&e.clone(u,b),I<c.y&&e.clone(u,c),I>T.y&&e.clone(u,T),R<l.z&&e.clone(u,l),R>A.z&&e.clone(u,A)}var P=e.magnitudeSquared(e.subtract(b,s,w)),_=e.magnitudeSquared(e.subtract(T,c,w)),L=e.magnitudeSquared(e.subtract(A,l,w)),C=s,D=b,q=P;_>q&&(q=_,C=c,D=T),L>q&&(q=L,C=l,D=A);var B=x;B.x=.5*(C.x+D.x),B.y=.5*(C.y+D.y),B.z=.5*(C.z+D.z);var U=e.magnitudeSquared(e.subtract(D,B,w)),F=Math.sqrt(U),G=E;G.x=s.x,G.y=c.y,G.z=l.z;var W=S;W.x=b.x,W.y=T.y,W.z=A.z;var V=e.multiplyByScalar(e.add(G,W,w),.5,M),Y=0;for(O=0;z>O;O+=i){u.x=t[O]+a.x,u.y=t[O+1]+a.y,u.z=t[O+2]+a.z;var k=e.magnitude(e.subtract(u,V,w));k>Y&&(Y=k);var j=e.magnitudeSquared(e.subtract(u,B,w));if(j>U){var H=Math.sqrt(j);F=.5*(F+H),U=F*F;var Z=H-F;B.x=(F*B.x+Z*u.x)/H,B.y=(F*B.y+Z*u.y)/H,B.z=(F*B.z+Z*u.z)/H}}return Y>F?(e.clone(B,o.center),o.radius=F):(e.clone(V,o.center),o.radius=Y),o},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},f.clone=function(t,r){return n(t)?n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius):void 0},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var a=e.center;t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius},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 I=new e,R=new e;f.union=function(t,r,a){n(a)||(a=new f);var i=t.center,o=r.center;e.add(i,o,R);var u=e.multiplyByScalar(R,.5,R),s=e.magnitude(e.subtract(i,u,I))+t.radius,c=e.magnitude(e.subtract(o,u,I))+r.radius;return a.radius=Math.max(s,c),e.clone(u,a.center),a};var P=new e;f.expand=function(t,r,n){n=f.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,P));return a>n.radius&&(n.radius=a),n},f.intersect=function(t,r){var n=t.center,a=t.radius,i=e.dot(r,n)+r.w;return-a>i?u.OUTSIDE:a>i?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=c.getMaximumScale(t)*e.radius,r};var _=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,_);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var L=new e;f.computePlaneDistances=function(t,r,a,i){n(i)||(i=new s);var o=e.subtract(t.center,r,L),u=e.multiplyByScalar(a,e.dot(a,o),L),c=e.magnitude(u);return i.start=c-t.radius,i.stop=c+t.radius,i};for(var C=new e,D=new e,q=new e,B=new e,U=new e,F=new t,G=new Array(8),W=0;8>W;++W)G[W]=new e;var V=new o;return f.projectTo2D=function(t,n,a){n=r(n,V);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,C),c=e.cross(e.UNIT_Z,s,D);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 y=e.negate(l,U),d=e.negate(c,B),m=G,h=m[0];e.add(s,l,h),e.add(h,c,h),h=m[1],e.add(s,l,h),e.add(h,d,h),h=m[2],e.add(s,y,h),e.add(h,d,h),h=m[3],e.add(s,y,h),e.add(h,c,h),e.negate(s,s),h=m[4],e.add(s,l,h),e.add(h,c,h),h=m[5],e.add(s,l,h),e.add(h,d,h),h=m[6],e.add(s,y,h),e.add(h,d,h),h=m[7],e.add(s,y,h),e.add(h,c,h);for(var p=m.length,v=0;p>v;++v){var g=m[v];e.add(o,g,g);var w=i.cartesianToCartographic(g,F);n.project(w,g)}a=f.fromPoints(m,a),o=a.center;var x=o.x,E=o.y,S=o.z;return o.x=S,o.y=x,o.z=E,a},f.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersect=function(e){return f.intersect(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i=function(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){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n]=t.y},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.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.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.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.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n},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){return i.equalsEpsilon(this,e,t)},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(){return a.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?n.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(n.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e){a.supportsFullscreen()&&e[n.requestFullscreen]()},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;n>r;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(m)){m=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(m=!0,h=n(e[1]))}return m}function i(){return a()&&h}function o(){if(!t(p)&&(p=!1,!a()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(p=!0,v=n(e[1]))}return p}function u(){return o()&&v}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(g=!0,w=n(e[1]),w.isNightly=!!e[2])}return g}function c(){return s()&&w}function l(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=n(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=n(e[1])))}return x}function f(){return l()&&E}function y(){if(!t(S)){S=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(S=!0,M=n(e[1]))}return S}function d(){return y()&&M}var m,h,p,v,g,w,x,E,S,M,b={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:y,firefoxVersion:d,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};return b.supportsFullscreen=function(){return r.supportsFullscreen()},b.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},b.supportsWebWorkers=function(){return"undefined"!=typeof Worker},b}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,r,n,a){"use strict";if(!n.supportsTypedArrays())return{};var i={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},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 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.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.FLOAT:return new Float32Array(t);case i.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},i.createArrayBufferView=function(t,n,a,o){switch(a=e(a,0),o=e(o,(n.byteLength-a)/i.getSizeInBytes(t)),t){case i.BYTE:return new Int8Array(n,a,o);case i.UNSIGNED_BYTE:return new Uint8Array(n,a,o);case i.SHORT:return new Int16Array(n,a,o);case i.UNSIGNED_SHORT:return new Uint16Array(n,a,o);case i.FLOAT:return new Float32Array(n,a,o);case i.DOUBLE:return new Float64Array(n,a,o);default:throw new r("componentDatatype is not a valid value.")}},a(i)}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,n,a,i,o,u){"use strict";var s=function(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)},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,y=Math.cos(i);return r(a)?(a.x=u,a.y=l,a.z=f,a.w=y,a):new s(u,l,f,y)};var l=[1,2,0],f=new Array(3);s.fromRotationMatrix=function(e,t){var n,a,i,o,c,y=e[u.COLUMN0ROW0],d=e[u.COLUMN1ROW1],m=e[u.COLUMN2ROW2],h=y+d+m;if(h>0)n=Math.sqrt(h+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,v=0;d>y&&(v=1),m>y&&m>d&&(v=2);var g=p[v],w=p[g];n=Math.sqrt(e[u.getElementIndex(v,v)]-e[u.getElementIndex(g,g)]-e[u.getElementIndex(w,w)]+1);var x=f;x[v]=.5*n,n=.5/n,c=(e[u.getElementIndex(w,g)]-e[u.getElementIndex(g,w)])*n,x[g]=(e[u.getElementIndex(g,v)]+e[u.getElementIndex(v,g)])*n,x[w]=(e[u.getElementIndex(w,v)]+e[u.getElementIndex(v,w)])*n,a=-x[0],i=-x[1],o=-x[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=c,t):new s(a,i,o,c)};var y=new e,d=new e,m=new s,h=new s,p=new s;s.packedLength=4,s.pack=function(e,r,n){n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w},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,p),s.conjugate(p,p);for(var a=0,i=r-t+1;i>a;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,y);var u=s.computeAngle(m);n[o]=y.x*u,n[o+1]=y.y*u,n[o+2]=y.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,h),0===u?s.clone(s.IDENTITY,m):s.fromAxisAngle(d,u,m),s.multiply(m,h,o)},s.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w):void 0},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,y=o*s-n*c+a*l+i*u,d=o*c+n*s-a*u+i*l,m=o*l-n*u-a*s-i*c;return r.x=f,r.y=y,r.z=d,r.w=m,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 v=new s;s.lerp=function(e,t,r,n){return v=s.multiplyByScalar(t,r,v),n=s.multiplyByScalar(e,1-r,n),s.add(v,n,n)};var g=new s,w=new s,x=new s;s.slerp=function(e,t,r,n){var a=s.dot(e,t),i=t;if(0>a&&(a=-a,i=g=s.negate(t,g)),1-a<o.EPSILON6)return s.lerp(e,i,r,n);var u=Math.acos(a);return w=s.multiplyByScalar(e,Math.sin((1-r)*u),w),x=s.multiplyByScalar(i,Math.sin(r*u),x),n=s.add(w,x,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 E=new e,S=new e,M=new s,b=new s;s.computeInnerQuadrangle=function(t,r,n,a){var i=s.conjugate(r,M);s.multiply(i,n,b);var o=s.log(b,E);s.multiply(i,t,b);var u=s.log(b,S);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,M),s.multiply(r,M,a)},s.squad=function(e,t,r,n,a,i){var o=s.slerp(e,t,a,M),u=s.slerp(r,n,a,b);return s.slerp(o,u,2*a*(1-a),i)};for(var T=new s,A=1.9011074535173003,z=a.supportsTypedArrays()?new Float32Array(8):[],O=a.supportsTypedArrays()?new Float32Array(8):[],N=a.supportsTypedArrays()?new Float32Array(8):[],I=a.supportsTypedArrays()?new Float32Array(8):[],R=0;7>R;++R){var P=R+1,_=2*P+1;z[R]=1/(P*_),O[R]=P/_}return z[7]=A/136,O[7]=8*A/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)N[f]=(z[f]*c-O[f])*o,I[f]=(z[f]*l-O[f])*o;var y=a*r*(1+N[0]*(1+N[1]*(1+N[2]*(1+N[3]*(1+N[4]*(1+N[5]*(1+N[6]*(1+N[7])))))))),d=u*(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=s.multiplyByScalar(e,d,T);return s.multiplyByScalar(t,y,n),s.add(m,n,n)},s.fastSquad=function(e,t,r,n,a,i){var o=s.fastSlerp(e,t,a,M),u=s.fastSlerp(r,n,a,b);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,y,d,m,h,p){var v=t+a;e.multiplyByScalar(l,Math.cos(v),o),e.multiplyByScalar(i,Math.sin(v),u),e.add(o,u,o);var g=Math.cos(t);g*=g;var w=Math.sin(t);w*=w;var x=y/Math.sqrt(d*g+f*w),E=x/m;return n.fromAxisAngle(o,E,s),r.fromQuaternion(s,c),r.multiplyByVector(c,h,p),e.normalize(p,p),e.multiplyByScalar(p,m,p),p}var i={},o=new e,u=new e,s=new n,c=new r,l=new e,f=new e,y=new e,d=new e;i.raisePositionsToHeight=function(t,r,n){for(var a=r.ellipsoid,i=r.height,o=r.extrudedHeight,u=n?2*(t.length/3):t.length/3,s=new Float64Array(3*u),c=d,m=t.length,h=n?m:0,p=0;m>p;p+=3){var v,g=p+1,w=p+2,x=e.fromArray(t,p,l); -x=a.scaleToGeodeticSurface(x,x),v=e.clone(x,f),c=a.geodeticSurfaceNormal(x,c);var E=e.multiplyByScalar(c,i,y);x=e.add(x,E,x),n&&(E=e.multiplyByScalar(c,o,E),v=e.add(v,E,v),s[p+h]=v.x,s[g+h]=v.y,s[w+h]=v.z),s[p]=x.x,s[g]=x.y,s[w]=x.z}return s};var m=new e,h=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,d=r.granularity,v=2.31,g=o*o,w=u*u,x=u*o,E=e.magnitude(c),S=e.normalize(c,m),M=e.cross(e.UNIT_Z,c,h);M=e.normalize(M,M);var b,T,A,z,O,N=e.cross(S,M,p),I=1+Math.ceil(t.PI_OVER_TWO/d),R=v/(I-1),P=2*I*(I+1),_=n?new Array(3*P):void 0,L=0,C=l,D=f,q=i?[]:void 0,B=i?[]:void 0,U=t.PI_OVER_TWO;for(b=0;I>b&&U>0;++b){if(C=a(U,s,N,M,g,x,w,E,S,C),D=a(Math.PI-U,s,N,M,g,x,w,E,S,D),n){for(_[L++]=C.x,_[L++]=C.y,_[L++]=C.z,A=2*b+2,T=1;A-1>T;++T)z=T/(A-1),O=e.lerp(C,D,z,y),_[L++]=O.x,_[L++]=O.y,_[L++]=O.z;_[L++]=D.x,_[L++]=D.y,_[L++]=D.z}i&&(B.unshift(C.x,C.y,C.z),0!==b&&q.push(D.x,D.y,D.z)),U=t.PI_OVER_TWO-(b+1)*R}for(I=b,b=I;b>0;--b){if(U=t.PI_OVER_TWO-(b-1)*R,C=a(-U,s,N,M,g,x,w,E,S,C),D=a(U+Math.PI,s,N,M,g,x,w,E,S,D),n){for(_[L++]=C.x,_[L++]=C.y,_[L++]=C.z,A=2*(b-1)+2,T=1;A-1>T;++T)z=T/(A-1),O=e.lerp(C,D,z,y),_[L++]=O.x,_[L++]=O.y,_[L++]=O.z;_[L++]=D.x,_[L++]=D.y,_[L++]=D.z}i&&(B.unshift(C.x,C.y,C.z),1!==b&&q.push(D.x,D.y,D.z))}var F={};return n&&(_.length!==L&&(P=L/3,_.length=L),F.positions=_,F.numPts=I),i&&(F.outerPositions=B.concat(q)),F},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"],function(e){"use strict";var t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===t.POINTS||e===t.LINES||e===t.LINE_LOOP||e===t.LINE_STRIP||e===t.TRIANGLES||e===t.TRIANGLE_STRIP||e===t.TRIANGLE_FAN}};return e(t)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,a){"use strict";var i=function(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)};return i.computeNumberOfVertices=function(e){var n=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(n!==o&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=o}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(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";var a=function(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,{})};return a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,a){"use strict";var i={};i.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=t.x,n=t.y;t.x=(1-Math.abs(n))*a.signNotZero(r),t.y=(1-Math.abs(r))*a.signNotZero(n)}return t.x=a.toSNorm(t.x),t.y=a.toSNorm(t.y),t},i.octDecode=function(e,r,n){if(n.x=a.fromSNorm(e),n.y=a.fromSNorm(r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var i=n.x;n.x=(1-Math.abs(n.y))*a.signNotZero(i),n.y=(1-Math.abs(i))*a.signNotZero(n.y)}return t.normalize(n,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 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=1===e.x?4095:0|4096*e.x,r=1===e.y?4095:0|4096*e.y;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096;return t.x=Math.floor(r)/4096,t.y=r-Math.floor(r),t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=new t,a=new t,i=new t,o=function(o,u,s,c,l){r(l)||(l=new t);var f,y,d,m,h,p,v,g;r(u.z)?(f=t.subtract(s,u,n),y=t.subtract(c,u,a),d=t.subtract(o,u,i),m=t.dot(f,f),h=t.dot(f,y),p=t.dot(f,d),v=t.dot(y,y),g=t.dot(y,d)):(f=e.subtract(s,u,n),y=e.subtract(c,u,a),d=e.subtract(o,u,i),m=e.dot(f,f),h=e.dot(f,y),p=e.dot(f,d),v=e.dot(y,y),g=e.dot(y,d));var w=1/(m*v-h*h);return l.y=(v*p-h*g)*w,l.z=(m*g-h*p)*w,l.x=1-l.y-l.z,l};return o}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)};r.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var n={high:0,low:0};r.fromCartesian=function(e,a){t(a)||(a=new r);var i=a.high,o=a.low;return r.encode(e.x,n),i.x=n.high,o.x=n.low,r.encode(e.y,n),i.y=n.high,o.y=n.low,r.encode(e.z,n),i.z=n.high,o.z=n.low,a};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"],function(e,t,r,n){"use strict";var a={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,a){return e>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(a)}),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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,0>i?[i,0]:[0,i];var c=n*n,l=4*e*a,f=r(c,-l,t.EPSILON14);if(0>f)return[];var y=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[y/e,a/y]:[a/y,y/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,y=u*u,d=s*s,m=o*s-y,h=o*c-u*s,p=u*c-d,v=4*m*p-h*h;if(0>v){var g,w,x;y*f>=l*d?(g=o,w=m,x=-2*u*m+o*h):(g=c,w=p,x=-c*h+2*s*p);var E=0>x?-1:1,S=-E*Math.abs(g)*Math.sqrt(-v);i=-x+S;var M=i/2,b=0>M?-Math.pow(-M,1/3):Math.pow(M,1/3),T=i===S?-b:-w/b;return a=0>=w?b+T:-x/(b*b+T*T+w),y*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var A=m,z=-2*u*m+o*h,O=p,N=-c*h+2*s*p,I=Math.sqrt(v),R=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*I,-z)/3);a=2*Math.sqrt(-A);var _=Math.cos(P);i=a*_;var L=a*(-_/2-R*Math.sin(P)),C=i+L>2*u?i-u:L-u,D=o,q=C/D;P=Math.abs(Math.atan2(c*I,-N)/3),a=2*Math.sqrt(-O),_=Math.cos(P),i=a*_,L=a*(-_/2-R*Math.sin(P));var B=-c,U=2*s>i+L?i+s:L+s,F=B/U,G=D*U,W=-C*U-D*B,V=C*B,Y=(s*W-u*V)/(-u*W+s*G);return Y>=q?F>=q?F>=Y?[q,Y,F]:[q,F,Y]:[F,q,Y]:F>=q?[Y,q,F]:F>=Y?[Y,F,q]:[F,Y,q]}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=0>u?-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,0>u?[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 y=-t/4,d=f[f.length-1];if(Math.abs(d)<r.EPSILON14){var m=n.computeRealRoots(1,s,l);if(2===m.length){var h,p=m[0],v=m[1];if(p>=0&&v>=0){var g=Math.sqrt(p),w=Math.sqrt(v);return[y-w,y-g,y+g,y+w]}if(p>=0&&0>v)return h=Math.sqrt(p),[y-h,y+h];if(0>p&&v>=0)return h=Math.sqrt(v),[y-h,y+h]}return[]}if(d>0){var x=Math.sqrt(d),E=(s+d-c/x)/2,S=(s+d+c/x)/2,M=n.computeRealRoots(1,x,E),b=n.computeRealRoots(1,-x,S);return 0!==M.length?(M[0]+=y,M[1]+=y,0!==b.length?(b[0]+=y,b[1]+=y,M[1]<=b[0]?[M[0],M[1],b[0],b[1]]:b[1]<=M[0]?[b[0],b[1],M[0],M[1]]:M[0]>=b[0]&&M[1]<=b[1]?[b[0],M[0],M[1],b[1]]:b[0]>=M[0]&&b[1]<=M[1]?[M[0],b[0],b[1],M[1]]:M[0]>b[0]&&M[0]<b[1]?[b[0],M[0],b[1],M[1]]:[M[0],b[0],M[1],b[1]]):M):0!==b.length?(b[0]+=y,b[1]+=y,b):[]}}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,y=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,y);if(d.length>0){var m,h,p=d[0],v=a-p,g=v*v,w=t/2,x=v/2,E=g-4*o,S=g+4*Math.abs(o),M=c-4*p,b=c+4*Math.abs(p);if(0>p||M*S>E*b){var T=Math.sqrt(M);m=T/2,h=0===T?0:(t*x-i)/T}else{var A=Math.sqrt(E);m=0===A?0:(t*x-i)/A,h=A/2}var z,O;0===w&&0===m?(z=0,O=0):r.sign(w)===r.sign(m)?(z=w+m,O=p/z):(O=w-m,z=p/O);var N,I;0===x&&0===h?(N=0,I=0):r.sign(x)===r.sign(h)?(N=x+h,I=o/N):(I=x-h,N=o/I);var R=n.computeRealRoots(1,z,N),P=n.computeRealRoots(1,O,I);if(0!==R.length)return 0!==P.length?R[1]<=P[0]?[R[0],R[1],P[0],P[1]]:P[1]<=R[0]?[P[0],P[1],R[0],R[1]]:R[0]>=P[0]&&R[1]<=P[1]?[P[0],R[0],R[1],P[1]]:P[0]>=R[0]&&P[1]<=R[1]?[R[0],P[0],P[1],R[1]]:R[0]>P[0]&&R[0]<P[1]?[P[0],R[0],P[1],R[1]]:[R[0],P[0],R[1],P[1]]:R;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,y=f*n,d=a*a,m=d*a,h=u*c*f-4*s*y-4*e*l*f+18*e*t*r*y-27*i*f*f+256*o*m+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)+d*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return h},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,y=s/t,d=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>f?d+1:d,d+=0>y?d+1:d){case 0:return a(c,l,f,y);case 1:return i(c,l,f,y);case 2:return i(c,l,f,y);case 3:return a(c,l,f,y);case 4:return a(c,l,f,y);case 5:return i(c,l,f,y);case 6:return a(c,l,f,y);case 7:return a(c,l,f,y);case 8:return i(c,l,f,y);case 9:return a(c,l,f,y);case 10:return a(c,l,f,y);case 11:return i(c,l,f,y);case 12:return a(c,l,f,y);case 13:return a(c,l,f,y);case 14:return a(c,l,f,y);case 15:return a(c,l,f,y);default:return void 0}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=function(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n};return n.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},n}),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(t,n,a,o,u){u=r(u,!1);var s,c,l,f,y,d=t.origin,m=t.direction,h=e.subtract(a,n,p),E=e.subtract(o,n,v),S=e.cross(m,E,g),M=e.dot(h,S);if(u){if(M<i.EPSILON6)return void 0;if(s=e.subtract(d,n,w),l=e.dot(s,S),0>l||l>M)return void 0;if(c=e.cross(s,h,x),f=e.dot(m,c),0>f||l+f>M)return void 0;y=e.dot(E,c)/M}else{if(Math.abs(M)<i.EPSILON6)return void 0;var b=1/M;if(s=e.subtract(d,n,w),l=e.dot(s,S)*b,0>l||l>1)return void 0;if(c=e.cross(s,h,x),f=e.dot(m,c)*b,0>f||l+f>1)return void 0;y=e.dot(E,c)*b}return y}function f(e,t,r,n){var a=t*t-4*e*r;if(0>a)return void 0;if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);return 0===c?void 0:(n.root0=n.root1=c,n)}function y(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,g),l=e.dot(o,o),y=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,m=f(l,y,d,S);return n(m)?(a.start=m.root0,a.stop=m.root1,a):void 0}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 m(t,r,n,a,c){var l,f=a*a,y=c*c,m=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*y,h=c*(a*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+r.y),p=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*y+a*r.x+n,v=y*d(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),g=c*(a*d(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+r.z),w=[];if(0===g&&0===v){if(l=u.computeRealRoots(m,h,p),0===l.length)return w;var x=l[0],E=Math.sqrt(Math.max(1-x*x,0));if(w.push(new e(a,c*x,c*-E)),w.push(new e(a,c*x,c*E)),2===l.length){var S=l[1],M=Math.sqrt(Math.max(1-S*S,0));w.push(new e(a,c*S,c*-M)),w.push(new e(a,c*S,c*M))}return w}var b=g*g,T=v*v,A=m*m,z=g*v,O=A+T,N=2*(h*m+z),I=2*p*m+h*h-T+b,R=2*(p*h-z),P=p*p-b;if(0===O&&0===N&&0===I&&0===R)return w;l=s.computeRealRoots(O,N,I,R,P);var _=l.length;if(0===_)return w;for(var L=0;_>L;++L){var C,D=l[L],q=D*D,B=Math.max(1-q,0),U=Math.sqrt(B);C=i.sign(m)===i.sign(p)?d(m*q+p,h*D,i.EPSILON12):i.sign(p)===i.sign(h*D)?d(m*q,h*D+p,i.EPSILON12):d(m*q+h*D,p,i.EPSILON12);var F=d(v*D,g,i.EPSILON15),G=C*F;0>G?w.push(new e(a,c*D,c*U)):G>0?w.push(new e(a,c*D,c*-U)):0!==U?(w.push(new e(a,c*D,c*-U)),w.push(new e(a,c*D,c*U)),++L):w.push(new e(a,c*D,c*U))}return w}var h={};h.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)return void 0;var l=(-r.distance-e.dot(s,o))/c;return 0>l?void 0:(a=e.multiplyByScalar(u,l,a),e.add(o,a,a))};var p=new e,v=new e,g=new e,w=new e,x=new e;h.rayTriangle=function(t,r,a,i,o,u){var s=l(t,r,a,i,o);return!n(s)||0>s?void 0:(n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u))};var E=new c;h.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=E;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var f=l(c,a,i,o,u);return!n(f)||0>f||f>e.distance(t,r)?void 0:(n(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var S={root0:0,root1:0};h.raySphere=function(e,t,r){return r=y(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var M=new c;h.lineSegmentSphere=function(t,r,a,i){var o=M;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=y(o,a,i),!n(i)||i.stop<0||i.start>s?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i)};var b=new e,T=new e;h.rayEllipsoid=function(t,r){var n,a,i,o,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,b),l=e.multiplyComponents(s,t.direction,T),f=e.magnitudeSquared(c),y=e.dot(c,l);if(f>1){if(y>=0)return void 0;var d=y*y;if(n=f-1,a=e.magnitudeSquared(l),i=a*n,i>d)return void 0;if(d>i){o=y*y-i,u=-y+Math.sqrt(o);var m=u/a,h=n/u;return h>m?{start:m,stop:h}:{start:h,stop:m}}var p=Math.sqrt(n/a);return{start:p,stop:p}}return 1>f?(n=f-1,a=e.magnitudeSquared(l),i=a*n,o=y*y-i,u=-y+Math.sqrt(o),{start:0,stop:u/a}):0>y?(a=e.magnitudeSquared(l),{start:0,stop:-y/a}):void 0};var A=new e,z=new e,O=new e,N=new e,I=new e,R=new o,P=new o,_=new o,L=new o,C=new o,D=new o,q=new o,B=new e,U=new e,F=new t;h.grazingAltitudeLocation=function(t,r){var a=t.origin,u=t.direction,s=r.geodeticSurfaceNormal(a);if(e.dot(u,s)>=0)return a;var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u),f=e.normalize(l,A),y=e.mostOrthogonalAxis(l,N),d=e.normalize(e.cross(y,f,z),z),h=e.normalize(e.cross(f,d,O),O),p=R;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]=h.x,p[7]=h.y,p[8]=h.z;var v=o.transpose(p,P),g=o.fromScale(r.radii,_),w=o.fromScale(r.oneOverRadii,L),x=C;x[0]=0,x[1]=-u.z,x[2]=u.y,x[3]=u.z,x[4]=0,x[5]=-u.x,x[6]=-u.y,x[7]=u.x,x[8]=0;var E,S,M=o.multiply(o.multiply(v,w,D),x,D),b=o.multiply(o.multiply(M,g,q),p,q),T=o.multiplyByVector(M,a,I),G=m(b,e.negate(T,A),0,0,1),W=G.length;if(W>0){for(var V=e.clone(e.ZERO,U),Y=Number.NEGATIVE_INFINITY,k=0;W>k;++k){E=o.multiplyByVector(g,o.multiplyByVector(p,G[k],B),B);var j=e.normalize(e.subtract(E,a,N),N),H=e.dot(j,u);H>Y&&(Y=H,V=e.clone(E,V))}var Z=r.cartesianToCartographic(V,F);return Y=i.clamp(Y,0,1),S=e.magnitude(e.subtract(V,a,N))*Math.sqrt(1-Y*Y),S=c?-S:S,Z.height=S,r.cartographicToCartesian(Z)}return void 0};var G=new e;return h.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)return void 0;var l=e.dot(s,t),f=-(a.distance+l)/c;return 0>f||f>1?void 0:(e.multiplyByScalar(u,f,o),e.add(t,o,o),o)},h.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,y;if((1===l||2===l)&&(f=new e,y=new e),1===l){if(u)return h.lineSegmentPlane(t,r,a,f),h.lineSegmentPlane(t,n,a,y),{positions:[t,r,n,f,y],indices:[0,3,4,1,2,4,1,4,3]};if(s)return h.lineSegmentPlane(r,n,a,f),h.lineSegmentPlane(r,t,a,y),{positions:[t,r,n,f,y],indices:[1,3,4,2,0,4,2,4,3]};if(c)return h.lineSegmentPlane(n,t,a,f),h.lineSegmentPlane(n,r,a,y),{positions:[t,r,n,f,y],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return h.lineSegmentPlane(r,t,a,f),h.lineSegmentPlane(n,t,a,y),{positions:[t,r,n,f,y],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return h.lineSegmentPlane(n,r,a,f),h.lineSegmentPlane(t,r,a,y),{positions:[t,r,n,f,y],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return h.lineSegmentPlane(t,n,a,f),h.lineSegmentPlane(r,n,a,y),{positions:[t,r,n,f,y],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},h}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(t,r){this.normal=e.clone(t),this.distance=r};return r.fromPointNormal=function(n,a,i){var o=-e.dot(a,n);return t(i)?(e.clone(a,i.normal),i.distance=o,i):new r(a,o)},r.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},r}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};return r.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];o>u;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;a+1>l;l++)c[l]=0;for(var f=i+1,y=0;o>y;++y)f-c[n[y]]>i&&(c[n[y]]=f,++f);return(f-i+1)/(o/3)},r.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(;n>i;){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 y=r[f];a[y].numLiveTriangles&&(s=0,i-a[y].timeStamp+2*a[y].numLiveTriangles<=t&&(s=i-a[y].timeStamp),(s>l||-1===l)&&(l=s,c=y)),++f}return-1===c?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,y=o[f],d=c;if(t(u))l=u+1;else{for(;d>f;)y>l&&(l=y),++f,y=o[f];if(-1===l)return 0;++l}for(var m=[],h=0;l>h;h++)m[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var p=0;d>f;)m[o[f]].vertexTriangles.push(p),++m[o[f]].numLiveTriangles,m[o[f+1]].vertexTriangles.push(p),++m[o[f+1]].numLiveTriangles,m[o[f+2]].vertexTriangles.push(p),++m[o[f+2]].numLiveTriangles,++p,f+=3;var v=0,g=s+1;i=1;var w,x,E=[],S=[],M=0,b=[],T=c/3,A=[];for(h=0;T>h;h++)A[h]=!1;for(var z,O;-1!==v;){E=[],x=m[v],O=x.vertexTriangles.length;for(var N=0;O>N;++N)if(p=x.vertexTriangles[N],!A[p]){A[p]=!0,f=p+p+p;for(var I=0;3>I;++I)z=o[f],E.push(z),S.push(z),b[M]=z,++M,w=m[z],--w.numLiveTriangles,g-w.timeStamp>s&&(w.timeStamp=g,++g),++f}v=a(o,s,E,m,g,S,l)}return b},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,r,n,a,i,o,u,s,c,l,f,y,d,m,h,p,v,g,w,x,E,S,M,b){"use strict";function T(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function A(e){for(var t=e.length,r=6*(t/3),n=p.createTypedArray(t,r),a=0,i=0;t>i;i+=3,a+=6)T(n,a,e[i],e[i+1],e[i+2]);return n}function z(e){var t=e.length;if(t>=3){var r=6*(t-2),n=p.createTypedArray(t,r);T(n,0,e[0],e[1],e[2]);for(var a=6,i=3;t>i;++i,a+=6)T(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function O(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;t>o;++o,i+=6)T(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function N(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 I(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 R(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;n>i;i+=3)a.unpack(r,i,J),E.multiplyByPoint(e,J,J),a.pack(J,r,i)}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;n>i;i+=3)a.unpack(r,i,J),x.multiplyByVector(e,J,J),J=a.normalize(J,J),a.pack(J,r,i)}function _(e){var t,r=e.length,n={},a=e[0].geometry.attributes;for(t in a)if(a.hasOwnProperty(t)&&c(a[t])&&c(a[t].values)){for(var i=a[t],o=i.values.length,s=!0,l=1;r>l;++l){var f=e[l].geometry.attributes[t];if(!c(f)||i.componentDatatype!==f.componentDatatype||i.componentsPerAttribute!==f.componentsPerAttribute||i.normalize!==f.normalize){s=!1;break}o+=f.values.length}s&&(n[t]=new m({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:u.createTypedArray(i.componentDatatype,o)}))}return n}function L(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function C(e){var t=d.computeNumberOfVertices(e),r=p.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;t>a;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=M.TRIANGLES,e}function D(e){var t=d.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;t-1>a;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,t>a+2&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=M.TRIANGLES,e}function q(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function B(e){var t=d.computeNumberOfVertices(e),r=p.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;t>a;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=M.LINES,e}function U(e){var t=d.computeNumberOfVertices(e),r=p.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;t>a;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=M.LINES,e}function F(e){switch(e.primitiveType){case M.TRIANGLE_FAN:return C(e);case M.TRIANGLE_STRIP:return D(e);case M.TRIANGLES:return L(e);case M.LINE_STRIP:return B(e);case M.LINE_LOOP:return U(e);case M.LINES:return q(e)}return e}function G(e,t){Math.abs(e.y)<w.EPSILON11&&(e.y=t?-w.EPSILON11:w.EPSILON11)}function W(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,dt),e.y/(e.y-t.y),dt),r),a.clone(r,n),G(r,!0),G(n,!1)}function V(e,t,r){if(e.x>=0||t.x>=0||r.x>=0)return void 0;var n=e.y<0,a=t.y<0,i=r.y<0;G(e,n),G(t,a),G(r,i);var o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=gt.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(W(e,t,mt,pt),W(e,r,ht,vt),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(W(t,r,mt,pt),W(t,e,ht,vt),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(W(r,e,mt,pt),W(r,t,ht,vt),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,mt,pt),W(r,t,ht,vt),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(W(t,r,mt,pt),W(t,e,ht,vt),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(W(e,t,mt,pt),W(e,r,ht,vt),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=gt.positions;return s[0]=e,s[1]=t,s[2]=r,gt.length=3,(1===o||2===o)&&(s[3]=mt,s[4]=ht,s[5]=pt,s[6]=vt,gt.length=7),gt}function Y(e,r,i,o,u,s,l,f){if(c(u)||c(s)||c(l)||c(f)){var y,d,m,h,p,v,g,w,x,E,S,M,b=o.positions,T=b[0],A=b[1],z=b[2],O=wt,N=xt,I=Et,R=St,P=Mt,_=bt;c(u)&&(y=a.fromArray(u,3*e),d=a.fromArray(u,3*r),m=a.fromArray(u,3*i)),c(s)&&(h=a.fromArray(s,3*e),p=a.fromArray(s,3*r),v=a.fromArray(s,3*i)),c(l)&&(g=a.fromArray(l,3*e),w=a.fromArray(l,3*r),x=a.fromArray(l,3*i)),c(f)&&(E=n.fromArray(f,2*e),S=n.fromArray(f,2*r),M=n.fromArray(f,2*i));for(var L=3;L<b.length;++L){var C=b[L],D=t(C,T,A,z);if(c(u)){O=a.multiplyByScalar(y,D.x,O),N=a.multiplyByScalar(d,D.y,N),I=a.multiplyByScalar(m,D.z,I);var q=a.add(O,N,Tt);a.add(q,I,q),a.normalize(q,q),u.push(q.x,q.y,q.z)}if(c(s)){O=a.multiplyByScalar(h,D.x,O),N=a.multiplyByScalar(p,D.y,N),I=a.multiplyByScalar(v,D.z,I);var B=a.add(O,N,Tt);a.add(B,I,B),a.normalize(B,B),s.push(B.x,B.y,B.z)}if(c(l)){O=a.multiplyByScalar(g,D.x,O),N=a.multiplyByScalar(w,D.y,N),I=a.multiplyByScalar(x,D.z,I);var U=a.add(O,N,Tt);a.add(U,I,U),a.normalize(U,U),l.push(U.x,U.y,U.z)}if(c(f)){R=n.multiplyByScalar(E,D.x,R),P=n.multiplyByScalar(S,D.y,P),_=n.multiplyByScalar(M,D.z,_);var F=n.add(R,P,R);n.add(F,_,F),f.push(F.x,F.y)}}}}function k(e){for(var t=e.attributes,r=t.position.values,n=c(t.normal)?t.normal.values:void 0,i=c(t.binormal)?t.binormal.values:void 0,o=c(t.tangent)?t.tangent.values:void 0,s=c(t.st)?t.st.values:void 0,l=e.indices,f=Array.prototype.slice.call(r,0),y=c(n)?Array.prototype.slice.call(n,0):void 0,m=c(i)?Array.prototype.slice.call(i,0):void 0,h=c(o)?Array.prototype.slice.call(o,0):void 0,v=c(s)?Array.prototype.slice.call(s,0):void 0,g=[],w=l.length,x=0;w>x;x+=3){var E=l[x],S=l[x+1],M=l[x+2],b=a.fromArray(r,3*E),T=a.fromArray(r,3*S),A=a.fromArray(r,3*M),z=V(b,T,A);if(c(z))if(f[3*E+1]=z.positions[0].y,f[3*S+1]=z.positions[1].y,f[3*M+1]=z.positions[2].y,z.length>3){for(var O=f.length/3,N=0;N<z.indices.length;++N){var I=z.indices[N];3>I?g.push(l[x+I]):g.push(I-3+O)}for(var R=3;R<z.positions.length;++R){var P=z.positions[R];f.push(P.x,P.y,P.z)}Y(E,S,M,z,y,m,h,v)}else g.push(E,S,M);else g.push(E,S,M)}e.attributes.position.values=new Float64Array(f),c(y)&&(t.normal.values=u.createTypedArray(t.normal.componentDatatype,y)),c(m)&&(t.binormal.values=u.createTypedArray(t.binormal.componentDatatype,m)),c(h)&&(t.tangent.values=u.createTypedArray(t.tangent.componentDatatype,h)),c(v)&&(t.st.values=u.createTypedArray(t.st.componentDatatype,v));var _=d.computeNumberOfVertices(e);e.indices=p.createTypedArray(_,g)}function j(e){for(var t=e.attributes,r=t.position.values,n=e.indices,i=Array.prototype.slice.call(r,0),o=[],u=n.length,s=0;u>s;s+=2){var l=n[s],f=n[s+1],y=a.fromArray(r,3*l),m=a.fromArray(r,3*f);if(Math.abs(y.y)<w.EPSILON6&&(y.y=y.y<0?-w.EPSILON6:w.EPSILON6,i[3*l+1]=y.y),Math.abs(m.y)<w.EPSILON6&&(m.y=m.y<0?-w.EPSILON6:w.EPSILON6,i[3*f+1]=m.y),o.push(l),y.x<0||m.x<0){var h=g.lineSegmentPlane(y,m,At);if(c(h)){var v=a.multiplyByScalar(a.UNIT_Y,5*w.EPSILON9,zt);y.y<0&&a.negate(v,v);var x=i.length/3;o.push(x,x+1);var E=a.add(h,v,Ot);i.push(E.x,E.y,E.z),a.negate(v,v),a.add(h,v,E),i.push(E.x,E.y,E.z)}}o.push(f)}e.attributes.position.values=new Float64Array(i);var S=d.computeNumberOfVertices(e);e.indices=p.createTypedArray(S,o)}function H(e){var t=e.attributes,r=t.position.values,o=c(t.st)?t.st.values:void 0,s=c(t.prevPosition)?t.prevPosition.values:void 0,l=c(t.nextPosition)?t.nextPosition.values:void 0,f=c(t.expandAndWidth)?t.expandAndWidth.values:void 0,y=c(t.color)?t.color.values:void 0;e.indices;for(var m=Array.prototype.slice.call(r,0),h=c(o)?Array.prototype.slice.call(o,0):void 0,v=c(s)?Array.prototype.slice.call(s,0):void 0,x=c(l)?Array.prototype.slice.call(l,0):void 0,E=c(f)?Array.prototype.slice.call(f,0):void 0,S=c(y)?Array.prototype.slice.call(y,0):void 0,M=[],b=m.length/3,T=0;b>T;T+=4){var A=T,z=T+1,O=T+2,N=a.fromArray(m,3*A,Rt),I=a.fromArray(m,3*z,Pt),R=a.fromArray(m,3*O,_t),P=a.equals(N,I);Math.abs(N.y)<w.EPSILON6&&(N.y=R.y<0?-w.EPSILON6:w.EPSILON6,m[3*A+1]=N.y),Math.abs(R.y)<w.EPSILON6&&(R.y=N.y<0?-w.EPSILON6:w.EPSILON6,m[3*O+1]=R.y),m[3*z+1]=I.y=P?N.y:R.y;var _=!1;if(N.x<0||R.x<0){var L=g.lineSegmentPlane(N,R,At,Pt);if(c(L)){var C=a.multiplyByScalar(a.UNIT_Y,5*w.EPSILON9,Lt);N.y<0&&a.negate(C,C);var D=a.add(L,C,Ct);m.push(D.x,D.y,D.z),m.push(D.x,D.y,D.z),a.negate(C,C),a.add(L,C,D),m.push(D.x,D.y,D.z),m.push(D.x,D.y,D.z),v.push(N.x,N.y,N.z,N.x,N.y,N.z),v.push(N.x,N.y,N.z,N.x,N.y,N.z),x.push(R.x,R.y,R.z,R.x,R.y,R.z),x.push(R.x,R.y,R.z,R.x,R.y,R.z);var q=n.fromArray(E,2*A),B=Math.abs(q.y);E.push(-1,-B,1,-B),E.push(-1,B,1,B);var U=a.magnitudeSquared(a.subtract(L,N,Lt));if(U/=a.magnitudeSquared(a.subtract(R,N,Lt)),c(S)){var F=i.fromArray(S,4*A,Dt),G=i.fromArray(S,4*O,Dt),W=w.lerp(F.x,G.x,U),V=w.lerp(F.y,G.y,U),Y=w.lerp(F.z,G.z,U),k=w.lerp(F.w,G.w,U);S.push(W,V,Y,k),S.push(W,V,Y,k),S.push(W,V,Y,k),S.push(W,V,Y,k)}if(c(h)){var j=n.fromArray(h,2*A,Nt),H=n.fromArray(h,2*(T+3),It),Z=w.lerp(j.x,H.x,U);h.push(Z,j.y),h.push(Z,H.y),h.push(Z,j.y),h.push(Z,H.y)}_=!0}}if(_){var X=m.length/3-4;M.push(T,X,T+1),M.push(T+1,X,X+1),M.push(X+2,T+2,X+3),M.push(X+3,T+2,T+3)}else M.push(T,T+2,T+1),M.push(T+1,T+2,T+3)}t.position.values=new Float64Array(m),t.prevPosition.values=u.createTypedArray(t.prevPosition.componentDatatype,v),t.nextPosition.values=u.createTypedArray(t.nextPosition.componentDatatype,x),t.expandAndWidth.values=u.createTypedArray(t.expandAndWidth.componentDatatype,E),c(h)&&(t.st.values=u.createTypedArray(t.st.componentDatatype,h)),c(S)&&(t.color.values=u.createTypedArray(t.color.componentDatatype,S));var Q=d.computeNumberOfVertices(e);e.indices=p.createTypedArray(Q,M)}var Z={};Z.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case M.TRIANGLES:e.indices=A(t);break;case M.TRIANGLE_STRIP:e.indices=z(t);break;case M.TRIANGLE_FAN:e.indices=O(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=M.LINES}return e},Z.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,y=0;o>y;y+=3)l[f++]=a[y],l[f++]=a[y+1],l[f++]=a[y+2],l[f++]=a[y]+i[y]*n,l[f++]=a[y+1]+i[y+1]*n,l[f++]=a[y+2]+i[y+2]*n;var h,p=e.boundingSphere;return c(p)&&(h=new r(p.center,p.radius+n)),new d({attributes:{position:new m({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:M.LINES,boundingSphere:h}) -},Z.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;o>t;++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},Z.reorderForPreVertexCache=function(e){var t=d.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;t>a;a++)n[a]=-1;for(var i,o=r,s=o.length,l=p.createTypedArray(t,s),f=0,y=0,m=0;s>f;)i=n[o[f]],-1!==i?l[y]=i:(i=o[f],n[i]=m,l[y]=m,++m),++f,++y;e.indices=l;var h=e.attributes;for(var v in h)if(h.hasOwnProperty(v)&&c(h[v])&&c(h[v].values)){for(var g=h[v],w=g.values,x=0,E=g.componentsPerAttribute,S=u.createTypedArray(g.componentDatatype,m*E);t>x;){var M=n[x];if(-1!==M)for(a=0;E>a;a++)S[E*M+a]=w[E*x+a];++x}g.values=S}}return e},Z.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===M.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;n>i;i++)r[i]>a&&(a=r[i]);e.indices=b.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},Z.fitToUnsignedShortIndices=function(e){var t=[],r=d.computeNumberOfVertices(e);if(c(e.indices)&&r>w.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=N(e.attributes),s=e.indices,l=s.length;e.primitiveType===M.TRIANGLES?n=3:e.primitiveType===M.LINES?n=2:e.primitiveType===M.POINTS&&(n=1);for(var f=0;l>f;f+=n){for(var y=0;n>y;++y){var m=s[f+y],h=a[m];c(h)||(h=o++,a[m]=h,I(u,e.attributes,m)),i.push(h)}o+n>w.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere})),a=[],i=[],o=0,u=N(e.attributes))}0!==i.length&&t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere}))}else t.push(e);return t};var X=new a,Q=new o;Z.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new y;for(var s=i.ellipsoid,f=o.values,d=new Float64Array(f.length),h=0,p=0;p<f.length;p+=3){var v=a.fromArray(f,p,X),g=s.cartesianToCartographic(v,Q);if(!c(g))throw new l("Could not project point ("+v.x+", "+v.y+", "+v.z+") to 2D.");var w=i.project(g,X);d[h++]=w.x,d[h++]=w.y,d[h++]=w.z}return e.attributes[r]=o,e.attributes[n]=new m({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:d}),delete e.attributes[t],e};var K={high:0,low:0};Z.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;o>l;++l)f.encode(i[l],K),s[l]=K.high,c[l]=K.low;var y=a.componentsPerAttribute;return e.attributes[r]=new m({componentDatatype:u.FLOAT,componentsPerAttribute:y,values:s}),e.attributes[n]=new m({componentDatatype:u.FLOAT,componentsPerAttribute:y,values:c}),delete e.attributes[t],e};var J=new a,$=new E,et=new x;Z.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(E.equals(t,E.IDENTITY))return e;var n=e.geometry.attributes;R(t,n.position),R(t,n.prevPosition),R(t,n.nextPosition),(c(n.normal)||c(n.binormal)||c(n.tangent))&&(E.inverse(t,$),E.transpose($,$),E.getRotation($,et),P(et,n.normal),P(et,n.binormal),P(et,n.tangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=E.clone(E.IDENTITY),e};var tt=new a;Z.combine=function(e){var t,n,i,o,u=e.length;e[0].modelMatrix;var s,l,f,y=c(e[0].geometry.indices),m=e[0].geometry.primitiveType,h=_(e);for(t in h)if(h.hasOwnProperty(t))for(s=h[t].values,o=0,n=0;u>n;++n)for(l=e[n].geometry.attributes[t].values,f=l.length,i=0;f>i;++i)s[o++]=l[i];var v;if(y){var g=0;for(n=0;u>n;++n)g+=e[n].geometry.indices.length;var w=d.computeNumberOfVertices(new d({attributes:h,primitiveType:M.POINTS})),x=p.createTypedArray(w,g),E=0,S=0;for(n=0;u>n;++n){var b=e[n].geometry.indices,T=b.length;for(o=0;T>o;++o)x[E++]=S+b[o];S+=d.computeNumberOfVertices(e[n].geometry)}v=x}var A,z=new a,O=0;for(n=0;u>n;++n){if(A=e[n].geometry.boundingSphere,!c(A)){z=void 0;break}a.add(A.center,z,z)}if(c(z))for(a.divideByScalar(z,u,z),n=0;u>n;++n){A=e[n].geometry.boundingSphere;var N=a.magnitude(a.subtract(A.center,z,tt))+A.radius;N>O&&(O=N)}return new d({attributes:h,indices:v,primitiveType:m,boundingSphere:c(z)?new r(z,O):void 0})};var rt=new a,nt=new a,at=new a,it=new a;Z.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;i>f;f++)s[f]={indexOffset:0,count:0,currentCount:0};var y=0;for(f=0;o>f;f+=3){var d=t[f],h=t[f+1],p=t[f+2],v=3*d,g=3*h,w=3*p;nt.x=n[v],nt.y=n[v+1],nt.z=n[v+2],at.x=n[g],at.y=n[g+1],at.z=n[g+2],it.x=n[w],it.y=n[w+1],it.z=n[w+2],s[d].count++,s[h].count++,s[p].count++,a.subtract(at,nt,at),a.subtract(it,nt,it),c[y]=a.cross(at,it,new a),y++}var x=0;for(f=0;i>f;f++)s[f].indexOffset+=x,x+=s[f].count;y=0;var E;for(f=0;o>f;f+=3){E=s[t[f]];var S=E.indexOffset+E.currentCount;l[S]=y,E.currentCount++,E=s[t[f+1]],S=E.indexOffset+E.currentCount,l[S]=y,E.currentCount++,E=s[t[f+2]],S=E.indexOffset+E.currentCount,l[S]=y,E.currentCount++,y++}var M=new Float32Array(3*i);for(f=0;i>f;f++){var b=3*f;if(E=s[f],E.count>0){for(a.clone(a.ZERO,rt),y=0;y<E.count;y++)a.add(rt,c[l[E.indexOffset+y]],rt);a.normalize(rt,rt),M[b]=rt.x,M[b+1]=rt.y,M[b+2]=rt.z}else M[b]=0,M[b+1]=0,M[b+2]=1}return e.attributes.normal=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:M}),e};var ot=new a,ut=new a,st=new a;Z.computeBinormalAndTangent=function(e){e.attributes;for(var t=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,y,d;for(l=0;s>l;l+=3){var h=t[l],p=t[l+1],v=t[l+2];f=3*h,y=3*p,d=3*v;var g=2*h,w=2*p,x=2*v,E=r[f],S=r[f+1],M=r[f+2],b=i[g],T=i[g+1],A=i[w+1]-T,z=i[x+1]-T,O=1/((i[w]-b)*z-(i[x]-b)*A),N=(z*(r[y]-E)-A*(r[d]-E))*O,I=(z*(r[y+1]-S)-A*(r[d+1]-S))*O,R=(z*(r[y+2]-M)-A*(r[d+2]-M))*O;c[f]+=N,c[f+1]+=I,c[f+2]+=R,c[y]+=N,c[y+1]+=I,c[y+2]+=R,c[d]+=N,c[d+1]+=I,c[d+2]+=R}var P=new Float32Array(3*o),_=new Float32Array(3*o);for(l=0;o>l;l++){f=3*l,y=f+1,d=f+2;var L=a.fromArray(n,f,ot),C=a.fromArray(c,f,st),D=a.dot(L,C);a.multiplyByScalar(L,D,ut),a.normalize(a.subtract(C,ut,C),C),_[f]=C.x,_[y]=C.y,_[d]=C.z,a.normalize(a.cross(L,C,C),C),P[f]=C.x,P[y]=C.y,P[d]=C.z}return e.attributes.tangent=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:_}),e.attributes.binormal=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e};var ct=new n,lt=new a,ft=new a,yt=new a;Z.compressVertices=function(t){var r=t.attributes.normal,i=t.attributes.st;if(!c(r)&&!c(i))return t;var o,s,l,f,y=t.attributes.tangent,d=t.attributes.binormal;c(r)&&(o=r.values),c(i)&&(s=i.values),c(y)&&(l=y.values),d&&(f=d.values);var h=c(o)?o.length:s.length,p=c(o)?3:2,v=h/p,g=v,w=c(s)&&c(o)?2:1;w+=c(l)||c(f)?1:0,g*=w;for(var x=new Float32Array(g),E=0,S=0;v>S;++S){c(s)&&(n.fromArray(s,2*S,ct),x[E++]=e.compressTextureCoordinates(ct));var M=3*S;c(o)&&c(l)&&c(f)?(a.fromArray(o,M,lt),a.fromArray(l,M,ft),a.fromArray(f,M,yt),e.octPack(lt,ft,yt,ct),x[E++]=ct.x,x[E++]=ct.y):(c(o)&&(a.fromArray(o,M,lt),x[E++]=e.octEncodeFloat(lt)),c(l)&&(a.fromArray(l,M,lt),x[E++]=e.octEncodeFloat(lt)),c(f)&&(a.fromArray(f,M,lt),x[E++]=e.octEncodeFloat(lt)))}return t.attributes.compressedAttributes=new m({componentDatatype:u.FLOAT,componentsPerAttribute:w,values:x}),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 dt=new a,mt=new a,ht=new a,pt=new a,vt=new a,gt={positions:new Array(7),indices:new Array(9)},wt=new a,xt=new a,Et=new a,St=new n,Mt=new n,bt=new n,Tt=new a,At=S.fromPointNormal(a.ZERO,a.UNIT_Y),zt=new a,Ot=new a,Nt=new n,It=new n,Rt=new a,Pt=new a,_t=new a,Lt=new a,Ct=new a,Dt=new i;return new i,Z.wrapLongitude=function(e){var t=e.boundingSphere;if(c(t)){var n=t.center.x-t.radius;if(n>0||r.intersect(t,i.UNIT_Y)!==v.INTERSECTING)return e}if(e.geometryType!==h.NONE)switch(e.geometryType){case h.POLYLINES:H(e);break;case h.TRIANGLES:k(e);break;case h.LINES:j(e)}else F(e),e.primitiveType===M.TRIANGLES?k(e):e.primitiveType===M.LINES&&j(e);return e},Z}),define("Core/VertexFormat",["./defaultValue","./freezeObject"],function(e,t){"use strict";var r=function(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 r.POSITION_ONLY=t(new r({position:!0})),r.POSITION_AND_NORMAL=t(new r({position:!0,normal:!0})),r.POSITION_NORMAL_AND_ST=t(new r({position:!0,normal:!0,st:!0})),r.POSITION_AND_ST=t(new r({position:!0,st:!0})),r.POSITION_AND_COLOR=t(new r({position:!0,color:!0})),r.ALL=t(new r({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),r.DEFAULT=r.POSITION_NORMAL_AND_ST,r}),define("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,r,n,a,i,o,u,s,c,l,f,y,d,m,h,p,v,g,w,x,E){"use strict";function S(e,t,n){var i=t.vertexFormat,o=t.center,u=t.semiMajorAxis,c=t.ellipsoid,f=t.stRotation,m=n?2*(e.length/3):e.length/3,h=i.st?new Float32Array(2*m):void 0,p=i.normal?new Float32Array(3*m):void 0,v=i.tangent?new Float32Array(3*m):void 0,w=i.binormal?new Float32Array(3*m):void 0,E=0,S=C,M=D,b=q,T=new l(c),A=T.project(c.cartesianToCartographic(o,B),U),z=c.scaleToGeodeticSurface(o,O);c.geodeticSurfaceNormal(z,z);for(var R=x.fromAxisAngle(z,f,L),F=g.fromQuaternion(R,_),G=e.length,W=n?G:0,V=2*(W/3),Y=0;G>Y;Y+=3){var k=Y+1,j=Y+2,H=r.fromArray(e,Y,O);if(i.st){var Z=g.multiplyByVector(F,H,N),X=T.project(c.cartesianToCartographic(Z,B),I);r.subtract(X,A,X),P.x=(X.x+u)/(2*u),P.y=(X.y+u)/(2*u),n&&(h[E+V]=P.x,h[E+1+V]=P.y),h[E++]=P.x,h[E++]=P.y}S=c.geodeticSurfaceNormal(H,S),(i.normal||i.tangent||i.binormal)&&((i.tangent||i.binormal)&&(M=r.cross(r.UNIT_Z,S,M),g.multiplyByVector(F,M,M)),i.normal&&(p[Y]=S.x,p[k]=S.y,p[j]=S.z,n&&(p[Y+W]=-S.x,p[k+W]=-S.y,p[j+W]=-S.z)),i.tangent&&(v[Y]=M.x,v[k]=M.y,v[j]=M.z,n&&(v[Y+W]=-M.x,v[k+W]=-M.y,v[j+W]=-M.z)),i.binormal&&(b=r.cross(S,M,b),w[Y]=b.x,w[k]=b.y,w[j]=b.z,n&&(w[Y+W]=b.x,w[k+W]=b.y,w[j+W]=b.z)))}var Q=new d;if(i.position){var K=s.raisePositionsToHeight(e,t,n);Q.position=new y({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:K})}return i.st&&(Q.st=new y({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:h})),i.normal&&(Q.normal=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(Q.tangent=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),i.binormal&&(Q.binormal=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:w})),Q}function M(e){var t,r,n,a,i,o=new Array(2*e*(e+1)),u=0;for(a=1;e>a;++a){for(n=a*(a+1),t=(a-1)*a,o[u++]=n++,o[u++]=t,o[u++]=n,r=2*a,i=0;r-1>i;++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;r-1>a;++a)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;for(++t,++n,a=e-1;a>0;--a){for(o[u++]=t++,o[u++]=t,o[u++]=n,r=2*a,i=0;r-1>i;++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++}return o}function b(t){var n=t.center;F=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(n,F),t.height,F),F=r.add(n,F,F);var a=new e(F,t.semiMajorAxis),i=s.computeEllipsePositions(t,!0,!1),o=i.positions,u=i.numPts,c=S(o,t,!1),l=M(u);return l=p.createTypedArray(o.length/3,l),{boundingSphere:a,attributes:c,indices:l}}function T(e,t){var n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,u=t.ellipsoid,s=t.height,c=t.extrudedHeight,f=t.stRotation,m=2*(e.length/3),h=new Float64Array(3*m),p=n.st?new Float32Array(2*m):void 0,v=n.normal?new Float32Array(3*m):void 0,w=n.tangent?new Float32Array(3*m):void 0,E=n.binormal?new Float32Array(3*m):void 0,S=0,M=C,b=D,T=q,A=new l(u),z=A.project(u.cartesianToCartographic(i,B),U),F=u.scaleToGeodeticSurface(i,O);u.geodeticSurfaceNormal(F,F);for(var G=x.fromAxisAngle(F,f,L),W=g.fromQuaternion(G,_),V=e.length,Y=2*(V/3),k=0;V>k;k+=3){var j,H=k+1,Z=k+2,X=r.fromArray(e,k,O);if(n.st){var Q=g.multiplyByVector(W,X,N),K=A.project(u.cartesianToCartographic(Q,B),I);r.subtract(K,z,K),P.x=(K.x+o)/(2*o),P.y=(K.y+o)/(2*o),p[S+Y]=P.x,p[S+1+Y]=P.y,p[S++]=P.x,p[S++]=P.y}X=u.scaleToGeodeticSurface(X,X),j=r.clone(X,N),M=u.geodeticSurfaceNormal(X,M);var J=r.multiplyByScalar(M,s,R);if(X=r.add(X,J,X),J=r.multiplyByScalar(M,c,J),j=r.add(j,J,j),n.position&&(h[k+V]=j.x,h[H+V]=j.y,h[Z+V]=j.z,h[k]=X.x,h[H]=X.y,h[Z]=X.z),n.normal||n.tangent||n.binormal){T=r.clone(M,T);var $=r.fromArray(e,(k+3)%V,R);r.subtract($,X,$);var et=r.subtract(j,X,I);M=r.normalize(r.cross(et,$,M),M),n.normal&&(v[k]=M.x,v[H]=M.y,v[Z]=M.z,v[k+V]=M.x,v[H+V]=M.y,v[Z+V]=M.z),n.tangent&&(b=r.normalize(r.cross(T,M,b),b),w[k]=b.x,w[H]=b.y,w[Z]=b.z,w[k+V]=b.x,w[k+1+V]=b.y,w[k+2+V]=b.z),n.binormal&&(E[k]=T.x,E[H]=T.y,E[Z]=T.z,E[k+V]=T.x,E[H+V]=T.y,E[Z+V]=T.z)}}var tt=new d;return n.position&&(tt.position=new y({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:h})),n.st&&(tt.st=new y({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(tt.normal=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),n.tangent&&(tt.tangent=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:w})),n.binormal&&(tt.binormal=new y({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:E})),tt}function A(e){for(var t,r,n,a,i=e.length/3,o=p.createTypedArray(i,6*i),u=0,s=0;i-1>s;s++)t=s,n=s+i,r=t+1,a=r+i,o[u++]=t,o[u++]=n,o[u++]=r,o[u++]=r,o[u++]=n,o[u++]=a;return t=i-1,n=s+i,r=0,a=r+i,o[u++]=t,o[u++]=n,o[u++]=r,o[u++]=r,o[u++]=n,o[u++]=a,o}function z(t){var n=t.center,a=t.ellipsoid,i=t.semiMajorAxis,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,O),t.height,O);G.center=r.add(n,o,G.center),G.radius=i,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,o),t.extrudedHeight,o),W.center=r.add(n,o,W.center),W.radius=i;var u=s.computeEllipsePositions(t,!0,!0),c=u.positions,l=u.numPts,y=u.outerPositions,d=e.union(G,W),v=S(c,t,!0),g=M(l),x=g.length;g.length=2*x;for(var E=c.length/3,b=0;x>b;b+=3)g[b+x]=g[b+2]+E,g[b+1+x]=g[b+1]+E,g[b+2+x]=g[b]+E;var z=p.createTypedArray(2*E/3,g),N=new f({attributes:v,indices:z,primitiveType:w.TRIANGLES}),I=T(y,t);g=A(y);var R=p.createTypedArray(2*y.length/3,g),P=new f({attributes:I,indices:R,primitiveType:w.TRIANGLES}),_=h.combine([new m({geometry:N}),new m({geometry:P})]);return{boundingSphere:d,attributes:_.attributes,indices:_.indices}}var O=new r,N=new r,I=new r,R=new r,P=new t,_=new g,L=new x,C=new r,D=new r,q=new r,B=new n,U=new r,F=new r,G=new e,W=new e,V=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.center,n=e.semiMajorAxis,a=e.semiMinorAxis,u=i(e.granularity,v.RADIANS_PER_DEGREE),s=i(e.height,0),l=e.extrudedHeight,f=o(l)&&!v.equalsEpsilon(s,l,1);this._center=r.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=a,this._ellipsoid=i(e.ellipsoid,c.WGS84),this._rotation=i(e.rotation,0),this._stRotation=i(e.stRotation,0),this._height=s,this._granularity=u,this._vertexFormat=i(e.vertexFormat,E.DEFAULT),this._extrudedHeight=l,this._extrude=f,this._workerName="createEllipseGeometry"};return V.createGeometry=function(e){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=z(r)):t=b(r),new f({attributes:t.attributes,indices:t.indices,primitiveType:w.TRIANGLES,boundingSphere:t.boundingSphere})},V}),define("Workers/createEllipseGeometry",["../Core/Cartesian3","../Core/EllipseGeometry","../Core/Ellipsoid"],function(e,t,r){"use strict";function n(n){return n._center=e.clone(n._center),n._ellipsoid=r.clone(n._ellipsoid),t.createGeometry(n)}return n})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";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(r){t=r.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=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:0>e?-1:0},a.signNotZero=function(e){return 0>e?-1:1},a.toSNorm=function(e){return Math.round(255*(.5*a.clamp(e,-1,1)+.5))},a.fromSNorm=function(e){return a.clamp(e,0,255)/255*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.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 a>=i||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;e>=n;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,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(r,n){t(n)||(n=new i);var a=r.clock,o=r.cone,u=e(r.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,r,n,a){return t(a)?(a.x=e,a.y=r,a.z=n,a):new i(e,r,n)},i.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z},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},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 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},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.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 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){i.normalize(e,s),i.normalize(t,c);var r=i.dot(s,c),n=i.magnitude(i.cross(s,c,s));return Math.atan2(n,r)};var l=new i;i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);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,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.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,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)},i.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},i.fromDegrees=function(e,t,r,n,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,r,n,o)};var E=new i,f=new i,d=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(r,n,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(n);E.x=c*Math.cos(r),E.y=c*Math.sin(r),E.z=Math.sin(n),E=i.normalize(E,E),i.multiplyComponents(s,E,f);var l=Math.sqrt(i.dot(E,f));return f=i.divideByScalar(f,l,f),E=i.multiplyByScalar(E,a,E),t(u)||(u=new i),i.add(f,E,u)},i.fromDegreesArray=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o++)n[o]=a.toRadians(e[o]);return i.fromRadiansArray(n,t,r)},i.fromRadiansArray=function(e,r,n){var a=e.length;t(n)?n.length=a/2:n=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];n[o/2]=i.fromRadians(u,s,0,r,n[o/2])}return n},i.fromDegreesArrayHeights=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o+=3)n[o]=a.toRadians(e[o]),n[o+1]=a.toRadians(e[o+1]),n[o+2]=e[o+2];return i.fromRadiansArrayHeights(n,t,r)},i.fromRadiansArrayHeights=function(e,r,n){var a=e.length;t(n)?n.length=a/3:n=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];n[o/3]=i.fromRadians(u,s,c,r,n[o/3])}return n},i.ZERO=n(new i(0,0,0)),i.UNIT_X=n(new i(1,0,0)),i.UNIT_Y=n(new i(0,1,0)),i.UNIT_Z=n(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,c){var l=r.x,E=r.y,f=r.z,d=a.x,h=a.y,_=a.z,m=l*l*d*d,y=E*E*h*h,T=f*f*_*_,p=m+y+T,R=Math.sqrt(1/p),A=e.multiplyByScalar(r,R,i);if(s>p)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,x,w,C,P,L,F,U,b,D=(1-R)*e.magnitude(r)/(.5*e.magnitude(I)),B=0;do{D-=B,g=1/(1+D*v),x=1/(1+D*N),w=1/(1+D*S),C=g*g,P=x*x,L=w*w,F=C*g,U=P*x,b=L*w,M=m*C+y*P+T*L-1,O=m*F*v+y*U*N+T*b*S;var z=-2*O;B=M/z}while(Math.abs(M)>n.EPSILON12);return t(c)?(c.x=l*g,c.y=E*x,c.z=f*w,c):new e(l*g,E*x,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),d=i.EPSILON1;return u.fromCartesian=function(t,n,a){var h=r(n)?n.oneOverRadii:E,_=r(n)?n.oneOverRadiiSquared:f,m=r(n)?n._centerToleranceSquared:d,y=o(t,h,_,m,c);if(r(y)){var T=e.multiplyComponents(t,_,s);T=e.normalize(T,T);var p=e.subtract(t,y,l),R=Math.atan2(T.y,T.x),A=Math.asin(T.z),v=i.sign(e.dot(p,t))*e.magnitude(p);return r(a)?(a.longitude=R,a.latitude=A,a.height=v,a):new u(R,A,v)}},u.clone=function(e,t){return r(e)?r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){a=r(a,0),e.pack(t._radii,n,a)},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;r>a;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,h=new e,_=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,h);if(n(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(r,i,_),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;r>a;++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}),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","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(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 u(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function s(e){for(var t=0,r=0;3>r;++r){var n=e[o.getElementIndex(d[r],f[r])];t+=2*n*n}return Math.sqrt(t)}function c(e,t){for(var r=i.EPSILON15,n=0,a=1,u=0;3>u;++u){var s=Math.abs(e[o.getElementIndex(d[u],f[u])]);s>n&&(a=u,n=s)}var c=1,l=0,E=f[a],h=d[a];if(Math.abs(e[o.getElementIndex(h,E)])>r){var _,m=e[o.getElementIndex(h,h)],y=e[o.getElementIndex(E,E)],T=e[o.getElementIndex(h,E)],p=(m-y)/2/T;_=0>p?-1/(-p+Math.sqrt(1+p*p)):1/(p+Math.sqrt(1+p*p)),c=1/Math.sqrt(1+_*_),l=_*c}return t=o.clone(o.IDENTITY,t),t[o.getElementIndex(E,E)]=t[o.getElementIndex(h,h)]=c,t[o.getElementIndex(h,E)]=l,t[o.getElementIndex(E,h)]=-l,t}o.packedLength=9,o.pack=function(e,r,n){n=t(n,0),r[n++]=e[0],r[n++]=e[1],r[n++]=e[2],r[n++]=e[3],r[n++]=e[4],r[n++]=e[5],r[n++]=e[6],r[n++]=e[7],r[n++]=e[8]},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[4]=e[n++],a[5]=e[n++],a[6]=e[n++],a[7]=e[n++],a[8]=e[n++],a},o.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},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[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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,u=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,d=e.w*e.w,h=n-s-E+d,_=2*(a-f),m=2*(i+l),y=2*(a+f),T=-n+s-E+d,p=2*(c-u),R=2*(i-l),A=2*(c+u),v=-n-s+E+d;return r(t)?(t[0]=h,t[1]=y,t[2]=R,t[3]=_,t[4]=T,t[5]=A,t[6]=m,t[7]=p,t[8]=v,t):new o(h,_,m,y,T,p,R,A,v)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,n,-a,0,a,n)},o.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 o(n,0,a,0,1,0,-a,0,n)},o.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 o(n,-a,0,a,n,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,r,n){n=o.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},o.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},o.setRow=function(e,t,r,n){return n=o.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var l=new e;o.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),r};var E=new e;o.getMaximumScale=function(t){return o.getScale(t,E),e.maximumComponent(E)},o.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},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[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},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[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},o.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},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[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},o.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},o.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},o.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 f=[1,0,0],d=[2,2,1],h=new o,_=new o;return o.computeEigenDecomposition=function(e,t){var n=i.EPSILON20,a=10,l=0,E=0;r(t)||(t={});for(var f=t.unitary=o.clone(o.IDENTITY,t.unitary),d=t.diagonal=o.clone(e,t.diagonal),m=n*u(d);a>E&&s(d)>m;)c(d,h),o.transpose(h,_),o.multiply(d,h,d),o.multiply(_,d,d),o.multiply(f,h,f),++l>2&&(++E,l=0);return 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[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},o.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)},o.inverse=function(e,t){var r=e[0],a=e[1],u=e[2],s=e[3],c=e[4],l=e[5],E=e[6],f=e[7],d=e[8],h=o.determinant(e);if(Math.abs(h)<=i.EPSILON15)throw new n("matrix is not invertible");t[0]=c*d-f*l,t[1]=f*u-a*d,t[2]=a*l-c*u,t[3]=E*l-s*d,t[4]=r*d-E*u,t[5]=s*u-r*l,t[6]=s*f-E*c,t[7]=E*a-r*f,t[8]=r*c-s*a;var _=1/h;return o.multiplyByScalar(t,_,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=a(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=a(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w},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.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.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(r){t=r.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(e,t,n,a,i,o,u,s,c,l,E,f,d,h,_,m){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(h,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(E,0),this[11]=r(_,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(f,0),this[15]=r(m,0)}c.packedLength=16,c.pack=function(e,t,n){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]},c.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new c),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},c.clone=function(e,t){return n(e)?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 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]):void 0},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,r,a){n(a)||(a=new c);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,l=t.x*t.y,E=t.x*t.z,f=t.x*t.w,d=t.y*t.y,h=t.y*t.z,_=t.y*t.w,m=t.z*t.z,y=t.z*t.w,T=t.w*t.w,p=s-d-m+T,R=2*(l-y),A=2*(E+_),v=2*(l+y),N=-s+d-m+T,S=2*(h-f),I=2*(E-_),M=2*(h+f),O=-s-d+m+T;return a[0]=p*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},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.IDENTITY,e,t)},c.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 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 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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,E=new e,f=new e;c.fromCamera=function(t,r){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,E),E),e.normalize(e.cross(E,l,f),f);var u=E.x,s=E.y,d=E.z,h=l.x,_=l.y,m=l.z,y=f.x,T=f.y,p=f.z,R=a.x,A=a.y,v=a.z,N=u*-R+s*-A+d*-v,S=y*-R+T*-A+p*-v,I=h*R+_*A+m*v; +return n(r)?(r[0]=u,r[1]=y,r[2]=-h,r[3]=0,r[4]=s,r[5]=T,r[6]=-_,r[7]=0,r[8]=d,r[9]=p,r[10]=-m,r[11]=0,r[12]=N,r[13]=S,r[14]=I,r[15]=1,r):new c(u,s,d,N,y,T,p,S,-h,-_,-m,I,0,0,0,1)},c.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},c.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},c.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,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]=E,o[11]=f,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},c.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},c.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,d=l,h=E,_=i+c,m=o+l,y=t+E,T=1;return a[0]=f,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]=h,a[11]=0,a[12]=_,a[13]=m,a[14]=y,a[15]=T,a},c.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]]},c.getElementIndex=function(e,t){return 4*e+t},c.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},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],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,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 d=new e;c.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 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],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=e[9],d=e[10],h=e[11],_=e[12],m=e[13],y=e[14],T=e[15],p=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],x=t[10],w=t[11],C=t[12],P=t[13],L=t[14],F=t[15],U=n*p+u*R+E*A+_*v,b=a*p+s*R+f*A+m*v,D=i*p+c*R+d*A+y*v,B=o*p+l*R+h*A+T*v,z=n*N+u*S+E*I+_*M,G=a*N+s*S+f*I+m*M,V=i*N+c*S+d*I+y*M,q=o*N+l*S+h*I+T*M,X=n*O+u*g+E*x+_*w,H=a*O+s*g+f*x+m*w,W=i*O+c*g+d*x+y*w,Y=o*O+l*g+h*x+T*w,k=n*C+u*P+E*L+_*F,K=a*C+s*P+f*L+m*F,Z=i*C+c*P+d*L+y*F,j=o*C+l*P+h*L+T*F;return r[0]=U,r[1]=b,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},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],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=e[12],d=e[13],h=e[14],_=t[0],m=t[1],y=t[2],T=t[4],p=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*_+o*m+c*y,g=a*_+u*m+l*y,x=i*_+s*m+E*y,w=n*T+o*p+c*R,C=a*T+u*p+l*R,P=i*T+s*p+E*R,L=n*A+o*v+c*N,F=a*A+u*v+l*N,U=i*A+s*v+E*N,b=n*S+o*I+c*M+f,D=a*S+u*I+l*M+d,B=i*S+s*I+E*M+h;return r[0]=O,r[1]=g,r[2]=x,r[3]=0,r[4]=w,r[5]=C,r[6]=P,r[7]=0,r[8]=L,r[9]=F,r[10]=U,r[11]=0,r[12]=b,r[13]=D,r[14]=B,r[15]=1,r},c.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],d=t[1],h=t[2],_=t[3],m=t[4],y=t[5],T=t[6],p=t[7],R=t[8],A=n*f+o*d+c*h,v=a*f+u*d+l*h,N=i*f+s*d+E*h,S=n*_+o*m+c*y,I=a*_+u*m+l*y,M=i*_+s*m+E*y,O=n*T+o*p+c*R,g=a*T+u*p+l*R,x=i*T+s*p+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]=x,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,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;c.multiplyByUniformScale=function(e,t,r){return _.x=t,_.y=t,_.z=t,c.multiplyByScale(e,_,r)},c.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?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]=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)},c.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},c.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},c.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},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],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},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||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]},c.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},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 m=new u,y=new u,T=new t,p=new t(0,0,0,1);return c.inverse=function(e,r){if(u.equalsEpsilon(c.getRotation(e,m),y,o.EPSILON7)&&t.equals(c.getRow(e,3,T),p))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],l=e[12],E=e[1],f=e[5],d=e[9],h=e[13],_=e[2],R=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,x=R*M,w=v*S,C=R*I,P=A*S,L=_*M,F=v*N,U=_*I,b=A*N,D=_*S,B=R*N,z=O*f+w*d+C*h-(g*f+x*d+P*h),G=g*E+L*d+b*h-(O*E+F*d+U*h),V=x*E+F*f+D*h-(w*E+L*f+B*h),q=P*E+U*f+B*d-(C*E+b*f+D*d),X=g*a+x*i+P*l-(O*a+w*i+C*l),H=O*n+F*i+U*l-(g*n+L*i+b*l),W=w*n+L*a+B*l-(x*n+F*a+D*l),Y=C*n+b*a+D*i-(P*n+U*a+B*i);O=i*h,g=l*d,x=a*h,w=l*f,C=a*d,P=i*f,L=n*h,F=l*E,U=n*d,b=i*E,D=n*f,B=a*E;var k=O*S+w*I+C*M-(g*S+x*I+P*M),K=g*N+L*I+b*M-(O*N+F*I+U*M),Z=x*N+F*S+D*M-(w*N+L*S+B*M),j=P*N+U*S+B*I-(C*N+b*S+D*I),Q=x*A+P*v+g*R-(C*v+O*R+w*A),J=U*v+O*_+F*A-(L*A+b*v+g*_),$=L*R+B*v+w*_-(D*v+x*_+F*R),ee=D*A+C*_+b*R-(U*R+B*A+P*_),te=n*z+a*G+i*V+l*q;if(Math.abs(te)<o.EPSILON20)throw new s("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},c.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],d=e[14],h=-r*E-n*f-a*d,_=-i*E-o*f-u*d,m=-s*E-c*f-l*d;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]=h,t[13]=_,t[14]=m,t[15]=1,t},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,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/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/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){n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north},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 r>t&&(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;f>E;E++){var d=e[E];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var h=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,h),o=Math.max(o,h)}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.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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;i>a&&(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;i>a&&o>0?a+=u.TWO_PI:c>o&&a>0&&(o+=u.TWO_PI),i>a&&0>c?c+=u.TWO_PI:c>o&&0>i&&(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)&&l>=E)){var f=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(f>=d))return r(n)?(n.west=l,n.south=f,n.east=E,n.north=d,n):new s(l,f,E,d)}},s.union=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.west),n.south=Math.min(e.south,t.south),n.east=Math.max(e.east,t.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 r=t.longitude,n=t.latitude,a=e.west,i=e.east;return a>i&&(i+=u.TWO_PI,0>r&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(i>r||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,d=e.east,h=e.west,_=c;_.height=a,_.longitude=h,_.latitude=E,o[l]=n.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=n.cartographicToCartesian(_,o[l]),l++,_.latitude=f,o[l]=n.cartographicToCartesian(_,o[l]),l++,_.longitude=h,o[l]=n.cartographicToCartesian(_,o[l]),l++,0>E?_.latitude=E:f>0?_.latitude=f:_.latitude=0;for(var m=1;8>m;++m)_.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,_)&&(o[l]=n.cartographicToCartesian(_,o[l]),l++);return 0===_.latitude&&(_.longitude=h,o[l]=n.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=n.cartographicToCartesian(_,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","./Plane","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,E,f){"use strict";function d(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,_=new e,m=new e,y=new e,T=new e,p=new e,R=new e,A=new e,v=new e,N=new e,S=new e,I=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],R),i=e.clone(a,h),o=e.clone(a,_),u=e.clone(a,m),s=e.clone(a,y),c=e.clone(a,T),l=e.clone(a,p),E=t.length,f=1;E>f;f++){e.clone(t[f],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 x=e.magnitudeSquared(e.subtract(s,i,A)),w=e.magnitudeSquared(e.subtract(c,o,A)),C=e.magnitudeSquared(e.subtract(l,u,A)),P=i,L=s,F=x;w>F&&(F=w,P=o,L=c),C>F&&(F=C,P=u,L=l);var U=v;U.x=.5*(P.x+L.x),U.y=.5*(P.y+L.y),U.z=.5*(P.z+L.z);var b=e.magnitudeSquared(e.subtract(L,U,A)),D=Math.sqrt(b),B=N;B.x=i.x,B.y=o.y,B.z=u.z;var z=S;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,A),.5,I),V=0;for(f=0;E>f;f++){e.clone(t[f],a);var q=e.magnitude(e.subtract(a,G,A));q>V&&(V=q);var X=e.magnitudeSquared(e.subtract(a,U,A));if(X>b){var H=Math.sqrt(X);D=.5*(D+H),b=D*D;var W=H-D;U.x=(D*U.x+W*a.x)/H,U.y=(D*U.y+W*a.y)/H,U.z=(D*U.z+W*a.z)/H}}return V>D?(e.clone(U,r.center),r.radius=D):(e.clone(G,r.center),r.radius=V),r};var M=new o,O=new e,g=new e,x=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,M),f.southwest(t,x),x.height=i,f.northeast(t,w),w.height=o;var s=a.project(x,O),c=a.project(w,g),l=c.x-s.x,E=c.y-s.y,h=c.z-s.z;u.radius=.5*Math.sqrt(l*l+E*E+h*h);var _=u.center;return _.x=s.x+.5*l,_.y=s.y+.5*E,_.z=s.z+.5*h,u};var C=[];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,C)),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=R;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,_),l=e.clone(u,m),E=e.clone(u,y),f=e.clone(u,T),M=e.clone(u,p),O=t.length,g=0;O>g;g+=i){var x=t[g]+a.x,w=t[g+1]+a.y,C=t[g+2]+a.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>E.x&&e.clone(u,E),w<c.y&&e.clone(u,c),w>f.y&&e.clone(u,f),C<l.z&&e.clone(u,l),C>M.z&&e.clone(u,M)}var P=e.magnitudeSquared(e.subtract(E,s,A)),L=e.magnitudeSquared(e.subtract(f,c,A)),F=e.magnitudeSquared(e.subtract(M,l,A)),U=s,b=E,D=P;L>D&&(D=L,U=c,b=f),F>D&&(D=F,U=l,b=M);var B=v;B.x=.5*(U.x+b.x),B.y=.5*(U.y+b.y),B.z=.5*(U.z+b.z);var z=e.magnitudeSquared(e.subtract(b,B,A)),G=Math.sqrt(z),V=N;V.x=s.x,V.y=c.y,V.z=l.z;var q=S;q.x=E.x,q.y=f.y,q.z=M.z;var X=e.multiplyByScalar(e.add(V,q,A),.5,I),H=0;for(g=0;O>g;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,A));W>H&&(H=W);var Y=e.magnitudeSquared(e.subtract(u,B,A));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 H>G?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),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=R;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,_),s=e.clone(i,m),c=e.clone(i,y),l=e.clone(i,T),E=e.clone(i,p),f=t.length,M=0;f>M;M+=3){var O=t[M]+r[M],g=t[M+1]+r[M+1],x=t[M+2]+r[M+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>E.z&&e.clone(i,E)}var w=e.magnitudeSquared(e.subtract(c,o,A)),C=e.magnitudeSquared(e.subtract(l,u,A)),P=e.magnitudeSquared(e.subtract(E,s,A)),L=o,F=c,U=w;C>U&&(U=C,L=u,F=l),P>U&&(U=P,L=s,F=E);var b=v;b.x=.5*(L.x+F.x),b.y=.5*(L.y+F.y),b.z=.5*(L.z+F.z);var D=e.magnitudeSquared(e.subtract(F,b,A)),B=Math.sqrt(D),z=N;z.x=o.x,z.y=u.y,z.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=E.z;var V=e.multiplyByScalar(e.add(z,G,A),.5,I),q=0;for(M=0;f>M;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,A));X>q&&(q=X);var H=e.magnitudeSquared(e.subtract(i,b,A));if(H>D){var W=Math.sqrt(H);B=.5*(B+W),D=B*B;var Y=W-B;b.x=(B*b.x+Y*i.x)/W,b.y=(B*b.y+Y*i.y)/W,b.z=(B*b.z+Y*i.z)/W}}return q>B?(e.clone(b,a.center),a.radius=B):(e.clone(V,a.center),a.radius=q),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;a>o;o++)i.push(t[o].center);r=d.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;a>o;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return r.radius=s,r};var L=new e,F=new e,U=new e;d.fromOrientedBoundingBox=function(t,r){n(r)||(r=new d);var a=t.halfAxes,i=c.getColumn(a,0,L),o=c.getColumn(a,1,F),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},d.clone=function(t,r){return n(t)?n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new d(t.center,t.radius):void 0},d.packedLength=4,d.pack=function(e,t,n){n=r(n,0);var a=e.center;t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius},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 b=new e,D=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,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),f=e.multiplyByScalar(c,(-o+E)/l,D);return e.add(f,i,f),e.clone(f,a.center),a.radius=E,a};var B=new e;d.expand=function(t,r,n){n=d.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,B));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-a>o?u.OUTSIDE:a>o?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 G=new e;d.computePlaneDistances=function(t,r,a,i){n(i)||(i=new s);var o=e.subtract(t.center,r,G),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var V=new e,q=new e,X=new e,H=new e,W=new e,Y=new t,k=new Array(8),K=0;8>K;++K)k[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,V),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,X);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),f=e.negate(c,H),h=k,_=h[0];e.add(s,l,_),e.add(_,c,_),_=h[1],e.add(s,l,_),e.add(_,f,_),_=h[2],e.add(s,E,_),e.add(_,f,_),_=h[3],e.add(s,E,_),e.add(_,c,_),e.negate(s,s),_=h[4],e.add(s,l,_),e.add(_,c,_),_=h[5],e.add(s,l,_),e.add(_,f,_),_=h[6],e.add(s,E,_),e.add(_,f,_),_=h[7],e.add(s,E,_),e.add(_,c,_);for(var m=h.length,y=0;m>y;++y){var T=h[y];e.add(o,T,T);var p=i.cartesianToCartographic(T,Y);n.project(p,T)}a=d.fromPoints(h,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,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){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n]=t.y},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.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.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("Renderer/WebGLConstants",["../Core/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/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(){return a.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?n.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(n.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",e(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;n>r;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(p)){p=!1;var e=/ Chrome\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(p=!0,R=n(e[1]))}return p}function i(){return a()&&R}function o(){if(!t(A)&&(A=!1,!a()&&/ Safari\/[\.0-9]+/.test(T.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(A=!0,v=n(e[1]))}return A}function u(){return o()&&v}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(T.userAgent);null!==e&&(N=!0,S=n(e[1]),S.isNightly=!!e[2])}return N}function c(){return s()&&S}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,M=n(e[1]))):"Netscape"===T.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(I=!0,M=n(e[1])))}return I}function E(){return l()&&M}function f(){if(!t(O)){O=!1;var e=/Firefox\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(O=!0,g=n(e[1]))}return O}function d(){return t(x)||(x=/Windows/i.test(T.appVersion)),x}function h(){return f()&&g}function _(){return t(w)||(w="undefined"!=typeof PointerEvent&&(!t(T.pointerEnabled)||T.pointerEnabled)),w}function m(){if(!t(P)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;P=t(r)&&""!==r,P&&(C=r)}return P}function y(){return m()?C:void 0}var T;T="undefined"!=typeof navigator?navigator:{};var p,R,A,v,N,S,I,M,O,g,x,w,C,P,L={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:E,isFirefox:f,firefoxVersion:h,isWindows:d,hardwareConcurrency:e(T.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:m,imageRenderingValue:y};return L.supportsFullscreen=function(){return r.supportsFullscreen()},L.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},L.supportsWebWorkers=function(){return"undefined"!=typeof Worker},L}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,r,n,a,i){"use strict";if(!a.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return r(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new n("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,r,a,i){switch(a=t(a,0),i=t(i,(r.byteLength-a)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(r,a,i);case o.UNSIGNED_BYTE:return new Uint8Array(r,a,i);case o.SHORT:return new Int16Array(r,a,i);case o.UNSIGNED_SHORT:return new Uint16Array(r,a,i);case o.FLOAT:return new Float32Array(r,a,i);case o.DOUBLE:return new Float64Array(r,a,i);default:throw new n("componentDatatype is not a valid value.")}},i(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,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],d=e[u.COLUMN1ROW1],h=e[u.COLUMN2ROW2],_=f+d+h;if(_>0)n=Math.sqrt(_+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 m=l,y=0;d>f&&(y=1),h>f&&h>d&&(y=2);var T=m[y],p=m[T];n=Math.sqrt(e[u.getElementIndex(y,y)]-e[u.getElementIndex(T,T)]-e[u.getElementIndex(p,p)]+1);var R=E;R[y]=.5*n,n=.5/n,c=(e[u.getElementIndex(p,T)]-e[u.getElementIndex(T,p)])*n,R[T]=(e[u.getElementIndex(T,y)]+e[u.getElementIndex(y,T)])*n,R[p]=(e[u.getElementIndex(p,y)]+e[u.getElementIndex(y,p)])*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 d=new e,h=new e,_=new s,m=new s,y=new s;s.packedLength=4,s.pack=function(e,r,n){n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w},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;i>a;a++){var o=3*a;s.unpack(e,4*(t+a),_),s.multiply(_,y,_),_.w<0&&s.negate(_,_),s.computeAxis(_,d);var u=s.computeAngle(_);n[o]=d.x*u,n[o+1]=d.y*u,n[o+2]=d.z*u}},s.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new s),e.fromArray(t,0,h);var u=e.magnitude(h);return s.unpack(n,4*i,m),0===u?s.clone(s.IDENTITY,_):s.fromAxisAngle(h,u,_),s.multiply(_,m,o)},s.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w):void 0},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,d=o*c+n*s-a*u+i*l,h=o*l-n*u-a*s-i*c;return r.x=E,r.y=f,r.z=d,r.w=h,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 T=new s;s.lerp=function(e,t,r,n){return T=s.multiplyByScalar(t,r,T),n=s.multiplyByScalar(e,1-r,n),s.add(T,n,n)};var p=new s,R=new s,A=new s;s.slerp=function(e,t,r,n){var a=s.dot(e,t),i=t;if(0>a&&(a=-a,i=p=s.negate(t,p)),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),A=s.multiplyByScalar(i,Math.sin(r*u),A),n=s.add(R,A,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 v=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,v);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 M=new s,O=1.9011074535173003,g=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;7>P;++P){var L=P+1,F=2*L+1;g[P]=1/(L*F),x[P]=L/F}return g[7]=O/136,x[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,E=7;E>=0;--E)w[E]=(g[E]*c-x[E])*o,C[E]=(g[E]*l-x[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])))))))),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])))))))),h=s.multiplyByScalar(e,d,M);return s.multiplyByScalar(t,f,n),s.add(h,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/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,n){"use strict";function a(t,a,i,l,E,f,d,h,_,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 T=Math.cos(t);T*=T;var p=Math.sin(t);p*=p;var R=f/Math.sqrt(d*T+E*p),A=R/h;return n.fromAxisAngle(o,A,s),r.fromQuaternion(s,c),r.multiplyByVector(c,_,m),e.normalize(m,m),e.multiplyByScalar(m,h,m),m}var i={},o=new e,u=new e,s=new n,c=new r,l=new e,E=new e,f=new e,d=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,h=n?c:0,_=0;c>_;_+=3){var m=_+1,y=_+2,T=e.fromArray(t,_,l);a.scaleToGeodeticSurface(T,T);var p=e.clone(T,E),R=a.geodeticSurfaceNormal(T,d),A=e.multiplyByScalar(R,i,f);e.add(T,A,T),n&&(e.multiplyByScalar(R,o,A),e.add(p,A,p),s[_+h]=p.x,s[m+h]=p.y,s[y+h]=p.z),s[_]=T.x,s[m]=T.y,s[y]=T.z}return s};var h=new e,_=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,d=8*r.granularity,y=o*o,T=u*u,p=u*o,R=e.magnitude(c),A=e.normalize(c,h),v=e.cross(e.UNIT_Z,c,_);v=e.normalize(v,v);var N=e.cross(A,v,m),S=1+Math.ceil(t.PI_OVER_TWO/d),I=t.PI_OVER_TWO/(S-1),M=t.PI_OVER_TWO-S*I;0>M&&(S-=Math.ceil(Math.abs(M)/I));var O,g,x,w,C,P=2*(S*(S+2)),L=n?new Array(3*P):void 0,F=0,U=l,b=E,D=4*S*3,B=D-1,z=0,G=i?new Array(D):void 0;for(M=t.PI_OVER_TWO,U=a(M,s,N,v,y,p,T,R,A,U),n&&(L[F++]=U.x,L[F++]=U.y,L[F++]=U.z),i&&(G[B--]=U.z,G[B--]=U.y,G[B--]=U.x),M=t.PI_OVER_TWO-I,O=1;S+1>O;++O){if(U=a(M,s,N,v,y,p,T,R,A,U),b=a(Math.PI-M,s,N,v,y,p,T,R,A,b),n){for(L[F++]=U.x,L[F++]=U.y,L[F++]=U.z,x=2*O+2,g=1;x-1>g;++g)w=g/(x-1),C=e.lerp(U,b,w,f),L[F++]=C.x,L[F++]=C.y,L[F++]=C.z;L[F++]=b.x,L[F++]=b.y,L[F++]=b.z}i&&(G[B--]=U.z,G[B--]=U.y,G[B--]=U.x,G[z++]=b.x,G[z++]=b.y,G[z++]=b.z),M=t.PI_OVER_TWO-(O+1)*I}for(O=S;O>1;--O){if(M=t.PI_OVER_TWO-(O-1)*I,U=a(-M,s,N,v,y,p,T,R,A,U),b=a(M+Math.PI,s,N,v,y,p,T,R,A,b),n){for(L[F++]=U.x,L[F++]=U.y,L[F++]=U.z,x=2*(O-1)+2,g=1;x-1>g;++g)w=g/(x-1),C=e.lerp(U,b,w,f),L[F++]=C.x,L[F++]=C.y,L[F++]=C.z;L[F++]=b.x,L[F++]=b.y,L[F++]=b.z}i&&(G[B--]=U.z,G[B--]=U.y,G[B--]=U.x,G[z++]=b.x,G[z++]=b.y,G[z++]=b.z)}M=t.PI_OVER_TWO,U=a(-M,s,N,v,y,p,T,R,A,U);var V={};return n&&(L[F++]=U.x,L[F++]=U.y,L[F++]=U.z,V.positions=L,V.numPts=S),i&&(G[B--]=U.z,G[B--]=U.y,G[B--]=U.x,V.outerPositions=G),V},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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(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=void 0}return i.computeNumberOfVertices=function(e){var n=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(n!==o&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=o}return n},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.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=t.x,n=t.y;t.x=(1-Math.abs(n))*a.signNotZero(r),t.y=(1-Math.abs(r))*a.signNotZero(n)}return t.x=a.toSNorm(t.x),t.y=a.toSNorm(t.y),t},i.octDecode=function(e,r,n){if(n.x=a.fromSNorm(e),n.y=a.fromSNorm(r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var i=n.x;n.x=(1-Math.abs(n.y))*a.signNotZero(i),n.y=(1-Math.abs(i))*a.signNotZero(n.y)}return t.normalize(n,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 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=1===e.x?4095:4096*e.x|0,r=1===e.y?4095:4096*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096;return t.x=Math.floor(r)/4096,t.y=r-Math.floor(r),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,d,h,_,m,y,T;r(a.z)?(E=t.subtract(s,a,i),f=t.subtract(c,a,o),d=t.subtract(n,a,u),h=t.dot(E,E),_=t.dot(E,f),m=t.dot(E,d),y=t.dot(f,f),T=t.dot(f,d)):(E=e.subtract(s,a,i),f=e.subtract(c,a,o),d=e.subtract(n,a,u),h=e.dot(E,E),_=e.dot(E,f),m=e.dot(E,d),y=e.dot(f,f),T=e.dot(f,d));var p=1/(h*y-_*_);return l.y=(y*m-_*T)*p,l.z=(h*T-_*m)*p,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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,n){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,n):new Uint16Array(t,r,n)},n(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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,0>i?[i,0]:[0,i];var c=n*n,l=4*e*a,E=r(c,-l,t.EPSILON14);if(0>E)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,d=s*s,h=o*s-f,_=o*c-u*s,m=u*c-d,y=4*h*m-_*_;if(0>y){var T,p,R;f*E>=l*d?(T=o,p=h,R=-2*u*h+o*_):(T=c,p=m,R=-c*_+2*s*m);var A=0>R?-1:1,v=-A*Math.abs(T)*Math.sqrt(-y);i=-R+v;var N=i/2,S=0>N?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===v?-S:-p/S;return a=0>=p?S+I:-R/(S*S+I*I+p),f*E>=l*d?[(a-u)/o]:[-c/(a+s)]}var M=h,O=-2*u*h+o*_,g=m,x=-c*_+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(-M);var L=Math.cos(P);i=a*L;var F=a*(-L/2-C*Math.sin(P)),U=i+F>2*u?i-u:F-u,b=o,D=U/b;P=Math.abs(Math.atan2(c*w,-x)/3),a=2*Math.sqrt(-g),L=Math.cos(P),i=a*L,F=a*(-L/2-C*Math.sin(P));var B=-c,z=2*s>i+F?i+s:F+s,G=B/z,V=b*z,q=-U*z-b*B,X=U*B,H=(s*q-u*X)/(-u*q+s*V);return H>=D?G>=D?G>=H?[D,H,G]:[D,G,H]:[G,D,H]:G>=D?[H,D,G]:G>=H?[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=0>u?-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,0>u?[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,d=E[E.length-1];if(Math.abs(d)<r.EPSILON14){var h=n.computeRealRoots(1,s,l);if(2===h.length){var _,m=h[0],y=h[1];if(m>=0&&y>=0){var T=Math.sqrt(m),p=Math.sqrt(y);return[f-p,f-T,f+T,f+p]}if(m>=0&&0>y)return _=Math.sqrt(m),[f-_,f+_];if(0>m&&y>=0)return _=Math.sqrt(y),[f-_,f+_]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,v=(s+d+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,d=e.computeRealRoots(1,l,E,f);if(d.length>0){var h,_,m=d[0],y=a-m,T=y*y,p=t/2,R=y/2,A=T-4*o,v=T+4*Math.abs(o),N=c-4*m,S=c+4*Math.abs(m);if(0>m||N*v>A*S){var I=Math.sqrt(N);h=I/2,_=0===I?0:(t*R-i)/I}else{var M=Math.sqrt(A);h=0===M?0:(t*R-i)/M,_=M/2}var O,g;0===p&&0===h?(O=0,g=0):r.sign(p)===r.sign(h)?(O=p+h,g=m/O):(g=p-h,O=m/g);var x,w;0===R&&0===_?(x=0,w=0):r.sign(R)===r.sign(_)?(x=R+_,w=o/x):(w=R-_,x=o/w);var C=n.computeRealRoots(1,O,x),P=n.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,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,d=a*a,h=d*a,_=u*c*E-4*s*f-4*e*l*E+18*e*t*r*f-27*i*E*E+256*o*h+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)+d*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return _},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,d=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>E?d+1:d,d+=0>f?d+1:d){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(t,n,a,o,u){u=r(u,!1);var s,c,l,E,f,d=t.origin,h=t.direction,_=e.subtract(a,n,m),A=e.subtract(o,n,y),v=e.cross(h,A,T),N=e.dot(_,v);if(u){if(N<i.EPSILON6)return;if(s=e.subtract(d,n,p),l=e.dot(s,v),0>l||l>N)return;if(c=e.cross(s,_,R),E=e.dot(h,c),0>E||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(d,n,p),l=e.dot(s,v)*S,0>l||l>1)return;if(c=e.cross(s,_,R),E=e.dot(h,c)*S,0>E||l+E>1)return;f=e.dot(A,c)*S}return f}function E(e,t,r,n){var a=t*t-4*e*r;if(!(0>a)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(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,T),l=e.dot(o,o),f=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,h=E(l,f,d,v);return n(h)?(a.start=h.root0,a.stop=h.root1,a):void 0}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,E=a*a,f=c*c,h=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*f,_=c*(a*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+r.y),m=t[o.COLUMN0ROW0]*E+t[o.COLUMN2ROW2]*f+a*r.x+n,y=f*d(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),T=c*(a*d(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+r.z),p=[];if(0===T&&0===y){if(l=u.computeRealRoots(h,_,m),0===l.length)return p;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(p.push(new e(a,c*R,c*-A)),p.push(new e(a,c*R,c*A)),2===l.length){var v=l[1],N=Math.sqrt(Math.max(1-v*v,0));p.push(new e(a,c*v,c*-N)),p.push(new e(a,c*v,c*N))}return p}var S=T*T,I=y*y,M=h*h,O=T*y,g=M+I,x=2*(_*h+O),w=2*m*h+_*_-I+S,C=2*(m*_-O),P=m*m-S;if(0===g&&0===x&&0===w&&0===C)return p;l=s.computeRealRoots(g,x,w,C,P);var L=l.length;if(0===L)return p;for(var F=0;L>F;++F){var U,b=l[F],D=b*b,B=Math.max(1-D,0),z=Math.sqrt(B);U=i.sign(h)===i.sign(m)?d(h*D+m,_*b,i.EPSILON12):i.sign(m)===i.sign(_*b)?d(h*D,_*b+m,i.EPSILON12):d(h*D+_*b,m,i.EPSILON12);var G=d(y*b,T,i.EPSILON15),V=U*G;0>V?p.push(new e(a,c*b,c*z)):V>0?p.push(new e(a,c*b,c*-z)):0!==z?(p.push(new e(a,c*b,c*-z)),p.push(new e(a,c*b,c*z)),++F):p.push(new e(a,c*b,c*z))}return p}var _={};_.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(!(0>l))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var m=new e,y=new e,T=new e,p=new e,R=new e;_.rayTriangle=function(t,r,a,i,o,u){var s=l(t,r,a,i,o);if(n(s)&&!(0>s))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new c;_.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 E=l(c,a,i,o,u);return!n(E)||0>E||E>e.distance(t,r)?void 0:(n(s)||(s=new e),e.multiplyByScalar(c.direction,E,s),e.add(c.origin,s,s))};var v={root0:0,root1:0};_.raySphere=function(e,t,r){return r=f(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var N=new c;_.lineSegmentSphere=function(t,r,a,i){var o=N,u=e.subtract(r,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=f(o,a,i),!n(i)||i.stop<0||i.start>s?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i)};var S=new e,I=new 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,I),E=e.magnitudeSquared(c),f=e.dot(c,l);if(E>1){if(f>=0)return;var d=f*f;if(n=E-1,a=e.magnitudeSquared(l),i=a*n,i>d)return;if(d>i){o=f*f-i,u=-f+Math.sqrt(o);var h=u/a,_=n/u;return _>h?{start:h,stop:_}:{start:_,stop:h}}var m=Math.sqrt(n/a);return{start:m,stop:m}}return 1>E?(n=E-1,a=e.magnitudeSquared(l),i=a*n,o=f*f-i,u=-f+Math.sqrt(o),{start:0,stop:u/a}):0>f?(a=e.magnitudeSquared(l),{start:0,stop:-f/a}):void 0};var M=new e,O=new e,g=new e,x=new e,w=new e,C=new o,P=new o,L=new o,F=new o,U=new o,b=new o,D=new o,B=new e,z=new e,G=new t;_.grazingAltitudeLocation=function(t,r){var a=t.origin,u=t.direction,s=r.geodeticSurfaceNormal(a,M);if(e.dot(u,s)>=0)return a;var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u,M),E=e.normalize(l,l),f=e.mostOrthogonalAxis(l,x),d=e.normalize(e.cross(f,E,O),O),_=e.normalize(e.cross(E,d,g),g),m=C;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]=_.x,m[7]=_.y,m[8]=_.z;var y=o.transpose(m,P),T=o.fromScale(r.radii,L),p=o.fromScale(r.oneOverRadii,F),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,p,b),R,b),S=o.multiply(o.multiply(N,T,D),m,D),I=o.multiplyByVector(N,a,w),V=h(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;q>W;++W){A=o.multiplyByVector(T,o.multiplyByVector(m,V[W],B),B);var Y=e.normalize(e.subtract(A,a,x),x),k=e.dot(Y,u);k>H&&(H=k,X=e.clone(A,X))}var K=r.cartesianToCartographic(X,G);return H=i.clamp(H,0,1),v=e.magnitude(e.subtract(X,a,x))*Math.sqrt(1-H*H),v=c?-v:v,K.height=v,r.cartographicToCartesian(K,new e)}};var V=new e;return _.lineSegmentPlane=function(t,r,a,o){n(o)||(o=new e);var u=e.subtract(r,t,V),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(!(0>E||E>1))return e.multiplyByScalar(u,E,o),e.add(t,o,o),o}},_.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 _.lineSegmentPlane(t,r,a,E),_.lineSegmentPlane(t,n,a,f),{positions:[t,r,n,E,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return _.lineSegmentPlane(r,n,a,E),_.lineSegmentPlane(r,t,a,f),{positions:[t,r,n,E,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return _.lineSegmentPlane(n,t,a,E),_.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 _.lineSegmentPlane(r,t,a,E),_.lineSegmentPlane(n,t,a,f),{positions:[t,r,n,E,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return _.lineSegmentPlane(n,r,a,E),_.lineSegmentPlane(t,r,a,f),{positions:[t,r,n,E,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return _.lineSegmentPlane(t,n,a,E),_.lineSegmentPlane(r,n,a,f),{positions:[t,r,n,E,f],indices:[0,1,4,0,4,3,2,3,4]}}},_}),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];o>u;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;a+1>l;l++)c[l]=0;for(var E=i+1,f=0;o>f;++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(;n>i;){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||-1===l)&&(l=s,c=f)),++E}return-1===c?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],d=c;if(t(u))l=u+1;else{for(;d>E;)f>l&&(l=f),++E,f=o[E];if(-1===l)return 0;++l}for(var h=[],_=0;l>_;_++)h[_]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};E=0;for(var m=0;d>E;)h[o[E]].vertexTriangles.push(m),++h[o[E]].numLiveTriangles,h[o[E+1]].vertexTriangles.push(m),++h[o[E+1]].numLiveTriangles,h[o[E+2]].vertexTriangles.push(m),++h[o[E+2]].numLiveTriangles,++m,E+=3;var y=0,T=s+1;i=1;var p,R,A=[],v=[],N=0,S=[],I=c/3,M=[];for(_=0;I>_;_++)M[_]=!1;for(var O,g;-1!==y;){A=[],R=h[y],g=R.vertexTriangles.length;for(var x=0;g>x;++x)if(m=R.vertexTriangles[x],!M[m]){M[m]=!0,E=m+m+m;for(var w=0;3>w;++w)O=o[E],A.push(O),v.push(O),S[N]=O,++N,p=h[O],--p.numLiveTriangles,T-p.timeStamp>s&&(p.timeStamp=T,++T),++E}y=a(o,s,A,h,T,v,l)}return S},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,d,h,_,m,y,T,p,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 O(e){for(var t=e.length,r=t/3*6,n=y.createTypedArray(t,r),a=0,i=0;t>i;i+=3,a+=6)M(n,a,e[i],e[i+1],e[i+2]);return n}function g(e){var t=e.length;if(t>=3){var r=6*(t-2),n=y.createTypedArray(t,r);M(n,0,e[0],e[1],e[2]);for(var a=6,i=3;t>i;++i,a+=6)M(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;t>o;++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 h({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;n>i;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;n>i;i+=3)a.unpack(r,i,ie),A.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,r,i)}function F(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;n>E;++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 h({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)),_=e[0][t].primitiveType,m=F(e,t);for(n in m)if(m.hasOwnProperty(n))for(s=m[n].values,u=0,i=0;f>i;++i)for(l=e[i][t].attributes[n].values,E=l.length,o=0;E>o;++o)s[u++]=l[o];var T;if(h){var p=0;for(i=0;f>i;++i)p+=e[i][t].indices.length;var R=d.computeNumberOfVertices(new d({attributes:m,primitiveType:S.POINTS})),A=y.createTypedArray(R,p),v=0,N=0;for(i=0;f>i;++i){var I=e[i][t].indices,M=I.length;for(u=0;M>u;++u)A[v++]=N+I[u];N+=d.computeNumberOfVertices(e[i][t])}T=A}var O,g=new a,x=0;for(i=0;f>i;++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;f>i;++i){O=e[i][t].boundingSphere;var w=a.magnitude(a.subtract(O.center,g,se))+O.radius;w>x&&(x=w)}return new d({attributes:m,indices:T,primitiveType:_,boundingSphere:c(g)?new r(g,x):void 0})}function b(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function D(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,a=3;t>a;++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=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;t-1>a;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,t>a+2&&(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=y.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function G(e){var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;t>a;++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=y.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;t>a;++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 b(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=0>n;X(e,u),X(t,u),X(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),X(r,!0),X(n,!1)}function Y(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=Ie.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(W(e,t,Ae,Ne),W(e,r,ve,Se),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(W(t,r,Ae,Ne),W(t,e,ve,Se),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(W(r,e,Ae,Ne),W(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||(W(r,e,Ae,Ne),W(r,t,ve,Se),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(W(t,r,Ae,Ne),W(t,e,ve,Se),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(W(e,t,Ae,Ne),W(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=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 a=t[n];r[n]=new h({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new d({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 j(e,r,i,o,u,s,l,E,f,d,h){if(c(s)||c(l)||c(E)||c(f)){var _=a.fromArray(u,3*e,Me),m=a.fromArray(u,3*r,Oe),y=a.fromArray(u,3*i,ge),T=t(o,_,m,y,xe);if(c(s)){var p=a.fromArray(s,3*e,Me),R=a.fromArray(s,3*r,Oe),A=a.fromArray(s,3*i,ge);a.multiplyByScalar(p,T.x,p),a.multiplyByScalar(R,T.y,R),a.multiplyByScalar(A,T.z,A);var v=a.add(p,R,p);a.add(v,A,v),a.normalize(v,v),a.pack(v,d.normal.values,3*h)}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,d.binormal.values,3*h)}if(c(E)){var O=a.fromArray(E,3*e,Me),g=a.fromArray(E,3*r,Oe),x=a.fromArray(E,3*i,ge);a.multiplyByScalar(O,T.x,O),a.multiplyByScalar(g,T.y,g),a.multiplyByScalar(x,T.z,x);var w=a.add(O,g,O);a.add(w,x,w),a.normalize(w,w),a.pack(w,d.tangent.values,3*h)}if(c(f)){var C=n.fromArray(f,2*e,we),P=n.fromArray(f,2*r,Ce),L=n.fromArray(f,2*i,Pe);n.multiplyByScalar(C,T.x,C),n.multiplyByScalar(P,T.y,P),n.multiplyByScalar(L,T.z,L);var F=n.add(C,P,C);n.add(F,L,F),n.pack(F,d.st.values,2*h)}}}function Q(e,t,r,n,a,i){var o=e.position.values.length/3;if(-1!==a){var u=n[a],s=r[u];return-1===s?(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.binormal)?s.binormal.values:void 0,d=c(s.tangent)?s.tangent.values:void 0,h=c(s.st)?s.st.values:void 0,_=u.indices,m=K(u),y=K(u),T=[];T.length=l.length/3;var p=[];for(p.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,p[o]=-1;var R=_.length;for(o=0;R>o;o+=3){var A=_[o],v=_[o+1],N=_[o+2],S=a.fromArray(l,3*A),I=a.fromArray(l,3*v),M=a.fromArray(l,3*N),O=Y(S,I,M);if(c(O)&&O.positions.length>3)for(var g=O.positions,x=O.indices,w=x.length,C=0;w>C;++C){var P=x[C],L=g[P];L.y<0?(t=y.attributes,r=y.indices,n=T):(t=m.attributes,r=m.indices,n=p),i=Q(t,r,n,_,3>P?o+P:-1,L),j(A,v,N,L,l,E,f,d,h,t,i)}else c(O)&&(S=O.positions[0],I=O.positions[1],M=O.positions[2]),S.y<0?(t=y.attributes,r=y.indices,n=T):(t=m.attributes,r=m.indices,n=p),i=Q(t,r,n,_,o,S),j(A,v,N,S,l,E,f,d,h,t,i),i=Q(t,r,n,_,o+1,I),j(A,v,N,I,l,E,f,d,h,t,i),i=Q(t,r,n,_,o+2,M),j(A,v,N,M,l,E,f,d,h,t,i)}Z(e,y,m)}function $(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;l>t;t+=2){var d=o[t],h=o[t+1],_=a.fromArray(i,3*d,Me),m=a.fromArray(i,3*h,Oe);Math.abs(_.y)<R.EPSILON6&&(_.y<0?_.y=-R.EPSILON6:_.y=R.EPSILON6),Math.abs(m.y)<R.EPSILON6&&(m.y<0?m.y=-R.EPSILON6:m.y=R.EPSILON6);var y=u.attributes,T=u.indices,A=f,v=s.attributes,N=s.indices,S=E,I=p.lineSegmentPlane(_,m,Le,ge);if(c(I)){var M=a.multiplyByScalar(a.UNIT_Y,5*R.EPSILON9,Fe);_.y<0&&(a.negate(M,M),y=s.attributes,T=s.indices,A=E,v=u.attributes,N=u.indices,S=f);var O=a.add(I,M,Ue);Q(y,T,A,o,t,_),Q(y,T,A,o,-1,O),a.negate(M,M),a.add(I,M,O),Q(v,N,S,o,-1,O),Q(v,N,S,o,t+1,m)}else{var g,x,w;_.y<0?(g=s.attributes,x=s.indices,w=E):(g=u.attributes,x=u.indices,w=f),Q(g,x,w,o,t,_),Q(g,x,w,o,t+1,m)}}Z(e,s,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,d=s.expandAndWidth.values,h=c(s.st)?s.st.values:void 0,_=c(s.color)?s.color.values:void 0,m=K(u),y=K(u),T=l.length/3;for(t=0;T>t;t+=4){var A=t,v=t+1,N=t+2,S=t+3,I=a.fromArray(l,3*A,Be),M=a.fromArray(l,3*v,ze),O=a.fromArray(l,3*N,Ge),g=a.fromArray(l,3*S,Ve);Math.abs(I.y)<R.EPSILON6&&(I.y=R.EPSILON6*(O.y<0?-1:1),M.y=I.y),Math.abs(O.y)<R.EPSILON6&&(O.y=R.EPSILON6*(I.y<0?-1:1),g.y=O.y);var x=m.attributes,w=m.indices,C=y.attributes,P=y.indices,L=p.lineSegmentPlane(I,O,Le,qe);if(c(L)){var F=a.multiplyByScalar(a.UNIT_Y,5*R.EPSILON9,Xe);I.y<0&&(a.negate(F,F),x=y.attributes,w=y.indices,C=m.attributes,P=m.indices);var U=a.add(L,F,He);for(x.position.values.push(I.x,I.y,I.z,M.x,M.y,M.z),x.position.values.push(U.x,U.y,U.z),x.position.values.push(U.x,U.y,U.z),a.negate(F,F),a.add(L,F,U),C.position.values.push(U.x,U.y,U.z),C.position.values.push(U.x,U.y,U.z),C.position.values.push(O.x,O.y,O.z,g.x,g.y,g.z),r=3*A;3*A+6>r;++r)x.prevPosition.values.push(E[r]);for(x.prevPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),C.prevPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),r=3*N;3*N+6>r;++r)C.prevPosition.values.push(E[r]);for(r=3*A;3*A+6>r;++r)x.nextPosition.values.push(f[r]);for(x.nextPosition.values.push(O.x,O.y,O.z,O.x,O.y,O.z),C.nextPosition.values.push(O.x,O.y,O.z,O.x,O.y,O.z),r=3*N;3*N+6>r;++r)C.nextPosition.values.push(f[r]);var b=n.fromArray(d,2*A,be),D=Math.abs(b.y);x.expandAndWidth.values.push(-1,D,1,D),x.expandAndWidth.values.push(-1,-D,1,-D),C.expandAndWidth.values.push(-1,D,1,D),C.expandAndWidth.values.push(-1,-D,1,-D);var B=a.magnitudeSquared(a.subtract(L,I,Ve));if(B/=a.magnitudeSquared(a.subtract(O,I,Ve)),c(_)){var z=i.fromArray(_,4*A,We),G=i.fromArray(_,4*N,We),V=R.lerp(z.x,G.x,B),q=R.lerp(z.y,G.y,B),X=R.lerp(z.z,G.z,B),H=R.lerp(z.w,G.w,B);for(r=4*A;4*A+8>r;++r)x.color.values.push(_[r]);for(x.color.values.push(V,q,X,H),x.color.values.push(V,q,X,H),C.color.values.push(V,q,X,H),C.color.values.push(V,q,X,H),r=4*N;4*N+8>r;++r)C.color.values.push(_[r])}if(c(h)){var W=n.fromArray(h,2*A,be),Y=n.fromArray(h,2*(t+3),De),k=R.lerp(W.x,Y.x,B);for(r=2*A;2*A+4>r;++r)x.st.values.push(h[r]);for(x.st.values.push(k,W.y),x.st.values.push(k,Y.y),C.st.values.push(k,W.y),C.st.values.push(k,Y.y),r=2*N;2*N+4>r;++r)C.st.values.push(h[r])}o=x.position.values.length/3-4,w.push(o,o+2,o+1),w.push(o+1,o+2,o+3),o=C.position.values.length/3-4,P.push(o,o+2,o+1),P.push(o+1,o+2,o+3)}else{var j,Q;for(I.y<0?(j=y.attributes,Q=y.indices):(j=m.attributes,Q=m.indices),j.position.values.push(I.x,I.y,I.z),j.position.values.push(M.x,M.y,M.z),j.position.values.push(O.x,O.y,O.z),j.position.values.push(g.x,g.y,g.z),r=3*t;3*t+12>r;++r)j.prevPosition.values.push(E[r]),j.nextPosition.values.push(f[r]);for(r=2*t;2*t+8>r;++r)j.expandAndWidth.values.push(d[r]),c(h)&&j.st.values.push(h[r]);if(c(_))for(r=4*t;4*t+16>r;++r)j.color.values.push(_[r]);o=j.position.values.length/3-4,Q.push(o,o+2,o+1),Q.push(o+1,o+2,o+3)}}Z(e,y,m)}var te={};te.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=g(t);break;case S.TRIANGLE_FAN:e.indices=x(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}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),E=0,f=0;o>f;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 _,m=e.boundingSphere;return c(m)&&(_=new r(m.center,m.radius+n)),new d({attributes:{position:new h({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:_})},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;o>t;++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=d.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;t>a;a++)n[a]=-1;for(var i,o=r,s=o.length,l=y.createTypedArray(t,s),E=0,f=0,h=0;s>E;)i=n[o[E]],-1!==i?l[f]=i:(i=o[E],n[i]=h,l[f]=h,++h),++E,++f;e.indices=l;var _=e.attributes;for(var m in _)if(_.hasOwnProperty(m)&&c(_[m])&&c(_[m].values)){for(var T=_[m],p=T.values,R=0,A=T.componentsPerAttribute,v=u.createTypedArray(T.componentDatatype,h*A);t>R;){var N=n[R];if(-1!==N)for(a=0;A>a;a++)v[A*N+a]=p[A*R+a];++R}T.values=v}}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;n>i;i++)r[i]>a&&(a=r[i]);e.indices=I.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},te.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;l>E;E+=n){for(var f=0;n>f;++f){var h=s[E+f],_=a[h];c(_)||(_=o++,a[h]=_,C(u,e.attributes,h)),i.push(_)}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 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,E=o.values,d=new Float64Array(E.length),_=0,m=0;m<E.length;m+=3){var y=a.fromArray(E,m,re),T=s.cartesianToCartographic(y,ne);if(!c(T))throw new l("Could not project point ("+y.x+", "+y.y+", "+y.z+") to 2D.");var p=i.project(T,re);d[_++]=p.x,d[_++]=p.y,d[_++]=p.z}return e.attributes[r]=o,e.attributes[n]=new h({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:d}),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;o>l;++l)E.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var f=a.componentsPerAttribute;return e.attributes[r]=new h({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:s}),e.attributes[n]=new h({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:c}),delete e.attributes[t],e};var ie=new a,oe=new v,ue=new A;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),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;n>a;++a){var i=e[a];c(i.geometry)?t.push(i):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;i>E;E++)s[E]={indexOffset:0,count:0,currentCount:0};var f=0;for(E=0;o>E;E+=3){var d=t[E],_=t[E+1],m=t[E+2],y=3*d,T=3*_,p=3*m;le.x=n[y],le.y=n[y+1],le.z=n[y+2],Ee.x=n[T],Ee.y=n[T+1],Ee.z=n[T+2],fe.x=n[p],fe.y=n[p+1],fe.z=n[p+2],s[d].count++,s[_].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;i>E;E++)s[E].indexOffset+=R,R+=s[E].count;f=0;var A;for(E=0;o>E;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;i>E;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 h({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var de=new a,he=new a,_e=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,d;for(l=0;s>l;l+=3){var _=t[l],m=t[l+1],y=t[l+2];E=3*_,f=3*m,d=3*y;var T=2*_,p=2*m,R=2*y,A=r[E],v=r[E+1],N=r[E+2],S=i[T],I=i[T+1],M=i[p+1]-I,O=i[R+1]-I,g=1/((i[p]-S)*O-(i[R]-S)*M),x=(O*(r[f]-A)-M*(r[d]-A))*g,w=(O*(r[f+1]-v)-M*(r[d+1]-v))*g,C=(O*(r[f+2]-N)-M*(r[d+2]-N))*g;c[E]+=x,c[E+1]+=w,c[E+2]+=C,c[f]+=x,c[f+1]+=w,c[f+2]+=C,c[d]+=x,c[d+1]+=w,c[d+2]+=C}var P=new Float32Array(3*o),L=new Float32Array(3*o);for(l=0;o>l;l++){E=3*l,f=E+1,d=E+2;var F=a.fromArray(n,E,de),U=a.fromArray(c,E,_e),b=a.dot(F,U);a.multiplyByScalar(F,b,he),a.normalize(a.subtract(U,he,U),U),L[E]=U.x,L[f]=U.y,L[d]=U.z,a.normalize(a.cross(F,U,U),U),P[E]=U.x,P[f]=U.y,P[d]=U.z}return e.attributes.tangent=new h({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e.attributes.binormal=new h({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e};var me=new n,ye=new a,Te=new a,pe=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,d=t.attributes.binormal;c(r)&&(o=r.values),c(i)&&(s=i.values),c(f)&&(l=f.values),d&&(E=d.values);var _=c(o)?o.length:s.length,m=c(o)?3:2,y=_/m,T=y,p=c(s)&&c(o)?2:1;p+=c(l)||c(E)?1:0,T*=p;for(var R=new Float32Array(T),A=0,v=0;y>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,ye),a.fromArray(l,N,Te),a.fromArray(E,N,pe),e.octPack(ye,Te,pe,me),R[A++]=me.x,R[A++]=me.y):(c(o)&&(a.fromArray(o,N,ye),R[A++]=e.octEncodeFloat(ye)),c(l)&&(a.fromArray(l,N,ye),R[A++]=e.octEncodeFloat(ye)),c(E)&&(a.fromArray(E,N,ye),R[A++]=e.octEncodeFloat(ye)))}return t.attributes.compressedAttributes=new h({componentDatatype:u.FLOAT,componentsPerAttribute:p,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,xe=new a,we=new n,Ce=new n,Pe=new n,Le=N.fromPointNormal(a.ZERO,a.UNIT_Y),Fe=new a,Ue=new a,be=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 a,We=new i;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,N.ORIGIN_ZX_PLANE)!==T.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:$(e)}else q(t),t.primitiveType===S.TRIANGLES?J(e):t.primitiveType===S.LINES&&$(e);return e},te}),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){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},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){return t(e)?(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):void 0},a}),define("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,d,h,_,m,y,T,p,R,A){"use strict";function v(e,n,i){var o=n.vertexFormat,u=n.center,c=n.semiMajorAxis,E=n.semiMinorAxis,h=n.ellipsoid,_=n.stRotation,m=i?e.length/3*2:e.length/3,y=o.st?new Float32Array(2*m):void 0,p=o.normal?new Float32Array(3*m):void 0,A=o.tangent?new Float32Array(3*m):void 0,v=o.binormal?new Float32Array(3*m):void 0,N=0,S=b,I=D,M=B,O=new l(h),g=O.project(h.cartesianToCartographic(u,z),G),P=h.scaleToGeodeticSurface(u,x);h.geodeticSurfaceNormal(P,P);for(var X=R.fromAxisAngle(P,_,U),H=T.fromQuaternion(X,F),W=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,V),Y=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,q),k=e.length,K=i?k:0,Z=K/3*2,j=0;k>j;j+=3){var Q=j+1,J=j+2,$=r.fromArray(e,j,x);if(o.st){var ee=T.multiplyByVector(H,$,w),te=O.project(h.cartesianToCartographic(ee,z),C);r.subtract(te,g,te),L.x=(te.x+c)/(2*c),L.y=(te.y+E)/(2*E),W.x=Math.min(L.x,W.x),W.y=Math.min(L.y,W.y),Y.x=Math.max(L.x,Y.x),Y.y=Math.max(L.y,Y.y),i&&(y[N+Z]=L.x,y[N+1+Z]=L.y),y[N++]=L.x,y[N++]=L.y}S=h.geodeticSurfaceNormal($,S),(o.normal||o.tangent||o.binormal)&&((o.tangent||o.binormal)&&(I=r.normalize(r.cross(r.UNIT_Z,S,I),I),T.multiplyByVector(H,I,I)),o.normal&&(p[j]=S.x,p[Q]=S.y,p[J]=S.z,i&&(p[j+K]=-S.x,p[Q+K]=-S.y,p[J+K]=-S.z)),o.tangent&&(A[j]=I.x,A[Q]=I.y,A[J]=I.z,i&&(A[j+K]=-I.x,A[Q+K]=-I.y,A[J+K]=-I.z)),o.binormal&&(M=r.normalize(r.cross(S,I,M),M),v[j]=M.x,v[Q]=M.y,v[J]=M.z,i&&(v[j+K]=M.x,v[Q+K]=M.y,v[J+K]=M.z)))}if(o.st){k=y.length;for(var re=0;k>re;re+=2)y[re]=(y[re]-W.x)/(Y.x-W.x),y[re+1]=(y[re+1]-W.y)/(Y.y-W.y)}var ne=new d;if(o.position){var ae=s.raisePositionsToHeight(e,n,i);ne.position=new f({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:ae})}return o.st&&(ne.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:y})),o.normal&&(ne.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:p})),o.tangent&&(ne.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:A})),o.binormal&&(ne.binormal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),ne}function N(e){var t,r,n,a,i,o=new Array(12*(e*(e+1))-6),u=0;for(t=0,n=1,a=0;3>a;a++)o[u++]=n++,o[u++]=t,o[u++]=n;for(a=2;e+1>a;++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;r-1>i;++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;r-1>a;++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;r-1>i;++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;3>a;a++)o[u++]=t++,o[u++]=t,o[u++]=n;return o}function S(t){var n=t.center;X=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(n,X),t.height,X),X=r.add(n,X,X);var a=new e(X,t.semiMajorAxis),i=s.computeEllipsePositions(t,!0,!1),o=i.positions,u=i.numPts,c=v(o,t,!1),l=N(u);return l=m.createTypedArray(o.length/3,l),{boundingSphere:a,attributes:c,indices:l}}function I(e,n){var i=n.vertexFormat,o=n.center,u=n.semiMajorAxis,s=n.semiMinorAxis,c=n.ellipsoid,E=n.height,h=n.extrudedHeight,_=n.stRotation,m=e.length/3*2,y=new Float64Array(3*m),p=i.st?new Float32Array(2*m):void 0,A=i.normal?new Float32Array(3*m):void 0,v=i.tangent?new Float32Array(3*m):void 0,N=i.binormal?new Float32Array(3*m):void 0,S=0,I=b,M=D,O=B,g=new l(c),X=g.project(c.cartesianToCartographic(o,z),G),H=c.scaleToGeodeticSurface(o,x);c.geodeticSurfaceNormal(H,H);for(var W=R.fromAxisAngle(H,_,U),Y=T.fromQuaternion(W,F),k=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,V),K=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,q),Z=e.length,j=Z/3*2,Q=0;Z>Q;Q+=3){var J,$=Q+1,ee=Q+2,te=r.fromArray(e,Q,x);if(i.st){var re=T.multiplyByVector(Y,te,w),ne=g.project(c.cartesianToCartographic(re,z),C);r.subtract(ne,X,ne),L.x=(ne.x+u)/(2*u),L.y=(ne.y+s)/(2*s),k.x=Math.min(L.x,k.x),k.y=Math.min(L.y,k.y),K.x=Math.max(L.x,K.x),K.y=Math.max(L.y,K.y),p[S+j]=L.x,p[S+1+j]=L.y,p[S++]=L.x,p[S++]=L.y}te=c.scaleToGeodeticSurface(te,te),J=r.clone(te,w),I=c.geodeticSurfaceNormal(te,I);var ae=r.multiplyByScalar(I,E,P);if(te=r.add(te,ae,te),ae=r.multiplyByScalar(I,h,ae),J=r.add(J,ae,J),i.position&&(y[Q+Z]=J.x,y[$+Z]=J.y,y[ee+Z]=J.z,y[Q]=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,(Q+3)%Z,P);r.subtract(ie,te,ie);var oe=r.subtract(J,te,C);I=r.normalize(r.cross(oe,ie,I),I),i.normal&&(A[Q]=I.x,A[$]=I.y,A[ee]=I.z,A[Q+Z]=I.x,A[$+Z]=I.y,A[ee+Z]=I.z),i.tangent&&(M=r.normalize(r.cross(O,I,M),M),v[Q]=M.x,v[$]=M.y,v[ee]=M.z,v[Q+Z]=M.x,v[Q+1+Z]=M.y,v[Q+2+Z]=M.z),i.binormal&&(N[Q]=O.x,N[$]=O.y,N[ee]=O.z,N[Q+Z]=O.x,N[$+Z]=O.y,N[ee+Z]=O.z)}}if(i.st){Z=p.length;for(var ue=0;Z>ue;ue+=2)p[ue]=(p[ue]-k.x)/(K.x-k.x),p[ue+1]=(p[ue+1]-k.y)/(K.y-k.y)}var se=new d;return i.position&&(se.position=new f({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:y})),i.st&&(se.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:p})),i.normal&&(se.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:A})),i.tangent&&(se.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),i.binormal&&(se.binormal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:N})),se}function M(e){for(var t=e.length/3,r=m.createTypedArray(t,6*t),n=0,a=0;t>a;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 O(t){var n=t.center,a=t.ellipsoid,i=t.semiMajorAxis,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,x),t.height,x);H.center=r.add(n,o,H.center),H.radius=i,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,o),t.extrudedHeight,o),W.center=r.add(n,o,W.center),W.radius=i;var u=s.computeEllipsePositions(t,!0,!0),c=u.positions,l=u.numPts,f=u.outerPositions,d=e.union(H,W),y=v(c,t,!0),T=N(l),R=T.length;T.length=2*R;for(var A=c.length/3,S=0;R>S;S+=3)T[S+R]=T[S+2]+A,T[S+1+R]=T[S+1]+A,T[S+2+R]=T[S]+A;var O=m.createTypedArray(2*A/3,T),g=new E({attributes:y,indices:O,primitiveType:p.TRIANGLES}),w=I(f,t);T=M(f);var C=m.createTypedArray(2*f.length/3,T),P=new E({attributes:w,indices:C,primitiveType:p.TRIANGLES}),L=_.combineInstances([new h({geometry:g}),new h({geometry:P})]);return{boundingSphere:d,attributes:L[0].attributes,indices:L[0].indices}}function g(e){e=i(e,i.EMPTY_OBJECT);var t=e.center,n=i(e.ellipsoid,c.WGS84),a=e.semiMajorAxis,u=e.semiMinorAxis,s=i(e.granularity,y.RADIANS_PER_DEGREE),l=i(e.height,0),E=e.extrudedHeight,f=o(E)&&Math.abs(l-E)>1,d=i(e.vertexFormat,A.DEFAULT);this._center=r.clone(t),this._semiMajorAxis=a,this._semiMinorAxis=u,this._ellipsoid=c.clone(n),this._rotation=i(e.rotation,0),this._stRotation=i(e.stRotation,0),this._height=l,this._granularity=s,this._vertexFormat=A.clone(d),this._extrudedHeight=i(E,l),this._extrude=f,this._workerName="createEllipseGeometry"}var x=new r,w=new r,C=new r,P=new r,L=new t,F=new T,U=new R,b=new r,D=new r,B=new r,z=new n,G=new r,V=new t,q=new t,X=new r,H=new e,W=new e;g.packedLength=r.packedLength+c.packedLength+A.packedLength+8,g.pack=function(e,t,n){n=i(n,0),r.pack(e._center,t,n),n+=r.packedLength,c.pack(e._ellipsoid,t,n),n+=c.packedLength,A.pack(e._vertexFormat,t,n),n+=A.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};var Y=new r,k=new c,K=new A,Z={center:Y,ellipsoid:k,vertexFormat:K,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0};return g.unpack=function(e,t,n){t=i(t,0);var a=r.unpack(e,t,Y);t+=r.packedLength;var u=c.unpack(e,t,k);t+=c.packedLength;var s=A.unpack(e,t,K);t+=A.packedLength;var l=e[t++],E=e[t++],f=e[t++],d=e[t++],h=e[t++],_=e[t++],m=e[t++],y=1===e[t];return o(n)?(n._center=r.clone(a,n._center),n._ellipsoid=c.clone(u,n._ellipsoid),n._vertexFormat=A.clone(s,n._vertexFormat),n._semiMajorAxis=l,n._semiMinorAxis=E,n._rotation=f,n._stRotation=d,n._height=h,n._granularity=_,n._extrudedHeight=m,n._extrude=y,n):(Z.height=h,Z.extrudedHeight=m,Z.granularity=_,Z.stRotation=d,Z.rotation=f,Z.semiMajorAxis=l,Z.semiMinorAxis=E,new g(Z))},g.createGeometry=function(e){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=O(r)):t=S(r),new E({attributes:t.attributes,indices:t.indices,primitiveType:p.TRIANGLES,boundingSphere:t.boundingSphere})},g.createShadowVolume=function(e,t,r){var n=e._granularity,a=e._ellipsoid,i=t(n,a),o=r(n,a);return new g({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:a,stRotation:e._stRotation,granularity:n,extrudedHeight:i,height:o,vertexFormat:A.POSITION_ONLY})},g}),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/Workers/createEllipseOutlineGeometry.js b/Workers/createEllipseOutlineGeometry.js index ed96217..dcc5e8b 100644 --- a/Workers/createEllipseOutlineGeometry.js +++ b/Workers/createEllipseOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -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";var t=function(t){return void 0!==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";var e=function(t,e){return void 0!==t?t:e};return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";var e=function(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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("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^=2636928640&t<<7,t^=4022730752&t<<15,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){"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(t){return t>0?1:0>t?-1:0},n.signNotZero=function(t){return 0>t?-1:1},n.toSNorm=function(t){return Math.round(255*(.5*n.clamp(t,-1,1)+.5))},n.fromSNorm=function(t){return 2*(n.clamp(t,0,255)/255)-1},n.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},n.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},n.lerp=function(t,e,n){return(1-n)*t+n*e},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(t){return t*n.RADIANS_PER_DEGREE},n.toDegrees=function(t){return t*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(t){var e=n.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},n.negativePiToPi=function(t){for(var e=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+e)>t;)t+=i;if(-r>t)return-r;for(;t>r+e;)t-=i;return t>r?r:t},n.zeroToTwoPi=function(t){var e=t%n.TWO_PI;return 0>e?(e+n.TWO_PI)%n.TWO_PI:e},n.equalsEpsilon=function(t,n,r){return r=e(r,0),Math.abs(t-n)<=r};var r=[1];n.factorial=function(t){var e=r.length;if(t>=e)for(var n=r[e-1],i=e;t>=i;i++)r.push(n*i);return r[t]},n.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},n.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},n.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},n.clamp=function(t,e,n){return e>t?e:t>n?n:t};var i=new t;return n.setRandomNumberSeed=function(e){i=new t(e)},n.nextRandomNumber=function(){return i.random()},n.acosClamped=function(t){return Math.acos(n.clamp(t,-1,1))},n.asinClamped=function(t){return Math.asin(n.clamp(t,-1,1))},n}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)};a.fromSpherical=function(n,r){e(r)||(r=new a);var i=n.clock,o=n.cone,u=t(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(t,n,r,i){return e(i)?(i.x=t,i.y=n,i.z=r,i):new a(t,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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.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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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 s=new a,c=new a;a.angleBetween=function(t,e){a.normalize(t,s),a.normalize(e,c);var n=a.dot(s,c),r=a.magnitude(a.cross(s,c,s));return Math.atan2(r,n)};var l=new a;a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,l);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):n.y<=n.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r},a.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,s=e.z,c=i*s-a*u,l=a*o-r*s,h=r*u-i*o;return n.x=c,n.y=l,n.z=h,n},a.fromDegrees=function(t,e,n,r,o){var u=i.toRadians(t),s=i.toRadians(e);return a.fromRadians(u,s,n,r,o)};var h=new a,f=new a,d=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=t(i,0);var s=e(o)?o.radiiSquared:d,c=Math.cos(r);h.x=c*Math.cos(n),h.y=c*Math.sin(n),h.z=Math.sin(r),h=a.normalize(h,h),a.multiplyComponents(s,h,f);var l=Math.sqrt(a.dot(h,f));return f=a.divideByScalar(f,l,f),h=a.multiplyByScalar(h,i,h),e(u)||(u=new a),a.add(f,h,u)},a.fromDegreesArray=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=i.toRadians(t[o]);return a.fromRadiansArray(r,e,n)},a.fromRadiansArray=function(t,n,r){var i=t.length;e(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],s=t[o+1];r[o/2]=a.fromRadians(u,s,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o+=3)r[o]=i.toRadians(t[o]),r[o+1]=i.toRadians(t[o+1]),r[o+2]=t[o+2];return a.fromRadiansArrayHeights(r,e,n)},a.fromRadiansArrayHeights=function(t,n,r){var i=t.length;e(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],s=t[o+1],c=t[o+2];r[o/3]=a.fromRadians(u,s,c,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)};return a.fromRadians=function(n,r,i,o){return i=t(i,0),e(o)?(o.longitude=n,o.latitude=r,o.height=i,o):new a(n,r,i)},a.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),a.fromRadians(t,e,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new a(t.longitude,t.latitude,t.height):void 0},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.longitude-n.longitude)<=r&&Math.abs(t.latitude-n.latitude)<=r&&Math.abs(t.height-n.height)<=r},a.ZERO=r(new a(0,0,0)),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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),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"],function(t,e,n,r,i,a,o,u){"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}var c=function(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,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))return void 0;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.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),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=s,n.z=c,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 l=new t,h=new t;c.prototype.cartographicToCartesian=function(e,n){var i=l,a=h;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;n>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var f=new t,d=new t,y=new t;c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,d);if(!r(a))return void 0;var o=this.geodeticSurfaceNormal(a,f),s=t.subtract(n,a,y),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),h=u.sign(t.dot(s,n))*t.magnitude(s);return r(i)?(i.longitude=c,i.latitude=l,i.height=h,i):new e(c,l,h)},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;n>i;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e};var m=new t,p=new t;return c.prototype.scaleToGeodeticSurface=function(e,n){var i=e.x,a=e.y,o=e.z,s=this._oneOverRadii,c=s.x,l=s.y,h=s.z,f=i*i*c*c,d=a*a*l*l,y=o*o*h*h,w=f+d+y,v=Math.sqrt(1/w),x=t.multiplyByScalar(e,v,m);if(w<this._centerToleranceSquared)return isFinite(v)?t.clone(x,n):void 0;var g=this._oneOverRadiiSquared,E=g.x,M=g.y,z=g.z,S=p;S.x=2*x.x*E,S.y=2*x.y*M,S.z=2*x.z*z;var O,_,T,I,N,R,b,A,P,C,L,U=(1-v)*t.magnitude(e)/(.5*t.magnitude(S)),q=0;do{U-=q,T=1/(1+U*E),I=1/(1+U*M),N=1/(1+U*z),R=T*T,b=I*I,A=N*N,P=R*T,C=b*I,L=A*N,O=f*R+d*b+y*A-1,_=f*P*E+d*C*M+y*L*z;var B=-2*_;q=O/B}while(Math.abs(O)>u.EPSILON12);return r(n)?(n.x=i*T,n.y=a*I,n.z=o*N,n):new t(i*T,a*I,o*N)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,s,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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";var u=function(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";var e=function(e,n){this.start=t(e,0),this.stop=t(n,0)};return e}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";var i=function(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)};i.fromElements=function(t,n,r,a,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=a,o):new i(t,n,r,a)},i.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 i(t.red,t.green,t.blue,t.alpha)},i.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new i(t.x,t.y,t.z,t.w):void 0},i.packedLength=4,i.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r++],a.w=n[r],a},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,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},i.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},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 a=new i;i.distance=function(t,e){return i.subtract(t,e,a),i.magnitude(a)},i.normalize=function(t,e){var n=i.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,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,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},i.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},i.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},i.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},i.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},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 o=new i;i.lerp=function(t,e,n,r){return i.multiplyByScalar(e,n,o),r=i.multiplyByScalar(t,1-n,r),i.add(o,r,r)};var u=new i;return i.mostOrthogonalAxis=function(t,e){var n=i.normalize(t,u);return i.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?i.clone(i.UNIT_X,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e):n.y<=n.z?n.y<=n.w?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e)},i.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},i.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r&&Math.abs(t.w-n.w)<=r},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(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e){return i.equalsEpsilon(this,t,e)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t){for(var e=0,n=0;9>n;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function u(t){for(var e=0,n=0;3>n;++n){var r=t[c.getElementIndex(d[n],f[n])];e+=2*r*r}return Math.sqrt(e)}function s(t,e){for(var n=a.EPSILON15,r=0,i=1,o=0;3>o;++o){var u=Math.abs(t[c.getElementIndex(d[o],f[o])]);u>r&&(i=o,r=u)}var s=1,l=0,h=f[i],y=d[i];if(Math.abs(t[c.getElementIndex(y,h)])>n){var m,p=t[c.getElementIndex(y,y)],w=t[c.getElementIndex(h,h)],v=t[c.getElementIndex(y,h)],x=(p-w)/2/v;m=0>x?-1/(-x+Math.sqrt(1+x*x)):1/(x+Math.sqrt(1+x*x)),s=1/Math.sqrt(1+m*m),l=m*s}return e=c.clone(c.IDENTITY,e),e[c.getElementIndex(h,h)]=e[c.getElementIndex(y,y)]=s,e[c.getElementIndex(y,h)]=l,e[c.getElementIndex(h,y)]=-l,e}var c=function(t,n,r,i,a,o,u,s,c){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(s,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(c,0)};c.clone=function(t,e){return n(t)?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 c(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},c.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new c),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},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[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 c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},c.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,u=t.y*t.y,s=t.y*t.z,l=t.y*t.w,h=t.z*t.z,f=t.z*t.w,d=t.w*t.w,y=r-u-h+d,m=2*(i-f),p=2*(a+l),w=2*(i+f),v=-r+u-h+d,x=2*(s-o),g=2*(a-l),E=2*(s+o),M=-r-u+h+d;return n(e)?(e[0]=y,e[1]=w,e[2]=g,e[3]=m,e[4]=v,e[5]=E,e[6]=p,e[7]=x,e[8]=M,e):new c(y,m,p,w,v,x,g,E,M)},c.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 c(t.x,0,0,0,t.y,0,0,0,t.z)},c.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 c(t,0,0,0,t,0,0,0,t)},c.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 c(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},c.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 c(1,0,0,0,r,-i,0,i,r)},c.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 c(r,0,i,0,1,0,-i,0,r)},c.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 c(r,-i,0,i,r,0,0,0,1)},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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},c.getElementIndex=function(t,e){return 3*t+e},c.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},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},c.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},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,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[3],e[4],e[5],l)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],l)),n};var h=new t;c.getMaximumScale=function(e){return c.getScale(e,h),t.maximumComponent(h)},c.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],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],c=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],h=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]=s,n[6]=c,n[7]=l,n[8]=h,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},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},c.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,s=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=s,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},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},c.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],s=t[2],c=t[5],l=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=s,e[7]=c,e[8]=l,e};var f=[1,0,0],d=[2,2,1],y=new c,m=new c;return c.computeEigenDecomposition=function(t,e){var r=a.EPSILON20,i=10,l=0,h=0;n(e)||(e={});for(var f=e.unitary=c.clone(c.IDENTITY,e.unitary),d=e.diagonal=c.clone(t,e.diagonal),p=r*o(d);i>h&&u(d)>p;)s(d,y),c.transpose(y,m),c.multiply(d,y,d),c.multiply(m,d,d),c.multiply(f,y,f),++l>2&&(++h,l=0);return 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},c.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],s=t[5],c=t[8];return e*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},c.inverse=function(t,e){var n=t[0],i=t[1],o=t[2],u=t[3],s=t[4],l=t[5],h=t[6],f=t[7],d=t[8],y=c.determinant(t);if(Math.abs(y)<=a.EPSILON15)throw new r("matrix is not invertible");e[0]=s*d-f*l,e[1]=f*o-i*d,e[2]=i*l-s*o,e[3]=h*l-u*d,e[4]=n*d-h*o,e[5]=u*o-n*l,e[6]=u*f-h*s,e[7]=h*i-n*f,e[8]=n*s-u*i;var m=1/y;return c.multiplyByScalar(e,m,e)},c.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]},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},c.IDENTITY=i(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(t){"use strict";var e=function(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,s){"use strict";var c=function(t,e,r,i,a,o,u,s,c,l,h,f,d,y,m,p){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(e,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(y,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(h,0),this[11]=n(m,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(p,0)};c.packedLength=16,c.pack=function(t,e,r){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]},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){return r(t)?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]):void 0},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,s=e.x*e.x,l=e.x*e.y,h=e.x*e.z,f=e.x*e.w,d=e.y*e.y,y=e.y*e.z,m=e.y*e.w,p=e.z*e.z,w=e.z*e.w,v=e.w*e.w,x=s-d-p+v,g=2*(l-w),E=2*(h+m),M=2*(l+w),z=-s+d-p+v,S=2*(y-f),O=2*(h-m),_=2*(y+f),T=-s-d+p+v;return i[0]=x*a,i[1]=M*a,i[2]=O*a,i[3]=0,i[4]=g*o,i[5]=z*o,i[6]=_*o,i[7]=0,i[8]=E*u,i[9]=S*u,i[10]=T*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},c.fromTranslation=function(t,e){return c.fromRotationTranslation(u.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 l=new t,h=new t,f=new t;c.fromCamera=function(e,n){var i=e.eye,a=e.target,o=e.up;t.normalize(t.subtract(a,i,l),l),t.normalize(t.cross(l,o,h),h),t.normalize(t.cross(h,l,f),f);var u=h.x,s=h.y,d=h.z,y=l.x,m=l.y,p=l.z,w=f.x,v=f.y,x=f.z,g=i.x,E=i.y,M=i.z,z=u*-g+s*-E+d*-M,S=w*-g+v*-E+x*-M,O=y*g+m*E+p*M;return r(n)?(n[0]=u,n[1]=w,n[2]=-y,n[3]=0,n[4]=s,n[5]=v,n[6]=-m,n[7]=0,n[8]=d,n[9]=x,n[10]=-p,n[11]=0,n[12]=z,n[13]=S,n[14]=O,n[15]=1,n):new c(u,s,d,z,w,v,x,S,-y,-m,-p,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,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},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),s=1/(r-n),c=1/(a-i),l=-(e+t)*u,h=-(r+n)*s,f=-(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]=h,o[14]=f,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),s=2*i/(r-n),c=(e+t)/(e-t),l=(r+n)/(r-n),h=-(a+i)/(a-i),f=-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]=h,o[11]=f,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),l=-1,h=-1,f=-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]=h,a[12]=0,a[13]=0,a[14]=f,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),s=n(t.height,0);e=n(e,0),r=n(r,1);var c=.5*u,l=.5*s,h=.5*(r-e),f=c,d=l,y=h,m=a+c,p=o+l,w=e+h,v=1;return i[0]=f,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]=y,i[11]=0,i[12]=m,i[13]=p,i[14]=w,i[15]=v,i},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.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 d=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],d)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],d)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],d)),n};var y=new t;c.getMaximumScale=function(e){return c.getScale(e,y),t.maximumComponent(y)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],s=t[5],c=t[6],l=t[7],h=t[8],f=t[9],d=t[10],y=t[11],m=t[12],p=t[13],w=t[14],v=t[15],x=e[0],g=e[1],E=e[2],M=e[3],z=e[4],S=e[5],O=e[6],_=e[7],T=e[8],I=e[9],N=e[10],R=e[11],b=e[12],A=e[13],P=e[14],C=e[15],L=r*x+u*g+h*E+m*M,U=i*x+s*g+f*E+p*M,q=a*x+c*g+d*E+w*M,B=o*x+l*g+y*E+v*M,D=r*z+u*S+h*O+m*_,F=i*z+s*S+f*O+p*_,W=a*z+c*S+d*O+w*_,G=o*z+l*S+y*O+v*_,V=r*T+u*I+h*N+m*R,Y=i*T+s*I+f*N+p*R,j=a*T+c*I+d*N+w*R,k=o*T+l*I+y*N+v*R,H=r*b+u*A+h*P+m*C,Z=i*b+s*A+f*P+p*C,X=a*b+c*A+d*P+w*C,K=o*b+l*A+y*P+v*C;return n[0]=L,n[1]=U,n[2]=q,n[3]=B,n[4]=D,n[5]=F,n[6]=W,n[7]=G,n[8]=V,n[9]=Y,n[10]=j,n[11]=k,n[12]=H,n[13]=Z,n[14]=X,n[15]=K,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],s=t[6],c=t[8],l=t[9],h=t[10],f=t[12],d=t[13],y=t[14],m=e[0],p=e[1],w=e[2],v=e[4],x=e[5],g=e[6],E=e[8],M=e[9],z=e[10],S=e[12],O=e[13],_=e[14],T=r*m+o*p+c*w,I=i*m+u*p+l*w,N=a*m+s*p+h*w,R=r*v+o*x+c*g,b=i*v+u*x+l*g,A=a*v+s*x+h*g,P=r*E+o*M+c*z,C=i*E+u*M+l*z,L=a*E+s*M+h*z,U=r*S+o*O+c*_+f,q=i*S+u*O+l*_+d,B=a*S+s*O+h*_+y;return n[0]=T,n[1]=I,n[2]=N,n[3]=0,n[4]=R,n[5]=b,n[6]=A,n[7]=0,n[8]=P,n[9]=C,n[10]=L,n[11]=0,n[12]=U,n[13]=q,n[14]=B,n[15]=1,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],s=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]=s,n[15]=t[15],n};var m=new t;c.multiplyByUniformScale=function(t,e,n){return m.x=e,m.y=e,m.z=e,c.multiplyByScale(t,m,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,s=t[1]*r+t[5]*i+t[9]*a+t[13]*o,c=t[2]*r+t[6]*i+t[10]*a+t[14]*o,l=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,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,s=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=s,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],s=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=s,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[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[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]},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 p=new u,w=new u,v=new e,x=new e(0,0,0,1);return c.inverse=function(t,n){if(u.equalsEpsilon(c.getRotation(t,p),w,o.EPSILON7)&&e.equals(c.getRow(t,3,v),x))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],l=t[12],h=t[1],f=t[5],d=t[9],y=t[13],m=t[2],g=t[6],E=t[10],M=t[14],z=t[3],S=t[7],O=t[11],_=t[15],T=E*_,I=M*O,N=g*_,R=M*S,b=g*O,A=E*S,P=m*_,C=M*z,L=m*O,U=E*z,q=m*S,B=g*z,D=T*f+R*d+b*y-(I*f+N*d+A*y),F=I*h+P*d+U*y-(T*h+C*d+L*y),W=N*h+C*f+q*y-(R*h+P*f+B*y),G=A*h+L*f+B*d-(b*h+U*f+q*d),V=I*i+N*a+A*l-(T*i+R*a+b*l),Y=T*r+C*a+L*l-(I*r+P*a+U*l),j=R*r+P*i+B*l-(N*r+C*i+q*l),k=b*r+U*i+q*a-(A*r+L*i+B*a);T=a*y,I=l*d,N=i*y,R=l*f,b=i*d,A=a*f,P=r*y,C=l*h,L=r*d,U=a*h,q=r*f,B=i*h;var H=T*S+R*O+b*_-(I*S+N*O+A*_),Z=I*z+P*O+U*_-(T*z+C*O+L*_),X=N*z+C*S+q*_-(R*z+P*S+B*_),K=A*z+L*S+B*O-(b*z+U*S+q*O),J=N*E+A*M+I*g-(b*M+T*g+R*E),Q=L*M+T*m+C*E-(P*E+U*M+I*m),$=P*g+B*M+R*m-(q*M+N*m+C*g),te=q*E+b*m+U*g-(L*g+B*E+A*m),ee=r*D+i*F+a*W+l*G;if(Math.abs(ee)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return ee=1/ee,n[0]=D*ee,n[1]=F*ee,n[2]=W*ee,n[3]=G*ee,n[4]=V*ee,n[5]=Y*ee,n[6]=j*ee,n[7]=k*ee,n[8]=H*ee,n[9]=Z*ee,n[10]=X*ee,n[11]=K*ee,n[12]=J*ee,n[13]=Q*ee,n[14]=$*ee,n[15]=te*ee,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],s=t[8],c=t[9],l=t[10],h=t[12],f=t[13],d=t[14],y=-n*h-r*f-i*d,m=-a*h-o*f-u*d,p=-s*h-c*f-l*d;return e[0]=n,e[1]=a,e[2]=s,e[3]=0,e[4]=r,e[5]=o,e[6]=c,e[7]=0,e[8]=i,e[9]=u,e[10]=l,e[11]=0,e[12]=y,e[13]=m,e[14]=p,e[15]=1,e},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";var u=function(t,n,r,i){this.west=e(t,0),this.south=e(n,0),this.east=e(r,0),this.north=e(i,0)};u.fromDegrees=function(t,r,i,a,s){return t=o.toRadians(e(t,0)),r=o.toRadians(e(r,0)),i=o.toRadians(e(i,0)),a=o.toRadians(e(a,0)),n(s)?(s.west=t,s.south=r,s.east=i,s.north=a,s):new u(t,r,i,a)},u.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=t.length;c>s;s++){var l=t[s];r=Math.min(r,l.longitude),i=Math.max(i,l.longitude),a=Math.min(a,l.latitude),o=Math.max(o,l.latitude)}return n(e)?(e.west=r,e.south=a,e.east=i,e.north=o,e):new u(r,a,i,o)},u.packedLength=4,u.pack=function(t,n,r){r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i.west=t[r++],i.south=t[r++],i.east=t[r++],i.north=t[r],i},u.clone=function(t,e){return n(t)?n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new u(t.west,t.south,t.east,t.north):void 0},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.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},u.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},u.validate=function(){},u.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)},u.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)},u.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)},u.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)},u.center=function(e,r){var i=e.east,a=e.west,u=.5*(a+i);return a>i&&(u=o.negativePiToPi(u+o.PI)),n(r)?(r.longitude=u,r.latitude=.5*(e.south+e.north),r.height=0,r):new t(u,.5*(e.south+e.north))},u.intersectWith=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),s=Math.min(t.north,e.north);return n(r)?(r.west=i,r.south=a,r.east=o,r.north=s,r):new u(i,a,o,s)},u.contains=function(t,e){return e.longitude>=t.west&&e.longitude<=t.east&&e.latitude>=t.south&&e.latitude<=t.north},u.isEmpty=function(t){return t.west>=t.east||t.south>=t.north};var s=new t;return u.subsample=function(t,r,a,u){r=e(r,i.WGS84),a=e(a,0),n(u)||(u=[]);var c=0,l=t.north,h=t.south,f=t.east,d=t.west,y=s;y.height=a,y.longitude=d,y.latitude=l,u[c]=r.cartographicToCartesian(y,u[c]),c++,y.longitude=f,u[c]=r.cartographicToCartesian(y,u[c]),c++,y.latitude=h,u[c]=r.cartographicToCartesian(y,u[c]),c++,y.longitude=d,u[c]=r.cartographicToCartesian(y,u[c]),c++,y.latitude=0>l?l:h>0?h:0;for(var m=1;8>m;++m){var p=-Math.PI+m*o.PI_OVER_TWO;p>d&&f>p&&(y.longitude=p,u[c]=r.cartographicToCartesian(y,u[c]),c++)}return 0===y.latitude&&(y.longitude=d,u[c]=r.cartographicToCartesian(y,u[c]),c++,y.longitude=f,u[c]=r.cartographicToCartesian(y,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,s,c,l){"use strict";var h=function(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)},f=new t,d=new t,y=new t,m=new t,p=new t,w=new t,v=new t,x=new t,g=new t,E=new t,M=new t,z=new t;h.fromPoints=function(e,n){if(r(n)||(n=new h),!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],v),a=t.clone(i,f),o=t.clone(i,d),u=t.clone(i,y),s=t.clone(i,m),c=t.clone(i,p),l=t.clone(i,w),S=e.length,O=1;S>O;O++){t.clone(e[O],i);var _=i.x,T=i.y,I=i.z;_<a.x&&t.clone(i,a),_>s.x&&t.clone(i,s),T<o.y&&t.clone(i,o),T>c.y&&t.clone(i,c),I<u.z&&t.clone(i,u),I>l.z&&t.clone(i,l)}var N=t.magnitudeSquared(t.subtract(s,a,x)),R=t.magnitudeSquared(t.subtract(c,o,x)),b=t.magnitudeSquared(t.subtract(l,u,x)),A=a,P=s,C=N;R>C&&(C=R,A=o,P=c),b>C&&(C=b,A=u,P=l);var L=g;L.x=.5*(A.x+P.x),L.y=.5*(A.y+P.y),L.z=.5*(A.z+P.z);var U=t.magnitudeSquared(t.subtract(P,L,x)),q=Math.sqrt(U),B=E;B.x=a.x,B.y=o.y,B.z=u.z;var D=M;D.x=s.x,D.y=c.y,D.z=l.z;var F=t.multiplyByScalar(t.add(B,D,x),.5,z),W=0;for(O=0;S>O;O++){t.clone(e[O],i);var G=t.magnitude(t.subtract(i,F,x));G>W&&(W=G);var V=t.magnitudeSquared(t.subtract(i,L,x));if(V>U){var Y=Math.sqrt(V);q=.5*(q+Y),U=q*q;var j=Y-q;L.x=(q*L.x+j*i.x)/Y,L.y=(q*L.y+j*i.y)/Y,L.z=(q*L.z+j*i.z)/Y}}return W>q?(t.clone(L,n.center),n.radius=q):(t.clone(F,n.center),n.radius=W),n};var S=new o,O=new t,_=new t,T=new e,I=new e;h.fromRectangle2D=function(t,e,n){return h.fromRectangleWithHeights2D(t,e,0,0,n)},h.fromRectangleWithHeights2D=function(e,i,a,o,u){if(r(u)||(u=new h),!r(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;i=n(i,S),l.southwest(e,T),T.height=a,l.northeast(e,I),I.height=o;var s=i.project(T,O),c=i.project(I,_),f=c.x-s.x,d=c.y-s.y,y=c.z-s.z;u.radius=.5*Math.sqrt(f*f+d*d+y*y);var m=u.center;return m.x=s.x+.5*f,m.y=s.y+.5*d,m.z=s.z+.5*y,u};var N=[];h.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=l.subsample(t,e,i,N)),h.fromPoints(u,o)},h.fromVertices=function(e,i,a,o){if(r(o)||(o=new h),!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=v;u.x=e[0]+i.x,u.y=e[1]+i.y,u.z=e[2]+i.z;for(var s=t.clone(u,f),c=t.clone(u,d),l=t.clone(u,y),S=t.clone(u,m),O=t.clone(u,p),_=t.clone(u,w),T=e.length,I=0;T>I;I+=a){var N=e[I]+i.x,R=e[I+1]+i.y,b=e[I+2]+i.z;u.x=N,u.y=R,u.z=b,N<s.x&&t.clone(u,s),N>S.x&&t.clone(u,S),R<c.y&&t.clone(u,c),R>O.y&&t.clone(u,O),b<l.z&&t.clone(u,l),b>_.z&&t.clone(u,_)}var A=t.magnitudeSquared(t.subtract(S,s,x)),P=t.magnitudeSquared(t.subtract(O,c,x)),C=t.magnitudeSquared(t.subtract(_,l,x)),L=s,U=S,q=A;P>q&&(q=P,L=c,U=O),C>q&&(q=C,L=l,U=_);var B=g;B.x=.5*(L.x+U.x),B.y=.5*(L.y+U.y),B.z=.5*(L.z+U.z);var D=t.magnitudeSquared(t.subtract(U,B,x)),F=Math.sqrt(D),W=E;W.x=s.x,W.y=c.y,W.z=l.z;var G=M;G.x=S.x,G.y=O.y,G.z=_.z;var V=t.multiplyByScalar(t.add(W,G,x),.5,z),Y=0;for(I=0;T>I;I+=a){u.x=e[I]+i.x,u.y=e[I+1]+i.y,u.z=e[I+2]+i.z;var j=t.magnitude(t.subtract(u,V,x));j>Y&&(Y=j);var k=t.magnitudeSquared(t.subtract(u,B,x));if(k>D){var H=Math.sqrt(k);F=.5*(F+H),D=F*F;var Z=H-F;B.x=(F*B.x+Z*u.x)/H,B.y=(F*B.y+Z*u.y)/H,B.z=(F*B.z+Z*u.z)/H}}return Y>F?(t.clone(B,o.center),o.radius=F):(t.clone(V,o.center),o.radius=Y),o},h.fromCornerPoints=function(e,n,i){r(i)||(i=new h);var a=i.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),i.radius=t.distance(a,n),i},h.fromEllipsoid=function(e,n){return r(n)||(n=new h),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n},h.clone=function(e,n){return r(e)?r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new h(e.center,e.radius):void 0},h.packedLength=4,h.pack=function(t,e,r){r=n(r,0);var i=t.center;e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius},h.unpack=function(t,e,i){e=n(e,0),r(i)||(i=new h);var a=i.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],i.radius=t[e],i};var R=new t,b=new t;h.union=function(e,n,i){r(i)||(i=new h);var a=e.center,o=n.center;t.add(a,o,b);var u=t.multiplyByScalar(b,.5,b),s=t.magnitude(t.subtract(a,u,R))+e.radius,c=t.magnitude(t.subtract(o,u,R))+n.radius;return i.radius=Math.max(s,c),t.clone(u,i.center),i};var A=new t;h.expand=function(e,n,r){r=h.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,A));return i>r.radius&&(r.radius=i),r},h.intersect=function(e,n){var r=e.center,i=e.radius,a=t.dot(n,r)+n.w;return-i>a?u.OUTSIDE:i>a?u.INTERSECTING:u.INSIDE},h.transform=function(t,e,n){return r(n)||(n=new h),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var P=new t;h.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,P);return t.magnitudeSquared(r)-e.radius*e.radius},h.transformWithoutScale=function(t,e,n){return r(n)||(n=new h),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var C=new t;h.computePlaneDistances=function(e,n,i,a){r(a)||(a=new s);var o=t.subtract(e.center,n,C),u=t.multiplyByScalar(i,t.dot(i,o),C),c=t.magnitude(u);return a.start=c-e.radius,a.stop=c+e.radius,a};for(var L=new t,U=new t,q=new t,B=new t,D=new t,F=new e,W=new Array(8),G=0;8>G;++G)W[G]=new t;var V=new o;return h.projectTo2D=function(e,r,i){r=n(r,V);var a=r.ellipsoid,o=e.center,u=e.radius,s=a.geodeticSurfaceNormal(o,L),c=t.cross(t.UNIT_Z,s,U);t.normalize(c,c);var l=t.cross(s,c,q);t.normalize(l,l),t.multiplyByScalar(s,u,s),t.multiplyByScalar(l,u,l),t.multiplyByScalar(c,u,c);var f=t.negate(l,D),d=t.negate(c,B),y=W,m=y[0];t.add(s,l,m),t.add(m,c,m),m=y[1],t.add(s,l,m),t.add(m,d,m),m=y[2],t.add(s,f,m),t.add(m,d,m),m=y[3],t.add(s,f,m),t.add(m,c,m),t.negate(s,s),m=y[4],t.add(s,l,m),t.add(m,c,m),m=y[5],t.add(s,l,m),t.add(m,d,m),m=y[6],t.add(s,f,m),t.add(m,d,m),m=y[7],t.add(s,f,m),t.add(m,c,m);for(var p=y.length,w=0;p>w;++w){var v=y[w];t.add(o,v,v);var x=a.cartesianToCartographic(v,F);r.project(x,v)}i=h.fromPoints(y,i),o=i.center;var g=o.x,E=o.y,M=o.z;return o.x=M,o.y=g,o.z=E,i},h.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},h.prototype.intersect=function(t){return h.intersect(this,t)},h.prototype.equals=function(t){return h.equals(this,t)},h.prototype.clone=function(t){return h.clone(this,t)},h}),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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof e[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",t(document[i])?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",t(document[i])&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",t(document[i])?r.fullscreenElement=i:(i=s+"FullScreenElement",t(document[i])&&(r.fullscreenElement=i)),i=s+"fullscreenchange",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t){i.supportsFullscreen()&&t[r.requestFullscreen]()},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;r>n;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(y)){y=!1;var t=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(y=!0,m=r(t[1]))}return y}function a(){return i()&&m}function o(){if(!e(p)&&(p=!1,!i()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(p=!0,w=r(t[1]))}return p}function u(){return o()&&w}function s(){if(!e(v)){v=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==t&&(v=!0,x=r(t[1]),x.isNightly=!!t[2])}return v}function c(){return s()&&x}function l(){if(!e(g)){g=!1;var t;"Microsoft Internet Explorer"===navigator.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(g=!0,E=r(t[1]))):"Netscape"===navigator.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(g=!0,E=r(t[1])))}return g}function h(){return l()&&E}function f(){if(!e(M)){M=!1;var t=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(M=!0,z=r(t[1]))}return M}function d(){return f()&&z}var y,m,p,w,v,x,g,E,M,z,S={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:h,isFirefox:f,firefoxVersion:d,hardwareConcurrency:t(navigator.hardwareConcurrency,3)};return S.supportsFullscreen=function(){return n.supportsFullscreen()},S.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},S.supportsWebWorkers=function(){return"undefined"!=typeof Worker},S}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,e,n,r,i){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(t){switch(t){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(t){return t instanceof Int8Array?a.BYTE:t instanceof Uint8Array?a.UNSIGNED_BYTE:t instanceof Int16Array?a.SHORT:t instanceof Uint16Array?a.UNSIGNED_SHORT:t instanceof Float32Array?a.FLOAT:t instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(t){return e(t)&&(t===a.BYTE||t===a.UNSIGNED_BYTE||t===a.SHORT||t===a.UNSIGNED_SHORT||t===a.FLOAT||t===a.DOUBLE)},a.createTypedArray=function(t,e){switch(t){case a.BYTE:return new Int8Array(e);case a.UNSIGNED_BYTE:return new Uint8Array(e);case a.SHORT:return new Int16Array(e);case a.UNSIGNED_SHORT:return new Uint16Array(e);case a.FLOAT:return new Float32Array(e);case a.DOUBLE:return new Float64Array(e);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(e,r,i,o){switch(i=t(i,0),o=t(o,(r.byteLength-i)/a.getSizeInBytes(e)),e){case a.BYTE:return new Int8Array(r,i,o);case a.UNSIGNED_BYTE:return new Uint8Array(r,i,o);case a.SHORT:return new Int16Array(r,i,o);case a.UNSIGNED_SHORT:return new Uint16Array(r,i,o);case a.FLOAT:return new Float32Array(r,i,o);case a.DOUBLE:return new Float64Array(r,i,o);default:throw new n("componentDatatype is not a valid value.")}},i(a)}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(t,e,n,r,i,a,o,u){"use strict";var s=function(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)},c=new t;s.fromAxisAngle=function(e,r,i){var a=r/2,o=Math.sin(a);c=t.normalize(e,c);var u=c.x*o,l=c.y*o,h=c.z*o,f=Math.cos(a);return n(i)?(i.x=u,i.y=l,i.z=h,i.w=f,i):new s(u,l,h,f)};var l=[1,2,0],h=new Array(3);s.fromRotationMatrix=function(t,e){var r,i,a,o,c,f=t[u.COLUMN0ROW0],d=t[u.COLUMN1ROW1],y=t[u.COLUMN2ROW2],m=f+d+y;if(m>0)r=Math.sqrt(m+1),c=.5*r,r=.5/r,i=(t[u.COLUMN1ROW2]-t[u.COLUMN2ROW1])*r,a=(t[u.COLUMN2ROW0]-t[u.COLUMN0ROW2])*r,o=(t[u.COLUMN0ROW1]-t[u.COLUMN1ROW0])*r;else{var p=l,w=0;d>f&&(w=1),y>f&&y>d&&(w=2);var v=p[w],x=p[v];r=Math.sqrt(t[u.getElementIndex(w,w)]-t[u.getElementIndex(v,v)]-t[u.getElementIndex(x,x)]+1);var g=h;g[w]=.5*r,r=.5/r,c=(t[u.getElementIndex(x,v)]-t[u.getElementIndex(v,x)])*r,g[v]=(t[u.getElementIndex(v,w)]+t[u.getElementIndex(w,v)])*r,g[x]=(t[u.getElementIndex(x,w)]+t[u.getElementIndex(w,x)])*r,i=-g[0],a=-g[1],o=-g[2]}return n(e)?(e.x=i,e.y=a,e.z=o,e.w=c,e):new s(i,a,o,c)};var f=new t,d=new t,y=new s,m=new s,p=new s;s.packedLength=4,s.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},s.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new s),i.x=t[r],i.y=t[r+1],i.z=t[r+2],i.w=t[r+3],i},s.packedInterpolationLength=3,s.convertPackedArrayForInterpolation=function(t,e,n,r){s.unpack(t,4*n,p),s.conjugate(p,p);for(var i=0,a=n-e+1;a>i;i++){var o=3*i;s.unpack(t,4*(e+i),y),s.multiply(y,p,y),y.w<0&&s.negate(y,y),s.computeAxis(y,f);var u=s.computeAngle(y);r[o]=f.x*u,r[o+1]=f.y*u,r[o+2]=f.z*u}},s.unpackInterpolationResult=function(e,r,i,a,o){n(o)||(o=new s),t.fromArray(e,0,d);var u=t.magnitude(d);return s.unpack(r,4*a,m),0===u?s.clone(s.IDENTITY,y):s.fromAxisAngle(d,u,y),s.multiply(y,m,o)},s.clone=function(t,e){return n(t)?n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new s(t.x,t.y,t.z,t.w):void 0},s.conjugate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=t.w,e},s.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},s.magnitude=function(t){return Math.sqrt(s.magnitudeSquared(t))},s.normalize=function(t,e){var n=1/s.magnitude(t),r=t.x*n,i=t.y*n,a=t.z*n,o=t.w*n;return e.x=r,e.y=i,e.z=a,e.w=o,e},s.inverse=function(t,e){var n=s.magnitudeSquared(t);return e=s.conjugate(t,e),s.multiplyByScalar(e,1/n,e)},s.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},s.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},s.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},s.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},s.multiply=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e.x,s=e.y,c=e.z,l=e.w,h=o*u+r*l+i*c-a*s,f=o*s-r*c+i*l+a*u,d=o*c+r*s-i*u+a*l,y=o*l-r*u-i*s-a*c;return n.x=h,n.y=f,n.z=d,n.w=y,n},s.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},s.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},s.computeAxis=function(t,e){var n=t.w;if(Math.abs(n-1)<o.EPSILON6)return e.x=e.y=e.z=0,e;var r=1/Math.sqrt(1-n*n);return e.x=t.x*r,e.y=t.y*r,e.z=t.z*r,e},s.computeAngle=function(t){return Math.abs(t.w-1)<o.EPSILON6?0:2*Math.acos(t.w)};var w=new s;s.lerp=function(t,e,n,r){return w=s.multiplyByScalar(e,n,w),r=s.multiplyByScalar(t,1-n,r),s.add(w,r,r)};var v=new s,x=new s,g=new s;s.slerp=function(t,e,n,r){var i=s.dot(t,e),a=e;if(0>i&&(i=-i,a=v=s.negate(e,v)),1-i<o.EPSILON6)return s.lerp(t,a,n,r);var u=Math.acos(i);return x=s.multiplyByScalar(t,Math.sin((1-n)*u),x),g=s.multiplyByScalar(a,Math.sin(n*u),g),r=s.add(x,g,r),s.multiplyByScalar(r,1/Math.sin(u),r)},s.log=function(e,n){var r=o.acosClamped(e.w),i=0;return 0!==r&&(i=r/Math.sin(r)),t.multiplyByScalar(e,i,n)},s.exp=function(e,n){var r=t.magnitude(e),i=0;return 0!==r&&(i=Math.sin(r)/r),n.x=e.x*i,n.y=e.y*i,n.z=e.z*i,n.w=Math.cos(r),n};var E=new t,M=new t,z=new s,S=new s;s.computeInnerQuadrangle=function(e,n,r,i){var a=s.conjugate(n,z);s.multiply(a,r,S);var o=s.log(S,E);s.multiply(a,e,S);var u=s.log(S,M);return t.add(o,u,o),t.multiplyByScalar(o,.25,o),t.negate(o,o),s.exp(o,z),s.multiply(n,z,i)},s.squad=function(t,e,n,r,i,a){var o=s.slerp(t,e,i,z),u=s.slerp(n,r,i,S);return s.slerp(o,u,2*i*(1-i),a)};for(var O=new s,_=1.9011074535173003,T=i.supportsTypedArrays()?new Float32Array(8):[],I=i.supportsTypedArrays()?new Float32Array(8):[],N=i.supportsTypedArrays()?new Float32Array(8):[],R=i.supportsTypedArrays()?new Float32Array(8):[],b=0;7>b;++b){var A=b+1,P=2*A+1;T[b]=1/(A*P),I[b]=A/P}return T[7]=_/136,I[7]=8*_/17,s.fastSlerp=function(t,e,n,r){var i,a=s.dot(t,e);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-n,c=n*n,l=u*u,h=7;h>=0;--h)N[h]=(T[h]*c-I[h])*o,R[h]=(T[h]*l-I[h])*o;var f=i*n*(1+N[0]*(1+N[1]*(1+N[2]*(1+N[3]*(1+N[4]*(1+N[5]*(1+N[6]*(1+N[7])))))))),d=u*(1+R[0]*(1+R[1]*(1+R[2]*(1+R[3]*(1+R[4]*(1+R[5]*(1+R[6]*(1+R[7])))))))),y=s.multiplyByScalar(t,d,O);return s.multiplyByScalar(e,f,r),s.add(y,r,r)},s.fastSquad=function(t,e,n,r,i,a){var o=s.fastSlerp(t,e,i,z),u=s.fastSlerp(n,r,i,S);return s.fastSlerp(o,u,2*i*(1-i),a)},s.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},s.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.x-e.x)<=r&&Math.abs(t.y-e.y)<=r&&Math.abs(t.z-e.z)<=r&&Math.abs(t.w-e.w)<=r},s.ZERO=a(new s(0,0,0,0)),s.IDENTITY=a(new s(0,0,0,1)),s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.prototype.equalsEpsilon=function(t,e){return s.equalsEpsilon(this,t,e)},s.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},s}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(t,e,n,r){"use strict";function i(e,i,a,l,h,f,d,y,m,p){var w=e+i;t.multiplyByScalar(l,Math.cos(w),o),t.multiplyByScalar(a,Math.sin(w),u),t.add(o,u,o);var v=Math.cos(e);v*=v;var x=Math.sin(e);x*=x;var g=f/Math.sqrt(d*v+h*x),E=g/y;return r.fromAxisAngle(o,E,s),n.fromQuaternion(s,c),n.multiplyByVector(c,m,p),t.normalize(p,p),t.multiplyByScalar(p,y,p),p}var a={},o=new t,u=new t,s=new r,c=new n,l=new t,h=new t,f=new t,d=new t;a.raisePositionsToHeight=function(e,n,r){for(var i=n.ellipsoid,a=n.height,o=n.extrudedHeight,u=r?2*(e.length/3):e.length/3,s=new Float64Array(3*u),c=d,y=e.length,m=r?y:0,p=0;y>p;p+=3){var w,v=p+1,x=p+2,g=t.fromArray(e,p,l);g=i.scaleToGeodeticSurface(g,g),w=t.clone(g,h),c=i.geodeticSurfaceNormal(g,c);var E=t.multiplyByScalar(c,a,f);g=t.add(g,E,g),r&&(E=t.multiplyByScalar(c,o,E),w=t.add(w,E,w),s[p+m]=w.x,s[v+m]=w.y,s[x+m]=w.z),s[p]=g.x,s[v]=g.y,s[x]=g.z}return s};var y=new t,m=new t,p=new t;return a.computeEllipsePositions=function(n,r,a){var o=n.semiMinorAxis,u=n.semiMajorAxis,s=n.rotation,c=n.center,d=n.granularity,w=2.31,v=o*o,x=u*u,g=u*o,E=t.magnitude(c),M=t.normalize(c,y),z=t.cross(t.UNIT_Z,c,m);z=t.normalize(z,z);var S,O,_,T,I,N=t.cross(M,z,p),R=1+Math.ceil(e.PI_OVER_TWO/d),b=w/(R-1),A=2*R*(R+1),P=r?new Array(3*A):void 0,C=0,L=l,U=h,q=a?[]:void 0,B=a?[]:void 0,D=e.PI_OVER_TWO;for(S=0;R>S&&D>0;++S){if(L=i(D,s,N,z,v,g,x,E,M,L),U=i(Math.PI-D,s,N,z,v,g,x,E,M,U),r){for(P[C++]=L.x,P[C++]=L.y,P[C++]=L.z,_=2*S+2,O=1;_-1>O;++O)T=O/(_-1),I=t.lerp(L,U,T,f),P[C++]=I.x,P[C++]=I.y,P[C++]=I.z;P[C++]=U.x,P[C++]=U.y,P[C++]=U.z}a&&(B.unshift(L.x,L.y,L.z),0!==S&&q.push(U.x,U.y,U.z)),D=e.PI_OVER_TWO-(S+1)*b}for(R=S,S=R;S>0;--S){if(D=e.PI_OVER_TWO-(S-1)*b,L=i(-D,s,N,z,v,g,x,E,M,L),U=i(D+Math.PI,s,N,z,v,g,x,E,M,U),r){for(P[C++]=L.x,P[C++]=L.y,P[C++]=L.z,_=2*(S-1)+2,O=1;_-1>O;++O)T=O/(_-1),I=t.lerp(L,U,T,f),P[C++]=I.x,P[C++]=I.y,P[C++]=I.z;P[C++]=U.x,P[C++]=U.y,P[C++]=U.z}a&&(B.unshift(L.x,L.y,L.z),1!==S&&q.push(U.x,U.y,U.z))}var F={};return r&&(P.length!==C&&(A=C/3,P.length=C),F.positions=P,F.numPts=R),a&&(F.outerPositions=B.concat(q)),F},a}),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"],function(t){"use strict";var e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(t){return t===e.POINTS||t===e.LINES||t===e.LINE_LOOP||t===e.LINE_STRIP||t===e.TRIANGLES||t===e.TRIANGLE_STRIP||t===e.TRIANGLE_FAN}};return t(e)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";var a=function(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)};return a.computeNumberOfVertices=function(t){var r=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&e(t.attributes[i])&&e(t.attributes[i].values)){var a=t.attributes[i],o=a.values.length/a.componentsPerAttribute; -if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t){"use strict";var e=function(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 e}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";var e=function(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"],function(t,e,n,r){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,i){return t>r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(i)}),define("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(t,e,n,r,i,a,o,u,s,c,l,h,f,d){"use strict";function y(r){var i=r.center;w=e.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(i,w),r.height,w),w=e.add(i,w,w);for(var a=new t(w,r.semiMajorAxis),u=o.computeEllipsePositions(r,!1,!0).outerPositions,s=new l({position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(u,r,!1)})}),f=u.length/3,d=h.createTypedArray(f,2*f),y=0,m=0;f-1>m;m++)d[y++]=m,d[y++]=m+1;return d[y++]=f-1,d[y++]=0,{boundingSphere:a,attributes:s,indices:d}}function m(i){var a=r(i.numberOfVerticalLines,16);a=Math.max(a,0);var u=i.center,s=i.ellipsoid,f=i.semiMajorAxis,d=e.multiplyByScalar(s.geodeticSurfaceNormal(u,p),i.height,p);v.center=e.add(u,d,v.center),v.radius=f,d=e.multiplyByScalar(s.geodeticSurfaceNormal(u,d),i.extrudedHeight,d),x.center=e.add(u,d,x.center),x.radius=f;var y=o.computeEllipsePositions(i,!1,!0).outerPositions,m=new l({position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(y,i,!0)})});y=m.position.values;var w=t.union(v,x),g=y.length/3,E=h.createTypedArray(g,2*g+2*a);g/=2;for(var M=0,z=0;g-1>z;z++)E[M++]=z,E[M++]=z+1,E[M++]=z+g,E[M++]=z+g+1;E[M++]=g-1,E[M++]=0,E[M++]=g+g-1,E[M++]=g;var S;if(a>0){var O=Math.min(a,g);S=Math.round(g/O)}var _=Math.min(S*a,g);if(a>0)for(z=0;_>z;z+=S)E[M++]=z,E[M++]=z+g;return{boundingSphere:w,attributes:m,indices:E}}var p=new e,w=new e,v=new t,x=new t,g=function(t){t=r(t,r.EMPTY_OBJECT);var n=t.center,a=t.semiMajorAxis,o=t.semiMinorAxis,s=r(t.granularity,f.RADIANS_PER_DEGREE),c=r(t.height,0),l=t.extrudedHeight,h=i(l)&&!f.equalsEpsilon(c,l,1);this._center=e.clone(n),this._semiMajorAxis=a,this._semiMinorAxis=o,this._ellipsoid=r(t.ellipsoid,u.WGS84),this._rotation=r(t.rotation,0),this._height=c,this._granularity=s,this._extrudedHeight=l,this._extrude=h,this._numberOfVerticalLines=Math.max(r(t.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"};return g.createGeometry=function(t){var e,n={center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:t._ellipsoid,rotation:t._rotation,height:t._height,extrudedHeight:t._extrudedHeight,granularity:t._granularity,numberOfVerticalLines:t._numberOfVerticalLines};return t._extrude?(n.extrudedHeight=Math.min(t._extrudedHeight,t._height),n.height=Math.max(t._extrudedHeight,t._height),e=m(n)):e=y(n),new s({attributes:e.attributes,indices:e.indices,primitiveType:d.LINES,boundingSphere:e.boundingSphere})},g}),define("Workers/createEllipseOutlineGeometry",["../Core/Cartesian3","../Core/EllipseOutlineGeometry","../Core/Ellipsoid"],function(t,e,n){"use strict";function r(r){return r._center=t.clone(r._center),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}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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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:0>e?-1:0},i.signNotZero=function(e){return 0>e?-1:1},i.toSNorm=function(e){return Math.round(255*(.5*i.clamp(e,-1,1)+.5))},i.fromSNorm=function(e){return i.clamp(e,0,255)/255*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.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 i>=a||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;e>=r;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}a.fromSpherical=function(n,r){t(r)||(r=new a);var i=n.clock,o=n.cone,u=e(n.magnitude,1),E=u*Math.sin(o);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(e,n,r,i){return t(i)?(i.x=e,i.y=n,i.z=r,i):new a(e,n,r)},a.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new a(e.x,e.y,e.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 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},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var u=new a;a.lerp=function(e,t,n,r){return a.multiplyByScalar(t,n,u),r=a.multiplyByScalar(e,1-n,r),a.add(u,r,r)};var E=new a,s=new a;a.angleBetween=function(e,t){a.normalize(e,E),a.normalize(t,s);var n=a.dot(E,s),r=a.magnitude(a.cross(E,s,E));return Math.atan2(r,n)};var c=new a;a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,c);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):n.y<=n.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,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},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},a.equalsEpsilon=function(e,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)},a.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},a.fromDegrees=function(e,t,n,r,o){var u=i.toRadians(e),E=i.toRadians(t);return a.fromRadians(u,E,n,r,o)};var _=new a,l=new a,R=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=e(i,0);var E=t(o)?o.radiiSquared:R,s=Math.cos(r);_.x=s*Math.cos(n),_.y=s*Math.sin(n),_.z=Math.sin(r),_=a.normalize(_,_),a.multiplyComponents(E,_,l);var c=Math.sqrt(a.dot(_,l));return l=a.divideByScalar(l,c,l),_=a.multiplyByScalar(_,i,_),t(u)||(u=new a),a.add(l,_,u)},a.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=i.toRadians(e[o]);return a.fromRadiansArray(r,t,n)},a.fromRadiansArray=function(e,n,r){var i=e.length;t(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=e[o],E=e[o+1];r[o/2]=a.fromRadians(u,E,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=i.toRadians(e[o]),r[o+1]=i.toRadians(e[o+1]),r[o+2]=e[o+2];return a.fromRadiansArrayHeights(r,t,n)},a.fromRadiansArrayHeights=function(e,n,r){var i=e.length;t(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=e[o],E=e[o+1],s=e[o+2];r[o/3]=a.fromRadians(u,E,s,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),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,R=i.x,T=i.y,A=i.z,d=c*c*R*R,f=_*_*T*T,h=l*l*A*A,N=d+f+h,I=Math.sqrt(1/N),S=e.multiplyByScalar(n,I,a);if(E>N)return isFinite(I)?e.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,w,x,v,F,g,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*m),w=1/(1+D*y),x=U*U,v=L*L,F=w*w,g=x*U,P=v*L,B=F*w,p=d*x+f*v+h*F-1,C=d*g*M+f*P*m+h*B*y;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*w,s):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 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),R=a.EPSILON1;return u.fromCartesian=function(t,r,i){var T=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:l,d=n(r)?r._centerToleranceSquared:R,f=o(t,T,A,d,s);if(n(f)){var h=e.multiplyComponents(t,A,E);h=e.normalize(h,h);var N=e.subtract(t,f,c),I=Math.atan2(h.y,h.x),S=Math.asin(h.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){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){i=n(i,0),e.pack(t._radii,r,i)},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;n>i;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var R=new e,T=new e,A=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,T);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;n>i;++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}),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","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(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 u(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function E(e){for(var t=0,n=0;3>n;++n){var r=e[o.getElementIndex(R[n],l[n])];t+=2*r*r}return Math.sqrt(t)}function s(e,t){for(var n=a.EPSILON15,r=0,i=1,u=0;3>u;++u){var E=Math.abs(e[o.getElementIndex(R[u],l[u])]);E>r&&(i=u,r=E)}var s=1,c=0,_=l[i],T=R[i];if(Math.abs(e[o.getElementIndex(T,_)])>n){var A,d=e[o.getElementIndex(T,T)],f=e[o.getElementIndex(_,_)],h=e[o.getElementIndex(T,_)],N=(d-f)/2/h;A=0>N?-1/(-N+Math.sqrt(1+N*N)):1/(N+Math.sqrt(1+N*N)),s=1/Math.sqrt(1+A*A),c=A*s}return t=o.clone(o.IDENTITY,t),t[o.getElementIndex(_,_)]=t[o.getElementIndex(T,T)]=s,t[o.getElementIndex(T,_)]=c,t[o.getElementIndex(_,T)]=-c,t}o.packedLength=9,o.pack=function(e,n,r){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]},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[4]=e[r++],i[5]=e[r++],i[6]=e[r++],i[7]=e[r++],i[8]=e[r++],i},o.clone=function(e,t){return n(e)?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 o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},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[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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var r=e.x*e.x,i=e.x*e.y,a=e.x*e.z,u=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,R=e.w*e.w,T=r-E-_+R,A=2*(i-l),d=2*(a+c),f=2*(i+l),h=-r+E-_+R,N=2*(s-u),I=2*(a-c),S=2*(s+u),M=-r-E+_+R;return n(t)?(t[0]=T,t[1]=f,t[2]=I,t[3]=A,t[4]=h,t[5]=S,t[6]=d,t[7]=N,t[8]=M,t):new o(T,A,d,f,h,N,I,S,M)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,r,-i,0,i,r)},o.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 o(r,0,i,0,1,0,-i,0,r)},o.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 o(r,-i,0,i,r,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},o.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},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var c=new e;o.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],c)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],c)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],c)),n};var _=new e;o.getMaximumScale=function(t){return o.getScale(t,_),e.maximumComponent(_)},o.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},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[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},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[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},o.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},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[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},o.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},o.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},o.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],R=[2,2,1],T=new o,A=new o;return o.computeEigenDecomposition=function(e,t){var r=a.EPSILON20,i=10,c=0,_=0;n(t)||(t={});for(var l=t.unitary=o.clone(o.IDENTITY,t.unitary),R=t.diagonal=o.clone(e,t.diagonal),d=r*u(R);i>_&&E(R)>d;)s(R,T),o.transpose(T,A),o.multiply(R,T,R),o.multiply(A,R,R),o.multiply(l,T,l),++c>2&&(++_,c=0);return 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[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},o.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)},o.inverse=function(e,t){var n=e[0],i=e[1],u=e[2],E=e[3],s=e[4],c=e[5],_=e[6],l=e[7],R=e[8],T=o.determinant(e);if(Math.abs(T)<=a.EPSILON15)throw new r("matrix is not invertible");t[0]=s*R-l*c,t[1]=l*u-i*R,t[2]=i*c-s*u,t[3]=_*c-E*R,t[4]=n*R-_*u,t[5]=E*u-n*c,t[6]=E*l-_*s,t[7]=_*i-n*l,t[8]=n*s-E*i;var A=1/T;return o.multiplyByScalar(t,A,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=i(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=i(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},a.packedLength=4,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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.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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(e,t,r,i,a,o,u,E,s,c,_,l,R,T,A,d){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(T,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(l,0),this[15]=n(d,0)}s.packedLength=16,s.pack=function(e,t,r){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]},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[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},s.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new s(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]):void 0},s.fromArray=s.unpack,s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},s.fromRotationTranslation=function(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 s(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)},s.fromTranslationQuaternionRotationScale=function(e,t,n,i){r(i)||(i=new s);var a=n.x,o=n.y,u=n.z,E=t.x*t.x,c=t.x*t.y,_=t.x*t.z,l=t.x*t.w,R=t.y*t.y,T=t.y*t.z,A=t.y*t.w,d=t.z*t.z,f=t.z*t.w,h=t.w*t.w,N=E-R-d+h,I=2*(c-f),S=2*(_+A),M=2*(c+f),m=-E+R-d+h,y=2*(T-l),O=2*(_-A),p=2*(T+l),C=-E-R+d+h;return i[0]=N*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]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},s.fromTranslationRotationScale=function(e,t){return s.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},s.fromTranslation=function(e,t){return s.fromRotationTranslation(u.IDENTITY,e,t)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new s(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new s(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var c=new e,_=new e,l=new e;s.fromCamera=function(t,n){var i=t.eye,a=t.target,o=t.up;e.normalize(e.subtract(a,i,c),c),e.normalize(e.cross(c,o,_),_),e.normalize(e.cross(_,c,l),l);var u=_.x,E=_.y,R=_.z,T=c.x,A=c.y,d=c.z,f=l.x,h=l.y,N=l.z,I=i.x,S=i.y,M=i.z,m=u*-I+E*-S+R*-M,y=f*-I+h*-S+N*-M,O=T*I+A*S+d*M; +return r(n)?(n[0]=u,n[1]=f,n[2]=-T,n[3]=0,n[4]=E,n[5]=h,n[6]=-A,n[7]=0,n[8]=R,n[9]=N,n[10]=-d,n[11]=0,n[12]=m,n[13]=y,n[14]=O,n[15]=1,n):new s(u,E,R,m,f,h,N,y,-T,-A,-d,O,0,0,0,1)},s.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},s.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},s.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,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]=l,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},s.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},s.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,R=c,T=_,A=a+s,d=o+c,f=t+_,h=1;return i[0]=l,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]=T,i[11]=0,i[12]=A,i[13]=d,i[14]=f,i[15]=h,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[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},s.getElementIndex=function(e,t){return 4*e+t},s.getColumn=function(e,t,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},s.setColumn=function(e,t,n,r){r=s.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},s.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},s.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},s.setRow=function(e,t,n,r){return r=s.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;s.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 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],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],R=e[10],T=e[11],A=e[12],d=e[13],f=e[14],h=e[15],N=t[0],I=t[1],S=t[2],M=t[3],m=t[4],y=t[5],O=t[6],p=t[7],C=t[8],U=t[9],L=t[10],w=t[11],x=t[12],v=t[13],F=t[14],g=t[15],P=r*N+u*I+_*S+A*M,B=i*N+E*I+l*S+d*M,D=a*N+s*I+R*S+f*M,z=o*N+c*I+T*S+h*M,G=r*m+u*y+_*O+A*p,b=i*m+E*y+l*O+d*p,X=a*m+s*y+R*O+f*p,V=o*m+c*y+T*O+h*p,H=r*C+u*U+_*L+A*w,W=i*C+E*U+l*L+d*w,q=a*C+s*U+R*L+f*w,Y=o*C+c*U+T*L+h*w,K=r*x+u*v+_*F+A*g,k=i*x+E*v+l*F+d*g,Z=a*x+s*v+R*F+f*g,j=o*x+c*v+T*F+h*g;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]=W,n[10]=q,n[11]=Y,n[12]=K,n[13]=k,n[14]=Z,n[15]=j,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[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},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[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},s.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],R=e[13],T=e[14],A=t[0],d=t[1],f=t[2],h=t[4],N=t[5],I=t[6],S=t[8],M=t[9],m=t[10],y=t[12],O=t[13],p=t[14],C=r*A+o*d+s*f,U=i*A+u*d+c*f,L=a*A+E*d+_*f,w=r*h+o*N+s*I,x=i*h+u*N+c*I,v=a*h+E*N+_*I,F=r*S+o*M+s*m,g=i*S+u*M+c*m,P=a*S+E*M+_*m,B=r*y+o*O+s*p+l,D=i*y+u*O+c*p+R,z=a*y+E*O+_*p+T;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=w,n[5]=x,n[6]=v,n[7]=0,n[8]=F,n[9]=g,n[10]=P,n[11]=0,n[12]=B,n[13]=D,n[14]=z,n[15]=1,n},s.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],R=t[1],T=t[2],A=t[3],d=t[4],f=t[5],h=t[6],N=t[7],I=t[8],S=r*l+o*R+s*T,M=i*l+u*R+c*T,m=a*l+E*R+_*T,y=r*A+o*d+s*f,O=i*A+u*d+c*f,p=a*A+E*d+_*f,C=r*h+o*N+s*I,U=i*h+u*N+c*I,L=a*h+E*N+_*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]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},s.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;s.multiplyByUniformScale=function(e,t,n){return A.x=t,A.y=t,A.z=t,s.multiplyByScale(e,A,n)},s.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?s.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)},s.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},s.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},s.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},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[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},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},s.transpose=function(e,t){var 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},s.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e[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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},s.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},s.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var d=new u,f=new u,h=new t,N=new t(0,0,0,1);return s.inverse=function(e,n){if(u.equalsEpsilon(s.getRotation(e,d),f,o.EPSILON7)&&t.equals(s.getRow(e,3,h),N))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],c=e[12],_=e[1],l=e[5],R=e[9],T=e[13],A=e[2],I=e[6],S=e[10],M=e[14],m=e[3],y=e[7],O=e[11],p=e[15],C=S*p,U=M*O,L=I*p,w=M*y,x=I*O,v=S*y,F=A*p,g=M*m,P=A*O,B=S*m,D=A*y,z=I*m,G=C*l+w*R+x*T-(U*l+L*R+v*T),b=U*_+F*R+B*T-(C*_+g*R+P*T),X=L*_+g*l+D*T-(w*_+F*l+z*T),V=v*_+P*l+z*R-(x*_+B*l+D*R),H=U*i+L*a+v*c-(C*i+w*a+x*c),W=C*r+g*a+P*c-(U*r+F*a+B*c),q=w*r+F*i+z*c-(L*r+g*i+D*c),Y=x*r+B*i+D*a-(v*r+P*i+z*a);C=a*T,U=c*R,L=i*T,w=c*l,x=i*R,v=a*l,F=r*T,g=c*_,P=r*R,B=a*_,D=r*l,z=i*_;var K=C*y+w*O+x*p-(U*y+L*O+v*p),k=U*m+F*O+B*p-(C*m+g*O+P*p),Z=L*m+g*y+D*p-(w*m+F*y+z*p),j=v*m+P*y+z*O-(x*m+B*y+D*O),Q=L*S+v*M+U*I-(x*M+C*I+w*S),J=P*M+C*A+g*S-(F*S+B*M+U*A),$=F*I+z*M+w*A-(D*M+L*A+g*I),ee=D*S+x*A+B*I-(P*I+z*S+v*A),te=r*G+i*b+a*X+c*V;if(Math.abs(te)<o.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]=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},s.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],R=e[14],T=-n*_-r*l-i*R,A=-a*_-o*l-u*R,d=-E*_-s*l-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]=T,t[13]=A,t[14]=d,t[15]=1,t},s.IDENTITY=a(new s(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),s.ZERO=a(new s(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN0ROW3=3,s.COLUMN1ROW0=4,s.COLUMN1ROW1=5,s.COLUMN1ROW2=6,s.COLUMN1ROW3=7,s.COLUMN2ROW0=8,s.COLUMN2ROW1=9,s.COLUMN2ROW2=10,s.COLUMN2ROW3=11,s.COLUMN3ROW0=12,s.COLUMN3ROW1=13,s.COLUMN3ROW2=14,s.COLUMN3ROW3=15,s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.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]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},s}),define("Core/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}),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){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},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 n>t&&(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 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 T=R.longitude>=0?R.longitude:R.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=s,t.east=i,t.north=c,t):new E(r,s,i,c)},E.clone=function(e,t){return n(e)?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):void 0},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;a>i&&(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;a>i&&o>0?i+=u.TWO_PI:s>o&&i>0&&(o+=u.TWO_PI),a>i&&0>s?s+=u.TWO_PI:s>o&&0>a&&(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),R=Math.min(e.north,t.north);if(!(l>=R))return n(r)?(r.west=c,r.south=l,r.east=_,r.north=R,r):new E(c,l,_,R)}},E.union=function(e,t,r){return n(r)||(r=new E),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.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 i>a&&(a+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(a>n||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,R=e.east,T=e.west,A=s;A.height=i,A.longitude=T,A.latitude=_,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.latitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=T,o[c]=r.cartographicToCartesian(A,o[c]),c++,0>_?A.latitude=_:l>0?A.latitude=l:A.latitude=0;for(var d=1;8>d;++d)A.longitude=-Math.PI+d*u.PI_OVER_TWO,E.contains(e,A)&&(o[c]=r.cartographicToCartesian(A,o[c]),c++);return 0===A.latitude&&(A.longitude=T,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","./Plane","./Rectangle"],function(e,t,n,r,i,a,o,u,E,s,c,_,l){"use strict";function R(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var T=new e,A=new e,d=new e,f=new e,h=new e,N=new e,I=new e,S=new e,M=new e,m=new e,y=new e,O=new e;R.fromPoints=function(t,n){if(r(n)||(n=new R),!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],I),a=e.clone(i,T),o=e.clone(i,A),u=e.clone(i,d),E=e.clone(i,f),s=e.clone(i,h),c=e.clone(i,N),_=t.length,l=1;_>l;l++){e.clone(t[l],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,S)),w=e.magnitudeSquared(e.subtract(s,o,S)),x=e.magnitudeSquared(e.subtract(c,u,S)),v=a,F=E,g=L;w>g&&(g=w,v=o,F=s),x>g&&(g=x,v=u,F=c);var P=M;P.x=.5*(v.x+F.x),P.y=.5*(v.y+F.y),P.z=.5*(v.z+F.z);var B=e.magnitudeSquared(e.subtract(F,P,S)),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,S),.5,O),X=0;for(l=0;_>l;l++){e.clone(t[l],i);var V=e.magnitude(e.subtract(i,b,S));V>X&&(X=V);var H=e.magnitudeSquared(e.subtract(i,P,S));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 X>D?(e.clone(P,n.center),n.radius=D):(e.clone(b,n.center),n.radius=X),n};var p=new o,C=new e,U=new e,L=new t,w=new t;R.fromRectangle2D=function(e,t,n){return R.fromRectangleWithHeights2D(e,t,0,0,n)},R.fromRectangleWithHeights2D=function(t,i,a,o,u){if(r(u)||(u=new R),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=n(i,p),l.southwest(t,L),L.height=a,l.northeast(t,w),w.height=o;var E=i.project(L,C),s=i.project(w,U),c=s.x-E.x,_=s.y-E.y,T=s.z-E.z;u.radius=.5*Math.sqrt(c*c+_*_+T*T);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*_,A.z=E.z+.5*T,u};var x=[];R.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,x)),R.fromPoints(u,o)},R.fromVertices=function(t,i,a,o){if(r(o)||(o=new R),!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=I;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,A),c=e.clone(u,d),_=e.clone(u,f),l=e.clone(u,h),p=e.clone(u,N),C=t.length,U=0;C>U;U+=a){var L=t[U]+i.x,w=t[U+1]+i.y,x=t[U+2]+i.z;u.x=L,u.y=w,u.z=x,L<E.x&&e.clone(u,E),L>_.x&&e.clone(u,_),w<s.y&&e.clone(u,s),w>l.y&&e.clone(u,l),x<c.z&&e.clone(u,c),x>p.z&&e.clone(u,p)}var v=e.magnitudeSquared(e.subtract(_,E,S)),F=e.magnitudeSquared(e.subtract(l,s,S)),g=e.magnitudeSquared(e.subtract(p,c,S)),P=E,B=_,D=v;F>D&&(D=F,P=s,B=l),g>D&&(D=g,P=c,B=p);var z=M;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,S)),b=Math.sqrt(G),X=m;X.x=E.x,X.y=s.y,X.z=c.z;var V=y;V.x=_.x,V.y=l.y,V.z=p.z;var H=e.multiplyByScalar(e.add(X,V,S),.5,O),W=0;for(U=0;C>U;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,S));q>W&&(W=q);var Y=e.magnitudeSquared(e.subtract(u,z,S));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 W>b?(e.clone(z,o.center),o.radius=b):(e.clone(H,o.center),o.radius=W),o},R.fromEncodedCartesianVertices=function(t,n,i){if(r(i)||(i=new R),!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=I;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,A),E=e.clone(a,d),s=e.clone(a,f),c=e.clone(a,h),_=e.clone(a,N),l=t.length,p=0;l>p;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 w=e.magnitudeSquared(e.subtract(s,o,S)),x=e.magnitudeSquared(e.subtract(c,u,S)),v=e.magnitudeSquared(e.subtract(_,E,S)),F=o,g=s,P=w;x>P&&(P=x,F=u,g=c),v>P&&(P=v,F=E,g=_);var B=M;B.x=.5*(F.x+g.x),B.y=.5*(F.y+g.y),B.z=.5*(F.z+g.z);var D=e.magnitudeSquared(e.subtract(g,B,S)),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 X=e.multiplyByScalar(e.add(G,b,S),.5,O),V=0;for(p=0;l>p;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,S));H>V&&(V=H);var W=e.magnitudeSquared(e.subtract(a,B,S));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 V>z?(e.clone(B,i.center),i.radius=z):(e.clone(X,i.center),i.radius=V),i},R.fromCornerPoints=function(t,n,i){r(i)||(i=new R);var a=i.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,n),i},R.fromEllipsoid=function(t,n){return r(n)||(n=new R),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var v=new e;R.fromBoundingSpheres=function(t,n){if(r(n)||(n=new R),!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 R.clone(t[0],n);if(2===i)return R.union(t[0],t[1],n);for(var a=[],o=0;i>o;o++)a.push(t[o].center);n=R.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;i>o;o++){var s=t[o];E=Math.max(E,e.distance(u,s.center,v)+s.radius)}return n.radius=E,n};var F=new e,g=new e,P=new e;R.fromOrientedBoundingBox=function(t,n){r(n)||(n=new R);var i=t.halfAxes,a=s.getColumn(i,0,F),o=s.getColumn(i,1,g),u=s.getColumn(i,2,P),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},R.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new R(t.center,t.radius):void 0},R.packedLength=4,R.pack=function(e,t,r){r=n(r,0);var i=e.center;t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius},R.unpack=function(e,t,i){t=n(t,0),r(i)||(i=new R);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var B=new e,D=new e;R.union=function(t,n,i){r(i)||(i=new R);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(i),i;if(E>=c+o)return n.clone(i),i;var _=.5*(o+c+E),l=e.multiplyByScalar(s,(-o+_)/c,D);return e.add(l,a,l),e.clone(l,i.center),i.radius=_,i};var z=new e;R.expand=function(t,n,r){r=R.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,z));return i>r.radius&&(r.radius=i),r},R.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return-i>o?u.OUTSIDE:i>o?u.INTERSECTING:u.INSIDE},R.transform=function(e,t,n){return r(n)||(n=new R),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var G=new e;R.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,G);return e.magnitudeSquared(r)-t.radius*t.radius},R.transformWithoutScale=function(e,t,n){return r(n)||(n=new R),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;R.computePlaneDistances=function(t,n,i,a){r(a)||(a=new E);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 X=new e,V=new e,H=new e,W=new e,q=new e,Y=new t,K=new Array(8),k=0;8>k;++k)K[k]=new e;var Z=new o;return R.projectTo2D=function(t,r,i){r=n(r,Z);var a=r.ellipsoid,o=t.center,u=t.radius,E=a.geodeticSurfaceNormal(o,X),s=e.cross(e.UNIT_Z,E,V);e.normalize(s,s);var c=e.cross(E,s,H);e.normalize(c,c),e.multiplyByScalar(E,u,E),e.multiplyByScalar(c,u,c),e.multiplyByScalar(s,u,s);var _=e.negate(c,q),l=e.negate(s,W),T=K,A=T[0];e.add(E,c,A),e.add(A,s,A),A=T[1],e.add(E,c,A),e.add(A,l,A),A=T[2],e.add(E,_,A),e.add(A,l,A),A=T[3],e.add(E,_,A),e.add(A,s,A),e.negate(E,E),A=T[4],e.add(E,c,A),e.add(A,s,A),A=T[5],e.add(E,c,A),e.add(A,l,A),A=T[6],e.add(E,_,A),e.add(A,l,A),A=T[7],e.add(E,_,A),e.add(A,s,A);for(var d=T.length,f=0;d>f;++f){var h=T[f];e.add(o,h,h);var N=a.cartesianToCartographic(h,Y);r.project(N,h)}i=R.fromPoints(T,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},R.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},R.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},R.prototype.intersectPlane=function(e){return R.intersectPlane(this,e)},R.prototype.distanceSquaredTo=function(e){return R.distanceSquaredTo(this,e)},R.prototype.computePlaneDistances=function(e,t,n){return R.computePlaneDistances(this,e,t,n)},R.prototype.isOccluded=function(e){return R.isOccluded(this,e)},R.prototype.equals=function(e){return R.equals(this,e)},R.prototype.clone=function(e){return R.clone(this,e)},R}),define("Renderer/WebGLConstants",["../Core/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/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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++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",e(document[i])?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",e(document[i])&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",e(document[i])?r.fullscreenElement=i:(i=E+"FullScreenElement",e(document[i])&&(r.fullscreenElement=i)),i=E+"fullscreenchange",e(document["on"+i])&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",e(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;r>n;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(N)){N=!1;var e=/ Chrome\/([\.0-9]+)/.exec(h.userAgent);null!==e&&(N=!0,I=r(e[1]))}return N}function a(){return i()&&I}function o(){if(!t(S)&&(S=!1,!i()&&/ Safari\/[\.0-9]+/.test(h.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(h.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function u(){return o()&&M}function E(){if(!t(m)){m=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(h.userAgent);null!==e&&(m=!0,y=r(e[1]),y.isNightly=!!e[2])}return m}function s(){return E()&&y}function c(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===h.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(h.userAgent),null!==e&&(O=!0,p=r(e[1]))):"Netscape"===h.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(h.userAgent),null!==e&&(O=!0,p=r(e[1])))}return O}function _(){return c()&&p}function l(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(h.userAgent);null!==e&&(C=!0,U=r(e[1]))}return C}function R(){return t(L)||(L=/Windows/i.test(h.appVersion)),L}function T(){return l()&&U}function A(){return t(w)||(w="undefined"!=typeof PointerEvent&&(!t(h.pointerEnabled)||h.pointerEnabled)),w}function d(){if(!t(v)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;v=t(n)&&""!==n,v&&(x=n)}return v}function f(){return d()?x:void 0}var h;h="undefined"!=typeof navigator?navigator:{};var N,I,S,M,m,y,O,p,C,U,L,w,x,v,F={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isFirefox:l,firefoxVersion:T,isWindows:R,hardwareConcurrency:e(h.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:d,imageRenderingValue:f};return F.supportsFullscreen=function(){return n.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,i,a){"use strict";if(!i.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return n(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,n,i,a){switch(i=t(i,0),a=t(a,(n.byteLength-i)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,i,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,i,a);case o.SHORT:return new Int16Array(n,i,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,i,a);case o.FLOAT:return new Float32Array(n,i,a);case o.DOUBLE:return new Float64Array(n,i,a);default:throw new r("componentDatatype is not a valid value.")}},a(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],R=e[u.COLUMN1ROW1],T=e[u.COLUMN2ROW2],A=l+R+T;if(A>0)r=Math.sqrt(A+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 d=c,f=0;R>l&&(f=1),T>l&&T>R&&(f=2);var h=d[f],N=d[h];r=Math.sqrt(e[u.getElementIndex(f,f)]-e[u.getElementIndex(h,h)]-e[u.getElementIndex(N,N)]+1);var I=_;I[f]=.5*r,r=.5/r,s=(e[u.getElementIndex(N,h)]-e[u.getElementIndex(h,N)])*r,I[h]=(e[u.getElementIndex(h,f)]+e[u.getElementIndex(f,h)])*r,I[N]=(e[u.getElementIndex(N,f)]+e[u.getElementIndex(f,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 R=new e,T=new e,A=new E,d=new E,f=new E;E.packedLength=4,E.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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,f),E.conjugate(f,f);for(var i=0,a=n-t+1;a>i;i++){var o=3*i;E.unpack(e,4*(t+i),A),E.multiply(A,f,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,r,i,a,o){n(o)||(o=new E),e.fromArray(t,0,T);var u=e.magnitude(T);return E.unpack(r,4*a,d),0===u?E.clone(E.IDENTITY,A):E.fromAxisAngle(T,u,A),E.multiply(A,d,o)},E.clone=function(e,t){return n(e)?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):void 0},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,R=o*s+r*E-i*u+a*c,T=o*c-r*u-i*E-a*s;return n.x=_,n.y=l,n.z=R,n.w=T,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 h=new E;E.lerp=function(e,t,n,r){return h=E.multiplyByScalar(t,n,h),r=E.multiplyByScalar(e,1-n,r),E.add(h,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(0>i&&(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,m=new e,y=new E,O=new E;E.computeInnerQuadrangle=function(t,n,r,i){var a=E.conjugate(n,y);E.multiply(a,r,O);var o=E.log(O,M);E.multiply(a,t,O);var u=E.log(O,m);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),E.exp(o,y),E.multiply(n,y,i)},E.squad=function(e,t,n,r,i,a){var o=E.slerp(e,t,i,y),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):[],w=i.supportsTypedArrays()?new Float32Array(8):[],x=i.supportsTypedArrays()?new Float32Array(8):[],v=0;7>v;++v){var F=v+1,g=2*F+1;U[v]=1/(F*g),L[v]=F/g}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;--_)w[_]=(U[_]*s-L[_])*o,x[_]=(U[_]*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])))))))),R=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])))))))),T=E.multiplyByScalar(e,R,p);return E.multiplyByScalar(t,l,r),E.add(T,r,r)},E.fastSquad=function(e,t,n,r,i,a){var o=E.fastSlerp(e,t,i,y),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,R,T,A,d){var f=t+i;e.multiplyByScalar(c,Math.cos(f),o),e.multiplyByScalar(a,Math.sin(f),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(R*h+_*N),S=I/T;return r.fromAxisAngle(o,S,E),n.fromQuaternion(E,s),n.multiplyByVector(s,A,d),e.normalize(d,d),e.multiplyByScalar(d,T,d),d}var a={},o=new e,u=new e,E=new r,s=new n,c=new e,_=new e,l=new e,R=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,T=r?s:0,A=0;s>A;A+=3){var d=A+1,f=A+2,h=e.fromArray(t,A,c);i.scaleToGeodeticSurface(h,h);var N=e.clone(h,_),I=i.geodeticSurfaceNormal(h,R),S=e.multiplyByScalar(I,a,l);e.add(h,S,h),r&&(e.multiplyByScalar(I,o,S),e.add(N,S,N),E[A+T]=N.x,E[d+T]=N.y,E[f+T]=N.z),E[A]=h.x,E[d]=h.y,E[f]=h.z}return E};var T=new e,A=new e,d=new e;return a.computeEllipsePositions=function(n,r,a){var o=n.semiMinorAxis,u=n.semiMajorAxis,E=n.rotation,s=n.center,R=8*n.granularity,f=o*o,h=u*u,N=u*o,I=e.magnitude(s),S=e.normalize(s,T),M=e.cross(e.UNIT_Z,s,A);M=e.normalize(M,M);var m=e.cross(S,M,d),y=1+Math.ceil(t.PI_OVER_TWO/R),O=t.PI_OVER_TWO/(y-1),p=t.PI_OVER_TWO-y*O;0>p&&(y-=Math.ceil(Math.abs(p)/O));var C,U,L,w,x,v=2*(y*(y+2)),F=r?new Array(3*v):void 0,g=0,P=c,B=_,D=4*y*3,z=D-1,G=0,b=a?new Array(D):void 0;for(p=t.PI_OVER_TWO,P=i(p,E,m,M,f,N,h,I,S,P),r&&(F[g++]=P.x,F[g++]=P.y,F[g++]=P.z),a&&(b[z--]=P.z,b[z--]=P.y,b[z--]=P.x),p=t.PI_OVER_TWO-O,C=1;y+1>C;++C){if(P=i(p,E,m,M,f,N,h,I,S,P),B=i(Math.PI-p,E,m,M,f,N,h,I,S,B),r){for(F[g++]=P.x,F[g++]=P.y,F[g++]=P.z,L=2*C+2,U=1;L-1>U;++U)w=U/(L-1),x=e.lerp(P,B,w,l),F[g++]=x.x,F[g++]=x.y,F[g++]=x.z;F[g++]=B.x,F[g++]=B.y,F[g++]=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=y;C>1;--C){if(p=t.PI_OVER_TWO-(C-1)*O,P=i(-p,E,m,M,f,N,h,I,S,P),B=i(p+Math.PI,E,m,M,f,N,h,I,S,B),r){for(F[g++]=P.x,F[g++]=P.y,F[g++]=P.z,L=2*(C-1)+2,U=1;L-1>U;++U)w=U/(L-1),x=e.lerp(P,B,w,l),F[g++]=x.x,F[g++]=x.y,F[g++]=x.z;F[g++]=B.x,F[g++]=B.y,F[g++]=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,m,M,f,N,h,I,S,P);var X={};return r&&(F[g++]=P.x,F[g++]=P.y,F[g++]=P.z,X.positions=F,X.numPts=y),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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(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=void 0}return a.computeNumberOfVertices=function(e){var r=-1;for(var i in e.attributes)if(e.attributes.hasOwnProperty(i)&&t(e.attributes[i])&&t(e.attributes[i].values)){var a=e.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===a.UNSIGNED_BYTE||e===a.UNSIGNED_SHORT||e===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,r){return e>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,r):new Uint16Array(t,n,r)},r(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,R){"use strict";function T(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,E=new c({position:new s({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(u,r,!1)})}),l=u.length/3,R=_.createTypedArray(l,2*l),T=0,A=0;l>A;++A)R[T++]=A,R[T++]=(A+1)%l;return{boundingSphere:a,attributes:E,indices:R}}function A(i){var a=r(i.numberOfVerticalLines,16);a=Math.max(a,0);var u=i.center,E=i.ellipsoid,l=i.semiMajorAxis,R=t.multiplyByScalar(E.geodeticSurfaceNormal(u,f),i.height,f);N.center=t.add(u,R,N.center),N.radius=l,R=t.multiplyByScalar(E.geodeticSurfaceNormal(u,R),i.extrudedHeight,R),I.center=t.add(u,R,I.center),I.radius=l;var T=o.computeEllipsePositions(i,!1,!0).outerPositions,A=new c({position:new s({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(T,i,!0)})});T=A.position.values;var d=e.union(N,I),h=T.length/3,S=_.createTypedArray(h,2*h+2*a);h/=2;var M,m=0;for(M=0;h>M;++M)S[m++]=M,S[m++]=(M+1)%h,S[m++]=M+h,S[m++]=(M+1)%h+h;var y;if(a>0){var O=Math.min(a,h);y=Math.round(h/O)}var p=Math.min(y*a,h);if(a>0)for(M=0;p>M;M+=y)S[m++]=M,S[m++]=M+h;return{boundingSphere:d,attributes:A,indices:S}}function d(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,R=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=R,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var f=new t,h=new t,N=new e,I=new e;d.packedLength=t.packedLength+u.packedLength+9,d.pack=function(e,n,a){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};var S=new t,M=new u,m={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 d.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++],R=e[n++],T=e[n++],A=e[n++],f=1===e[n++],h=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=R,a._extrudedHeight=T?A:void 0,a._extrude=f,a._numberOfVerticalLines=h,a):(m.height=l,m.extrudedHeight=T?A:void 0,m.granularity=R,m.rotation=_,m.semiMajorAxis=s,m.semiMinorAxis=c,m.numberOfVerticalLines=h,new d(m))},d.createGeometry=function(e){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=A(n)):t=T(n),new E({attributes:t.attributes,indices:t.indices,primitiveType:R.LINES,boundingSphere:t.boundingSphere})},d}),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/Workers/createEllipsoidGeometry.js b/Workers/createEllipsoidGeometry.js index aa3e1ff..919aba6 100644 --- a/Workers/createEllipsoidGeometry.js +++ b/Workers/createEllipsoidGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,5 +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";var t=function(t){return void 0!==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";var e=function(t,e){return void 0!==t?t:e};return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";var e=function(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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("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^=2636928640&t<<7,t^=4022730752&t<<15,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){"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(t){return t>0?1:0>t?-1:0},n.signNotZero=function(t){return 0>t?-1:1},n.toSNorm=function(t){return Math.round(255*(.5*n.clamp(t,-1,1)+.5))},n.fromSNorm=function(t){return 2*(n.clamp(t,0,255)/255)-1},n.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},n.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},n.lerp=function(t,e,n){return(1-n)*t+n*e},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(t){return t*n.RADIANS_PER_DEGREE},n.toDegrees=function(t){return t*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(t){var e=n.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},n.negativePiToPi=function(t){for(var e=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+e)>t;)t+=i;if(-r>t)return-r;for(;t>r+e;)t-=i;return t>r?r:t},n.zeroToTwoPi=function(t){var e=t%n.TWO_PI;return 0>e?(e+n.TWO_PI)%n.TWO_PI:e},n.equalsEpsilon=function(t,n,r){return r=e(r,0),Math.abs(t-n)<=r};var r=[1];n.factorial=function(t){var e=r.length;if(t>=e)for(var n=r[e-1],i=e;t>=i;i++)r.push(n*i);return r[t]},n.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},n.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},n.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},n.clamp=function(t,e,n){return e>t?e:t>n?n:t};var i=new t;return n.setRandomNumberSeed=function(e){i=new t(e)},n.nextRandomNumber=function(){return i.random()},n.acosClamped=function(t){return Math.acos(n.clamp(t,-1,1))},n.asinClamped=function(t){return Math.asin(n.clamp(t,-1,1))},n}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)};a.fromSpherical=function(n,r){e(r)||(r=new a);var i=n.clock,o=n.cone,u=t(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(t,n,r,i){return e(i)?(i.x=t,i.y=n,i.z=r,i):new a(t,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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.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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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 s=new a,c=new a;a.angleBetween=function(t,e){a.normalize(t,s),a.normalize(e,c);var n=a.dot(s,c),r=a.magnitude(a.cross(s,c,s));return Math.atan2(r,n)};var l=new a;a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,l);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):n.y<=n.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r},a.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,s=e.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},a.fromDegrees=function(t,e,n,r,o){var u=i.toRadians(t),s=i.toRadians(e);return a.fromRadians(u,s,n,r,o)};var f=new a,h=new a,d=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=t(i,0);var s=e(o)?o.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=a.normalize(f,f),a.multiplyComponents(s,f,h);var l=Math.sqrt(a.dot(f,h));return h=a.divideByScalar(h,l,h),f=a.multiplyByScalar(f,i,f),e(u)||(u=new a),a.add(h,f,u)},a.fromDegreesArray=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=i.toRadians(t[o]);return a.fromRadiansArray(r,e,n)},a.fromRadiansArray=function(t,n,r){var i=t.length;e(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],s=t[o+1];r[o/2]=a.fromRadians(u,s,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o+=3)r[o]=i.toRadians(t[o]),r[o+1]=i.toRadians(t[o+1]),r[o+2]=t[o+2];return a.fromRadiansArrayHeights(r,e,n)},a.fromRadiansArrayHeights=function(t,n,r){var i=t.length;e(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],s=t[o+1],c=t[o+2];r[o/3]=a.fromRadians(u,s,c,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)};return a.fromRadians=function(n,r,i,o){return i=t(i,0),e(o)?(o.longitude=n,o.latitude=r,o.height=i,o):new a(n,r,i)},a.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),a.fromRadians(t,e,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new a(t.longitude,t.latitude,t.height):void 0},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.longitude-n.longitude)<=r&&Math.abs(t.latitude-n.latitude)<=r&&Math.abs(t.height-n.height)<=r},a.ZERO=r(new a(0,0,0)),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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),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"],function(t,e,n,r,i,a,o,u){"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}var c=function(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,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))return void 0;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.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),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=s,n.z=c,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 l=new t,f=new t;c.prototype.cartographicToCartesian=function(e,n){var i=l,a=f;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;n>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var h=new t,d=new t,m=new t;c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,d);if(!r(a))return void 0;var o=this.geodeticSurfaceNormal(a,h),s=t.subtract(n,a,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(t.dot(s,n))*t.magnitude(s);return r(i)?(i.longitude=c,i.latitude=l,i.height=f,i):new e(c,l,f)},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;n>i;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e};var y=new t,p=new t;return c.prototype.scaleToGeodeticSurface=function(e,n){var i=e.x,a=e.y,o=e.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,h=i*i*c*c,d=a*a*l*l,m=o*o*f*f,v=h+d+m,w=Math.sqrt(1/v),x=t.multiplyByScalar(e,w,y);if(v<this._centerToleranceSquared)return isFinite(w)?t.clone(x,n):void 0;var E=this._oneOverRadiiSquared,g=E.x,M=E.y,S=E.z,z=p;z.x=2*x.x*g,z.y=2*x.y*M,z.z=2*x.z*S;var O,T,N,_,I,R,b,A,P,C,L,U=(1-w)*t.magnitude(e)/(.5*t.magnitude(z)),q=0;do{U-=q,N=1/(1+U*g),_=1/(1+U*M),I=1/(1+U*S),R=N*N,b=_*_,A=I*I,P=R*N,C=b*_,L=A*I,O=h*R+d*b+m*A-1,T=h*P*g+d*C*M+m*L*S;var D=-2*T;q=O/D}while(Math.abs(O)>u.EPSILON12);return r(n)?(n.x=i*N,n.y=a*_,n.z=o*I,n):new t(i*N,a*_,o*I)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,s,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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";var u=function(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";var e=function(e,n){this.start=t(e,0),this.stop=t(n,0)};return e}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";var i=function(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)};i.fromElements=function(t,n,r,a,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=a,o):new i(t,n,r,a)},i.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 i(t.red,t.green,t.blue,t.alpha)},i.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new i(t.x,t.y,t.z,t.w):void 0},i.packedLength=4,i.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r++],a.w=n[r],a},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,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},i.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},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 a=new i;i.distance=function(t,e){return i.subtract(t,e,a),i.magnitude(a)},i.normalize=function(t,e){var n=i.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,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,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},i.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},i.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},i.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},i.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},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 o=new i;i.lerp=function(t,e,n,r){return i.multiplyByScalar(e,n,o),r=i.multiplyByScalar(t,1-n,r),i.add(o,r,r)};var u=new i;return i.mostOrthogonalAxis=function(t,e){var n=i.normalize(t,u);return i.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?i.clone(i.UNIT_X,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e):n.y<=n.z?n.y<=n.w?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e)},i.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},i.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r&&Math.abs(t.w-n.w)<=r},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(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e){return i.equalsEpsilon(this,t,e)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t){for(var e=0,n=0;9>n;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function u(t){for(var e=0,n=0;3>n;++n){var r=t[c.getElementIndex(d[n],h[n])];e+=2*r*r}return Math.sqrt(e)}function s(t,e){for(var n=a.EPSILON15,r=0,i=1,o=0;3>o;++o){var u=Math.abs(t[c.getElementIndex(d[o],h[o])]);u>r&&(i=o,r=u)}var s=1,l=0,f=h[i],m=d[i];if(Math.abs(t[c.getElementIndex(m,f)])>n){var y,p=t[c.getElementIndex(m,m)],v=t[c.getElementIndex(f,f)],w=t[c.getElementIndex(m,f)],x=(p-v)/2/w;y=0>x?-1/(-x+Math.sqrt(1+x*x)):1/(x+Math.sqrt(1+x*x)),s=1/Math.sqrt(1+y*y),l=y*s}return e=c.clone(c.IDENTITY,e),e[c.getElementIndex(f,f)]=e[c.getElementIndex(m,m)]=s,e[c.getElementIndex(m,f)]=l,e[c.getElementIndex(f,m)]=-l,e}var c=function(t,n,r,i,a,o,u,s,c){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(s,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(c,0)};c.clone=function(t,e){return n(t)?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 c(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},c.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new c),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},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[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 c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},c.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,u=t.y*t.y,s=t.y*t.z,l=t.y*t.w,f=t.z*t.z,h=t.z*t.w,d=t.w*t.w,m=r-u-f+d,y=2*(i-h),p=2*(a+l),v=2*(i+h),w=-r+u-f+d,x=2*(s-o),E=2*(a-l),g=2*(s+o),M=-r-u+f+d;return n(e)?(e[0]=m,e[1]=v,e[2]=E,e[3]=y,e[4]=w,e[5]=g,e[6]=p,e[7]=x,e[8]=M,e):new c(m,y,p,v,w,x,E,g,M)},c.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 c(t.x,0,0,0,t.y,0,0,0,t.z)},c.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 c(t,0,0,0,t,0,0,0,t)},c.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 c(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},c.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 c(1,0,0,0,r,-i,0,i,r)},c.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 c(r,0,i,0,1,0,-i,0,r)},c.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 c(r,-i,0,i,r,0,0,0,1)},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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},c.getElementIndex=function(t,e){return 3*t+e},c.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},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},c.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},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,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[3],e[4],e[5],l)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],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]*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],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],c=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],f=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]=s,n[6]=c,n[7]=l,n[8]=f,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},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},c.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,s=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=s,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},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},c.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],s=t[2],c=t[5],l=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=s,e[7]=c,e[8]=l,e};var h=[1,0,0],d=[2,2,1],m=new c,y=new c;return c.computeEigenDecomposition=function(t,e){var r=a.EPSILON20,i=10,l=0,f=0;n(e)||(e={});for(var h=e.unitary=c.clone(c.IDENTITY,e.unitary),d=e.diagonal=c.clone(t,e.diagonal),p=r*o(d);i>f&&u(d)>p;)s(d,m),c.transpose(m,y),c.multiply(d,m,d),c.multiply(y,d,d),c.multiply(h,m,h),++l>2&&(++f,l=0);return 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},c.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],s=t[5],c=t[8];return e*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},c.inverse=function(t,e){var n=t[0],i=t[1],o=t[2],u=t[3],s=t[4],l=t[5],f=t[6],h=t[7],d=t[8],m=c.determinant(t);if(Math.abs(m)<=a.EPSILON15)throw new r("matrix is not invertible");e[0]=s*d-h*l,e[1]=h*o-i*d,e[2]=i*l-s*o,e[3]=f*l-u*d,e[4]=n*d-f*o,e[5]=u*o-n*l,e[6]=u*h-f*s,e[7]=f*i-n*h,e[8]=n*s-u*i;var y=1/m;return c.multiplyByScalar(e,y,e)},c.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]},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},c.IDENTITY=i(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(t){"use strict";var e=function(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,s){"use strict";var c=function(t,e,r,i,a,o,u,s,c,l,f,h,d,m,y,p){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(e,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(m,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(y,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(p,0)};c.packedLength=16,c.pack=function(t,e,r){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]},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){return r(t)?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]):void 0},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,s=e.x*e.x,l=e.x*e.y,f=e.x*e.z,h=e.x*e.w,d=e.y*e.y,m=e.y*e.z,y=e.y*e.w,p=e.z*e.z,v=e.z*e.w,w=e.w*e.w,x=s-d-p+w,E=2*(l-v),g=2*(f+y),M=2*(l+v),S=-s+d-p+w,z=2*(m-h),O=2*(f-y),T=2*(m+h),N=-s-d+p+w;return i[0]=x*a,i[1]=M*a,i[2]=O*a,i[3]=0,i[4]=E*o,i[5]=S*o,i[6]=T*o,i[7]=0,i[8]=g*u,i[9]=z*u,i[10]=N*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},c.fromTranslation=function(t,e){return c.fromRotationTranslation(u.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 l=new t,f=new t,h=new t;c.fromCamera=function(e,n){var i=e.eye,a=e.target,o=e.up;t.normalize(t.subtract(a,i,l),l),t.normalize(t.cross(l,o,f),f),t.normalize(t.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,m=l.x,y=l.y,p=l.z,v=h.x,w=h.y,x=h.z,E=i.x,g=i.y,M=i.z,S=u*-E+s*-g+d*-M,z=v*-E+w*-g+x*-M,O=m*E+y*g+p*M;return r(n)?(n[0]=u,n[1]=v,n[2]=-m,n[3]=0,n[4]=s,n[5]=w,n[6]=-y,n[7]=0,n[8]=d,n[9]=x,n[10]=-p,n[11]=0,n[12]=S,n[13]=z,n[14]=O,n[15]=1,n):new c(u,s,d,S,v,w,x,z,-m,-y,-p,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,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},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),s=1/(r-n),c=1/(a-i),l=-(e+t)*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},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),s=2*i/(r-n),c=(e+t)/(e-t),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},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),s=(e+t)/(e-t),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},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),s=n(t.height,0);e=n(e,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-e),h=c,d=l,m=f,y=a+c,p=o+l,v=e+f,w=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]=m,i[11]=0,i[12]=y,i[13]=p,i[14]=v,i[15]=w,i},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.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 d=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],d)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],d)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],d)),n};var m=new t;c.getMaximumScale=function(e){return c.getScale(e,m),t.maximumComponent(m)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],s=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],m=t[11],y=t[12],p=t[13],v=t[14],w=t[15],x=e[0],E=e[1],g=e[2],M=e[3],S=e[4],z=e[5],O=e[6],T=e[7],N=e[8],_=e[9],I=e[10],R=e[11],b=e[12],A=e[13],P=e[14],C=e[15],L=r*x+u*E+f*g+y*M,U=i*x+s*E+h*g+p*M,q=a*x+c*E+d*g+v*M,D=o*x+l*E+m*g+w*M,B=r*S+u*z+f*O+y*T,F=i*S+s*z+h*O+p*T,W=a*S+c*z+d*O+v*T,G=o*S+l*z+m*O+w*T,V=r*N+u*_+f*I+y*R,Y=i*N+s*_+h*I+p*R,k=a*N+c*_+d*I+v*R,j=o*N+l*_+m*I+w*R,H=r*b+u*A+f*P+y*C,Z=i*b+s*A+h*P+p*C,X=a*b+c*A+d*P+v*C,K=o*b+l*A+m*P+w*C;return n[0]=L,n[1]=U,n[2]=q,n[3]=D,n[4]=B,n[5]=F,n[6]=W,n[7]=G,n[8]=V,n[9]=Y,n[10]=k,n[11]=j,n[12]=H,n[13]=Z,n[14]=X,n[15]=K,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],s=t[6],c=t[8],l=t[9],f=t[10],h=t[12],d=t[13],m=t[14],y=e[0],p=e[1],v=e[2],w=e[4],x=e[5],E=e[6],g=e[8],M=e[9],S=e[10],z=e[12],O=e[13],T=e[14],N=r*y+o*p+c*v,_=i*y+u*p+l*v,I=a*y+s*p+f*v,R=r*w+o*x+c*E,b=i*w+u*x+l*E,A=a*w+s*x+f*E,P=r*g+o*M+c*S,C=i*g+u*M+l*S,L=a*g+s*M+f*S,U=r*z+o*O+c*T+h,q=i*z+u*O+l*T+d,D=a*z+s*O+f*T+m;return n[0]=N,n[1]=_,n[2]=I,n[3]=0,n[4]=R,n[5]=b,n[6]=A,n[7]=0,n[8]=P,n[9]=C,n[10]=L,n[11]=0,n[12]=U,n[13]=q,n[14]=D,n[15]=1,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],s=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]=s,n[15]=t[15],n};var y=new t;c.multiplyByUniformScale=function(t,e,n){return y.x=e,y.y=e,y.z=e,c.multiplyByScale(t,y,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,s=t[1]*r+t[5]*i+t[9]*a+t[13]*o,c=t[2]*r+t[6]*i+t[10]*a+t[14]*o,l=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,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,s=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=s,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],s=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=s,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[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[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]},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 p=new u,v=new u,w=new e,x=new e(0,0,0,1);return c.inverse=function(t,n){if(u.equalsEpsilon(c.getRotation(t,p),v,o.EPSILON7)&&e.equals(c.getRow(t,3,w),x))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],l=t[12],f=t[1],h=t[5],d=t[9],m=t[13],y=t[2],E=t[6],g=t[10],M=t[14],S=t[3],z=t[7],O=t[11],T=t[15],N=g*T,_=M*O,I=E*T,R=M*z,b=E*O,A=g*z,P=y*T,C=M*S,L=y*O,U=g*S,q=y*z,D=E*S,B=N*h+R*d+b*m-(_*h+I*d+A*m),F=_*f+P*d+U*m-(N*f+C*d+L*m),W=I*f+C*h+q*m-(R*f+P*h+D*m),G=A*f+L*h+D*d-(b*f+U*h+q*d),V=_*i+I*a+A*l-(N*i+R*a+b*l),Y=N*r+C*a+L*l-(_*r+P*a+U*l),k=R*r+P*i+D*l-(I*r+C*i+q*l),j=b*r+U*i+q*a-(A*r+L*i+D*a);N=a*m,_=l*d,I=i*m,R=l*h,b=i*d,A=a*h,P=r*m,C=l*f,L=r*d,U=a*f,q=r*h,D=i*f;var H=N*z+R*O+b*T-(_*z+I*O+A*T),Z=_*S+P*O+U*T-(N*S+C*O+L*T),X=I*S+C*z+q*T-(R*S+P*z+D*T),K=A*S+L*z+D*O-(b*S+U*z+q*O),J=I*g+A*M+_*E-(b*M+N*E+R*g),Q=L*M+N*y+C*g-(P*g+U*M+_*y),$=P*E+D*M+R*y-(q*M+I*y+C*E),te=q*g+b*y+U*E-(L*E+D*g+A*y),ee=r*B+i*F+a*W+l*G;if(Math.abs(ee)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return ee=1/ee,n[0]=B*ee,n[1]=F*ee,n[2]=W*ee,n[3]=G*ee,n[4]=V*ee,n[5]=Y*ee,n[6]=k*ee,n[7]=j*ee,n[8]=H*ee,n[9]=Z*ee,n[10]=X*ee,n[11]=K*ee,n[12]=J*ee,n[13]=Q*ee,n[14]=$*ee,n[15]=te*ee,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],s=t[8],c=t[9],l=t[10],f=t[12],h=t[13],d=t[14],m=-n*f-r*h-i*d,y=-a*f-o*h-u*d,p=-s*f-c*h-l*d;return e[0]=n,e[1]=a,e[2]=s,e[3]=0,e[4]=r,e[5]=o,e[6]=c,e[7]=0,e[8]=i,e[9]=u,e[10]=l,e[11]=0,e[12]=m,e[13]=y,e[14]=p,e[15]=1,e},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";var u=function(t,n,r,i){this.west=e(t,0),this.south=e(n,0),this.east=e(r,0),this.north=e(i,0)};u.fromDegrees=function(t,r,i,a,s){return t=o.toRadians(e(t,0)),r=o.toRadians(e(r,0)),i=o.toRadians(e(i,0)),a=o.toRadians(e(a,0)),n(s)?(s.west=t,s.south=r,s.east=i,s.north=a,s):new u(t,r,i,a)},u.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=t.length;c>s;s++){var l=t[s];r=Math.min(r,l.longitude),i=Math.max(i,l.longitude),a=Math.min(a,l.latitude),o=Math.max(o,l.latitude)}return n(e)?(e.west=r,e.south=a,e.east=i,e.north=o,e):new u(r,a,i,o)},u.packedLength=4,u.pack=function(t,n,r){r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i.west=t[r++],i.south=t[r++],i.east=t[r++],i.north=t[r],i},u.clone=function(t,e){return n(t)?n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new u(t.west,t.south,t.east,t.north):void 0},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.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},u.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},u.validate=function(){},u.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)},u.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)},u.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)},u.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)},u.center=function(e,r){var i=e.east,a=e.west,u=.5*(a+i);return a>i&&(u=o.negativePiToPi(u+o.PI)),n(r)?(r.longitude=u,r.latitude=.5*(e.south+e.north),r.height=0,r):new t(u,.5*(e.south+e.north))},u.intersectWith=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),s=Math.min(t.north,e.north);return n(r)?(r.west=i,r.south=a,r.east=o,r.north=s,r):new u(i,a,o,s)},u.contains=function(t,e){return e.longitude>=t.west&&e.longitude<=t.east&&e.latitude>=t.south&&e.latitude<=t.north},u.isEmpty=function(t){return t.west>=t.east||t.south>=t.north};var s=new t;return u.subsample=function(t,r,a,u){r=e(r,i.WGS84),a=e(a,0),n(u)||(u=[]);var c=0,l=t.north,f=t.south,h=t.east,d=t.west,m=s;m.height=a,m.longitude=d,m.latitude=l,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:f>0?f:0;for(var y=1;8>y;++y){var p=-Math.PI+y*o.PI_OVER_TWO;p>d&&h>p&&(m.longitude=p,u[c]=r.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,s,c,l){"use strict";var f=function(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)},h=new t,d=new t,m=new t,y=new t,p=new t,v=new t,w=new t,x=new t,E=new t,g=new t,M=new t,S=new t;f.fromPoints=function(e,n){if(r(n)||(n=new f),!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],w),a=t.clone(i,h),o=t.clone(i,d),u=t.clone(i,m),s=t.clone(i,y),c=t.clone(i,p),l=t.clone(i,v),z=e.length,O=1;z>O;O++){t.clone(e[O],i);var T=i.x,N=i.y,_=i.z;T<a.x&&t.clone(i,a),T>s.x&&t.clone(i,s),N<o.y&&t.clone(i,o),N>c.y&&t.clone(i,c),_<u.z&&t.clone(i,u),_>l.z&&t.clone(i,l)}var I=t.magnitudeSquared(t.subtract(s,a,x)),R=t.magnitudeSquared(t.subtract(c,o,x)),b=t.magnitudeSquared(t.subtract(l,u,x)),A=a,P=s,C=I;R>C&&(C=R,A=o,P=c),b>C&&(C=b,A=u,P=l);var L=E;L.x=.5*(A.x+P.x),L.y=.5*(A.y+P.y),L.z=.5*(A.z+P.z);var U=t.magnitudeSquared(t.subtract(P,L,x)),q=Math.sqrt(U),D=g;D.x=a.x,D.y=o.y,D.z=u.z;var B=M;B.x=s.x,B.y=c.y,B.z=l.z;var F=t.multiplyByScalar(t.add(D,B,x),.5,S),W=0;for(O=0;z>O;O++){t.clone(e[O],i);var G=t.magnitude(t.subtract(i,F,x));G>W&&(W=G);var V=t.magnitudeSquared(t.subtract(i,L,x));if(V>U){var Y=Math.sqrt(V);q=.5*(q+Y),U=q*q;var k=Y-q;L.x=(q*L.x+k*i.x)/Y,L.y=(q*L.y+k*i.y)/Y,L.z=(q*L.z+k*i.z)/Y}}return W>q?(t.clone(L,n.center),n.radius=q):(t.clone(F,n.center),n.radius=W),n};var z=new o,O=new t,T=new t,N=new e,_=new e;f.fromRectangle2D=function(t,e,n){return f.fromRectangleWithHeights2D(t,e,0,0,n)},f.fromRectangleWithHeights2D=function(e,i,a,o,u){if(r(u)||(u=new f),!r(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;i=n(i,z),l.southwest(e,N),N.height=a,l.northeast(e,_),_.height=o;var s=i.project(N,O),c=i.project(_,T),h=c.x-s.x,d=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(h*h+d*d+m*m);var y=u.center;return y.x=s.x+.5*h,y.y=s.y+.5*d,y.z=s.z+.5*m,u};var I=[];f.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=l.subsample(t,e,i,I)),f.fromPoints(u,o)},f.fromVertices=function(e,i,a,o){if(r(o)||(o=new f),!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=w;u.x=e[0]+i.x,u.y=e[1]+i.y,u.z=e[2]+i.z;for(var s=t.clone(u,h),c=t.clone(u,d),l=t.clone(u,m),z=t.clone(u,y),O=t.clone(u,p),T=t.clone(u,v),N=e.length,_=0;N>_;_+=a){var I=e[_]+i.x,R=e[_+1]+i.y,b=e[_+2]+i.z;u.x=I,u.y=R,u.z=b,I<s.x&&t.clone(u,s),I>z.x&&t.clone(u,z),R<c.y&&t.clone(u,c),R>O.y&&t.clone(u,O),b<l.z&&t.clone(u,l),b>T.z&&t.clone(u,T)}var A=t.magnitudeSquared(t.subtract(z,s,x)),P=t.magnitudeSquared(t.subtract(O,c,x)),C=t.magnitudeSquared(t.subtract(T,l,x)),L=s,U=z,q=A;P>q&&(q=P,L=c,U=O),C>q&&(q=C,L=l,U=T);var D=E;D.x=.5*(L.x+U.x),D.y=.5*(L.y+U.y),D.z=.5*(L.z+U.z);var B=t.magnitudeSquared(t.subtract(U,D,x)),F=Math.sqrt(B),W=g;W.x=s.x,W.y=c.y,W.z=l.z;var G=M;G.x=z.x,G.y=O.y,G.z=T.z;var V=t.multiplyByScalar(t.add(W,G,x),.5,S),Y=0;for(_=0;N>_;_+=a){u.x=e[_]+i.x,u.y=e[_+1]+i.y,u.z=e[_+2]+i.z;var k=t.magnitude(t.subtract(u,V,x));k>Y&&(Y=k);var j=t.magnitudeSquared(t.subtract(u,D,x));if(j>B){var H=Math.sqrt(j);F=.5*(F+H),B=F*F;var Z=H-F;D.x=(F*D.x+Z*u.x)/H,D.y=(F*D.y+Z*u.y)/H,D.z=(F*D.z+Z*u.z)/H}}return Y>F?(t.clone(D,o.center),o.radius=F):(t.clone(V,o.center),o.radius=Y),o},f.fromCornerPoints=function(e,n,i){r(i)||(i=new f);var a=i.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),i.radius=t.distance(a,n),i},f.fromEllipsoid=function(e,n){return r(n)||(n=new f),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n},f.clone=function(e,n){return r(e)?r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new f(e.center,e.radius):void 0},f.packedLength=4,f.pack=function(t,e,r){r=n(r,0);var i=t.center;e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius},f.unpack=function(t,e,i){e=n(e,0),r(i)||(i=new f);var a=i.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],i.radius=t[e],i};var R=new t,b=new t;f.union=function(e,n,i){r(i)||(i=new f);var a=e.center,o=n.center;t.add(a,o,b);var u=t.multiplyByScalar(b,.5,b),s=t.magnitude(t.subtract(a,u,R))+e.radius,c=t.magnitude(t.subtract(o,u,R))+n.radius;return i.radius=Math.max(s,c),t.clone(u,i.center),i};var A=new t;f.expand=function(e,n,r){r=f.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,A));return i>r.radius&&(r.radius=i),r},f.intersect=function(e,n){var r=e.center,i=e.radius,a=t.dot(n,r)+n.w;return-i>a?u.OUTSIDE:i>a?u.INTERSECTING:u.INSIDE},f.transform=function(t,e,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var P=new t;f.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,P);return t.magnitudeSquared(r)-e.radius*e.radius},f.transformWithoutScale=function(t,e,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var C=new t;f.computePlaneDistances=function(e,n,i,a){r(a)||(a=new s);var o=t.subtract(e.center,n,C),u=t.multiplyByScalar(i,t.dot(i,o),C),c=t.magnitude(u);return a.start=c-e.radius,a.stop=c+e.radius,a};for(var L=new t,U=new t,q=new t,D=new t,B=new t,F=new e,W=new Array(8),G=0;8>G;++G)W[G]=new t;var V=new o;return f.projectTo2D=function(e,r,i){r=n(r,V);var a=r.ellipsoid,o=e.center,u=e.radius,s=a.geodeticSurfaceNormal(o,L),c=t.cross(t.UNIT_Z,s,U);t.normalize(c,c);var l=t.cross(s,c,q);t.normalize(l,l),t.multiplyByScalar(s,u,s),t.multiplyByScalar(l,u,l),t.multiplyByScalar(c,u,c);var h=t.negate(l,B),d=t.negate(c,D),m=W,y=m[0];t.add(s,l,y),t.add(y,c,y),y=m[1],t.add(s,l,y),t.add(y,d,y),y=m[2],t.add(s,h,y),t.add(y,d,y),y=m[3],t.add(s,h,y),t.add(y,c,y),t.negate(s,s),y=m[4],t.add(s,l,y),t.add(y,c,y),y=m[5],t.add(s,l,y),t.add(y,d,y),y=m[6],t.add(s,h,y),t.add(y,d,y),y=m[7],t.add(s,h,y),t.add(y,c,y);for(var p=m.length,v=0;p>v;++v){var w=m[v];t.add(o,w,w);var x=a.cartesianToCartographic(w,F);r.project(x,w)}i=f.fromPoints(m,i),o=i.center;var E=o.x,g=o.y,M=o.z;return o.x=M,o.y=E,o.z=g,i},f.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},f.prototype.intersect=function(t){return f.intersect(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/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(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){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n):new a(t.x,t.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r]=e.y},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.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.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.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 s=new a,c=new a;a.angleBetween=function(t,e){return a.normalize(t,s),a.normalize(e,c),i.acosClamped(a.dot(s,c))};var l=new a;return a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,l);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.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r},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){return a.equalsEpsilon(this,t,e)},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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof e[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",t(document[i])?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",t(document[i])&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",t(document[i])?r.fullscreenElement=i:(i=s+"FullScreenElement",t(document[i])&&(r.fullscreenElement=i)),i=s+"fullscreenchange",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t){i.supportsFullscreen()&&t[r.requestFullscreen]()},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;r>n;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(m)){m=!1;var t=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(m=!0,y=r(t[1]))}return m}function a(){return i()&&y}function o(){if(!e(p)&&(p=!1,!i()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(p=!0,v=r(t[1]))}return p}function u(){return o()&&v}function s(){if(!e(w)){w=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==t&&(w=!0,x=r(t[1]),x.isNightly=!!t[2])}return w}function c(){return s()&&x}function l(){if(!e(E)){E=!1;var t;"Microsoft Internet Explorer"===navigator.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(E=!0,g=r(t[1]))):"Netscape"===navigator.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(E=!0,g=r(t[1])))}return E}function f(){return l()&&g}function h(){if(!e(M)){M=!1;var t=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(M=!0,S=r(t[1]))}return M}function d(){return h()&&S}var m,y,p,v,w,x,E,g,M,S,z={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:d,hardwareConcurrency:t(navigator.hardwareConcurrency,3)};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,e,n,r,i){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(t){switch(t){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(t){return t instanceof Int8Array?a.BYTE:t instanceof Uint8Array?a.UNSIGNED_BYTE:t instanceof Int16Array?a.SHORT:t instanceof Uint16Array?a.UNSIGNED_SHORT:t instanceof Float32Array?a.FLOAT:t instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(t){return e(t)&&(t===a.BYTE||t===a.UNSIGNED_BYTE||t===a.SHORT||t===a.UNSIGNED_SHORT||t===a.FLOAT||t===a.DOUBLE)},a.createTypedArray=function(t,e){switch(t){case a.BYTE:return new Int8Array(e);case a.UNSIGNED_BYTE:return new Uint8Array(e);case a.SHORT:return new Int16Array(e);case a.UNSIGNED_SHORT:return new Uint16Array(e);case a.FLOAT:return new Float32Array(e);case a.DOUBLE:return new Float64Array(e);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(e,r,i,o){switch(i=t(i,0),o=t(o,(r.byteLength-i)/a.getSizeInBytes(e)),e){case a.BYTE:return new Int8Array(r,i,o);case a.UNSIGNED_BYTE:return new Uint8Array(r,i,o);case a.SHORT:return new Int16Array(r,i,o);case a.UNSIGNED_SHORT:return new Uint16Array(r,i,o);case a.FLOAT:return new Float32Array(r,i,o);case a.DOUBLE:return new Float64Array(r,i,o);default:throw new n("componentDatatype is not a valid value.")}},i(a)}),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"],function(t){"use strict";var e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(t){return t===e.POINTS||t===e.LINES||t===e.LINE_LOOP||t===e.LINE_STRIP||t===e.TRIANGLES||t===e.TRIANGLE_STRIP||t===e.TRIANGLE_FAN}};return t(e)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";var a=function(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)};return a.computeNumberOfVertices=function(t){var r=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&e(t.attributes[i])&&e(t.attributes[i].values)){var a=t.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t){"use strict";var e=function(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 e}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";var e=function(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"],function(t,e,n,r){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,i){return t>r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(i)}),define("Core/VertexFormat",["./defaultValue","./freezeObject"],function(t,e){"use strict";var n=function(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 n.POSITION_ONLY=e(new n({position:!0})),n.POSITION_AND_NORMAL=e(new n({position:!0,normal:!0})),n.POSITION_NORMAL_AND_ST=e(new n({position:!0,normal:!0,st:!0})),n.POSITION_AND_ST=e(new n({position:!0,st:!0})),n.POSITION_AND_COLOR=e(new n({position:!0,color:!0})),n.ALL=e(new n({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),n.DEFAULT=n.POSITION_NORMAL_AND_ST,n}),define("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(t,e,n,r,i,a,o,u,s,c,l,f,h,d){"use strict";var m=new n,y=new n,p=new n,v=new n,w=new n,x=new n(1,1,1),E=Math.cos,g=Math.sin,M=function(t){t=i(t,i.EMPTY_OBJECT);var e=i(t.radii,x),r=i(t.stackPartitions,64),a=i(t.slicePartitions,64),o=i(t.vertexFormat,d.DEFAULT);this._radii=n.clone(e),this._stackPartitions=r,this._slicePartitions=a,this._vertexFormat=o,this._workerName="createEllipsoidGeometry"};return M.createGeometry=function(i){var a,d,x=i._radii,M=o.fromCartesian3(x),S=i._vertexFormat,z=i._slicePartitions+1,O=i._stackPartitions+1,T=O*z,N=new Float64Array(3*T),_=6*(z-1)*(O-1),I=l.createTypedArray(T,_),R=S.normal?new Float32Array(3*T):void 0,b=S.tangent?new Float32Array(3*T):void 0,A=S.binormal?new Float32Array(3*T):void 0,P=S.st?new Float32Array(2*T):void 0,C=new Array(z),L=new Array(z),U=0;for(a=0;z>a;a++){var q=f.TWO_PI*a/(z-1);C[a]=E(q),L[a]=g(q),N[U++]=0,N[U++]=0,N[U++]=x.z}for(a=1;O-1>a;a++){var D=Math.PI*a/(O-1),B=g(D),F=x.x*B,W=x.y*B,G=x.z*E(D);for(d=0;z>d;d++)N[U++]=C[d]*F,N[U++]=L[d]*W,N[U++]=G}for(a=0;z>a;a++)N[U++]=0,N[U++]=0,N[U++]=-x.z;var V=new c;S.position&&(V.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:N}));var Y=0,k=0,j=0,H=0;if(S.st||S.normal||S.tangent||S.binormal){for(a=0;T>a;a++){var Z=n.fromArray(N,3*a,m),X=M.geodeticSurfaceNormal(Z,y);if(S.st){var K=e.negate(X,w);e.magnitude(K)<f.EPSILON6&&(U=3*(a+z*Math.floor(.5*O)),U>N.length&&(U=3*(a-z*Math.floor(.5*O))),n.fromArray(N,U,K),M.geodeticSurfaceNormal(K,K),e.negate(K,K)),P[Y++]=Math.atan2(K.y,K.x)/f.TWO_PI+.5,P[Y++]=Math.asin(X.z)/Math.PI+.5}if(S.normal&&(R[k++]=X.x,R[k++]=X.y,R[k++]=X.z),S.tangent||S.binormal){var J=p;if(z>a||a>T-z-1?(n.cross(n.UNIT_X,X,J),n.normalize(J,J)):(n.cross(n.UNIT_Z,X,J),n.normalize(J,J)),S.tangent&&(b[j++]=J.x,b[j++]=J.y,b[j++]=J.z),S.binormal){var Q=n.cross(X,J,v);n.normalize(Q,Q),A[H++]=Q.x,A[H++]=Q.y,A[H++]=Q.z}}}S.st&&(V.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:P})),S.normal&&(V.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R})),S.tangent&&(V.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:b})),S.binormal&&(V.binormal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:A}))}for(U=0,a=0;O>a;a++){var $=a*z,te=(a+1)*z;for(d=0;z-1>d;d++)I[U++]=te+d,I[U++]=te+d+1,I[U++]=$+d+1,I[U++]=te+d,I[U++]=$+d+1,I[U++]=$+d}return new u({attributes:V,indices:I,primitiveType:h.TRIANGLES,boundingSphere:t.fromEllipsoid(M)})},M}),define("Workers/createEllipsoidGeometry",["../Core/EllipsoidGeometry"],function(t){"use strict";return t.createGeometry})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==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(n){e=n.stack}this.stack=e}return 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("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:0>t?-1:0},i.signNotZero=function(t){return 0>t?-1:1},i.toSNorm=function(t){return Math.round(255*(.5*i.clamp(t,-1,1)+.5))},i.fromSNorm=function(t){return i.clamp(t,0,255)/255*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.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 i>=a||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;t>=r;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 e>t?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";function a(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}a.fromSpherical=function(n,r){e(r)||(r=new a);var i=n.clock,o=n.cone,u=t(n.magnitude,1),E=u*Math.sin(o);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(t,n,r,i){return e(i)?(i.x=t,i.y=n,i.z=r,i):new a(t,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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){a.normalize(t,E),a.normalize(e,s);var n=a.dot(E,s),r=a.magnitude(a.cross(E,s,E));return Math.atan2(r,n)};var c=new a;a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,c);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):n.y<=n.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},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)},a.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},a.fromDegrees=function(t,e,n,r,o){var u=i.toRadians(t),E=i.toRadians(e);return a.fromRadians(u,E,n,r,o)};var _=new a,l=new a,R=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=t(i,0);var E=e(o)?o.radiiSquared:R,s=Math.cos(r);_.x=s*Math.cos(n),_.y=s*Math.sin(n),_.z=Math.sin(r),_=a.normalize(_,_),a.multiplyComponents(E,_,l);var c=Math.sqrt(a.dot(_,l));return l=a.divideByScalar(l,c,l),_=a.multiplyByScalar(_,i,_),e(u)||(u=new a),a.add(l,_,u)},a.fromDegreesArray=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=i.toRadians(t[o]);return a.fromRadiansArray(r,e,n)},a.fromRadiansArray=function(t,n,r){var i=t.length;e(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],E=t[o+1];r[o/2]=a.fromRadians(u,E,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o+=3)r[o]=i.toRadians(t[o]),r[o+1]=i.toRadians(t[o+1]),r[o+2]=t[o+2];return a.fromRadiansArrayHeights(r,e,n)},a.fromRadiansArrayHeights=function(t,n,r){var i=t.length;e(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],E=t[o+1],s=t[o+2];r[o/3]=a.fromRadians(u,E,s,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(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+")"},a}),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,R=i.x,T=i.y,A=i.z,f=c*c*R*R,N=_*_*T*T,d=l*l*A*A,h=f+N+d,I=Math.sqrt(1/h),S=t.multiplyByScalar(n,I,a);if(E>h)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,x,D,B,g=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{g-=z,U=1/(1+g*m),L=1/(1+g*M),F=1/(1+g*O),P=U*U,v=L*L,w=F*F,x=P*U,D=v*L,B=w*F,p=f*P+N*v+d*w-1,C=f*x*m+N*D*M+d*B*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=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),R=a.EPSILON1;return u.fromCartesian=function(e,r,i){var T=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:l,f=n(r)?r._centerToleranceSquared:R,N=o(e,T,A,f,s);if(n(N)){var d=t.multiplyComponents(e,A,E);d=t.normalize(d,d);var h=t.subtract(e,N,c),I=Math.atan2(d.y,d.x),S=Math.asin(d.z),m=a.sign(t.dot(h,e))*t.magnitude(h);return n(i)?(i.longitude=I,i.latitude=S,i.height=m,i):new u(I,S,m)}},u.clone=function(t,e){return n(t)?n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height):void 0},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}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,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){i=n(i,0),t.pack(e._radii,r,i)},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;n>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var R=new t,T=new t,A=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,T);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;n>i;++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}),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","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(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 u(t){for(var e=0,n=0;9>n;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function E(t){for(var e=0,n=0;3>n;++n){var r=t[o.getElementIndex(R[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function s(t,e){for(var n=a.EPSILON15,r=0,i=1,u=0;3>u;++u){var E=Math.abs(t[o.getElementIndex(R[u],l[u])]);E>r&&(i=u,r=E)}var s=1,c=0,_=l[i],T=R[i];if(Math.abs(t[o.getElementIndex(T,_)])>n){var A,f=t[o.getElementIndex(T,T)],N=t[o.getElementIndex(_,_)],d=t[o.getElementIndex(T,_)],h=(f-N)/2/d;A=0>h?-1/(-h+Math.sqrt(1+h*h)):1/(h+Math.sqrt(1+h*h)),s=1/Math.sqrt(1+A*A),c=A*s}return e=o.clone(o.IDENTITY,e),e[o.getElementIndex(_,_)]=e[o.getElementIndex(T,T)]=s,e[o.getElementIndex(T,_)]=c,e[o.getElementIndex(_,T)]=-c,e}o.packedLength=9,o.pack=function(t,n,r){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]},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),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},o.clone=function(t,e){return n(t)?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 o(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},o.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new o),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},o.fromColumnMajorArray=function(t,e){return o.clone(t,e)},o.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 o(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},o.fromQuaternion=function(t,e){var r=t.x*t.x,i=t.x*t.y,a=t.x*t.z,u=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,R=t.w*t.w,T=r-E-_+R,A=2*(i-l),f=2*(a+c),N=2*(i+l),d=-r+E-_+R,h=2*(s-u),I=2*(a-c),S=2*(s+u),m=-r-E+_+R;return n(e)?(e[0]=T,e[1]=N,e[2]=I,e[3]=A,e[4]=d,e[5]=S,e[6]=f,e[7]=h,e[8]=m,e):new o(T,A,f,N,d,h,I,S,m)},o.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 o(t.x,0,0,0,t.y,0,0,0,t.z)},o.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 o(t,0,0,0,t,0,0,0,t)},o.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 o(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},o.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 o(1,0,0,0,r,-i,0,i,r)},o.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 o(r,0,i,0,1,0,-i,0,r)},o.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 o(r,-i,0,i,r,0,0,0,1)},o.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]]},o.getElementIndex=function(t,e){return 3*t+e},o.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},o.setColumn=function(t,e,n,r){r=o.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},o.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},o.setRow=function(t,e,n,r){return r=o.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var c=new t;o.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],c)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],c)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],c)),n};var _=new t;o.getMaximumScale=function(e){return o.getScale(e,_),t.maximumComponent(_)},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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],T=new o,A=new o;return o.computeEigenDecomposition=function(t,e){var r=a.EPSILON20,i=10,c=0,_=0;n(e)||(e={});for(var l=e.unitary=o.clone(o.IDENTITY,e.unitary),R=e.diagonal=o.clone(t,e.diagonal),f=r*u(R);i>_&&E(R)>f;)s(R,T),o.transpose(T,A),o.multiply(R,T,R),o.multiply(A,R,R),o.multiply(l,T,l),++c>2&&(++_,c=0);return e},o.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},o.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)},o.inverse=function(t,e){var n=t[0],i=t[1],u=t[2],E=t[3],s=t[4],c=t[5],_=t[6],l=t[7],R=t[8],T=o.determinant(t);if(Math.abs(T)<=a.EPSILON15)throw new r("matrix is not invertible");e[0]=s*R-l*c,e[1]=l*u-i*R,e[2]=i*c-s*u,e[3]=_*c-E*R,e[4]=n*R-_*u,e[5]=E*u-n*c,e[6]=E*l-_*s,e[7]=_*i-n*l,e[8]=n*s-E*i;var A=1/T;return o.multiplyByScalar(e,A,e)},o.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]},o.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},o.IDENTITY=i(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=i(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.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]},o.prototype.equalsEpsilon=function(t,e){return o.equalsEpsilon(this,t,e)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return e(t)?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):void 0},a.packedLength=4,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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.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.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(n){e=n.stack}this.stack=e}return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(t,e,r,i,a,o,u,E,s,c,_,l,R,T,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(T,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(l,0),this[15]=n(f,0)}s.packedLength=16,s.pack=function(t,e,r){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]},s.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new s),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},s.clone=function(t,e){return r(t)?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 s(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]):void 0},s.fromArray=s.unpack,s.fromColumnMajorArray=function(t,e){return s.clone(t,e)},s.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 s(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])},s.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 s(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)},s.fromTranslationQuaternionRotationScale=function(t,e,n,i){r(i)||(i=new s);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,c=e.x*e.y,_=e.x*e.z,l=e.x*e.w,R=e.y*e.y,T=e.y*e.z,A=e.y*e.w,f=e.z*e.z,N=e.z*e.w,d=e.w*e.w,h=E-R-f+d,I=2*(c-N),S=2*(_+A),m=2*(c+N),M=-E+R-f+d,O=2*(T-l),y=2*(_-A),p=2*(T+l),C=-E-R+f+d;return i[0]=h*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},s.fromTranslationRotationScale=function(t,e){return s.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},s.fromTranslation=function(t,e){return s.fromRotationTranslation(u.IDENTITY,t,e)},s.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 s(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},s.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 s(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var c=new t,_=new t,l=new t;s.fromCamera=function(e,n){var i=e.eye,a=e.target,o=e.up;t.normalize(t.subtract(a,i,c),c),t.normalize(t.cross(c,o,_),_),t.normalize(t.cross(_,c,l),l);var u=_.x,E=_.y,R=_.z,T=c.x,A=c.y,f=c.z,N=l.x,d=l.y,h=l.z,I=i.x,S=i.y,m=i.z,M=u*-I+E*-S+R*-m,O=N*-I+d*-S+h*-m,y=T*I+A*S+f*m; +return r(n)?(n[0]=u,n[1]=N,n[2]=-T,n[3]=0,n[4]=E,n[5]=d,n[6]=-A,n[7]=0,n[8]=R,n[9]=h,n[10]=-f,n[11]=0,n[12]=M,n[13]=O,n[14]=y,n[15]=1,n):new s(u,E,R,M,N,d,h,O,-T,-A,-f,y,0,0,0,1)},s.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},s.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},s.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,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]=l,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},s.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},s.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,R=c,T=_,A=a+s,f=o+c,N=e+_,d=1;return i[0]=l,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]=T,i[11]=0,i[12]=A,i[13]=f,i[14]=N,i[15]=d,i},s.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]]},s.getElementIndex=function(t,e){return 4*t+e},s.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},s.setColumn=function(t,e,n,r){r=s.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},s.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},s.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},s.setRow=function(t,e,n,r){return r=s.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;s.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 T=new t;s.getMaximumScale=function(e){return s.getScale(e,T),t.maximumComponent(T)},s.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],R=t[10],T=t[11],A=t[12],f=t[13],N=t[14],d=t[15],h=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],x=e[15],D=r*h+u*I+_*S+A*m,B=i*h+E*I+l*S+f*m,g=a*h+s*I+R*S+N*m,z=o*h+c*I+T*S+d*m,G=r*M+u*O+_*y+A*p,b=i*M+E*O+l*y+f*p,X=a*M+s*O+R*y+N*p,V=o*M+c*O+T*y+d*p,q=r*C+u*U+_*L+A*F,H=i*C+E*U+l*L+f*F,W=a*C+s*U+R*L+N*F,Y=o*C+c*U+T*L+d*F,K=r*P+u*v+_*w+A*x,k=i*P+E*v+l*w+f*x,Z=a*P+s*v+R*w+N*x,j=o*P+c*v+T*w+d*x;return n[0]=D,n[1]=B,n[2]=g,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},s.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},s.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},s.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],R=t[13],T=t[14],A=e[0],f=e[1],N=e[2],d=e[4],h=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*A+o*f+s*N,U=i*A+u*f+c*N,L=a*A+E*f+_*N,F=r*d+o*h+s*I,P=i*d+u*h+c*I,v=a*d+E*h+_*I,w=r*S+o*m+s*M,x=i*S+u*m+c*M,D=a*S+E*m+_*M,B=r*O+o*y+s*p+l,g=i*O+u*y+c*p+R,z=a*O+E*y+_*p+T;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]=D,n[11]=0,n[12]=B,n[13]=g,n[14]=z,n[15]=1,n},s.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],R=e[1],T=e[2],A=e[3],f=e[4],N=e[5],d=e[6],h=e[7],I=e[8],S=r*l+o*R+s*T,m=i*l+u*R+c*T,M=a*l+E*R+_*T,O=r*A+o*f+s*N,y=i*A+u*f+c*N,p=a*A+E*f+_*N,C=r*d+o*h+s*I,U=i*d+u*h+c*I,L=a*d+E*h+_*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},s.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;s.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,s.multiplyByScale(t,A,n)},s.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?s.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)},s.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},s.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},s.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},s.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},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[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},s.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},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[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},s.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]},s.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},s.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},s.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 f=new u,N=new u,d=new e,h=new e(0,0,0,1);return s.inverse=function(t,n){if(u.equalsEpsilon(s.getRotation(t,f),N,o.EPSILON7)&&e.equals(s.getRow(t,3,d),h))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],c=t[12],_=t[1],l=t[5],R=t[9],T=t[13],A=t[2],I=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=I*p,F=m*O,P=I*y,v=S*O,w=A*p,x=m*M,D=A*y,B=S*M,g=A*O,z=I*M,G=C*l+F*R+P*T-(U*l+L*R+v*T),b=U*_+w*R+B*T-(C*_+x*R+D*T),X=L*_+x*l+g*T-(F*_+w*l+z*T),V=v*_+D*l+z*R-(P*_+B*l+g*R),q=U*i+L*a+v*c-(C*i+F*a+P*c),H=C*r+x*a+D*c-(U*r+w*a+B*c),W=F*r+w*i+z*c-(L*r+x*i+g*c),Y=P*r+B*i+g*a-(v*r+D*i+z*a);C=a*T,U=c*R,L=i*T,F=c*l,P=i*R,v=a*l,w=r*T,x=c*_,D=r*R,B=a*_,g=r*l,z=i*_;var K=C*O+F*y+P*p-(U*O+L*y+v*p),k=U*M+w*y+B*p-(C*M+x*y+D*p),Z=L*M+x*O+g*p-(F*M+w*O+z*p),j=v*M+D*O+z*y-(P*M+B*O+g*y),Q=L*S+v*m+U*I-(P*m+C*I+F*S),J=D*m+C*A+x*S-(w*S+B*m+U*A),$=w*I+z*m+F*A-(g*m+L*A+x*I),tt=g*S+P*A+B*I-(D*I+z*S+v*A),et=r*G+i*b+a*X+c*V;if(Math.abs(et)<o.EPSILON20)throw new E("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},s.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],R=t[14],T=-n*_-r*l-i*R,A=-a*_-o*l-u*R,f=-E*_-s*l-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]=T,e[13]=A,e[14]=f,e[15]=1,e},s.IDENTITY=a(new s(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),s.ZERO=a(new s(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN0ROW3=3,s.COLUMN1ROW0=4,s.COLUMN1ROW1=5,s.COLUMN1ROW2=6,s.COLUMN1ROW3=7,s.COLUMN2ROW0=8,s.COLUMN2ROW1=9,s.COLUMN2ROW2=10,s.COLUMN2ROW3=11,s.COLUMN3ROW0=12,s.COLUMN3ROW1=13,s.COLUMN3ROW2=14,s.COLUMN3ROW3=15,s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.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]},s.prototype.equalsEpsilon=function(t,e){return s.equalsEpsilon(this,t,e)},s.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},s}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function i(e,n){this.normal=t.clone(e),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-t.dot(r,n);return e(a)?(t.clone(r,a.normal),a.distance=o,a):new i(r,o)};var a=new t;return i.fromCartesian4=function(n,r){var o=t.fromCartesian4(n,a),u=n.w;return e(r)?(t.clone(o,r.normal),r.distance=u,r):new i(o,u)},i.getPointDistance=function(e,n){return t.dot(e.normal,n)+e.distance},i.ORIGIN_XY_PLANE=r(new i(t.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=r(new i(t.UNIT_X,0)),i.ORIGIN_ZX_PLANE=r(new i(t.UNIT_Y,0)),i}),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){r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north},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 n>e&&(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 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 T=R.longitude>=0?R.longitude:R.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(e)?(e.west=r,e.south=s,e.east=i,e.north=c,e):new E(r,s,i,c)},E.clone=function(t,e){return n(t)?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):void 0},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;a>i&&(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;a>i&&o>0?i+=u.TWO_PI:s>o&&i>0&&(o+=u.TWO_PI),a>i&&0>s?s+=u.TWO_PI:s>o&&0>a&&(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),R=Math.min(t.north,e.north);if(!(l>=R))return n(r)?(r.west=c,r.south=l,r.east=_,r.north=R,r):new E(c,l,_,R)}},E.union=function(t,e,r){return n(r)||(r=new E),r.west=Math.min(t.west,e.west),r.south=Math.min(t.south,e.south),r.east=Math.max(t.east,e.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 i>a&&(a+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(a>n||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,R=t.east,T=t.west,A=s;A.height=i,A.longitude=T,A.latitude=_,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.latitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=T,o[c]=r.cartographicToCartesian(A,o[c]),c++,0>_?A.latitude=_:l>0?A.latitude=l:A.latitude=0;for(var f=1;8>f;++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=T,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","./Plane","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_,l){"use strict";function R(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var T=new t,A=new t,f=new t,N=new t,d=new t,h=new t,I=new t,S=new t,m=new t,M=new t,O=new t,y=new t;R.fromPoints=function(e,n){if(r(n)||(n=new R),!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],I),a=t.clone(i,T),o=t.clone(i,A),u=t.clone(i,f),E=t.clone(i,N),s=t.clone(i,d),c=t.clone(i,h),_=e.length,l=1;_>l;l++){t.clone(e[l],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,S)),F=t.magnitudeSquared(t.subtract(s,o,S)),P=t.magnitudeSquared(t.subtract(c,u,S)),v=a,w=E,x=L;F>x&&(x=F,v=o,w=s),P>x&&(x=P,v=u,w=c);var D=m;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,S)),g=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,S),.5,y),X=0;for(l=0;_>l;l++){t.clone(e[l],i);var V=t.magnitude(t.subtract(i,b,S));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(i,D,S));if(q>B){var H=Math.sqrt(q);g=.5*(g+H),B=g*g;var W=H-g;D.x=(g*D.x+W*i.x)/H,D.y=(g*D.y+W*i.y)/H,D.z=(g*D.z+W*i.z)/H}}return X>g?(t.clone(D,n.center),n.radius=g):(t.clone(b,n.center),n.radius=X),n};var p=new o,C=new t,U=new t,L=new e,F=new e;R.fromRectangle2D=function(t,e,n){return R.fromRectangleWithHeights2D(t,e,0,0,n)},R.fromRectangleWithHeights2D=function(e,i,a,o,u){if(r(u)||(u=new R),!r(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;i=n(i,p),l.southwest(e,L),L.height=a,l.northeast(e,F),F.height=o;var E=i.project(L,C),s=i.project(F,U),c=s.x-E.x,_=s.y-E.y,T=s.z-E.z;u.radius=.5*Math.sqrt(c*c+_*_+T*T);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*_,A.z=E.z+.5*T,u};var P=[];R.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=l.subsample(t,e,i,P)),R.fromPoints(u,o)},R.fromVertices=function(e,i,a,o){if(r(o)||(o=new R),!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=I;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,A),c=t.clone(u,f),_=t.clone(u,N),l=t.clone(u,d),p=t.clone(u,h),C=e.length,U=0;C>U;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>l.y&&t.clone(u,l),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var v=t.magnitudeSquared(t.subtract(_,E,S)),w=t.magnitudeSquared(t.subtract(l,s,S)),x=t.magnitudeSquared(t.subtract(p,c,S)),D=E,B=_,g=v;w>g&&(g=w,D=s,B=l),x>g&&(g=x,D=c,B=p);var z=m;z.x=.5*(D.x+B.x),z.y=.5*(D.y+B.y),z.z=.5*(D.z+B.z);var G=t.magnitudeSquared(t.subtract(B,z,S)),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=l.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,S),.5,y),H=0;for(U=0;C>U;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,S));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,S));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 H>b?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},R.fromEncodedCartesianVertices=function(e,n,i){if(r(i)||(i=new R),!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=I;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,A),E=t.clone(a,f),s=t.clone(a,N),c=t.clone(a,d),_=t.clone(a,h),l=e.length,p=0;l>p;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,S)),P=t.magnitudeSquared(t.subtract(c,u,S)),v=t.magnitudeSquared(t.subtract(_,E,S)),w=o,x=s,D=F;P>D&&(D=P,w=u,x=c),v>D&&(D=v,w=E,x=_);var B=m;B.x=.5*(w.x+x.x),B.y=.5*(w.y+x.y),B.z=.5*(w.z+x.z);var g=t.magnitudeSquared(t.subtract(x,B,S)),z=Math.sqrt(g),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,S),.5,y),V=0;for(p=0;l>p;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,S));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(a,B,S));if(H>g){var W=Math.sqrt(H);z=.5*(z+W),g=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 V>z?(t.clone(B,i.center),i.radius=z):(t.clone(X,i.center),i.radius=V),i},R.fromCornerPoints=function(e,n,i){r(i)||(i=new R);var a=i.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),i.radius=t.distance(a,n),i},R.fromEllipsoid=function(e,n){return r(n)||(n=new R),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var v=new t;R.fromBoundingSpheres=function(e,n){if(r(n)||(n=new R),!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 R.clone(e[0],n);if(2===i)return R.union(e[0],e[1],n);for(var a=[],o=0;i>o;o++)a.push(e[o].center);n=R.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;i>o;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,v)+s.radius)}return n.radius=E,n};var w=new t,x=new t,D=new t;R.fromOrientedBoundingBox=function(e,n){r(n)||(n=new R);var i=e.halfAxes,a=s.getColumn(i,0,w),o=s.getColumn(i,1,x),u=s.getColumn(i,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},R.clone=function(e,n){return r(e)?r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new R(e.center,e.radius):void 0},R.packedLength=4,R.pack=function(t,e,r){r=n(r,0);var i=t.center;e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius},R.unpack=function(t,e,i){e=n(e,0),r(i)||(i=new R);var a=i.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],i.radius=t[e],i};var B=new t,g=new t;R.union=function(e,n,i){r(i)||(i=new R);var a=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,a,B),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,g);return t.add(l,a,l),t.clone(l,i.center),i.radius=_,i};var z=new t;R.expand=function(e,n,r){r=R.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,z));return i>r.radius&&(r.radius=i),r},R.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return-i>o?u.OUTSIDE:i>o?u.INTERSECTING:u.INSIDE},R.transform=function(t,e,n){return r(n)||(n=new R),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var G=new t;R.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,G);return t.magnitudeSquared(r)-e.radius*e.radius},R.transformWithoutScale=function(t,e,n){return r(n)||(n=new R),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var b=new t;R.computePlaneDistances=function(e,n,i,a){r(a)||(a=new E);var o=t.subtract(e.center,n,b),u=t.dot(i,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var X=new t,V=new t,q=new t,H=new t,W=new t,Y=new e,K=new Array(8),k=0;8>k;++k)K[k]=new t;var Z=new o;return R.projectTo2D=function(e,r,i){r=n(r,Z);var a=r.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,X),s=t.cross(t.UNIT_Z,E,V);t.normalize(s,s);var c=t.cross(E,s,q);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,W),l=t.negate(s,H),T=K,A=T[0];t.add(E,c,A),t.add(A,s,A),A=T[1],t.add(E,c,A),t.add(A,l,A),A=T[2],t.add(E,_,A),t.add(A,l,A),A=T[3],t.add(E,_,A),t.add(A,s,A),t.negate(E,E),A=T[4],t.add(E,c,A),t.add(A,s,A),A=T[5],t.add(E,c,A),t.add(A,l,A),A=T[6],t.add(E,_,A),t.add(A,l,A),A=T[7],t.add(E,_,A),t.add(A,s,A);for(var f=T.length,N=0;f>N;++N){var d=T[N];t.add(o,d,d);var h=a.cartesianToCartographic(d,Y);r.project(h,d)}i=R.fromPoints(T,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},R.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},R.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},R.prototype.intersectPlane=function(t){return R.intersectPlane(this,t)},R.prototype.distanceSquaredTo=function(t){return R.distanceSquaredTo(this,t)},R.prototype.computePlaneDistances=function(t,e,n){return R.computePlaneDistances(this,t,e,n)},R.prototype.isOccluded=function(t){return R.isOccluded(this,t)},R.prototype.equals=function(t){return R.equals(this,t)},R.prototype.clone=function(t){return R.clone(this,t)},R}),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){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n):new a(t.x,t.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r]=e.y},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.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.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("Renderer/WebGLConstants",["../Core/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/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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++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",t(document[i])?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",t(document[i])&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",t(document[i])?r.fullscreenElement=i:(i=E+"FullScreenElement",t(document[i])&&(r.fullscreenElement=i)),i=E+"fullscreenchange",t(document["on"+i])&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",t(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;r>n;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(h)){h=!1;var t=/ Chrome\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(h=!0,I=r(t[1]))}return h}function a(){return i()&&I}function o(){if(!e(S)&&(S=!1,!i()&&/ Safari\/[\.0-9]+/.test(d.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(S=!0,m=r(t[1]))}return S}function u(){return o()&&m}function E(){if(!e(M)){M=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(d.userAgent);null!==t&&(M=!0,O=r(t[1]),O.isNightly=!!t[2])}return M}function s(){return E()&&O}function c(){if(!e(y)){y=!1;var t;"Microsoft Internet Explorer"===d.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(d.userAgent),null!==t&&(y=!0,p=r(t[1]))):"Netscape"===d.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(d.userAgent),null!==t&&(y=!0,p=r(t[1])))}return y}function _(){return c()&&p}function l(){if(!e(C)){C=!1;var t=/Firefox\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(C=!0,U=r(t[1]))}return C}function R(){return e(L)||(L=/Windows/i.test(d.appVersion)),L}function T(){return l()&&U}function A(){return e(F)||(F="undefined"!=typeof PointerEvent&&(!e(d.pointerEnabled)||d.pointerEnabled)),F}function f(){if(!e(v)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;v=e(n)&&""!==n,v&&(P=n)}return v}function N(){return f()?P:void 0}var d;d="undefined"!=typeof navigator?navigator:{};var h,I,S,m,M,O,y,p,C,U,L,F,P,v,w={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isFirefox:l,firefoxVersion:T,isWindows:R,hardwareConcurrency:t(d.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:f,imageRenderingValue:N};return w.supportsFullscreen=function(){return n.supportsFullscreen()},w.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},w.supportsWebWorkers=function(){return"undefined"!=typeof Worker},w}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,e,n,r,i,a){"use strict";if(!i.supportsTypedArrays())return{};var o={BYTE:t.BYTE,UNSIGNED_BYTE:t.UNSIGNED_BYTE,SHORT:t.SHORT,UNSIGNED_SHORT:t.UNSIGNED_SHORT,FLOAT:t.FLOAT,DOUBLE:t.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},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 Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return n(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||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.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(t,n,i,a){switch(i=e(i,0),a=e(a,(n.byteLength-i)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,i,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,i,a);case o.SHORT:return new Int16Array(n,i,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,i,a);case o.FLOAT:return new Float32Array(n,i,a);case o.DOUBLE:return new Float64Array(n,i,a);default:throw new r("componentDatatype is not a valid value.")}},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",["../Renderer/WebGLConstants","./freezeObject"],function(t,e){"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(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 e(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=void 0}return a.computeNumberOfVertices=function(t){var r=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&e(t.attributes[i])&&e(t.attributes[i].values)){var a=t.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a={UNSIGNED_BYTE:t.UNSIGNED_BYTE,UNSIGNED_SHORT:t.UNSIGNED_SHORT,UNSIGNED_INT:t.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(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,n,r){return t>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,r):new Uint16Array(e,n,r)},r(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){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},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){return e(t)?(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):void 0},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,R,T){"use strict";function A(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,T.DEFAULT);this._radii=n.clone(e),this._stackPartitions=r,this._slicePartitions=a,this._vertexFormat=T.clone(o),this._workerName="createEllipsoidGeometry"}var f=new n,N=new n,d=new n,h=new n,I=new n,S=new n(1,1,1),m=Math.cos,M=Math.sin;A.packedLength=n.packedLength+T.packedLength+2,A.pack=function(t,e,r){r=i(r,0),n.pack(t._radii,e,r),r+=n.packedLength,T.pack(t._vertexFormat,e,r),r+=T.packedLength,e[r++]=t._stackPartitions,e[r]=t._slicePartitions};var O=new n,y=new T,p={radii:O,vertexFormat:y,stackPartitions:void 0,slicePartitions:void 0};return A.unpack=function(t,e,r){e=i(e,0);var o=n.unpack(t,e,O);e+=n.packedLength;var u=T.unpack(t,e,y);e+=T.packedLength;var E=t[e++],s=t[e];return a(r)?(r._radii=n.clone(o,r._radii),r._vertexFormat=T.clone(u,r._vertexFormat),r._stackPartitions=E,r._slicePartitions=s,r):(p.stackPartitions=E,p.slicePartitions=s,new A(p))},A.createGeometry=function(i){var a,o,T=i._radii,A=u.fromCartesian3(T),S=i._vertexFormat,O=i._slicePartitions+1,y=i._stackPartitions+1,p=y*O,C=new Float64Array(3*p),U=6*(O-1)*(y-1),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(O),D=new Array(O),B=0;for(a=0;O>a;a++){var g=l.TWO_PI*a/(O-1);x[a]=m(g),D[a]=M(g),C[B++]=0,C[B++]=0,C[B++]=T.z}for(a=1;y-1>a;a++){var z=Math.PI*a/(y-1),G=M(z),b=T.x*G,X=T.y*G,V=T.z*m(z);for(o=0;O>o;o++)C[B++]=x[o]*b,C[B++]=D[o]*X,C[B++]=V}for(a=0;O>a;a++)C[B++]=0,C[B++]=0,C[B++]=-T.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(a=0;p>a;a++){var k=n.fromArray(C,3*a,f),Z=A.geodeticSurfaceNormal(k,N);if(S.st){var j=e.negate(Z,I);e.magnitude(j)<l.EPSILON6&&(B=3*(a+O*Math.floor(.5*y)),B>C.length&&(B=3*(a-O*Math.floor(.5*y))),n.fromArray(C,B,j),A.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=d;if(O>a||a>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,h);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(B=0,a=0;y>a;a++){var $=a*O,tt=(a+1)*O;for(o=0;O-1>o;o++)L[B++]=tt+o,L[B++]=tt+o+1,L[B++]=$+o+1,L[B++]=tt+o,L[B++]=$+o+1,L[B++]=$+o}return new E({attributes:q,indices:L,primitiveType:R.TRIANGLES,boundingSphere:t.fromEllipsoid(A)})},A}),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/Workers/createEllipsoidOutlineGeometry.js b/Workers/createEllipsoidOutlineGeometry.js index e350d37..34ed9bd 100644 --- a/Workers/createEllipsoidOutlineGeometry.js +++ b/Workers/createEllipsoidOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,5 +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";var t=function(t){return void 0!==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";var e=function(t,e){return void 0!==t?t:e};return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";var e=function(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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("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^=2636928640&t<<7,t^=4022730752&t<<15,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){"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(t){return t>0?1:0>t?-1:0},n.signNotZero=function(t){return 0>t?-1:1},n.toSNorm=function(t){return Math.round(255*(.5*n.clamp(t,-1,1)+.5))},n.fromSNorm=function(t){return 2*(n.clamp(t,0,255)/255)-1},n.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},n.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},n.lerp=function(t,e,n){return(1-n)*t+n*e},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(t){return t*n.RADIANS_PER_DEGREE},n.toDegrees=function(t){return t*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(t){var e=n.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},n.negativePiToPi=function(t){for(var e=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+e)>t;)t+=i;if(-r>t)return-r;for(;t>r+e;)t-=i;return t>r?r:t},n.zeroToTwoPi=function(t){var e=t%n.TWO_PI;return 0>e?(e+n.TWO_PI)%n.TWO_PI:e},n.equalsEpsilon=function(t,n,r){return r=e(r,0),Math.abs(t-n)<=r};var r=[1];n.factorial=function(t){var e=r.length;if(t>=e)for(var n=r[e-1],i=e;t>=i;i++)r.push(n*i);return r[t]},n.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},n.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},n.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},n.clamp=function(t,e,n){return e>t?e:t>n?n:t};var i=new t;return n.setRandomNumberSeed=function(e){i=new t(e)},n.nextRandomNumber=function(){return i.random()},n.acosClamped=function(t){return Math.acos(n.clamp(t,-1,1))},n.asinClamped=function(t){return Math.asin(n.clamp(t,-1,1))},n}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)};a.fromSpherical=function(n,r){e(r)||(r=new a);var i=n.clock,o=n.cone,u=t(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(t,n,r,i){return e(i)?(i.x=t,i.y=n,i.z=r,i):new a(t,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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.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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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 s=new a,c=new a;a.angleBetween=function(t,e){a.normalize(t,s),a.normalize(e,c);var n=a.dot(s,c),r=a.magnitude(a.cross(s,c,s));return Math.atan2(r,n)};var l=new a;a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,l);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):n.y<=n.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r},a.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,s=e.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},a.fromDegrees=function(t,e,n,r,o){var u=i.toRadians(t),s=i.toRadians(e);return a.fromRadians(u,s,n,r,o)};var f=new a,h=new a,d=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=t(i,0);var s=e(o)?o.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=a.normalize(f,f),a.multiplyComponents(s,f,h);var l=Math.sqrt(a.dot(f,h));return h=a.divideByScalar(h,l,h),f=a.multiplyByScalar(f,i,f),e(u)||(u=new a),a.add(h,f,u)},a.fromDegreesArray=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=i.toRadians(t[o]);return a.fromRadiansArray(r,e,n)},a.fromRadiansArray=function(t,n,r){var i=t.length;e(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],s=t[o+1];r[o/2]=a.fromRadians(u,s,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o+=3)r[o]=i.toRadians(t[o]),r[o+1]=i.toRadians(t[o+1]),r[o+2]=t[o+2];return a.fromRadiansArrayHeights(r,e,n)},a.fromRadiansArrayHeights=function(t,n,r){var i=t.length;e(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],s=t[o+1],c=t[o+2];r[o/3]=a.fromRadians(u,s,c,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)};return a.fromRadians=function(n,r,i,o){return i=t(i,0),e(o)?(o.longitude=n,o.latitude=r,o.height=i,o):new a(n,r,i)},a.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),a.fromRadians(t,e,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new a(t.longitude,t.latitude,t.height):void 0},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.longitude-n.longitude)<=r&&Math.abs(t.latitude-n.latitude)<=r&&Math.abs(t.height-n.height)<=r},a.ZERO=r(new a(0,0,0)),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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),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"],function(t,e,n,r,i,a,o,u){"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}var c=function(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,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))return void 0;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.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),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=s,n.z=c,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 l=new t,f=new t;c.prototype.cartographicToCartesian=function(e,n){var i=l,a=f;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;n>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var h=new t,d=new t,m=new t;c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,d);if(!r(a))return void 0;var o=this.geodeticSurfaceNormal(a,h),s=t.subtract(n,a,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(t.dot(s,n))*t.magnitude(s);return r(i)?(i.longitude=c,i.latitude=l,i.height=f,i):new e(c,l,f)},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;n>i;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e};var y=new t,p=new t;return c.prototype.scaleToGeodeticSurface=function(e,n){var i=e.x,a=e.y,o=e.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,h=i*i*c*c,d=a*a*l*l,m=o*o*f*f,v=h+d+m,E=Math.sqrt(1/v),w=t.multiplyByScalar(e,E,y);if(v<this._centerToleranceSquared)return isFinite(E)?t.clone(w,n):void 0;var g=this._oneOverRadiiSquared,x=g.x,M=g.y,S=g.z,z=p;z.x=2*w.x*x,z.y=2*w.y*M,z.z=2*w.z*S;var O,T,_,N,R,I,b,A,P,C,L,U=(1-E)*t.magnitude(e)/(.5*t.magnitude(z)),q=0;do{U-=q,_=1/(1+U*x),N=1/(1+U*M),R=1/(1+U*S),I=_*_,b=N*N,A=R*R,P=I*_,C=b*N,L=A*R,O=h*I+d*b+m*A-1,T=h*P*x+d*C*M+m*L*S;var D=-2*T;q=O/D}while(Math.abs(O)>u.EPSILON12);return r(n)?(n.x=i*_,n.y=a*N,n.z=o*R,n):new t(i*_,a*N,o*R)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,s,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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";var u=function(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";var e=function(e,n){this.start=t(e,0),this.stop=t(n,0)};return e}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";var i=function(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)};i.fromElements=function(t,n,r,a,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=a,o):new i(t,n,r,a)},i.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 i(t.red,t.green,t.blue,t.alpha)},i.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new i(t.x,t.y,t.z,t.w):void 0},i.packedLength=4,i.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r++],a.w=n[r],a},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,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},i.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},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 a=new i;i.distance=function(t,e){return i.subtract(t,e,a),i.magnitude(a)},i.normalize=function(t,e){var n=i.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,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,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},i.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},i.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},i.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},i.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},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 o=new i;i.lerp=function(t,e,n,r){return i.multiplyByScalar(e,n,o),r=i.multiplyByScalar(t,1-n,r),i.add(o,r,r)};var u=new i;return i.mostOrthogonalAxis=function(t,e){var n=i.normalize(t,u);return i.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?i.clone(i.UNIT_X,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e):n.y<=n.z?n.y<=n.w?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e)},i.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},i.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r&&Math.abs(t.w-n.w)<=r},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(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e){return i.equalsEpsilon(this,t,e)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t){for(var e=0,n=0;9>n;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function u(t){for(var e=0,n=0;3>n;++n){var r=t[c.getElementIndex(d[n],h[n])];e+=2*r*r}return Math.sqrt(e)}function s(t,e){for(var n=a.EPSILON15,r=0,i=1,o=0;3>o;++o){var u=Math.abs(t[c.getElementIndex(d[o],h[o])]);u>r&&(i=o,r=u)}var s=1,l=0,f=h[i],m=d[i];if(Math.abs(t[c.getElementIndex(m,f)])>n){var y,p=t[c.getElementIndex(m,m)],v=t[c.getElementIndex(f,f)],E=t[c.getElementIndex(m,f)],w=(p-v)/2/E;y=0>w?-1/(-w+Math.sqrt(1+w*w)):1/(w+Math.sqrt(1+w*w)),s=1/Math.sqrt(1+y*y),l=y*s}return e=c.clone(c.IDENTITY,e),e[c.getElementIndex(f,f)]=e[c.getElementIndex(m,m)]=s,e[c.getElementIndex(m,f)]=l,e[c.getElementIndex(f,m)]=-l,e}var c=function(t,n,r,i,a,o,u,s,c){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(s,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(c,0)};c.clone=function(t,e){return n(t)?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 c(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},c.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new c),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},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[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 c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},c.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,u=t.y*t.y,s=t.y*t.z,l=t.y*t.w,f=t.z*t.z,h=t.z*t.w,d=t.w*t.w,m=r-u-f+d,y=2*(i-h),p=2*(a+l),v=2*(i+h),E=-r+u-f+d,w=2*(s-o),g=2*(a-l),x=2*(s+o),M=-r-u+f+d;return n(e)?(e[0]=m,e[1]=v,e[2]=g,e[3]=y,e[4]=E,e[5]=x,e[6]=p,e[7]=w,e[8]=M,e):new c(m,y,p,v,E,w,g,x,M)},c.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 c(t.x,0,0,0,t.y,0,0,0,t.z)},c.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 c(t,0,0,0,t,0,0,0,t)},c.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 c(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},c.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 c(1,0,0,0,r,-i,0,i,r)},c.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 c(r,0,i,0,1,0,-i,0,r)},c.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 c(r,-i,0,i,r,0,0,0,1)},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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},c.getElementIndex=function(t,e){return 3*t+e},c.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},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},c.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},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,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[3],e[4],e[5],l)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],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]*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],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],c=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],f=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]=s,n[6]=c,n[7]=l,n[8]=f,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},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},c.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,s=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=s,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},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},c.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],s=t[2],c=t[5],l=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=s,e[7]=c,e[8]=l,e};var h=[1,0,0],d=[2,2,1],m=new c,y=new c;return c.computeEigenDecomposition=function(t,e){var r=a.EPSILON20,i=10,l=0,f=0;n(e)||(e={});for(var h=e.unitary=c.clone(c.IDENTITY,e.unitary),d=e.diagonal=c.clone(t,e.diagonal),p=r*o(d);i>f&&u(d)>p;)s(d,m),c.transpose(m,y),c.multiply(d,m,d),c.multiply(y,d,d),c.multiply(h,m,h),++l>2&&(++f,l=0);return 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},c.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],s=t[5],c=t[8];return e*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},c.inverse=function(t,e){var n=t[0],i=t[1],o=t[2],u=t[3],s=t[4],l=t[5],f=t[6],h=t[7],d=t[8],m=c.determinant(t);if(Math.abs(m)<=a.EPSILON15)throw new r("matrix is not invertible");e[0]=s*d-h*l,e[1]=h*o-i*d,e[2]=i*l-s*o,e[3]=f*l-u*d,e[4]=n*d-f*o,e[5]=u*o-n*l,e[6]=u*h-f*s,e[7]=f*i-n*h,e[8]=n*s-u*i;var y=1/m;return c.multiplyByScalar(e,y,e)},c.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]},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},c.IDENTITY=i(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(t){"use strict";var e=function(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,s){"use strict";var c=function(t,e,r,i,a,o,u,s,c,l,f,h,d,m,y,p){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(e,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(m,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(y,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(p,0)};c.packedLength=16,c.pack=function(t,e,r){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]},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){return r(t)?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]):void 0},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,s=e.x*e.x,l=e.x*e.y,f=e.x*e.z,h=e.x*e.w,d=e.y*e.y,m=e.y*e.z,y=e.y*e.w,p=e.z*e.z,v=e.z*e.w,E=e.w*e.w,w=s-d-p+E,g=2*(l-v),x=2*(f+y),M=2*(l+v),S=-s+d-p+E,z=2*(m-h),O=2*(f-y),T=2*(m+h),_=-s-d+p+E;return i[0]=w*a,i[1]=M*a,i[2]=O*a,i[3]=0,i[4]=g*o,i[5]=S*o,i[6]=T*o,i[7]=0,i[8]=x*u,i[9]=z*u,i[10]=_*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},c.fromTranslation=function(t,e){return c.fromRotationTranslation(u.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 l=new t,f=new t,h=new t;c.fromCamera=function(e,n){var i=e.eye,a=e.target,o=e.up;t.normalize(t.subtract(a,i,l),l),t.normalize(t.cross(l,o,f),f),t.normalize(t.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,m=l.x,y=l.y,p=l.z,v=h.x,E=h.y,w=h.z,g=i.x,x=i.y,M=i.z,S=u*-g+s*-x+d*-M,z=v*-g+E*-x+w*-M,O=m*g+y*x+p*M;return r(n)?(n[0]=u,n[1]=v,n[2]=-m,n[3]=0,n[4]=s,n[5]=E,n[6]=-y,n[7]=0,n[8]=d,n[9]=w,n[10]=-p,n[11]=0,n[12]=S,n[13]=z,n[14]=O,n[15]=1,n):new c(u,s,d,S,v,E,w,z,-m,-y,-p,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,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},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),s=1/(r-n),c=1/(a-i),l=-(e+t)*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},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),s=2*i/(r-n),c=(e+t)/(e-t),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},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),s=(e+t)/(e-t),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},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),s=n(t.height,0);e=n(e,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-e),h=c,d=l,m=f,y=a+c,p=o+l,v=e+f,E=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]=m,i[11]=0,i[12]=y,i[13]=p,i[14]=v,i[15]=E,i},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.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 d=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],d)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],d)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],d)),n};var m=new t;c.getMaximumScale=function(e){return c.getScale(e,m),t.maximumComponent(m)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],s=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],m=t[11],y=t[12],p=t[13],v=t[14],E=t[15],w=e[0],g=e[1],x=e[2],M=e[3],S=e[4],z=e[5],O=e[6],T=e[7],_=e[8],N=e[9],R=e[10],I=e[11],b=e[12],A=e[13],P=e[14],C=e[15],L=r*w+u*g+f*x+y*M,U=i*w+s*g+h*x+p*M,q=a*w+c*g+d*x+v*M,D=o*w+l*g+m*x+E*M,B=r*S+u*z+f*O+y*T,F=i*S+s*z+h*O+p*T,W=a*S+c*z+d*O+v*T,G=o*S+l*z+m*O+E*T,V=r*_+u*N+f*R+y*I,Y=i*_+s*N+h*R+p*I,k=a*_+c*N+d*R+v*I,j=o*_+l*N+m*R+E*I,H=r*b+u*A+f*P+y*C,Z=i*b+s*A+h*P+p*C,X=a*b+c*A+d*P+v*C,K=o*b+l*A+m*P+E*C;return n[0]=L,n[1]=U,n[2]=q,n[3]=D,n[4]=B,n[5]=F,n[6]=W,n[7]=G,n[8]=V,n[9]=Y,n[10]=k,n[11]=j,n[12]=H,n[13]=Z,n[14]=X,n[15]=K,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],s=t[6],c=t[8],l=t[9],f=t[10],h=t[12],d=t[13],m=t[14],y=e[0],p=e[1],v=e[2],E=e[4],w=e[5],g=e[6],x=e[8],M=e[9],S=e[10],z=e[12],O=e[13],T=e[14],_=r*y+o*p+c*v,N=i*y+u*p+l*v,R=a*y+s*p+f*v,I=r*E+o*w+c*g,b=i*E+u*w+l*g,A=a*E+s*w+f*g,P=r*x+o*M+c*S,C=i*x+u*M+l*S,L=a*x+s*M+f*S,U=r*z+o*O+c*T+h,q=i*z+u*O+l*T+d,D=a*z+s*O+f*T+m;return n[0]=_,n[1]=N,n[2]=R,n[3]=0,n[4]=I,n[5]=b,n[6]=A,n[7]=0,n[8]=P,n[9]=C,n[10]=L,n[11]=0,n[12]=U,n[13]=q,n[14]=D,n[15]=1,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],s=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]=s,n[15]=t[15],n};var y=new t;c.multiplyByUniformScale=function(t,e,n){return y.x=e,y.y=e,y.z=e,c.multiplyByScale(t,y,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,s=t[1]*r+t[5]*i+t[9]*a+t[13]*o,c=t[2]*r+t[6]*i+t[10]*a+t[14]*o,l=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,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,s=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=s,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],s=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=s,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[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[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]},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 p=new u,v=new u,E=new e,w=new e(0,0,0,1);return c.inverse=function(t,n){if(u.equalsEpsilon(c.getRotation(t,p),v,o.EPSILON7)&&e.equals(c.getRow(t,3,E),w))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],l=t[12],f=t[1],h=t[5],d=t[9],m=t[13],y=t[2],g=t[6],x=t[10],M=t[14],S=t[3],z=t[7],O=t[11],T=t[15],_=x*T,N=M*O,R=g*T,I=M*z,b=g*O,A=x*z,P=y*T,C=M*S,L=y*O,U=x*S,q=y*z,D=g*S,B=_*h+I*d+b*m-(N*h+R*d+A*m),F=N*f+P*d+U*m-(_*f+C*d+L*m),W=R*f+C*h+q*m-(I*f+P*h+D*m),G=A*f+L*h+D*d-(b*f+U*h+q*d),V=N*i+R*a+A*l-(_*i+I*a+b*l),Y=_*r+C*a+L*l-(N*r+P*a+U*l),k=I*r+P*i+D*l-(R*r+C*i+q*l),j=b*r+U*i+q*a-(A*r+L*i+D*a);_=a*m,N=l*d,R=i*m,I=l*h,b=i*d,A=a*h,P=r*m,C=l*f,L=r*d,U=a*f,q=r*h,D=i*f;var H=_*z+I*O+b*T-(N*z+R*O+A*T),Z=N*S+P*O+U*T-(_*S+C*O+L*T),X=R*S+C*z+q*T-(I*S+P*z+D*T),K=A*S+L*z+D*O-(b*S+U*z+q*O),J=R*x+A*M+N*g-(b*M+_*g+I*x),Q=L*M+_*y+C*x-(P*x+U*M+N*y),$=P*g+D*M+I*y-(q*M+R*y+C*g),te=q*x+b*y+U*g-(L*g+D*x+A*y),ee=r*B+i*F+a*W+l*G;if(Math.abs(ee)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return ee=1/ee,n[0]=B*ee,n[1]=F*ee,n[2]=W*ee,n[3]=G*ee,n[4]=V*ee,n[5]=Y*ee,n[6]=k*ee,n[7]=j*ee,n[8]=H*ee,n[9]=Z*ee,n[10]=X*ee,n[11]=K*ee,n[12]=J*ee,n[13]=Q*ee,n[14]=$*ee,n[15]=te*ee,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],s=t[8],c=t[9],l=t[10],f=t[12],h=t[13],d=t[14],m=-n*f-r*h-i*d,y=-a*f-o*h-u*d,p=-s*f-c*h-l*d;return e[0]=n,e[1]=a,e[2]=s,e[3]=0,e[4]=r,e[5]=o,e[6]=c,e[7]=0,e[8]=i,e[9]=u,e[10]=l,e[11]=0,e[12]=m,e[13]=y,e[14]=p,e[15]=1,e},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";var u=function(t,n,r,i){this.west=e(t,0),this.south=e(n,0),this.east=e(r,0),this.north=e(i,0)};u.fromDegrees=function(t,r,i,a,s){return t=o.toRadians(e(t,0)),r=o.toRadians(e(r,0)),i=o.toRadians(e(i,0)),a=o.toRadians(e(a,0)),n(s)?(s.west=t,s.south=r,s.east=i,s.north=a,s):new u(t,r,i,a)},u.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=t.length;c>s;s++){var l=t[s];r=Math.min(r,l.longitude),i=Math.max(i,l.longitude),a=Math.min(a,l.latitude),o=Math.max(o,l.latitude)}return n(e)?(e.west=r,e.south=a,e.east=i,e.north=o,e):new u(r,a,i,o)},u.packedLength=4,u.pack=function(t,n,r){r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i.west=t[r++],i.south=t[r++],i.east=t[r++],i.north=t[r],i},u.clone=function(t,e){return n(t)?n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new u(t.west,t.south,t.east,t.north):void 0},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.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},u.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},u.validate=function(){},u.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)},u.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)},u.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)},u.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)},u.center=function(e,r){var i=e.east,a=e.west,u=.5*(a+i);return a>i&&(u=o.negativePiToPi(u+o.PI)),n(r)?(r.longitude=u,r.latitude=.5*(e.south+e.north),r.height=0,r):new t(u,.5*(e.south+e.north))},u.intersectWith=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),s=Math.min(t.north,e.north);return n(r)?(r.west=i,r.south=a,r.east=o,r.north=s,r):new u(i,a,o,s)},u.contains=function(t,e){return e.longitude>=t.west&&e.longitude<=t.east&&e.latitude>=t.south&&e.latitude<=t.north},u.isEmpty=function(t){return t.west>=t.east||t.south>=t.north};var s=new t;return u.subsample=function(t,r,a,u){r=e(r,i.WGS84),a=e(a,0),n(u)||(u=[]);var c=0,l=t.north,f=t.south,h=t.east,d=t.west,m=s;m.height=a,m.longitude=d,m.latitude=l,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:f>0?f:0;for(var y=1;8>y;++y){var p=-Math.PI+y*o.PI_OVER_TWO;p>d&&h>p&&(m.longitude=p,u[c]=r.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,s,c,l){"use strict";var f=function(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)},h=new t,d=new t,m=new t,y=new t,p=new t,v=new t,E=new t,w=new t,g=new t,x=new t,M=new t,S=new t;f.fromPoints=function(e,n){if(r(n)||(n=new f),!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],E),a=t.clone(i,h),o=t.clone(i,d),u=t.clone(i,m),s=t.clone(i,y),c=t.clone(i,p),l=t.clone(i,v),z=e.length,O=1;z>O;O++){t.clone(e[O],i);var T=i.x,_=i.y,N=i.z;T<a.x&&t.clone(i,a),T>s.x&&t.clone(i,s),_<o.y&&t.clone(i,o),_>c.y&&t.clone(i,c),N<u.z&&t.clone(i,u),N>l.z&&t.clone(i,l)}var R=t.magnitudeSquared(t.subtract(s,a,w)),I=t.magnitudeSquared(t.subtract(c,o,w)),b=t.magnitudeSquared(t.subtract(l,u,w)),A=a,P=s,C=R;I>C&&(C=I,A=o,P=c),b>C&&(C=b,A=u,P=l);var L=g;L.x=.5*(A.x+P.x),L.y=.5*(A.y+P.y),L.z=.5*(A.z+P.z);var U=t.magnitudeSquared(t.subtract(P,L,w)),q=Math.sqrt(U),D=x;D.x=a.x,D.y=o.y,D.z=u.z;var B=M;B.x=s.x,B.y=c.y,B.z=l.z;var F=t.multiplyByScalar(t.add(D,B,w),.5,S),W=0;for(O=0;z>O;O++){t.clone(e[O],i);var G=t.magnitude(t.subtract(i,F,w));G>W&&(W=G);var V=t.magnitudeSquared(t.subtract(i,L,w));if(V>U){var Y=Math.sqrt(V);q=.5*(q+Y),U=q*q;var k=Y-q;L.x=(q*L.x+k*i.x)/Y,L.y=(q*L.y+k*i.y)/Y,L.z=(q*L.z+k*i.z)/Y}}return W>q?(t.clone(L,n.center),n.radius=q):(t.clone(F,n.center),n.radius=W),n};var z=new o,O=new t,T=new t,_=new e,N=new e;f.fromRectangle2D=function(t,e,n){return f.fromRectangleWithHeights2D(t,e,0,0,n)},f.fromRectangleWithHeights2D=function(e,i,a,o,u){if(r(u)||(u=new f),!r(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;i=n(i,z),l.southwest(e,_),_.height=a,l.northeast(e,N),N.height=o;var s=i.project(_,O),c=i.project(N,T),h=c.x-s.x,d=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(h*h+d*d+m*m);var y=u.center;return y.x=s.x+.5*h,y.y=s.y+.5*d,y.z=s.z+.5*m,u};var R=[];f.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=l.subsample(t,e,i,R)),f.fromPoints(u,o)},f.fromVertices=function(e,i,a,o){if(r(o)||(o=new f),!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=E;u.x=e[0]+i.x,u.y=e[1]+i.y,u.z=e[2]+i.z;for(var s=t.clone(u,h),c=t.clone(u,d),l=t.clone(u,m),z=t.clone(u,y),O=t.clone(u,p),T=t.clone(u,v),_=e.length,N=0;_>N;N+=a){var R=e[N]+i.x,I=e[N+1]+i.y,b=e[N+2]+i.z;u.x=R,u.y=I,u.z=b,R<s.x&&t.clone(u,s),R>z.x&&t.clone(u,z),I<c.y&&t.clone(u,c),I>O.y&&t.clone(u,O),b<l.z&&t.clone(u,l),b>T.z&&t.clone(u,T)}var A=t.magnitudeSquared(t.subtract(z,s,w)),P=t.magnitudeSquared(t.subtract(O,c,w)),C=t.magnitudeSquared(t.subtract(T,l,w)),L=s,U=z,q=A;P>q&&(q=P,L=c,U=O),C>q&&(q=C,L=l,U=T);var D=g;D.x=.5*(L.x+U.x),D.y=.5*(L.y+U.y),D.z=.5*(L.z+U.z);var B=t.magnitudeSquared(t.subtract(U,D,w)),F=Math.sqrt(B),W=x;W.x=s.x,W.y=c.y,W.z=l.z;var G=M;G.x=z.x,G.y=O.y,G.z=T.z;var V=t.multiplyByScalar(t.add(W,G,w),.5,S),Y=0;for(N=0;_>N;N+=a){u.x=e[N]+i.x,u.y=e[N+1]+i.y,u.z=e[N+2]+i.z;var k=t.magnitude(t.subtract(u,V,w));k>Y&&(Y=k);var j=t.magnitudeSquared(t.subtract(u,D,w));if(j>B){var H=Math.sqrt(j);F=.5*(F+H),B=F*F;var Z=H-F;D.x=(F*D.x+Z*u.x)/H,D.y=(F*D.y+Z*u.y)/H,D.z=(F*D.z+Z*u.z)/H}}return Y>F?(t.clone(D,o.center),o.radius=F):(t.clone(V,o.center),o.radius=Y),o},f.fromCornerPoints=function(e,n,i){r(i)||(i=new f);var a=i.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),i.radius=t.distance(a,n),i},f.fromEllipsoid=function(e,n){return r(n)||(n=new f),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n},f.clone=function(e,n){return r(e)?r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new f(e.center,e.radius):void 0},f.packedLength=4,f.pack=function(t,e,r){r=n(r,0);var i=t.center;e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius},f.unpack=function(t,e,i){e=n(e,0),r(i)||(i=new f);var a=i.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],i.radius=t[e],i};var I=new t,b=new t;f.union=function(e,n,i){r(i)||(i=new f);var a=e.center,o=n.center;t.add(a,o,b);var u=t.multiplyByScalar(b,.5,b),s=t.magnitude(t.subtract(a,u,I))+e.radius,c=t.magnitude(t.subtract(o,u,I))+n.radius;return i.radius=Math.max(s,c),t.clone(u,i.center),i};var A=new t;f.expand=function(e,n,r){r=f.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,A));return i>r.radius&&(r.radius=i),r},f.intersect=function(e,n){var r=e.center,i=e.radius,a=t.dot(n,r)+n.w;return-i>a?u.OUTSIDE:i>a?u.INTERSECTING:u.INSIDE},f.transform=function(t,e,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var P=new t;f.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,P);return t.magnitudeSquared(r)-e.radius*e.radius},f.transformWithoutScale=function(t,e,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var C=new t;f.computePlaneDistances=function(e,n,i,a){r(a)||(a=new s);var o=t.subtract(e.center,n,C),u=t.multiplyByScalar(i,t.dot(i,o),C),c=t.magnitude(u);return a.start=c-e.radius,a.stop=c+e.radius,a};for(var L=new t,U=new t,q=new t,D=new t,B=new t,F=new e,W=new Array(8),G=0;8>G;++G)W[G]=new t;var V=new o;return f.projectTo2D=function(e,r,i){r=n(r,V);var a=r.ellipsoid,o=e.center,u=e.radius,s=a.geodeticSurfaceNormal(o,L),c=t.cross(t.UNIT_Z,s,U);t.normalize(c,c);var l=t.cross(s,c,q);t.normalize(l,l),t.multiplyByScalar(s,u,s),t.multiplyByScalar(l,u,l),t.multiplyByScalar(c,u,c);var h=t.negate(l,B),d=t.negate(c,D),m=W,y=m[0];t.add(s,l,y),t.add(y,c,y),y=m[1],t.add(s,l,y),t.add(y,d,y),y=m[2],t.add(s,h,y),t.add(y,d,y),y=m[3],t.add(s,h,y),t.add(y,c,y),t.negate(s,s),y=m[4],t.add(s,l,y),t.add(y,c,y),y=m[5],t.add(s,l,y),t.add(y,d,y),y=m[6],t.add(s,h,y),t.add(y,d,y),y=m[7],t.add(s,h,y),t.add(y,c,y);for(var p=m.length,v=0;p>v;++v){var E=m[v];t.add(o,E,E);var w=a.cartesianToCartographic(E,F);r.project(w,E)}i=f.fromPoints(m,i),o=i.center;var g=o.x,x=o.y,M=o.z;return o.x=M,o.y=g,o.z=x,i},f.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},f.prototype.intersect=function(t){return f.intersect(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 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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof e[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",t(document[i])?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",t(document[i])&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",t(document[i])?r.fullscreenElement=i:(i=s+"FullScreenElement",t(document[i])&&(r.fullscreenElement=i)),i=s+"fullscreenchange",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t){i.supportsFullscreen()&&t[r.requestFullscreen]()},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;r>n;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(m)){m=!1;var t=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(m=!0,y=r(t[1]))}return m}function a(){return i()&&y}function o(){if(!e(p)&&(p=!1,!i()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(p=!0,v=r(t[1]))}return p}function u(){return o()&&v}function s(){if(!e(E)){E=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==t&&(E=!0,w=r(t[1]),w.isNightly=!!t[2])}return E}function c(){return s()&&w}function l(){if(!e(g)){g=!1;var t;"Microsoft Internet Explorer"===navigator.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(g=!0,x=r(t[1]))):"Netscape"===navigator.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(g=!0,x=r(t[1])))}return g}function f(){return l()&&x}function h(){if(!e(M)){M=!1;var t=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(M=!0,S=r(t[1]))}return M}function d(){return h()&&S}var m,y,p,v,E,w,g,x,M,S,z={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:d,hardwareConcurrency:t(navigator.hardwareConcurrency,3)};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,e,n,r,i){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(t){switch(t){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(t){return t instanceof Int8Array?a.BYTE:t instanceof Uint8Array?a.UNSIGNED_BYTE:t instanceof Int16Array?a.SHORT:t instanceof Uint16Array?a.UNSIGNED_SHORT:t instanceof Float32Array?a.FLOAT:t instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(t){return e(t)&&(t===a.BYTE||t===a.UNSIGNED_BYTE||t===a.SHORT||t===a.UNSIGNED_SHORT||t===a.FLOAT||t===a.DOUBLE)},a.createTypedArray=function(t,e){switch(t){case a.BYTE:return new Int8Array(e);case a.UNSIGNED_BYTE:return new Uint8Array(e);case a.SHORT:return new Int16Array(e);case a.UNSIGNED_SHORT:return new Uint16Array(e);case a.FLOAT:return new Float32Array(e);case a.DOUBLE:return new Float64Array(e);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(e,r,i,o){switch(i=t(i,0),o=t(o,(r.byteLength-i)/a.getSizeInBytes(e)),e){case a.BYTE:return new Int8Array(r,i,o);case a.UNSIGNED_BYTE:return new Uint8Array(r,i,o);case a.SHORT:return new Int16Array(r,i,o);case a.UNSIGNED_SHORT:return new Uint16Array(r,i,o);case a.FLOAT:return new Float32Array(r,i,o);case a.DOUBLE:return new Float64Array(r,i,o);default:throw new n("componentDatatype is not a valid value.")}},i(a)}),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"],function(t){"use strict";var e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(t){return t===e.POINTS||t===e.LINES||t===e.LINE_LOOP||t===e.LINE_STRIP||t===e.TRIANGLES||t===e.TRIANGLE_STRIP||t===e.TRIANGLE_FAN}};return t(e)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";var a=function(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)};return a.computeNumberOfVertices=function(t){var r=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&e(t.attributes[i])&&e(t.attributes[i].values)){var a=t.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t){"use strict";var e=function(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 e}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";var e=function(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"],function(t,e,n,r){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,i){return t>r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(i)}),define("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(t,e,n,r,i,a,o,u,s,c,l,f){"use strict";var h=new e(1,1,1),d=Math.cos,m=Math.sin,y=function(t){t=r(t,r.EMPTY_OBJECT);var n=r(t.radii,h),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"};return y.createGeometry=function(e){var r,i,h,y,p,v,E=e._radii,w=a.fromCartesian3(E),g=e._stackPartitions,x=e._slicePartitions,M=e._subdivisions,S=M*(g+x-1),z=S-x+2,O=new Float64Array(3*z),T=c.createTypedArray(z,2*S),_=0,N=new Array(M),R=new Array(M);for(r=0;M>r;r++)h=l.TWO_PI*r/M,N[r]=d(h),R[r]=m(h);for(r=1;g>r;r++)for(y=Math.PI*r/g,p=d(y),v=m(y),i=0;M>i;i++)O[_++]=E.x*N[i]*v,O[_++]=E.y*R[i]*v,O[_++]=E.z*p;for(N.length=x,R.length=x,r=0;x>r;r++)h=l.TWO_PI*r/x,N[r]=d(h),R[r]=m(h);for(O[_++]=0,O[_++]=0,O[_++]=E.z,r=1;M>r;r++)for(y=Math.PI*r/M,p=d(y),v=m(y),i=0;x>i;i++)O[_++]=E.x*N[i]*v,O[_++]=E.y*R[i]*v,O[_++]=E.z*p;for(O[_++]=0,O[_++]=0,O[_++]=-E.z,_=0,r=0;g-1>r;++r){var I=r*M;for(i=0;M-1>i;++i)T[_++]=I+i,T[_++]=I+i+1;T[_++]=I+M-1,T[_++]=I}var b=M*(g-1);for(i=1;x+1>i;++i)T[_++]=b,T[_++]=b+i;for(r=0;M-2>r;++r){var A=r*x+1+b,P=(r+1)*x+1+b;for(i=0;x-1>i;++i)T[_++]=P+i,T[_++]=A+i;T[_++]=P+x-1,T[_++]=A+x-1}var C=O.length/3-1;for(i=C-1;i>C-x-1;--i)T[_++]=C,T[_++]=i;var L=new s({position:new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:O})});return new o({attributes:L,indices:T,primitiveType:f.LINES,boundingSphere:t.fromEllipsoid(w)})},y}),define("Workers/createEllipsoidOutlineGeometry",["../Core/EllipsoidOutlineGeometry"],function(t){"use strict";return t.createGeometry})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==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(n){e=n.stack}this.stack=e}return 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("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:0>t?-1:0},i.signNotZero=function(t){return 0>t?-1:1},i.toSNorm=function(t){return Math.round(255*(.5*i.clamp(t,-1,1)+.5))},i.fromSNorm=function(t){return i.clamp(t,0,255)/255*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.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 i>=a||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;t>=r;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 e>t?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";function a(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}a.fromSpherical=function(n,r){e(r)||(r=new a);var i=n.clock,o=n.cone,u=t(n.magnitude,1),E=u*Math.sin(o);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(t,n,r,i){return e(i)?(i.x=t,i.y=n,i.z=r,i):new a(t,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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){a.normalize(t,E),a.normalize(e,s);var n=a.dot(E,s),r=a.magnitude(a.cross(E,s,E));return Math.atan2(r,n)};var c=new a;a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,c);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):n.y<=n.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},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)},a.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},a.fromDegrees=function(t,e,n,r,o){var u=i.toRadians(t),E=i.toRadians(e);return a.fromRadians(u,E,n,r,o)};var _=new a,R=new a,T=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=t(i,0);var E=e(o)?o.radiiSquared:T,s=Math.cos(r);_.x=s*Math.cos(n),_.y=s*Math.sin(n),_.z=Math.sin(r),_=a.normalize(_,_),a.multiplyComponents(E,_,R);var c=Math.sqrt(a.dot(_,R));return R=a.divideByScalar(R,c,R),_=a.multiplyByScalar(_,i,_),e(u)||(u=new a),a.add(R,_,u)},a.fromDegreesArray=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=i.toRadians(t[o]);return a.fromRadiansArray(r,e,n)},a.fromRadiansArray=function(t,n,r){var i=t.length;e(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],E=t[o+1];r[o/2]=a.fromRadians(u,E,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o+=3)r[o]=i.toRadians(t[o]),r[o+1]=i.toRadians(t[o+1]),r[o+2]=t[o+2];return a.fromRadiansArrayHeights(r,e,n)},a.fromRadiansArrayHeights=function(t,n,r){var i=t.length;e(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],E=t[o+1],s=t[o+2];r[o/3]=a.fromRadians(u,E,s,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(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+")"},a}),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,R=n.z,T=i.x,l=i.y,A=i.z,f=c*c*T*T,N=_*_*l*l,h=R*R*A*A,d=f+N+h,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,a);if(E>d)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 C,p,U,L,F,P,v,D,B,w,g,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,B=P*U,w=v*L,g=D*F,C=f*P+N*v+h*D-1,p=f*B*M+N*w*O+h*g*m;var G=-2*p;z=C/G}while(Math.abs(C)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=R*F,s):new t(c*U,_*L,R*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),R=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),T=a.EPSILON1;return u.fromCartesian=function(e,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:R,f=n(r)?r._centerToleranceSquared:T,N=o(e,l,A,f,s);if(n(N)){var h=t.multiplyComponents(e,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){return n(t)?n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height):void 0},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}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,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){i=n(i,0),t.pack(e._radii,r,i)},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,R=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=R;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;n>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var T=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,T),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;n>i;++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}),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","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(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 u(t){for(var e=0,n=0;9>n;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function E(t){for(var e=0,n=0;3>n;++n){var r=t[o.getElementIndex(T[n],R[n])];e+=2*r*r}return Math.sqrt(e)}function s(t,e){for(var n=a.EPSILON15,r=0,i=1,u=0;3>u;++u){var E=Math.abs(t[o.getElementIndex(T[u],R[u])]);E>r&&(i=u,r=E)}var s=1,c=0,_=R[i],l=T[i];if(Math.abs(t[o.getElementIndex(l,_)])>n){var A,f=t[o.getElementIndex(l,l)],N=t[o.getElementIndex(_,_)],h=t[o.getElementIndex(l,_)],d=(f-N)/2/h;A=0>d?-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=o.clone(o.IDENTITY,e),e[o.getElementIndex(_,_)]=e[o.getElementIndex(l,l)]=s,e[o.getElementIndex(l,_)]=c,e[o.getElementIndex(_,l)]=-c,e}o.packedLength=9,o.pack=function(t,n,r){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]},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),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},o.clone=function(t,e){return n(t)?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 o(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},o.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new o),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},o.fromColumnMajorArray=function(t,e){return o.clone(t,e)},o.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 o(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},o.fromQuaternion=function(t,e){var r=t.x*t.x,i=t.x*t.y,a=t.x*t.z,u=t.x*t.w,E=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,R=t.z*t.w,T=t.w*t.w,l=r-E-_+T,A=2*(i-R),f=2*(a+c),N=2*(i+R),h=-r+E-_+T,d=2*(s-u),I=2*(a-c),S=2*(s+u),M=-r-E+_+T;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 o(l,A,f,N,h,d,I,S,M)},o.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 o(t.x,0,0,0,t.y,0,0,0,t.z)},o.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 o(t,0,0,0,t,0,0,0,t)},o.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 o(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},o.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 o(1,0,0,0,r,-i,0,i,r)},o.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 o(r,0,i,0,1,0,-i,0,r)},o.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 o(r,-i,0,i,r,0,0,0,1)},o.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]]},o.getElementIndex=function(t,e){return 3*t+e},o.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},o.setColumn=function(t,e,n,r){r=o.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},o.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},o.setRow=function(t,e,n,r){return r=o.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var c=new t;o.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],c)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],c)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],c)),n};var _=new t;o.getMaximumScale=function(e){return o.getScale(e,_),t.maximumComponent(_)},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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],T=[2,2,1],l=new o,A=new o;return o.computeEigenDecomposition=function(t,e){var r=a.EPSILON20,i=10,c=0,_=0;n(e)||(e={});for(var R=e.unitary=o.clone(o.IDENTITY,e.unitary),T=e.diagonal=o.clone(t,e.diagonal),f=r*u(T);i>_&&E(T)>f;)s(T,l),o.transpose(l,A),o.multiply(T,l,T),o.multiply(A,T,T),o.multiply(R,l,R),++c>2&&(++_,c=0);return e},o.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},o.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)},o.inverse=function(t,e){var n=t[0],i=t[1],u=t[2],E=t[3],s=t[4],c=t[5],_=t[6],R=t[7],T=t[8],l=o.determinant(t);if(Math.abs(l)<=a.EPSILON15)throw new r("matrix is not invertible");e[0]=s*T-R*c,e[1]=R*u-i*T,e[2]=i*c-s*u,e[3]=_*c-E*T,e[4]=n*T-_*u,e[5]=E*u-n*c,e[6]=E*R-_*s,e[7]=_*i-n*R,e[8]=n*s-E*i;var A=1/l;return o.multiplyByScalar(e,A,e)},o.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]},o.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},o.IDENTITY=i(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=i(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.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]},o.prototype.equalsEpsilon=function(t,e){return o.equalsEpsilon(this,t,e)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return e(t)?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):void 0},a.packedLength=4,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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.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.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(n){e=n.stack}this.stack=e}return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(t,e,r,i,a,o,u,E,s,c,_,R,T,l,A,f){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(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(R,0),this[15]=n(f,0)}s.packedLength=16,s.pack=function(t,e,r){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]},s.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new s),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},s.clone=function(t,e){return r(t)?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 s(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]):void 0},s.fromArray=s.unpack,s.fromColumnMajorArray=function(t,e){return s.clone(t,e)},s.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 s(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])},s.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 s(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)},s.fromTranslationQuaternionRotationScale=function(t,e,n,i){r(i)||(i=new s);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,c=e.x*e.y,_=e.x*e.z,R=e.x*e.w,T=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-T-f+h,I=2*(c-N),S=2*(_+A),M=2*(c+N),O=-E+T-f+h,m=2*(l-R),y=2*(_-A),C=2*(l+R),p=-E-T+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]=C*o,i[7]=0,i[8]=S*u,i[9]=m*u,i[10]=p*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},s.fromTranslationRotationScale=function(t,e){return s.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},s.fromTranslation=function(t,e){return s.fromRotationTranslation(u.IDENTITY,t,e)},s.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 s(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},s.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 s(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var c=new t,_=new t,R=new t;s.fromCamera=function(e,n){var i=e.eye,a=e.target,o=e.up;t.normalize(t.subtract(a,i,c),c),t.normalize(t.cross(c,o,_),_),t.normalize(t.cross(_,c,R),R);var u=_.x,E=_.y,T=_.z,l=c.x,A=c.y,f=c.z,N=R.x,h=R.y,d=R.z,I=i.x,S=i.y,M=i.z,O=u*-I+E*-S+T*-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]=T,n[9]=d,n[10]=-f,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new s(u,E,T,O,N,h,d,m,-l,-A,-f,y,0,0,0,1)},s.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},s.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,R=-(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]=R,o[15]=1,o},s.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),R=-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]=R,o[12]=0,o[13]=0,o[14]=T,o[15]=0,o},s.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,R=-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]=R,a[15]=0,a},s.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),R=s,T=c,l=_,A=a+s,f=o+c,N=e+_,h=1;return i[0]=R,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]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=N,i[15]=h,i},s.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]]},s.getElementIndex=function(t,e){return 4*t+e},s.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},s.setColumn=function(t,e,n,r){r=s.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},s.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},s.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},s.setRow=function(t,e,n,r){return r=s.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var T=new t;s.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[4],e[5],e[6],T)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],T)),n};var l=new t;s.getMaximumScale=function(e){return s.getScale(e,l),t.maximumComponent(l)},s.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],R=t[9],T=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],C=e[7],p=e[8],U=e[9],L=e[10],F=e[11],P=e[12],v=e[13],D=e[14],B=e[15],w=r*d+u*I+_*S+A*M,g=i*d+E*I+R*S+f*M,x=a*d+s*I+T*S+N*M,z=o*d+c*I+l*S+h*M,G=r*O+u*m+_*y+A*C,b=i*O+E*m+R*y+f*C,X=a*O+s*m+T*y+N*C,V=o*O+c*m+l*y+h*C,H=r*p+u*U+_*L+A*F,W=i*p+E*U+R*L+f*F,q=a*p+s*U+T*L+N*F,Y=o*p+c*U+l*L+h*F,K=r*P+u*v+_*D+A*B,k=i*P+E*v+R*D+f*B,Z=a*P+s*v+T*D+N*B,j=o*P+c*v+l*D+h*B;return n[0]=w,n[1]=g,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},s.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},s.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},s.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],R=t[12],T=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],C=e[14],p=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,B=i*S+u*M+c*O,w=a*S+E*M+_*O,g=r*m+o*y+s*C+R,x=i*m+u*y+c*C+T,z=a*m+E*y+_*C+l;return n[0]=p,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]=B,n[10]=w,n[11]=0,n[12]=g,n[13]=x,n[14]=z,n[15]=1,n},s.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],R=e[0],T=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*R+o*T+s*l,M=i*R+u*T+c*l,O=a*R+E*T+_*l,m=r*A+o*f+s*N,y=i*A+u*f+c*N,C=a*A+E*f+_*N,p=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]=C,n[7]=0,n[8]=p,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},s.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;s.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,s.multiplyByScale(t,A,n)},s.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?s.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)},s.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},s.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},s.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},s.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},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[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},s.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},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[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},s.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]},s.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},s.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},s.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 f=new u,N=new u,h=new e,d=new e(0,0,0,1);return s.inverse=function(t,n){if(u.equalsEpsilon(s.getRotation(t,f),N,o.EPSILON7)&&e.equals(s.getRow(t,3,h),d))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],c=t[12],_=t[1],R=t[5],T=t[9],l=t[13],A=t[2],I=t[6],S=t[10],M=t[14],O=t[3],m=t[7],y=t[11],C=t[15],p=S*C,U=M*y,L=I*C,F=M*m,P=I*y,v=S*m,D=A*C,B=M*O,w=A*y,g=S*O,x=A*m,z=I*O,G=p*R+F*T+P*l-(U*R+L*T+v*l),b=U*_+D*T+g*l-(p*_+B*T+w*l),X=L*_+B*R+x*l-(F*_+D*R+z*l),V=v*_+w*R+z*T-(P*_+g*R+x*T),H=U*i+L*a+v*c-(p*i+F*a+P*c),W=p*r+B*a+w*c-(U*r+D*a+g*c),q=F*r+D*i+z*c-(L*r+B*i+x*c),Y=P*r+g*i+x*a-(v*r+w*i+z*a);p=a*l,U=c*T,L=i*l,F=c*R,P=i*T,v=a*R,D=r*l,B=c*_,w=r*T,g=a*_,x=r*R,z=i*_;var K=p*m+F*y+P*C-(U*m+L*y+v*C),k=U*O+D*y+g*C-(p*O+B*y+w*C),Z=L*O+B*m+x*C-(F*O+D*m+z*C),j=v*O+w*m+z*y-(P*O+g*m+x*y),Q=L*S+v*M+U*I-(P*M+p*I+F*S),J=w*M+p*A+B*S-(D*S+g*M+U*A),$=D*I+z*M+F*A-(x*M+L*A+B*I),tt=x*S+P*A+g*I-(w*I+z*S+v*A),et=r*G+i*b+a*X+c*V;if(Math.abs(et)<o.EPSILON20)throw new E("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},s.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],R=t[13],T=t[14],l=-n*_-r*R-i*T,A=-a*_-o*R-u*T,f=-E*_-s*R-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]=l,e[13]=A,e[14]=f,e[15]=1,e},s.IDENTITY=a(new s(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),s.ZERO=a(new s(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN0ROW3=3,s.COLUMN1ROW0=4,s.COLUMN1ROW1=5,s.COLUMN1ROW2=6,s.COLUMN1ROW3=7,s.COLUMN2ROW0=8,s.COLUMN2ROW1=9,s.COLUMN2ROW2=10,s.COLUMN2ROW3=11,s.COLUMN3ROW0=12,s.COLUMN3ROW1=13,s.COLUMN3ROW2=14,s.COLUMN3ROW3=15,s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.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]},s.prototype.equalsEpsilon=function(t,e){return s.equalsEpsilon(this,t,e)},s.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},s}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function i(e,n){this.normal=t.clone(e),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-t.dot(r,n);return e(a)?(t.clone(r,a.normal),a.distance=o,a):new i(r,o)};var a=new t;return i.fromCartesian4=function(n,r){var o=t.fromCartesian4(n,a),u=n.w;return e(r)?(t.clone(o,r.normal),r.distance=u,r):new i(o,u)},i.getPointDistance=function(e,n){return t.dot(e.normal,n)+e.distance},i.ORIGIN_XY_PLANE=r(new i(t.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=r(new i(t.UNIT_X,0)),i.ORIGIN_ZX_PLANE=r(new i(t.UNIT_Y,0)),i}),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){r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north},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 n>e&&(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,R=t.length;R>_;_++){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 l=T.longitude>=0?T.longitude:T.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.clone=function(t,e){return n(t)?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):void 0},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;a>i&&(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;a>i&&o>0?i+=u.TWO_PI:s>o&&i>0&&(o+=u.TWO_PI),a>i&&0>s?s+=u.TWO_PI:s>o&&0>a&&(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 R=Math.max(t.south,e.south),T=Math.min(t.north,e.north);if(!(R>=T))return n(r)?(r.west=c,r.south=R,r.east=_,r.north=T,r):new E(c,R,_,T)}},E.union=function(t,e,r){return n(r)||(r=new E),r.west=Math.min(t.west,e.west),r.south=Math.min(t.south,e.south),r.east=Math.max(t.east,e.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 i>a&&(a+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(a>n||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,R=t.south,T=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=T,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.latitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,0>_?A.latitude=_:R>0?A.latitude=R:A.latitude=0;for(var f=1;8>f;++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=T,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","./Plane","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_,R){"use strict";function T(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var 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,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],I),a=t.clone(i,l),o=t.clone(i,A),u=t.clone(i,f),E=t.clone(i,N),s=t.clone(i,h),c=t.clone(i,d),_=e.length,R=1;_>R;R++){t.clone(e[R],i);var C=i.x,p=i.y,U=i.z;C<a.x&&t.clone(i,a),C>E.x&&t.clone(i,E),p<o.y&&t.clone(i,o),p>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,S)),F=t.magnitudeSquared(t.subtract(s,o,S)),P=t.magnitudeSquared(t.subtract(c,u,S)),v=a,D=E,B=L;F>B&&(B=F,v=o,D=s),P>B&&(B=P,v=u,D=c);var w=M;w.x=.5*(v.x+D.x),w.y=.5*(v.y+D.y),w.z=.5*(v.z+D.z);var g=t.magnitudeSquared(t.subtract(D,w,S)),x=Math.sqrt(g),z=O;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,S),.5,y),X=0;for(R=0;_>R;R++){t.clone(e[R],i);var V=t.magnitude(t.subtract(i,b,S));V>X&&(X=V);var H=t.magnitudeSquared(t.subtract(i,w,S));if(H>g){var W=Math.sqrt(H);x=.5*(x+W),g=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 C=new o,p=new t,U=new t,L=new e,F=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,C),R.southwest(e,L),L.height=a,R.northeast(e,F),F.height=o;var E=i.project(L,p),s=i.project(F,U),c=s.x-E.x,_=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+_*_+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*_,A.z=E.z+.5*l,u};var P=[];T.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=R.subsample(t,e,i,P)),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=I;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,A),c=t.clone(u,f),_=t.clone(u,N),R=t.clone(u,h),C=t.clone(u,d),p=e.length,U=0;p>U;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>R.y&&t.clone(u,R),P<c.z&&t.clone(u,c),P>C.z&&t.clone(u,C)}var v=t.magnitudeSquared(t.subtract(_,E,S)),D=t.magnitudeSquared(t.subtract(R,s,S)),B=t.magnitudeSquared(t.subtract(C,c,S)),w=E,g=_,x=v;D>x&&(x=D,w=s,g=R),B>x&&(x=B,w=c,g=C);var z=M;z.x=.5*(w.x+g.x),z.y=.5*(w.y+g.y),z.z=.5*(w.z+g.z);var G=t.magnitudeSquared(t.subtract(g,z,S)),b=Math.sqrt(G),X=O;X.x=E.x,X.y=s.y,X.z=c.z;var V=m;V.x=_.x,V.y=R.y,V.z=C.z;var H=t.multiplyByScalar(t.add(X,V,S),.5,y),W=0;for(U=0;p>U;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,S));q>W&&(W=q);var Y=t.magnitudeSquared(t.subtract(u,z,S));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 W>b?(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=I;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,A),E=t.clone(a,f),s=t.clone(a,N),c=t.clone(a,h),_=t.clone(a,d),R=e.length,C=0;R>C;C+=3){var p=e[C]+n[C],U=e[C+1]+n[C+1],L=e[C+2]+n[C+2];a.x=p,a.y=U,a.z=L,p<o.x&&t.clone(a,o),p>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,S)),P=t.magnitudeSquared(t.subtract(c,u,S)),v=t.magnitudeSquared(t.subtract(_,E,S)),D=o,B=s,w=F;P>w&&(w=P,D=u,B=c),v>w&&(w=v,D=E,B=_);var g=M;g.x=.5*(D.x+B.x),g.y=.5*(D.y+B.y),g.z=.5*(D.z+B.z);var x=t.magnitudeSquared(t.subtract(B,g,S)),z=Math.sqrt(x),G=O;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,S),.5,y),V=0;for(C=0;R>C;C+=3){a.x=e[C]+n[C],a.y=e[C+1]+n[C+1],a.z=e[C+2]+n[C+2];var H=t.magnitude(t.subtract(a,X,S));H>V&&(V=H);var W=t.magnitudeSquared(t.subtract(a,g,S));if(W>x){var q=Math.sqrt(W);z=.5*(z+q),x=z*z;var Y=q-z;g.x=(z*g.x+Y*a.x)/q,g.y=(z*g.y+Y*a.y)/q,g.z=(z*g.z+Y*a.z)/q}}return V>z?(t.clone(g,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 v=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;i>o;o++)a.push(e[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;i>o;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,v)+s.radius)}return n.radius=E,n};var D=new t,B=new t,w=new t;T.fromOrientedBoundingBox=function(e,n){r(n)||(n=new T);var i=e.halfAxes,a=s.getColumn(i,0,D),o=s.getColumn(i,1,B),u=s.getColumn(i,2,w),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){return r(e)?r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius):void 0},T.packedLength=4,T.pack=function(t,e,r){r=n(r,0);var i=t.center;e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius},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 g=new t,x=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,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),R=t.multiplyByScalar(s,(-o+_)/c,x);return t.add(R,a,R),t.clone(R,i.center),i.radius=_,i};var z=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,z));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-i>o?u.OUTSIDE:i>o?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 G=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,G);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 b=new t;T.computePlaneDistances=function(e,n,i,a){r(a)||(a=new E);var o=t.subtract(e.center,n,b),u=t.dot(i,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var X=new t,V=new t,H=new t,W=new t,q=new t,Y=new e,K=new Array(8),k=0;8>k;++k)K[k]=new t;var Z=new o;return T.projectTo2D=function(e,r,i){r=n(r,Z);var a=r.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,X),s=t.cross(t.UNIT_Z,E,V);t.normalize(s,s);var c=t.cross(E,s,H);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,W),l=K,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;f>N;++N){var h=l[N];t.add(o,h,h);var d=a.cartesianToCartographic(h,Y);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("Renderer/WebGLConstants",["../Core/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/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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++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",t(document[i])?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",t(document[i])&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",t(document[i])?r.fullscreenElement=i:(i=E+"FullScreenElement",t(document[i])&&(r.fullscreenElement=i)),i=E+"fullscreenchange",t(document["on"+i])&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",t(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;r>n;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(d)){d=!1;var t=/ Chrome\/([\.0-9]+)/.exec(h.userAgent);null!==t&&(d=!0,I=r(t[1]))}return d}function a(){return i()&&I}function o(){if(!e(S)&&(S=!1,!i()&&/ Safari\/[\.0-9]+/.test(h.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(h.userAgent);null!==t&&(S=!0,M=r(t[1]))}return S}function u(){return o()&&M}function E(){if(!e(O)){O=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(h.userAgent);null!==t&&(O=!0,m=r(t[1]),m.isNightly=!!t[2])}return O}function s(){return E()&&m}function c(){if(!e(y)){y=!1;var t;"Microsoft Internet Explorer"===h.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(h.userAgent),null!==t&&(y=!0,C=r(t[1]))):"Netscape"===h.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(h.userAgent),null!==t&&(y=!0,C=r(t[1])))}return y}function _(){return c()&&C}function R(){if(!e(p)){p=!1;var t=/Firefox\/([\.0-9]+)/.exec(h.userAgent);null!==t&&(p=!0,U=r(t[1]))}return p}function T(){return e(L)||(L=/Windows/i.test(h.appVersion)),L}function l(){return R()&&U}function A(){return e(F)||(F="undefined"!=typeof PointerEvent&&(!e(h.pointerEnabled)||h.pointerEnabled)),F}function f(){if(!e(v)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;v=e(n)&&""!==n,v&&(P=n)}return v}function N(){return f()?P:void 0}var h;h="undefined"!=typeof navigator?navigator:{};var d,I,S,M,O,m,y,C,p,U,L,F,P,v,D={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isFirefox:R,firefoxVersion:l,isWindows:T,hardwareConcurrency:t(h.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:f,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/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,e,n,r,i,a){"use strict";if(!i.supportsTypedArrays())return{};var o={BYTE:t.BYTE,UNSIGNED_BYTE:t.UNSIGNED_BYTE,SHORT:t.SHORT,UNSIGNED_SHORT:t.UNSIGNED_SHORT,FLOAT:t.FLOAT,DOUBLE:t.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},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 Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return n(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||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.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(t,n,i,a){switch(i=e(i,0),a=e(a,(n.byteLength-i)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,i,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,i,a);case o.SHORT:return new Int16Array(n,i,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,i,a);case o.FLOAT:return new Float32Array(n,i,a);case o.DOUBLE:return new Float64Array(n,i,a);default:throw new r("componentDatatype is not a valid value.")}},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",["../Renderer/WebGLConstants","./freezeObject"],function(t,e){"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(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 e(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=void 0}return a.computeNumberOfVertices=function(t){var r=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&e(t.attributes[i])&&e(t.attributes[i].values)){var a=t.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a={UNSIGNED_BYTE:t.UNSIGNED_BYTE,UNSIGNED_SHORT:t.UNSIGNED_SHORT,UNSIGNED_INT:t.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(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,n,r){return t>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,r):new Uint16Array(e,n,r)},r(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,_,R){"use strict";function T(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;T.packedLength=e.packedLength+3,T.pack=function(t,n,i){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};var N=new e,h={radii:N,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return T.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 T(h))},T.createGeometry=function(e){var r,i,a,T,l,N,h=e._radii,d=o.fromCartesian3(h),I=e._stackPartitions,S=e._slicePartitions,M=e._subdivisions,O=M*(I+S-1),m=O-S+2,y=new Float64Array(3*m),C=c.createTypedArray(m,2*O),p=0,U=new Array(M),L=new Array(M);for(r=0;M>r;r++)a=_.TWO_PI*r/M,U[r]=A(a),L[r]=f(a);for(r=1;I>r;r++)for(T=Math.PI*r/I,l=A(T),N=f(T),i=0;M>i;i++)y[p++]=h.x*U[i]*N,y[p++]=h.y*L[i]*N,y[p++]=h.z*l;for(U.length=S,L.length=S,r=0;S>r;r++)a=_.TWO_PI*r/S,U[r]=A(a),L[r]=f(a);for(y[p++]=0,y[p++]=0,y[p++]=h.z,r=1;M>r;r++)for(T=Math.PI*r/M,l=A(T),N=f(T),i=0;S>i;i++)y[p++]=h.x*U[i]*N,y[p++]=h.y*L[i]*N,y[p++]=h.z*l;for(y[p++]=0,y[p++]=0,y[p++]=-h.z,p=0,r=0;I-1>r;++r){var F=r*M;for(i=0;M-1>i;++i)C[p++]=F+i,C[p++]=F+i+1;C[p++]=F+M-1,C[p++]=F}var P=M*(I-1);for(i=1;S+1>i;++i)C[p++]=P,C[p++]=P+i;for(r=0;M-2>r;++r){var v=r*S+1+P,D=(r+1)*S+1+P;for(i=0;S-1>i;++i)C[p++]=D+i,C[p++]=v+i;C[p++]=D+S-1,C[p++]=v+S-1}var B=y.length/3-1;for(i=B-1;i>B-S-1;--i)C[p++]=B,C[p++]=i;var w=new s({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:y})});return new u({attributes:w,indices:C,primitiveType:R.LINES,boundingSphere:t.fromEllipsoid(d)})},T}),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/Workers/createGeometry.js b/Workers/createGeometry.js index 7f609a9..850fa84 100644 --- a/Workers/createGeometry.js +++ b/Workers/createGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,23 @@ 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";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};r.EPSILON1=.1,r.EPSILON2=.01,r.EPSILON3=.001,r.EPSILON4=1e-4,r.EPSILON5=1e-5,r.EPSILON6=1e-6,r.EPSILON7=1e-7,r.EPSILON8=1e-8,r.EPSILON9=1e-9,r.EPSILON10=1e-10,r.EPSILON11=1e-11,r.EPSILON12=1e-12,r.EPSILON13=1e-13,r.EPSILON14=1e-14,r.EPSILON15=1e-15,r.EPSILON16=1e-16,r.EPSILON17=1e-17,r.EPSILON18=1e-18,r.EPSILON19=1e-19,r.EPSILON20=1e-20,r.GRAVITATIONALPARAMETER=3986004418e5,r.SOLAR_RADIUS=6955e5,r.LUNAR_RADIUS=1737400,r.SIXTY_FOUR_KILOBYTES=65536,r.sign=function(e){return e>0?1:0>e?-1:0},r.signNotZero=function(e){return 0>e?-1:1},r.toSNorm=function(e){return Math.round(255*(.5*r.clamp(e,-1,1)+.5))},r.fromSNorm=function(e){return 2*(r.clamp(e,0,255)/255)-1},r.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},r.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},r.lerp=function(e,t,r){return(1-r)*e+r*t},r.PI=Math.PI,r.ONE_OVER_PI=1/Math.PI,r.PI_OVER_TWO=.5*Math.PI,r.PI_OVER_THREE=Math.PI/3,r.PI_OVER_FOUR=Math.PI/4,r.PI_OVER_SIX=Math.PI/6,r.THREE_PI_OVER_TWO=.5*3*Math.PI,r.TWO_PI=2*Math.PI,r.ONE_OVER_TWO_PI=1/(2*Math.PI),r.RADIANS_PER_DEGREE=Math.PI/180,r.DEGREES_PER_RADIAN=180/Math.PI,r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600,r.toRadians=function(e){return e*r.RADIANS_PER_DEGREE},r.toDegrees=function(e){return e*r.DEGREES_PER_RADIAN},r.convertLongitudeRange=function(e){var t=r.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},r.negativePiToPi=function(e){for(var t=r.EPSILON10,n=r.PI,o=r.TWO_PI;-(n+t)>e;)e+=o;if(-n>e)return-n;for(;e>n+t;)e-=o;return e>n?n:e},r.zeroToTwoPi=function(e){var t=e%r.TWO_PI;return 0>t?(t+r.TWO_PI)%r.TWO_PI:t},r.equalsEpsilon=function(e,r,n){return n=t(n,0),Math.abs(e-r)<=n};var n=[1];r.factorial=function(e){var t=n.length;if(e>=t)for(var r=n[t-1],o=t;e>=o;o++)n.push(r*o);return n[e]},r.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},r.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},r.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},r.clamp=function(e,t,r){return t>e?t:e>r?r:e};var o=new e;return r.setRandomNumberSeed=function(t){o=new e(t)},r.nextRandomNumber=function(){return o.random()},r.acosClamped=function(e){return Math.acos(r.clamp(e,-1,1))},r.asinClamped=function(e){return Math.asin(r.clamp(e,-1,1))},r}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";var a=function(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)};a.fromSpherical=function(r,n){t(n)||(n=new a);var o=r.clock,i=r.cone,u=e(r.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(o),n.y=s*Math.sin(o),n.z=u*Math.cos(i),n},a.fromElements=function(e,r,n,o){return t(o)?(o.x=e,o.y=r,o.z=n,o):new a(e,r,n)},a.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new a(e.x,e.y,e.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z},a.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new a),o.x=r[n++],o.y=r[n++],o.z=r[n],o},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},a.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},a.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var i=new a;a.distance=function(e,t){return a.subtract(e,t,i),a.magnitude(i)},a.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var u=new a;a.lerp=function(e,t,r,n){return a.multiplyByScalar(t,r,u),n=a.multiplyByScalar(e,1-r,n),a.add(u,n,n)};var s=new a,c=new a;a.angleBetween=function(e,t){a.normalize(e,s),a.normalize(t,c);var r=a.dot(s,c),n=a.magnitude(a.cross(s,c,s));return Math.atan2(n,r)};var l=new a;a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,l);return a.abs(r,r),t=r.x<=r.y?r.x<=r.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):r.y<=r.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,t)},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z},a.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n},a.cross=function(e,t,r){var n=e.x,o=e.y,a=e.z,i=t.x,u=t.y,s=t.z,c=o*s-a*u,l=a*i-n*s,f=n*u-o*i;return r.x=c,r.y=l,r.z=f,r},a.fromDegrees=function(e,t,r,n,i){var u=o.toRadians(e),s=o.toRadians(t);return a.fromRadians(u,s,r,n,i)};var f=new a,m=new a,h=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(r,n,o,i,u){o=e(o,0);var s=t(i)?i.radiiSquared:h,c=Math.cos(n);f.x=c*Math.cos(r),f.y=c*Math.sin(r),f.z=Math.sin(n),f=a.normalize(f,f),a.multiplyComponents(s,f,m);var l=Math.sqrt(a.dot(f,m));return m=a.divideByScalar(m,l,m),f=a.multiplyByScalar(f,o,f),t(u)||(u=new a),a.add(m,f,u)},a.fromDegreesArray=function(e,t,r){for(var n=new Array(e.length),i=0;i<e.length;i++)n[i]=o.toRadians(e[i]);return a.fromRadiansArray(n,t,r)},a.fromRadiansArray=function(e,r,n){var o=e.length;t(n)?n.length=o/2:n=new Array(o/2);for(var i=0;o>i;i+=2){var u=e[i],s=e[i+1];n[i/2]=a.fromRadians(u,s,0,r,n[i/2])}return n},a.fromDegreesArrayHeights=function(e,t,r){for(var n=new Array(e.length),i=0;i<e.length;i+=3)n[i]=o.toRadians(e[i]),n[i+1]=o.toRadians(e[i+1]),n[i+2]=e[i+2];return a.fromRadiansArrayHeights(n,t,r)},a.fromRadiansArrayHeights=function(e,r,n){var o=e.length;t(n)?n.length=o/3:n=new Array(o/3);for(var i=0;o>i;i+=3){var u=e[i],s=e[i+1],c=e[i+2];n[i/3]=a.fromRadians(u,s,c,r,n[i/3])}return n},a.ZERO=n(new a(0,0,0)),a.UNIT_X=n(new a(1,0,0)),a.UNIT_Y=n(new a(0,1,0)),a.UNIT_Z=n(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";var a=function(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)};return a.fromRadians=function(r,n,o,i){return o=e(o,0),t(i)?(i.longitude=r,i.latitude=n,i.height=o,i):new a(r,n,o)},a.fromDegrees=function(e,t,r,n){return e=o.toRadians(e),t=o.toRadians(t),a.fromRadians(e,t,r,n)},a.clone=function(e,r){return t(e)?t(r)?(r.longitude=e.longitude,r.latitude=e.latitude,r.height=e.height,r):new a(e.longitude,e.latitude,e.height):void 0},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.longitude===r.longitude&&e.latitude===r.latitude&&e.height===r.height},a.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.longitude-r.longitude)<=n&&Math.abs(e.latitude-r.latitude)<=n&&Math.abs(e.height-r.height)<=n},a.ZERO=n(new a(0,0,0)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o,a,i,u){"use strict";function s(t,n,o,a){n=r(n,0),o=r(o,0),a=r(a,0),t._radii=new e(n,o,a),t._radiiSquared=new e(n*n,o*o,a*a),t._radiiToTheFourth=new e(n*n*n*n,o*o*o*o,a*a*a*a),t._oneOverRadii=new e(0===n?0:1/n,0===o?0:1/o,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===o?0:1/(o*o),0===a?0:1/(a*a)),t._minimumRadius=Math.min(n,o,a),t._maximumRadius=Math.max(n,o,a),t._centerToleranceSquared=u.EPSILON1}var c=function(e,t,r){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,s(this,e,t,r)};o(c.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),c.clone=function(t,r){if(!n(t))return void 0;var o=t._radii;return n(r)?(e.clone(o,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new c(o.x,o.y,o.z)},c.fromCartesian3=function(e,t){return n(t)||(t=new c),n(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=i(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=i(new c(1,1,1)),c.MOON=i(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,r){var o=t.longitude,a=t.latitude,i=Math.cos(a),u=i*Math.cos(o),s=i*Math.sin(o),c=Math.sin(a);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},c.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var l=new e,f=new e;c.prototype.cartographicToCartesian=function(t,r){var o=l,a=f;this.geodeticSurfaceNormalCartographic(t,o),e.multiplyComponents(this._radiiSquared,o,a);var i=Math.sqrt(e.dot(o,a));return e.divideByScalar(a,i,a),e.multiplyByScalar(o,t.height,o),n(r)||(r=new e),e.add(a,o,r)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var o=0;r>o;o++)t[o]=this.cartographicToCartesian(e[o],t[o]);return t};var m=new e,h=new e,d=new e;c.prototype.cartesianToCartographic=function(r,o){var a=this.scaleToGeodeticSurface(r,h);if(!n(a))return void 0;var i=this.geodeticSurfaceNormal(a,m),s=e.subtract(r,a,d),c=Math.atan2(i.y,i.x),l=Math.asin(i.z),f=u.sign(e.dot(s,r))*e.magnitude(s);return n(o)?(o.longitude=c,o.latitude=l,o.height=f,o):new t(c,l,f)},c.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var o=0;r>o;++o)t[o]=this.cartesianToCartographic(e[o],t[o]);return t};var p=new e,y=new e;return c.prototype.scaleToGeodeticSurface=function(t,r){var o=t.x,a=t.y,i=t.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,m=o*o*c*c,h=a*a*l*l,d=i*i*f*f,v=m+h+d,g=Math.sqrt(1/v),E=e.multiplyByScalar(t,g,p);if(v<this._centerToleranceSquared)return isFinite(g)?e.clone(E,r):void 0;var S=this._oneOverRadiiSquared,C=S.x,w=S.y,A=S.z,x=y;x.x=2*E.x*C,x.y=2*E.y*w,x.z=2*E.z*A;var b,T,M,R,O,I,N,L,z,P,D,F=(1-g)*e.magnitude(t)/(.5*e.magnitude(x)),_=0;do{F-=_,M=1/(1+F*C),R=1/(1+F*w),O=1/(1+F*A),I=M*M,N=R*R,L=O*O,z=I*M,P=N*R,D=L*O,b=m*I+h*N+d*L-1,T=m*z*C+h*P*w+d*D*A;var B=-2*T;_=b/B}while(Math.abs(b)>u.EPSILON12);return n(r)?(r.x=o*M,r.y=a*R,r.z=i*O,r):new e(o*M,a*R,i*O)},c.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var o=t.x,a=t.y,i=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(o*o*u.x+a*a*u.y+i*i*u.z);return e.multiplyByScalar(t,s,r)},c.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},c.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},c.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,o,a,i){"use strict";var u=function(e){this._ellipsoid=r(e,i.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return o(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var o=this._semimajorAxis,a=t.longitude*o,i=t.latitude*o,u=t.height;return n(r)?(r.x=a,r.y=i,r.z=u,r):new e(a,i,u)},u.prototype.unproject=function(e,r){var o=this._oneOverSemimajorAxis,a=e.x*o,i=e.y*o,u=e.z;return n(r)?(r.longitude=a,r.latitude=i,r.height=u,r):new t(a,i,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";var t=function(t,r){this.start=e(t,0),this.stop=e(r,0)};return t}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";var o=function(t,r,n,o){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(o,0)};o.fromElements=function(e,r,n,a,i){return t(i)?(i.x=e,i.y=r,i.z=n,i.w=a,i):new o(e,r,n,a)},o.fromColor=function(e,r){return t(r)?(r.x=e.red,r.y=e.green,r.z=e.blue,r.w=e.alpha,r):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r):new o(e.x,e.y,e.z,e.w):void 0},o.packedLength=4,o.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w},o.unpack=function(r,n,a){return n=e(n,0),t(a)||(a=new o),a.x=r[n++],a.y=r[n++],a.z=r[n++],a.w=r[n],a},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,t){return o.subtract(e,t,a),o.magnitude(a)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var i=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,i),n=o.multiplyByScalar(e,1-r,n),o.add(i,n,n)};var u=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,u);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):r.y<=r.z?r.y<=r.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z&&e.w===r.w},o.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n&&Math.abs(e.w-r.w)<=n},o.ZERO=n(new o(0,0,0,0)),o.UNIT_X=n(new o(1,0,0,0)),o.UNIT_Y=n(new o(0,1,0,0)),o.UNIT_Z=n(new o(0,0,1,0)),o.UNIT_W=n(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o,a){"use strict";function i(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function u(e){for(var t=0,r=0;3>r;++r){var n=e[c.getElementIndex(h[r],m[r])];t+=2*n*n}return Math.sqrt(t)}function s(e,t){for(var r=a.EPSILON15,n=0,o=1,i=0;3>i;++i){var u=Math.abs(e[c.getElementIndex(h[i],m[i])]);u>n&&(o=i,n=u)}var s=1,l=0,f=m[o],d=h[o];if(Math.abs(e[c.getElementIndex(d,f)])>r){var p,y=e[c.getElementIndex(d,d)],v=e[c.getElementIndex(f,f)],g=e[c.getElementIndex(d,f)],E=(y-v)/2/g;p=0>E?-1/(-E+Math.sqrt(1+E*E)):1/(E+Math.sqrt(1+E*E)),s=1/Math.sqrt(1+p*p),l=p*s}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(f,f)]=t[c.getElementIndex(d,d)]=s,t[c.getElementIndex(d,f)]=l,t[c.getElementIndex(f,d)]=-l,t}var c=function(e,r,n,o,a,i,u,s,c){this[0]=t(e,0),this[1]=t(o,0),this[2]=t(u,0),this[3]=t(r,0),this[4]=t(a,0),this[5]=t(s,0),this[6]=t(n,0),this[7]=t(i,0),this[8]=t(c,0)};c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,n,o){return n=t(n,0),r(o)||(o=new c),o[0]=e[n],o[1]=e[n+1],o[2]=e[n+2],o[3]=e[n+3],o[4]=e[n+4],o[5]=e[n+5],o[6]=e[n+6],o[7]=e[n+7],o[8]=e[n+8],o},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var n=e.x*e.x,o=e.x*e.y,a=e.x*e.z,i=e.x*e.w,u=e.y*e.y,s=e.y*e.z,l=e.y*e.w,f=e.z*e.z,m=e.z*e.w,h=e.w*e.w,d=n-u-f+h,p=2*(o-m),y=2*(a+l),v=2*(o+m),g=-n+u-f+h,E=2*(s-i),S=2*(a-l),C=2*(s+i),w=-n-u+f+h;return r(t)?(t[0]=d,t[1]=v,t[2]=S,t[3]=p,t[4]=g,t[5]=C,t[6]=y,t[7]=E,t[8]=w,t):new c(d,p,y,v,g,E,S,C,w)},c.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new c(e.x,0,0,0,e.y,0,0,0,e.z)},c.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new c(e,0,0,0,e,0,0,0,e)},c.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.fromRotationX=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=o,t[6]=0,t[7]=-o,t[8]=n,t):new c(1,0,0,0,n,-o,0,o,n)},c.fromRotationY=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-o,t[3]=0,t[4]=1,t[5]=0,t[6]=o,t[7]=0,t[8]=n,t):new c(n,0,o,0,1,0,-o,0,n)},c.fromRotationZ=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=n,t[1]=o,t[2]=0,t[3]=-o,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new c(n,-o,0,o,n,0,0,0,1)},c.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},c.getElementIndex=function(e,t){return 3*e+t},c.getColumn=function(e,t,r){var n=3*t,o=e[n],a=e[n+1],i=e[n+2];return r.x=o,r.y=a,r.z=i,r},c.setColumn=function(e,t,r,n){n=c.clone(e,n);var o=3*t;return n[o]=r.x,n[o+1]=r.y,n[o+2]=r.z,n},c.getRow=function(e,t,r){var n=e[t],o=e[t+3],a=e[t+6];return r.x=n,r.y=o,r.z=a,r},c.setRow=function(e,t,r,n){return n=c.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var l=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),r};var f=new e;c.getMaximumScale=function(t){return c.getScale(t,f),e.maximumComponent(f)},c.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],i=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=o,r[2]=a,r[3]=i,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=f,r},c.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},c.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},c.multiplyByVector=function(e,t,r){var n=t.x,o=t.y,a=t.z,i=e[0]*n+e[3]*o+e[6]*a,u=e[1]*n+e[4]*o+e[7]*a,s=e[2]*n+e[5]*o+e[8]*a;return r.x=i,r.y=u,r.z=s,r},c.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},c.transpose=function(e,t){var r=e[0],n=e[3],o=e[6],a=e[1],i=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=o,t[3]=a,t[4]=i,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var m=[1,0,0],h=[2,2,1],d=new c,p=new c;return c.computeEigenDecomposition=function(e,t){var n=a.EPSILON20,o=10,l=0,f=0;r(t)||(t={});for(var m=t.unitary=c.clone(c.IDENTITY,t.unitary),h=t.diagonal=c.clone(e,t.diagonal),y=n*i(h);o>f&&u(h)>y;)s(h,d),c.transpose(d,p),c.multiply(h,d,h),c.multiply(p,h,h),c.multiply(m,d,m),++l>2&&(++f,l=0);return t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},c.determinant=function(e){var t=e[0],r=e[3],n=e[6],o=e[1],a=e[4],i=e[7],u=e[2],s=e[5],c=e[8];return t*(a*c-s*i)+o*(s*n-r*c)+u*(r*i-a*n)},c.inverse=function(e,t){var r=e[0],o=e[1],i=e[2],u=e[3],s=e[4],l=e[5],f=e[6],m=e[7],h=e[8],d=c.determinant(e);if(Math.abs(d)<=a.EPSILON15)throw new n("matrix is not invertible");t[0]=s*h-m*l,t[1]=m*i-o*h,t[2]=o*l-s*i,t[3]=f*l-u*h,t[4]=r*h-f*i,t[5]=u*i-r*l,t[6]=u*m-f*s,t[7]=f*o-r*m,t[8]=r*s-u*o;var p=1/d;return c.multiplyByScalar(t,p,t)},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},c.IDENTITY=o(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,o,a,i,u,s){"use strict";var c=function(e,t,n,o,a,i,u,s,c,l,f,m,h,d,p,y){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),this[5]=r(i,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(p,0),this[12]=r(o,0),this[13]=r(s,0),this[14]=r(m,0),this[15]=r(y,0)};c.packedLength=16,c.pack=function(e,t,n){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]},c.unpack=function(e,t,o){return t=r(t,0),n(o)||(o=new c),o[0]=e[t++],o[1]=e[t++],o[2]=e[t++],o[3]=e[t++],o[4]=e[t++],o[5]=e[t++],o[6]=e[t++],o[7]=e[t++],o[8]=e[t++],o[9]=e[t++],o[10]=e[t++],o[11]=e[t++],o[12]=e[t++],o[13]=e[t++],o[14]=e[t++],o[15]=e[t],o},c.clone=function(e,t){return n(e)?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 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]):void 0},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 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,o,a){return o=r(o,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]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a):new c(t[0],t[3],t[6],o.x,t[1],t[4],t[7],o.y,t[2],t[5],t[8],o.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,r,o){n(o)||(o=new c);var a=r.x,i=r.y,u=r.z,s=t.x*t.x,l=t.x*t.y,f=t.x*t.z,m=t.x*t.w,h=t.y*t.y,d=t.y*t.z,p=t.y*t.w,y=t.z*t.z,v=t.z*t.w,g=t.w*t.w,E=s-h-y+g,S=2*(l-v),C=2*(f+p),w=2*(l+v),A=-s+h-y+g,x=2*(d-m),b=2*(f-p),T=2*(d+m),M=-s-h+y+g;return o[0]=E*a,o[1]=w*a,o[2]=b*a,o[3]=0,o[4]=S*i,o[5]=A*i,o[6]=T*i,o[7]=0,o[8]=C*u,o[9]=x*u,o[10]=M*u,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.IDENTITY,e,t)},c.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 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 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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,f=new e,m=new e;c.fromCamera=function(t,r){var o=t.eye,a=t.target,i=t.up;e.normalize(e.subtract(a,o,l),l),e.normalize(e.cross(l,i,f),f),e.normalize(e.cross(f,l,m),m);var u=f.x,s=f.y,h=f.z,d=l.x,p=l.y,y=l.z,v=m.x,g=m.y,E=m.z,S=o.x,C=o.y,w=o.z,A=u*-S+s*-C+h*-w,x=v*-S+g*-C+E*-w,b=d*S+p*C+y*w;return n(r)?(r[0]=u,r[1]=v,r[2]=-d,r[3]=0,r[4]=s,r[5]=g,r[6]=-p,r[7]=0,r[8]=h,r[9]=E,r[10]=-y,r[11]=0,r[12]=A,r[13]=x,r[14]=b,r[15]=1,r):new c(u,s,h,A,v,g,E,x,-d,-p,-y,b,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,r,n,o){var a=Math.tan(.5*e),i=1/a,u=i/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=i,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=-1,o[12]=0,o[13]=0,o[14]=c,o[15]=0,o},c.computeOrthographicOffCenter=function(e,t,r,n,o,a,i){var u=1/(t-e),s=1/(n-r),c=1/(a-o),l=-(t+e)*u,f=-(n+r)*s,m=-(a+o)*c;return u*=2,s*=2,c*=-2,i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=c,i[11]=0,i[12]=l,i[13]=f,i[14]=m,i[15]=1,i},c.computePerspectiveOffCenter=function(e,t,r,n,o,a,i){var u=2*o/(t-e),s=2*o/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),f=-(a+o)/(a-o),m=-1,h=-2*a*o/(a-o);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=c,i[9]=l,i[10]=f,i[11]=m,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},c.computeInfinitePerspectiveOffCenter=function(e,t,r,n,o,a){var i=2*o/(t-e),u=2*o/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,f=-1,m=-2*o;return a[0]=i,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=s,a[9]=c,a[10]=l,a[11]=f,a[12]=0,a[13]=0,a[14]=m,a[15]=0,a},c.computeViewportTransformation=function(e,t,n,o){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),i=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),m=c,h=l,d=f,p=a+c,y=i+l,v=t+f,g=1;return o[0]=m,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=d,o[11]=0,o[12]=p,o[13]=y,o[14]=v,o[15]=g,o},c.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]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,r){var n=4*t,o=e[n],a=e[n+1],i=e[n+2],u=e[n+3];return r.x=o,r.y=a,r.z=i,r.w=u,r},c.setColumn=function(e,t,r,n){n=c.clone(e,n);var o=4*t;return n[o]=r.x,n[o+1]=r.y,n[o+2]=r.z,n[o+3]=r.w,n},c.getRow=function(e,t,r){var n=e[t],o=e[t+4],a=e[t+8],i=e[t+12];return r.x=n,r.y=o,r.z=a,r.w=i,r},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 h=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],h)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],h)),r};var d=new e;c.getMaximumScale=function(t){return c.getScale(t,d),e.maximumComponent(d)},c.multiply=function(e,t,r){var n=e[0],o=e[1],a=e[2],i=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],m=e[9],h=e[10],d=e[11],p=e[12],y=e[13],v=e[14],g=e[15],E=t[0],S=t[1],C=t[2],w=t[3],A=t[4],x=t[5],b=t[6],T=t[7],M=t[8],R=t[9],O=t[10],I=t[11],N=t[12],L=t[13],z=t[14],P=t[15],D=n*E+u*S+f*C+p*w,F=o*E+s*S+m*C+y*w,_=a*E+c*S+h*C+v*w,B=i*E+l*S+d*C+g*w,U=n*A+u*x+f*b+p*T,G=o*A+s*x+m*b+y*T,q=a*A+c*x+h*b+v*T,k=i*A+l*x+d*b+g*T,W=n*M+u*R+f*O+p*I,V=o*M+s*R+m*O+y*I,Y=a*M+c*R+h*O+v*I,H=i*M+l*R+d*O+g*I,j=n*N+u*L+f*z+p*P,K=o*N+s*L+m*z+y*P,Z=a*N+c*L+h*z+v*P,X=i*N+l*L+d*z+g*P;return r[0]=D,r[1]=F,r[2]=_,r[3]=B,r[4]=U,r[5]=G,r[6]=q,r[7]=k,r[8]=W,r[9]=V,r[10]=Y,r[11]=H,r[12]=j,r[13]=K,r[14]=Z,r[15]=X,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],o=e[1],a=e[2],i=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],m=e[12],h=e[13],d=e[14],p=t[0],y=t[1],v=t[2],g=t[4],E=t[5],S=t[6],C=t[8],w=t[9],A=t[10],x=t[12],b=t[13],T=t[14],M=n*p+i*y+c*v,R=o*p+u*y+l*v,O=a*p+s*y+f*v,I=n*g+i*E+c*S,N=o*g+u*E+l*S,L=a*g+s*E+f*S,z=n*C+i*w+c*A,P=o*C+u*w+l*A,D=a*C+s*w+f*A,F=n*x+i*b+c*T+m,_=o*x+u*b+l*T+h,B=a*x+s*b+f*T+d;return r[0]=M,r[1]=R,r[2]=O,r[3]=0,r[4]=I,r[5]=N,r[6]=L,r[7]=0,r[8]=z,r[9]=P,r[10]=D,r[11]=0,r[12]=F,r[13]=_,r[14]=B,r[15]=1,r},c.multiplyByTranslation=function(e,t,r){var n=t.x,o=t.y,a=t.z,i=n*e[0]+o*e[4]+a*e[8]+e[12],u=n*e[1]+o*e[5]+a*e[9]+e[13],s=n*e[2]+o*e[6]+a*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=i,r[13]=u,r[14]=s,r[15]=e[15],r};var p=new e;c.multiplyByUniformScale=function(e,t,r){return p.x=t,p.y=t,p.z=t,c.multiplyByScale(e,p,r)},c.multiplyByScale=function(e,t,r){var n=t.x,o=t.y,a=t.z;return 1===n&&1===o&&1===a?c.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=o*e[4],r[5]=o*e[5],r[6]=o*e[6],r[7]=0,r[8]=a*e[8],r[9]=a*e[9],r[10]=a*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},c.multiplyByVector=function(e,t,r){var n=t.x,o=t.y,a=t.z,i=t.w,u=e[0]*n+e[4]*o+e[8]*a+e[12]*i,s=e[1]*n+e[5]*o+e[9]*a+e[13]*i,c=e[2]*n+e[6]*o+e[10]*a+e[14]*i,l=e[3]*n+e[7]*o+e[11]*a+e[15]*i;return r.x=u,r.y=s,r.z=c,r.w=l,r},c.multiplyByPointAsVector=function(e,t,r){var n=t.x,o=t.y,a=t.z,i=e[0]*n+e[4]*o+e[8]*a,u=e[1]*n+e[5]*o+e[9]*a,s=e[2]*n+e[6]*o+e[10]*a;return r.x=i,r.y=u,r.z=s,r},c.multiplyByPoint=function(e,t,r){var n=t.x,o=t.y,a=t.z,i=e[0]*n+e[4]*o+e[8]*a+e[12],u=e[1]*n+e[5]*o+e[9]*a+e[13],s=e[2]*n+e[6]*o+e[10]*a+e[14];return r.x=i,r.y=u,r.z=s,r},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],o=e[3],a=e[6],i=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=i,t[14]=u,t[15]=e[15],t},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||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]&&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]},c.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},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 y=new u,v=new u,g=new t,E=new t(0,0,0,1);return c.inverse=function(e,r){if(u.equalsEpsilon(c.getRotation(e,y),v,i.EPSILON7)&&t.equals(c.getRow(e,3,g),E))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],o=e[4],a=e[8],l=e[12],f=e[1],m=e[5],h=e[9],d=e[13],p=e[2],S=e[6],C=e[10],w=e[14],A=e[3],x=e[7],b=e[11],T=e[15],M=C*T,R=w*b,O=S*T,I=w*x,N=S*b,L=C*x,z=p*T,P=w*A,D=p*b,F=C*A,_=p*x,B=S*A,U=M*m+I*h+N*d-(R*m+O*h+L*d),G=R*f+z*h+F*d-(M*f+P*h+D*d),q=O*f+P*m+_*d-(I*f+z*m+B*d),k=L*f+D*m+B*h-(N*f+F*m+_*h),W=R*o+O*a+L*l-(M*o+I*a+N*l),V=M*n+P*a+D*l-(R*n+z*a+F*l),Y=I*n+z*o+B*l-(O*n+P*o+_*l),H=N*n+F*o+_*a-(L*n+D*o+B*a);M=a*d,R=l*h,O=o*d,I=l*m,N=o*h,L=a*m,z=n*d,P=l*f,D=n*h,F=a*f,_=n*m,B=o*f;var j=M*x+I*b+N*T-(R*x+O*b+L*T),K=R*A+z*b+F*T-(M*A+P*b+D*T),Z=O*A+P*x+_*T-(I*A+z*x+B*T),X=L*A+D*x+B*b-(N*A+F*x+_*b),Q=O*C+L*w+R*S-(N*w+M*S+I*C),J=D*w+M*p+P*C-(z*C+F*w+R*p),$=z*S+B*w+I*p-(_*w+O*p+P*S),et=_*C+N*p+F*S-(D*S+B*C+L*p),tt=n*U+o*G+a*q+l*k;if(Math.abs(tt)<i.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return tt=1/tt,r[0]=U*tt,r[1]=G*tt,r[2]=q*tt,r[3]=k*tt,r[4]=W*tt,r[5]=V*tt,r[6]=Y*tt,r[7]=H*tt,r[8]=j*tt,r[9]=K*tt,r[10]=Z*tt,r[11]=X*tt,r[12]=Q*tt,r[13]=J*tt,r[14]=$*tt,r[15]=et*tt,r},c.inverseTransformation=function(e,t){var r=e[0],n=e[1],o=e[2],a=e[4],i=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],m=e[13],h=e[14],d=-r*f-n*m-o*h,p=-a*f-i*m-u*h,y=-s*f-c*m-l*h;return t[0]=r,t[1]=a,t[2]=s,t[3]=0,t[4]=n,t[5]=i,t[6]=c,t[7]=0,t[8]=o,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=p,t[14]=y,t[15]=1,t},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,o,a,i){"use strict";var u=function(e,r,n,o){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(o,0)};u.fromDegrees=function(e,n,o,a,s){return e=i.toRadians(t(e,0)),n=i.toRadians(t(n,0)),o=i.toRadians(t(o,0)),a=i.toRadians(t(a,0)),r(s)?(s.west=e,s.south=n,s.east=o,s.north=a,s):new u(e,n,o,a)},u.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,i=-Number.MAX_VALUE,s=0,c=e.length;c>s;s++){var l=e[s];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),a=Math.min(a,l.latitude),i=Math.max(i,l.latitude)}return r(t)?(t.west=n,t.south=a,t.east=o,t.north=i,t):new u(n,a,o,i)},u.packedLength=4,u.pack=function(e,r,n){n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north},u.unpack=function(e,n,o){return n=t(n,0),r(o)||(o=new u),o.west=e[n++],o.south=e[n++],o.east=e[n++],o.north=e[n],o},u.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},u.validate=function(){},u.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},u.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},u.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},u.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},u.center=function(t,n){var o=t.east,a=t.west,u=.5*(a+o);return a>o&&(u=i.negativePiToPi(u+i.PI)),r(n)?(n.longitude=u,n.latitude=.5*(t.south+t.north),n.height=0,n):new e(u,.5*(t.south+t.north))},u.intersectWith=function(e,t,n){var o=Math.max(e.west,t.west),a=Math.max(e.south,t.south),i=Math.min(e.east,t.east),s=Math.min(e.north,t.north);return r(n)?(n.west=o,n.south=a,n.east=i,n.north=s,n):new u(o,a,i,s)},u.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},u.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var s=new e;return u.subsample=function(e,n,a,u){n=t(n,o.WGS84),a=t(a,0),r(u)||(u=[]);var c=0,l=e.north,f=e.south,m=e.east,h=e.west,d=s;d.height=a,d.longitude=h,d.latitude=l,u[c]=n.cartographicToCartesian(d,u[c]),c++,d.longitude=m,u[c]=n.cartographicToCartesian(d,u[c]),c++,d.latitude=f,u[c]=n.cartographicToCartesian(d,u[c]),c++,d.longitude=h,u[c]=n.cartographicToCartesian(d,u[c]),c++,d.latitude=0>l?l:f>0?f:0;for(var p=1;8>p;++p){var y=-Math.PI+p*i.PI_OVER_TWO;y>h&&m>y&&(d.longitude=y,u[c]=n.cartographicToCartesian(d,u[c]),c++)}return 0===d.latitude&&(d.longitude=h,u[c]=n.cartographicToCartesian(d,u[c]),c++,d.longitude=m,u[c]=n.cartographicToCartesian(d,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-i.PI_OVER_TWO,Math.PI,i.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,r,n,o,a,i,u,s,c,l){"use strict";var f=function(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)},m=new e,h=new e,d=new e,p=new e,y=new e,v=new e,g=new e,E=new e,S=new e,C=new e,w=new e,A=new e;f.fromPoints=function(t,r){if(n(r)||(r=new f),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var o=e.clone(t[0],g),a=e.clone(o,m),i=e.clone(o,h),u=e.clone(o,d),s=e.clone(o,p),c=e.clone(o,y),l=e.clone(o,v),x=t.length,b=1;x>b;b++){e.clone(t[b],o);var T=o.x,M=o.y,R=o.z;T<a.x&&e.clone(o,a),T>s.x&&e.clone(o,s),M<i.y&&e.clone(o,i),M>c.y&&e.clone(o,c),R<u.z&&e.clone(o,u),R>l.z&&e.clone(o,l)}var O=e.magnitudeSquared(e.subtract(s,a,E)),I=e.magnitudeSquared(e.subtract(c,i,E)),N=e.magnitudeSquared(e.subtract(l,u,E)),L=a,z=s,P=O;I>P&&(P=I,L=i,z=c),N>P&&(P=N,L=u,z=l);var D=S;D.x=.5*(L.x+z.x),D.y=.5*(L.y+z.y),D.z=.5*(L.z+z.z);var F=e.magnitudeSquared(e.subtract(z,D,E)),_=Math.sqrt(F),B=C;B.x=a.x,B.y=i.y,B.z=u.z;var U=w;U.x=s.x,U.y=c.y,U.z=l.z;var G=e.multiplyByScalar(e.add(B,U,E),.5,A),q=0;for(b=0;x>b;b++){e.clone(t[b],o);var k=e.magnitude(e.subtract(o,G,E));k>q&&(q=k);var W=e.magnitudeSquared(e.subtract(o,D,E));if(W>F){var V=Math.sqrt(W);_=.5*(_+V),F=_*_;var Y=V-_;D.x=(_*D.x+Y*o.x)/V,D.y=(_*D.y+Y*o.y)/V,D.z=(_*D.z+Y*o.z)/V}}return q>_?(e.clone(D,r.center),r.radius=_):(e.clone(G,r.center),r.radius=q),r};var x=new i,b=new e,T=new e,M=new t,R=new t;f.fromRectangle2D=function(e,t,r){return f.fromRectangleWithHeights2D(e,t,0,0,r)},f.fromRectangleWithHeights2D=function(t,o,a,i,u){if(n(u)||(u=new f),!n(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;o=r(o,x),l.southwest(t,M),M.height=a,l.northeast(t,R),R.height=i;var s=o.project(M,b),c=o.project(R,T),m=c.x-s.x,h=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(m*m+h*h+d*d);var p=u.center;return p.x=s.x+.5*m,p.y=s.y+.5*h,p.z=s.z+.5*d,u};var O=[];f.fromRectangle3D=function(e,t,o,i){t=r(t,a.WGS84),o=r(o,0);var u;return n(e)&&(u=l.subsample(e,t,o,O)),f.fromPoints(u,i)},f.fromVertices=function(t,o,a,i){if(n(i)||(i=new f),!n(t)||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;o=r(o,e.ZERO),a=r(a,3);var u=g;u.x=t[0]+o.x,u.y=t[1]+o.y,u.z=t[2]+o.z;for(var s=e.clone(u,m),c=e.clone(u,h),l=e.clone(u,d),x=e.clone(u,p),b=e.clone(u,y),T=e.clone(u,v),M=t.length,R=0;M>R;R+=a){var O=t[R]+o.x,I=t[R+1]+o.y,N=t[R+2]+o.z;u.x=O,u.y=I,u.z=N,O<s.x&&e.clone(u,s),O>x.x&&e.clone(u,x),I<c.y&&e.clone(u,c),I>b.y&&e.clone(u,b),N<l.z&&e.clone(u,l),N>T.z&&e.clone(u,T)}var L=e.magnitudeSquared(e.subtract(x,s,E)),z=e.magnitudeSquared(e.subtract(b,c,E)),P=e.magnitudeSquared(e.subtract(T,l,E)),D=s,F=x,_=L;z>_&&(_=z,D=c,F=b),P>_&&(_=P,D=l,F=T);var B=S;B.x=.5*(D.x+F.x),B.y=.5*(D.y+F.y),B.z=.5*(D.z+F.z);var U=e.magnitudeSquared(e.subtract(F,B,E)),G=Math.sqrt(U),q=C;q.x=s.x,q.y=c.y,q.z=l.z;var k=w;k.x=x.x,k.y=b.y,k.z=T.z;var W=e.multiplyByScalar(e.add(q,k,E),.5,A),V=0;for(R=0;M>R;R+=a){u.x=t[R]+o.x,u.y=t[R+1]+o.y,u.z=t[R+2]+o.z;var Y=e.magnitude(e.subtract(u,W,E));Y>V&&(V=Y);var H=e.magnitudeSquared(e.subtract(u,B,E));if(H>U){var j=Math.sqrt(H);G=.5*(G+j),U=G*G;var K=j-G;B.x=(G*B.x+K*u.x)/j,B.y=(G*B.y+K*u.y)/j,B.z=(G*B.z+K*u.z)/j}}return V>G?(e.clone(B,i.center),i.radius=G):(e.clone(W,i.center),i.radius=V),i},f.fromCornerPoints=function(t,r,o){n(o)||(o=new f);var a=o.center;return e.add(t,r,a),e.multiplyByScalar(a,.5,a),o.radius=e.distance(a,r),o},f.fromEllipsoid=function(t,r){return n(r)||(r=new f),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r},f.clone=function(t,r){return n(t)?n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius):void 0},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var o=e.center;t[n++]=o.x,t[n++]=o.y,t[n++]=o.z,t[n]=e.radius},f.unpack=function(e,t,o){t=r(t,0),n(o)||(o=new f);var a=o.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],o.radius=e[t],o};var I=new e,N=new e;f.union=function(t,r,o){n(o)||(o=new f);var a=t.center,i=r.center;e.add(a,i,N);var u=e.multiplyByScalar(N,.5,N),s=e.magnitude(e.subtract(a,u,I))+t.radius,c=e.magnitude(e.subtract(i,u,I))+r.radius;return o.radius=Math.max(s,c),e.clone(u,o.center),o};var L=new e;f.expand=function(t,r,n){n=f.clone(t,n);var o=e.magnitude(e.subtract(r,n.center,L));return o>n.radius&&(n.radius=o),n},f.intersect=function(t,r){var n=t.center,o=t.radius,a=e.dot(r,n)+r.w;return-o>a?u.OUTSIDE:o>a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=c.getMaximumScale(t)*e.radius,r};var z=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,z);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var P=new e;f.computePlaneDistances=function(t,r,o,a){n(a)||(a=new s);var i=e.subtract(t.center,r,P),u=e.multiplyByScalar(o,e.dot(o,i),P),c=e.magnitude(u);return a.start=c-t.radius,a.stop=c+t.radius,a};for(var D=new e,F=new e,_=new e,B=new e,U=new e,G=new t,q=new Array(8),k=0;8>k;++k)q[k]=new e;var W=new i;return f.projectTo2D=function(t,n,o){n=r(n,W);var a=n.ellipsoid,i=t.center,u=t.radius,s=a.geodeticSurfaceNormal(i,D),c=e.cross(e.UNIT_Z,s,F);e.normalize(c,c);var l=e.cross(s,c,_);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var m=e.negate(l,U),h=e.negate(c,B),d=q,p=d[0];e.add(s,l,p),e.add(p,c,p),p=d[1],e.add(s,l,p),e.add(p,h,p),p=d[2],e.add(s,m,p),e.add(p,h,p),p=d[3],e.add(s,m,p),e.add(p,c,p),e.negate(s,s),p=d[4],e.add(s,l,p),e.add(p,c,p),p=d[5],e.add(s,l,p),e.add(p,h,p),p=d[6],e.add(s,m,p),e.add(p,h,p),p=d[7],e.add(s,m,p),e.add(p,c,p);for(var y=d.length,v=0;y>v;++v){var g=d[v];e.add(i,g,g);var E=a.cartesianToCartographic(g,G);n.project(E,g)}o=f.fromPoints(d,o),i=o.center;var S=i.x,C=i.y,w=i.z;return i.x=w,i.y=S,i.z=C,o},f.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersect=function(e){return f.intersect(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},o={};return t(o,{element:{get:function(){return o.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return o.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return o.supportsFullscreen()?null!==o.element:void 0}}}),o.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var o,a=["webkit","moz","o","ms","khtml"],i=0,u=a.length;u>i;++i){var s=a[i];o=s+"RequestFullscreen","function"==typeof t[o]?(n.requestFullscreen=o,r=!0):(o=s+"RequestFullScreen","function"==typeof t[o]&&(n.requestFullscreen=o,r=!0)),o=s+"ExitFullscreen","function"==typeof document[o]?n.exitFullscreen=o:(o=s+"CancelFullScreen","function"==typeof document[o]&&(n.exitFullscreen=o)),o=s+"FullscreenEnabled",e(document[o])?n.fullscreenEnabled=o:(o=s+"FullScreenEnabled",e(document[o])&&(n.fullscreenEnabled=o)),o=s+"FullscreenElement",e(document[o])?n.fullscreenElement=o:(o=s+"FullScreenElement",e(document[o])&&(n.fullscreenElement=o)),o=s+"fullscreenchange",e(document["on"+o])&&("ms"===s&&(o="MSFullscreenChange"),n.fullscreenchange=o),o=s+"fullscreenerror",e(document["on"+o])&&("ms"===s&&(o="MSFullscreenError"),n.fullscreenerror=o)}return r},o.requestFullscreen=function(e){o.supportsFullscreen()&&e[n.requestFullscreen]()},o.exitFullscreen=function(){o.supportsFullscreen()&&document[n.exitFullscreen]()},o}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function n(e){for(var t=e.split("."),r=0,n=t.length;n>r;++r)t[r]=parseInt(t[r],10);return t}function o(){if(!t(d)){d=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(d=!0,p=n(e[1]))}return d}function a(){return o()&&p}function i(){if(!t(y)&&(y=!1,!o()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(y=!0,v=n(e[1]))}return y}function u(){return i()&&v}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(g=!0,E=n(e[1]),E.isNightly=!!e[2])}return g}function c(){return s()&&E}function l(){if(!t(S)){S=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(S=!0,C=n(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(S=!0,C=n(e[1])))}return S}function f(){return l()&&C}function m(){if(!t(w)){w=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(w=!0,A=n(e[1]))}return w}function h(){return m()&&A}var d,p,y,v,g,E,S,C,w,A,x={isChrome:o,chromeVersion:a,isSafari:i,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:m,firefoxVersion:h,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};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,o,a){"use strict";function i(e,t,r){return 0>r&&(r+=1),r>1&&(r-=1),1>6*r?e+6*(t-e)*r:1>2*r?t:2>3*r?e+6*(t-e)*(2/3-r):e}var u=function(t,r,n,o){this.red=e(t,1),this.green=e(r,1),this.blue=e(n,1),this.alpha=e(o,1)};u.fromCartesian4=function(e,r){return t(r)?(r.red=e.x,r.green=e.y,r.blue=e.z,r.alpha=e.w,r):new u(e.x,e.y,e.z,e.w)},u.fromBytes=function(t,r,n,o){return t=u.byteToFloat(e(t,255)),r=u.byteToFloat(e(r,255)),n=u.byteToFloat(e(n,255)),o=u.byteToFloat(e(o,255)),new u(t,r,n,o)};var s,c,l;n.supportsTypedArrays()&&(s=new ArrayBuffer(4),c=new Uint32Array(s),l=new Uint8Array(s)),u.fromRgba=function(e){return c[0]=e,u.fromBytes(l[0],l[1],l[2],l[3])},u.fromHsl=function(t,r,n,o){t=e(t,0)%1,r=e(r,0),n=e(n,0),o=e(o,1);var a=n,s=n,c=n;if(0!==r){var l;l=.5>n?n*(1+r):n+r-n*r;var f=2*n-l;a=i(f,l,t+1/3),s=i(f,l,t),c=i(f,l,t-1/3)}return new u(a,s,c,o)},u.fromRandom=function(r,n){r=e(r,e.EMPTY_OBJECT);var o=r.red;if(!t(o)){var i=e(r.minimumRed,0),s=e(r.maximumRed,1);o=i+a.nextRandomNumber()*(s-i)}var c=r.green;if(!t(c)){var l=e(r.minimumGreen,0),f=e(r.maximumGreen,1);c=l+a.nextRandomNumber()*(f-l)}var m=r.blue;if(!t(m)){var h=e(r.minimumBlue,0),d=e(r.maximumBlue,1);m=h+a.nextRandomNumber()*(d-h)}var p=r.alpha;if(!t(p)){var y=e(r.minimumAlpha,0),v=e(r.maximumAlpha,1);p=y+a.nextRandomNumber()*(v-y)}return t(n)?(n.red=o,n.green=c,n.blue=m,n.alpha=p,n):new u(o,c,m,p)};var f=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,m=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,h=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,d=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return u.fromCssColorString=function(r){var n=u[r.toUpperCase()];if(t(n))return u.clone(n);var o=f.exec(r);return null!==o?new u(parseInt(o[1],16)/15,parseInt(o[2],16)/15,parseInt(o[3],16)/15):(o=m.exec(r),null!==o?new u(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255):(o=h.exec(r),null!==o?new u(parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),parseFloat(e(o[4],"1.0"))):(o=d.exec(r),null!==o?u.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(e(o[4],"1.0"))):void 0)))},u.packedLength=4,u.pack=function(t,r,n){n=e(n,0),r[n++]=t.red,r[n++]=t.green,r[n++]=t.blue,r[n]=t.alpha},u.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new u),o.red=r[n++],o.green=r[n++],o.blue=r[n++],o.alpha=r[n],o},u.byteToFloat=function(e){return e/255},u.floatToByte=function(e){return 1===e?255:0|256*e},u.clone=function(e,r){return t(e)?t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=e.alpha,r):new u(e.red,e.green,e.blue,e.alpha):void 0},u.equals=function(e,r){return e===r||t(e)&&t(r)&&e.red===r.red&&e.green===r.green&&e.blue===r.blue&&e.alpha===r.alpha},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,r){return this===e||t(e)&&Math.abs(this.red-e.red)<=r&&Math.abs(this.green-e.green)<=r&&Math.abs(this.blue-e.blue)<=r&&Math.abs(this.alpha-e.alpha)<=r},u.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},u.prototype.toCssColorString=function(){var e=u.floatToByte(this.red),t=u.floatToByte(this.green),r=u.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+r+")":"rgba("+e+","+t+","+r+","+this.alpha+")"},u.prototype.toBytes=function(e){var r=u.floatToByte(this.red),n=u.floatToByte(this.green),o=u.floatToByte(this.blue),a=u.floatToByte(this.alpha);return t(e)?(e[0]=r,e[1]=n,e[2]=o,e[3]=a,e):[r,n,o,a]},u.prototype.toRgba=function(){return l[0]=u.floatToByte(this.red),l[1]=u.floatToByte(this.green),l[2]=u.floatToByte(this.blue),l[3]=u.floatToByte(this.alpha),c[0]},u.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.ALICEBLUE=o(u.fromCssColorString("#F0F8FF")),u.ANTIQUEWHITE=o(u.fromCssColorString("#FAEBD7")),u.AQUA=o(u.fromCssColorString("#00FFFF")),u.AQUAMARINE=o(u.fromCssColorString("#7FFFD4")),u.AZURE=o(u.fromCssColorString("#F0FFFF")),u.BEIGE=o(u.fromCssColorString("#F5F5DC")),u.BISQUE=o(u.fromCssColorString("#FFE4C4")),u.BLACK=o(u.fromCssColorString("#000000")),u.BLANCHEDALMOND=o(u.fromCssColorString("#FFEBCD")),u.BLUE=o(u.fromCssColorString("#0000FF")),u.BLUEVIOLET=o(u.fromCssColorString("#8A2BE2")),u.BROWN=o(u.fromCssColorString("#A52A2A")),u.BURLYWOOD=o(u.fromCssColorString("#DEB887")),u.CADETBLUE=o(u.fromCssColorString("#5F9EA0")),u.CHARTREUSE=o(u.fromCssColorString("#7FFF00")),u.CHOCOLATE=o(u.fromCssColorString("#D2691E")),u.CORAL=o(u.fromCssColorString("#FF7F50")),u.CORNFLOWERBLUE=o(u.fromCssColorString("#6495ED")),u.CORNSILK=o(u.fromCssColorString("#FFF8DC")),u.CRIMSON=o(u.fromCssColorString("#DC143C")),u.CYAN=o(u.fromCssColorString("#00FFFF")),u.DARKBLUE=o(u.fromCssColorString("#00008B")),u.DARKCYAN=o(u.fromCssColorString("#008B8B")),u.DARKGOLDENROD=o(u.fromCssColorString("#B8860B")),u.DARKGRAY=o(u.fromCssColorString("#A9A9A9")),u.DARKGREEN=o(u.fromCssColorString("#006400")),u.DARKGREY=u.DARKGRAY,u.DARKKHAKI=o(u.fromCssColorString("#BDB76B")),u.DARKMAGENTA=o(u.fromCssColorString("#8B008B")),u.DARKOLIVEGREEN=o(u.fromCssColorString("#556B2F")),u.DARKORANGE=o(u.fromCssColorString("#FF8C00")),u.DARKORCHID=o(u.fromCssColorString("#9932CC")),u.DARKRED=o(u.fromCssColorString("#8B0000")),u.DARKSALMON=o(u.fromCssColorString("#E9967A")),u.DARKSEAGREEN=o(u.fromCssColorString("#8FBC8F")),u.DARKSLATEBLUE=o(u.fromCssColorString("#483D8B")),u.DARKSLATEGRAY=o(u.fromCssColorString("#2F4F4F")),u.DARKSLATEGREY=u.DARKSLATEGRAY,u.DARKTURQUOISE=o(u.fromCssColorString("#00CED1")),u.DARKVIOLET=o(u.fromCssColorString("#9400D3")),u.DEEPPINK=o(u.fromCssColorString("#FF1493")),u.DEEPSKYBLUE=o(u.fromCssColorString("#00BFFF")),u.DIMGRAY=o(u.fromCssColorString("#696969")),u.DIMGREY=u.DIMGRAY,u.DODGERBLUE=o(u.fromCssColorString("#1E90FF")),u.FIREBRICK=o(u.fromCssColorString("#B22222")),u.FLORALWHITE=o(u.fromCssColorString("#FFFAF0")),u.FORESTGREEN=o(u.fromCssColorString("#228B22")),u.FUSCHIA=o(u.fromCssColorString("#FF00FF")),u.GAINSBORO=o(u.fromCssColorString("#DCDCDC")),u.GHOSTWHITE=o(u.fromCssColorString("#F8F8FF")),u.GOLD=o(u.fromCssColorString("#FFD700")),u.GOLDENROD=o(u.fromCssColorString("#DAA520")),u.GRAY=o(u.fromCssColorString("#808080")),u.GREEN=o(u.fromCssColorString("#008000")),u.GREENYELLOW=o(u.fromCssColorString("#ADFF2F")),u.GREY=u.GRAY,u.HONEYDEW=o(u.fromCssColorString("#F0FFF0")),u.HOTPINK=o(u.fromCssColorString("#FF69B4")),u.INDIANRED=o(u.fromCssColorString("#CD5C5C")),u.INDIGO=o(u.fromCssColorString("#4B0082")),u.IVORY=o(u.fromCssColorString("#FFFFF0")),u.KHAKI=o(u.fromCssColorString("#F0E68C")),u.LAVENDER=o(u.fromCssColorString("#E6E6FA")),u.LAVENDAR_BLUSH=o(u.fromCssColorString("#FFF0F5")),u.LAWNGREEN=o(u.fromCssColorString("#7CFC00")),u.LEMONCHIFFON=o(u.fromCssColorString("#FFFACD")),u.LIGHTBLUE=o(u.fromCssColorString("#ADD8E6")),u.LIGHTCORAL=o(u.fromCssColorString("#F08080")),u.LIGHTCYAN=o(u.fromCssColorString("#E0FFFF")),u.LIGHTGOLDENRODYELLOW=o(u.fromCssColorString("#FAFAD2")),u.LIGHTGRAY=o(u.fromCssColorString("#D3D3D3")),u.LIGHTGREEN=o(u.fromCssColorString("#90EE90")),u.LIGHTGREY=u.LIGHTGRAY,u.LIGHTPINK=o(u.fromCssColorString("#FFB6C1")),u.LIGHTSEAGREEN=o(u.fromCssColorString("#20B2AA")),u.LIGHTSKYBLUE=o(u.fromCssColorString("#87CEFA")),u.LIGHTSLATEGRAY=o(u.fromCssColorString("#778899")),u.LIGHTSLATEGREY=u.LIGHTSLATEGRAY,u.LIGHTSTEELBLUE=o(u.fromCssColorString("#B0C4DE")),u.LIGHTYELLOW=o(u.fromCssColorString("#FFFFE0")),u.LIME=o(u.fromCssColorString("#00FF00")),u.LIMEGREEN=o(u.fromCssColorString("#32CD32")),u.LINEN=o(u.fromCssColorString("#FAF0E6")),u.MAGENTA=o(u.fromCssColorString("#FF00FF")),u.MAROON=o(u.fromCssColorString("#800000")),u.MEDIUMAQUAMARINE=o(u.fromCssColorString("#66CDAA")),u.MEDIUMBLUE=o(u.fromCssColorString("#0000CD")),u.MEDIUMORCHID=o(u.fromCssColorString("#BA55D3")),u.MEDIUMPURPLE=o(u.fromCssColorString("#9370DB")),u.MEDIUMSEAGREEN=o(u.fromCssColorString("#3CB371")),u.MEDIUMSLATEBLUE=o(u.fromCssColorString("#7B68EE")),u.MEDIUMSPRINGGREEN=o(u.fromCssColorString("#00FA9A")),u.MEDIUMTURQUOISE=o(u.fromCssColorString("#48D1CC")),u.MEDIUMVIOLETRED=o(u.fromCssColorString("#C71585")),u.MIDNIGHTBLUE=o(u.fromCssColorString("#191970")),u.MINTCREAM=o(u.fromCssColorString("#F5FFFA")),u.MISTYROSE=o(u.fromCssColorString("#FFE4E1")),u.MOCCASIN=o(u.fromCssColorString("#FFE4B5")),u.NAVAJOWHITE=o(u.fromCssColorString("#FFDEAD")),u.NAVY=o(u.fromCssColorString("#000080")),u.OLDLACE=o(u.fromCssColorString("#FDF5E6")),u.OLIVE=o(u.fromCssColorString("#808000")),u.OLIVEDRAB=o(u.fromCssColorString("#6B8E23")),u.ORANGE=o(u.fromCssColorString("#FFA500")),u.ORANGERED=o(u.fromCssColorString("#FF4500")),u.ORCHID=o(u.fromCssColorString("#DA70D6")),u.PALEGOLDENROD=o(u.fromCssColorString("#EEE8AA")),u.PALEGREEN=o(u.fromCssColorString("#98FB98")),u.PALETURQUOISE=o(u.fromCssColorString("#AFEEEE")),u.PALEVIOLETRED=o(u.fromCssColorString("#DB7093")),u.PAPAYAWHIP=o(u.fromCssColorString("#FFEFD5")),u.PEACHPUFF=o(u.fromCssColorString("#FFDAB9")),u.PERU=o(u.fromCssColorString("#CD853F")),u.PINK=o(u.fromCssColorString("#FFC0CB")),u.PLUM=o(u.fromCssColorString("#DDA0DD")),u.POWDERBLUE=o(u.fromCssColorString("#B0E0E6")),u.PURPLE=o(u.fromCssColorString("#800080")),u.RED=o(u.fromCssColorString("#FF0000")),u.ROSYBROWN=o(u.fromCssColorString("#BC8F8F")),u.ROYALBLUE=o(u.fromCssColorString("#4169E1")),u.SADDLEBROWN=o(u.fromCssColorString("#8B4513")),u.SALMON=o(u.fromCssColorString("#FA8072")),u.SANDYBROWN=o(u.fromCssColorString("#F4A460")),u.SEAGREEN=o(u.fromCssColorString("#2E8B57")),u.SEASHELL=o(u.fromCssColorString("#FFF5EE")),u.SIENNA=o(u.fromCssColorString("#A0522D")),u.SILVER=o(u.fromCssColorString("#C0C0C0")),u.SKYBLUE=o(u.fromCssColorString("#87CEEB")),u.SLATEBLUE=o(u.fromCssColorString("#6A5ACD")),u.SLATEGRAY=o(u.fromCssColorString("#708090")),u.SLATEGREY=u.SLATEGRAY,u.SNOW=o(u.fromCssColorString("#FFFAFA")),u.SPRINGGREEN=o(u.fromCssColorString("#00FF7F")),u.STEELBLUE=o(u.fromCssColorString("#4682B4")),u.TAN=o(u.fromCssColorString("#D2B48C")),u.TEAL=o(u.fromCssColorString("#008080")),u.THISTLE=o(u.fromCssColorString("#D8BFD8")),u.TOMATO=o(u.fromCssColorString("#FF6347")),u.TURQUOISE=o(u.fromCssColorString("#40E0D0")),u.VIOLET=o(u.fromCssColorString("#EE82EE")),u.WHEAT=o(u.fromCssColorString("#F5DEB3")),u.WHITE=o(u.fromCssColorString("#FFFFFF")),u.WHITESMOKE=o(u.fromCssColorString("#F5F5F5")),u.YELLOW=o(u.fromCssColorString("#FFFF00")),u.YELLOWGREEN=o(u.fromCssColorString("#9ACD32")),u -}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,r,n,o){"use strict";if(!n.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return t(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(t,n,o,i){switch(o=e(o,0),i=e(i,(n.byteLength-o)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(n,o,i);case a.UNSIGNED_BYTE:return new Uint8Array(n,o,i);case a.SHORT:return new Int16Array(n,o,i);case a.UNSIGNED_SHORT:return new Uint16Array(n,o,i);case a.FLOAT:return new Float32Array(n,o,i);case a.DOUBLE:return new Float64Array(n,o,i);default:throw new r("componentDatatype is not a valid value.")}},o(a)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject"],function(e){"use strict";var t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===t.POINTS||e===t.LINES||e===t.LINE_LOOP||e===t.LINE_STRIP||e===t.TRIANGLES||e===t.TRIANGLE_STRIP||e===t.TRIANGLE_FAN}};return e(t)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,o){"use strict";var a=function(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,o.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE)};return a.computeNumberOfVertices=function(e){var n=-1;for(var o in e.attributes)if(e.attributes.hasOwnProperty(o)&&t(e.attributes[o])&&t(e.attributes[o].values)){var a=e.attributes[o],i=a.values.length/a.componentsPerAttribute;if(n!==i&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=i}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";var a=function(t,r){this.x=e(t,0),this.y=e(r,0)};a.fromElements=function(e,r,n){return t(n)?(n.x=e,n.y=r,n):new a(e,r)},a.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new a(e.x,e.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n]=t.y},a.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new a),o.x=r[n++],o.y=r[n],o},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y)},a.minimumComponent=function(e){return Math.min(e.x,e.y)},a.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},a.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var i=new a;a.distance=function(e,t){return a.subtract(e,t,i),a.magnitude(i)},a.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var u=new a;a.lerp=function(e,t,r,n){return a.multiplyByScalar(t,r,u),n=a.multiplyByScalar(e,1-r,n),a.add(u,n,n)};var s=new a,c=new a;a.angleBetween=function(e,t){return a.normalize(e,s),a.normalize(t,c),o.acosClamped(a.dot(s,c))};var l=new a;return a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,l);return a.abs(r,r),t=r.x<=r.y?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Y,t)},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y},a.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n},a.ZERO=n(new a(0,0)),a.UNIT_X=n(new a(1,0)),a.UNIT_Y=n(new a(0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,o){"use strict";var a={};a.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=t.x,n=t.y;t.x=(1-Math.abs(n))*o.signNotZero(r),t.y=(1-Math.abs(r))*o.signNotZero(n)}return t.x=o.toSNorm(t.x),t.y=o.toSNorm(t.y),t},a.octDecode=function(e,r,n){if(n.x=o.fromSNorm(e),n.y=o.fromSNorm(r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var a=n.x;n.x=(1-Math.abs(n.y))*o.signNotZero(a),n.y=(1-Math.abs(a))*o.signNotZero(n.y)}return t.normalize(n,n)},a.octPackFloat=function(e){return 256*e.x+e.y};var i=new e;return a.octEncodeFloat=function(e){return a.octEncode(e,i),a.octPackFloat(i)},a.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),o=256*(r-n);return a.octDecode(n,o,t)},a.octPack=function(e,t,r,n){var o=a.octEncodeFloat(e),u=a.octEncodeFloat(t),s=a.octEncode(r,i);return n.x=65536*s.x+o,n.y=65536*s.y+u,n},a.octUnpack=function(e,t,r,n){var o=e.x/65536,i=Math.floor(o),u=65536*(o-i);o=e.y/65536;var s=Math.floor(o),c=65536*(o-s);a.octDecodeFloat(u,t),a.octDecodeFloat(c,r),a.octDecode(i,s,n)},a.compressTextureCoordinates=function(e){var t=1===e.x?4095:0|4096*e.x,r=1===e.y?4095:0|4096*e.y;return 4096*t+r},a.decompressTextureCoordinates=function(e,t){var r=e/4096;return t.x=Math.floor(r)/4096,t.y=r-Math.floor(r),t},a}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=new t,o=new t,a=new t,i=function(i,u,s,c,l){r(l)||(l=new t);var f,m,h,d,p,y,v,g;r(u.z)?(f=t.subtract(s,u,n),m=t.subtract(c,u,o),h=t.subtract(i,u,a),d=t.dot(f,f),p=t.dot(f,m),y=t.dot(f,h),v=t.dot(m,m),g=t.dot(m,h)):(f=e.subtract(s,u,n),m=e.subtract(c,u,o),h=e.subtract(i,u,a),d=e.dot(f,f),p=e.dot(f,m),y=e.dot(f,h),v=e.dot(m,m),g=e.dot(m,h));var E=1/(d*v-p*p);return l.y=(v*y-p*g)*E,l.z=(d*g-p*y)*E,l.x=1-l.y-l.z,l};return i}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)};r.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var n={high:0,low:0};r.fromCartesian=function(e,o){t(o)||(o=new r);var a=o.high,i=o.low;return r.encode(e.x,n),a.x=n.high,i.x=n.low,r.encode(e.y,n),a.y=n.high,i.y=n.low,r.encode(e.z,n),a.z=n.high,i.z=n.low,o};var o=new r;return r.writeElements=function(e,t,n){r.fromCartesian(e,o);var a=o.high,i=o.low;t[n]=a.x,t[n+1]=a.y,t[n+2]=a.z,t[n+3]=i.x,t[n+4]=i.y,t[n+5]=i.z},r}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n){"use strict";var o={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};return o.getSizeInBytes=function(e){switch(e){case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},o.validate=function(t){return e(t)&&(t===o.UNSIGNED_BYTE||t===o.UNSIGNED_SHORT||t===o.UNSIGNED_INT)},o.createTypedArray=function(e,t){return e>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},o.createTypedArrayFromArrayBuffer=function(e,t,r,o){return e>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,o):new Uint16Array(t,r,o)},r(o)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var o=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(o/Math.max(Math.abs(e),Math.abs(r)))<n?0:o}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,o){var a;if(0===e)return 0===n?[]:[-o/n];if(0===n){if(0===o)return[0,0];var i=Math.abs(o),u=Math.abs(e);if(u>i&&i/u<t.EPSILON14)return[0,0];if(i>u&&u/i<t.EPSILON14)return[];if(a=-o/e,0>a)return[];var s=Math.sqrt(a);return[-s,s]}if(0===o)return a=-n/e,0>a?[a,0]:[0,a];var c=n*n,l=4*e*o,f=r(c,-l,t.EPSILON14);if(0>f)return[];var m=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[m/e,o/m]:[o/m,m/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var o,a,i=e,u=t/3,s=r/3,c=n,l=i*s,f=u*c,m=u*u,h=s*s,d=i*s-m,p=i*c-u*s,y=u*c-h,v=4*d*y-p*p;if(0>v){var g,E,S;m*f>=l*h?(g=i,E=d,S=-2*u*d+i*p):(g=c,E=y,S=-c*p+2*s*y);var C=0>S?-1:1,w=-C*Math.abs(g)*Math.sqrt(-v);a=-S+w;var A=a/2,x=0>A?-Math.pow(-A,1/3):Math.pow(A,1/3),b=a===w?-x:-E/x;return o=0>=E?x+b:-S/(x*x+b*b+E),m*f>=l*h?[(o-u)/i]:[-c/(o+s)]}var T=d,M=-2*u*d+i*p,R=y,O=-c*p+2*s*y,I=Math.sqrt(v),N=Math.sqrt(3)/2,L=Math.abs(Math.atan2(i*I,-M)/3);o=2*Math.sqrt(-T);var z=Math.cos(L);a=o*z;var P=o*(-z/2-N*Math.sin(L)),D=a+P>2*u?a-u:P-u,F=i,_=D/F;L=Math.abs(Math.atan2(c*I,-O)/3),o=2*Math.sqrt(-R),z=Math.cos(L),a=o*z,P=o*(-z/2-N*Math.sin(L));var B=-c,U=2*s>a+P?a+s:P+s,G=B/U,q=F*U,k=-D*U-F*B,W=D*B,V=(s*k-u*W)/(-u*k+s*q);return V>=_?G>=_?G>=V?[_,V,G]:[_,G,V]:[G,_,V]:G>=_?[V,_,G]:G>=V?[V,G,_]:[G,V,_]}var n={};return n.computeDiscriminant=function(e,t,r,n){var o=e*e,a=t*t,i=r*r,u=n*n,s=18*e*t*r*n+a*i-27*o*u-4*(e*i*r+a*t*n);return s},n.computeRealRoots=function(e,n,o,a){var i,u;if(0===e)return t.computeRealRoots(n,o,a);if(0===n){if(0===o){if(0===a)return[0,0,0];u=-a/e;var s=0>u?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===a?(i=t.computeRealRoots(e,0,o),0===i.Length?[0]:[i[0],0,i[1]]):r(e,0,o,a)}return 0===o?0===a?(u=-n/e,0>u?[u,0,0]:[0,0,u]):r(e,n,0,a):0===a?(i=t.computeRealRoots(e,n,o),0===i.length?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]):r(e,n,o,a)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function o(t,o,a,i){var u=t*t,s=o-3*u/8,c=a-o*t/2+u*t/8,l=i-a*t/4+o*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var m=-t/4,h=f[f.length-1];if(Math.abs(h)<r.EPSILON14){var d=n.computeRealRoots(1,s,l);if(2===d.length){var p,y=d[0],v=d[1];if(y>=0&&v>=0){var g=Math.sqrt(y),E=Math.sqrt(v);return[m-E,m-g,m+g,m+E]}if(y>=0&&0>v)return p=Math.sqrt(y),[m-p,m+p];if(0>y&&v>=0)return p=Math.sqrt(v),[m-p,m+p]}return[]}if(h>0){var S=Math.sqrt(h),C=(s+h-c/S)/2,w=(s+h+c/S)/2,A=n.computeRealRoots(1,S,C),x=n.computeRealRoots(1,-S,w);return 0!==A.length?(A[0]+=m,A[1]+=m,0!==x.length?(x[0]+=m,x[1]+=m,A[1]<=x[0]?[A[0],A[1],x[0],x[1]]:x[1]<=A[0]?[x[0],x[1],A[0],A[1]]:A[0]>=x[0]&&A[1]<=x[1]?[x[0],A[0],A[1],x[1]]:x[0]>=A[0]&&x[1]<=A[1]?[A[0],x[0],x[1],A[1]]:A[0]>x[0]&&A[0]<x[1]?[x[0],A[0],x[1],A[1]]:[A[0],x[0],A[1],x[1]]):A):0!==x.length?(x[0]+=m,x[1]+=m,x):[]}}return[]}function a(t,o,a,i){var u=a*a,s=o*o,c=t*t,l=-2*o,f=a*t+s-4*i,m=c*i-a*o*t+u,h=e.computeRealRoots(1,l,f,m);if(h.length>0){var d,p,y=h[0],v=o-y,g=v*v,E=t/2,S=v/2,C=g-4*i,w=g+4*Math.abs(i),A=c-4*y,x=c+4*Math.abs(y);if(0>y||A*w>C*x){var b=Math.sqrt(A);d=b/2,p=0===b?0:(t*S-a)/b}else{var T=Math.sqrt(C);d=0===T?0:(t*S-a)/T,p=T/2}var M,R;0===E&&0===d?(M=0,R=0):r.sign(E)===r.sign(d)?(M=E+d,R=y/M):(R=E-d,M=y/R);var O,I;0===S&&0===p?(O=0,I=0):r.sign(S)===r.sign(p)?(O=S+p,I=i/O):(I=S-p,O=i/I);var N=n.computeRealRoots(1,M,O),L=n.computeRealRoots(1,R,I);if(0!==N.length)return 0!==L.length?N[1]<=L[0]?[N[0],N[1],L[0],L[1]]:L[1]<=N[0]?[L[0],L[1],N[0],N[1]]:N[0]>=L[0]&&N[1]<=L[1]?[L[0],N[0],N[1],L[1]]:L[0]>=N[0]&&L[1]<=N[1]?[N[0],L[0],L[1],N[1]]:N[0]>L[0]&&N[0]<L[1]?[L[0],N[0],L[1],N[1]]:[N[0],L[0],N[1],L[1]]:N;if(0!==L.length)return L}return[]}var i={};return i.computeDiscriminant=function(e,t,r,n,o){var a=e*e,i=a*e,u=t*t,s=u*t,c=r*r,l=c*r,f=n*n,m=f*n,h=o*o,d=h*o,p=u*c*f-4*s*m-4*e*l*f+18*e*t*r*m-27*a*f*f+256*i*d+o*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*f+144*a*r*f)+h*(144*e*u*r-27*u*u-128*a*c-192*a*t*n);return p},i.computeRealRoots=function(t,n,i,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,i,u,s);var c=n/t,l=i/t,f=u/t,m=s/t,h=0>c?1:0;switch(h+=0>l?h+1:h,h+=0>f?h+1:h,h+=0>m?h+1:h){case 0:return o(c,l,f,m);case 1:return a(c,l,f,m);case 2:return a(c,l,f,m);case 3:return o(c,l,f,m);case 4:return o(c,l,f,m);case 5:return a(c,l,f,m);case 6:return o(c,l,f,m);case 7:return o(c,l,f,m);case 8:return a(c,l,f,m);case 9:return o(c,l,f,m);case 10:return o(c,l,f,m);case 11:return a(c,l,f,m);case 12:return o(c,l,f,m);case 13:return o(c,l,f,m);case 14:return o(c,l,f,m);case 15:return o(c,l,f,m);default:return void 0}},i}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=function(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n};return n.getPoint=function(t,n,o){return r(o)||(o=new e),o=e.multiplyByScalar(t.direction,n,o),e.add(t.origin,o,o)},n}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,o,a,i,u,s,c){"use strict";function l(t,n,o,i,u){u=r(u,!1);var s,c,l,f,m,h=t.origin,d=t.direction,p=e.subtract(o,n,y),C=e.subtract(i,n,v),w=e.cross(d,C,g),A=e.dot(p,w);if(u){if(A<a.EPSILON6)return void 0;if(s=e.subtract(h,n,E),l=e.dot(s,w),0>l||l>A)return void 0;if(c=e.cross(s,p,S),f=e.dot(d,c),0>f||l+f>A)return void 0;m=e.dot(C,c)/A}else{if(Math.abs(A)<a.EPSILON6)return void 0;var x=1/A;if(s=e.subtract(h,n,E),l=e.dot(s,w)*x,0>l||l>1)return void 0;if(c=e.cross(s,p,S),f=e.dot(d,c)*x,0>f||l+f>1)return void 0;m=e.dot(C,c)*x}return m}function f(e,t,r,n){var o=t*t-4*e*r;if(0>o)return void 0;if(o>0){var a=1/(2*e),i=Math.sqrt(o),u=(-t+i)*a,s=(-t-i)*a;return s>u?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);return 0===c?void 0:(n.root0=n.root1=c,n)}function m(t,r,o){n(o)||(o={});var a=t.origin,i=t.direction,u=r.center,s=r.radius*r.radius,c=e.subtract(a,u,g),l=e.dot(i,i),m=2*e.dot(i,c),h=e.magnitudeSquared(c)-s,d=f(l,m,h,w);return n(d)?(o.start=d.root0,o.stop=d.root1,o):void 0}function h(e,t,r){var n=e+t;return a.sign(e)!==a.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function d(t,r,n,o,c){var l,f=o*o,m=c*c,d=(t[i.COLUMN1ROW1]-t[i.COLUMN2ROW2])*m,p=c*(o*h(t[i.COLUMN1ROW0],t[i.COLUMN0ROW1],a.EPSILON15)+r.y),y=t[i.COLUMN0ROW0]*f+t[i.COLUMN2ROW2]*m+o*r.x+n,v=m*h(t[i.COLUMN2ROW1],t[i.COLUMN1ROW2],a.EPSILON15),g=c*(o*h(t[i.COLUMN2ROW0],t[i.COLUMN0ROW2])+r.z),E=[];if(0===g&&0===v){if(l=u.computeRealRoots(d,p,y),0===l.length)return E;var S=l[0],C=Math.sqrt(Math.max(1-S*S,0));if(E.push(new e(o,c*S,c*-C)),E.push(new e(o,c*S,c*C)),2===l.length){var w=l[1],A=Math.sqrt(Math.max(1-w*w,0));E.push(new e(o,c*w,c*-A)),E.push(new e(o,c*w,c*A))}return E}var x=g*g,b=v*v,T=d*d,M=g*v,R=T+b,O=2*(p*d+M),I=2*y*d+p*p-b+x,N=2*(y*p-M),L=y*y-x;if(0===R&&0===O&&0===I&&0===N)return E;l=s.computeRealRoots(R,O,I,N,L);var z=l.length;if(0===z)return E;for(var P=0;z>P;++P){var D,F=l[P],_=F*F,B=Math.max(1-_,0),U=Math.sqrt(B);D=a.sign(d)===a.sign(y)?h(d*_+y,p*F,a.EPSILON12):a.sign(y)===a.sign(p*F)?h(d*_,p*F+y,a.EPSILON12):h(d*_+p*F,y,a.EPSILON12);var G=h(v*F,g,a.EPSILON15),q=D*G;0>q?E.push(new e(o,c*F,c*U)):q>0?E.push(new e(o,c*F,c*-U)):0!==U?(E.push(new e(o,c*F,c*-U)),E.push(new e(o,c*F,c*U)),++P):E.push(new e(o,c*F,c*U))}return E}var p={};p.rayPlane=function(t,r,o){n(o)||(o=new e);var i=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(Math.abs(c)<a.EPSILON15)return void 0;var l=(-r.distance-e.dot(s,i))/c;return 0>l?void 0:(o=e.multiplyByScalar(u,l,o),e.add(i,o,o))};var y=new e,v=new e,g=new e,E=new e,S=new e;p.rayTriangle=function(t,r,o,a,i,u){var s=l(t,r,o,a,i);return!n(s)||0>s?void 0:(n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u))};var C=new c;p.lineSegmentTriangle=function(t,r,o,a,i,u,s){var c=C;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var f=l(c,o,a,i,u);return!n(f)||0>f||f>e.distance(t,r)?void 0:(n(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var w={root0:0,root1:0};p.raySphere=function(e,t,r){return r=m(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var A=new c;p.lineSegmentSphere=function(t,r,o,a){var i=A;e.clone(t,i.origin);var u=e.subtract(r,t,i.direction),s=e.magnitude(u);return e.normalize(u,u),a=m(i,o,a),!n(a)||a.stop<0||a.start>s?void 0:(a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a)};var x=new e,b=new e;p.rayEllipsoid=function(t,r){var n,o,a,i,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,x),l=e.multiplyComponents(s,t.direction,b),f=e.magnitudeSquared(c),m=e.dot(c,l);if(f>1){if(m>=0)return void 0;var h=m*m;if(n=f-1,o=e.magnitudeSquared(l),a=o*n,a>h)return void 0;if(h>a){i=m*m-a,u=-m+Math.sqrt(i);var d=u/o,p=n/u;return p>d?{start:d,stop:p}:{start:p,stop:d}}var y=Math.sqrt(n/o);return{start:y,stop:y}}return 1>f?(n=f-1,o=e.magnitudeSquared(l),a=o*n,i=m*m-a,u=-m+Math.sqrt(i),{start:0,stop:u/o}):0>m?(o=e.magnitudeSquared(l),{start:0,stop:-m/o}):void 0};var T=new e,M=new e,R=new e,O=new e,I=new e,N=new i,L=new i,z=new i,P=new i,D=new i,F=new i,_=new i,B=new e,U=new e,G=new t;p.grazingAltitudeLocation=function(t,r){var o=t.origin,u=t.direction,s=r.geodeticSurfaceNormal(o);if(e.dot(u,s)>=0)return o;var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u),f=e.normalize(l,T),m=e.mostOrthogonalAxis(l,O),h=e.normalize(e.cross(m,f,M),M),p=e.normalize(e.cross(f,h,R),R),y=N;y[0]=f.x,y[1]=f.y,y[2]=f.z,y[3]=h.x,y[4]=h.y,y[5]=h.z,y[6]=p.x,y[7]=p.y,y[8]=p.z;var v=i.transpose(y,L),g=i.fromScale(r.radii,z),E=i.fromScale(r.oneOverRadii,P),S=D;S[0]=0,S[1]=-u.z,S[2]=u.y,S[3]=u.z,S[4]=0,S[5]=-u.x,S[6]=-u.y,S[7]=u.x,S[8]=0;var C,w,A=i.multiply(i.multiply(v,E,F),S,F),x=i.multiply(i.multiply(A,g,_),y,_),b=i.multiplyByVector(A,o,I),q=d(x,e.negate(b,T),0,0,1),k=q.length;if(k>0){for(var W=e.clone(e.ZERO,U),V=Number.NEGATIVE_INFINITY,Y=0;k>Y;++Y){C=i.multiplyByVector(g,i.multiplyByVector(y,q[Y],B),B);var H=e.normalize(e.subtract(C,o,O),O),j=e.dot(H,u);j>V&&(V=j,W=e.clone(C,W))}var K=r.cartesianToCartographic(W,G);return V=a.clamp(V,0,1),w=e.magnitude(e.subtract(W,o,O))*Math.sqrt(1-V*V),w=c?-w:w,K.height=w,r.cartographicToCartesian(K)}return void 0};var q=new e;return p.lineSegmentPlane=function(t,r,o,i){n(i)||(i=new e);var u=e.subtract(r,t,q),s=o.normal,c=e.dot(s,u);if(Math.abs(c)<a.EPSILON6)return void 0;var l=e.dot(s,t),f=-(o.distance+l)/c;return 0>f||f>1?void 0:(e.multiplyByScalar(u,f,i),e.add(t,i,i),i)},p.trianglePlaneIntersection=function(t,r,n,o){var a=o.normal,i=o.distance,u=e.dot(a,t)+i<0,s=e.dot(a,r)+i<0,c=e.dot(a,n)+i<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,m;if((1===l||2===l)&&(f=new e,m=new e),1===l){if(u)return p.lineSegmentPlane(t,r,o,f),p.lineSegmentPlane(t,n,o,m),{positions:[t,r,n,f,m],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(r,n,o,f),p.lineSegmentPlane(r,t,o,m),{positions:[t,r,n,f,m],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(n,t,o,f),p.lineSegmentPlane(n,r,o,m),{positions:[t,r,n,f,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return p.lineSegmentPlane(r,t,o,f),p.lineSegmentPlane(n,t,o,m),{positions:[t,r,n,f,m],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(n,r,o,f),p.lineSegmentPlane(t,r,o,m),{positions:[t,r,n,f,m],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,n,o,f),p.lineSegmentPlane(r,n,o,m),{positions:[t,r,n,f,m],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},p}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(t,r){this.normal=e.clone(t),this.distance=r};return r.fromPointNormal=function(n,o,a){var i=-e.dot(o,n);return t(a)?(e.clone(o,a.normal),a.distance=i,a):new r(o,i)},r.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},r}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};return r.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,o=r.maximumIndex,a=e(r.cacheSize,24),i=n.length;if(!t(o)){o=0;for(var u=0,s=n[u];i>u;)s>o&&(o=s),++u,s=n[u]}for(var c=[],l=0;o+1>l;l++)c[l]=0;for(var f=a+1,m=0;i>m;++m)f-c[n[m]]>a&&(c[n[m]]=f,++f);return(f-a+1)/(i/3)},r.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var o=t[t.length-1];if(t.splice(t.length-1,1),e[o].numLiveTriangles>0)return o}for(;n>a;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}function o(e,t,r,o,a,i,u){for(var s,c=-1,l=-1,f=0;f<r.length;){var m=r[f];o[m].numLiveTriangles&&(s=0,a-o[m].timeStamp+2*o[m].numLiveTriangles<=t&&(s=a-o[m].timeStamp),(s>l||-1===l)&&(l=s,c=m)),++f}return-1===c?n(o,i,e,u):c}r=e(r,e.EMPTY_OBJECT);var a,i=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=i.length,l=0,f=0,m=i[f],h=c;if(t(u))l=u+1;else{for(;h>f;)m>l&&(l=m),++f,m=i[f];if(-1===l)return 0;++l}for(var d=[],p=0;l>p;p++)d[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var y=0;h>f;)d[i[f]].vertexTriangles.push(y),++d[i[f]].numLiveTriangles,d[i[f+1]].vertexTriangles.push(y),++d[i[f+1]].numLiveTriangles,d[i[f+2]].vertexTriangles.push(y),++d[i[f+2]].numLiveTriangles,++y,f+=3;var v=0,g=s+1;a=1;var E,S,C=[],w=[],A=0,x=[],b=c/3,T=[];for(p=0;b>p;p++)T[p]=!1;for(var M,R;-1!==v;){C=[],S=d[v],R=S.vertexTriangles.length;for(var O=0;R>O;++O)if(y=S.vertexTriangles[O],!T[y]){T[y]=!0,f=y+y+y;for(var I=0;3>I;++I)M=i[f],C.push(M),w.push(M),x[A]=M,++A,E=d[M],--E.numLiveTriangles,g-E.timeStamp>s&&(E.timeStamp=g,++g),++f}v=o(i,s,C,d,g,w,l)}return x},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,r,n,o,a,i,u,s,c,l,f,m,h,d,p,y,v,g,E,S,C,w,A,x){"use strict";function b(e,t,r,n,o){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=o,e[t++]=o,e[t]=r}function T(e){for(var t=e.length,r=6*(t/3),n=y.createTypedArray(t,r),o=0,a=0;t>a;a+=3,o+=6)b(n,o,e[a],e[a+1],e[a+2]);return n}function M(e){var t=e.length;if(t>=3){var r=6*(t-2),n=y.createTypedArray(t,r);b(n,0,e[0],e[1],e[2]);for(var o=6,a=3;t>a;++a,o+=6)b(n,o,e[a-1],e[a],e[a-2]);return n}return new Uint16Array}function R(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=y.createTypedArray(t,r),o=e[0],a=0,i=1;t>i;++i,a+=6)b(n,a,o,e[i],e[i+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 I(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var o=t[n],a=0;a<o.componentsPerAttribute;++a)e[n].values.push(o.values[r*o.componentsPerAttribute+a])}function N(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;n>a;a+=3)o.unpack(r,a,J),C.multiplyByPoint(e,J,J),o.pack(J,r,a)}function L(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;n>a;a+=3)o.unpack(r,a,J),S.multiplyByVector(e,J,J),J=o.normalize(J,J),o.pack(J,r,a)}function z(e){var t,r=e.length,n={},o=e[0].geometry.attributes;for(t in o)if(o.hasOwnProperty(t)&&c(o[t])&&c(o[t].values)){for(var a=o[t],i=a.values.length,s=!0,l=1;r>l;++l){var f=e[l].geometry.attributes[t];if(!c(f)||a.componentDatatype!==f.componentDatatype||a.componentsPerAttribute!==f.componentsPerAttribute||a.normalize!==f.normalize){s=!1;break}i+=f.values.length}s&&(n[t]=new d({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:u.createTypedArray(a.componentDatatype,i)}))}return n}function P(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function D(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,o=3;t>o;++o)r[n++]=o-1,r[n++]=0,r[n++]=o;return e.indices=r,e.primitiveType=A.TRIANGLES,e}function F(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,o=3;t-1>o;o+=2)r[n++]=o,r[n++]=o-1,r[n++]=o+1,t>o+2&&(r[n++]=o,r[n++]=o+1,r[n++]=o+2);return e.indices=r,e.primitiveType=A.TRIANGLES,e}function _(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function B(e){var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,o=2;t>o;++o)r[n++]=o-1,r[n++]=o;return e.indices=r,e.primitiveType=A.LINES,e}function U(e){var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,o=2;t>o;++o)r[n++]=o-1,r[n++]=o;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=A.LINES,e}function G(e){switch(e.primitiveType){case A.TRIANGLE_FAN:return D(e);case A.TRIANGLE_STRIP:return F(e);case A.TRIANGLES:return P(e);case A.LINE_STRIP:return B(e);case A.LINE_LOOP:return U(e);case A.LINES:return _(e)}return e}function q(e,t){Math.abs(e.y)<E.EPSILON11&&(e.y=t?-E.EPSILON11:E.EPSILON11)}function k(e,t,r,n){o.add(e,o.multiplyByScalar(o.subtract(t,e,ht),e.y/(e.y-t.y),ht),r),o.clone(r,n),q(r,!0),q(n,!1)}function W(e,t,r){if(e.x>=0||t.x>=0||r.x>=0)return void 0;var n=e.y<0,o=t.y<0,a=r.y<0;q(e,n),q(t,o),q(r,a);var i=0;i+=n?1:0,i+=o?1:0,i+=a?1:0;var u=gt.indices;1===i?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(k(e,t,dt,yt),k(e,r,pt,vt),u[0]=0,u[3]=1,u[4]=2,u[6]=1):o?(k(t,r,dt,yt),k(t,e,pt,vt),u[0]=1,u[3]=2,u[4]=0,u[6]=2):a&&(k(r,e,dt,yt),k(r,t,pt,vt),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===i&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?o?a||(k(r,e,dt,yt),k(r,t,pt,vt),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(k(t,r,dt,yt),k(t,e,pt,vt),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(k(e,t,dt,yt),k(e,r,pt,vt),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=gt.positions;return s[0]=e,s[1]=t,s[2]=r,gt.length=3,(1===i||2===i)&&(s[3]=dt,s[4]=pt,s[5]=yt,s[6]=vt,gt.length=7),gt}function V(e,r,a,i,u,s,l,f){if(c(u)||c(s)||c(l)||c(f)){var m,h,d,p,y,v,g,E,S,C,w,A,x=i.positions,b=x[0],T=x[1],M=x[2],R=Et,O=St,I=Ct,N=wt,L=At,z=xt;c(u)&&(m=o.fromArray(u,3*e),h=o.fromArray(u,3*r),d=o.fromArray(u,3*a)),c(s)&&(p=o.fromArray(s,3*e),y=o.fromArray(s,3*r),v=o.fromArray(s,3*a)),c(l)&&(g=o.fromArray(l,3*e),E=o.fromArray(l,3*r),S=o.fromArray(l,3*a)),c(f)&&(C=n.fromArray(f,2*e),w=n.fromArray(f,2*r),A=n.fromArray(f,2*a));for(var P=3;P<x.length;++P){var D=x[P],F=t(D,b,T,M);if(c(u)){R=o.multiplyByScalar(m,F.x,R),O=o.multiplyByScalar(h,F.y,O),I=o.multiplyByScalar(d,F.z,I);var _=o.add(R,O,bt);o.add(_,I,_),o.normalize(_,_),u.push(_.x,_.y,_.z)}if(c(s)){R=o.multiplyByScalar(p,F.x,R),O=o.multiplyByScalar(y,F.y,O),I=o.multiplyByScalar(v,F.z,I);var B=o.add(R,O,bt);o.add(B,I,B),o.normalize(B,B),s.push(B.x,B.y,B.z)}if(c(l)){R=o.multiplyByScalar(g,F.x,R),O=o.multiplyByScalar(E,F.y,O),I=o.multiplyByScalar(S,F.z,I);var U=o.add(R,O,bt);o.add(U,I,U),o.normalize(U,U),l.push(U.x,U.y,U.z)}if(c(f)){N=n.multiplyByScalar(C,F.x,N),L=n.multiplyByScalar(w,F.y,L),z=n.multiplyByScalar(A,F.z,z);var G=n.add(N,L,N);n.add(G,z,G),f.push(G.x,G.y)}}}}function Y(e){for(var t=e.attributes,r=t.position.values,n=c(t.normal)?t.normal.values:void 0,a=c(t.binormal)?t.binormal.values:void 0,i=c(t.tangent)?t.tangent.values:void 0,s=c(t.st)?t.st.values:void 0,l=e.indices,f=Array.prototype.slice.call(r,0),m=c(n)?Array.prototype.slice.call(n,0):void 0,d=c(a)?Array.prototype.slice.call(a,0):void 0,p=c(i)?Array.prototype.slice.call(i,0):void 0,v=c(s)?Array.prototype.slice.call(s,0):void 0,g=[],E=l.length,S=0;E>S;S+=3){var C=l[S],w=l[S+1],A=l[S+2],x=o.fromArray(r,3*C),b=o.fromArray(r,3*w),T=o.fromArray(r,3*A),M=W(x,b,T);if(c(M))if(f[3*C+1]=M.positions[0].y,f[3*w+1]=M.positions[1].y,f[3*A+1]=M.positions[2].y,M.length>3){for(var R=f.length/3,O=0;O<M.indices.length;++O){var I=M.indices[O];3>I?g.push(l[S+I]):g.push(I-3+R)}for(var N=3;N<M.positions.length;++N){var L=M.positions[N];f.push(L.x,L.y,L.z)}V(C,w,A,M,m,d,p,v)}else g.push(C,w,A);else g.push(C,w,A)}e.attributes.position.values=new Float64Array(f),c(m)&&(t.normal.values=u.createTypedArray(t.normal.componentDatatype,m)),c(d)&&(t.binormal.values=u.createTypedArray(t.binormal.componentDatatype,d)),c(p)&&(t.tangent.values=u.createTypedArray(t.tangent.componentDatatype,p)),c(v)&&(t.st.values=u.createTypedArray(t.st.componentDatatype,v));var z=h.computeNumberOfVertices(e);e.indices=y.createTypedArray(z,g)}function H(e){for(var t=e.attributes,r=t.position.values,n=e.indices,a=Array.prototype.slice.call(r,0),i=[],u=n.length,s=0;u>s;s+=2){var l=n[s],f=n[s+1],m=o.fromArray(r,3*l),d=o.fromArray(r,3*f);if(Math.abs(m.y)<E.EPSILON6&&(m.y=m.y<0?-E.EPSILON6:E.EPSILON6,a[3*l+1]=m.y),Math.abs(d.y)<E.EPSILON6&&(d.y=d.y<0?-E.EPSILON6:E.EPSILON6,a[3*f+1]=d.y),i.push(l),m.x<0||d.x<0){var p=g.lineSegmentPlane(m,d,Tt);if(c(p)){var v=o.multiplyByScalar(o.UNIT_Y,5*E.EPSILON9,Mt);m.y<0&&o.negate(v,v);var S=a.length/3;i.push(S,S+1);var C=o.add(p,v,Rt);a.push(C.x,C.y,C.z),o.negate(v,v),o.add(p,v,C),a.push(C.x,C.y,C.z)}}i.push(f)}e.attributes.position.values=new Float64Array(a);var w=h.computeNumberOfVertices(e);e.indices=y.createTypedArray(w,i)}function j(e){var t=e.attributes,r=t.position.values,i=c(t.st)?t.st.values:void 0,s=c(t.prevPosition)?t.prevPosition.values:void 0,l=c(t.nextPosition)?t.nextPosition.values:void 0,f=c(t.expandAndWidth)?t.expandAndWidth.values:void 0,m=c(t.color)?t.color.values:void 0;e.indices;for(var d=Array.prototype.slice.call(r,0),p=c(i)?Array.prototype.slice.call(i,0):void 0,v=c(s)?Array.prototype.slice.call(s,0):void 0,S=c(l)?Array.prototype.slice.call(l,0):void 0,C=c(f)?Array.prototype.slice.call(f,0):void 0,w=c(m)?Array.prototype.slice.call(m,0):void 0,A=[],x=d.length/3,b=0;x>b;b+=4){var T=b,M=b+1,R=b+2,O=o.fromArray(d,3*T,Nt),I=o.fromArray(d,3*M,Lt),N=o.fromArray(d,3*R,zt),L=o.equals(O,I);Math.abs(O.y)<E.EPSILON6&&(O.y=N.y<0?-E.EPSILON6:E.EPSILON6,d[3*T+1]=O.y),Math.abs(N.y)<E.EPSILON6&&(N.y=O.y<0?-E.EPSILON6:E.EPSILON6,d[3*R+1]=N.y),d[3*M+1]=I.y=L?O.y:N.y; -var z=!1;if(O.x<0||N.x<0){var P=g.lineSegmentPlane(O,N,Tt,Lt);if(c(P)){var D=o.multiplyByScalar(o.UNIT_Y,5*E.EPSILON9,Pt);O.y<0&&o.negate(D,D);var F=o.add(P,D,Dt);d.push(F.x,F.y,F.z),d.push(F.x,F.y,F.z),o.negate(D,D),o.add(P,D,F),d.push(F.x,F.y,F.z),d.push(F.x,F.y,F.z),v.push(O.x,O.y,O.z,O.x,O.y,O.z),v.push(O.x,O.y,O.z,O.x,O.y,O.z),S.push(N.x,N.y,N.z,N.x,N.y,N.z),S.push(N.x,N.y,N.z,N.x,N.y,N.z);var _=n.fromArray(C,2*T),B=Math.abs(_.y);C.push(-1,-B,1,-B),C.push(-1,B,1,B);var U=o.magnitudeSquared(o.subtract(P,O,Pt));if(U/=o.magnitudeSquared(o.subtract(N,O,Pt)),c(w)){var G=a.fromArray(w,4*T,Ft),q=a.fromArray(w,4*R,Ft),k=E.lerp(G.x,q.x,U),W=E.lerp(G.y,q.y,U),V=E.lerp(G.z,q.z,U),Y=E.lerp(G.w,q.w,U);w.push(k,W,V,Y),w.push(k,W,V,Y),w.push(k,W,V,Y),w.push(k,W,V,Y)}if(c(p)){var H=n.fromArray(p,2*T,Ot),j=n.fromArray(p,2*(b+3),It),K=E.lerp(H.x,j.x,U);p.push(K,H.y),p.push(K,j.y),p.push(K,H.y),p.push(K,j.y)}z=!0}}if(z){var Z=d.length/3-4;A.push(b,Z,b+1),A.push(b+1,Z,Z+1),A.push(Z+2,b+2,Z+3),A.push(Z+3,b+2,b+3)}else A.push(b,b+2,b+1),A.push(b+1,b+2,b+3)}t.position.values=new Float64Array(d),t.prevPosition.values=u.createTypedArray(t.prevPosition.componentDatatype,v),t.nextPosition.values=u.createTypedArray(t.nextPosition.componentDatatype,S),t.expandAndWidth.values=u.createTypedArray(t.expandAndWidth.componentDatatype,C),c(p)&&(t.st.values=u.createTypedArray(t.st.componentDatatype,p)),c(w)&&(t.color.values=u.createTypedArray(t.color.componentDatatype,w));var X=h.computeNumberOfVertices(e);e.indices=y.createTypedArray(X,A)}var K={};K.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case A.TRIANGLES:e.indices=T(t);break;case A.TRIANGLE_STRIP:e.indices=M(t);break;case A.TRIANGLE_FAN:e.indices=R(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=A.LINES}return e},K.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var o=e.attributes.position.values,a=e.attributes[t].values,i=o.length,l=new Float64Array(2*i),f=0,m=0;i>m;m+=3)l[f++]=o[m],l[f++]=o[m+1],l[f++]=o[m+2],l[f++]=o[m]+a[m]*n,l[f++]=o[m+1]+a[m+1]*n,l[f++]=o[m+2]+a[m+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:A.LINES,boundingSphere:p})},K.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],n=e.attributes,o={},a=0,i=r.length;for(t=0;i>t;++t){var u=r[t];c(n[u])&&(o[u]=a++)}for(var s in n)n.hasOwnProperty(s)&&!c(o[s])&&(o[s]=a++);return o},K.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),o=0;t>o;o++)n[o]=-1;for(var a,i=r,s=i.length,l=y.createTypedArray(t,s),f=0,m=0,d=0;s>f;)a=n[i[f]],-1!==a?l[m]=a:(a=i[f],n[a]=d,l[m]=d,++d),++f,++m;e.indices=l;var p=e.attributes;for(var v in p)if(p.hasOwnProperty(v)&&c(p[v])&&c(p[v].values)){for(var g=p[v],E=g.values,S=0,C=g.componentsPerAttribute,w=u.createTypedArray(g.componentDatatype,d*C);t>S;){var A=n[S];if(-1!==A)for(o=0;C>o;o++)w[C*A+o]=E[C*S+o];++S}g.values=w}}return e},K.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===A.TRIANGLES&&c(r)){for(var n=r.length,o=0,a=0;n>a;a++)r[a]>o&&(o=r[a]);e.indices=x.tipsify({indices:r,maximumIndex:o,cacheSize:t})}return e},K.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>E.SIXTY_FOUR_KILOBYTES){var n,o=[],a=[],i=0,u=O(e.attributes),s=e.indices,l=s.length;e.primitiveType===A.TRIANGLES?n=3:e.primitiveType===A.LINES?n=2:e.primitiveType===A.POINTS&&(n=1);for(var f=0;l>f;f+=n){for(var m=0;n>m;++m){var d=s[f+m],p=o[d];c(p)||(p=i++,o[d]=p,I(u,e.attributes,d)),a.push(p)}i+n>E.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere})),o=[],a=[],i=0,u=O(e.attributes))}0!==a.length&&t.push(new h({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere}))}else t.push(e);return t};var Z=new o,X=new i;K.projectTo2D=function(e,t,r,n,a){var i=e.attributes[t];a=c(a)?a:new m;for(var s=a.ellipsoid,f=i.values,h=new Float64Array(f.length),p=0,y=0;y<f.length;y+=3){var v=o.fromArray(f,y,Z),g=s.cartesianToCartographic(v,X);if(!c(g))throw new l("Could not project point ("+v.x+", "+v.y+", "+v.z+") to 2D.");var E=a.project(g,Z);h[p++]=E.x,h[p++]=E.y,h[p++]=E.z}return e.attributes[r]=i,e.attributes[n]=new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:h}),delete e.attributes[t],e};var Q={high:0,low:0};K.encodeAttribute=function(e,t,r,n){for(var o=e.attributes[t],a=o.values,i=a.length,s=new Float32Array(i),c=new Float32Array(i),l=0;i>l;++l)f.encode(a[l],Q),s[l]=Q.high,c[l]=Q.low;var m=o.componentsPerAttribute;return e.attributes[r]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:m,values:s}),e.attributes[n]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:m,values:c}),delete e.attributes[t],e};var J=new o,$=new C,et=new S;K.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(C.equals(t,C.IDENTITY))return e;var n=e.geometry.attributes;N(t,n.position),N(t,n.prevPosition),N(t,n.nextPosition),(c(n.normal)||c(n.binormal)||c(n.tangent))&&(C.inverse(t,$),C.transpose($,$),C.getRotation($,et),L(et,n.normal),L(et,n.binormal),L(et,n.tangent));var o=e.geometry.boundingSphere;return c(o)&&(e.geometry.boundingSphere=r.transform(o,t,o)),e.modelMatrix=C.clone(C.IDENTITY),e};var tt=new o;K.combine=function(e){var t,n,a,i,u=e.length;e[0].modelMatrix;var s,l,f,m=c(e[0].geometry.indices),d=e[0].geometry.primitiveType,p=z(e);for(t in p)if(p.hasOwnProperty(t))for(s=p[t].values,i=0,n=0;u>n;++n)for(l=e[n].geometry.attributes[t].values,f=l.length,a=0;f>a;++a)s[i++]=l[a];var v;if(m){var g=0;for(n=0;u>n;++n)g+=e[n].geometry.indices.length;var E=h.computeNumberOfVertices(new h({attributes:p,primitiveType:A.POINTS})),S=y.createTypedArray(E,g),C=0,w=0;for(n=0;u>n;++n){var x=e[n].geometry.indices,b=x.length;for(i=0;b>i;++i)S[C++]=w+x[i];w+=h.computeNumberOfVertices(e[n].geometry)}v=S}var T,M=new o,R=0;for(n=0;u>n;++n){if(T=e[n].geometry.boundingSphere,!c(T)){M=void 0;break}o.add(T.center,M,M)}if(c(M))for(o.divideByScalar(M,u,M),n=0;u>n;++n){T=e[n].geometry.boundingSphere;var O=o.magnitude(o.subtract(T.center,M,tt))+T.radius;O>R&&(R=O)}return new h({attributes:p,indices:v,primitiveType:d,boundingSphere:c(M)?new r(M,R):void 0})};var rt=new o,nt=new o,ot=new o,at=new o;K.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,a=r.position.values.length/3,i=t.length,s=new Array(a),c=new Array(i/3),l=new Array(i),f=0;a>f;f++)s[f]={indexOffset:0,count:0,currentCount:0};var m=0;for(f=0;i>f;f+=3){var h=t[f],p=t[f+1],y=t[f+2],v=3*h,g=3*p,E=3*y;nt.x=n[v],nt.y=n[v+1],nt.z=n[v+2],ot.x=n[g],ot.y=n[g+1],ot.z=n[g+2],at.x=n[E],at.y=n[E+1],at.z=n[E+2],s[h].count++,s[p].count++,s[y].count++,o.subtract(ot,nt,ot),o.subtract(at,nt,at),c[m]=o.cross(ot,at,new o),m++}var S=0;for(f=0;a>f;f++)s[f].indexOffset+=S,S+=s[f].count;m=0;var C;for(f=0;i>f;f+=3){C=s[t[f]];var w=C.indexOffset+C.currentCount;l[w]=m,C.currentCount++,C=s[t[f+1]],w=C.indexOffset+C.currentCount,l[w]=m,C.currentCount++,C=s[t[f+2]],w=C.indexOffset+C.currentCount,l[w]=m,C.currentCount++,m++}var A=new Float32Array(3*a);for(f=0;a>f;f++){var x=3*f;if(C=s[f],C.count>0){for(o.clone(o.ZERO,rt),m=0;m<C.count;m++)o.add(rt,c[l[C.indexOffset+m]],rt);o.normalize(rt,rt),A[x]=rt.x,A[x+1]=rt.y,A[x+2]=rt.z}else A[x]=0,A[x+1]=0,A[x+2]=1}return e.attributes.normal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:A}),e};var it=new o,ut=new o,st=new o;K.computeBinormalAndTangent=function(e){e.attributes;for(var t=e.indices,r=e.attributes.position.values,n=e.attributes.normal.values,a=e.attributes.st.values,i=e.attributes.position.values.length/3,s=t.length,c=new Array(3*i),l=0;l<c.length;l++)c[l]=0;var f,m,h;for(l=0;s>l;l+=3){var p=t[l],y=t[l+1],v=t[l+2];f=3*p,m=3*y,h=3*v;var g=2*p,E=2*y,S=2*v,C=r[f],w=r[f+1],A=r[f+2],x=a[g],b=a[g+1],T=a[E+1]-b,M=a[S+1]-b,R=1/((a[E]-x)*M-(a[S]-x)*T),O=(M*(r[m]-C)-T*(r[h]-C))*R,I=(M*(r[m+1]-w)-T*(r[h+1]-w))*R,N=(M*(r[m+2]-A)-T*(r[h+2]-A))*R;c[f]+=O,c[f+1]+=I,c[f+2]+=N,c[m]+=O,c[m+1]+=I,c[m+2]+=N,c[h]+=O,c[h+1]+=I,c[h+2]+=N}var L=new Float32Array(3*i),z=new Float32Array(3*i);for(l=0;i>l;l++){f=3*l,m=f+1,h=f+2;var P=o.fromArray(n,f,it),D=o.fromArray(c,f,st),F=o.dot(P,D);o.multiplyByScalar(P,F,ut),o.normalize(o.subtract(D,ut,D),D),z[f]=D.x,z[m]=D.y,z[h]=D.z,o.normalize(o.cross(P,D,D),D),L[f]=D.x,L[m]=D.y,L[h]=D.z}return e.attributes.tangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:z}),e.attributes.binormal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e};var ct=new n,lt=new o,ft=new o,mt=new o;K.compressVertices=function(t){var r=t.attributes.normal,a=t.attributes.st;if(!c(r)&&!c(a))return t;var i,s,l,f,m=t.attributes.tangent,h=t.attributes.binormal;c(r)&&(i=r.values),c(a)&&(s=a.values),c(m)&&(l=m.values),h&&(f=h.values);var p=c(i)?i.length:s.length,y=c(i)?3:2,v=p/y,g=v,E=c(s)&&c(i)?2:1;E+=c(l)||c(f)?1:0,g*=E;for(var S=new Float32Array(g),C=0,w=0;v>w;++w){c(s)&&(n.fromArray(s,2*w,ct),S[C++]=e.compressTextureCoordinates(ct));var A=3*w;c(i)&&c(l)&&c(f)?(o.fromArray(i,A,lt),o.fromArray(l,A,ft),o.fromArray(f,A,mt),e.octPack(lt,ft,mt,ct),S[C++]=ct.x,S[C++]=ct.y):(c(i)&&(o.fromArray(i,A,lt),S[C++]=e.octEncodeFloat(lt)),c(l)&&(o.fromArray(l,A,lt),S[C++]=e.octEncodeFloat(lt)),c(f)&&(o.fromArray(f,A,lt),S[C++]=e.octEncodeFloat(lt)))}return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:E,values:S}),c(i)&&delete t.attributes.normal,c(s)&&delete t.attributes.st,c(l)&&delete t.attributes.tangent,c(f)&&delete t.attributes.binormal,t};var ht=new o,dt=new o,pt=new o,yt=new o,vt=new o,gt={positions:new Array(7),indices:new Array(9)},Et=new o,St=new o,Ct=new o,wt=new n,At=new n,xt=new n,bt=new o,Tt=w.fromPointNormal(o.ZERO,o.UNIT_Y),Mt=new o,Rt=new o,Ot=new n,It=new n,Nt=new o,Lt=new o,zt=new o,Pt=new o,Dt=new o,Ft=new a;return new a,K.wrapLongitude=function(e){var t=e.boundingSphere;if(c(t)){var n=t.center.x-t.radius;if(n>0||r.intersect(t,a.UNIT_Y)!==v.INTERSECTING)return e}if(e.geometryType!==p.NONE)switch(e.geometryType){case p.POLYLINES:j(e);break;case p.TRIANGLES:Y(e);break;case p.LINES:H(e)}else G(e),e.primitiveType===A.TRIANGLES?Y(e):e.primitiveType===A.LINES&&H(e);return e},K}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,o,a,i,u){"use strict";var s=function(e){this._ellipsoid=r(e,i.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return o(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.mercatorAngleToGeodeticLatitude=function(e){return u.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},s.geodeticLatitudeToMercatorAngle=function(e){e>s.MaximumLatitude?e=s.MaximumLatitude:e<-s.MaximumLatitude&&(e=-s.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI),s.prototype.project=function(t,r){var o=this._semimajorAxis,a=t.longitude*o,i=s.geodeticLatitudeToMercatorAngle(t.latitude)*o,u=t.height;return n(r)?(r.x=a,r.y=i,r.z=u,r):new e(a,i,u)},s.prototype.unproject=function(e,r){var o=this._oneOverSemimajorAxis,a=e.x*o,i=s.mercatorAngleToGeodeticLatitude(e.y*o),u=e.z;return n(r)?(r.longitude=a,r.latitude=i,r.height=u,r):new t(a,i,u)},s}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,n,o,a,i,u,s,c,l,f,m,h,d){"use strict";function p(e,t,r){var n,o=!r,a=e.length;if(!o&&a>1){var i=e[0].modelMatrix;for(n=1;a>n;++n)if(!h.equals(i,e[n].modelMatrix)){o=!0;break}}if(o)for(n=0;a>n;++n)f.transformToWorldCoordinates(e[n]);else h.clone(e[0].modelMatrix,t)}function y(e,n){for(var o=e.length,a=0;o>a;++a){var i=e[a],u=i.geometry,s=u.attributes,c=s.position,f=4*(c.values.length/c.componentsPerAttribute);s.pickColor=new l({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0,values:new Uint8Array(f)});for(var m=n[a],h=t.floatToByte(m.red),d=t.floatToByte(m.green),p=t.floatToByte(m.blue),y=t.floatToByte(m.alpha),v=s.pickColor.values,g=0;f>g;g+=4)v[g]=h,v[g+1]=d,v[g+2]=p,v[g+3]=y}}function v(e){var t,r=e.length,n=[],a=e[0].attributes;for(t in a)if(a.hasOwnProperty(t)){for(var i=a[t],u=!0,s=1;r>s;++s){var c=e[s].attributes[t];if(!o(c)||i.componentDatatype!==c.componentDatatype||i.componentsPerAttribute!==c.componentsPerAttribute||i.normalize!==c.normalize){u=!1;break}}u&&n.push(t)}return n}function g(e,t){for(var n=e.length,o=0;n>o;++o)for(var a=e[o],i=a.attributes,u=a.geometry,s=c.computeNumberOfVertices(u),f=t.length,m=0;f>m;++m){for(var h=t[m],d=i[h],p=d.componentDatatype,y=d.value,v=y.length,g=r.createTypedArray(p,s*v),E=0;s>E;++E)g.set(y,E*v);u.attributes[h]=new l({componentDatatype:p,componentsPerAttribute:v,normalize:d.normalize,values:g})}}function E(e){var t,n=e.instances,o=e.pickIds,a=e.projection,i=e.elementIndexUintSupported,u=e.scene3DOnly,s=e.allowPicking,c=e.vertexCacheOptimize,l=e.compressVertices,m=e.modelMatrix,h=n.length;if(n[0].geometry.primitiveType,p(n,m,u),!u)for(t=0;h>t;++t)f.wrapLongitude(n[t].geometry);s&&y(n,o);var d=v(n);if(g(n,d),c)for(t=0;h>t;++t)f.reorderForPostVertexCache(n[t].geometry),f.reorderForPreVertexCache(n[t].geometry);var E,S=f.combine(n),C=S.attributes;if(u)for(E in C)C.hasOwnProperty(E)&&C[E].componentDatatype===r.DOUBLE&&f.encodeAttribute(S,E,E+"3DHigh",E+"3DLow");else for(E in C)if(C.hasOwnProperty(E)&&C[E].componentDatatype===r.DOUBLE){var w=E+"3D",A=E+"2D";f.projectTo2D(S,E,w,A,a),f.encodeAttribute(S,w,w+"High",w+"Low"),f.encodeAttribute(S,A,A+"High",A+"Low")}return l&&f.compressVertices(S),i?[S]:f.fitToUnsignedShortIndices(S)}function S(e,t,n){for(var o=[],a=e.attributes,i=n.length,u=0;i>u;++u){var s=n[u],c=a[s],l=c.componentDatatype;l===r.DOUBLE&&(l=r.FLOAT);var f=r.createTypedArray(l,c.values);o.push({index:t[s],componentDatatype:l,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,values:f}),delete a[s]}return o}function C(e,t,r){for(var a=[],i=v(e),u=e.length,s={},l={},f=0;u>f;++f)for(var m=e[f],h=c.computeNumberOfVertices(m.geometry),d=i.length,p=0;d>p;++p)for(var y=i[p],g=r[y],E=h;E>0;){for(var S,C=n(l[y],0),w=t[C],A=w.length,x=0;A>x&&(S=w[x],S.index!==g);++x);o(a[f])||(a[f]={}),o(a[f][y])||(a[f][y]={dirty:!1,value:m.attributes[y].value,indices:[]});var b,T=S.values.length/S.componentsPerAttribute,M=n(s[y],0);T>M+E?(b=E,a[f][y].indices.push({attribute:S,offset:M,count:b}),s[y]=M+E):(b=T-M,a[f][y].indices.push({attribute:S,offset:M,count:b}),s[y]=0,l[y]=C+1),E-=b}return a}function w(e,t){var r=e.attributes;for(var n in r)if(r.hasOwnProperty(n)){var a=r[n];o(a)&&o(a.values)&&t.push(a.values.buffer)}o(e.indices)&&t.push(e.indices.buffer)}function A(e,t){for(var r=e.length,n=0;r>n;++n)w(e[n],t)}function x(e,t){for(var r=e.length,n=0;r>n;++n)for(var o=e[n],a=o.length,i=0;a>i;++i)t.push(o[i].values.buffer)}function b(t){for(var r=1,n=t.length,a=0;n>a;a++){var i=t[a],u=i.attributes;r+=4+e.packedLength+(o(i.indices)?i.indices.length:0);for(var s in u)if(u.hasOwnProperty(s)&&o(u[s])){var c=u[s];r+=5+c.values.length}}return r}function T(e,t){for(var r=e.length,n=new Uint32Array(e.length),o=0;r>o;++o)n[o]=e[o].toRgba();return t.push(n.buffer),n}function M(e){for(var r=e.length,n=new Array(r),o=0;r>o;o++)n[o]=t.fromRgba(e[o]);return n}function R(e){for(var t=e.length,r=1+17*t,n=0;t>n;n++){var a=e[n].attributes;for(var i in a)if(a.hasOwnProperty(i)&&o(a[i])){var u=a[i];r+=5+u.value.length}}return r}function O(e,t){var r=new Float64Array(R(e)),n={},a=[],i=e.length,u=0;r[u++]=i;for(var s=0;i>s;s++){var c=e[s];h.pack(c.modelMatrix,r,u),u+=h.packedLength;var l=c.attributes,f=[];for(var m in l)l.hasOwnProperty(m)&&o(l[m])&&(f.push(m),o(n[m])||(n[m]=a.length,a.push(m)));r[u++]=f.length;for(var d=0;d<f.length;d++){var p=f[d],y=l[p];r[u++]=n[p],r[u++]=y.componentDatatype,r[u++]=y.componentsPerAttribute,r[u++]=y.normalize,r[u++]=y.value.length,r.set(y.value,u),u+=y.value.length}}return t.push(r.buffer),{stringTable:a,packedData:r}}function I(e){for(var t=e.packedData,n=e.stringTable,o=new Array(t[0]),a=0,i=1;i<t.length;){var u=h.unpack(t,i);i+=h.packedLength;for(var s={},c=t[i++],l=0;c>l;l++){for(var f=n[t[i++]],m=t[i++],d=t[i++],p=0!==t[i++],y=t[i++],v=r.createTypedArray(m,y),g=0;y>g;g++)v[g]=t[i++];s[f]={componentDatatype:m,componentsPerAttribute:d,normalize:p,value:v}}o[a++]={attributes:s,modelMatrix:u}}return o}function N(e){for(var t=e.length,r=1+t,n=0;t>n;n++){var a=e[n];for(var i in a)if(a.hasOwnProperty(i)&&o(a[i])){var u=a[i];r+=3+3*u.indices.length+u.value.length}}return r}function L(e,t){var r=new Float64Array(N(e)),n=[],a=[],i={},u=e.length,s=0;r[s++]=u;for(var c=0;u>c;c++){var l=e[c],f=[];for(var m in l)l.hasOwnProperty(m)&&o(l[m])&&(f.push(m),o(i[m])||(i[m]=n.length,n.push(m)));r[s++]=f.length;for(var h=0;h<f.length;h++){var d=f[h],p=l[d];r[s++]=i[d];var y=p.indices,v=y.length;r[s++]=v;for(var g=0;v>g;g++){var E=y[g];r[s++]=E.count,r[s++]=E.offset;var S=a.indexOf(E.attribute);-1===S&&(S=a.length,a.push(E.attribute)),r[s++]=S}r[s++]=p.value.length,r.set(p.value,s),s+=p.value.length}}return t.push(r.buffer),{stringTable:n,packedData:r,attributeTable:a}}function z(e){for(var t=e.stringTable,n=e.attributeTable,o=e.packedData,a=new Array(o[0]),i=0,u=1,s=o.length;s>u;){for(var c={},l=o[u++],f=0;l>f;f++){for(var m=t[o[u++]],h=new Array(o[u++]),d=0;d<h.length;d++){var p={};p.count=o[u++],p.offset=o[u++],p.attribute=n[o[u++]],h[d]=p}for(var y=o[u++],v=r.createTypedArray(h[0].attribute.componentDatatype,y),g=0;y>g;g++)v[g]=o[u++];c[m]={dirty:!1,indices:h,value:v}}a[i++]=c}return a}if(!u.supportsTypedArrays())return{};var P={};return P.combineGeometry=function(e){for(var t=E(e),r=f.createAttributeLocations(t[0]),n=e.instances,o=v(n),a=[],i=t.length,u=0;i>u;++u){var s=t[u];a.push(S(s,r,o))}var c=C(n,a,r);return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:r,vaAttributes:a,vaAttributeLocations:c}},P.packCreateGeometryResults=function(t,r){var n=new Float64Array(b(t)),a=[],i={},u=t.length,s=0;n[s++]=u;for(var c=0;u>c;c++){var l=t[c];n[s++]=l.primitiveType,n[s++]=l.geometryType,e.pack(l.boundingSphere,n,s),s+=e.packedLength;var f=l.attributes,m=[];for(var h in f)f.hasOwnProperty(h)&&o(f[h])&&(m.push(h),o(i[h])||(i[h]=a.length,a.push(h)));n[s++]=m.length;for(var d=0;d<m.length;d++){var p=m[d],y=f[p];n[s++]=i[p],n[s++]=y.componentDatatype,n[s++]=y.componentsPerAttribute,n[s++]=y.normalize?1:0,n[s++]=y.values.length,n.set(y.values,s),s+=y.values.length}var v=o(l.indices)?l.indices.length:0;n[s++]=v,v>0&&(n.set(l.indices,s),s+=v)}return r.push(n.buffer),{stringTable:a,packedData:n}},P.unpackCreateGeometryResults=function(t){for(var n,o=t.stringTable,a=t.packedData,i=new Array(a[0]),u=0,s=1;s<a.length;){var f=a[s++],h=a[s++],d=e.unpack(a,s);s+=e.packedLength;var p,y,v,g={},E=a[s++];for(n=0;E>n;n++){var S=o[a[s++]],C=a[s++];v=a[s++];var w=0!==a[s++];p=a[s++],y=r.createTypedArray(C,p);for(var A=0;p>A;A++)y[A]=a[s++];g[S]=new l({componentDatatype:C,componentsPerAttribute:v,normalize:w,values:y})}var x;if(p=a[s++],p>0){var b=y.length/v;for(x=m.createTypedArray(b,p),n=0;p>n;n++)x[n]=a[s++]}i[u++]=new c({primitiveType:f,geometryType:h,boundingSphere:d,indices:x,attributes:g})}return i},P.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,n=r.length,o=0;n>o;o++)t.push(r[o].packedData.buffer);var a;return e.allowPicking&&(a=T(e.pickIds,t)),{createGeometryResults:e.createGeometryResults,packedInstances:O(e.instances,t),packedPickIds:a,ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix}},P.unpackCombineGeometryParameters=function(e){for(var t=I(e.packedInstances),r=e.allowPicking?M(e.packedPickIds):void 0,n=e.createGeometryResults,o=n.length,a=0,u=0;o>u;u++)for(var c=P.unpackCreateGeometryResults(n[u]),l=c.length,f=0;l>f;f++)t[a++].geometry=c[f];var m=i.clone(e.ellipsoid),p=e.isGeographic?new s(m):new d(m);return{instances:t,pickIds:r,ellipsoid:m,projection:p,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:h.clone(e.modelMatrix)}},P.packCombineGeometryResults=function(e,t){return A(e.geometries,t),x(e.vaAttributes,t),{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,packedVaAttributeLocations:L(e.vaAttributeLocations,t),modelMatrix:e.modelMatrix}},P.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,perInstanceAttributeLocations:z(e.packedVaAttributeLocations,e.vaAttributes),modelMatrix:e.modelMatrix}},P}),define("Core/formatError",["./defined"],function(e){"use strict";var t=function(t){var r,n=t.name,o=t.message;r=e(n)&&e(o)?n+": "+o:t.toString();var a=t.stack;return e(a)&&(r+="\n"+a),r};return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";var n=function(n){var o,a=[],i={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;a.length=0,i.id=s.id,i.error=void 0,i.result=void 0;try{i.result=n(s.parameters,a)}catch(c){i.error=c instanceof Error?{name:c.name,message:c.message,stack:c.stack}:c}t(o)||(o=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(a.length=0);try{o(i,a)}catch(c){i.result=void 0,i.error="postMessage failed with error: "+r(c)+"\n with responseMessage: "+JSON.stringify(i),o(i)}}};return n}),define("Workers/createGeometry",["../Core/defined","../Scene/PrimitivePipeline","./createTaskProcessorWorker","require"],function(e,t,r,n){"use strict";function o(t){var r=i[t];return e(r)||n(["./"+t],function(e){r=e,i[r]=e}),r}function a(r,n){for(var a=[],i=r.subTasks,u=0;u<i.length;u++){var s=i[u],c=s.geometry,l=s.moduleName;if(e(l)){var f=o(l);a.push(f(c))}else a.push(c)}return t.packCreateGeometryResults(a,n)}var i={};return r(a)})}(); \ No newline at end of file +/** + @license + when.js - https://github.com/cujojs/when + + MIT License (c) copyright B Cavalier & J Hann + + * A lightweight CommonJS Promises/A and when() implementation + * when is part of the cujo.js family of libraries (http://cujojs.com/) + * + * Licensed under the MIT License at: + * http://www.opensource.org/licenses/mit-license.php + * + * @version 1.7.1 + */ + +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";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(r){t=r.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=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 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(e){return e>0?1:0>e?-1:0},o.signNotZero=function(e){return 0>e?-1:1},o.toSNorm=function(e){return Math.round(255*(.5*o.clamp(e,-1,1)+.5))},o.fromSNorm=function(e){return o.clamp(e,0,255)/255*2-1},o.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},o.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},o.lerp=function(e,t,r){return(1-r)*e+r*t},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(e){return e*o.RADIANS_PER_DEGREE},o.toDegrees=function(e){return e*o.DEGREES_PER_RADIAN},o.convertLongitudeRange=function(e){var t=o.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},o.negativePiToPi=function(e){return o.zeroToTwoPi(e+o.PI)-o.PI},o.zeroToTwoPi=function(e){var t=o.mod(e,o.TWO_PI);return Math.abs(t)<o.EPSILON14&&Math.abs(e)>o.EPSILON14?o.TWO_PI:t},o.mod=function(e,t){return(e%t+t)%t},o.equalsEpsilon=function(e,r,n,o){o=t(o,n);var i=Math.abs(e-r);return o>=i||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];o.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;e>=n;n++)i.push(r*n);return i[e]},o.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},o.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},o.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},o.clamp=function(e,t,r){return t>e?t:e>r?r:e};var a=new e;return o.setRandomNumberSeed=function(t){a=new e(t)},o.nextRandomNumber=function(){return a.random()},o.acosClamped=function(e){return Math.acos(o.clamp(e,-1,1))},o.asinClamped=function(e){return Math.asin(o.clamp(e,-1,1))},o.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},o.logBase=function(e,t){return Math.log(e)/Math.log(t)},o.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},o}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,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(r,n){t(n)||(n=new i);var o=r.clock,a=r.cone,u=e(r.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(e,r,n,o){return t(o)?(o.x=e,o.y=r,o.z=n,o):new i(e,r,n)},i.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z},i.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new i),o.x=r[n++],o.y=r[n++],o.z=r[n],o},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 a=new i;i.distance=function(e,t){return i.subtract(e,t,a),i.magnitude(a)},i.distanceSquared=function(e,t){return i.subtract(e,t,a),i.magnitudeSquared(a)},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.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 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){i.normalize(e,s),i.normalize(t,c);var r=i.dot(s,c),n=i.magnitude(i.cross(s,c,s));return Math.atan2(n,r)};var l=new i;i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);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,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.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,r,n,i){return e===r||t(e)&&t(r)&&o.equalsEpsilon(e.x,r.x,n,i)&&o.equalsEpsilon(e.y,r.y,n,i)&&o.equalsEpsilon(e.z,r.z,n,i)},i.cross=function(e,t,r){var n=e.x,o=e.y,i=e.z,a=t.x,u=t.y,s=t.z,c=o*s-i*u,l=i*a-n*s,E=n*u-o*a;return r.x=c,r.y=l,r.z=E,r},i.fromDegrees=function(e,t,r,n,a){var u=o.toRadians(e),s=o.toRadians(t);return i.fromRadians(u,s,r,n,a)};var E=new i,f=new i,h=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(r,n,o,a,u){o=e(o,0);var s=t(a)?a.radiiSquared:h,c=Math.cos(n);E.x=c*Math.cos(r),E.y=c*Math.sin(r),E.z=Math.sin(n),E=i.normalize(E,E),i.multiplyComponents(s,E,f);var l=Math.sqrt(i.dot(E,f));return f=i.divideByScalar(f,l,f),E=i.multiplyByScalar(E,o,E),t(u)||(u=new i),i.add(f,E,u)},i.fromDegreesArray=function(e,t,r){for(var n=new Array(e.length),a=0;a<e.length;a++)n[a]=o.toRadians(e[a]);return i.fromRadiansArray(n,t,r)},i.fromRadiansArray=function(e,r,n){var o=e.length;t(n)?n.length=o/2:n=new Array(o/2);for(var a=0;o>a;a+=2){var u=e[a],s=e[a+1];n[a/2]=i.fromRadians(u,s,0,r,n[a/2])}return n},i.fromDegreesArrayHeights=function(e,t,r){for(var n=new Array(e.length),a=0;a<e.length;a+=3)n[a]=o.toRadians(e[a]),n[a+1]=o.toRadians(e[a+1]),n[a+2]=e[a+2];return i.fromRadiansArrayHeights(n,t,r)},i.fromRadiansArrayHeights=function(e,r,n){var o=e.length;t(n)?n.length=o/3:n=new Array(o/3);for(var a=0;o>a;a+=3){var u=e[a],s=e[a+1],c=e[a+2];n[a/3]=i.fromRadians(u,s,c,r,n[a/3])}return n},i.ZERO=n(new i(0,0,0)),i.UNIT_X=n(new i(1,0,0)),i.UNIT_Y=n(new i(0,1,0)),i.UNIT_Z=n(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 o(r,o,u,s,c){var l=r.x,E=r.y,f=r.z,h=o.x,m=o.y,d=o.z,p=l*l*h*h,T=E*E*m*m,R=f*f*d*d,A=p+T+R,_=Math.sqrt(1/A),y=e.multiplyByScalar(r,_,i);if(s>A)return isFinite(_)?e.clone(y,c):void 0;var v=u.x,S=u.y,C=u.z,g=a;g.x=y.x*v*2,g.y=y.y*S*2,g.z=y.z*C*2;var N,I,O,M,L,F,P,w,D,b,x,U=(1-_)*e.magnitude(r)/(.5*e.magnitude(g)),B=0;do{U-=B,O=1/(1+U*v),M=1/(1+U*S),L=1/(1+U*C),F=O*O,P=M*M,w=L*L,D=F*O,b=P*M,x=w*L,N=p*F+T*P+R*w-1,I=p*D*v+T*b*S+R*x*C;var G=-2*I;B=N/G}while(Math.abs(N)>n.EPSILON12);return t(c)?(c.x=l*O,c.y=E*M,c.z=f*L,c):new e(l*O,E*M,f*L)}var i=new e,a=new e;return o}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,o,i,a){"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,o,i){return o=t(o,0),r(i)?(i.longitude=e,i.latitude=n,i.height=o,i):new u(e,n,o)},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,o){var m=r(n)?n.oneOverRadii:E,d=r(n)?n.oneOverRadiiSquared:f,p=r(n)?n._centerToleranceSquared:h,T=a(t,m,d,p,c);if(r(T)){var R=e.multiplyComponents(t,d,s);R=e.normalize(R,R);var A=e.subtract(t,T,l),_=Math.atan2(R.y,R.x),y=Math.asin(R.z),v=i.sign(e.dot(A,t))*e.magnitude(A);return r(o)?(o.longitude=_,o.latitude=y,o.height=v,o):new u(_,y,v)}},u.clone=function(e,t){return r(e)?r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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=o(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,o,i,a,u,s){"use strict";function c(t,n,o,i){n=r(n,0),o=r(o,0),i=r(i,0),t._radii=new e(n,o,i),t._radiiSquared=new e(n*n,o*o,i*i),t._radiiToTheFourth=new e(n*n*n*n,o*o*o*o,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===o?0:1/o,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===o?0:1/(o*o),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,o,i),t._maximumRadius=Math.max(n,o,i),t._centerToleranceSquared=u.EPSILON1}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,c(this,e,t,r)}o(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 o=t._radii;return n(r)?(e.clone(o,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new l(o.x,o.y,o.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=a(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=a(new l(1,1,1)),l.MOON=a(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,o){o=r(o,0),e.pack(t._radii,n,o)},l.unpack=function(t,n,o){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,o)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var o=t.longitude,i=t.latitude,a=Math.cos(i),u=a*Math.cos(o),s=a*Math.sin(o),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 o=E,i=f;this.geodeticSurfaceNormalCartographic(t,o),e.multiplyComponents(this._radiiSquared,o,i);var a=Math.sqrt(e.dot(o,i));return e.divideByScalar(i,a,i),e.multiplyByScalar(o,t.height,o),n(r)||(r=new e),e.add(i,o,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var o=0;r>o;o++)t[o]=this.cartographicToCartesian(e[o],t[o]);return t};var h=new e,m=new e,d=new e;return l.prototype.cartesianToCartographic=function(r,o){var i=this.scaleToGeodeticSurface(r,m);if(n(i)){var a=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,d),c=Math.atan2(a.y,a.x),l=Math.asin(a.z),E=u.sign(e.dot(s,r))*e.magnitude(s);return n(o)?(o.longitude=c,o.latitude=l,o.height=E,o):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 o=0;r>o;++o)t[o]=this.cartesianToCartographic(e[o],t[o]);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 o=t.x,i=t.y,a=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(o*o*u.x+i*i*u.y+a*a*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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,o,i,a){"use strict";function u(e){this._ellipsoid=r(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return o(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var o=this._semimajorAxis,i=t.longitude*o,a=t.latitude*o,u=t.height;return n(r)?(r.x=i,r.y=a,r.z=u,r):new e(i,a,u)},u.prototype.unproject=function(e,r){var o=this._oneOverSemimajorAxis,i=e.x*o,a=e.y*o,u=e.z;return n(r)?(r.longitude=i,r.latitude=a,r.height=u,r):new t(i,a,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","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o,i){"use strict";function a(e,r,n,o,i,a,u,s,c){this[0]=t(e,0),this[1]=t(o,0),this[2]=t(u,0),this[3]=t(r,0),this[4]=t(i,0),this[5]=t(s,0),this[6]=t(n,0),this[7]=t(a,0),this[8]=t(c,0)}function u(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function s(e){for(var t=0,r=0;3>r;++r){var n=e[a.getElementIndex(h[r],f[r])];t+=2*n*n}return Math.sqrt(t)}function c(e,t){for(var r=i.EPSILON15,n=0,o=1,u=0;3>u;++u){var s=Math.abs(e[a.getElementIndex(h[u],f[u])]);s>n&&(o=u,n=s)}var c=1,l=0,E=f[o],m=h[o];if(Math.abs(e[a.getElementIndex(m,E)])>r){var d,p=e[a.getElementIndex(m,m)],T=e[a.getElementIndex(E,E)],R=e[a.getElementIndex(m,E)],A=(p-T)/2/R;d=0>A?-1/(-A+Math.sqrt(1+A*A)):1/(A+Math.sqrt(1+A*A)),c=1/Math.sqrt(1+d*d),l=d*c}return t=a.clone(a.IDENTITY,t),t[a.getElementIndex(E,E)]=t[a.getElementIndex(m,m)]=c,t[a.getElementIndex(m,E)]=l,t[a.getElementIndex(E,m)]=-l,t}a.packedLength=9,a.pack=function(e,r,n){n=t(n,0),r[n++]=e[0],r[n++]=e[1],r[n++]=e[2],r[n++]=e[3],r[n++]=e[4],r[n++]=e[5],r[n++]=e[6],r[n++]=e[7],r[n++]=e[8]},a.unpack=function(e,n,o){return n=t(n,0),r(o)||(o=new a),o[0]=e[n++],o[1]=e[n++],o[2]=e[n++],o[3]=e[n++],o[4]=e[n++],o[5]=e[n++],o[6]=e[n++],o[7]=e[n++],o[8]=e[n++],o},a.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new a(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},a.fromArray=function(e,n,o){return n=t(n,0),r(o)||(o=new a),o[0]=e[n],o[1]=e[n+1],o[2]=e[n+2],o[3]=e[n+3],o[4]=e[n+4],o[5]=e[n+5],o[6]=e[n+6],o[7]=e[n+7],o[8]=e[n+8],o},a.fromColumnMajorArray=function(e,t){return a.clone(e,t)},a.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 a(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},a.fromQuaternion=function(e,t){var n=e.x*e.x,o=e.x*e.y,i=e.x*e.z,u=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,m=n-s-E+h,d=2*(o-f),p=2*(i+l),T=2*(o+f),R=-n+s-E+h,A=2*(c-u),_=2*(i-l),y=2*(c+u),v=-n-s+E+h;return r(t)?(t[0]=m,t[1]=T,t[2]=_,t[3]=d,t[4]=R,t[5]=y,t[6]=p,t[7]=A,t[8]=v,t):new a(m,d,p,T,R,A,_,y,v)},a.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 a(e.x,0,0,0,e.y,0,0,0,e.z)},a.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 a(e,0,0,0,e,0,0,0,e)},a.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 a(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},a.fromRotationX=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=o,t[6]=0,t[7]=-o,t[8]=n,t):new a(1,0,0,0,n,-o,0,o,n)},a.fromRotationY=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-o,t[3]=0,t[4]=1,t[5]=0,t[6]=o,t[7]=0,t[8]=n,t):new a(n,0,o,0,1,0,-o,0,n)},a.fromRotationZ=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=n,t[1]=o,t[2]=0,t[3]=-o,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new a(n,-o,0,o,n,0,0,0,1)},a.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]]},a.getElementIndex=function(e,t){return 3*e+t},a.getColumn=function(e,t,r){var n=3*t,o=e[n],i=e[n+1],a=e[n+2];return r.x=o,r.y=i,r.z=a,r},a.setColumn=function(e,t,r,n){n=a.clone(e,n);var o=3*t;return n[o]=r.x,n[o+1]=r.y,n[o+2]=r.z,n},a.getRow=function(e,t,r){var n=e[t],o=e[t+3],i=e[t+6];return r.x=n,r.y=o,r.z=i,r},a.setRow=function(e,t,r,n){return n=a.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var l=new e;a.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),r};var E=new e;a.getMaximumScale=function(t){return a.getScale(t,E),e.maximumComponent(E)},a.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=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],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]=o,r[2]=i,r[3]=a,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=E,r},a.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},a.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},a.multiplyByVector=function(e,t,r){var n=t.x,o=t.y,i=t.z,a=e[0]*n+e[3]*o+e[6]*i,u=e[1]*n+e[4]*o+e[7]*i,s=e[2]*n+e[5]*o+e[8]*i;return r.x=a,r.y=u,r.z=s,r},a.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},a.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},a.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},a.transpose=function(e,t){var r=e[0],n=e[3],o=e[6],i=e[1],a=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=o,t[3]=i,t[4]=a,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var f=[1,0,0],h=[2,2,1],m=new a,d=new a;return a.computeEigenDecomposition=function(e,t){var n=i.EPSILON20,o=10,l=0,E=0;r(t)||(t={});for(var f=t.unitary=a.clone(a.IDENTITY,t.unitary),h=t.diagonal=a.clone(e,t.diagonal),p=n*u(h);o>E&&s(h)>p;)c(h,m),a.transpose(m,d),a.multiply(h,m,h),a.multiply(d,h,h),a.multiply(f,m,f),++l>2&&(++E,l=0);return t},a.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},a.determinant=function(e){var t=e[0],r=e[3],n=e[6],o=e[1],i=e[4],a=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*a)+o*(s*n-r*c)+u*(r*a-i*n)},a.inverse=function(e,t){var r=e[0],o=e[1],u=e[2],s=e[3],c=e[4],l=e[5],E=e[6],f=e[7],h=e[8],m=a.determinant(e);if(Math.abs(m)<=i.EPSILON15)throw new n("matrix is not invertible");t[0]=c*h-f*l,t[1]=f*u-o*h,t[2]=o*l-c*u,t[3]=E*l-s*h,t[4]=r*h-E*u,t[5]=s*u-r*l,t[6]=s*f-E*c,t[7]=E*o-r*f,t[8]=r*c-s*o;var d=1/m;return a.multiplyByScalar(t,d,t)},a.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]},a.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},a.IDENTITY=o(new a(1,0,0,0,1,0,0,0,1)),a.ZERO=o(new a(0,0,0,0,0,0,0,0,0)),a.COLUMN0ROW0=0,a.COLUMN0ROW1=1,a.COLUMN0ROW2=2,a.COLUMN1ROW0=3,a.COLUMN1ROW1=4,a.COLUMN1ROW2=5,a.COLUMN2ROW0=6,a.COLUMN2ROW1=7,a.COLUMN2ROW2=8,a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.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]},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},a}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";function i(t,r,n,o){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(o,0)}i.fromElements=function(e,r,n,o,a){return t(a)?(a.x=e,a.y=r,a.z=n,a.w=o,a):new i(e,r,n,o)},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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w},i.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new i),o.x=r[n++],o.y=r[n++],o.z=r[n++],o.w=r[n],o},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 a=new i;i.distance=function(e,t){return i.subtract(e,t,a),i.magnitude(a)},i.distanceSquared=function(e,t){return i.subtract(e,t,a),i.magnitudeSquared(a)},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.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)&&o.equalsEpsilon(e.x,r.x,n,i)&&o.equalsEpsilon(e.y,r.y,n,i)&&o.equalsEpsilon(e.z,r.z,n,i)&&o.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(r){t=r.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,o,i,a,u,s){"use strict";function c(e,t,n,o,i,a,u,s,c,l,E,f,h,m,d,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(a,0),this[6]=r(l,0),this[7]=r(m,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(E,0),this[11]=r(d,0),this[12]=r(o,0),this[13]=r(s,0),this[14]=r(f,0),this[15]=r(p,0)}c.packedLength=16,c.pack=function(e,t,n){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]},c.unpack=function(e,t,o){return t=r(t,0),n(o)||(o=new c),o[0]=e[t++],o[1]=e[t++],o[2]=e[t++],o[3]=e[t++],o[4]=e[t++],o[5]=e[t++],o[6]=e[t++],o[7]=e[t++],o[8]=e[t++],o[9]=e[t++],o[10]=e[t++],o[11]=e[t++],o[12]=e[t++],o[13]=e[t++],o[14]=e[t++],o[15]=e[t],o},c.clone=function(e,t){return n(e)?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 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]):void 0},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 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,o,i){return o=r(o,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]=o.x,i[13]=o.y,i[14]=o.z,i[15]=1,i):new c(t[0],t[3],t[6],o.x,t[1],t[4],t[7],o.y,t[2],t[5],t[8],o.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,r,o){n(o)||(o=new c);var i=r.x,a=r.y,u=r.z,s=t.x*t.x,l=t.x*t.y,E=t.x*t.z,f=t.x*t.w,h=t.y*t.y,m=t.y*t.z,d=t.y*t.w,p=t.z*t.z,T=t.z*t.w,R=t.w*t.w,A=s-h-p+R,_=2*(l-T),y=2*(E+d),v=2*(l+T),S=-s+h-p+R,C=2*(m-f),g=2*(E-d),N=2*(m+f),I=-s-h+p+R;return o[0]=A*i,o[1]=v*i,o[2]=g*i,o[3]=0,o[4]=_*a,o[5]=S*a,o[6]=N*a,o[7]=0,o[8]=y*u,o[9]=C*u,o[10]=I*u,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.IDENTITY,e,t)},c.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 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 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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,E=new e,f=new e;c.fromCamera=function(t,r){var o=t.eye,i=t.target,a=t.up;e.normalize(e.subtract(i,o,l),l),e.normalize(e.cross(l,a,E),E),e.normalize(e.cross(E,l,f),f);var u=E.x,s=E.y,h=E.z,m=l.x,d=l.y,p=l.z,T=f.x,R=f.y,A=f.z,_=o.x,y=o.y,v=o.z,S=u*-_+s*-y+h*-v,C=T*-_+R*-y+A*-v,g=m*_+d*y+p*v; +return n(r)?(r[0]=u,r[1]=T,r[2]=-m,r[3]=0,r[4]=s,r[5]=R,r[6]=-d,r[7]=0,r[8]=h,r[9]=A,r[10]=-p,r[11]=0,r[12]=S,r[13]=C,r[14]=g,r[15]=1,r):new c(u,s,h,S,T,R,A,C,-m,-d,-p,g,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,r,n,o){var i=Math.tan(.5*e),a=1/i,u=a/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=-1,o[12]=0,o[13]=0,o[14]=c,o[15]=0,o},c.computeOrthographicOffCenter=function(e,t,r,n,o,i,a){var u=1/(t-e),s=1/(n-r),c=1/(i-o),l=-(t+e)*u,E=-(n+r)*s,f=-(i+o)*c;return u*=2,s*=2,c*=-2,a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=s,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=c,a[11]=0,a[12]=l,a[13]=E,a[14]=f,a[15]=1,a},c.computePerspectiveOffCenter=function(e,t,r,n,o,i,a){var u=2*o/(t-e),s=2*o/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),E=-(i+o)/(i-o),f=-1,h=-2*i*o/(i-o);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=s,a[6]=0,a[7]=0,a[8]=c,a[9]=l,a[10]=E,a[11]=f,a[12]=0,a[13]=0,a[14]=h,a[15]=0,a},c.computeInfinitePerspectiveOffCenter=function(e,t,r,n,o,i){var a=2*o/(t-e),u=2*o/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,E=-1,f=-2*o;return i[0]=a,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},c.computeViewportTransformation=function(e,t,n,o){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),a=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,m=E,d=i+c,p=a+l,T=t+E,R=1;return o[0]=f,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=m,o[11]=0,o[12]=d,o[13]=p,o[14]=T,o[15]=R,o},c.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]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,r){var n=4*t,o=e[n],i=e[n+1],a=e[n+2],u=e[n+3];return r.x=o,r.y=i,r.z=a,r.w=u,r},c.setColumn=function(e,t,r,n){n=c.clone(e,n);var o=4*t;return n[o]=r.x,n[o+1]=r.y,n[o+2]=r.z,n[o+3]=r.w,n},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],o=e[t+4],i=e[t+8],a=e[t+12];return r.x=n,r.y=o,r.z=i,r.w=a,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 h=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],h)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],h)),r};var m=new e;c.getMaximumScale=function(t){return c.getScale(t,m),e.maximumComponent(m)},c.multiply=function(e,t,r){var n=e[0],o=e[1],i=e[2],a=e[3],u=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=e[9],h=e[10],m=e[11],d=e[12],p=e[13],T=e[14],R=e[15],A=t[0],_=t[1],y=t[2],v=t[3],S=t[4],C=t[5],g=t[6],N=t[7],I=t[8],O=t[9],M=t[10],L=t[11],F=t[12],P=t[13],w=t[14],D=t[15],b=n*A+u*_+E*y+d*v,x=o*A+s*_+f*y+p*v,U=i*A+c*_+h*y+T*v,B=a*A+l*_+m*y+R*v,G=n*S+u*C+E*g+d*N,z=o*S+s*C+f*g+p*N,V=i*S+c*C+h*g+T*N,H=a*S+l*C+m*g+R*N,q=n*I+u*O+E*M+d*L,W=o*I+s*O+f*M+p*L,Y=i*I+c*O+h*M+T*L,X=a*I+l*O+m*M+R*L,k=n*F+u*P+E*w+d*D,K=o*F+s*P+f*w+p*D,Z=i*F+c*P+h*w+T*D,j=a*F+l*P+m*w+R*D;return r[0]=b,r[1]=x,r[2]=U,r[3]=B,r[4]=G,r[5]=z,r[6]=V,r[7]=H,r[8]=q,r[9]=W,r[10]=Y,r[11]=X,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],o=e[1],i=e[2],a=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=e[12],h=e[13],m=e[14],d=t[0],p=t[1],T=t[2],R=t[4],A=t[5],_=t[6],y=t[8],v=t[9],S=t[10],C=t[12],g=t[13],N=t[14],I=n*d+a*p+c*T,O=o*d+u*p+l*T,M=i*d+s*p+E*T,L=n*R+a*A+c*_,F=o*R+u*A+l*_,P=i*R+s*A+E*_,w=n*y+a*v+c*S,D=o*y+u*v+l*S,b=i*y+s*v+E*S,x=n*C+a*g+c*N+f,U=o*C+u*g+l*N+h,B=i*C+s*g+E*N+m;return r[0]=I,r[1]=O,r[2]=M,r[3]=0,r[4]=L,r[5]=F,r[6]=P,r[7]=0,r[8]=w,r[9]=D,r[10]=b,r[11]=0,r[12]=x,r[13]=U,r[14]=B,r[15]=1,r},c.multiplyByMatrix3=function(e,t,r){var n=e[0],o=e[1],i=e[2],a=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=t[0],h=t[1],m=t[2],d=t[3],p=t[4],T=t[5],R=t[6],A=t[7],_=t[8],y=n*f+a*h+c*m,v=o*f+u*h+l*m,S=i*f+s*h+E*m,C=n*d+a*p+c*T,g=o*d+u*p+l*T,N=i*d+s*p+E*T,I=n*R+a*A+c*_,O=o*R+u*A+l*_,M=i*R+s*A+E*_;return r[0]=y,r[1]=v,r[2]=S,r[3]=0,r[4]=C,r[5]=g,r[6]=N,r[7]=0,r[8]=I,r[9]=O,r[10]=M,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,o=t.y,i=t.z,a=n*e[0]+o*e[4]+i*e[8]+e[12],u=n*e[1]+o*e[5]+i*e[9]+e[13],s=n*e[2]+o*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]=a,r[13]=u,r[14]=s,r[15]=e[15],r};var d=new e;c.multiplyByUniformScale=function(e,t,r){return d.x=t,d.y=t,d.z=t,c.multiplyByScale(e,d,r)},c.multiplyByScale=function(e,t,r){var n=t.x,o=t.y,i=t.z;return 1===n&&1===o&&1===i?c.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=o*e[4],r[5]=o*e[5],r[6]=o*e[6],r[7]=0,r[8]=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)},c.multiplyByVector=function(e,t,r){var n=t.x,o=t.y,i=t.z,a=t.w,u=e[0]*n+e[4]*o+e[8]*i+e[12]*a,s=e[1]*n+e[5]*o+e[9]*i+e[13]*a,c=e[2]*n+e[6]*o+e[10]*i+e[14]*a,l=e[3]*n+e[7]*o+e[11]*i+e[15]*a;return r.x=u,r.y=s,r.z=c,r.w=l,r},c.multiplyByPointAsVector=function(e,t,r){var n=t.x,o=t.y,i=t.z,a=e[0]*n+e[4]*o+e[8]*i,u=e[1]*n+e[5]*o+e[9]*i,s=e[2]*n+e[6]*o+e[10]*i;return r.x=a,r.y=u,r.z=s,r},c.multiplyByPoint=function(e,t,r){var n=t.x,o=t.y,i=t.z,a=e[0]*n+e[4]*o+e[8]*i+e[12],u=e[1]*n+e[5]*o+e[9]*i+e[13],s=e[2]*n+e[6]*o+e[10]*i+e[14];return r.x=a,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],o=e[3],i=e[6],a=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]=o,t[13]=a,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||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]},c.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},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 p=new u,T=new u,R=new t,A=new t(0,0,0,1);return c.inverse=function(e,r){if(u.equalsEpsilon(c.getRotation(e,p),T,a.EPSILON7)&&t.equals(c.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],o=e[4],i=e[8],l=e[12],E=e[1],f=e[5],h=e[9],m=e[13],d=e[2],_=e[6],y=e[10],v=e[14],S=e[3],C=e[7],g=e[11],N=e[15],I=y*N,O=v*g,M=_*N,L=v*C,F=_*g,P=y*C,w=d*N,D=v*S,b=d*g,x=y*S,U=d*C,B=_*S,G=I*f+L*h+F*m-(O*f+M*h+P*m),z=O*E+w*h+x*m-(I*E+D*h+b*m),V=M*E+D*f+U*m-(L*E+w*f+B*m),H=P*E+b*f+B*h-(F*E+x*f+U*h),q=O*o+M*i+P*l-(I*o+L*i+F*l),W=I*n+D*i+b*l-(O*n+w*i+x*l),Y=L*n+w*o+B*l-(M*n+D*o+U*l),X=F*n+x*o+U*i-(P*n+b*o+B*i);I=i*m,O=l*h,M=o*m,L=l*f,F=o*h,P=i*f,w=n*m,D=l*E,b=n*h,x=i*E,U=n*f,B=o*E;var k=I*C+L*g+F*N-(O*C+M*g+P*N),K=O*S+w*g+x*N-(I*S+D*g+b*N),Z=M*S+D*C+U*N-(L*S+w*C+B*N),j=P*S+b*C+B*g-(F*S+x*C+U*g),Q=M*y+P*v+O*_-(F*v+I*_+L*y),J=b*v+I*d+D*y-(w*y+x*v+O*d),$=w*_+B*v+L*d-(U*v+M*d+D*_),ee=U*y+F*d+x*_-(b*_+B*y+P*d),te=n*G+o*z+i*V+l*H;if(Math.abs(te)<a.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=G*te,r[1]=z*te,r[2]=V*te,r[3]=H*te,r[4]=q*te,r[5]=W*te,r[6]=Y*te,r[7]=X*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],o=e[2],i=e[4],a=e[5],u=e[6],s=e[8],c=e[9],l=e[10],E=e[12],f=e[13],h=e[14],m=-r*E-n*f-o*h,d=-i*E-a*f-u*h,p=-s*E-c*f-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=a,t[6]=c,t[7]=0,t[8]=o,t[9]=u,t[10]=l,t[11]=0,t[12]=m,t[13]=d,t[14]=p,t[15]=1,t},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,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/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function o(t,r){this.normal=e.clone(t),this.distance=r}o.fromPointNormal=function(r,n,i){var a=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=a,i):new o(n,a)};var i=new e;return o.fromCartesian4=function(r,n){var a=e.fromCartesian4(r,i),u=r.w;return t(n)?(e.clone(a,n.normal),n.distance=u,n):new o(a,u)},o.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},o.ORIGIN_XY_PLANE=n(new o(e.UNIT_Z,0)),o.ORIGIN_YZ_PLANE=n(new o(e.UNIT_X,0)),o.ORIGIN_ZX_PLANE=n(new o(e.UNIT_Y,0)),o}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,o,i,a,u){"use strict";function s(e,r,n,o){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(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(e,r,n){n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north},s.unpack=function(e,n,o){return n=t(n,0),r(o)||(o=new s),o.west=e[n++],o.south=e[n++],o.east=e[n++],o.north=e[n],o},s.computeWidth=function(e){var t=e.east,r=e.west;return r>t&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,n,o,i,a){return e=u.toRadians(t(e,0)),n=u.toRadians(t(n,0)),o=u.toRadians(t(o,0)),i=u.toRadians(t(i,0)),r(a)?(a.west=e,a.south=n,a.east=o,a.north=i,a):new s(e,n,o,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,E=0,f=e.length;f>E;E++){var h=e[E];n=Math.min(n,h.longitude),o=Math.max(o,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var m=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,m),a=Math.max(a,m)}return o-n>a-i&&(n=i,o=a,o>u.PI&&(o-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=o,t.north=l,t):new s(n,c,o,l)},s.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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 o=t.east,i=t.west;i>o&&(o+=u.TWO_PI);var a=u.negativePiToPi(.5*(i+o)),s=.5*(t.south+t.north);return r(n)?(n.longitude=a,n.latitude=s,n.height=0,n):new e(a,s)},s.intersection=function(e,t,n){var o=e.east,i=e.west,a=t.east,c=t.west;i>o&&a>0?o+=u.TWO_PI:c>a&&o>0&&(a+=u.TWO_PI),i>o&&0>c?c+=u.TWO_PI:c>a&&0>i&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),E=u.negativePiToPi(Math.min(o,a));if(!((e.west<e.east||t.west<t.east)&&l>=E)){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.union=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.west),n.south=Math.min(e.south,t.south),n.east=Math.max(e.east,t.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 r=t.longitude,n=t.latitude,o=e.west,i=e.east;return o>i&&(i+=u.TWO_PI,0>r&&(r+=u.TWO_PI)),(r>o||u.equalsEpsilon(r,o,u.EPSILON14))&&(i>r||u.equalsEpsilon(r,i,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,n,o,a){n=t(n,i.WGS84),o=t(o,0),r(a)||(a=[]);var l=0,E=e.north,f=e.south,h=e.east,m=e.west,d=c;d.height=o,d.longitude=m,d.latitude=E,a[l]=n.cartographicToCartesian(d,a[l]),l++,d.longitude=h,a[l]=n.cartographicToCartesian(d,a[l]),l++,d.latitude=f,a[l]=n.cartographicToCartesian(d,a[l]),l++,d.longitude=m,a[l]=n.cartographicToCartesian(d,a[l]),l++,0>E?d.latitude=E:f>0?d.latitude=f:d.latitude=0;for(var p=1;8>p;++p)d.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,d)&&(a[l]=n.cartographicToCartesian(d,a[l]),l++);return 0===d.latitude&&(d.longitude=m,a[l]=n.cartographicToCartesian(d,a[l]),l++,d.longitude=h,a[l]=n.cartographicToCartesian(d,a[l]),l++),a.length=l,a},s.MAX_VALUE=a(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Plane","./Rectangle"],function(e,t,r,n,o,i,a,u,s,c,l,E,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var m=new e,d=new e,p=new e,T=new e,R=new e,A=new e,_=new e,y=new e,v=new e,S=new e,C=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 o=e.clone(t[0],_),i=e.clone(o,m),a=e.clone(o,d),u=e.clone(o,p),s=e.clone(o,T),c=e.clone(o,R),l=e.clone(o,A),E=t.length,f=1;E>f;f++){e.clone(t[f],o);var N=o.x,I=o.y,O=o.z;N<i.x&&e.clone(o,i),N>s.x&&e.clone(o,s),I<a.y&&e.clone(o,a),I>c.y&&e.clone(o,c),O<u.z&&e.clone(o,u),O>l.z&&e.clone(o,l)}var M=e.magnitudeSquared(e.subtract(s,i,y)),L=e.magnitudeSquared(e.subtract(c,a,y)),F=e.magnitudeSquared(e.subtract(l,u,y)),P=i,w=s,D=M;L>D&&(D=L,P=a,w=c),F>D&&(D=F,P=u,w=l);var b=v;b.x=.5*(P.x+w.x),b.y=.5*(P.y+w.y),b.z=.5*(P.z+w.z);var x=e.magnitudeSquared(e.subtract(w,b,y)),U=Math.sqrt(x),B=S;B.x=i.x,B.y=a.y,B.z=u.z;var G=C;G.x=s.x,G.y=c.y,G.z=l.z;var z=e.multiplyByScalar(e.add(B,G,y),.5,g),V=0;for(f=0;E>f;f++){e.clone(t[f],o);var H=e.magnitude(e.subtract(o,z,y));H>V&&(V=H);var q=e.magnitudeSquared(e.subtract(o,b,y));if(q>x){var W=Math.sqrt(q);U=.5*(U+W),x=U*U;var Y=W-U;b.x=(U*b.x+Y*o.x)/W,b.y=(U*b.y+Y*o.y)/W,b.z=(U*b.z+Y*o.z)/W}}return V>U?(e.clone(b,r.center),r.radius=U):(e.clone(z,r.center),r.radius=V),r};var N=new a,I=new e,O=new e,M=new t,L=new t;h.fromRectangle2D=function(e,t,r){return h.fromRectangleWithHeights2D(e,t,0,0,r)},h.fromRectangleWithHeights2D=function(t,o,i,a,u){if(n(u)||(u=new h),!n(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;o=r(o,N),f.southwest(t,M),M.height=i,f.northeast(t,L),L.height=a;var s=o.project(M,I),c=o.project(L,O),l=c.x-s.x,E=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(l*l+E*E+m*m);var d=u.center;return d.x=s.x+.5*l,d.y=s.y+.5*E,d.z=s.z+.5*m,u};var F=[];h.fromRectangle3D=function(e,t,o,a){t=r(t,i.WGS84),o=r(o,0);var u;return n(e)&&(u=f.subsample(e,t,o,F)),h.fromPoints(u,a)},h.fromVertices=function(t,o,i,a){if(n(a)||(a=new h),!n(t)||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;o=r(o,e.ZERO),i=r(i,3);var u=_;u.x=t[0]+o.x,u.y=t[1]+o.y,u.z=t[2]+o.z;for(var s=e.clone(u,m),c=e.clone(u,d),l=e.clone(u,p),E=e.clone(u,T),f=e.clone(u,R),N=e.clone(u,A),I=t.length,O=0;I>O;O+=i){var M=t[O]+o.x,L=t[O+1]+o.y,F=t[O+2]+o.z;u.x=M,u.y=L,u.z=F,M<s.x&&e.clone(u,s),M>E.x&&e.clone(u,E),L<c.y&&e.clone(u,c),L>f.y&&e.clone(u,f),F<l.z&&e.clone(u,l),F>N.z&&e.clone(u,N)}var P=e.magnitudeSquared(e.subtract(E,s,y)),w=e.magnitudeSquared(e.subtract(f,c,y)),D=e.magnitudeSquared(e.subtract(N,l,y)),b=s,x=E,U=P;w>U&&(U=w,b=c,x=f),D>U&&(U=D,b=l,x=N);var B=v;B.x=.5*(b.x+x.x),B.y=.5*(b.y+x.y),B.z=.5*(b.z+x.z);var G=e.magnitudeSquared(e.subtract(x,B,y)),z=Math.sqrt(G),V=S;V.x=s.x,V.y=c.y,V.z=l.z;var H=C;H.x=E.x,H.y=f.y,H.z=N.z;var q=e.multiplyByScalar(e.add(V,H,y),.5,g),W=0;for(O=0;I>O;O+=i){u.x=t[O]+o.x,u.y=t[O+1]+o.y,u.z=t[O+2]+o.z;var Y=e.magnitude(e.subtract(u,q,y));Y>W&&(W=Y);var X=e.magnitudeSquared(e.subtract(u,B,y));if(X>G){var k=Math.sqrt(X);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 W>z?(e.clone(B,a.center),a.radius=z):(e.clone(q,a.center),a.radius=W),a},h.fromEncodedCartesianVertices=function(t,r,o){if(n(o)||(o=new h),!n(t)||!n(r)||t.length!==r.length||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;var i=_;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var a=e.clone(i,m),u=e.clone(i,d),s=e.clone(i,p),c=e.clone(i,T),l=e.clone(i,R),E=e.clone(i,A),f=t.length,N=0;f>N;N+=3){var I=t[N]+r[N],O=t[N+1]+r[N+1],M=t[N+2]+r[N+2];i.x=I,i.y=O,i.z=M,I<a.x&&e.clone(i,a),I>c.x&&e.clone(i,c),O<u.y&&e.clone(i,u),O>l.y&&e.clone(i,l),M<s.z&&e.clone(i,s),M>E.z&&e.clone(i,E)}var L=e.magnitudeSquared(e.subtract(c,a,y)),F=e.magnitudeSquared(e.subtract(l,u,y)),P=e.magnitudeSquared(e.subtract(E,s,y)),w=a,D=c,b=L;F>b&&(b=F,w=u,D=l),P>b&&(b=P,w=s,D=E);var x=v;x.x=.5*(w.x+D.x),x.y=.5*(w.y+D.y),x.z=.5*(w.z+D.z);var U=e.magnitudeSquared(e.subtract(D,x,y)),B=Math.sqrt(U),G=S;G.x=a.x,G.y=u.y,G.z=s.z;var z=C;z.x=c.x,z.y=l.y,z.z=E.z;var V=e.multiplyByScalar(e.add(G,z,y),.5,g),H=0;for(N=0;f>N;N+=3){i.x=t[N]+r[N],i.y=t[N+1]+r[N+1],i.z=t[N+2]+r[N+2];var q=e.magnitude(e.subtract(i,V,y));q>H&&(H=q);var W=e.magnitudeSquared(e.subtract(i,x,y));if(W>U){var Y=Math.sqrt(W);B=.5*(B+Y),U=B*B;var X=Y-B;x.x=(B*x.x+X*i.x)/Y,x.y=(B*x.y+X*i.y)/Y,x.z=(B*x.z+X*i.z)/Y}}return H>B?(e.clone(x,o.center),o.radius=B):(e.clone(V,o.center),o.radius=H),o},h.fromCornerPoints=function(t,r,o){n(o)||(o=new h);var i=o.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),o.radius=e.distance(i,r),o},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 o=t.length;if(1===o)return h.clone(t[0],r);if(2===o)return h.union(t[0],t[1],r);for(var i=[],a=0;o>a;a++)i.push(t[a].center);r=h.fromPoints(i,r);var u=r.center,s=r.radius;for(a=0;o>a;a++){var c=t[a];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return r.radius=s,r};var w=new e,D=new e,b=new e;h.fromOrientedBoundingBox=function(t,r){n(r)||(r=new h);var o=t.halfAxes,i=c.getColumn(o,0,w),a=c.getColumn(o,1,D),u=c.getColumn(o,2,b),s=e.magnitude(i),l=e.magnitude(a),E=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,E),r},h.clone=function(t,r){return n(t)?n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new h(t.center,t.radius):void 0},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var o=e.center;t[n++]=o.x,t[n++]=o.y,t[n++]=o.z,t[n]=e.radius},h.unpack=function(e,t,o){t=r(t,0),n(o)||(o=new h);var i=o.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],o.radius=e[t],o};var x=new e,U=new e;h.union=function(t,r,o){n(o)||(o=new h);var i=t.center,a=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,x),l=e.magnitude(c);if(a>=l+s)return t.clone(o),o;if(s>=l+a)return r.clone(o),o;var E=.5*(a+l+s),f=e.multiplyByScalar(c,(-a+E)/l,U);return e.add(f,i,f),e.clone(f,o.center),o.radius=E,o};var B=new e;h.expand=function(t,r,n){n=h.clone(t,n);var o=e.magnitude(e.subtract(r,n.center,B));return o>n.radius&&(n.radius=o),n},h.intersectPlane=function(t,r){var n=t.center,o=t.radius,i=r.normal,a=e.dot(i,n)+r.distance;return-o>a?u.OUTSIDE:o>a?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 G=new e;h.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,G);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 z=new e;h.computePlaneDistances=function(t,r,o,i){n(i)||(i=new s);var a=e.subtract(t.center,r,z),u=e.dot(o,a);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var V=new e,H=new e,q=new e,W=new e,Y=new e,X=new t,k=new Array(8),K=0;8>K;++K)k[K]=new e;var Z=new a;return h.projectTo2D=function(t,n,o){n=r(n,Z);var i=n.ellipsoid,a=t.center,u=t.radius,s=i.geodeticSurfaceNormal(a,V),c=e.cross(e.UNIT_Z,s,H);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,Y),f=e.negate(c,W),m=k,d=m[0];e.add(s,l,d),e.add(d,c,d),d=m[1],e.add(s,l,d),e.add(d,f,d),d=m[2],e.add(s,E,d),e.add(d,f,d),d=m[3],e.add(s,E,d),e.add(d,c,d),e.negate(s,s),d=m[4],e.add(s,l,d),e.add(d,c,d),d=m[5],e.add(s,l,d),e.add(d,f,d),d=m[6],e.add(s,E,d),e.add(d,f,d),d=m[7],e.add(s,E,d),e.add(d,c,d);for(var p=m.length,T=0;p>T;++T){var R=m[T];e.add(a,R,R);var A=i.cartesianToCartographic(R,X);n.project(A,R)}o=h.fromPoints(m,o),a=o.center;var _=a.x,y=a.y,v=a.z;return a.x=v,a.y=_,a.z=y,o},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},o={};return t(o,{element:{get:function(){return o.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return o.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return o.supportsFullscreen()?null!==o.element:void 0}}}),o.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var o,i=["webkit","moz","o","ms","khtml"],a=0,u=i.length;u>a;++a){var s=i[a];o=s+"RequestFullscreen","function"==typeof t[o]?(n.requestFullscreen=o,r=!0):(o=s+"RequestFullScreen","function"==typeof t[o]&&(n.requestFullscreen=o,r=!0)),o=s+"ExitFullscreen","function"==typeof document[o]?n.exitFullscreen=o:(o=s+"CancelFullScreen","function"==typeof document[o]&&(n.exitFullscreen=o)),o=s+"FullscreenEnabled",e(document[o])?n.fullscreenEnabled=o:(o=s+"FullScreenEnabled",e(document[o])&&(n.fullscreenEnabled=o)),o=s+"FullscreenElement",e(document[o])?n.fullscreenElement=o:(o=s+"FullScreenElement",e(document[o])&&(n.fullscreenElement=o)),o=s+"fullscreenchange",e(document["on"+o])&&("ms"===s&&(o="MSFullscreenChange"),n.fullscreenchange=o),o=s+"fullscreenerror",e(document["on"+o])&&("ms"===s&&(o="MSFullscreenError"),n.fullscreenerror=o)}return r},o.requestFullscreen=function(e,t){o.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},o.exitFullscreen=function(){o.supportsFullscreen()&&document[n.exitFullscreen]()},o}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function n(e){for(var t=e.split("."),r=0,n=t.length;n>r;++r)t[r]=parseInt(t[r],10);return t}function o(){if(!t(A)){A=!1;var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,_=n(e[1]))}return A}function i(){return o()&&_}function a(){if(!t(y)&&(y=!1,!o()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(y=!0,v=n(e[1]))}return y}function u(){return a()&&v}function s(){if(!t(S)){S=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(S=!0,C=n(e[1]),C.isNightly=!!e[2])}return S}function c(){return s()&&C}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,N=n(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,N=n(e[1])))}return g}function E(){return l()&&N}function f(){if(!t(I)){I=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(I=!0,O=n(e[1]))}return I}function h(){return t(M)||(M=/Windows/i.test(R.appVersion)),M}function m(){return f()&&O}function d(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),L}function p(){if(!t(P)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;P=t(r)&&""!==r,P&&(F=r)}return P}function T(){return p()?F:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,_,y,v,S,C,g,N,I,O,M,L,F,P,w={isChrome:o,chromeVersion:i,isSafari:a,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:E,isFirefox:f,firefoxVersion:m,isWindows:h,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:d,supportsImageRenderingPixelated:p,imageRenderingValue:T};return w.supportsFullscreen=function(){return r.supportsFullscreen()},w.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},w.supportsWebWorkers=function(){return"undefined"!=typeof Worker},w}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(e,t,r,n,o,i){"use strict";function a(e,t,r){return 0>r&&(r+=1),r>1&&(r-=1),1>6*r?e+6*(t-e)*r:1>2*r?t:2>3*r?e+(t-e)*(2/3-r)*6:e}function u(t,r,n,o){this.red=e(t,1),this.green=e(r,1),this.blue=e(n,1),this.alpha=e(o,1)}u.fromCartesian4=function(e,r){return t(r)?(r.red=e.x,r.green=e.y,r.blue=e.z,r.alpha=e.w,r):new u(e.x,e.y,e.z,e.w)},u.fromBytes=function(r,n,o,i,a){return r=u.byteToFloat(e(r,255)),n=u.byteToFloat(e(n,255)),o=u.byteToFloat(e(o,255)),i=u.byteToFloat(e(i,255)),t(a)?(a.red=r,a.green=n,a.blue=o,a.alpha=i,a):new u(r,n,o,i)},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,c,l;n.supportsTypedArrays()&&(s=new ArrayBuffer(4),c=new Uint32Array(s),l=new Uint8Array(s)),u.fromRgba=function(e){return c[0]=e,u.fromBytes(l[0],l[1],l[2],l[3])},u.fromHsl=function(t,r,n,o){t=e(t,0)%1,r=e(r,0),n=e(n,0),o=e(o,1);var i=n,s=n,c=n;if(0!==r){var l;l=.5>n?n*(1+r):n+r-n*r;var E=2*n-l;i=a(E,l,t+1/3),s=a(E,l,t),c=a(E,l,t-1/3)}return new u(i,s,c,o)},u.fromRandom=function(r,n){r=e(r,e.EMPTY_OBJECT);var o=r.red;if(!t(o)){var a=e(r.minimumRed,0),s=e(r.maximumRed,1);o=a+i.nextRandomNumber()*(s-a)}var c=r.green;if(!t(c)){var l=e(r.minimumGreen,0),E=e(r.maximumGreen,1);c=l+i.nextRandomNumber()*(E-l)}var f=r.blue;if(!t(f)){var h=e(r.minimumBlue,0),m=e(r.maximumBlue,1);f=h+i.nextRandomNumber()*(m-h)}var d=r.alpha;if(!t(d)){var p=e(r.minimumAlpha,0),T=e(r.maximumAlpha,1);d=p+i.nextRandomNumber()*(T-p)}return t(n)?(n.red=o,n.green=c,n.blue=f,n.alpha=d,n):new u(o,c,f,d)};var E=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,f=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,h=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,m=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return u.fromCssColorString=function(r){var n=u[r.toUpperCase()];if(t(n))return u.clone(n);var o=E.exec(r);return null!==o?new u(parseInt(o[1],16)/15,parseInt(o[2],16)/15,parseInt(o[3],16)/15):(o=f.exec(r),null!==o?new u(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255):(o=h.exec(r),null!==o?new u(parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),parseFloat(e(o[4],"1.0"))):(o=m.exec(r),null!==o?u.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(e(o[4],"1.0"))):void 0)))},u.packedLength=4,u.pack=function(t,r,n){n=e(n,0),r[n++]=t.red,r[n++]=t.green,r[n++]=t.blue,r[n]=t.alpha},u.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new u),o.red=r[n++],o.green=r[n++],o.blue=r[n++],o.alpha=r[n],o},u.byteToFloat=function(e){return e/255},u.floatToByte=function(e){return 1===e?255:256*e|0},u.clone=function(e,r){return t(e)?t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=e.alpha,r):new u(e.red,e.green,e.blue,e.alpha):void 0; +},u.equals=function(e,r){return e===r||t(e)&&t(r)&&e.red===r.red&&e.green===r.green&&e.blue===r.blue&&e.alpha===r.alpha},u.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),o=u.floatToByte(this.blue),i=u.floatToByte(this.alpha);return t(e)?(e[0]=r,e[1]=n,e[2]=o,e[3]=i,e):[r,n,o,i]},u.prototype.toRgba=function(){return l[0]=u.floatToByte(this.red),l[1]=u.floatToByte(this.green),l[2]=u.floatToByte(this.blue),l[3]=u.floatToByte(this.alpha),c[0]},u.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.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("Renderer/WebGLConstants",["../Core/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",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,r,n,o,i){"use strict";if(!o.supportsTypedArrays())return{};var a={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return r(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(e,r,o,i){switch(o=t(o,0),i=t(i,(r.byteLength-o)/a.getSizeInBytes(e)),e){case a.BYTE:return new Int8Array(r,o,i);case a.UNSIGNED_BYTE:return new Uint8Array(r,o,i);case a.SHORT:return new Int16Array(r,o,i);case a.UNSIGNED_SHORT:return new Uint16Array(r,o,i);case a.FLOAT:return new Float32Array(r,o,i);case a.DOUBLE:return new Float64Array(r,o,i);default:throw new n("componentDatatype is not a valid value.")}},i(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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,o){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,o.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=void 0}return i.computeNumberOfVertices=function(e){var n=-1;for(var o in e.attributes)if(e.attributes.hasOwnProperty(o)&&t(e.attributes[o])&&t(e.attributes[o].values)){var i=e.attributes[o],a=i.values.length/i.componentsPerAttribute;if(n!==a&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=a}return n},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,o){"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){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n]=t.y},i.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new i),o.x=r[n++],o.y=r[n],o},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 a=new i;i.distance=function(e,t){return i.subtract(e,t,a),i.magnitude(a)},i.distanceSquared=function(e,t){return i.subtract(e,t,a),i.magnitudeSquared(a)},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.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),o.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)&&o.equalsEpsilon(e.x,r.x,n,i)&&o.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,o){"use strict";var i={};i.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=t.x,n=t.y;t.x=(1-Math.abs(n))*o.signNotZero(r),t.y=(1-Math.abs(r))*o.signNotZero(n)}return t.x=o.toSNorm(t.x),t.y=o.toSNorm(t.y),t},i.octDecode=function(e,r,n){if(n.x=o.fromSNorm(e),n.y=o.fromSNorm(r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var i=n.x;n.x=(1-Math.abs(n.y))*o.signNotZero(i),n.y=(1-Math.abs(i))*o.signNotZero(n.y)}return t.normalize(n,n)},i.octPackFloat=function(e){return 256*e.x+e.y};var a=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,a),i.octPackFloat(a)},i.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),o=256*(r-n);return i.octDecode(n,o,t)},i.octPack=function(e,t,r,n){var o=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(r,a);return n.x=65536*s.x+o,n.y=65536*s.y+u,n},i.octUnpack=function(e,t,r,n){var o=e.x/65536,a=Math.floor(o),u=65536*(o-a);o=e.y/65536;var s=Math.floor(o),c=65536*(o-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,r),i.octDecode(a,s,n)},i.compressTextureCoordinates=function(e){var t=1===e.x?4095:4096*e.x|0,r=1===e.y?4095:4096*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096;return t.x=Math.floor(r)/4096,t.y=r-Math.floor(r),t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function o(n,o,s,c,l){r(l)||(l=new t);var E,f,h,m,d,p,T,R;r(o.z)?(E=t.subtract(s,o,i),f=t.subtract(c,o,a),h=t.subtract(n,o,u),m=t.dot(E,E),d=t.dot(E,f),p=t.dot(E,h),T=t.dot(f,f),R=t.dot(f,h)):(E=e.subtract(s,o,i),f=e.subtract(c,o,a),h=e.subtract(n,o,u),m=e.dot(E,E),d=e.dot(E,f),p=e.dot(E,h),T=e.dot(f,f),R=e.dot(f,h));var A=1/(m*T-d*d);return l.y=(T*p-d*R)*A,l.z=(m*R-d*p)*A,l.x=1-l.y-l.z,l}var i=new t,a=new t,u=new t;return o}),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 o={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,a=r.low;return n.encode(e.x,o),i.x=o.high,a.x=o.low,n.encode(e.y,o),i.y=o.high,a.y=o.low,n.encode(e.z,o),i.z=o.high,a.z=o.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var o=i.high,a=i.low;t[r]=o.x,t[r+1]=o.y,t[r+2]=o.z,t[r+3]=a.x,t[r+4]=a.y,t[r+5]=a.z},n}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,n){"use strict";function o(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 o}),define("Core/IndexDatatype",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";var i={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=o.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,n){return e>=o.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,n):new Uint16Array(t,r,n)},n(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var o=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(o/Math.max(Math.abs(e),Math.abs(r)))<n?0:o}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,o){var i;if(0===e)return 0===n?[]:[-o/n]; +if(0===n){if(0===o)return[0,0];var a=Math.abs(o),u=Math.abs(e);if(u>a&&a/u<t.EPSILON14)return[0,0];if(a>u&&u/a<t.EPSILON14)return[];if(i=-o/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===o)return i=-n/e,0>i?[i,0]:[0,i];var c=n*n,l=4*e*o,E=r(c,-l,t.EPSILON14);if(0>E)return[];var f=-.5*r(n,t.sign(n)*Math.sqrt(E),t.EPSILON14);return n>0?[f/e,o/f]:[o/f,f/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var o,i,a=e,u=t/3,s=r/3,c=n,l=a*s,E=u*c,f=u*u,h=s*s,m=a*s-f,d=a*c-u*s,p=u*c-h,T=4*m*p-d*d;if(0>T){var R,A,_;f*E>=l*h?(R=a,A=m,_=-2*u*m+a*d):(R=c,A=p,_=-c*d+2*s*p);var y=0>_?-1:1,v=-y*Math.abs(R)*Math.sqrt(-T);i=-_+v;var S=i/2,C=0>S?-Math.pow(-S,1/3):Math.pow(S,1/3),g=i===v?-C:-A/C;return o=0>=A?C+g:-_/(C*C+g*g+A),f*E>=l*h?[(o-u)/a]:[-c/(o+s)]}var N=m,I=-2*u*m+a*d,O=p,M=-c*d+2*s*p,L=Math.sqrt(T),F=Math.sqrt(3)/2,P=Math.abs(Math.atan2(a*L,-I)/3);o=2*Math.sqrt(-N);var w=Math.cos(P);i=o*w;var D=o*(-w/2-F*Math.sin(P)),b=i+D>2*u?i-u:D-u,x=a,U=b/x;P=Math.abs(Math.atan2(c*L,-M)/3),o=2*Math.sqrt(-O),w=Math.cos(P),i=o*w,D=o*(-w/2-F*Math.sin(P));var B=-c,G=2*s>i+D?i+s:D+s,z=B/G,V=x*G,H=-b*G-x*B,q=b*B,W=(s*H-u*q)/(-u*H+s*V);return W>=U?z>=U?z>=W?[U,W,z]:[U,z,W]:[z,U,W]:z>=U?[W,U,z]:z>=W?[W,z,U]:[z,W,U]}var n={};return n.computeDiscriminant=function(e,t,r,n){var o=e*e,i=t*t,a=r*r,u=n*n,s=18*e*t*r*n+i*a-27*o*u-4*(e*a*r+i*t*n);return s},n.computeRealRoots=function(e,n,o,i){var a,u;if(0===e)return t.computeRealRoots(n,o,i);if(0===n){if(0===o){if(0===i)return[0,0,0];u=-i/e;var s=0>u?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(a=t.computeRealRoots(e,0,o),0===a.Length?[0]:[a[0],0,a[1]]):r(e,0,o,i)}return 0===o?0===i?(u=-n/e,0>u?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(a=t.computeRealRoots(e,n,o),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]]):r(e,n,o,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function o(t,o,i,a){var u=t*t,s=o-3*u/8,c=i-o*t/2+u*t/8,l=a-i*t/4+o*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 m=n.computeRealRoots(1,s,l);if(2===m.length){var d,p=m[0],T=m[1];if(p>=0&&T>=0){var R=Math.sqrt(p),A=Math.sqrt(T);return[f-A,f-R,f+R,f+A]}if(p>=0&&0>T)return d=Math.sqrt(p),[f-d,f+d];if(0>p&&T>=0)return d=Math.sqrt(T),[f-d,f+d]}return[]}if(h>0){var _=Math.sqrt(h),y=(s+h-c/_)/2,v=(s+h+c/_)/2,S=n.computeRealRoots(1,_,y),C=n.computeRealRoots(1,-_,v);return 0!==S.length?(S[0]+=f,S[1]+=f,0!==C.length?(C[0]+=f,C[1]+=f,S[1]<=C[0]?[S[0],S[1],C[0],C[1]]:C[1]<=S[0]?[C[0],C[1],S[0],S[1]]:S[0]>=C[0]&&S[1]<=C[1]?[C[0],S[0],S[1],C[1]]:C[0]>=S[0]&&C[1]<=S[1]?[S[0],C[0],C[1],S[1]]:S[0]>C[0]&&S[0]<C[1]?[C[0],S[0],C[1],S[1]]:[S[0],C[0],S[1],C[1]]):S):0!==C.length?(C[0]+=f,C[1]+=f,C):[]}}return[]}function i(t,o,i,a){var u=i*i,s=o*o,c=t*t,l=-2*o,E=i*t+s-4*a,f=c*a-i*o*t+u,h=e.computeRealRoots(1,l,E,f);if(h.length>0){var m,d,p=h[0],T=o-p,R=T*T,A=t/2,_=T/2,y=R-4*a,v=R+4*Math.abs(a),S=c-4*p,C=c+4*Math.abs(p);if(0>p||S*v>y*C){var g=Math.sqrt(S);m=g/2,d=0===g?0:(t*_-i)/g}else{var N=Math.sqrt(y);m=0===N?0:(t*_-i)/N,d=N/2}var I,O;0===A&&0===m?(I=0,O=0):r.sign(A)===r.sign(m)?(I=A+m,O=p/I):(O=A-m,I=p/O);var M,L;0===_&&0===d?(M=0,L=0):r.sign(_)===r.sign(d)?(M=_+d,L=a/M):(L=_-d,M=a/L);var F=n.computeRealRoots(1,I,M),P=n.computeRealRoots(1,O,L);if(0!==F.length)return 0!==P.length?F[1]<=P[0]?[F[0],F[1],P[0],P[1]]:P[1]<=F[0]?[P[0],P[1],F[0],F[1]]:F[0]>=P[0]&&F[1]<=P[1]?[P[0],F[0],F[1],P[1]]:P[0]>=F[0]&&P[1]<=F[1]?[F[0],P[0],P[1],F[1]]:F[0]>P[0]&&F[0]<P[1]?[P[0],F[0],P[1],F[1]]:[F[0],P[0],F[1],P[1]]:F;if(0!==P.length)return P}return[]}var a={};return a.computeDiscriminant=function(e,t,r,n,o){var i=e*e,a=i*e,u=t*t,s=u*t,c=r*r,l=c*r,E=n*n,f=E*n,h=o*o,m=h*o,d=u*c*E-4*s*f-4*e*l*E+18*e*t*r*f-27*i*E*E+256*a*m+o*(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 d},a.computeRealRoots=function(t,n,a,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,a,u,s);var c=n/t,l=a/t,E=u/t,f=s/t,h=0>c?1:0;switch(h+=0>l?h+1:h,h+=0>E?h+1:h,h+=0>f?h+1:h){case 0:return o(c,l,E,f);case 1:return i(c,l,E,f);case 2:return i(c,l,E,f);case 3:return o(c,l,E,f);case 4:return o(c,l,E,f);case 5:return i(c,l,E,f);case 6:return o(c,l,E,f);case 7:return o(c,l,E,f);case 8:return i(c,l,E,f);case 9:return o(c,l,E,f);case 10:return o(c,l,E,f);case 11:return i(c,l,E,f);case 12:return o(c,l,E,f);case 13:return o(c,l,E,f);case 14:return o(c,l,E,f);case 15:return o(c,l,E,f);default:return}},a}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function o(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 o.getPoint=function(t,n,o){return r(o)||(o=new e),o=e.multiplyByScalar(t.direction,n,o),e.add(t.origin,o,o)},o}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,o,i,a,u,s,c){"use strict";function l(t,n,o,a,u){u=r(u,!1);var s,c,l,E,f,h=t.origin,m=t.direction,d=e.subtract(o,n,p),y=e.subtract(a,n,T),v=e.cross(m,y,R),S=e.dot(d,v);if(u){if(S<i.EPSILON6)return;if(s=e.subtract(h,n,A),l=e.dot(s,v),0>l||l>S)return;if(c=e.cross(s,d,_),E=e.dot(m,c),0>E||l+E>S)return;f=e.dot(y,c)/S}else{if(Math.abs(S)<i.EPSILON6)return;var C=1/S;if(s=e.subtract(h,n,A),l=e.dot(s,v)*C,0>l||l>1)return;if(c=e.cross(s,d,_),E=e.dot(m,c)*C,0>E||l+E>1)return;f=e.dot(y,c)*C}return f}function E(e,t,r,n){var o=t*t-4*e*r;if(!(0>o)){if(o>0){var i=1/(2*e),a=Math.sqrt(o),u=(-t+a)*i,s=(-t-a)*i;return s>u?(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,o){n(o)||(o={});var i=t.origin,a=t.direction,u=r.center,s=r.radius*r.radius,c=e.subtract(i,u,R),l=e.dot(a,a),f=2*e.dot(a,c),h=e.magnitudeSquared(c)-s,m=E(l,f,h,v);return n(m)?(o.start=m.root0,o.stop=m.root1,o):void 0}function h(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 m(t,r,n,o,c){var l,E=o*o,f=c*c,m=(t[a.COLUMN1ROW1]-t[a.COLUMN2ROW2])*f,d=c*(o*h(t[a.COLUMN1ROW0],t[a.COLUMN0ROW1],i.EPSILON15)+r.y),p=t[a.COLUMN0ROW0]*E+t[a.COLUMN2ROW2]*f+o*r.x+n,T=f*h(t[a.COLUMN2ROW1],t[a.COLUMN1ROW2],i.EPSILON15),R=c*(o*h(t[a.COLUMN2ROW0],t[a.COLUMN0ROW2])+r.z),A=[];if(0===R&&0===T){if(l=u.computeRealRoots(m,d,p),0===l.length)return A;var _=l[0],y=Math.sqrt(Math.max(1-_*_,0));if(A.push(new e(o,c*_,c*-y)),A.push(new e(o,c*_,c*y)),2===l.length){var v=l[1],S=Math.sqrt(Math.max(1-v*v,0));A.push(new e(o,c*v,c*-S)),A.push(new e(o,c*v,c*S))}return A}var C=R*R,g=T*T,N=m*m,I=R*T,O=N+g,M=2*(d*m+I),L=2*p*m+d*d-g+C,F=2*(p*d-I),P=p*p-C;if(0===O&&0===M&&0===L&&0===F)return A;l=s.computeRealRoots(O,M,L,F,P);var w=l.length;if(0===w)return A;for(var D=0;w>D;++D){var b,x=l[D],U=x*x,B=Math.max(1-U,0),G=Math.sqrt(B);b=i.sign(m)===i.sign(p)?h(m*U+p,d*x,i.EPSILON12):i.sign(p)===i.sign(d*x)?h(m*U,d*x+p,i.EPSILON12):h(m*U+d*x,p,i.EPSILON12);var z=h(T*x,R,i.EPSILON15),V=b*z;0>V?A.push(new e(o,c*x,c*G)):V>0?A.push(new e(o,c*x,c*-G)):0!==G?(A.push(new e(o,c*x,c*-G)),A.push(new e(o,c*x,c*G)),++D):A.push(new e(o,c*x,c*G))}return A}var d={};d.rayPlane=function(t,r,o){n(o)||(o=new e);var a=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,a))/c;if(!(0>l))return o=e.multiplyByScalar(u,l,o),e.add(a,o,o)}};var p=new e,T=new e,R=new e,A=new e,_=new e;d.rayTriangle=function(t,r,o,i,a,u){var s=l(t,r,o,i,a);if(n(s)&&!(0>s))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var y=new c;d.lineSegmentTriangle=function(t,r,o,i,a,u,s){var c=y;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var E=l(c,o,i,a,u);return!n(E)||0>E||E>e.distance(t,r)?void 0:(n(s)||(s=new e),e.multiplyByScalar(c.direction,E,s),e.add(c.origin,s,s))};var v={root0:0,root1:0};d.raySphere=function(e,t,r){return r=f(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var S=new c;d.lineSegmentSphere=function(t,r,o,i){var a=S,u=e.subtract(r,t,a.direction),s=e.magnitude(u);return e.normalize(u,u),i=f(a,o,i),!n(i)||i.stop<0||i.start>s?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i)};var C=new e,g=new e;d.rayEllipsoid=function(t,r){var n,o,i,a,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,C),l=e.multiplyComponents(s,t.direction,g),E=e.magnitudeSquared(c),f=e.dot(c,l);if(E>1){if(f>=0)return;var h=f*f;if(n=E-1,o=e.magnitudeSquared(l),i=o*n,i>h)return;if(h>i){a=f*f-i,u=-f+Math.sqrt(a);var m=u/o,d=n/u;return d>m?{start:m,stop:d}:{start:d,stop:m}}var p=Math.sqrt(n/o);return{start:p,stop:p}}return 1>E?(n=E-1,o=e.magnitudeSquared(l),i=o*n,a=f*f-i,u=-f+Math.sqrt(a),{start:0,stop:u/o}):0>f?(o=e.magnitudeSquared(l),{start:0,stop:-f/o}):void 0};var N=new e,I=new e,O=new e,M=new e,L=new e,F=new a,P=new a,w=new a,D=new a,b=new a,x=new a,U=new a,B=new e,G=new e,z=new t;d.grazingAltitudeLocation=function(t,r){var o=t.origin,u=t.direction,s=r.geodeticSurfaceNormal(o,N);if(e.dot(u,s)>=0)return o;var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u,N),E=e.normalize(l,l),f=e.mostOrthogonalAxis(l,M),h=e.normalize(e.cross(f,E,I),I),d=e.normalize(e.cross(E,h,O),O),p=F;p[0]=E.x,p[1]=E.y,p[2]=E.z,p[3]=h.x,p[4]=h.y,p[5]=h.z,p[6]=d.x,p[7]=d.y,p[8]=d.z;var T=a.transpose(p,P),R=a.fromScale(r.radii,w),A=a.fromScale(r.oneOverRadii,D),_=b;_[0]=0,_[1]=-u.z,_[2]=u.y,_[3]=u.z,_[4]=0,_[5]=-u.x,_[6]=-u.y,_[7]=u.x,_[8]=0;var y,v,S=a.multiply(a.multiply(T,A,x),_,x),C=a.multiply(a.multiply(S,R,U),p,U),g=a.multiplyByVector(S,o,L),V=m(C,e.negate(g,N),0,0,1),H=V.length;if(H>0){for(var q=e.clone(e.ZERO,G),W=Number.NEGATIVE_INFINITY,Y=0;H>Y;++Y){y=a.multiplyByVector(R,a.multiplyByVector(p,V[Y],B),B);var X=e.normalize(e.subtract(y,o,M),M),k=e.dot(X,u);k>W&&(W=k,q=e.clone(y,q))}var K=r.cartesianToCartographic(q,z);return W=i.clamp(W,0,1),v=e.magnitude(e.subtract(q,o,M))*Math.sqrt(1-W*W),v=c?-v:v,K.height=v,r.cartographicToCartesian(K,new e)}};var V=new e;return d.lineSegmentPlane=function(t,r,o,a){n(a)||(a=new e);var u=e.subtract(r,t,V),s=o.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON6)){var l=e.dot(s,t),E=-(o.distance+l)/c;if(!(0>E||E>1))return e.multiplyByScalar(u,E,a),e.add(t,a,a),a}},d.trianglePlaneIntersection=function(t,r,n,o){var i=o.normal,a=o.distance,u=e.dot(i,t)+a<0,s=e.dot(i,r)+a<0,c=e.dot(i,n)+a<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,o,E),d.lineSegmentPlane(t,n,o,f),{positions:[t,r,n,E,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return d.lineSegmentPlane(r,n,o,E),d.lineSegmentPlane(r,t,o,f),{positions:[t,r,n,E,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return d.lineSegmentPlane(n,t,o,E),d.lineSegmentPlane(n,r,o,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,o,E),d.lineSegmentPlane(n,t,o,f),{positions:[t,r,n,E,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return d.lineSegmentPlane(n,r,o,E),d.lineSegmentPlane(t,r,o,f),{positions:[t,r,n,E,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return d.lineSegmentPlane(t,n,o,E),d.lineSegmentPlane(r,n,o,f),{positions:[t,r,n,E,f],indices:[0,1,4,0,4,3,2,3,4]}}},d}),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,o=r.maximumIndex,i=e(r.cacheSize,24),a=n.length;if(!t(o)){o=0;for(var u=0,s=n[u];a>u;)s>o&&(o=s),++u,s=n[u]}for(var c=[],l=0;o+1>l;l++)c[l]=0;for(var E=i+1,f=0;a>f;++f)E-c[n[f]]>i&&(c[n[f]]=E,++E);return(E-i+1)/(a/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var o=t[t.length-1];if(t.splice(t.length-1,1),e[o].numLiveTriangles>0)return o}for(;n>i;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(e,t,r,o,i,a,u){for(var s,c=-1,l=-1,E=0;E<r.length;){var f=r[E];o[f].numLiveTriangles&&(s=0,i-o[f].timeStamp+2*o[f].numLiveTriangles<=t&&(s=i-o[f].timeStamp),(s>l||-1===l)&&(l=s,c=f)),++E}return-1===c?n(o,a,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,a=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=a.length,l=0,E=0,f=a[E],h=c;if(t(u))l=u+1;else{for(;h>E;)f>l&&(l=f),++E,f=a[E];if(-1===l)return 0;++l}for(var m=[],d=0;l>d;d++)m[d]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};E=0;for(var p=0;h>E;)m[a[E]].vertexTriangles.push(p),++m[a[E]].numLiveTriangles,m[a[E+1]].vertexTriangles.push(p),++m[a[E+1]].numLiveTriangles,m[a[E+2]].vertexTriangles.push(p),++m[a[E+2]].numLiveTriangles,++p,E+=3;var T=0,R=s+1;i=1;var A,_,y=[],v=[],S=0,C=[],g=c/3,N=[];for(d=0;g>d;d++)N[d]=!1;for(var I,O;-1!==T;){y=[],_=m[T],O=_.vertexTriangles.length;for(var M=0;O>M;++M)if(p=_.vertexTriangles[M],!N[p]){N[p]=!0,E=p+p+p;for(var L=0;3>L;++L)I=a[E],y.push(I),v.push(I),C[S]=I,++S,A=m[I],--A.numLiveTriangles,R-A.timeStamp>s&&(A.timeStamp=R,++R),++E}T=o(a,s,y,m,R,v,l)}return C},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,o,i,a,u,s,c,l,E,f,h,m,d,p,T,R,A,_,y,v,S,C,g){"use strict";function N(e,t,r,n,o){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=o,e[t++]=o,e[t]=r}function I(e){for(var t=e.length,r=t/3*6,n=T.createTypedArray(t,r),o=0,i=0;t>i;i+=3,o+=6)N(n,o,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=T.createTypedArray(t,r);N(n,0,e[0],e[1],e[2]);for(var o=6,i=3;t>i;++i,o+=6)N(n,o,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=T.createTypedArray(t,r),o=e[0],i=0,a=1;t>a;++a,i+=6)N(n,i,o,e[a],e[a+1]);return n}return new Uint16Array}function L(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 F(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var o=t[n],i=0;i<o.componentsPerAttribute;++i)e[n].values.push(o.values[r*o.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;n>i;i+=3)o.unpack(r,i,ie),v.multiplyByPoint(e,ie,ie),o.pack(ie,r,i)}function w(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;n>i;i+=3)o.unpack(r,i,ie),y.multiplyByVector(e,ie,ie),ie=o.normalize(ie,ie),o.pack(ie,r,i)}function D(e,t){var r,n=e.length,o={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var a=i[r],s=a.values.length,l=!0,E=1;n>E;++E){var f=e[E][t].attributes[r];if(!c(f)||a.componentDatatype!==f.componentDatatype||a.componentsPerAttribute!==f.componentsPerAttribute||a.normalize!==f.normalize){l=!1;break}s+=f.values.length}l&&(o[r]=new m({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:u.createTypedArray(a.componentDatatype,s)}))}return o}function b(e,t){var n,i,a,u,s,l,E,f=e.length,m=(e[0].modelMatrix,c(e[0][t].indices)),d=e[0][t].primitiveType,p=D(e,t);for(n in p)if(p.hasOwnProperty(n))for(s=p[n].values,u=0,i=0;f>i;++i)for(l=e[i][t].attributes[n].values,E=l.length,a=0;E>a;++a)s[u++]=l[a];var R;if(m){var A=0;for(i=0;f>i;++i)A+=e[i][t].indices.length;var _=h.computeNumberOfVertices(new h({attributes:p,primitiveType:C.POINTS})),y=T.createTypedArray(_,A),v=0,S=0;for(i=0;f>i;++i){var g=e[i][t].indices,N=g.length;for(u=0;N>u;++u)y[v++]=S+g[u];S+=h.computeNumberOfVertices(e[i][t])}R=y}var I,O=new o,M=0;for(i=0;f>i;++i){if(I=e[i][t].boundingSphere,!c(I)){O=void 0;break}o.add(I.center,O,O)}if(c(O))for(o.divideByScalar(O,f,O),i=0;f>i;++i){I=e[i][t].boundingSphere;var L=o.magnitude(o.subtract(I.center,O,se))+I.radius;L>M&&(M=L)}return new h({attributes:p,indices:R,primitiveType:d,boundingSphere:c(O)?new r(O,M):void 0})}function x(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=T.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function U(e){var t=h.computeNumberOfVertices(e),r=T.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,o=3;t>o;++o)r[n++]=o-1,r[n++]=0,r[n++]=o;return e.indices=r,e.primitiveType=C.TRIANGLES,e}function B(e){var t=h.computeNumberOfVertices(e),r=T.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var n=6,o=3;t-1>o;o+=2)r[n++]=o,r[n++]=o-1,r[n++]=o+1,t>o+2&&(r[n++]=o,r[n++]=o+1,r[n++]=o+2);return e.indices=r,e.primitiveType=C.TRIANGLES,e}function G(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=T.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function z(e){var t=h.computeNumberOfVertices(e),r=T.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,o=2;t>o;++o)r[n++]=o-1,r[n++]=o;return e.indices=r,e.primitiveType=C.LINES,e}function V(e){var t=h.computeNumberOfVertices(e),r=T.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,o=2;t>o;++o)r[n++]=o-1,r[n++]=o;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=C.LINES,e}function H(e){switch(e.primitiveType){case C.TRIANGLE_FAN:return U(e);case C.TRIANGLE_STRIP:return B(e);case C.TRIANGLES:return x(e);case C.LINE_STRIP:return z(e);case C.LINE_LOOP:return V(e);case C.LINES:return G(e)}return e}function q(e,t){Math.abs(e.y)<_.EPSILON6&&(t?e.y=-_.EPSILON6:e.y=_.EPSILON6)}function W(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,o=Math.abs(e.y),i=Math.abs(t.y),a=Math.abs(r.y);n=o>i?o>a?_.sign(e.y):_.sign(r.y):i>a?_.sign(t.y):_.sign(r.y);var u=0>n;q(e,u),q(t,u),q(r,u)}function Y(e,t,r,n){o.add(e,o.multiplyByScalar(o.subtract(t,e,_e),e.y/(e.y-t.y),_e),r),o.clone(r,n),q(r,!0),q(n,!1)}function X(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){W(e,t,r);var n=e.y<0,o=t.y<0,i=r.y<0,a=0;a+=n?1:0,a+=o?1:0,a+=i?1:0;var u=ge.indices;1===a?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(Y(e,t,ye,Se),Y(e,r,ve,Ce),u[0]=0,u[3]=1,u[4]=2,u[6]=1):o?(Y(t,r,ye,Se),Y(t,e,ve,Ce),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(Y(r,e,ye,Se),Y(r,t,ve,Ce),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===a&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?o?i||(Y(r,e,ye,Se),Y(r,t,ve,Ce),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(Y(t,r,ye,Se),Y(t,e,ve,Ce),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(Y(e,t,ye,Se),Y(e,r,ve,Ce),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===a||2===a)&&(s[3]=ye,s[4]=ve,s[5]=Se,s[6]=Ce,s.length=7),ge}}function k(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var o in n)if(n.hasOwnProperty(o)&&c(n[o])&&c(n[o].values)){var i=n[o];i.values=u.createTypedArray(i.componentDatatype,i.values)}var a=h.computeNumberOfVertices(e);return e.indices=T.createTypedArray(a,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 o=t[n];r[n]=new m({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new h({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 j(e,r,i,a,u,s,l,E,f,h,m){if(c(s)||c(l)||c(E)||c(f)){var d=o.fromArray(u,3*e,Ne),p=o.fromArray(u,3*r,Ie),T=o.fromArray(u,3*i,Oe),R=t(a,d,p,T,Me);if(c(s)){var A=o.fromArray(s,3*e,Ne),_=o.fromArray(s,3*r,Ie),y=o.fromArray(s,3*i,Oe);o.multiplyByScalar(A,R.x,A),o.multiplyByScalar(_,R.y,_),o.multiplyByScalar(y,R.z,y);var v=o.add(A,_,A);o.add(v,y,v),o.normalize(v,v),o.pack(v,h.normal.values,3*m)}if(c(l)){var S=o.fromArray(l,3*e,Ne),C=o.fromArray(l,3*r,Ie),g=o.fromArray(l,3*i,Oe);o.multiplyByScalar(S,R.x,S),o.multiplyByScalar(C,R.y,C),o.multiplyByScalar(g,R.z,g);var N=o.add(S,C,S);o.add(N,g,N),o.normalize(N,N),o.pack(N,h.binormal.values,3*m)}if(c(E)){var I=o.fromArray(E,3*e,Ne),O=o.fromArray(E,3*r,Ie),M=o.fromArray(E,3*i,Oe);o.multiplyByScalar(I,R.x,I),o.multiplyByScalar(O,R.y,O),o.multiplyByScalar(M,R.z,M);var L=o.add(I,O,I);o.add(L,M,L),o.normalize(L,L),o.pack(L,h.tangent.values,3*m)}if(c(f)){var F=n.fromArray(f,2*e,Le),P=n.fromArray(f,2*r,Fe),w=n.fromArray(f,2*i,Pe);n.multiplyByScalar(F,R.x,F),n.multiplyByScalar(P,R.y,P),n.multiplyByScalar(w,R.z,w);var D=n.add(F,P,F);n.add(D,w,D),n.pack(D,h.st.values,2*m)}}}function Q(e,t,r,n,o,i){var a=e.position.values.length/3;if(-1!==o){var u=n[o],s=r[u];return-1===s?(r[u]=a,e.position.values.push(i.x,i.y,i.z),t.push(a),a):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(a),a}function J(e){var t,r,n,i,a,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,m=c(s.st)?s.st.values:void 0,d=u.indices,p=K(u),T=K(u),R=[];R.length=l.length/3;var A=[];for(A.length=l.length/3,a=0;a<R.length;++a)R[a]=-1,A[a]=-1;var _=d.length;for(a=0;_>a;a+=3){var y=d[a],v=d[a+1],S=d[a+2],C=o.fromArray(l,3*y),g=o.fromArray(l,3*v),N=o.fromArray(l,3*S),I=X(C,g,N);if(c(I)&&I.positions.length>3)for(var O=I.positions,M=I.indices,L=M.length,F=0;L>F;++F){var P=M[F],w=O[P];w.y<0?(t=T.attributes,r=T.indices,n=R):(t=p.attributes,r=p.indices,n=A),i=Q(t,r,n,d,3>P?a+P:-1,w),j(y,v,S,w,l,E,f,h,m,t,i)}else c(I)&&(C=I.positions[0],g=I.positions[1],N=I.positions[2]),C.y<0?(t=T.attributes,r=T.indices,n=R):(t=p.attributes,r=p.indices,n=A),i=Q(t,r,n,d,a,C),j(y,v,S,C,l,E,f,h,m,t,i),i=Q(t,r,n,d,a+1,g),j(y,v,S,g,l,E,f,h,m,t,i),i=Q(t,r,n,d,a+2,N),j(y,v,S,N,l,E,f,h,m,t,i)}Z(e,T,p)}function $(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,a=r.indices,u=K(r),s=K(r),l=a.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;l>t;t+=2){var h=a[t],m=a[t+1],d=o.fromArray(i,3*h,Ne),p=o.fromArray(i,3*m,Ie);Math.abs(d.y)<_.EPSILON6&&(d.y<0?d.y=-_.EPSILON6:d.y=_.EPSILON6),Math.abs(p.y)<_.EPSILON6&&(p.y<0?p.y=-_.EPSILON6:p.y=_.EPSILON6);var T=u.attributes,R=u.indices,y=f,v=s.attributes,S=s.indices,C=E,g=A.lineSegmentPlane(d,p,we,Oe);if(c(g)){var N=o.multiplyByScalar(o.UNIT_Y,5*_.EPSILON9,De);d.y<0&&(o.negate(N,N),T=s.attributes,R=s.indices,y=E,v=u.attributes,S=u.indices,C=f);var I=o.add(g,N,be);Q(T,R,y,a,t,d),Q(T,R,y,a,-1,I),o.negate(N,N),o.add(g,N,I),Q(v,S,C,a,-1,I),Q(v,S,C,a,t+1,p)}else{var O,M,L;d.y<0?(O=s.attributes,M=s.indices,L=E):(O=u.attributes,M=u.indices,L=f),Q(O,M,L,a,t,d),Q(O,M,L,a,t+1,p)}}Z(e,s,u)}function ee(e){var t,r,a,u=e.geometry,s=u.attributes,l=s.position.values,E=s.prevPosition.values,f=s.nextPosition.values,h=s.expandAndWidth.values,m=c(s.st)?s.st.values:void 0,d=c(s.color)?s.color.values:void 0,p=K(u),T=K(u),R=l.length/3;for(t=0;R>t;t+=4){var y=t,v=t+1,S=t+2,C=t+3,g=o.fromArray(l,3*y,Be),N=o.fromArray(l,3*v,Ge),I=o.fromArray(l,3*S,ze),O=o.fromArray(l,3*C,Ve);Math.abs(g.y)<_.EPSILON6&&(g.y=_.EPSILON6*(I.y<0?-1:1),N.y=g.y),Math.abs(I.y)<_.EPSILON6&&(I.y=_.EPSILON6*(g.y<0?-1:1),O.y=I.y);var M=p.attributes,L=p.indices,F=T.attributes,P=T.indices,w=A.lineSegmentPlane(g,I,we,He);if(c(w)){var D=o.multiplyByScalar(o.UNIT_Y,5*_.EPSILON9,qe);g.y<0&&(o.negate(D,D),M=T.attributes,L=T.indices,F=p.attributes,P=p.indices);var b=o.add(w,D,We);for(M.position.values.push(g.x,g.y,g.z,N.x,N.y,N.z),M.position.values.push(b.x,b.y,b.z),M.position.values.push(b.x,b.y,b.z),o.negate(D,D),o.add(w,D,b),F.position.values.push(b.x,b.y,b.z),F.position.values.push(b.x,b.y,b.z),F.position.values.push(I.x,I.y,I.z,O.x,O.y,O.z),r=3*y;3*y+6>r;++r)M.prevPosition.values.push(E[r]);for(M.prevPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),F.prevPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),r=3*S;3*S+6>r;++r)F.prevPosition.values.push(E[r]);for(r=3*y;3*y+6>r;++r)M.nextPosition.values.push(f[r]);for(M.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),F.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),r=3*S;3*S+6>r;++r)F.nextPosition.values.push(f[r]);var x=n.fromArray(h,2*y,xe),U=Math.abs(x.y);M.expandAndWidth.values.push(-1,U,1,U),M.expandAndWidth.values.push(-1,-U,1,-U),F.expandAndWidth.values.push(-1,U,1,U),F.expandAndWidth.values.push(-1,-U,1,-U);var B=o.magnitudeSquared(o.subtract(w,g,Ve));if(B/=o.magnitudeSquared(o.subtract(I,g,Ve)),c(d)){var G=i.fromArray(d,4*y,Ye),z=i.fromArray(d,4*S,Ye),V=_.lerp(G.x,z.x,B),H=_.lerp(G.y,z.y,B),q=_.lerp(G.z,z.z,B),W=_.lerp(G.w,z.w,B);for(r=4*y;4*y+8>r;++r)M.color.values.push(d[r]);for(M.color.values.push(V,H,q,W),M.color.values.push(V,H,q,W),F.color.values.push(V,H,q,W),F.color.values.push(V,H,q,W),r=4*S;4*S+8>r;++r)F.color.values.push(d[r])}if(c(m)){var Y=n.fromArray(m,2*y,xe),X=n.fromArray(m,2*(t+3),Ue),k=_.lerp(Y.x,X.x,B);for(r=2*y;2*y+4>r;++r)M.st.values.push(m[r]);for(M.st.values.push(k,Y.y),M.st.values.push(k,X.y),F.st.values.push(k,Y.y),F.st.values.push(k,X.y),r=2*S;2*S+4>r;++r)F.st.values.push(m[r])}a=M.position.values.length/3-4,L.push(a,a+2,a+1),L.push(a+1,a+2,a+3),a=F.position.values.length/3-4,P.push(a,a+2,a+1),P.push(a+1,a+2,a+3)}else{var j,Q;for(g.y<0?(j=T.attributes,Q=T.indices):(j=p.attributes,Q=p.indices),j.position.values.push(g.x,g.y,g.z),j.position.values.push(N.x,N.y,N.z),j.position.values.push(I.x,I.y,I.z),j.position.values.push(O.x,O.y,O.z),r=3*t;3*t+12>r;++r)j.prevPosition.values.push(E[r]),j.nextPosition.values.push(f[r]);for(r=2*t;2*t+8>r;++r)j.expandAndWidth.values.push(h[r]),c(m)&&j.st.values.push(m[r]);if(c(d))for(r=4*t;4*t+16>r;++r)j.color.values.push(d[r]);a=j.position.values.length/3-4,Q.push(a,a+2,a+1),Q.push(a+1,a+2,a+3)}}Z(e,T,p)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case C.TRIANGLES:e.indices=I(t);break;case C.TRIANGLE_STRIP:e.indices=O(t);break;case C.TRIANGLE_FAN:e.indices=M(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=C.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var o=e.attributes.position.values,i=e.attributes[t].values,a=o.length,l=new Float64Array(2*a),E=0,f=0;a>f;f+=3)l[E++]=o[f],l[E++]=o[f+1],l[E++]=o[f+2],l[E++]=o[f]+i[f]*n,l[E++]=o[f+1]+i[f+1]*n,l[E++]=o[f+2]+i[f+2]*n;var d,p=e.boundingSphere;return c(p)&&(d=new r(p.center,p.radius+n)),new h({attributes:{position:new m({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:C.LINES,boundingSphere:d})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],n=e.attributes,o={},i=0,a=r.length;for(t=0;a>t;++t){var u=r[t];c(n[u])&&(o[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(o[s])&&(o[s]=i++);return o},te.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),o=0;t>o;o++)n[o]=-1;for(var i,a=r,s=a.length,l=T.createTypedArray(t,s),E=0,f=0,m=0;s>E;)i=n[a[E]],-1!==i?l[f]=i:(i=a[E],n[i]=m,l[f]=m,++m),++E,++f;e.indices=l;var d=e.attributes;for(var p in d)if(d.hasOwnProperty(p)&&c(d[p])&&c(d[p].values)){for(var R=d[p],A=R.values,_=0,y=R.componentsPerAttribute,v=u.createTypedArray(R.componentDatatype,m*y);t>_;){var S=n[_];if(-1!==S)for(o=0;y>o;o++)v[y*S+o]=A[y*_+o];++_}R.values=v}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===C.TRIANGLES&&c(r)){for(var n=r.length,o=0,i=0;n>i;i++)r[i]>o&&(o=r[i]);e.indices=g.tipsify({indices:r,maximumIndex:o,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>=_.SIXTY_FOUR_KILOBYTES){var n,o=[],i=[],a=0,u=L(e.attributes),s=e.indices,l=s.length;e.primitiveType===C.TRIANGLES?n=3:e.primitiveType===C.LINES?n=2:e.primitiveType===C.POINTS&&(n=1);for(var E=0;l>E;E+=n){for(var f=0;n>f;++f){var m=s[E+f],d=o[m];c(d)||(d=a++,o[m]=d,F(u,e.attributes,m)),i.push(d)}a+n>=_.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),o=[],i=[],a=0,u=L(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 o,ne=new a;te.projectTo2D=function(e,t,r,n,i){var a=e.attributes[t];i=c(i)?i:new f;for(var s=i.ellipsoid,E=a.values,h=new Float64Array(E.length),d=0,p=0;p<E.length;p+=3){var T=o.fromArray(E,p,re),R=s.cartesianToCartographic(T,ne);if(!c(R))throw new l("Could not project point ("+T.x+", "+T.y+", "+T.z+") to 2D.");var A=i.project(R,re);h[d++]=A.x,h[d++]=A.y,h[d++]=A.z}return e.attributes[r]=a,e.attributes[n]=new m({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:h}),delete e.attributes[t],e};var oe={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var o=e.attributes[t],i=o.values,a=i.length,s=new Float32Array(a),c=new Float32Array(a),l=0;a>l;++l)E.encode(i[l],oe),s[l]=oe.high,c[l]=oe.low;var f=o.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 ie=new o,ae=new v,ue=new y;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,ae),v.transpose(ae,ae),v.getRotation(ae,ue),w(ue,n.normal),w(ue,n.binormal),w(ue,n.tangent));var o=e.geometry.boundingSphere;return c(o)&&(e.geometry.boundingSphere=r.transform(o,t,o)),e.modelMatrix=v.clone(v.IDENTITY),e};var se=new o;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,o=0;n>o;++o){var i=e[o];c(i.geometry)?t.push(i):r.push(i)}var a=[];return t.length>0&&a.push(b(t,"geometry")),r.length>0&&(a.push(b(r,"westHemisphereGeometry")),a.push(b(r,"eastHemisphereGeometry"))),a};var ce=new o,le=new o,Ee=new o,fe=new o;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,a=t.length,s=new Array(i),c=new Array(a/3),l=new Array(a),E=0;i>E;E++)s[E]={indexOffset:0,count:0,currentCount:0};var f=0;for(E=0;a>E;E+=3){var h=t[E],d=t[E+1],p=t[E+2],T=3*h,R=3*d,A=3*p;le.x=n[T],le.y=n[T+1],le.z=n[T+2],Ee.x=n[R],Ee.y=n[R+1],Ee.z=n[R+2],fe.x=n[A],fe.y=n[A+1],fe.z=n[A+2],s[h].count++,s[d].count++,s[p].count++,o.subtract(Ee,le,Ee),o.subtract(fe,le,fe),c[f]=o.cross(Ee,fe,new o),f++}var _=0;for(E=0;i>E;E++)s[E].indexOffset+=_,_+=s[E].count;f=0;var y;for(E=0;a>E;E+=3){y=s[t[E]];var v=y.indexOffset+y.currentCount;l[v]=f,y.currentCount++,y=s[t[E+1]],v=y.indexOffset+y.currentCount,l[v]=f,y.currentCount++,y=s[t[E+2]],v=y.indexOffset+y.currentCount,l[v]=f,y.currentCount++,f++}var S=new Float32Array(3*i);for(E=0;i>E;E++){var C=3*E;if(y=s[E],y.count>0){for(o.clone(o.ZERO,ce),f=0;f<y.count;f++)o.add(ce,c[l[y.indexOffset+f]],ce);o.normalize(ce,ce),S[C]=ce.x,S[C+1]=ce.y,S[C+2]=ce.z}else S[C]=0,S[C+1]=0,S[C+2]=1}return e.attributes.normal=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:S}),e};var he=new o,me=new o,de=new o;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,a=e.attributes.position.values.length/3,s=t.length,c=new Array(3*a),l=0;l<c.length;l++)c[l]=0;var E,f,h; +for(l=0;s>l;l+=3){var d=t[l],p=t[l+1],T=t[l+2];E=3*d,f=3*p,h=3*T;var R=2*d,A=2*p,_=2*T,y=r[E],v=r[E+1],S=r[E+2],C=i[R],g=i[R+1],N=i[A+1]-g,I=i[_+1]-g,O=1/((i[A]-C)*I-(i[_]-C)*N),M=(I*(r[f]-y)-N*(r[h]-y))*O,L=(I*(r[f+1]-v)-N*(r[h+1]-v))*O,F=(I*(r[f+2]-S)-N*(r[h+2]-S))*O;c[E]+=M,c[E+1]+=L,c[E+2]+=F,c[f]+=M,c[f+1]+=L,c[f+2]+=F,c[h]+=M,c[h+1]+=L,c[h+2]+=F}var P=new Float32Array(3*a),w=new Float32Array(3*a);for(l=0;a>l;l++){E=3*l,f=E+1,h=E+2;var D=o.fromArray(n,E,he),b=o.fromArray(c,E,de),x=o.dot(D,b);o.multiplyByScalar(D,x,me),o.normalize(o.subtract(b,me,b),b),w[E]=b.x,w[f]=b.y,w[h]=b.z,o.normalize(o.cross(D,b,b),b),P[E]=b.x,P[f]=b.y,P[h]=b.z}return e.attributes.tangent=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:w}),e.attributes.binormal=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e};var pe=new n,Te=new o,Re=new o,Ae=new o;te.compressVertices=function(t){var r=t.attributes.normal,i=t.attributes.st;if(!c(r)&&!c(i))return t;var a,s,l,E,f=t.attributes.tangent,h=t.attributes.binormal;c(r)&&(a=r.values),c(i)&&(s=i.values),c(f)&&(l=f.values),h&&(E=h.values);var d=c(a)?a.length:s.length,p=c(a)?3:2,T=d/p,R=T,A=c(s)&&c(a)?2:1;A+=c(l)||c(E)?1:0,R*=A;for(var _=new Float32Array(R),y=0,v=0;T>v;++v){c(s)&&(n.fromArray(s,2*v,pe),_[y++]=e.compressTextureCoordinates(pe));var S=3*v;c(a)&&c(l)&&c(E)?(o.fromArray(a,S,Te),o.fromArray(l,S,Re),o.fromArray(E,S,Ae),e.octPack(Te,Re,Ae,pe),_[y++]=pe.x,_[y++]=pe.y):(c(a)&&(o.fromArray(a,S,Te),_[y++]=e.octEncodeFloat(Te)),c(l)&&(o.fromArray(l,S,Te),_[y++]=e.octEncodeFloat(Te)),c(E)&&(o.fromArray(E,S,Te),_[y++]=e.octEncodeFloat(Te)))}return t.attributes.compressedAttributes=new m({componentDatatype:u.FLOAT,componentsPerAttribute:A,values:_}),c(a)&&delete t.attributes.normal,c(s)&&delete t.attributes.st,c(l)&&delete t.attributes.tangent,c(E)&&delete t.attributes.binormal,t};var _e=new o,ye=new o,ve=new o,Se=new o,Ce=new o,ge={positions:new Array(7),indices:new Array(9)},Ne=new o,Ie=new o,Oe=new o,Me=new o,Le=new n,Fe=new n,Pe=new n,we=S.fromPointNormal(o.ZERO,o.UNIT_Y),De=new o,be=new o,xe=new n,Ue=new n,Be=new o,Ge=new o,ze=new o,Ve=new o,He=new o,qe=new o,We=new o,Ye=new i;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var o=n.center.x-n.radius;if(o>0||r.intersectPlane(n,S.ORIGIN_ZX_PLANE)!==R.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:$(e)}else H(t),t.primitiveType===C.TRIANGLES?J(e):t.primitiveType===C.LINES&&$(e);return e},te}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,o,i,a,u){"use strict";function s(e){this._ellipsoid=r(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return o(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.mercatorAngleToGeodeticLatitude=function(e){return u.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},s.geodeticLatitudeToMercatorAngle=function(e){e>s.MaximumLatitude?e=s.MaximumLatitude:e<-s.MaximumLatitude&&(e=-s.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI),s.prototype.project=function(t,r){var o=this._semimajorAxis,i=t.longitude*o,a=s.geodeticLatitudeToMercatorAngle(t.latitude)*o,u=t.height;return n(r)?(r.x=i,r.y=a,r.z=u,r):new e(i,a,u)},s.prototype.unproject=function(e,r){var o=this._oneOverSemimajorAxis,i=e.x*o,a=s.mercatorAngleToGeodeticLatitude(e.y*o),u=e.z;return n(r)?(r.longitude=i,r.latitude=a,r.height=u,r):new t(i,a,u)},s}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,n,o,i,a,u,s,c,l,E,f,h,m,d){"use strict";function p(e,t,r){var n,o=!r,i=e.length;if(!o&&i>1){var a=e[0].modelMatrix;for(n=1;i>n;++n)if(!m.equals(a,e[n].modelMatrix)){o=!0;break}}if(o)for(n=0;i>n;++n)f.transformToWorldCoordinates(e[n]);else m.multiplyTransformation(t,e[0].modelMatrix,t)}function T(e,n){var o=e.attributes,i=o.position,a=4*(i.values.length/i.componentsPerAttribute);o.pickColor=new l({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0,values:new Uint8Array(a)});for(var u=t.floatToByte(n.red),s=t.floatToByte(n.green),c=t.floatToByte(n.blue),E=t.floatToByte(n.alpha),f=o.pickColor.values,h=0;a>h;h+=4)f[h]=u,f[h+1]=s,f[h+2]=c,f[h+3]=E}function R(e,t){for(var r=e.length,n=0;r>n;++n){var i=e[n],a=t[n];o(i.geometry)?T(i.geometry,a):(T(i.westHemisphereGeometry,a),T(i.eastHemisphereGeometry,a))}}function A(e){var t,r=e.length,n=[],i=e[0].attributes;for(t in i)if(i.hasOwnProperty(t)){for(var a=i[t],u=!0,s=1;r>s;++s){var c=e[s].attributes[t];if(!o(c)||a.componentDatatype!==c.componentDatatype||a.componentsPerAttribute!==c.componentsPerAttribute||a.normalize!==c.normalize){u=!1;break}}u&&n.push(t)}return n}function _(e,t,n){for(var o=c.computeNumberOfVertices(t),i=n.length,a=0;i>a;++a){for(var u=n[a],s=e[u],E=s.componentDatatype,f=s.value,h=f.length,m=r.createTypedArray(E,o*h),d=0;o>d;++d)m.set(f,d*h);t.attributes[u]=new l({componentDatatype:E,componentsPerAttribute:h,normalize:s.normalize,values:m})}}function y(e,t){for(var r=e.length,n=0;r>n;++n){var i=e[n],a=i.attributes;o(i.geometry)?_(a,i.geometry,t):(_(a,i.westHemisphereGeometry,t),_(a,i.eastHemisphereGeometry,t))}}function v(t){var n,i,a=t.instances,u=t.pickIds,s=t.projection,c=t.elementIndexUintSupported,l=t.scene3DOnly,E=t.allowPicking,h=t.vertexCacheOptimize,m=t.compressVertices,d=t.modelMatrix,T=a.length;a[0].geometry.primitiveType;if(p(a,d,l),!l)for(n=0;T>n;++n)f.splitLongitude(a[n]);E&&R(a,u);var _=A(a);if(y(a,_),h)for(n=0;T>n;++n){var v=a[n];o(v.geometry)?(f.reorderForPostVertexCache(v.geometry),f.reorderForPreVertexCache(v.geometry)):(f.reorderForPostVertexCache(v.westHemisphereGeometry),f.reorderForPreVertexCache(v.westHemisphereGeometry),f.reorderForPostVertexCache(v.eastHemisphereGeometry),f.reorderForPreVertexCache(v.eastHemisphereGeometry))}var S=f.combineInstances(a);for(T=S.length,n=0;T>n;++n){i=S[n];var C,g=i.attributes;if(l)for(C in g)g.hasOwnProperty(C)&&g[C].componentDatatype===r.DOUBLE&&f.encodeAttribute(i,C,C+"3DHigh",C+"3DLow");else for(C in g)if(g.hasOwnProperty(C)&&g[C].componentDatatype===r.DOUBLE){var N=C+"3D",I=C+"2D";f.projectTo2D(i,C,N,I,s),o(i.boundingSphere)&&"position"===C&&(i.boundingSphereCV=e.fromVertices(i.attributes.position2D.values)),f.encodeAttribute(i,N,N+"High",N+"Low"),f.encodeAttribute(i,I,I+"High",I+"Low")}m&&f.compressVertices(i)}if(!c){var O=[];for(T=S.length,n=0;T>n;++n)i=S[n],O=O.concat(f.fitToUnsignedShortIndices(i));S=O}return S}function S(e,t,n){for(var o=[],i=e.attributes,a=n.length,u=0;a>u;++u){var s=n[u],c=i[s],l=c.componentDatatype;l===r.DOUBLE&&(l=r.FLOAT);var E=r.createTypedArray(l,c.values);o.push({index:t[s],componentDatatype:l,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,values:E}),delete i[s]}return o}function C(e,t,r,i,a,u,s,l,E){var f=c.computeNumberOfVertices(t);o(s[e])||(s[e]={boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV});for(var h=i.length,m=0;h>m;++m)for(var d=i[m],p=a[d],T=f;T>0;){for(var R,A=n(E[d],0),_=u[A],y=_.length,v=0;y>v&&(R=_[v],R.index!==p);++v);o(s[e][d])||(s[e][d]={dirty:!1,valid:!0,value:r[d].value,indices:[]});var S,C=R.values.length/R.componentsPerAttribute,g=n(l[d],0);C>g+T?(S=T,s[e][d].indices.push({attribute:R,offset:g,count:S}),l[d]=g+T):(S=C-g,s[e][d].indices.push({attribute:R,offset:g,count:S}),l[d]=0,E[d]=A+1),T-=S}}function g(e,t,r,n,i){var a,u,s,c=[],l=e.length,E={},f={};for(a=0;l>a;++a)u=e[a],s=u.attributes,o(u.geometry)&&C(a,u.geometry,s,i,n,r,c,E,f);for(a=0;l>a;++a)u=e[a],s=u.attributes,o(u.westHemisphereGeometry)&&C(a,u.westHemisphereGeometry,s,i,n,r,c,E,f);for(a=0;l>a;++a)u=e[a],s=u.attributes,o(u.eastHemisphereGeometry)&&C(a,u.eastHemisphereGeometry,s,i,n,r,c,E,f);for(l=t.length,a=0;l>a;++a){u=t[a],s=u.attributes;var h={};c.push(h);for(var m=i.length,d=0;m>d;++d){var p=i[d];h[p]={dirty:!1,valid:!1,value:s[p].value,indices:[]}}}return c}function N(e,t,r,n){var i,a,u,s=n.length-1;if(s>=0){var c=n[s];i=c.offset+c.count,u=c.index,a=r[u].indices.length}else i=0,u=0,a=r[u].indices.length;for(var l=e.length,E=0;l>E;++E){var f=e[E],h=f[t];if(o(h)){var m=h.indices.length;i+m>a&&(i=0,a=r[++u].indices.length),n.push({index:u,offset:i,count:m}),i+=m}}}function I(e,t){var r=[];return N(e,"geometry",t,r),N(e,"westHemisphereGeometry",t,r),N(e,"eastHemisphereGeometry",t,r),r}function O(e,t){var r=e.attributes;for(var n in r)if(r.hasOwnProperty(n)){var i=r[n];o(i)&&o(i.values)&&t.push(i.values.buffer)}o(e.indices)&&t.push(e.indices.buffer)}function M(e,t){for(var r=e.length,n=0;r>n;++n)O(e[n],t)}function L(e,t){for(var r=e.length,n=0;r>n;++n)for(var o=e[n],i=o.length,a=0;i>a;++a)t.push(o[a].values.buffer)}function F(t){for(var r=1,n=t.length,i=0;n>i;i++){var a=t[i];if(++r,o(a)){var u=a.attributes;r+=6+2*e.packedLength+(o(a.indices)?a.indices.length:0);for(var s in u)if(u.hasOwnProperty(s)&&o(u[s])){var c=u[s];r+=5+c.values.length}}}return r}function P(e,t){for(var r=e.length,n=new Uint32Array(e.length),o=0;r>o;++o)n[o]=e[o].toRgba();return t.push(n.buffer),n}function w(e){for(var r=e.length,n=new Array(r),o=0;r>o;o++)n[o]=t.fromRgba(e[o]);return n}function D(e){for(var t=e.length,r=1+17*t,n=0;t>n;n++){var i=e[n].attributes;for(var a in i)if(i.hasOwnProperty(a)&&o(i[a])){var u=i[a];r+=5+u.value.length}}return r}function b(e,t){var r=new Float64Array(D(e)),n={},i=[],a=e.length,u=0;r[u++]=a;for(var s=0;a>s;s++){var c=e[s];m.pack(c.modelMatrix,r,u),u+=m.packedLength;var l=c.attributes,E=[];for(var f in l)l.hasOwnProperty(f)&&o(l[f])&&(E.push(f),o(n[f])||(n[f]=i.length,i.push(f)));r[u++]=E.length;for(var h=0;h<E.length;h++){var d=E[h],p=l[d];r[u++]=n[d],r[u++]=p.componentDatatype,r[u++]=p.componentsPerAttribute,r[u++]=p.normalize,r[u++]=p.value.length,r.set(p.value,u),u+=p.value.length}}return t.push(r.buffer),{stringTable:i,packedData:r}}function x(e){for(var t=e.packedData,n=e.stringTable,o=new Array(t[0]),i=0,a=1;a<t.length;){var u=m.unpack(t,a);a+=m.packedLength;for(var s={},c=t[a++],l=0;c>l;l++){for(var E=n[t[a++]],f=t[a++],h=t[a++],d=0!==t[a++],p=t[a++],T=r.createTypedArray(f,p),R=0;p>R;R++)T[R]=t[a++];s[E]={componentDatatype:f,componentsPerAttribute:h,normalize:d,value:T}}o[i++]={attributes:s,modelMatrix:u}}return o}function U(t){for(var r=t.length,n=1+r,i=0;r>i;i++){var a=t[i];n+=2,n+=o(a.boundingSphere)?e.packedLength:0,n+=o(a.boundingSphereCV)?e.packedLength:0;for(var u in a)if(a.hasOwnProperty(u)&&o(a[u])&&"boundingSphere"!==u&&"boundingSphereCV"!==u){var s=a[u];n+=4+3*s.indices.length+s.value.length}}return n}function B(t,r){var n=new Float64Array(U(t)),i=[],a=[],u={},s=t.length,c=0;n[c++]=s;for(var l=0;s>l;l++){var E=t[l],f=E.boundingSphere,h=o(f);n[c++]=h?1:0,h&&(e.pack(f,n,c),c+=e.packedLength),f=E.boundingSphereCV,h=o(f),n[c++]=h?1:0,h&&(e.pack(f,n,c),c+=e.packedLength);var m=[];for(var d in E)E.hasOwnProperty(d)&&o(E[d])&&"boundingSphere"!==d&&"boundingSphereCV"!==d&&(m.push(d),o(u[d])||(u[d]=i.length,i.push(d)));n[c++]=m.length;for(var p=0;p<m.length;p++){var T=m[p],R=E[T];n[c++]=u[T],n[c++]=R.valid?1:0;var A=R.indices,_=A.length;n[c++]=_;for(var y=0;_>y;y++){var v=A[y];n[c++]=v.count,n[c++]=v.offset;var S=a.indexOf(v.attribute);-1===S&&(S=a.length,a.push(v.attribute)),n[c++]=S}n[c++]=R.value.length,n.set(R.value,c),c+=R.value.length}}return r.push(n.buffer),{stringTable:i,packedData:n,attributeTable:a}}function G(t,n){for(var o=t.stringTable,i=t.attributeTable,a=t.packedData,u=new Array(a[0]),s=0,c=1,l=a.length;l>c;){var E={},f=1===a[c++];f&&(E.boundingSphere=e.unpack(a,c),c+=e.packedLength),f=1===a[c++],f&&(E.boundingSphereCV=e.unpack(a,c),c+=e.packedLength);for(var h=a[c++],m=0;h>m;m++){for(var d=o[a[c++]],p=1===a[c++],T=a[c++],R=T>0?new Array(T):void 0,A=0;T>A;A++){var _={};_.count=a[c++],_.offset=a[c++],_.attribute=i[a[c++]],R[A]=_}for(var y=a[c++],v=p?r.createTypedArray(R[0].attribute.componentDatatype,y):new Array(y),S=0;y>S;S++)v[S]=a[c++];E[d]={dirty:!1,valid:p,indices:R,value:v}}u[s++]=E}return u}if(!u.supportsTypedArrays())return{};var z={};return z.combineGeometry=function(e){var t,r,n,i,a,u=e.instances,s=e.invalidInstances;if(u.length>0){t=v(e),r=f.createAttributeLocations(t[0]),i=A(u),n=[],a=t.length;for(var c=0;a>c;++c){var l=t[c];n.push(S(l,r,i))}}i=o(i)?i:A(s);var E,h=g(u,s,n,r,i);return e.createPickOffsets&&o(t)&&(E=I(u,t)),{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:r,vaAttributes:n,vaAttributeLocations:h,validInstancesIndices:e.validInstancesIndices,invalidInstancesIndices:e.invalidInstancesIndices,pickOffsets:E}},z.packCreateGeometryResults=function(t,r){var n=new Float64Array(F(t)),i=[],a={},u=t.length,s=0;n[s++]=u;for(var c=0;u>c;c++){var l=t[c],E=o(l);if(n[s++]=E?1:0,E){n[s++]=l.primitiveType,n[s++]=l.geometryType;var f=o(l.boundingSphere)?1:0;n[s++]=f,f&&e.pack(l.boundingSphere,n,s),s+=e.packedLength;var h=o(l.boundingSphereCV)?1:0;n[s++]=h,h&&e.pack(l.boundingSphereCV,n,s),s+=e.packedLength;var m=l.attributes,d=[];for(var p in m)m.hasOwnProperty(p)&&o(m[p])&&(d.push(p),o(a[p])||(a[p]=i.length,i.push(p)));n[s++]=d.length;for(var T=0;T<d.length;T++){var R=d[T],A=m[R];n[s++]=a[R],n[s++]=A.componentDatatype,n[s++]=A.componentsPerAttribute,n[s++]=A.normalize?1:0,n[s++]=A.values.length,n.set(A.values,s),s+=A.values.length}var _=o(l.indices)?l.indices.length:0;n[s++]=_,_>0&&(n.set(l.indices,s),s+=_)}}return r.push(n.buffer),{stringTable:i,packedData:n}},z.unpackCreateGeometryResults=function(t){for(var n,o=t.stringTable,i=t.packedData,a=new Array(i[0]),u=0,s=1;s<i.length;){var f=1===i[s++];if(f){var m,d,p=i[s++],T=i[s++],R=1===i[s++];R&&(m=e.unpack(i,s)),s+=e.packedLength;var A=1===i[s++];A&&(d=e.unpack(i,s)),s+=e.packedLength;var _,y,v,S=new E,C=i[s++];for(n=0;C>n;n++){var g=o[i[s++]],N=i[s++];v=i[s++];var I=0!==i[s++];_=i[s++],y=r.createTypedArray(N,_);for(var O=0;_>O;O++)y[O]=i[s++];S[g]=new l({componentDatatype:N,componentsPerAttribute:v,normalize:I,values:y})}var M;if(_=i[s++],_>0){var L=y.length/v;for(M=h.createTypedArray(L,_),n=0;_>n;n++)M[n]=i[s++]}a[u++]=new c({primitiveType:p,geometryType:T,boundingSphere:m,indices:M,attributes:S})}else a[u++]=void 0}return a},z.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,n=r.length,o=0;n>o;o++)t.push(r[o].packedData.buffer);var i;return e.allowPicking&&(i=P(e.pickIds,t)),{createGeometryResults:e.createGeometryResults,packedInstances:b(e.instances,t),packedPickIds:i,ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},z.unpackCombineGeometryParameters=function(e){for(var t=x(e.packedInstances),r=e.allowPicking,n=r?w(e.packedPickIds):void 0,i=e.createGeometryResults,u=i.length,c=0,l=[],E=[],f=[],h=[],p=[],T=0;u>T;T++)for(var R=z.unpackCreateGeometryResults(i[T]),A=R.length,_=0;A>_;_++){var y=R[_],v=t[c];o(y)?(v.geometry=y,l.push(v),f.push(c),r&&p.push(n[c])):(E.push(v),h.push(c)),++c}var S=a.clone(e.ellipsoid),C=e.isGeographic?new s(S):new d(S);return{instances:l,invalidInstances:E,validInstancesIndices:f,invalidInstancesIndices:h,pickIds:p,ellipsoid:S,projection:C,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:m.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},z.packCombineGeometryResults=function(e,t){return o(e.geometries)&&(M(e.geometries,t),L(e.vaAttributes,t)),{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,packedVaAttributeLocations:B(e.vaAttributeLocations,t),modelMatrix:e.modelMatrix,validInstancesIndices:e.validInstancesIndices,invalidInstancesIndices:e.invalidInstancesIndices,pickOffsets:e.pickOffsets}},z.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,perInstanceAttributeLocations:G(e.packedVaAttributeLocations,e.vaAttributes),modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets}},z}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,n,o){return t(e).then(r,n,o)}function t(e){var t,r;return e instanceof n?t=e:u(e)?(r=a(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=o(e),t}function r(t){return e(t,i)}function n(e){this.then=e}function o(e){var r=new n(function(r){try{return t(r?r(e):e)}catch(n){return i(n)}});return r}function i(e){var r=new n(function(r,n){try{return n?t(n(e)):i(e)}catch(o){return i(o)}});return r}function a(){function e(e,t,r){return f(e,t,r)}function r(e){return m(e)}function o(e){return m(i(e))}function u(e){return h(e)}var s,c,l,E,f,h,m;return c=new n(e),s={then:e,resolve:r,reject:o,progress:u,promise:c,resolver:{resolve:r,reject:o,progress:u}},l=[],E=[],f=function(e,t,r){var n,o;return n=a(),o="function"==typeof r?function(e){try{n.progress(r(e))}catch(t){n.progress(t)}}:function(e){n.progress(e)},l.push(function(r){r.then(e,t).then(n.resolve,n.reject,o)}),E.push(o),n.promise},h=function(e){return d(E,e),e},m=function(e){return e=t(e),f=e.then,m=t,h=T,d(l,e),E=l=y,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,r,n,o,i){return p(2,arguments),e(t,function(t){function u(e){d(e)}function s(e){m(e)}var c,l,E,f,h,m,d,p,R,A;if(R=t.length>>>0,c=Math.max(0,Math.min(r,R)),E=[],l=R-c+1,f=[],h=a(),c)for(p=h.progress,d=function(e){f.push(e),--l||(m=d=T,h.reject(f))},m=function(e){E.push(e),--c||(m=d=T,h.resolve(E))},A=0;R>A;++A)A in t&&e(t[A],s,u,p);else h.resolve(E);return h.then(n,o,i)})}function c(e,t,r,n){function o(e){return t?t(e[0]):e[0]}return s(e,1,o,r,n)}function l(e,t,r,n){return p(1,arguments),f(e,R).then(t,r,n)}function E(){return f(arguments,R)}function f(t,r){return e(t,function(t){var n,o,i,u,s,c;if(i=o=t.length>>>0,n=[],c=a(),i)for(u=function(t,o){e(t,r).then(function(e){n[o]=e,--i||c.resolve(n)},c.reject)},s=0;o>s;s++)s in t?u(t[s],s):--i;else c.resolve(n);return c.promise})}function h(t,r){var n=_.call(arguments,1);return e(t,function(t){var o;return o=t.length,n[0]=function(t,n,i){return e(t,function(t){return e(n,function(e){return r(t,e,i,o)})})},A.apply(t,n)})}function m(t,r,n){var o=arguments.length>2;return e(t,function(e){return e=o?n:e,r.resolve(e),e},function(e){return r.reject(e),i(e)},r.progress)}function d(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 T(){}function R(e){return e}var A,_,y;return e.defer=a,e.resolve=t,e.reject=r,e.join=E,e.all=l,e.map=f,e.reduce=h,e.any=c,e.some=s,e.chain=m,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(y,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(y,t)})})}},_=[].slice,A=[].reduce||function(e){var t,r,n,o,i;if(i=0,t=Object(this),o=t.length>>>0,r=arguments,r.length<=1)for(;;){if(i in t){n=t[i++];break}if(++i>=o)throw new TypeError}else n=r[1];for(;o>i;++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/formatError",["./defined"],function(e){"use strict";function t(t){var r,n=t.name,o=t.message;r=e(n)&&e(o)?n+": "+o: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 o,i=[],a={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,a.id=s.id,a.error=void 0,a.result=void 0;try{a.result=n(s.parameters,i)}catch(c){c instanceof Error?a.error={name:c.name,message:c.message,stack:c.stack}:a.error=c}t(o)||(o=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{o(a,i)}catch(c){a.result=void 0,a.error="postMessage failed with error: "+r(c)+"\n with responseMessage: "+JSON.stringify(a),o(a)}}}return n}),define("Workers/createGeometry",["../Core/defined","../Scene/PrimitivePipeline","../ThirdParty/when","./createTaskProcessorWorker","require"],function(e,t,r,n,o){"use strict";function i(t){var r=u[t];return e(r)||("object"==typeof exports?u[r]=r=o("Workers/"+t):o(["./"+t],function(e){r=e,u[r]=e})),r}function a(r,n){for(var o=r.subTasks,a=o.length,u=new Array(a),s=0;a>s;s++){var c=o[s],l=c.geometry,E=c.moduleName;if(e(E)){var f=i(E);u[s]=f(l,c.offset)}else u[s]=l}return t.packCreateGeometryResults(u,n)}var u={};return n(a)})}(); \ No newline at end of file diff --git a/Workers/createPolygonGeometry.js b/Workers/createPolygonGeometry.js index 24b1554..1a71dca 100644 --- a/Workers/createPolygonGeometry.js +++ b/Workers/createPolygonGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,8 +222,10 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};r.EPSILON1=.1,r.EPSILON2=.01,r.EPSILON3=.001,r.EPSILON4=1e-4,r.EPSILON5=1e-5,r.EPSILON6=1e-6,r.EPSILON7=1e-7,r.EPSILON8=1e-8,r.EPSILON9=1e-9,r.EPSILON10=1e-10,r.EPSILON11=1e-11,r.EPSILON12=1e-12,r.EPSILON13=1e-13,r.EPSILON14=1e-14,r.EPSILON15=1e-15,r.EPSILON16=1e-16,r.EPSILON17=1e-17,r.EPSILON18=1e-18,r.EPSILON19=1e-19,r.EPSILON20=1e-20,r.GRAVITATIONALPARAMETER=3986004418e5,r.SOLAR_RADIUS=6955e5,r.LUNAR_RADIUS=1737400,r.SIXTY_FOUR_KILOBYTES=65536,r.sign=function(e){return e>0?1:0>e?-1:0},r.signNotZero=function(e){return 0>e?-1:1},r.toSNorm=function(e){return Math.round(255*(.5*r.clamp(e,-1,1)+.5))},r.fromSNorm=function(e){return 2*(r.clamp(e,0,255)/255)-1},r.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},r.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},r.lerp=function(e,t,r){return(1-r)*e+r*t},r.PI=Math.PI,r.ONE_OVER_PI=1/Math.PI,r.PI_OVER_TWO=.5*Math.PI,r.PI_OVER_THREE=Math.PI/3,r.PI_OVER_FOUR=Math.PI/4,r.PI_OVER_SIX=Math.PI/6,r.THREE_PI_OVER_TWO=.5*3*Math.PI,r.TWO_PI=2*Math.PI,r.ONE_OVER_TWO_PI=1/(2*Math.PI),r.RADIANS_PER_DEGREE=Math.PI/180,r.DEGREES_PER_RADIAN=180/Math.PI,r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600,r.toRadians=function(e){return e*r.RADIANS_PER_DEGREE},r.toDegrees=function(e){return e*r.DEGREES_PER_RADIAN},r.convertLongitudeRange=function(e){var t=r.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},r.negativePiToPi=function(e){for(var t=r.EPSILON10,n=r.PI,i=r.TWO_PI;-(n+t)>e;)e+=i;if(-n>e)return-n;for(;e>n+t;)e-=i;return e>n?n:e},r.zeroToTwoPi=function(e){var t=e%r.TWO_PI;return 0>t?(t+r.TWO_PI)%r.TWO_PI:t},r.equalsEpsilon=function(e,r,n){return n=t(n,0),Math.abs(e-r)<=n};var n=[1];r.factorial=function(e){var t=n.length;if(e>=t)for(var r=n[t-1],i=t;e>=i;i++)n.push(r*i);return n[e]},r.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},r.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},r.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},r.clamp=function(e,t,r){return t>e?t:e>r?r:e};var i=new e;return r.setRandomNumberSeed=function(t){i=new e(t)},r.nextRandomNumber=function(){return i.random()},r.acosClamped=function(e){return Math.acos(r.clamp(e,-1,1))},r.asinClamped=function(e){return Math.asin(r.clamp(e,-1,1))},r}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i){"use strict";var a=function(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)};a.fromSpherical=function(r,n){t(n)||(n=new a);var i=r.clock,o=r.cone,u=e(r.magnitude,1),s=u*Math.sin(o);return n.x=s*Math.cos(i),n.y=s*Math.sin(i),n.z=u*Math.cos(o),n},a.fromElements=function(e,r,n,i){return t(i)?(i.x=e,i.y=r,i.z=n,i):new a(e,r,n)},a.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new a(e.x,e.y,e.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z},a.unpack=function(r,n,i){return n=e(n,0),t(i)||(i=new a),i.x=r[n++],i.y=r[n++],i.z=r[n],i},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},a.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},a.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(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},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var u=new a;a.lerp=function(e,t,r,n){return a.multiplyByScalar(t,r,u),n=a.multiplyByScalar(e,1-r,n),a.add(u,n,n)};var s=new a,c=new a;a.angleBetween=function(e,t){a.normalize(e,s),a.normalize(t,c);var r=a.dot(s,c),n=a.magnitude(a.cross(s,c,s));return Math.atan2(n,r)};var l=new a;a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,l);return a.abs(r,r),t=r.x<=r.y?r.x<=r.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):r.y<=r.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,t)},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z},a.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n},a.cross=function(e,t,r){var n=e.x,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},a.fromDegrees=function(e,t,r,n,o){var u=i.toRadians(e),s=i.toRadians(t);return a.fromRadians(u,s,r,n,o)};var f=new a,h=new a,d=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(r,n,i,o,u){i=e(i,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(n);f.x=c*Math.cos(r),f.y=c*Math.sin(r),f.z=Math.sin(n),f=a.normalize(f,f),a.multiplyComponents(s,f,h);var l=Math.sqrt(a.dot(f,h));return h=a.divideByScalar(h,l,h),f=a.multiplyByScalar(f,i,f),t(u)||(u=new a),a.add(h,f,u)},a.fromDegreesArray=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o++)n[o]=i.toRadians(e[o]);return a.fromRadiansArray(n,t,r)},a.fromRadiansArray=function(e,r,n){var i=e.length;t(n)?n.length=i/2:n=new Array(i/2);for(var o=0;i>o;o+=2){var u=e[o],s=e[o+1];n[o/2]=a.fromRadians(u,s,0,r,n[o/2])}return n},a.fromDegreesArrayHeights=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o+=3)n[o]=i.toRadians(e[o]),n[o+1]=i.toRadians(e[o+1]),n[o+2]=e[o+2];return a.fromRadiansArrayHeights(n,t,r)},a.fromRadiansArrayHeights=function(e,r,n){var i=e.length;t(n)?n.length=i/3:n=new Array(i/3);for(var o=0;i>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];n[o/3]=a.fromRadians(u,s,c,r,n[o/3])}return n},a.ZERO=n(new a(0,0,0)),a.UNIT_X=n(new a(1,0,0)),a.UNIT_Y=n(new a(0,1,0)),a.UNIT_Z=n(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i){"use strict";var a=function(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)};return a.fromRadians=function(r,n,i,o){return i=e(i,0),t(o)?(o.longitude=r,o.latitude=n,o.height=i,o):new a(r,n,i)},a.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),a.fromRadians(e,t,r,n)},a.clone=function(e,r){return t(e)?t(r)?(r.longitude=e.longitude,r.latitude=e.latitude,r.height=e.height,r):new a(e.longitude,e.latitude,e.height):void 0},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.longitude===r.longitude&&e.latitude===r.latitude&&e.height===r.height},a.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.longitude-r.longitude)<=n&&Math.abs(e.latitude-r.latitude)<=n&&Math.abs(e.height-r.height)<=n},a.ZERO=n(new a(0,0,0)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,a,o,u){"use strict";function s(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}var c=function(e,t,r){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,s(this,e,t,r)};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,r){if(!n(t))return void 0;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 c(i.x,i.y,i.z)},c.fromCartesian3=function(e,t){return n(t)||(t=new c),n(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=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.prototype.geocentricSurfaceNormal=e.normalize,c.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)},c.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var l=new e,f=new e;c.prototype.cartographicToCartesian=function(t,r){var i=l,a=f;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)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var i=0;r>i;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var h=new e,d=new e,y=new e;c.prototype.cartesianToCartographic=function(r,i){var a=this.scaleToGeodeticSurface(r,d);if(!n(a))return void 0;var o=this.geodeticSurfaceNormal(a,h),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)},c.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var i=0;r>i;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};var m=new e,p=new e;return c.prototype.scaleToGeodeticSurface=function(t,r){var i=t.x,a=t.y,o=t.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,h=i*i*c*c,d=a*a*l*l,y=o*o*f*f,v=h+d+y,g=Math.sqrt(1/v),w=e.multiplyByScalar(t,g,m);if(v<this._centerToleranceSquared)return isFinite(g)?e.clone(w,r):void 0;var x=this._oneOverRadiiSquared,E=x.x,S=x.y,O=x.z,T=p;T.x=2*w.x*E,T.y=2*w.y*S,T.z=2*w.z*O;var M,b,N,_,P,A,I,z,C,R,D,L=(1-g)*e.magnitude(t)/(.5*e.magnitude(T)),U=0;do{L-=U,N=1/(1+L*E),_=1/(1+L*S),P=1/(1+L*O),A=N*N,I=_*_,z=P*P,C=A*N,R=I*_,D=z*P,M=h*A+d*I+y*z-1,b=h*C*E+d*R*S+y*D*O;var q=-2*b;U=M/q}while(Math.abs(M)>u.EPSILON12);return n(r)?(r.x=i*N,r.y=a*_,r.z=o*P,r):new e(i*N,a*_,o*P)},c.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)},c.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},c.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},c.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i){"use strict";var a=function(t,r){this.x=e(t,0),this.y=e(r,0)};a.fromElements=function(e,r,n){return t(n)?(n.x=e,n.y=r,n):new a(e,r)},a.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new a(e.x,e.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n]=t.y},a.unpack=function(r,n,i){return n=e(n,0),t(i)||(i=new a),i.x=r[n++],i.y=r[n],i},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.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var u=new a;a.lerp=function(e,t,r,n){return a.multiplyByScalar(t,r,u),n=a.multiplyByScalar(e,1-r,n),a.add(u,n,n)};var s=new a,c=new a;a.angleBetween=function(e,t){return a.normalize(e,s),a.normalize(t,c),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.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n},a.ZERO=n(new a(0,0)),a.UNIT_X=n(new a(1,0)),a.UNIT_Y=n(new a(0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,i,a,o){"use strict";var u=function(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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,i,a,o){"use strict";var u=function(e,r,n,i){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(i,0)};u.fromDegrees=function(e,n,i,a,s){return e=o.toRadians(t(e,0)),n=o.toRadians(t(n,0)),i=o.toRadians(t(i,0)),a=o.toRadians(t(a,0)),r(s)?(s.west=e,s.south=n,s.east=i,s.north=a,s):new u(e,n,i,a)},u.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=e.length;c>s;s++){var l=e[s];n=Math.min(n,l.longitude),i=Math.max(i,l.longitude),a=Math.min(a,l.latitude),o=Math.max(o,l.latitude)}return r(t)?(t.west=n,t.south=a,t.east=i,t.north=o,t):new u(n,a,i,o)},u.packedLength=4,u.pack=function(e,r,n){n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north},u.unpack=function(e,n,i){return n=t(n,0),r(i)||(i=new u),i.west=e[n++],i.south=e[n++],i.east=e[n++],i.north=e[n],i},u.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},u.validate=function(){},u.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},u.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},u.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},u.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},u.center=function(t,n){var i=t.east,a=t.west,u=.5*(a+i);return a>i&&(u=o.negativePiToPi(u+o.PI)),r(n)?(n.longitude=u,n.latitude=.5*(t.south+t.north),n.height=0,n):new e(u,.5*(t.south+t.north))},u.intersectWith=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),s=Math.min(e.north,t.north);return r(n)?(n.west=i,n.south=a,n.east=o,n.north=s,n):new u(i,a,o,s)},u.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},u.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var s=new e;return u.subsample=function(e,n,a,u){n=t(n,i.WGS84),a=t(a,0),r(u)||(u=[]);var c=0,l=e.north,f=e.south,h=e.east,d=e.west,y=s;y.height=a,y.longitude=d,y.latitude=l,u[c]=n.cartographicToCartesian(y,u[c]),c++,y.longitude=h,u[c]=n.cartographicToCartesian(y,u[c]),c++,y.latitude=f,u[c]=n.cartographicToCartesian(y,u[c]),c++,y.longitude=d,u[c]=n.cartographicToCartesian(y,u[c]),c++,y.latitude=0>l?l:f>0?f:0;for(var m=1;8>m;++m){var p=-Math.PI+m*o.PI_OVER_TWO;p>d&&h>p&&(y.longitude=p,u[c]=n.cartographicToCartesian(y,u[c]),c++)}return 0===y.latitude&&(y.longitude=d,u[c]=n.cartographicToCartesian(y,u[c]),c++,y.longitude=h,u[c]=n.cartographicToCartesian(y,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./defaultValue","./defined","./DeveloperError","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,r,n,i,a,o,u){"use strict";var s=function(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.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;r>c;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){return n(e)?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):void 0},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:0>n&&(r.width-=n,r.x=t.x),i>r.height?r.height=i:0>i&&(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";var t=function(t,r){this.start=e(t,0),this.stop=e(r,0)};return t}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";var i=function(t,r,n,i){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(i,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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w},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.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 a=new i;i.distance=function(e,t){return i.subtract(e,t,a),i.magnitude(a)},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.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 o=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,o),n=i.multiplyByScalar(e,1-r,n),i.add(o,n,n)};var u=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,u);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.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n&&Math.abs(e.w-r.w)<=n},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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,a){"use strict";function o(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function u(e){for(var t=0,r=0;3>r;++r){var n=e[c.getElementIndex(d[r],h[r])];t+=2*n*n}return Math.sqrt(t)}function s(e,t){for(var r=a.EPSILON15,n=0,i=1,o=0;3>o;++o){var u=Math.abs(e[c.getElementIndex(d[o],h[o])]);u>n&&(i=o,n=u)}var s=1,l=0,f=h[i],y=d[i];if(Math.abs(e[c.getElementIndex(y,f)])>r){var m,p=e[c.getElementIndex(y,y)],v=e[c.getElementIndex(f,f)],g=e[c.getElementIndex(y,f)],w=(p-v)/2/g;m=0>w?-1/(-w+Math.sqrt(1+w*w)):1/(w+Math.sqrt(1+w*w)),s=1/Math.sqrt(1+m*m),l=m*s}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(f,f)]=t[c.getElementIndex(y,y)]=s,t[c.getElementIndex(y,f)]=l,t[c.getElementIndex(f,y)]=-l,t}var c=function(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)};c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,n,i){return n=t(n,0),r(i)||(i=new c),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},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var n=e.x*e.x,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,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,y=n-u-f+d,m=2*(i-h),p=2*(a+l),v=2*(i+h),g=-n+u-f+d,w=2*(s-o),x=2*(a-l),E=2*(s+o),S=-n-u+f+d;return r(t)?(t[0]=y,t[1]=v,t[2]=x,t[3]=m,t[4]=g,t[5]=E,t[6]=p,t[7]=w,t[8]=S,t):new c(y,m,p,v,g,w,x,E,S)},c.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new c(e.x,0,0,0,e.y,0,0,0,e.z)},c.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new c(e,0,0,0,e,0,0,0,e)},c.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.fromRotationX=function(e,t){var n=Math.cos(e),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 c(1,0,0,0,n,-i,0,i,n)},c.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 c(n,0,i,0,1,0,-i,0,n)},c.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 c(n,-i,0,i,n,0,0,0,1)},c.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},c.getElementIndex=function(e,t){return 3*e+t},c.getColumn=function(e,t,r){var n=3*t,i=e[n],a=e[n+1],o=e[n+2];return r.x=i,r.y=a,r.z=o,r},c.setColumn=function(e,t,r,n){n=c.clone(e,n);var i=3*t;return n[i]=r.x,n[i+1]=r.y,n[i+2]=r.z,n},c.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},c.setRow=function(e,t,r,n){return n=c.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var l=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),r};var f=new e;c.getMaximumScale=function(t){return c.getScale(t,f),e.maximumComponent(f)},c.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],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},c.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},c.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},c.multiplyByVector=function(e,t,r){var n=t.x,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},c.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},c.transpose=function(e,t){var r=e[0],n=e[3],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 h=[1,0,0],d=[2,2,1],y=new c,m=new c;return c.computeEigenDecomposition=function(e,t){var n=a.EPSILON20,i=10,l=0,f=0; -r(t)||(t={});for(var h=t.unitary=c.clone(c.IDENTITY,t.unitary),d=t.diagonal=c.clone(e,t.diagonal),p=n*o(d);i>f&&u(d)>p;)s(d,y),c.transpose(y,m),c.multiply(d,y,d),c.multiply(m,d,d),c.multiply(h,y,h),++l>2&&(++f,l=0);return t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},c.determinant=function(e){var t=e[0],r=e[3],n=e[6],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)},c.inverse=function(e,t){var r=e[0],i=e[1],o=e[2],u=e[3],s=e[4],l=e[5],f=e[6],h=e[7],d=e[8],y=c.determinant(e);if(Math.abs(y)<=a.EPSILON15)throw new n("matrix is not invertible");t[0]=s*d-h*l,t[1]=h*o-i*d,t[2]=i*l-s*o,t[3]=f*l-u*d,t[4]=r*d-f*o,t[5]=u*o-r*l,t[6]=u*h-f*s,t[7]=f*i-r*h,t[8]=r*s-u*i;var m=1/y;return c.multiplyByScalar(t,m,t)},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},c.IDENTITY=i(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,i,a,o,u,s){"use strict";var c=function(e,t,n,i,a,o,u,s,c,l,f,h,d,y,m,p){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(y,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(m,0),this[12]=r(i,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(p,0)};c.packedLength=16,c.pack=function(e,t,n){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]},c.unpack=function(e,t,i){return t=r(t,0),n(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){return n(e)?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 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]):void 0},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 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=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 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,r,i){n(i)||(i=new c);var a=r.x,o=r.y,u=r.z,s=t.x*t.x,l=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,y=t.y*t.z,m=t.y*t.w,p=t.z*t.z,v=t.z*t.w,g=t.w*t.w,w=s-d-p+g,x=2*(l-v),E=2*(f+m),S=2*(l+v),O=-s+d-p+g,T=2*(y-h),M=2*(f-m),b=2*(y+h),N=-s-d+p+g;return i[0]=w*a,i[1]=S*a,i[2]=M*a,i[3]=0,i[4]=x*o,i[5]=O*o,i[6]=b*o,i[7]=0,i[8]=E*u,i[9]=T*u,i[10]=N*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.IDENTITY,e,t)},c.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 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 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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,f=new e,h=new e;c.fromCamera=function(t,r){var i=t.eye,a=t.target,o=t.up;e.normalize(e.subtract(a,i,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,y=l.x,m=l.y,p=l.z,v=h.x,g=h.y,w=h.z,x=i.x,E=i.y,S=i.z,O=u*-x+s*-E+d*-S,T=v*-x+g*-E+w*-S,M=y*x+m*E+p*S;return n(r)?(r[0]=u,r[1]=v,r[2]=-y,r[3]=0,r[4]=s,r[5]=g,r[6]=-m,r[7]=0,r[8]=d,r[9]=w,r[10]=-p,r[11]=0,r[12]=O,r[13]=T,r[14]=M,r[15]=1,r):new c(u,s,d,O,v,g,w,T,-y,-m,-p,M,0,0,0,1)},c.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},c.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},c.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},c.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},c.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,y=f,m=a+c,p=o+l,v=t+f,g=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]=y,i[11]=0,i[12]=m,i[13]=p,i[14]=v,i[15]=g,i},c.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]]},c.getElementIndex=function(e,t){return 4*e+t},c.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},c.setColumn=function(e,t,r,n){n=c.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},c.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},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 d=new e;c.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 y=new e;c.getMaximumScale=function(t){return c.getScale(t,y),e.maximumComponent(y)},c.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],y=e[11],m=e[12],p=e[13],v=e[14],g=e[15],w=t[0],x=t[1],E=t[2],S=t[3],O=t[4],T=t[5],M=t[6],b=t[7],N=t[8],_=t[9],P=t[10],A=t[11],I=t[12],z=t[13],C=t[14],R=t[15],D=n*w+u*x+f*E+m*S,L=i*w+s*x+h*E+p*S,U=a*w+c*x+d*E+v*S,q=o*w+l*x+y*E+g*S,B=n*O+u*T+f*M+m*b,F=i*O+s*T+h*M+p*b,W=a*O+c*T+d*M+v*b,G=o*O+l*T+y*M+g*b,V=n*N+u*_+f*P+m*A,Y=i*N+s*_+h*P+p*A,j=a*N+c*_+d*P+v*A,k=o*N+l*_+y*P+g*A,H=n*I+u*z+f*C+m*R,Z=i*I+s*z+h*C+p*R,X=a*I+c*z+d*C+v*R,J=o*I+l*z+y*C+g*R;return r[0]=D,r[1]=L,r[2]=U,r[3]=q,r[4]=B,r[5]=F,r[6]=W,r[7]=G,r[8]=V,r[9]=Y,r[10]=j,r[11]=k,r[12]=H,r[13]=Z,r[14]=X,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],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],y=e[14],m=t[0],p=t[1],v=t[2],g=t[4],w=t[5],x=t[6],E=t[8],S=t[9],O=t[10],T=t[12],M=t[13],b=t[14],N=n*m+o*p+c*v,_=i*m+u*p+l*v,P=a*m+s*p+f*v,A=n*g+o*w+c*x,I=i*g+u*w+l*x,z=a*g+s*w+f*x,C=n*E+o*S+c*O,R=i*E+u*S+l*O,D=a*E+s*S+f*O,L=n*T+o*M+c*b+h,U=i*T+u*M+l*b+d,q=a*T+s*M+f*b+y;return r[0]=N,r[1]=_,r[2]=P,r[3]=0,r[4]=A,r[5]=I,r[6]=z,r[7]=0,r[8]=C,r[9]=R,r[10]=D,r[11]=0,r[12]=L,r[13]=U,r[14]=q,r[15]=1,r},c.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 m=new e;c.multiplyByUniformScale=function(e,t,r){return m.x=t,m.y=t,m.z=t,c.multiplyByScale(e,m,r)},c.multiplyByScale=function(e,t,r){var n=t.x,i=t.y,a=t.z;return 1===n&&1===i&&1===a?c.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)},c.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},c.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},c.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},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],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},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||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]&&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]},c.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},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 p=new u,v=new u,g=new t,w=new t(0,0,0,1);return c.inverse=function(e,r){if(u.equalsEpsilon(c.getRotation(e,p),v,o.EPSILON7)&&t.equals(c.getRow(e,3,g),w))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],l=e[12],f=e[1],h=e[5],d=e[9],y=e[13],m=e[2],x=e[6],E=e[10],S=e[14],O=e[3],T=e[7],M=e[11],b=e[15],N=E*b,_=S*M,P=x*b,A=S*T,I=x*M,z=E*T,C=m*b,R=S*O,D=m*M,L=E*O,U=m*T,q=x*O,B=N*h+A*d+I*y-(_*h+P*d+z*y),F=_*f+C*d+L*y-(N*f+R*d+D*y),W=P*f+R*h+U*y-(A*f+C*h+q*y),G=z*f+D*h+q*d-(I*f+L*h+U*d),V=_*i+P*a+z*l-(N*i+A*a+I*l),Y=N*n+R*a+D*l-(_*n+C*a+L*l),j=A*n+C*i+q*l-(P*n+R*i+U*l),k=I*n+L*i+U*a-(z*n+D*i+q*a);N=a*y,_=l*d,P=i*y,A=l*h,I=i*d,z=a*h,C=n*y,R=l*f,D=n*d,L=a*f,U=n*h,q=i*f;var H=N*T+A*M+I*b-(_*T+P*M+z*b),Z=_*O+C*M+L*b-(N*O+R*M+D*b),X=P*O+R*T+U*b-(A*O+C*T+q*b),J=z*O+D*T+q*M-(I*O+L*T+U*M),K=P*E+z*S+_*x-(I*S+N*x+A*E),Q=D*S+N*m+R*E-(C*E+L*S+_*m),$=C*x+q*S+A*m-(U*S+P*m+R*x),et=U*E+I*m+L*x-(D*x+q*E+z*m),tt=n*B+i*F+a*W+l*G;if(Math.abs(tt)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return tt=1/tt,r[0]=B*tt,r[1]=F*tt,r[2]=W*tt,r[3]=G*tt,r[4]=V*tt,r[5]=Y*tt,r[6]=j*tt,r[7]=k*tt,r[8]=H*tt,r[9]=Z*tt,r[10]=X*tt,r[11]=J*tt,r[12]=K*tt,r[13]=Q*tt,r[14]=$*tt,r[15]=et*tt,r},c.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],y=-r*f-n*h-i*d,m=-a*f-o*h-u*d,p=-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]=y,t[13]=m,t[14]=p,t[15]=1,t},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[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/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,r,n,i,a,o,u,s,c,l){"use strict";var f=function(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)},h=new e,d=new e,y=new e,m=new e,p=new e,v=new e,g=new e,w=new e,x=new e,E=new e,S=new e,O=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 i=e.clone(t[0],g),a=e.clone(i,h),o=e.clone(i,d),u=e.clone(i,y),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,v),T=t.length,M=1;T>M;M++){e.clone(t[M],i);var b=i.x,N=i.y,_=i.z;b<a.x&&e.clone(i,a),b>s.x&&e.clone(i,s),N<o.y&&e.clone(i,o),N>c.y&&e.clone(i,c),_<u.z&&e.clone(i,u),_>l.z&&e.clone(i,l)}var P=e.magnitudeSquared(e.subtract(s,a,w)),A=e.magnitudeSquared(e.subtract(c,o,w)),I=e.magnitudeSquared(e.subtract(l,u,w)),z=a,C=s,R=P;A>R&&(R=A,z=o,C=c),I>R&&(R=I,z=u,C=l);var D=x;D.x=.5*(z.x+C.x),D.y=.5*(z.y+C.y),D.z=.5*(z.z+C.z);var L=e.magnitudeSquared(e.subtract(C,D,w)),U=Math.sqrt(L),q=E;q.x=a.x,q.y=o.y,q.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var F=e.multiplyByScalar(e.add(q,B,w),.5,O),W=0;for(M=0;T>M;M++){e.clone(t[M],i);var G=e.magnitude(e.subtract(i,F,w));G>W&&(W=G);var V=e.magnitudeSquared(e.subtract(i,D,w));if(V>L){var Y=Math.sqrt(V);U=.5*(U+Y),L=U*U;var j=Y-U;D.x=(U*D.x+j*i.x)/Y,D.y=(U*D.y+j*i.y)/Y,D.z=(U*D.z+j*i.z)/Y}}return W>U?(e.clone(D,r.center),r.radius=U):(e.clone(F,r.center),r.radius=W),r};var T=new o,M=new e,b=new e,N=new t,_=new t;f.fromRectangle2D=function(e,t,r){return f.fromRectangleWithHeights2D(e,t,0,0,r)},f.fromRectangleWithHeights2D=function(t,i,a,o,u){if(n(u)||(u=new f),!n(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=r(i,T),l.southwest(t,N),N.height=a,l.northeast(t,_),_.height=o;var s=i.project(N,M),c=i.project(_,b),h=c.x-s.x,d=c.y-s.y,y=c.z-s.z;u.radius=.5*Math.sqrt(h*h+d*d+y*y);var m=u.center;return m.x=s.x+.5*h,m.y=s.y+.5*d,m.z=s.z+.5*y,u};var P=[];f.fromRectangle3D=function(e,t,i,o){t=r(t,a.WGS84),i=r(i,0);var u;return n(e)&&(u=l.subsample(e,t,i,P)),f.fromPoints(u,o)},f.fromVertices=function(t,i,a,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;i=r(i,e.ZERO),a=r(a,3);var u=g;u.x=t[0]+i.x,u.y=t[1]+i.y,u.z=t[2]+i.z;for(var s=e.clone(u,h),c=e.clone(u,d),l=e.clone(u,y),T=e.clone(u,m),M=e.clone(u,p),b=e.clone(u,v),N=t.length,_=0;N>_;_+=a){var P=t[_]+i.x,A=t[_+1]+i.y,I=t[_+2]+i.z;u.x=P,u.y=A,u.z=I,P<s.x&&e.clone(u,s),P>T.x&&e.clone(u,T),A<c.y&&e.clone(u,c),A>M.y&&e.clone(u,M),I<l.z&&e.clone(u,l),I>b.z&&e.clone(u,b)}var z=e.magnitudeSquared(e.subtract(T,s,w)),C=e.magnitudeSquared(e.subtract(M,c,w)),R=e.magnitudeSquared(e.subtract(b,l,w)),D=s,L=T,U=z;C>U&&(U=C,D=c,L=M),R>U&&(U=R,D=l,L=b);var q=x;q.x=.5*(D.x+L.x),q.y=.5*(D.y+L.y),q.z=.5*(D.z+L.z);var B=e.magnitudeSquared(e.subtract(L,q,w)),F=Math.sqrt(B),W=E;W.x=s.x,W.y=c.y,W.z=l.z;var G=S;G.x=T.x,G.y=M.y,G.z=b.z;var V=e.multiplyByScalar(e.add(W,G,w),.5,O),Y=0;for(_=0;N>_;_+=a){u.x=t[_]+i.x,u.y=t[_+1]+i.y,u.z=t[_+2]+i.z;var j=e.magnitude(e.subtract(u,V,w));j>Y&&(Y=j);var k=e.magnitudeSquared(e.subtract(u,q,w));if(k>B){var H=Math.sqrt(k);F=.5*(F+H),B=F*F;var Z=H-F;q.x=(F*q.x+Z*u.x)/H,q.y=(F*q.y+Z*u.y)/H,q.z=(F*q.z+Z*u.z)/H}}return Y>F?(e.clone(q,o.center),o.radius=F):(e.clone(V,o.center),o.radius=Y),o},f.fromCornerPoints=function(t,r,i){n(i)||(i=new f);var a=i.center;return e.add(t,r,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,r),i},f.fromEllipsoid=function(t,r){return n(r)||(r=new f),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r},f.clone=function(t,r){return n(t)?n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius):void 0},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var i=e.center;t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius},f.unpack=function(e,t,i){t=r(t,0),n(i)||(i=new f);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var A=new e,I=new e;f.union=function(t,r,i){n(i)||(i=new f);var a=t.center,o=r.center;e.add(a,o,I);var u=e.multiplyByScalar(I,.5,I),s=e.magnitude(e.subtract(a,u,A))+t.radius,c=e.magnitude(e.subtract(o,u,A))+r.radius;return i.radius=Math.max(s,c),e.clone(u,i.center),i};var z=new e;f.expand=function(t,r,n){n=f.clone(t,n);var i=e.magnitude(e.subtract(r,n.center,z));return i>n.radius&&(n.radius=i),n},f.intersect=function(t,r){var n=t.center,i=t.radius,a=e.dot(r,n)+r.w;return-i>a?u.OUTSIDE:i>a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=c.getMaximumScale(t)*e.radius,r};var C=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,C);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var R=new e;f.computePlaneDistances=function(t,r,i,a){n(a)||(a=new s);var o=e.subtract(t.center,r,R),u=e.multiplyByScalar(i,e.dot(i,o),R),c=e.magnitude(u);return a.start=c-t.radius,a.stop=c+t.radius,a};for(var D=new e,L=new e,U=new e,q=new e,B=new e,F=new t,W=new Array(8),G=0;8>G;++G)W[G]=new e;var V=new o;return f.projectTo2D=function(t,n,i){n=r(n,V);var a=n.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,D),c=e.cross(e.UNIT_Z,s,L);e.normalize(c,c);var l=e.cross(s,c,U);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var h=e.negate(l,B),d=e.negate(c,q),y=W,m=y[0];e.add(s,l,m),e.add(m,c,m),m=y[1],e.add(s,l,m),e.add(m,d,m),m=y[2],e.add(s,h,m),e.add(m,d,m),m=y[3],e.add(s,h,m),e.add(m,c,m),e.negate(s,s),m=y[4],e.add(s,l,m),e.add(m,c,m),m=y[5],e.add(s,l,m),e.add(m,d,m),m=y[6],e.add(s,h,m),e.add(m,d,m),m=y[7],e.add(s,h,m),e.add(m,c,m);for(var p=y.length,v=0;p>v;++v){var g=y[v];e.add(o,g,g);var w=a.cartesianToCartographic(g,F);n.project(w,g)}i=f.fromPoints(y,i),o=i.center;var x=o.x,E=o.y,S=o.z;return o.x=S,o.y=x,o.z=E,i},f.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersect=function(e){return f.intersect(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){return i.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++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",e(document[i])?n.fullscreenEnabled=i:(i=s+"FullScreenEnabled",e(document[i])&&(n.fullscreenEnabled=i)),i=s+"FullscreenElement",e(document[i])?n.fullscreenElement=i:(i=s+"FullScreenElement",e(document[i])&&(n.fullscreenElement=i)),i=s+"fullscreenchange",e(document["on"+i])&&("ms"===s&&(i="MSFullscreenChange"),n.fullscreenchange=i),i=s+"fullscreenerror",e(document["on"+i])&&("ms"===s&&(i="MSFullscreenError"),n.fullscreenerror=i)}return r},i.requestFullscreen=function(e){i.supportsFullscreen()&&e[n.requestFullscreen]()},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;n>r;++r)t[r]=parseInt(t[r],10);return t}function i(){if(!t(y)){y=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(y=!0,m=n(e[1]))}return y}function a(){return i()&&m}function o(){if(!t(p)&&(p=!1,!i()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(p=!0,v=n(e[1]))}return p}function u(){return o()&&v}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(g=!0,w=n(e[1]),w.isNightly=!!e[2])}return g}function c(){return s()&&w}function l(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=n(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=n(e[1])))}return x}function f(){return l()&&E}function h(){if(!t(S)){S=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(S=!0,O=n(e[1]))}return S}function d(){return h()&&O}var y,m,p,v,g,w,x,E,S,O,T={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:d,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};return T.supportsFullscreen=function(){return r.supportsFullscreen()},T.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},T.supportsWebWorkers=function(){return"undefined"!=typeof Worker},T}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,r,n,i){"use strict";if(!n.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return t(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(t,n,i,o){switch(i=e(i,0),o=e(o,(n.byteLength-i)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(n,i,o);case a.UNSIGNED_BYTE:return new Uint8Array(n,i,o);case a.SHORT:return new Int16Array(n,i,o);case a.UNSIGNED_SHORT:return new Uint16Array(n,i,o);case a.FLOAT:return new Float32Array(n,i,o);case a.DOUBLE:return new Float64Array(n,i,o);default:throw new r("componentDatatype is not a valid value.")}},i(a)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,r,n,i){"use strict";var a=function(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;f>h;h++){var d=t[h],y=d.x,m=d.y,p=d.z;i=Math.min(y,i),s=Math.max(y,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(p,u),l=Math.max(p,l)}var v=n.minimum;v.x=i,v.y=o,v.z=u;var g=n.maximum;g.x=s,g.y=c,g.z=l;var w=e.add(v,g,n.center);return e.multiplyByScalar(w,.5,w),n},a.clone=function(t,n){return r(t)?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):void 0},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.intersect=function(t,r){o=e.subtract(t.maximum,t.minimum,o);var n=e.multiplyByScalar(o,.5,o),a=n.x*Math.abs(r.x)+n.y*Math.abs(r.y)+n.z*Math.abs(r.z),u=e.dot(t.center,r)+r.w;return u-a>0?i.INSIDE:0>u+a?i.OUTSIDE:i.INTERSECTING},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.intersect=function(e){return a.intersect(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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(a=-i/e,0>a)return[];var s=Math.sqrt(a);return[-s,s]}if(0===i)return a=-n/e,0>a?[a,0]:[0,a];var c=n*n,l=4*e*i,f=r(c,-l,t.EPSILON14);if(0>f)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,y=o*s-h,m=o*c-u*s,p=u*c-d,v=4*y*p-m*m;if(0>v){var g,w,x;h*f>=l*d?(g=o,w=y,x=-2*u*y+o*m):(g=c,w=p,x=-c*m+2*s*p);var E=0>x?-1:1,S=-E*Math.abs(g)*Math.sqrt(-v);a=-x+S;var O=a/2,T=0>O?-Math.pow(-O,1/3):Math.pow(O,1/3),M=a===S?-T:-w/T;return i=0>=w?T+M:-x/(T*T+M*M+w),h*f>=l*d?[(i-u)/o]:[-c/(i+s)]}var b=y,N=-2*u*y+o*m,_=p,P=-c*m+2*s*p,A=Math.sqrt(v),I=Math.sqrt(3)/2,z=Math.abs(Math.atan2(o*A,-N)/3);i=2*Math.sqrt(-b);var C=Math.cos(z);a=i*C;var R=i*(-C/2-I*Math.sin(z)),D=a+R>2*u?a-u:R-u,L=o,U=D/L;z=Math.abs(Math.atan2(c*A,-P)/3),i=2*Math.sqrt(-_),C=Math.cos(z),a=i*C,R=i*(-C/2-I*Math.sin(z));var q=-c,B=2*s>a+R?a+s:R+s,F=q/B,W=L*B,G=-D*B-L*q,V=D*q,Y=(s*G-u*V)/(-u*G+s*W);return Y>=U?F>=U?F>=Y?[U,Y,F]:[U,F,Y]:[F,U,Y]:F>=U?[Y,U,F]:F>=Y?[Y,F,U]:[F,Y,U]}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=0>u?-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,0>u?[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 y=n.computeRealRoots(1,s,l);if(2===y.length){var m,p=y[0],v=y[1];if(p>=0&&v>=0){var g=Math.sqrt(p),w=Math.sqrt(v);return[h-w,h-g,h+g,h+w]}if(p>=0&&0>v)return m=Math.sqrt(p),[h-m,h+m];if(0>p&&v>=0)return m=Math.sqrt(v),[h-m,h+m]}return[]}if(d>0){var x=Math.sqrt(d),E=(s+d-c/x)/2,S=(s+d+c/x)/2,O=n.computeRealRoots(1,x,E),T=n.computeRealRoots(1,-x,S); -return 0!==O.length?(O[0]+=h,O[1]+=h,0!==T.length?(T[0]+=h,T[1]+=h,O[1]<=T[0]?[O[0],O[1],T[0],T[1]]:T[1]<=O[0]?[T[0],T[1],O[0],O[1]]:O[0]>=T[0]&&O[1]<=T[1]?[T[0],O[0],O[1],T[1]]:T[0]>=O[0]&&T[1]<=O[1]?[O[0],T[0],T[1],O[1]]:O[0]>T[0]&&O[0]<T[1]?[T[0],O[0],T[1],O[1]]:[O[0],T[0],O[1],T[1]]):O):0!==T.length?(T[0]+=h,T[1]+=h,T):[]}}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 y,m,p=d[0],v=i-p,g=v*v,w=t/2,x=v/2,E=g-4*o,S=g+4*Math.abs(o),O=c-4*p,T=c+4*Math.abs(p);if(0>p||O*S>E*T){var M=Math.sqrt(O);y=M/2,m=0===M?0:(t*x-a)/M}else{var b=Math.sqrt(E);y=0===b?0:(t*x-a)/b,m=b/2}var N,_;0===w&&0===y?(N=0,_=0):r.sign(w)===r.sign(y)?(N=w+y,_=p/N):(_=w-y,N=p/_);var P,A;0===x&&0===m?(P=0,A=0):r.sign(x)===r.sign(m)?(P=x+m,A=o/P):(A=x-m,P=o/A);var I=n.computeRealRoots(1,N,P),z=n.computeRealRoots(1,_,A);if(0!==I.length)return 0!==z.length?I[1]<=z[0]?[I[0],I[1],z[0],z[1]]:z[1]<=I[0]?[z[0],z[1],I[0],I[1]]:I[0]>=z[0]&&I[1]<=z[1]?[z[0],I[0],I[1],z[1]]:z[0]>=I[0]&&z[1]<=I[1]?[I[0],z[0],z[1],I[1]]:I[0]>z[0]&&I[0]<z[1]?[z[0],I[0],z[1],I[1]]:[I[0],z[0],I[1],z[1]]:I;if(0!==z.length)return z}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,y=d*i,m=u*c*f-4*s*h-4*e*l*f+18*e*t*r*h-27*a*f*f+256*o*y+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 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,h=s/t,d=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>f?d+1:d,d+=0>h?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 void 0}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=function(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n};return n.getPoint=function(t,n,i){return r(i)||(i=new e),i=e.multiplyByScalar(t.direction,n,i),e.add(t.origin,i,i)},n}),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(t,n,i,o,u){u=r(u,!1);var s,c,l,f,h,d=t.origin,y=t.direction,m=e.subtract(i,n,p),E=e.subtract(o,n,v),S=e.cross(y,E,g),O=e.dot(m,S);if(u){if(O<a.EPSILON6)return void 0;if(s=e.subtract(d,n,w),l=e.dot(s,S),0>l||l>O)return void 0;if(c=e.cross(s,m,x),f=e.dot(y,c),0>f||l+f>O)return void 0;h=e.dot(E,c)/O}else{if(Math.abs(O)<a.EPSILON6)return void 0;var T=1/O;if(s=e.subtract(d,n,w),l=e.dot(s,S)*T,0>l||l>1)return void 0;if(c=e.cross(s,m,x),f=e.dot(y,c)*T,0>f||l+f>1)return void 0;h=e.dot(E,c)*T}return h}function f(e,t,r,n){var i=t*t-4*e*r;if(0>i)return void 0;if(i>0){var a=1/(2*e),o=Math.sqrt(i),u=(-t+o)*a,s=(-t-o)*a;return s>u?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);return 0===c?void 0:(n.root0=n.root1=c,n)}function h(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,g),l=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,y=f(l,h,d,S);return n(y)?(i.start=y.root0,i.stop=y.root1,i):void 0}function d(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 y(t,r,n,i,c){var l,f=i*i,h=c*c,y=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,m=c*(i*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],a.EPSILON15)+r.y),p=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*h+i*r.x+n,v=h*d(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],a.EPSILON15),g=c*(i*d(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+r.z),w=[];if(0===g&&0===v){if(l=u.computeRealRoots(y,m,p),0===l.length)return w;var x=l[0],E=Math.sqrt(Math.max(1-x*x,0));if(w.push(new e(i,c*x,c*-E)),w.push(new e(i,c*x,c*E)),2===l.length){var S=l[1],O=Math.sqrt(Math.max(1-S*S,0));w.push(new e(i,c*S,c*-O)),w.push(new e(i,c*S,c*O))}return w}var T=g*g,M=v*v,b=y*y,N=g*v,_=b+M,P=2*(m*y+N),A=2*p*y+m*m-M+T,I=2*(p*m-N),z=p*p-T;if(0===_&&0===P&&0===A&&0===I)return w;l=s.computeRealRoots(_,P,A,I,z);var C=l.length;if(0===C)return w;for(var R=0;C>R;++R){var D,L=l[R],U=L*L,q=Math.max(1-U,0),B=Math.sqrt(q);D=a.sign(y)===a.sign(p)?d(y*U+p,m*L,a.EPSILON12):a.sign(p)===a.sign(m*L)?d(y*U,m*L+p,a.EPSILON12):d(y*U+m*L,p,a.EPSILON12);var F=d(v*L,g,a.EPSILON15),W=D*F;0>W?w.push(new e(i,c*L,c*B)):W>0?w.push(new e(i,c*L,c*-B)):0!==B?(w.push(new e(i,c*L,c*-B)),w.push(new e(i,c*L,c*B)),++R):w.push(new e(i,c*L,c*B))}return w}var m={};m.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)return void 0;var l=(-r.distance-e.dot(s,o))/c;return 0>l?void 0:(i=e.multiplyByScalar(u,l,i),e.add(o,i,i))};var p=new e,v=new e,g=new e,w=new e,x=new e;m.rayTriangle=function(t,r,i,a,o,u){var s=l(t,r,i,a,o);return!n(s)||0>s?void 0:(n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u))};var E=new c;m.lineSegmentTriangle=function(t,r,i,a,o,u,s){var c=E;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var f=l(c,i,a,o,u);return!n(f)||0>f||f>e.distance(t,r)?void 0:(n(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var S={root0:0,root1:0};m.raySphere=function(e,t,r){return r=h(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var O=new c;m.lineSegmentSphere=function(t,r,i,a){var o=O;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),a=h(o,i,a),!n(a)||a.stop<0||a.start>s?void 0:(a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a)};var T=new e,M=new e;m.rayEllipsoid=function(t,r){var n,i,a,o,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,T),l=e.multiplyComponents(s,t.direction,M),f=e.magnitudeSquared(c),h=e.dot(c,l);if(f>1){if(h>=0)return void 0;var d=h*h;if(n=f-1,i=e.magnitudeSquared(l),a=i*n,a>d)return void 0;if(d>a){o=h*h-a,u=-h+Math.sqrt(o);var y=u/i,m=n/u;return m>y?{start:y,stop:m}:{start:m,stop:y}}var p=Math.sqrt(n/i);return{start:p,stop:p}}return 1>f?(n=f-1,i=e.magnitudeSquared(l),a=i*n,o=h*h-a,u=-h+Math.sqrt(o),{start:0,stop:u/i}):0>h?(i=e.magnitudeSquared(l),{start:0,stop:-h/i}):void 0};var b=new e,N=new e,_=new e,P=new e,A=new e,I=new o,z=new o,C=new o,R=new o,D=new o,L=new o,U=new o,q=new e,B=new e,F=new t;m.grazingAltitudeLocation=function(t,r){var i=t.origin,u=t.direction,s=r.geodeticSurfaceNormal(i);if(e.dot(u,s)>=0)return i;var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u),f=e.normalize(l,b),h=e.mostOrthogonalAxis(l,P),d=e.normalize(e.cross(h,f,N),N),m=e.normalize(e.cross(f,d,_),_),p=I;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 v=o.transpose(p,z),g=o.fromScale(r.radii,C),w=o.fromScale(r.oneOverRadii,R),x=D;x[0]=0,x[1]=-u.z,x[2]=u.y,x[3]=u.z,x[4]=0,x[5]=-u.x,x[6]=-u.y,x[7]=u.x,x[8]=0;var E,S,O=o.multiply(o.multiply(v,w,L),x,L),T=o.multiply(o.multiply(O,g,U),p,U),M=o.multiplyByVector(O,i,A),W=y(T,e.negate(M,b),0,0,1),G=W.length;if(G>0){for(var V=e.clone(e.ZERO,B),Y=Number.NEGATIVE_INFINITY,j=0;G>j;++j){E=o.multiplyByVector(g,o.multiplyByVector(p,W[j],q),q);var k=e.normalize(e.subtract(E,i,P),P),H=e.dot(k,u);H>Y&&(Y=H,V=e.clone(E,V))}var Z=r.cartesianToCartographic(V,F);return Y=a.clamp(Y,0,1),S=e.magnitude(e.subtract(V,i,P))*Math.sqrt(1-Y*Y),S=c?-S:S,Z.height=S,r.cartographicToCartesian(Z)}return void 0};var W=new e;return m.lineSegmentPlane=function(t,r,i,o){n(o)||(o=new e);var u=e.subtract(r,t,W),s=i.normal,c=e.dot(s,u);if(Math.abs(c)<a.EPSILON6)return void 0;var l=e.dot(s,t),f=-(i.distance+l)/c;return 0>f||f>1?void 0:(e.multiplyByScalar(u,f,o),e.add(t,o,o),o)},m.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 m.lineSegmentPlane(t,r,i,f),m.lineSegmentPlane(t,n,i,h),{positions:[t,r,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(r,n,i,f),m.lineSegmentPlane(r,t,i,h),{positions:[t,r,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(n,t,i,f),m.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 m.lineSegmentPlane(r,t,i,f),m.lineSegmentPlane(n,t,i,h),{positions:[t,r,n,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(n,r,i,f),m.lineSegmentPlane(t,r,i,h),{positions:[t,r,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,n,i,f),m.lineSegmentPlane(r,n,i,h),{positions:[t,r,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(t,r){this.normal=e.clone(t),this.distance=r};return r.fromPointNormal=function(n,i,a){var o=-e.dot(i,n);return t(a)?(e.clone(i,a.normal),a.distance=o,a):new r(i,o)},r.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},r}),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(n){return a(n)}});return r}function a(e){var r=new n(function(r,n){try{return n?t(n(e)):a(e)}catch(i){return a(i)}});return r}function o(){function e(e,t,r){return h(e,t,r)}function r(e){return y(e)}function i(e){return y(a(e))}function u(e){return d(e)}var s,c,l,f,h,d,y;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(t){n.progress(t)}}: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 m(f,e),e},y=function(e){return e=t(e),h=e.then,y=t,d=v,m(l,e),f=l=E,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,r,n,i,a){return p(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){y(e)}var c,l,f,h,d,y,m,p,g,w;if(g=t.length>>>0,c=Math.max(0,Math.min(r,g)),f=[],l=g-c+1,h=[],d=o(),c)for(p=d.progress,m=function(e){h.push(e),--l||(y=m=v,d.reject(h))},y=function(e){f.push(e),--c||(y=m=v,d.resolve(f))},w=0;g>w;++w)w in t&&e(t[w],s,u,p);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 p(1,arguments),h(e,g).then(t,r,n)}function f(){return h(arguments,g)}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;i>s;s++)s in t?u(t[s],s):--a;else c.resolve(n);return c.promise})}function d(t,r){var n=x.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)})})},w.apply(t,n)})}function y(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 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 v(){}function g(e){return e}var w,x,E;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=y,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(E,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(E,t)})})}},x=[].slice,w=[].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(;i>a;++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/binarySearch",["./defined","./DeveloperError"],function(){"use strict";var e=function(e,t,r){for(var n,i,a=0,o=e.length-1;o>=a;)if(n=~~((a+o)/2),i=r(e[n],t),0>i)a=n+1;else{if(!(i>0))return n;o=n-1}return~(o+1)};return e}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";var e=function(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,y,m,p,v;if("%%"==e)return"%";for(var g=!1,w="",x=!1,E=!1,S=" ",O=s.length,T=0;s&&O>T;T++)switch(s.charAt(T)){case" ":w=" ";break;case"+":w="+";break;case"-":g=!0;break;case"'":S=s.charAt(T+1);break;case"0":x=!0;break;case"#":E=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(c=-c,g=!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,v=n?t[n.slice(0,-1)]:t[r++],h){case"s":return u(String(v),g,c,f,x,S);case"c":return u(String.fromCharCode(+v),g,c,f,x);case"b":return o(v,2,E,g,c,f,x);case"o":return o(v,8,E,g,c,f,x);case"x":return o(v,16,E,g,c,f,x);case"X":return o(v,16,E,g,c,f,x).toUpperCase();case"u":return o(v,10,E,g,c,f,x);case"i":case"d":return d=+v||0,d=Math.round(d-d%1),y=0>d?"-":w,v=y+i(String(Math.abs(d)),f,"0",!1),a(v,y,g,c,x);case"e":case"E":case"f":case"F":case"g":case"G":return d=+v,y=0>d?"-":w,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],v=y+Math.abs(d)[m](f),a(v,y,g,c,x)[p]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";var e=function(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(){"use strict";function e(e){return 0===e%4&&0!==e%100||0===e%400}return e}),define("Core/LeapSecond",[],function(){"use strict";var e=function(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){g.julianDate=e;var r=P.leapSeconds,n=t(r,g,l);0>n&&(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){g.julianDate=e;var n=P.leapSeconds,i=t(n,g,l);if(0>i&&(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):1>=a?void 0:P.addSeconds(e,-n[--i].offset,r)}function d(e,t,r){var n=0|t/s.SECONDS_PER_DAY;return e+=n,t-=s.SECONDS_PER_DAY*n,0>t&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function y(e,t,r,n,i,a,o){var u=0|(t-14)/12,c=e+4800+u,l=(0|1461*c/4)+(0|367*(t-2-12*u)/12)-(0|3*((c+100)/100)/4)+r-32075;n-=12,0>n&&(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]}var m=new a,p=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,g=new u,w=/^(\d{4})$/,x=/^(\d{4})-(\d{2})$/,E=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,O=/^(\d{4})-?(\d{2})-?(\d{2})$/,T=/([Z+\-])?(\d{2})?:?(\d{2})?$/,M=/^(\d{2})(\.\d+)?/.source+T.source,b=/^(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,N=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,_="Invalid ISO 8601 date.",P=function(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)};P.fromDate=function(e,t){var r=y(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,a,u,s=e.split("T"),l=1,h=1,m=0,g=0,T=0,A=0,I=s[0],z=s[1];if(!n(I))throw new i(_);var C;if(s=I.match(O),null!==s){if(C=I.split("-").length-1,C>0&&2!==C)throw new i(_);r=+s[1],l=+s[2],h=+s[3]}else if(s=I.match(x),null!==s)r=+s[1],l=+s[2];else if(s=I.match(w),null!==s)r=+s[1];else{var R;if(s=I.match(E),null!==s){if(r=+s[1],R=+s[2],u=o(r),1>R||u&&R>366||!u&&R>365)throw new i(_)}else{if(s=I.match(S),null===s)throw new i(_);r=+s[1];var D=+s[2],L=+s[3]||0;if(C=I.split("-").length-1,C>0&&(!n(s[3])&&1!==C||n(s[3])&&2!==C))throw new i(_);var U=new Date(Date.UTC(r,0,4));R=7*D+L-U.getUTCDay()-3}a=new Date(Date.UTC(r,0,1)),a.setUTCDate(R),l=a.getUTCMonth()+1,h=a.getUTCDate()}if(u=o(r),1>l||l>12||1>h||(2!==l||!u)&&h>p[l-1]||u&&2===l&&h>v)throw new i(_);var q;if(n(z)){if(s=z.match(N),null!==s){if(C=z.split(":").length-1,C>0&&2!==C&&3!==C)throw new i(_);m=+s[1],g=+s[2],T=+s[3],A=1e3*+(s[4]||0),q=5}else if(s=z.match(b),null!==s){if(C=z.split(":").length-1,C>0&&1!==C)throw new i(_);m=+s[1],g=+s[2],T=60*+(s[3]||0),q=4}else{if(s=z.match(M),null===s)throw new i(_);m=+s[1],g=60*+(s[2]||0),q=3}if(g>=60||T>=61||m>24||24===m&&(g>0||T>0||A>0))throw new i(_);var B=s[q],F=+s[q+1],W=+(s[q+2]||0);switch(B){case"+":m-=F,g-=W;break;case"-":m+=F,g+=W;break;case"Z":break;default:g+=new Date(Date.UTC(r,l-1,h,m,g)).getTimezoneOffset()}}else g+=new Date(Date.UTC(r,l-1,h)).getTimezoneOffset();var G=60===T;for(G&&T--;g>=60;)g-=60,m++;for(;m>=24;)m-=24,h++;for(a=u&&2===l?v:p[l-1];h>a;)h-=a,l++,l>12&&(l-=12,r++),a=u&&2===l?v:p[l-1];for(;0>g;)g+=60,m--;for(;0>m;)m+=24,h--;for(;1>h;)l--,1>l&&(l+=12,r--),a=u&&2===l?v:p[l-1],h+=a;var V=y(r,l,h,m,g,T,A);return n(t)?(d(V[0],V[1],t),f(t)):t=new P(V[0],V[1],c.UTC),G&&P.addSeconds(t,1,t),t},P.now=function(e){return P.fromDate(new Date,e)};var A=new P(0,0,c.TAI);return P.toGregorianDate=function(e,t){var r=!1,i=h(e,A);n(i)||(P.addSeconds(e,-1,A),i=h(A,A),r=!0);var o=i.dayNumber,u=i.secondsOfDay;u>=43200&&(o+=1);var c=0|o+68569,l=0|4*c/146097;c=0|c-(0|(146097*l+3)/4);var f=0|4e3*(c+1)/1461001;c=0|c-(0|1461*f/4)+31;var d=0|80*c/2447,y=0|c-(0|2447*d/80);c=0|d/11;var m=0|d+2-12*c,p=0|100*(l-49)+f+c,v=0|u/s.SECONDS_PER_HOUR,g=u-v*s.SECONDS_PER_HOUR,w=0|g/s.SECONDS_PER_MINUTE;g-=w*s.SECONDS_PER_MINUTE;var x=0|g,E=(g-x)/s.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),r&&(x+=1),n(t)?(t.year=p,t.month=m,t.day=y,t.hour=v,t.minute=w,t.second=x,t.millisecond=E,t.isLeapSecond=r,t):new a(p,m,y,v,w,x,E,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 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){return n(e)?n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new P(e.dayNumber,e.secondsOfDay,c.TAI):void 0},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){g.julianDate=e;var r=P.leapSeconds,n=t(r,g,l);return 0>n&&(n=~n,--n,0>n&&(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)],P}),define("Core/clone",["./defaultValue"],function(e){"use strict";var t=function(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";var e=function(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";var r=function(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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,r,n,i,a){"use strict";function o(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function u(e,t){for(var r=o(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 s(e,r){r=t(r,"");var i=e[1],a=!!e[2],s=e[3];switch(r){case"":case"text":return o(a,s);case"arraybuffer":return u(a,s);case"blob":var c=u(a,s);return new Blob([c],{type:i});case"document":var l=new DOMParser;return l.parseFromString(o(a,s),i);case"json":return JSON.parse(o(a,s));default:throw new n("Unhandled responseType: "+r)}}var c=function(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,i=t(r.method,"GET"),a=r.data,o=r.headers,u=r.overrideMimeType,s=r.withCredentials;return e(r.url,function(t){var r=e.defer();return c.load(t,n,i,a,o,r,u,s),r.promise})},l=/^data:(.*?)(;base64)?,(.*)$/;return c.load=function(e,t,n,o,u,c,f,h){var d=l.exec(e);if(null!==d)return c.resolve(s(d,t)),void 0;var y=new XMLHttpRequest;if(r(f)&&r(y.overrideMimeType)&&y.overrideMimeType(f),y.open(n,e,!0),r(u))for(var m in u)u.hasOwnProperty(m)&&y.setRequestHeader(m,u[m]);r(t)&&(y.responseType=t),r(h)&&(y.withCredentials=h),y.onload=function(){200===y.status?r(y.response)?c.resolve(y.response):r(y.responseXML)&&y.responseXML.hasChildNodes()?c.resolve(y.responseXML):r(y.responseText)?c.resolve(y.responseText):c.reject(new a("unknown XMLHttpRequest response type.")):c.reject(new i(y.status,y.response,y.getAllResponseHeaders()))},y.onerror=function(){c.reject(new i)},y.send(o)},c.defaultLoad=c.load,c}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";var r=function(r,n){return e({url:r,headers:t(n)?n.headers:void 0,overrideMimeType:t(n)?n.overrideMimeType:void 0,withCredentials:t(n)?n.withCredentials:void 0})};return r}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";var i={Accept:"application/json,*/*;q=0.01"},a=function(r,a){return t(a)||(a={}),t(a.headers)?t(a.headers.Accept)||(a.headers=e(a.headers),a.headers.Accept=i.Accept):a.headers=i,n(r,a).then(function(e){return JSON.parse(e)})};return a}),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(e,t){return o.compare(e.julianDate,t)}function d(e,r){if(!n(r.columnNames))return e._dataError="Error in loaded EOP data: The columnNames property is required.",void 0;if(!n(r.samples))return e._dataError="Error in loaded EOP data: The samples property is required.",void 0;var i=r.columnNames.indexOf("modifiedJulianDateUtc"),a=r.columnNames.indexOf("xPoleWanderRadians"),s=r.columnNames.indexOf("yPoleWanderRadians"),c=r.columnNames.indexOf("ut1MinusUtcSeconds"),d=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),y=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=r.columnNames.indexOf("taiMinusUtcSeconds");if(0>i||0>a||0>s||0>c||0>d||0>y||0>m)return e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns",void 0;var p=e._samples=r.samples,v=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=a,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=y,e._taiMinusUtcSecondsColumn=m,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var g,w=e._addNewLeapSeconds,x=0,E=p.length;E>x;x+=e._columnCount){var S=p[x+i],O=p[x+m],T=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,M=new o(T,O,f.TAI);if(v.push(M),w){if(O!==g&&n(g)){var b=o.leapSeconds,N=t(b,M,h);if(0>N){var _=new u(M,O);b.splice(~N,0,_)}}g=O}}}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 m(e,t,r){return t+e*(r-t)}function p(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],v=r[d+e._ut1MinusUtcSecondsColumn],g=v-p;if(g>.5||-.5>g){var w=r[h+e._taiMinusUtcSecondsColumn],x=r[d+e._taiMinusUtcSecondsColumn];w!==x&&(l.equals(n)?p=v:v-=x-w)}return u.xPoleWander=m(f,r[h+e._xPoleWanderRadiansColumn],r[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=m(f,r[h+e._yPoleWanderRadiansColumn],r[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=m(f,r[h+e._xCelestialPoleOffsetRadiansColumn],r[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=m(f,r[h+e._yCelestialPoleOffsetRadiansColumn],r[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=m(f,p,v),u}var v=function(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))d(this,t.data);else if(n(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:[]})};return v.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}}),v.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},v.prototype.compute=function(e,r){if(!n(this._samples)){if(n(this._dataError))throw new c(this._dataError);return void 0}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),y=!n(h),m=y||o.greaterThanOrEquals(h,e);if(d&&m)return s=u,!y&&h.equals(e)&&++s,l=s+1,p(this,a,this._samples,e,s,l,r),r}var v=t(a,e,o.compare,this._dateColumn);return v>=0?(v<a.length-1&&a[v+1].equals(e)&&++v,s=v,l=v):(l=~v,s=l-1,0>s&&(s=0)),this._lastIndex=s,p(this,a,this._samples,e,s,l,r),r},v}),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()):(r.path=t.authority&&""==t.path?"/"+this.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];for(n&&t.shift(),""==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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","require"],function(e,t,r,n){"use strict";function i(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;r>t;++t){var n=e[t].getAttribute("src"),i=f.exec(n);if(null!==i)return i[1]}return void 0}function a(){if(t(s))return s;var n;if(n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:i(),!t(n))throw new r("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return s=new e(n).resolve(new e(document.location.href))}function o(e){return n.toUrl("../"+e)}function u(t){return new e(t).resolve(a()).toString()}var s,c,l,f=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i,h=function(e){t(c)||(c=t(n.toUrl)?o:u),t(l)||(l=document.createElement("a"));var r=c(e);return l.href=r,l.href=l.href,l.href};return h._cesiumScriptRegex=f,h}),define("Core/Iau2006XysSample",[],function(){"use strict";var e=function(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,t,r){var n=f;return n.dayNumber=t,n.secondsOfDay=r,a.daysDifference(n,e._sampleZeroDateTT)}function c(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=3*i*r._samplesPerXysFile,u=0,s=n.length;s>u;++u)t[o+u]=n[u];a.resolve()}),a.promise}var l=function(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;t>=s;++s){n[s]=o,i[s]=s*this._stepSizeDays;for(var c=0;t>=c;++c)c!==s&&(n[s]*=s-c);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)},f=new a(0,0,u.TAI);return l.prototype.preload=function(t,r,n,i){var a=s(this,t,r),o=s(this,n,i),u=0|a/this._stepSizeDays-this._interpolationOrder/2;0>u&&(u=0);var l=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var f=0|u/this._samplesPerXysFile,h=0|l/this._samplesPerXysFile,d=[],y=f;h>=y;++y)d.push(c(this,y));return e.all(d)},l.prototype.computeXysRadians=function(e,t,r){var a=s(this,e,t);if(0>a)return void 0;var o=0|a/this._stepSizeDays;if(o>=this._totalSamples)return void 0;var u=this._interpolationOrder,l=o-(0|u/2);0>l&&(l=0);var f=l+u;f>=this._totalSamples&&(f=this._totalSamples-1,l=f-u,0>l&&(l=0));var h=!1,d=this._samples;if(n(d[3*l])||(c(this,0|l/this._samplesPerXysFile),h=!0),n(d[3*f])||(c(this,0|f/this._samplesPerXysFile),h=!0),h)return void 0;n(r)?(r.x=0,r.y=0,r.s=0):r=new i(0,0,0);var y,m,p=a-l*this._stepSizeDays,v=this._work,g=this._denominators,w=this._coef,x=this._xTable;for(y=0;u>=y;++y)v[y]=p-x[y];for(y=0;u>=y;++y){for(w[y]=1,m=0;u>=m;++m)m!==y&&(w[y]*=v[m]);w[y]*=g[y];var E=3*(l+y);r.x+=w[y]*d[E++],r.y+=w[y]*d[E++],r.s+=w[y]*d[E]}return r},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./TimeConstants"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,y,m,p){"use strict";var v={},g=new r,w=new r,x=new r;v.eastNorthUpToFixedFrame=function(e,t,n){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return a(n)?(n[0]=0,n[1]=1,n[2]=0,n[3]=0,n[4]=-o,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=o,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new m(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=g,s=w,l=x;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),a(n)?(n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=l.x,n[5]=l.y,n[6]=l.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 m(s.x,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var E=new r,S=new r,O=new r;v.northEastDownToFixedFrame=function(e,t,n){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return a(n)?(n[0]=-o,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]=-o,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new m(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=E,s=S,l=O;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),a(n)?(n[0]=l.x,n[1]=l.y,n[2]=l.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 m(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},v.northUpEastToFixedFrame=function(e,t,n){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return a(n)?(n[0]=-o,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=o,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 m(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=g,s=w,l=x;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),a(n)?(n[0]=l.x,n[1]=l.y,n[2]=l.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 m(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=24110.54841,M=8640184.812866,b=.093104,N=-62e-7,_=1.1772758384668e-19,P=72921158553e-15,A=d.TWO_PI/86400,I=new h;v.computeTemeToPseudoFixedMatrix=function(e,t){I=h.addSeconds(e,-h.computeTaiMinusUtc(e),I);var r,n=I.dayNumber,i=I.secondsOfDay,o=n-2451545;r=i>=43200?(o+.5)/p.DAYS_PER_JULIAN_CENTURY:(o-.5)/p.DAYS_PER_JULIAN_CENTURY;var u=T+r*(M+r*(b+r*N)),s=u*A%d.TWO_PI,c=P+_*(n-2451545.5),l=(i+.5*p.SECONDS_PER_DAY)%p.SECONDS_PER_DAY,f=s+c*l,m=Math.cos(f),v=Math.sin(f);return a(t)?(t[0]=m,t[1]=-v,t[2]=0,t[3]=v,t[4]=m,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(m,v,0,-v,m,0,0,0,1)},v.iau2006XysData=new l,v.earthOrientationParameters=u.NONE;var z=32.184,C=2451545;v.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+z,i=t.stop.dayNumber,a=t.stop.secondsOfDay+z,o=v.iau2006XysData.preload(r,n,i,a),u=v.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},v.computeIcrfToFixedMatrix=function(e,t){a(t)||(t=new y);var r=v.computeFixedToIcrfMatrix(e,t);return a(r)?y.transpose(r,t):void 0};var R=new f(0,0,0),D=new s(0,0,0,0,0,0),L=new y,U=new y;v.computeFixedToIcrfMatrix=function(e,t){a(t)||(t=new y);var r=v.earthOrientationParameters.compute(e,D);if(!a(r))return void 0;var n=e.dayNumber,i=e.secondsOfDay+z,o=v.iau2006XysData.computeXysRadians(n,i,R);if(!a(o))return void 0;var u=o.x+r.xPoleOffset,s=o.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=L;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(-o.s,U),m=y.multiply(l,f,L),g=e.dayNumber,w=e.secondsOfDay-h.computeTaiMinusUtc(e)+r.ut1MinusUtc,x=g-2451545,E=w/p.SECONDS_PER_DAY,S=.779057273264+E+.00273781191135448*(x+E);S=S%1*d.TWO_PI;var O=y.fromRotationZ(S,U),T=y.multiply(m,O,L),M=Math.cos(r.xPoleWander),b=Math.cos(r.yPoleWander),N=Math.sin(r.xPoleWander),_=Math.sin(r.yPoleWander),P=n-C+i/p.SECONDS_PER_DAY;P/=36525;var A=-47e-6*P*d.RADIANS_PER_DEGREE/3600,I=Math.cos(A),q=Math.sin(A),B=U;return B[0]=M*I,B[1]=M*q,B[2]=N,B[3]=-b*q+_*N*I,B[4]=b*I+_*N*q,B[5]=-_*M,B[6]=-_*q-b*N*I,B[7]=_*I-b*N*q,B[8]=b*M,y.multiply(T,B,t)};var q=new n;return 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,i,o){a(o)||(o=new t);var u=q;return m.multiplyByVector(e,n.fromElements(i.x,i.y,i.z,1,u),u),n.multiplyByScalar(u,1/u.w,u),m.multiplyByVector(r,u,u),t.fromCartesian4(u,o)},v}),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";var y=new n,m=function(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)};o(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}}});var p=new e;m.fromPoints=function(t,r){var n=e.fromPoints(t,p);return new m(n.center,r)};var v=new h,g=new r;m.prototype.projectPointOntoPlane=function(e,n){var i=v;i.origin=e,r.normalize(e,i.direction);var o=c.rayPlane(i,this._plane,g);if(a(o)||(r.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,g)),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)}return void 0},m.prototype.projectPointsOntoPlane=function(e,t){a(t)||(t=[]);for(var r=0,n=e.length,i=0;n>i;i++){var o=this.projectPointOntoPlane(e[i],t[r]);a(o)&&(t[r]=o,r++)}return t.length=r,t};var w=new r;return m.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=w,l=0;n>l;++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},m}),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"],function(e){"use strict";var t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===t.POINTS||e===t.LINES||e===t.LINE_LOOP||e===t.LINE_STRIP||e===t.TRIANGLES||e===t.TRIANGLE_STRIP||e===t.TRIANGLE_FAN}};return e(t)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,i){"use strict";var a=function(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)};return a.computeNumberOfVertices=function(e){var n=-1;for(var i in e.attributes)if(e.attributes.hasOwnProperty(i)&&t(e.attributes[i])&&t(e.attributes[i].values)){var a=e.attributes[i],o=a.values.length/a.componentsPerAttribute;if(n!==o&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=o}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(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";var i=function(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,{})};return i}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,i){"use strict";var a={};a.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=t.x,n=t.y;t.x=(1-Math.abs(n))*i.signNotZero(r),t.y=(1-Math.abs(r))*i.signNotZero(n)}return t.x=i.toSNorm(t.x),t.y=i.toSNorm(t.y),t},a.octDecode=function(e,r,n){if(n.x=i.fromSNorm(e),n.y=i.fromSNorm(r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var a=n.x;n.x=(1-Math.abs(n.y))*i.signNotZero(a),n.y=(1-Math.abs(a))*i.signNotZero(n.y)}return t.normalize(n,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 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=1===e.x?4095:0|4096*e.x,r=1===e.y?4095:0|4096*e.y;return 4096*t+r},a.decompressTextureCoordinates=function(e,t){var r=e/4096;return t.x=Math.floor(r)/4096,t.y=r-Math.floor(r),t},a}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=new t,i=new t,a=new t,o=function(o,u,s,c,l){r(l)||(l=new t);var f,h,d,y,m,p,v,g;r(u.z)?(f=t.subtract(s,u,n),h=t.subtract(c,u,i),d=t.subtract(o,u,a),y=t.dot(f,f),m=t.dot(f,h),p=t.dot(f,d),v=t.dot(h,h),g=t.dot(h,d)):(f=e.subtract(s,u,n),h=e.subtract(c,u,i),d=e.subtract(o,u,a),y=e.dot(f,f),m=e.dot(f,h),p=e.dot(f,d),v=e.dot(h,h),g=e.dot(h,d));var w=1/(y*v-m*m);return l.y=(v*p-m*g)*w,l.z=(y*g-m*p)*w,l.x=1-l.y-l.z,l};return o}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)};r.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var n={high:0,low:0};r.fromCartesian=function(e,i){t(i)||(i=new r);var a=i.high,o=i.low;return r.encode(e.x,n),a.x=n.high,o.x=n.low,r.encode(e.y,n),a.y=n.high,o.y=n.low,r.encode(e.z,n),a.z=n.high,o.z=n.low,i};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"],function(e,t,r,n){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,i){return e>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,i):new Uint16Array(t,r,i)},r(i)}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};return r.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,i=r.maximumIndex,a=e(r.cacheSize,24),o=n.length;if(!t(i)){i=0;for(var u=0,s=n[u];o>u;)s>i&&(i=s),++u,s=n[u]}for(var c=[],l=0;i+1>l;l++)c[l]=0;for(var f=a+1,h=0;o>h;++h)f-c[n[h]]>a&&(c[n[h]]=f,++f);return(f-a+1)/(o/3)},r.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(;n>a;){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||-1===l)&&(l=s,c=h)),++f}return-1===c?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(;d>f;)h>l&&(l=h),++f,h=o[f];if(-1===l)return 0;++l}for(var y=[],m=0;l>m;m++)y[m]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var p=0;d>f;)y[o[f]].vertexTriangles.push(p),++y[o[f]].numLiveTriangles,y[o[f+1]].vertexTriangles.push(p),++y[o[f+1]].numLiveTriangles,y[o[f+2]].vertexTriangles.push(p),++y[o[f+2]].numLiveTriangles,++p,f+=3;var v=0,g=s+1;a=1;var w,x,E=[],S=[],O=0,T=[],M=c/3,b=[];for(m=0;M>m;m++)b[m]=!1;for(var N,_;-1!==v;){E=[],x=y[v],_=x.vertexTriangles.length;for(var P=0;_>P;++P)if(p=x.vertexTriangles[P],!b[p]){b[p]=!0,f=p+p+p;for(var A=0;3>A;++A)N=o[f],E.push(N),S.push(N),T[O]=N,++O,w=y[N],--w.numLiveTriangles,g-w.timeStamp>s&&(w.timeStamp=g,++g),++f}v=i(o,s,E,y,g,S,l)}return T},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,r,n,i,a,o,u,s,c,l,f,h,d,y,m,p,v,g,w,x,E,S,O,T){"use strict";function M(e,t,r,n,i){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=i,e[t++]=i,e[t]=r}function b(e){for(var t=e.length,r=6*(t/3),n=p.createTypedArray(t,r),i=0,a=0;t>a;a+=3,i+=6)M(n,i,e[a],e[a+1],e[a+2]);return n}function N(e){var t=e.length;if(t>=3){var r=6*(t-2),n=p.createTypedArray(t,r);M(n,0,e[0],e[1],e[2]);for(var i=6,a=3;t>a;++a,i+=6)M(n,i,e[a-1],e[a],e[a-2]);return n}return new Uint16Array}function _(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=p.createTypedArray(t,r),i=e[0],a=0,o=1;t>o;++o,a+=6)M(n,a,i,e[o],e[o+1]);return n}return new Uint16Array}function P(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 y({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function A(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 I(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;n>a;a+=3)i.unpack(r,a,Q),E.multiplyByPoint(e,Q,Q),i.pack(Q,r,a)}function z(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;n>a;a+=3)i.unpack(r,a,Q),x.multiplyByVector(e,Q,Q),Q=i.normalize(Q,Q),i.pack(Q,r,a)}function C(e){var t,r=e.length,n={},i=e[0].geometry.attributes;for(t in i)if(i.hasOwnProperty(t)&&c(i[t])&&c(i[t].values)){for(var a=i[t],o=a.values.length,s=!0,l=1;r>l;++l){var f=e[l].geometry.attributes[t];if(!c(f)||a.componentDatatype!==f.componentDatatype||a.componentsPerAttribute!==f.componentsPerAttribute||a.normalize!==f.normalize){s=!1;break}o+=f.values.length}s&&(n[t]=new y({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:u.createTypedArray(a.componentDatatype,o)}))}return n}function R(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function D(e){var t=d.computeNumberOfVertices(e),r=p.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,i=3;t>i;++i)r[n++]=i-1,r[n++]=0,r[n++]=i;return e.indices=r,e.primitiveType=O.TRIANGLES,e}function L(e){var t=d.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,i=3;t-1>i;i+=2)r[n++]=i,r[n++]=i-1,r[n++]=i+1,t>i+2&&(r[n++]=i,r[n++]=i+1,r[n++]=i+2);return e.indices=r,e.primitiveType=O.TRIANGLES,e}function U(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function q(e){var t=d.computeNumberOfVertices(e),r=p.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,i=2;t>i;++i)r[n++]=i-1,r[n++]=i;return e.indices=r,e.primitiveType=O.LINES,e}function B(e){var t=d.computeNumberOfVertices(e),r=p.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,i=2;t>i;++i)r[n++]=i-1,r[n++]=i;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=O.LINES,e}function F(e){switch(e.primitiveType){case O.TRIANGLE_FAN:return D(e);case O.TRIANGLE_STRIP:return L(e);case O.TRIANGLES:return R(e);case O.LINE_STRIP:return q(e);case O.LINE_LOOP:return B(e);case O.LINES:return U(e)}return e}function W(e,t){Math.abs(e.y)<w.EPSILON11&&(e.y=t?-w.EPSILON11:w.EPSILON11)}function G(e,t,r,n){i.add(e,i.multiplyByScalar(i.subtract(t,e,dt),e.y/(e.y-t.y),dt),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)return void 0;var n=e.y<0,i=t.y<0,a=r.y<0;W(e,n),W(t,i),W(r,a);var o=0;o+=n?1:0,o+=i?1:0,o+=a?1:0;var u=gt.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(G(e,t,yt,pt),G(e,r,mt,vt),u[0]=0,u[3]=1,u[4]=2,u[6]=1):i?(G(t,r,yt,pt),G(t,e,mt,vt),u[0]=1,u[3]=2,u[4]=0,u[6]=2):a&&(G(r,e,yt,pt),G(r,t,mt,vt),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||(G(r,e,yt,pt),G(r,t,mt,vt),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(G(t,r,yt,pt),G(t,e,mt,vt),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(G(e,t,yt,pt),G(e,r,mt,vt),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=gt.positions;return s[0]=e,s[1]=t,s[2]=r,gt.length=3,(1===o||2===o)&&(s[3]=yt,s[4]=mt,s[5]=pt,s[6]=vt,gt.length=7),gt}function Y(e,r,a,o,u,s,l,f){if(c(u)||c(s)||c(l)||c(f)){var h,d,y,m,p,v,g,w,x,E,S,O,T=o.positions,M=T[0],b=T[1],N=T[2],_=wt,P=xt,A=Et,I=St,z=Ot,C=Tt;c(u)&&(h=i.fromArray(u,3*e),d=i.fromArray(u,3*r),y=i.fromArray(u,3*a)),c(s)&&(m=i.fromArray(s,3*e),p=i.fromArray(s,3*r),v=i.fromArray(s,3*a)),c(l)&&(g=i.fromArray(l,3*e),w=i.fromArray(l,3*r),x=i.fromArray(l,3*a)),c(f)&&(E=n.fromArray(f,2*e),S=n.fromArray(f,2*r),O=n.fromArray(f,2*a));for(var R=3;R<T.length;++R){var D=T[R],L=t(D,M,b,N);if(c(u)){_=i.multiplyByScalar(h,L.x,_),P=i.multiplyByScalar(d,L.y,P),A=i.multiplyByScalar(y,L.z,A);var U=i.add(_,P,Mt);i.add(U,A,U),i.normalize(U,U),u.push(U.x,U.y,U.z)}if(c(s)){_=i.multiplyByScalar(m,L.x,_),P=i.multiplyByScalar(p,L.y,P),A=i.multiplyByScalar(v,L.z,A);var q=i.add(_,P,Mt);i.add(q,A,q),i.normalize(q,q),s.push(q.x,q.y,q.z)}if(c(l)){_=i.multiplyByScalar(g,L.x,_),P=i.multiplyByScalar(w,L.y,P),A=i.multiplyByScalar(x,L.z,A);var B=i.add(_,P,Mt);i.add(B,A,B),i.normalize(B,B),l.push(B.x,B.y,B.z)}if(c(f)){I=n.multiplyByScalar(E,L.x,I),z=n.multiplyByScalar(S,L.y,z),C=n.multiplyByScalar(O,L.z,C);var F=n.add(I,z,I);n.add(F,C,F),f.push(F.x,F.y)}}}}function j(e){for(var t=e.attributes,r=t.position.values,n=c(t.normal)?t.normal.values:void 0,a=c(t.binormal)?t.binormal.values:void 0,o=c(t.tangent)?t.tangent.values:void 0,s=c(t.st)?t.st.values:void 0,l=e.indices,f=Array.prototype.slice.call(r,0),h=c(n)?Array.prototype.slice.call(n,0):void 0,y=c(a)?Array.prototype.slice.call(a,0):void 0,m=c(o)?Array.prototype.slice.call(o,0):void 0,v=c(s)?Array.prototype.slice.call(s,0):void 0,g=[],w=l.length,x=0;w>x;x+=3){var E=l[x],S=l[x+1],O=l[x+2],T=i.fromArray(r,3*E),M=i.fromArray(r,3*S),b=i.fromArray(r,3*O),N=V(T,M,b);if(c(N))if(f[3*E+1]=N.positions[0].y,f[3*S+1]=N.positions[1].y,f[3*O+1]=N.positions[2].y,N.length>3){for(var _=f.length/3,P=0;P<N.indices.length;++P){var A=N.indices[P];3>A?g.push(l[x+A]):g.push(A-3+_)}for(var I=3;I<N.positions.length;++I){var z=N.positions[I];f.push(z.x,z.y,z.z)}Y(E,S,O,N,h,y,m,v)}else g.push(E,S,O);else g.push(E,S,O)}e.attributes.position.values=new Float64Array(f),c(h)&&(t.normal.values=u.createTypedArray(t.normal.componentDatatype,h)),c(y)&&(t.binormal.values=u.createTypedArray(t.binormal.componentDatatype,y)),c(m)&&(t.tangent.values=u.createTypedArray(t.tangent.componentDatatype,m)),c(v)&&(t.st.values=u.createTypedArray(t.st.componentDatatype,v));var C=d.computeNumberOfVertices(e);e.indices=p.createTypedArray(C,g)}function k(e){for(var t=e.attributes,r=t.position.values,n=e.indices,a=Array.prototype.slice.call(r,0),o=[],u=n.length,s=0;u>s;s+=2){var l=n[s],f=n[s+1],h=i.fromArray(r,3*l),y=i.fromArray(r,3*f);if(Math.abs(h.y)<w.EPSILON6&&(h.y=h.y<0?-w.EPSILON6:w.EPSILON6,a[3*l+1]=h.y),Math.abs(y.y)<w.EPSILON6&&(y.y=y.y<0?-w.EPSILON6:w.EPSILON6,a[3*f+1]=y.y),o.push(l),h.x<0||y.x<0){var m=g.lineSegmentPlane(h,y,bt);if(c(m)){var v=i.multiplyByScalar(i.UNIT_Y,5*w.EPSILON9,Nt);h.y<0&&i.negate(v,v);var x=a.length/3;o.push(x,x+1);var E=i.add(m,v,_t);a.push(E.x,E.y,E.z),i.negate(v,v),i.add(m,v,E),a.push(E.x,E.y,E.z)}}o.push(f)}e.attributes.position.values=new Float64Array(a);var S=d.computeNumberOfVertices(e);e.indices=p.createTypedArray(S,o)}function H(e){var t=e.attributes,r=t.position.values,o=c(t.st)?t.st.values:void 0,s=c(t.prevPosition)?t.prevPosition.values:void 0,l=c(t.nextPosition)?t.nextPosition.values:void 0,f=c(t.expandAndWidth)?t.expandAndWidth.values:void 0,h=c(t.color)?t.color.values:void 0;e.indices;for(var y=Array.prototype.slice.call(r,0),m=c(o)?Array.prototype.slice.call(o,0):void 0,v=c(s)?Array.prototype.slice.call(s,0):void 0,x=c(l)?Array.prototype.slice.call(l,0):void 0,E=c(f)?Array.prototype.slice.call(f,0):void 0,S=c(h)?Array.prototype.slice.call(h,0):void 0,O=[],T=y.length/3,M=0;T>M;M+=4){var b=M,N=M+1,_=M+2,P=i.fromArray(y,3*b,It),A=i.fromArray(y,3*N,zt),I=i.fromArray(y,3*_,Ct),z=i.equals(P,A);Math.abs(P.y)<w.EPSILON6&&(P.y=I.y<0?-w.EPSILON6:w.EPSILON6,y[3*b+1]=P.y),Math.abs(I.y)<w.EPSILON6&&(I.y=P.y<0?-w.EPSILON6:w.EPSILON6,y[3*_+1]=I.y),y[3*N+1]=A.y=z?P.y:I.y;var C=!1;if(P.x<0||I.x<0){var R=g.lineSegmentPlane(P,I,bt,zt);if(c(R)){var D=i.multiplyByScalar(i.UNIT_Y,5*w.EPSILON9,Rt);P.y<0&&i.negate(D,D);var L=i.add(R,D,Dt);y.push(L.x,L.y,L.z),y.push(L.x,L.y,L.z),i.negate(D,D),i.add(R,D,L),y.push(L.x,L.y,L.z),y.push(L.x,L.y,L.z),v.push(P.x,P.y,P.z,P.x,P.y,P.z),v.push(P.x,P.y,P.z,P.x,P.y,P.z),x.push(I.x,I.y,I.z,I.x,I.y,I.z),x.push(I.x,I.y,I.z,I.x,I.y,I.z);var U=n.fromArray(E,2*b),q=Math.abs(U.y);E.push(-1,-q,1,-q),E.push(-1,q,1,q);var B=i.magnitudeSquared(i.subtract(R,P,Rt));if(B/=i.magnitudeSquared(i.subtract(I,P,Rt)),c(S)){var F=a.fromArray(S,4*b,Lt),W=a.fromArray(S,4*_,Lt),G=w.lerp(F.x,W.x,B),V=w.lerp(F.y,W.y,B),Y=w.lerp(F.z,W.z,B),j=w.lerp(F.w,W.w,B);S.push(G,V,Y,j),S.push(G,V,Y,j),S.push(G,V,Y,j),S.push(G,V,Y,j)}if(c(m)){var k=n.fromArray(m,2*b,Pt),H=n.fromArray(m,2*(M+3),At),Z=w.lerp(k.x,H.x,B);m.push(Z,k.y),m.push(Z,H.y),m.push(Z,k.y),m.push(Z,H.y)}C=!0}}if(C){var X=y.length/3-4;O.push(M,X,M+1),O.push(M+1,X,X+1),O.push(X+2,M+2,X+3),O.push(X+3,M+2,M+3)}else O.push(M,M+2,M+1),O.push(M+1,M+2,M+3)}t.position.values=new Float64Array(y),t.prevPosition.values=u.createTypedArray(t.prevPosition.componentDatatype,v),t.nextPosition.values=u.createTypedArray(t.nextPosition.componentDatatype,x),t.expandAndWidth.values=u.createTypedArray(t.expandAndWidth.componentDatatype,E),c(m)&&(t.st.values=u.createTypedArray(t.st.componentDatatype,m)),c(S)&&(t.color.values=u.createTypedArray(t.color.componentDatatype,S));var J=d.computeNumberOfVertices(e);e.indices=p.createTypedArray(J,O)}var Z={};Z.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case O.TRIANGLES:e.indices=b(t);break;case O.TRIANGLE_STRIP:e.indices=N(t);break;case O.TRIANGLE_FAN:e.indices=_(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=O.LINES}return e},Z.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;o>h;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 m,p=e.boundingSphere;return c(p)&&(m=new r(p.center,p.radius+n)),new d({attributes:{position:new y({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:O.LINES,boundingSphere:m})},Z.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;o>t;++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},Z.reorderForPreVertexCache=function(e){var t=d.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),i=0;t>i;i++)n[i]=-1;for(var a,o=r,s=o.length,l=p.createTypedArray(t,s),f=0,h=0,y=0;s>f;)a=n[o[f]],-1!==a?l[h]=a:(a=o[f],n[a]=y,l[h]=y,++y),++f,++h;e.indices=l;var m=e.attributes;for(var v in m)if(m.hasOwnProperty(v)&&c(m[v])&&c(m[v].values)){for(var g=m[v],w=g.values,x=0,E=g.componentsPerAttribute,S=u.createTypedArray(g.componentDatatype,y*E);t>x;){var O=n[x];if(-1!==O)for(i=0;E>i;i++)S[E*O+i]=w[E*x+i];++x}g.values=S}}return e},Z.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===O.TRIANGLES&&c(r)){for(var n=r.length,i=0,a=0;n>a;a++)r[a]>i&&(i=r[a]);e.indices=T.tipsify({indices:r,maximumIndex:i,cacheSize:t}) -}return e},Z.fitToUnsignedShortIndices=function(e){var t=[],r=d.computeNumberOfVertices(e);if(c(e.indices)&&r>w.SIXTY_FOUR_KILOBYTES){var n,i=[],a=[],o=0,u=P(e.attributes),s=e.indices,l=s.length;e.primitiveType===O.TRIANGLES?n=3:e.primitiveType===O.LINES?n=2:e.primitiveType===O.POINTS&&(n=1);for(var f=0;l>f;f+=n){for(var h=0;n>h;++h){var y=s[f+h],m=i[y];c(m)||(m=o++,i[y]=m,A(u,e.attributes,y)),a.push(m)}o+n>w.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere})),i=[],a=[],o=0,u=P(e.attributes))}0!==a.length&&t.push(new d({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere}))}else t.push(e);return t};var X=new i,J=new o;Z.projectTo2D=function(e,t,r,n,a){var o=e.attributes[t];a=c(a)?a:new h;for(var s=a.ellipsoid,f=o.values,d=new Float64Array(f.length),m=0,p=0;p<f.length;p+=3){var v=i.fromArray(f,p,X),g=s.cartesianToCartographic(v,J);if(!c(g))throw new l("Could not project point ("+v.x+", "+v.y+", "+v.z+") to 2D.");var w=a.project(g,X);d[m++]=w.x,d[m++]=w.y,d[m++]=w.z}return e.attributes[r]=o,e.attributes[n]=new y({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:d}),delete e.attributes[t],e};var K={high:0,low:0};Z.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;o>l;++l)f.encode(a[l],K),s[l]=K.high,c[l]=K.low;var h=i.componentsPerAttribute;return e.attributes[r]=new y({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:s}),e.attributes[n]=new y({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:c}),delete e.attributes[t],e};var Q=new i,$=new E,et=new x;Z.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(E.equals(t,E.IDENTITY))return e;var n=e.geometry.attributes;I(t,n.position),I(t,n.prevPosition),I(t,n.nextPosition),(c(n.normal)||c(n.binormal)||c(n.tangent))&&(E.inverse(t,$),E.transpose($,$),E.getRotation($,et),z(et,n.normal),z(et,n.binormal),z(et,n.tangent));var i=e.geometry.boundingSphere;return c(i)&&(e.geometry.boundingSphere=r.transform(i,t,i)),e.modelMatrix=E.clone(E.IDENTITY),e};var tt=new i;Z.combine=function(e){var t,n,a,o,u=e.length;e[0].modelMatrix;var s,l,f,h=c(e[0].geometry.indices),y=e[0].geometry.primitiveType,m=C(e);for(t in m)if(m.hasOwnProperty(t))for(s=m[t].values,o=0,n=0;u>n;++n)for(l=e[n].geometry.attributes[t].values,f=l.length,a=0;f>a;++a)s[o++]=l[a];var v;if(h){var g=0;for(n=0;u>n;++n)g+=e[n].geometry.indices.length;var w=d.computeNumberOfVertices(new d({attributes:m,primitiveType:O.POINTS})),x=p.createTypedArray(w,g),E=0,S=0;for(n=0;u>n;++n){var T=e[n].geometry.indices,M=T.length;for(o=0;M>o;++o)x[E++]=S+T[o];S+=d.computeNumberOfVertices(e[n].geometry)}v=x}var b,N=new i,_=0;for(n=0;u>n;++n){if(b=e[n].geometry.boundingSphere,!c(b)){N=void 0;break}i.add(b.center,N,N)}if(c(N))for(i.divideByScalar(N,u,N),n=0;u>n;++n){b=e[n].geometry.boundingSphere;var P=i.magnitude(i.subtract(b.center,N,tt))+b.radius;P>_&&(_=P)}return new d({attributes:m,indices:v,primitiveType:y,boundingSphere:c(N)?new r(N,_):void 0})};var rt=new i,nt=new i,it=new i,at=new i;Z.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;a>f;f++)s[f]={indexOffset:0,count:0,currentCount:0};var h=0;for(f=0;o>f;f+=3){var d=t[f],m=t[f+1],p=t[f+2],v=3*d,g=3*m,w=3*p;nt.x=n[v],nt.y=n[v+1],nt.z=n[v+2],it.x=n[g],it.y=n[g+1],it.z=n[g+2],at.x=n[w],at.y=n[w+1],at.z=n[w+2],s[d].count++,s[m].count++,s[p].count++,i.subtract(it,nt,it),i.subtract(at,nt,at),c[h]=i.cross(it,at,new i),h++}var x=0;for(f=0;a>f;f++)s[f].indexOffset+=x,x+=s[f].count;h=0;var E;for(f=0;o>f;f+=3){E=s[t[f]];var S=E.indexOffset+E.currentCount;l[S]=h,E.currentCount++,E=s[t[f+1]],S=E.indexOffset+E.currentCount,l[S]=h,E.currentCount++,E=s[t[f+2]],S=E.indexOffset+E.currentCount,l[S]=h,E.currentCount++,h++}var O=new Float32Array(3*a);for(f=0;a>f;f++){var T=3*f;if(E=s[f],E.count>0){for(i.clone(i.ZERO,rt),h=0;h<E.count;h++)i.add(rt,c[l[E.indexOffset+h]],rt);i.normalize(rt,rt),O[T]=rt.x,O[T+1]=rt.y,O[T+2]=rt.z}else O[T]=0,O[T+1]=0,O[T+2]=1}return e.attributes.normal=new y({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:O}),e};var ot=new i,ut=new i,st=new i;Z.computeBinormalAndTangent=function(e){e.attributes;for(var t=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;s>l;l+=3){var m=t[l],p=t[l+1],v=t[l+2];f=3*m,h=3*p,d=3*v;var g=2*m,w=2*p,x=2*v,E=r[f],S=r[f+1],O=r[f+2],T=a[g],M=a[g+1],b=a[w+1]-M,N=a[x+1]-M,_=1/((a[w]-T)*N-(a[x]-T)*b),P=(N*(r[h]-E)-b*(r[d]-E))*_,A=(N*(r[h+1]-S)-b*(r[d+1]-S))*_,I=(N*(r[h+2]-O)-b*(r[d+2]-O))*_;c[f]+=P,c[f+1]+=A,c[f+2]+=I,c[h]+=P,c[h+1]+=A,c[h+2]+=I,c[d]+=P,c[d+1]+=A,c[d+2]+=I}var z=new Float32Array(3*o),C=new Float32Array(3*o);for(l=0;o>l;l++){f=3*l,h=f+1,d=f+2;var R=i.fromArray(n,f,ot),D=i.fromArray(c,f,st),L=i.dot(R,D);i.multiplyByScalar(R,L,ut),i.normalize(i.subtract(D,ut,D),D),C[f]=D.x,C[h]=D.y,C[d]=D.z,i.normalize(i.cross(R,D,D),D),z[f]=D.x,z[h]=D.y,z[d]=D.z}return e.attributes.tangent=new y({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:C}),e.attributes.binormal=new y({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:z}),e};var ct=new n,lt=new i,ft=new i,ht=new i;Z.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 m=c(o)?o.length:s.length,p=c(o)?3:2,v=m/p,g=v,w=c(s)&&c(o)?2:1;w+=c(l)||c(f)?1:0,g*=w;for(var x=new Float32Array(g),E=0,S=0;v>S;++S){c(s)&&(n.fromArray(s,2*S,ct),x[E++]=e.compressTextureCoordinates(ct));var O=3*S;c(o)&&c(l)&&c(f)?(i.fromArray(o,O,lt),i.fromArray(l,O,ft),i.fromArray(f,O,ht),e.octPack(lt,ft,ht,ct),x[E++]=ct.x,x[E++]=ct.y):(c(o)&&(i.fromArray(o,O,lt),x[E++]=e.octEncodeFloat(lt)),c(l)&&(i.fromArray(l,O,lt),x[E++]=e.octEncodeFloat(lt)),c(f)&&(i.fromArray(f,O,lt),x[E++]=e.octEncodeFloat(lt)))}return t.attributes.compressedAttributes=new y({componentDatatype:u.FLOAT,componentsPerAttribute:w,values:x}),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 dt=new i,yt=new i,mt=new i,pt=new i,vt=new i,gt={positions:new Array(7),indices:new Array(9)},wt=new i,xt=new i,Et=new i,St=new n,Ot=new n,Tt=new n,Mt=new i,bt=S.fromPointNormal(i.ZERO,i.UNIT_Y),Nt=new i,_t=new i,Pt=new n,At=new n,It=new i,zt=new i,Ct=new i,Rt=new i,Dt=new i,Lt=new a;return new a,Z.wrapLongitude=function(e){var t=e.boundingSphere;if(c(t)){var n=t.center.x-t.radius;if(n>0||r.intersect(t,a.UNIT_Y)!==v.INTERSECTING)return e}if(e.geometryType!==m.NONE)switch(e.geometryType){case m.POLYLINES:H(e);break;case m.TRIANGLES:j(e);break;case m.LINES:k(e)}else F(e),e.primitiveType===O.TRIANGLES?j(e):e.primitiveType===O.LINES&&k(e);return e},Z}),define("Core/PolygonGeometryLibrary",["./Cartesian3","./defaultValue","./defined","./Ellipsoid"],function(e,t,r,n){"use strict";function i(t,r,n,i){return e.subtract(r,t,o),e.multiplyByScalar(o,n/i,o),e.add(t,o,o),[o.x,o.y,o.z]}var a={},o=new e;a.subdivideLine=function(t,r,n){var a=e.distance(t,r),o=e.angleBetween(t,r),u=o/n,s=Math.ceil(Math.log(u)/Math.log(2));1>s&&(s=0);var c=Math.pow(2,s),l=a/c,f=new Array(3*c),h=0;f[h++]=t.x,f[h++]=t.y,f[h++]=t.z;for(var d=1;c>d;d++){var y=i(t,r,d*l,a);f[h++]=y[0],f[h++]=y[1],f[h++]=y[2]}return f};var u=new e,s=new e,c=new e,l=new e;return a.scaleToGeodeticHeightExtruded=function(i,a,o,f,h){f=t(f,n.WGS84);var d=u,y=s,m=c,p=l;if(r(i)&&r(i.attributes)&&r(i.attributes.position))for(var v=i.attributes.position.values,g=v.length/2,w=0;g>w;w+=3)e.fromArray(v,w,m),f.geodeticSurfaceNormal(m,d),p=f.scaleToGeodeticSurface(m,p),y=e.multiplyByScalar(d,o,y),y=e.add(p,y,y),v[w+g]=y.x,v[w+1+g]=y.y,v[w+2+g]=y.z,h&&(p=e.clone(m,p)),y=e.multiplyByScalar(d,a,y),y=e.add(p,y,y),v[w]=y.x,v[w+1]=y.y,v[w+2]=y.z;return i},a}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";var r=new t,n=function(t,n,i,a){return e(t,n,i,a,r),r.x>0&&r.y>0&&r.z>0};return n}),define("Core/Queue",[],function(){"use strict";var e=function(){this._array=[],this._offset=0,this.length=0};return e.prototype.enqueue=function(e){this._array.push(e),this.length++},e.prototype.dequeue=function(){if(0===this.length)return void 0;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},e.prototype.contains=function(e){return-1!==this._array.indexOf(e)},e.prototype.clear=function(){this._array.length=this._offset=this.length=0},e.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},e}),define("Core/WindingOrder",["./freezeObject"],function(e){"use strict";var t={CLOCKWISE:2304,COUNTER_CLOCKWISE:2305,validate:function(e){return e===t.CLOCKWISE||e===t.COUNTER_CLOCKWISE}};return e(t)}),define("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,y){"use strict";function m(t,r,n){var i=e.subtract(r,t,q),a=e.subtract(n,r,B);return i.x*a.y-i.y*a.x>=0}function p(e){for(var t=e[0].x,r=0,n=0;n<e.length;n++)e[n].x>t&&(t=e[n].x,r=n);return r}function v(e){for(var t=e[0][0].x,r=0,n=0;n<e.length;n++){var i=e[n][p(e[n])].x;i>t&&(t=i,r=n)}return r}function g(e){for(var t=[],r=0;r<e.length;r++){var n=e[(r-1+e.length)%e.length],i=e[r],a=e[(r+1)%e.length];m(n,i,a)||t.push(i)}return t}function w(t,r){for(var n=0;n<t.length;n++)if(e.equals(r,t[n]))return n;return-1}function x(r,i,a){a=n(a,[]);var o=Number.MAX_VALUE,u=p(i),s=new e(i[u].x,r.y);a.push(u),a.push((u+1)%i.length);for(var c=i[0].x,l=c,f=1;f<i.length;++f)i[f].x<c?c=i[f].x:i[f].x>l&&(l=i[f].x);l+=l-c;var h=new t(l,r.y,0);for(f=0;f<i.length;f++){var d=i[f],y=i[(f+1)%i.length];if((d.x>=r.x||y.x>=r.x)&&(d.y>=r.y&&y.y<=r.y||d.y<=r.y&&y.y>=r.y)){var m=(y.y-d.y)*(h.x-r.x)-(y.x-d.x)*(h.y-r.y);if(0!==m){m=1/m;var v=((y.x-d.x)*(r.y-d.y)-(y.y-d.y)*(r.x-d.x))*m,g=((h.x-r.x)*(r.y-d.y)-(h.y-r.y)*(r.x-d.x))*m;if(v>=0&&1>=v&&g>=0&&1>=g){var w=new e(r.x+v*(h.x-r.x),r.y+v*(h.y-r.y)),x=e.subtract(w,r,F);m=e.magnitudeSquared(x),o>m&&(s=w,o=m,a[0]=f,a[1]=(f+1)%i.length)}}}}return s}function E(t,r){var n=v(r),i=r[n],a=p(i),o=i[a],u=[],s=x(o,t,u),c=w(t,s);if(-1!==c)return c;var h=e.magnitudeSquared(e.subtract(t[u[0]],o,W)),d=e.magnitudeSquared(e.subtract(t[u[1]],o,W)),y=d>h?t[u[0]]:t[u[1]],m=g(t),E=m.indexOf(y);-1!==E&&m.splice(E,1);for(var S=[],O=0;O<m.length;O++){var T=m[O];f(T,o,s,y)&&S.push(T)}var M=Number.MAX_VALUE;if(S.length>0){var b=e.fromElements(1,0,W);for(O=0;O<S.length;O++){var N=e.subtract(S[O],o,G),_=e.magnitude(b)*e.magnitudeSquared(N);if(0!==_){var P=Math.abs(l.acosClamped(e.dot(b,N)/_));M>P&&(M=P,y=S[O])}}}return t.indexOf(y)}function S(e,r,n){for(var i=ut.computeWindingOrder2D(e),a=0;a<r.length;a++){var o=r[a];t.equals(o[0],o[o.length-1])||o.push(o[0]);var s=ut.computeWindingOrder2D(o);s===i&&o.reverse()}var c=u.fromPoints(e,n),l=c.projectPointsOntoPlane(e),f=[];for(a=0;a<r.length;a++)f.push(c.projectPointsOntoPlane(r[a]));var h=E(l,f),d=v(f),y=p(f[d]),m=r[d],g=[];for(a=0;a<e.length;a++)g.push(e[a]);var w,x=[];if(0!==y)for(w=0;w<=m.length;w++){var S=(w+y)%m.length;0!==S&&x.push(m[S])}else for(w=0;w<m.length;w++)x.push(m[(w+y)%m.length]);var O=g.lastIndexOf(e[h]);x.push(e[O]);var T=g.slice(0,O+1),M=g.slice(O+1);return g=T.concat(x,M),r.splice(d,1),g}function O(e){var t="0."+Math.sin(V).toString().substr(5);V+=.2;var r=Math.floor(t*e);return r===e&&r--,r}function T(t,r,n){return M(t,r,n)&&M(r,t,n)&&!R(n[t].position,n[r].position,n)&&!e.equals(n[t].position,n[r].position)}function M(t,r,n){_(t,n);var i=n[t],a=n[r],o=N(t,n,Y),u=N(t,n,j),s=e.subtract(n[o].position,i.position,k),c=e.subtract(n[u].position,i.position,H),l=e.subtract(a.position,i.position,Z);return P(s,l)?b(s,l):P(c,l)?b(c,l):A(s,c)?C(s,c,l)?!0:!1:I(s,c)?z(s,c,l)?!1:!0:void 0}function b(t,r){return e.magnitude(r)<e.magnitude(t)}function N(e,t,r){var n=e+r;return 0>n&&(n=t.length-1),n===t.length&&(n=0),_(n,t),n}function _(t,r){var n=t-1,i=t+1;0>n&&(n=r.length-1),i===r.length&&(i=0);var o=e.subtract(r[n].position,r[t].position,X),u=e.subtract(r[i].position,r[t].position,J);if(P(o,u)){var s=new a("Superfluous vertex found.");throw s.vertexIndex=t,s}}function P(e,r){return 0===t.cross(e,r,K).z}function A(e,r){return t.cross(e,r,Q).z<0}function I(e,r){return t.cross(e,r,$).z>0}function z(e,r,n){return t.cross(e,n,et).z>0&&t.cross(n,r,et).z>0}function C(e,r,n){return t.cross(e,n,tt).z<0&&t.cross(n,r,tt).z<0}function R(t,r,n){for(var i=0;i<n.length;i++){var a,o=n[i].position;if(a=i<n.length-1?n[i+1].position:n[0].position,!(e.equals(t,o)||e.equals(r,a)||e.equals(t,a)||e.equals(r,o))){var u=(r.y-t.y)/(r.x-t.x),s=(a.y-o.y)/(a.x-o.x);if(!(u===s||isNaN(u)&&isNaN(s))){var c;c=isNaN(u)?t.x:isNaN(s)?o.x:(t.y-o.y-u*t.x+s*o.x)/(s-u);var l=u*c+t.y-u*t.x,f=e.fromElements(c,l,rt);if(!(e.equals(f,t)||e.equals(f,r)||e.equals(f,o)||e.equals(f,a))){var h=L(c,t.x,r.x)&&L(l,t.y,r.y)&&L(c,o.x,a.x)&&L(l,o.y,a.y);if(h)return!0}}}}return!1}function D(t){var r=t[0].position,n=t[1].position,i=t[2].position,a=e.subtract(n,r,nt),o=e.subtract(i,r,it);return P(a,o)}function L(e,t,r){return(e>t||e>r)&&(t>e||r>e)||t===r&&t===e}function U(e){var t=e.length;if(3===t)return D(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new a("Invalid polygon: must have at least three vertices.");for(var r=!1,n=0;!r;){var i=10*e.length;if(n>i)return[];n++;for(var o=O(e.length),u=o+1;Math.abs(o-u)<2||Math.abs(o-u)>e.length-2;)u=O(e.length);if(o>u){var s=o;o=u,u=s}try{if(T(o,u,e)){var c=e.splice(o,u-o+1,e[o],e[u]);return U(e).concat(U(c))}}catch(l){if(l.hasOwnProperty("vertexIndex"))return e.splice(l.vertexIndex,1),U(e);throw l}}}var q=new e,B=new e,F=new e,W=new e(1,0),G=new e,V=0,Y=-1,j=1,k=new t,H=new t,Z=new t,X=new t,J=new t,K=new t,Q=new t,$=new t,et=new t,tt=new t,rt=new e,nt=new t,it=new t,at=new t,ot=new t,ut={};return ut.removeDuplicates=function(e){for(var r=e.length,n=[],i=r-1,a=0;r>a;i=a++){var o=e[i],u=e[a];t.equals(o,u)||n.push(u)}return n},ut.computeArea2D=function(e){for(var t=e.length,r=0,n=t-1,i=0;t>i;n=i++){var a=e[n],o=e[i];r+=a.x*o.y-o.x*a.y}return.5*r},ut.computeWindingOrder2D=function(e){var t=ut.computeArea2D(e);return t>0?y.COUNTER_CLOCKWISE:y.CLOCKWISE},ut.triangulate=function(e){for(var t=e.length,r=[],n=0;t>n;++n)r[n]={position:e[n],index:n};return U(r)},ut.resetSeed=function(e){V=n(e,0)},ut.computeSubdivision=function(e,i,a){a=n(a,l.RADIANS_PER_DEGREE);for(var o=new d,u=i.length,f=0;u>f;f+=3)o.enqueue({i0:i[f],i1:i[f+1],i2:i[f+2]});for(var y,m=e.slice(0),p=[],v={};o.length>0;){var g,w,x=o.dequeue(),E=m[x.i0],S=m[x.i1],O=m[x.i2],T=t.angleBetween(E,S),M=t.angleBetween(S,O),b=t.angleBetween(O,E),N=Math.max(T,Math.max(M,b));N>a?T===N?(g=Math.min(x.i0,x.i1).toString()+" "+Math.max(x.i0,x.i1).toString(),y=v[g],y||(w=t.add(E,S,new t),t.multiplyByScalar(w,.5,w),m.push(w),y=m.length-1,v[g]=y),o.enqueue({i0:x.i0,i1:y,i2:x.i2}),o.enqueue({i0:y,i1:x.i1,i2:x.i2})):M===N?(g=Math.min(x.i1,x.i2).toString()+" "+Math.max(x.i1,x.i2).toString(),y=v[g],y||(w=t.add(S,O,new t),t.multiplyByScalar(w,.5,w),m.push(w),y=m.length-1,v[g]=y),o.enqueue({i0:x.i1,i1:y,i2:x.i0}),o.enqueue({i0:y,i1:x.i2,i2:x.i0})):b===N&&(g=Math.min(x.i2,x.i0).toString()+" "+Math.max(x.i2,x.i0).toString(),y=v[g],y||(w=t.add(O,E,new t),t.multiplyByScalar(w,.5,w),m.push(w),y=m.length-1,v[g]=y),o.enqueue({i0:x.i2,i1:y,i2:x.i1}),o.enqueue({i0:y,i1:x.i0,i2:x.i1})):(p.push(x.i0),p.push(x.i1),p.push(x.i2))}var _=m.length,P=new Array(3*_),A=0;for(y=0;_>y;y++){var I=m[y];P[A++]=I.x,P[A++]=I.y,P[A++]=I.z}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:P})},indices:p,primitiveType:h.TRIANGLES})},ut.scaleToGeodeticHeight=function(e,r,a,u){a=n(a,o.WGS84);var s=at,c=ot;if(r=n(r,0),u=n(u,!0),i(e)&&i(e.attributes)&&i(e.attributes.position))for(var l=e.attributes.position.values,f=l.length,h=0;f>h;h+=3)t.fromArray(l,h,c),u&&(c=a.scaleToGeodeticSurface(c,c)),s=a.geodeticSurfaceNormal(c,s),t.multiplyByScalar(s,r,s),t.add(c,s,c),l[h]=c.x,l[h+1]=c.y,l[h+2]=c.z;return e},ut.eliminateHoles=function(e,r,i){i=n(i,o.WGS84);for(var a=[],u=0;u<r.length;u++){for(var s=[],c=0;c<r[u].length;c++)s.push(t.clone(r[u][c]));a.push(s)}for(var l=e;a.length>0;)l=S(l,a,i);return l},ut}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,n,i,a,o,u){"use strict";var s=function(e,r,n,i){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(i,0)},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],y=e[u.COLUMN2ROW2],m=h+d+y;if(m>0)n=Math.sqrt(m+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 p=l,v=0;d>h&&(v=1),y>h&&y>d&&(v=2);var g=p[v],w=p[g];n=Math.sqrt(e[u.getElementIndex(v,v)]-e[u.getElementIndex(g,g)]-e[u.getElementIndex(w,w)]+1);var x=f;x[v]=.5*n,n=.5/n,c=(e[u.getElementIndex(w,g)]-e[u.getElementIndex(g,w)])*n,x[g]=(e[u.getElementIndex(g,v)]+e[u.getElementIndex(v,g)])*n,x[w]=(e[u.getElementIndex(w,v)]+e[u.getElementIndex(v,w)])*n,i=-x[0],a=-x[1],o=-x[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 e,d=new e,y=new s,m=new s,p=new s;s.packedLength=4,s.pack=function(e,r,n){n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w},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,p),s.conjugate(p,p);for(var i=0,a=r-t+1;a>i;i++){var o=3*i;s.unpack(e,4*(t+i),y),s.multiply(y,p,y),y.w<0&&s.negate(y,y),s.computeAxis(y,h);var u=s.computeAngle(y);n[o]=h.x*u,n[o+1]=h.y*u,n[o+2]=h.z*u}},s.unpackInterpolationResult=function(t,n,i,a,o){r(o)||(o=new s),e.fromArray(t,0,d);var u=e.magnitude(d);return s.unpack(n,4*a,m),0===u?s.clone(s.IDENTITY,y):s.fromAxisAngle(d,u,y),s.multiply(y,m,o)},s.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w):void 0},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,y=o*l-n*u-i*s-a*c;return r.x=f,r.y=h,r.z=d,r.w=y,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 v=new s;s.lerp=function(e,t,r,n){return v=s.multiplyByScalar(t,r,v),n=s.multiplyByScalar(e,1-r,n),s.add(v,n,n)};var g=new s,w=new s,x=new s;s.slerp=function(e,t,r,n){var i=s.dot(e,t),a=t;if(0>i&&(i=-i,a=g=s.negate(t,g)),1-i<o.EPSILON6)return s.lerp(e,a,r,n);var u=Math.acos(i);return w=s.multiplyByScalar(e,Math.sin((1-r)*u),w),x=s.multiplyByScalar(a,Math.sin(r*u),x),n=s.add(w,x,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 E=new e,S=new e,O=new s,T=new s;s.computeInnerQuadrangle=function(t,r,n,i){var a=s.conjugate(r,O);s.multiply(a,n,T);var o=s.log(T,E);s.multiply(a,t,T);var u=s.log(T,S);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,O),s.multiply(r,O,i)},s.squad=function(e,t,r,n,i,a){var o=s.slerp(e,t,i,O),u=s.slerp(r,n,i,T);return s.slerp(o,u,2*i*(1-i),a)};for(var M=new s,b=1.9011074535173003,N=i.supportsTypedArrays()?new Float32Array(8):[],_=i.supportsTypedArrays()?new Float32Array(8):[],P=i.supportsTypedArrays()?new Float32Array(8):[],A=i.supportsTypedArrays()?new Float32Array(8):[],I=0;7>I;++I){var z=I+1,C=2*z+1;N[I]=1/(z*C),_[I]=z/C}return N[7]=b/136,_[7]=8*b/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)P[f]=(N[f]*c-_[f])*o,A[f]=(N[f]*l-_[f])*o;var h=i*r*(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=u*(1+A[0]*(1+A[1]*(1+A[2]*(1+A[3]*(1+A[4]*(1+A[5]*(1+A[6]*(1+A[7])))))))),y=s.multiplyByScalar(e,d,M);return s.multiplyByScalar(t,h,n),s.add(y,n,n)},s.fastSquad=function(e,t,r,n,i,a){var o=s.fastSlerp(e,t,i,O),u=s.fastSlerp(r,n,i,T);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/VertexFormat",["./defaultValue","./freezeObject"],function(e,t){"use strict";var r=function(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 r.POSITION_ONLY=t(new r({position:!0})),r.POSITION_AND_NORMAL=t(new r({position:!0,normal:!0})),r.POSITION_NORMAL_AND_ST=t(new r({position:!0,normal:!0,st:!0})),r.POSITION_AND_ST=t(new r({position:!0,st:!0})),r.POSITION_AND_COLOR=t(new r({position:!0,color:!0})),r.ALL=t(new r({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),r.DEFAULT=r.POSITION_NORMAL_AND_ST,r}),define("Core/PolygonGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Quaternion","./Queue","./VertexFormat","./WindingOrder"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,y,m,p,v,g,w,x,E,S,O,T){"use strict";function M(e,t,r,i){for(var a=E.fromAxisAngle(e._plane.normal,r,z),u=v.fromQuaternion(a,C),s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,h=t.length,d=0;h>d;++d){var y=n.clone(t[d],I);v.multiplyByVector(u,y,y);var m=e.projectPointOntoPlane(y,A);o(m)&&(s=Math.min(s,m.x),c=Math.max(c,m.x),l=Math.min(l,m.y),f=Math.max(f,m.y))}return i.x=s,i.y=l,i.width=c-s,i.height=f-l,i}function b(e,t,r,n){var a=c.fromPoints(t,e),o=a.projectPointsOntoPlane(t,R),u=w.computeWindingOrder2D(o);u===T.CLOCKWISE&&(o.reverse(),t.reverse());var s=w.triangulate(o);s.length<3&&(s=[0,1,2]);var h;if(n){for(var y=t.length,m=new Array(3*y),p=0,v=0;y>v;v++){var g=t[v];m[p++]=g.x,m[p++]=g.y,m[p++]=g.z}h=new l({attributes:{position:new f({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:m})},indices:s,primitiveType:x.TRIANGLES})}else h=w.computeSubdivision(t,s,r);return new d({geometry:h})}function N(e,t,a,o,u,s,l){if(e.st||e.normal||e.tangent||e.binormal){var h=c.fromPoints(a,o),d=M(h,a,u,D),y=G;y.x=d.x,y.y=d.y;var m=t.attributes.position.values,g=m.length,w=e.st?new Float32Array(2*(g/3)):void 0,x=e.normal?new Float32Array(g):void 0,S=e.tangent?new Float32Array(g):void 0,O=e.binormal?new Float32Array(g):void 0,T=0,b=0,N=U,_=q,P=B,A=!0,I=E.fromAxisAngle(h._plane.normal,u,j),z=v.fromQuaternion(I,k),C=g/2,R=g/3;s&&(g/=2);for(var H=0;g>H;H+=3){var Z=n.fromArray(m,H,Y);if(e.st){var X=v.multiplyByVector(z,Z,L),J=h.projectPointOntoPlane(X,V);r.subtract(J,y,J),s&&(w[T+R]=J.x/d.width,w[T+1+R]=J.y/d.height),w[T]=J.x/d.width,w[T+1]=J.y/d.height,T+=2}if(e.normal||e.tangent||e.binormal){var K=b+1,Q=b+2;if(l){if(g>H+3){var $=n.fromArray(m,H+3,F);if(A){var et=n.fromArray(m,H+g,W);n.subtract($,Z,$),n.subtract(et,Z,et),N=n.normalize(n.cross(et,$,N),N),A=!1}n.equalsEpsilon($,Z,p.EPSILON10)&&(A=!0)}(e.tangent||e.binormal)&&(P=o.geodeticSurfaceNormal(Z,P),e.tangent&&(_=n.normalize(n.cross(P,N,_),_)))}else N=o.geodeticSurfaceNormal(Z,N),(e.tangent||e.binormal)&&(_=n.cross(n.UNIT_Z,N,_),_=n.normalize(v.multiplyByVector(z,_,_),_),e.binormal&&(P=n.normalize(n.cross(N,_,P),P)));e.normal&&(s&&!l?(x[b+C]=-N.x,x[K+C]=-N.y,x[Q+C]=-N.z):(x[b+C]=N.x,x[K+C]=N.y,x[Q+C]=N.z),x[b]=N.x,x[K]=N.y,x[Q]=N.z),e.tangent&&(s&&!l?(S[b+C]=-_.x,S[K+C]=-_.y,S[Q+C]=-_.z):(S[b+C]=_.x,S[K+C]=_.y,S[Q+C]=_.z),S[b]=_.x,S[K]=_.y,S[Q]=_.z),e.binormal&&(s&&(O[b+C]=P.x,O[K+C]=P.y,O[Q+C]=P.z),O[b]=P.x,O[K]=P.y,O[Q]=P.z),b+=3}}e.st&&(t.attributes.st=new f({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:w})),e.normal&&(t.attributes.normal=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:x})),e.tangent&&(t.attributes.tangent=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:S})),e.binormal&&(t.attributes.binormal=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:O}))}return t}function _(e,t,r){var a,o,u,s,c,d,y,v,w,E=[],S=e.length;if(r)for(y=0;S>y;y++)v=e[y],w=e[(y+1)%S],E.push(v.x,v.y,v.z,w.x,w.y,w.z);else for(y=0;S>y;y++)v=e[y],w=e[(y+1)%S],a=g.subdivideLine(v,w,t),a.push(w.x,w.y,w.z),E=E.concat(a);E=E.concat(E),S=E.length;var O=m.createTypedArray(S/3,S-6*e.length);for(o=0,S/=6,y=0;S>y;y++)u=y,s=u+1,v=n.fromArray(E,3*u,F),w=n.fromArray(E,3*s,W),n.equalsEpsilon(v,w,p.EPSILON6)||(c=u+S,d=c+1,O[o++]=u,O[o++]=c,O[o++]=s,O[o++]=s,O[o++]=c,O[o++]=d);return new l({attributes:new h({position:new f({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:E})}),indices:O,primitiveType:x.TRIANGLES})}function P(e,t,r,n,a){var o=b(e,t,r,a).geometry,u=o.attributes.position.values,s=o.indices,y=u.concat(u),p=y.length/3,v=m.createTypedArray(p,2*s.length);v.set(s);var g,x=s.length,E=p/2;for(g=0;x>g;g+=3){var S=v[g]+E,O=v[g+1]+E,M=v[g+2]+E;v[g+x]=M,v[g+1+x]=O,v[g+2+x]=S}var N=new l({attributes:new h({position:new f({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:y})}),indices:v,primitiveType:o.primitiveType}),P={topAndBottom:new d({geometry:N})};P.walls=[];var A=n.outerRing,I=c.fromPoints(A,e),z=I.projectPointsOntoPlane(A,H),C=w.computeWindingOrder2D(z);C===T.CLOCKWISE&&A.reverse();var R=_(A,r,a);P.walls.push(new d({geometry:R}));var D=n.holes;for(g=0;g<D.length;g++){var L=D[g];I=c.fromPoints(L,e),z=I.projectPointsOntoPlane(L,H),C=w.computeWindingOrder2D(z),C===T.CLOCKWISE&&L.reverse(),R=_(L,r),P.walls.push(new d({geometry:R}))}return P}var A=new r,I=new n,z=new E,C=new v,R=[],D=new e,L=new n,U=new n,q=new n,B=new n,F=new n,W=new n,G=new r,V=new r,Y=new n,j=new E,k=new v,H=[],Z=function(e){e=a(e,a.EMPTY_OBJECT);var t=a(e.vertexFormat,O.DEFAULT),r=a(e.ellipsoid,s.WGS84),n=a(e.granularity,p.RADIANS_PER_DEGREE),i=a(e.stRotation,0),u=a(e.height,0),c=a(e.perPositionHeight,!1),l=e.extrudedHeight,f=o(l)&&(!p.equalsEpsilon(u,l,p.EPSILON6)||c);if(f){var h=l;l=Math.min(h,u),u=Math.max(h,u)}var d=e.polygonHierarchy;this._vertexFormat=t,this._ellipsoid=r,this._granularity=n,this._stRotation=i,this._height=u,this._extrudedHeight=l,this._extrude=f,this._polygonHierarchy=d,this._perPositionHeight=c,this._workerName="createPolygonGeometry"};return Z.fromPositions=function(e){e=a(e,a.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};return new Z(t)},Z.createGeometry=function(e){var r,n,i,a=e._vertexFormat,s=e._ellipsoid,c=e._granularity,f=e._stRotation,h=e._height,d=e._extrudedHeight,p=e._extrude,v=e._polygonHierarchy,x=e._perPositionHeight,E=[],O=new S;O.enqueue(v),v=[];for(var T;0!==O.length;){var M=O.dequeue(),_=M.positions,A=M.holes;if(_=w.removeDuplicates(_),_.length<3)throw new u("At least three positions are required.");var I=A?A.length:0;if(0===I)v.push({outerRing:_,holes:[]}),E.push(_);else{var z=[];for(T=0;I>T;T++){var C=A[T];if(C.positions=w.removeDuplicates(C.positions),C.positions.length<3)throw new u("At least three positions are required.");z.push(C.positions);var R=0;o(C.holes)&&(R=C.holes.length);for(var D=0;R>D;D++)O.enqueue(C.holes[D])}v.push({outerRing:_,holes:z});var L=w.eliminateHoles(_,z);E.push(L)}}i=E[0];var U,q=[];if(p){for(T=0;T<E.length;T++)if(U=P(s,E[T],c,v[T],x),o(U)){n=U.topAndBottom,n.geometry=g.scaleToGeodeticHeightExtruded(n.geometry,h,d,s,x),n.geometry=N(a,n.geometry,i,s,f,!0,!1),q.push(n),r=U.walls;for(var B=0;B<r.length;B++){var F=r[B];F.geometry=g.scaleToGeodeticHeightExtruded(F.geometry,h,d,s,x),F.geometry=N(a,F.geometry,i,s,f,!0,!0),q.push(F)}}}else for(T=0;T<E.length;T++)U=b(s,E[T],c,x),o(U)&&(U.geometry=w.scaleToGeodeticHeight(U.geometry,h,s,!x),U.geometry=N(a,U.geometry,i,s,f,!1,!1),q.push(U));U=y.combine(q),U.attributes.position.values=new Float64Array(U.attributes.position.values),U.indices=m.createTypedArray(U.attributes.position.values.length/3,U.indices);var W=U.attributes,G=t.fromVertices(W.position.values);return a.position||delete W.position,new l({attributes:W,indices:U.indices,primitiveType:U.primitiveType,boundingSphere:G})},Z}),define("Workers/createPolygonGeometry",["../Core/Ellipsoid","../Core/PolygonGeometry"],function(e,t){"use strict";function r(r){return r._ellipsoid=e.clone(r._ellipsoid),t.createGeometry(r)}return r})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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:0>e?-1:0},a.signNotZero=function(e){return 0>e?-1:1},a.toSNorm=function(e){return Math.round(255*(.5*a.clamp(e,-1,1)+.5))},a.fromSNorm=function(e){return a.clamp(e,0,255)/255*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.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 a>=i||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;e>=r;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}i.fromSpherical=function(n,r){t(r)||(r=new i);var a=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(o),r},i.fromElements=function(e,n,r,a){return t(a)?(a.x=e,a.y=n,a.z=r,a):new i(e,n,r)},i.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 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},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},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 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){i.normalize(e,s),i.normalize(t,c);var n=i.dot(s,c),r=i.magnitude(i.cross(s,c,s));return Math.atan2(r,n)};var l=new i;i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):n.y<=n.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,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},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},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)},i.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},i.fromDegrees=function(e,t,n,r,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,n,r,o)};var f=new i,h=new i,d=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(n,r,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=i.normalize(f,f),i.multiplyComponents(s,f,h);var l=Math.sqrt(i.dot(f,h));return h=i.divideByScalar(h,l,h),f=i.multiplyByScalar(f,a,f),t(u)||(u=new i),i.add(h,f,u)},i.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=a.toRadians(e[o]);return i.fromRadiansArray(r,t,n)},i.fromRadiansArray=function(e,n,r){var a=e.length;t(r)?r.length=a/2:r=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=i.fromRadians(u,s,0,n,r[o/2])}return r},i.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=a.toRadians(e[o]),r[o+1]=a.toRadians(e[o+1]),r[o+2]=e[o+2];return i.fromRadiansArrayHeights(r,t,n)},i.fromRadiansArrayHeights=function(e,n,r){var a=e.length;t(r)?r.length=a/3:r=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=i.fromRadians(u,s,c,n,r[o/3])}return r},i.ZERO=r(new i(0,0,0)),i.UNIT_X=r(new i(1,0,0)),i.UNIT_Y=r(new i(0,1,0)),i.UNIT_Z=r(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,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},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,p=a.z,m=l*l*d*d,y=f*f*E*E,_=h*h*p*p,v=m+y+_,T=Math.sqrt(1/v),R=e.multiplyByScalar(n,T,i);if(s>v)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 I,O,w,M,x,P,C,D,L,U,b,F=(1-T)*e.magnitude(n)/(.5*e.magnitude(N)),z=0;do{F-=z,w=1/(1+F*A),M=1/(1+F*g),x=1/(1+F*S),P=w*w,C=M*M,D=x*x,L=P*w,U=C*M,b=D*x,I=m*P+y*C+_*D-1,O=m*L*A+y*U*g+_*b*S;var B=-2*O;z=I/B}while(Math.abs(I)>r.EPSILON12);return t(c)?(c.x=l*w,c.y=f*M,c.z=h*x,c):new e(l*w,f*M,h*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),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(t,p,s);_=e.normalize(_,_);var v=e.subtract(t,y,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){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){a=n(a,0),e.pack(t._radii,r,a)},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;n>a;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;n>a;++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}),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){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},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.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.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){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},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 n>t&&(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;h>f;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.clone=function(e,t){return n(e)?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):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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;i>a&&(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;i>a&&o>0?a+=u.TWO_PI:c>o&&a>0&&(o+=u.TWO_PI),i>a&&0>c?c+=u.TWO_PI:c>o&&0>i&&(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)&&l>=f)){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.union=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.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,a=e.west,i=e.east;return a>i&&(i+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(i>n||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++,0>f?p.latitude=f:h>0?p.latitude=h:p.latitude=0;for(var m=1;8>m;++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/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.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;n>c;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){return r(e)?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):void 0},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:0>r&&(n.width-=r,n.x=t.x),a>n.height?n.height=a:0>a&&(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","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(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 u(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;3>n;++n){var r=e[o.getElementIndex(d[n],h[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=i.EPSILON15,r=0,a=1,u=0;3>u;++u){var s=Math.abs(e[o.getElementIndex(d[u],h[u])]);s>r&&(a=u,r=s)}var c=1,l=0,f=h[a],E=d[a];if(Math.abs(e[o.getElementIndex(E,f)])>n){var p,m=e[o.getElementIndex(E,E)],y=e[o.getElementIndex(f,f)],_=e[o.getElementIndex(E,f)],v=(m-y)/2/_;p=0>v?-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=o.clone(o.IDENTITY,t),t[o.getElementIndex(f,f)]=t[o.getElementIndex(E,E)]=c,t[o.getElementIndex(E,f)]=l,t[o.getElementIndex(f,E)]=-l,t}o.packedLength=9,o.pack=function(e,n,r){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]},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},o.clone=function(e,t){return n(e)?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 o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},o.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,u=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,v=2*(c-u),T=2*(i-l),R=2*(c+u),A=-r-s+f+d;return n(t)?(t[0]=E,t[1]=y,t[2]=T,t[3]=p,t[4]=_,t[5]=R,t[6]=m,t[7]=v,t[8]=A,t):new o(E,p,m,y,_,v,T,R,A)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,r,-a,0,a,r)},o.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 o(r,0,a,0,1,0,-a,0,r)},o.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 o(r,-a,0,a,r,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},o.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},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;o.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 f=new e;o.getMaximumScale=function(t){return o.getScale(t,f),e.maximumComponent(f)},o.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},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[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},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[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},o.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},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[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},o.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},o.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},o.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],d=[2,2,1],E=new o,p=new o;return o.computeEigenDecomposition=function(e,t){var r=i.EPSILON20,a=10,l=0,f=0;n(t)||(t={});for(var h=t.unitary=o.clone(o.IDENTITY,t.unitary),d=t.diagonal=o.clone(e,t.diagonal),m=r*u(d);a>f&&s(d)>m;)c(d,E),o.transpose(E,p),o.multiply(d,E,d), +o.multiply(p,d,d),o.multiply(h,E,h),++l>2&&(++f,l=0);return 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[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},o.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)},o.inverse=function(e,t){var n=e[0],a=e[1],u=e[2],s=e[3],c=e[4],l=e[5],f=e[6],h=e[7],d=e[8],E=o.determinant(e);if(Math.abs(E)<=i.EPSILON15)throw new r("matrix is not invertible");t[0]=c*d-h*l,t[1]=h*u-a*d,t[2]=a*l-c*u,t[3]=f*l-s*d,t[4]=n*d-f*u,t[5]=s*u-n*l,t[6]=s*h-f*c,t[7]=f*a-n*h,t[8]=n*c-s*a;var p=1/E;return o.multiplyByScalar(t,p,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=a(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=a(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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.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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(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)}c.packedLength=16,c.pack=function(e,t,r){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]},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),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},c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[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]):void 0},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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new c);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,l=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,v=s-d-m+_,T=2*(l-y),R=2*(f+p),A=2*(l+y),g=-s+d-m+_,S=2*(E-h),N=2*(f-p),I=2*(E+h),O=-s-d+m+_;return a[0]=v*i,a[1]=A*i,a[2]=N*i,a[3]=0,a[4]=T*o,a[5]=g*o,a[6]=I*o,a[7]=0,a[8]=R*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},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.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 l=new e,f=new e,h=new e;c.fromCamera=function(t,n){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,E=l.x,p=l.y,m=l.z,y=h.x,_=h.y,v=h.z,T=a.x,R=a.y,A=a.z,g=u*-T+s*-R+d*-A,S=y*-T+_*-R+v*-A,N=E*T+p*R+m*A;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]=d,n[9]=v,n[10]=-m,n[11]=0,n[12]=g,n[13]=S,n[14]=N,n[15]=1,n):new c(u,s,d,g,y,_,v,S,-E,-p,-m,N,0,0,0,1)},c.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},c.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},c.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},c.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},c.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},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,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},c.setColumn=function(e,t,n,r){r=c.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},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],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},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 d=new e;c.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 E=new e;c.getMaximumScale=function(t){return c.getScale(t,E),e.maximumComponent(E)},c.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],v=t[0],T=t[1],R=t[2],A=t[3],g=t[4],S=t[5],N=t[6],I=t[7],O=t[8],w=t[9],M=t[10],x=t[11],P=t[12],C=t[13],D=t[14],L=t[15],U=r*v+u*T+f*R+p*A,b=a*v+s*T+h*R+m*A,F=i*v+c*T+d*R+y*A,z=o*v+l*T+E*R+_*A,B=r*g+u*S+f*N+p*I,G=a*g+s*S+h*N+m*I,q=i*g+c*S+d*N+y*I,W=o*g+l*S+E*N+_*I,H=r*O+u*w+f*M+p*x,V=a*O+s*w+h*M+m*x,X=i*O+c*w+d*M+y*x,Y=o*O+l*w+E*M+_*x,k=r*P+u*C+f*D+p*L,j=a*P+s*C+h*D+m*L,Z=i*P+c*C+d*D+y*L,K=o*P+l*C+E*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]=H,n[9]=V,n[10]=X,n[11]=Y,n[12]=k,n[13]=j,n[14]=Z,n[15]=K,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],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],v=t[5],T=t[6],R=t[8],A=t[9],g=t[10],S=t[12],N=t[13],I=t[14],O=r*p+o*m+c*y,w=a*p+u*m+l*y,M=i*p+s*m+f*y,x=r*_+o*v+c*T,P=a*_+u*v+l*T,C=i*_+s*v+f*T,D=r*R+o*A+c*g,L=a*R+u*A+l*g,U=i*R+s*A+f*g,b=r*S+o*N+c*I+h,F=a*S+u*N+l*I+d,z=i*S+s*N+f*I+E;return n[0]=O,n[1]=w,n[2]=M,n[3]=0,n[4]=x,n[5]=P,n[6]=C,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},c.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],v=t[7],T=t[8],R=r*h+o*d+c*E,A=a*h+u*d+l*E,g=i*h+s*d+f*E,S=r*p+o*m+c*y,N=a*p+u*m+l*y,I=i*p+s*m+f*y,O=r*_+o*v+c*T,w=a*_+u*v+l*T,M=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]=I,n[7]=0,n[8]=O,n[9]=w,n[10]=M,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,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;c.multiplyByUniformScale=function(e,t,n){return p.x=t,p.y=t,p.z=t,c.multiplyByScale(e,p,n)},c.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?c.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)},c.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},c.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},c.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},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],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},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 m=new u,y=new u,_=new t,v=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,m),y,o.EPSILON7)&&t.equals(c.getRow(e,3,_),v))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],l=e[12],f=e[1],h=e[5],d=e[9],E=e[13],p=e[2],T=e[6],R=e[10],A=e[14],g=e[3],S=e[7],N=e[11],I=e[15],O=R*I,w=A*N,M=T*I,x=A*S,P=T*N,C=R*S,D=p*I,L=A*g,U=p*N,b=R*g,F=p*S,z=T*g,B=O*h+x*d+P*E-(w*h+M*d+C*E),G=w*f+D*d+b*E-(O*f+L*d+U*E),q=M*f+L*h+F*E-(x*f+D*h+z*E),W=C*f+U*h+z*d-(P*f+b*h+F*d),H=w*a+M*i+C*l-(O*a+x*i+P*l),V=O*r+L*i+U*l-(w*r+D*i+b*l),X=x*r+D*a+z*l-(M*r+L*a+F*l),Y=P*r+b*a+F*i-(C*r+U*a+z*i);O=i*E,w=l*d,M=a*E,x=l*h,P=a*d,C=i*h,D=r*E,L=l*f,U=r*d,b=i*f,F=r*h,z=a*f;var k=O*S+x*N+P*I-(w*S+M*N+C*I),j=w*g+D*N+b*I-(O*g+L*N+U*I),Z=M*g+L*S+F*I-(x*g+D*S+z*I),K=C*g+U*S+z*N-(P*g+b*S+F*N),J=M*R+C*A+w*T-(P*A+O*T+x*R),Q=U*A+O*p+L*R-(D*R+b*A+w*p),$=D*T+z*A+x*p-(F*A+M*p+L*T),ee=F*R+P*p+b*T-(U*T+z*R+C*p),te=r*B+a*G+i*q+l*W;if(Math.abs(te)<o.EPSILON20)throw new s("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]=V*te,n[6]=X*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},c.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},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,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/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/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";function d(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var E=new e,p=new e,m=new e,y=new e,_=new e,v=new e,T=new e,R=new e,A=new e,g=new e,S=new e,N=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,E),o=e.clone(a,p),u=e.clone(a,m),s=e.clone(a,y),c=e.clone(a,_),l=e.clone(a,v),f=t.length,h=1;f>h;h++){e.clone(t[h],a);var I=a.x,O=a.y,w=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),w<u.z&&e.clone(a,u),w>l.z&&e.clone(a,l)}var M=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=M;x>L&&(L=x,C=o,D=c),P>L&&(L=P,C=u,D=l);var U=A;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=g;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(h=0;f>h;h++){e.clone(t[h],a);var W=e.magnitude(e.subtract(a,G,R));W>q&&(q=W);var H=e.magnitudeSquared(e.subtract(a,U,R));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*a.x)/V,U.y=(F*U.y+X*a.y)/V,U.z=(F*U.z+X*a.z)/V}}return q>F?(e.clone(U,n.center),n.radius=F):(e.clone(G,n.center),n.radius=q),n};var I=new o,O=new e,w=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,I),h.southwest(t,M),M.height=i,h.northeast(t,x),x.height=o;var s=a.project(M,O),c=a.project(x,w),l=c.x-s.x,f=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+f*f+E*E);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*f,p.z=s.z+.5*E,u};var P=[];d.fromRectangle3D=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0);var u;return r(e)&&(u=h.subsample(e,t,a,P)),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,E),c=e.clone(u,p),l=e.clone(u,m),f=e.clone(u,y),h=e.clone(u,_),I=e.clone(u,v),O=t.length,w=0;O>w;w+=i){var M=t[w]+a.x,x=t[w+1]+a.y,P=t[w+2]+a.z;u.x=M,u.y=x,u.z=P,M<s.x&&e.clone(u,s),M>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>h.y&&e.clone(u,h),P<l.z&&e.clone(u,l),P>I.z&&e.clone(u,I)}var C=e.magnitudeSquared(e.subtract(f,s,R)),D=e.magnitudeSquared(e.subtract(h,c,R)),L=e.magnitudeSquared(e.subtract(I,l,R)),U=s,b=f,F=C;D>F&&(F=D,U=c,b=h),L>F&&(F=L,U=l,b=I);var z=A;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=g;q.x=s.x,q.y=c.y,q.z=l.z;var W=S;W.x=f.x,W.y=h.y,W.z=I.z;var H=e.multiplyByScalar(e.add(q,W,R),.5,N),V=0;for(w=0;O>w;w+=i){u.x=t[w]+a.x,u.y=t[w+1]+a.y,u.z=t[w+2]+a.z;var X=e.magnitude(e.subtract(u,H,R));X>V&&(V=X);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 V>G?(e.clone(z,o.center),o.radius=G):(e.clone(H,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,E),u=e.clone(i,p),s=e.clone(i,m),c=e.clone(i,y),l=e.clone(i,_),f=e.clone(i,v),h=t.length,I=0;h>I;I+=3){var O=t[I]+n[I],w=t[I+1]+n[I+1],M=t[I+2]+n[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,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=A;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=g;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;h>I;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 H=e.magnitude(e.subtract(i,q,R));H>W&&(W=H);var V=e.magnitudeSquared(e.subtract(i,b,R));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*i.x)/X,b.y=(z*b.y+Y*i.y)/X,b.z=(z*b.z+Y*i.z)/X}}return W>z?(e.clone(b,a.center),a.radius=z):(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;a>o;o++)i.push(t[o].center);n=d.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;a>o;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var D=new e,L=new e,U=new e;d.fromOrientedBoundingBox=function(t,n){r(n)||(n=new d);var a=t.halfAxes,i=c.getColumn(a,0,D),o=c.getColumn(a,1,L),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){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new d(t.center,t.radius):void 0},d.packedLength=4,d.pack=function(e,t,r){r=n(r,0);var a=e.center;t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius},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 b=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,b),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-a>o?u.OUTSIDE:a>o?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 G=new e;d.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,G),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,W=new e,H=new e,V=new e,X=new e,Y=new t,k=new Array(8),j=0;8>j;++j)k[j]=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,q),c=e.cross(e.UNIT_Z,s,W);e.normalize(c,c);var l=e.cross(s,c,H);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=k,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;m>y;++y){var _=E[y];e.add(o,_,_);var v=i.cartesianToCartographic(_,Y);r.project(v,_)}a=d.fromPoints(E,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},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("Renderer/WebGLConstants",["../Core/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/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(){return a.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?r.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(r.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",e(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;r>n;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(v)){v=!1;var e=/ Chrome\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(v=!0,T=r(e[1]))}return v}function i(){return a()&&T}function o(){if(!t(R)&&(R=!1,!a()&&/ Safari\/[\.0-9]+/.test(_.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(R=!0,A=r(e[1]))}return R}function u(){return o()&&A}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(_.userAgent);null!==e&&(g=!0,S=r(e[1]),S.isNightly=!!e[2])}return g}function c(){return s()&&S}function l(){if(!t(N)){N=!1;var e;"Microsoft Internet Explorer"===_.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(_.userAgent),null!==e&&(N=!0,I=r(e[1]))):"Netscape"===_.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(_.userAgent),null!==e&&(N=!0,I=r(e[1])))}return N}function f(){return l()&&I}function h(){if(!t(O)){O=!1;var e=/Firefox\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(O=!0,w=r(e[1]))}return O}function d(){return t(M)||(M=/Windows/i.test(_.appVersion)),M}function E(){return h()&&w}function p(){return t(x)||(x="undefined"!=typeof PointerEvent&&(!t(_.pointerEnabled)||_.pointerEnabled)),x}function m(){if(!t(C)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;C=t(n)&&""!==n,C&&(P=n)}return C}function y(){return m()?P:void 0}var _;_="undefined"!=typeof navigator?navigator:{};var v,T,R,A,g,S,N,I,O,w,M,x,P,C,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:E,isWindows:d,hardwareConcurrency:e(_.hardwareConcurrency,3),supportsPointerEvents:p,supportsImageRenderingPixelated:m,imageRenderingValue:y};return D.supportsFullscreen=function(){return n.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,a,i){"use strict";if(!a.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return n(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,n,a,i){switch(a=t(a,0),i=t(i,(n.byteLength-a)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,a,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,a,i);case o.SHORT:return new Int16Array(n,a,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,a,i);case o.FLOAT:return new Float32Array(n,a,i);case o.DOUBLE:return new Float64Array(n,a,i);default:throw new r("componentDatatype is not a valid value.")}},i(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;f>h;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 v=e.add(y,_,r.center);return e.multiplyByScalar(v,.5,v),r},i.clone=function(t,r){return n(t)?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):void 0},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:0>s+u?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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,0>i?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(0>f)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(0>y){var _,v,T;h*f>=l*d?(_=o,v=E,T=-2*u*E+o*p):(_=c,v=m,T=-c*p+2*s*m);var R=0>T?-1:1,A=-R*Math.abs(_)*Math.sqrt(-y);i=-T+A;var g=i/2,S=0>g?-Math.pow(-g,1/3):Math.pow(g,1/3),N=i===A?-S:-v/S;return a=0>=v?S+N:-T/(S*S+N*N+v),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var I=E,O=-2*u*E+o*p,w=m,M=-c*p+2*s*m,x=Math.sqrt(y),P=Math.sqrt(3)/2,C=Math.abs(Math.atan2(o*x,-O)/3);a=2*Math.sqrt(-I);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,-M)/3),a=2*Math.sqrt(-w),D=Math.cos(C),i=a*D,L=a*(-D/2-P*Math.sin(C));var z=-c,B=2*s>i+L?i+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 V>=F?G>=F?G>=V?[F,V,G]:[F,G,V]:[G,F,V]:G>=F?[V,F,G]:G>=V?[V,G,F]:[G,V,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=0>u?-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,0>u?[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),v=Math.sqrt(y);return[h-v,h-_,h+_,h+v]}if(m>=0&&0>y)return p=Math.sqrt(m),[h-p,h+p];if(0>m&&y>=0)return p=Math.sqrt(y),[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,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 E,p,m=d[0],y=a-m,_=y*y,v=t/2,T=y/2,R=_-4*o,A=_+4*Math.abs(o),g=c-4*m,S=c+4*Math.abs(m);if(0>m||g*A>R*S){var N=Math.sqrt(g);E=N/2,p=0===N?0:(t*T-i)/N}else{var I=Math.sqrt(R);E=0===I?0:(t*T-i)/I,p=I/2}var O,w;0===v&&0===E?(O=0,w=0):n.sign(v)===n.sign(E)?(O=v+E,w=m/O):(w=v-E,O=m/w);var M,x;0===T&&0===p?(M=0,x=0):n.sign(T)===n.sign(p)?(M=T+p,x=o/M):(x=T-p,M=o/x);var P=r.computeRealRoots(1,O,M),C=r.computeRealRoots(1,w,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,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=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>f?d+1:d,d+=0>h?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(t,r,a,o,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,p=e.subtract(a,r,m),R=e.subtract(o,r,y),A=e.cross(E,R,_),g=e.dot(p,A);if(u){if(g<i.EPSILON6)return;if(s=e.subtract(d,r,v),l=e.dot(s,A),0>l||l>g)return;if(c=e.cross(s,p,T),f=e.dot(E,c),0>f||l+f>g)return;h=e.dot(R,c)/g}else{if(Math.abs(g)<i.EPSILON6)return;var S=1/g;if(s=e.subtract(d,r,v),l=e.dot(s,A)*S,0>l||l>1)return;if(c=e.cross(s,p,T),f=e.dot(E,c)*S,0>f||l+f>1)return;h=e.dot(R,c)*S}return h}function f(e,t,n,r){var a=t*t-4*e*n;if(!(0>a)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(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={});var i=t.origin,o=t.direction,u=n.center,s=n.radius*n.radius,c=e.subtract(i,u,_),l=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,E=f(l,h,d,A);return r(E)?(a.start=E.root0,a.stop=E.root1,a):void 0}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 E(t,n,r,a,c){var l,f=a*a,h=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,p=c*(a*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),m=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),v=[];if(0===_&&0===y){if(l=u.computeRealRoots(E,p,m),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],g=Math.sqrt(Math.max(1-A*A,0));v.push(new e(a,c*A,c*-g)),v.push(new e(a,c*A,c*g))}return v}var S=_*_,N=y*y,I=E*E,O=_*y,w=I+N,M=2*(p*E+O),x=2*m*E+p*p-N+S,P=2*(m*p-O),C=m*m-S;if(0===w&&0===M&&0===x&&0===P)return v;l=s.computeRealRoots(w,M,x,P,C);var D=l.length;if(0===D)return v;for(var L=0;D>L;++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(m)?d(E*F+m,p*b,i.EPSILON12):i.sign(m)===i.sign(p*b)?d(E*F,p*b+m,i.EPSILON12):d(E*F+p*b,m,i.EPSILON12);var G=d(y*b,_,i.EPSILON15),q=U*G;0>q?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)),++L):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(!(0>l))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var m=new e,y=new e,_=new e,v=new e,T=new e;p.rayTriangle=function(t,n,a,i,o,u){var s=l(t,n,a,i,o);if(r(s)&&!(0>s))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;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 f=l(c,a,i,o,u);return!r(f)||0>f||f>e.distance(t,n)?void 0:(r(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var A={root0:0,root1:0};p.raySphere=function(e,t,n){return n=h(e,t,n),!r(n)||n.stop<0?void 0:(n.start=Math.max(n.start,0),n)};var g=new c;p.lineSegmentSphere=function(t,n,a,i){var o=g,u=e.subtract(n,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=h(o,a,i),!r(i)||i.stop<0||i.start>s?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i)};var S=new e,N=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,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,i>d)return;if(d>i){o=h*h-i,u=-h+Math.sqrt(o);var E=u/a,p=r/u;return p>E?{start:E,stop:p}:{start:p,stop:E}}var m=Math.sqrt(r/a);return{start:m,stop:m}}return 1>f?(r=f-1,a=e.magnitudeSquared(l),i=a*r,o=h*h-i,u=-h+Math.sqrt(o),{start:0,stop:u/a}):0>h?(a=e.magnitudeSquared(l),{start:0,stop:-h/a}):void 0};var I=new e,O=new e,w=new e,M=new e,x=new e,P=new o,C=new o,D=new o,L=new o,U=new o,b=new o,F=new o,z=new e,B=new e,G=new t;p.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction,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),h=e.mostOrthogonalAxis(l,M),d=e.normalize(e.cross(h,f,O),O),p=e.normalize(e.cross(f,d,w),w),m=P;m[0]=f.x,m[1]=f.y,m[2]=f.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 y=o.transpose(m,C),_=o.fromScale(n.radii,D),v=o.fromScale(n.oneOverRadii,L),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,g=o.multiply(o.multiply(y,v,b),T,b),S=o.multiply(o.multiply(g,_,F),m,F),N=o.multiplyByVector(g,a,x),q=E(S,e.negate(N,I),0,0,1),W=q.length;if(W>0){for(var H=e.clone(e.ZERO,B),V=Number.NEGATIVE_INFINITY,X=0;W>X;++X){R=o.multiplyByVector(_,o.multiplyByVector(m,q[X],z),z);var Y=e.normalize(e.subtract(R,a,M),M),k=e.dot(Y,u);k>V&&(V=k,H=e.clone(R,H))}var j=n.cartesianToCartographic(H,G);return V=i.clamp(V,0,1),A=e.magnitude(e.subtract(H,a,M))*Math.sqrt(1-V*V),A=c?-A:A,j.height=A,n.cartographicToCartesian(j,new e)}};var q=new e;return p.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(!(0>f||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}),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(r){return i(r)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(a){return i(a)}});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(t){r.progress(t)}}: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=R,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,_,v;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))},v=0;_>v;++v)v in t&&e(t[v],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;a>s;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 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 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=E,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(;a>i;++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;o>=i;)if(r=~~((i+o)/2),a=n(e[r],t),0>a)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,v="",T=!1,R=!1,A=" ",g=s.length,S=0;s&&g>S;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,0>c&&(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,T,A);case"c":return u(String.fromCharCode(+y),_,c,f,T);case"b":return o(y,2,R,_,c,f,T);case"o":return o(y,8,R,_,c,f,T);case"x":return o(y,16,R,_,c,f,T);case"X":return o(y,16,R,_,c,f,T).toUpperCase();case"u":return o(y,10,R,_,c,f,T);case"i":case"d":return d=+y||0,d=Math.round(d-d%1),E=0>d?"-":v,y=E+a(String(Math.abs(d)),f,"0",!1),i(y,E,_,c,T);case"e":case"E":case"f":case"F":case"g":case"G":return d=+y,E=0>d?"-":v,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,T)[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){v.julianDate=e;var n=p.leapSeconds,r=t(n,v,l);0>r&&(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){v.julianDate=e;var r=p.leapSeconds,a=t(r,v,l);if(0>a&&(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):1>=i?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,0>t&&(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,0>r&&(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,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})?$/,I=/^(\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,M="Invalid ISO 8601 date.";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,i,u,s=e.split("T"),l=1,h=1,m=0,v=0,N=0,x=0,P=s[0],C=s[1];if(!r(P))throw new a(M);var D;if(s=P.match(S),null!==s){if(D=P.split("-").length-1,D>0&&2!==D)throw new a(M);n=+s[1],l=+s[2],h=+s[3]}else if(s=P.match(R),null!==s)n=+s[1],l=+s[2];else if(s=P.match(T),null!==s)n=+s[1];else{var L;if(s=P.match(A),null!==s){if(n=+s[1],L=+s[2],u=o(n),1>L||u&&L>366||!u&&L>365)throw new a(M)}else{if(s=P.match(g),null===s)throw new a(M);n=+s[1];var U=+s[2],b=+s[3]||0;if(D=P.split("-").length-1,D>0&&(!r(s[3])&&1!==D||r(s[3])&&2!==D))throw new a(M);var F=new Date(Date.UTC(n,0,4));L=7*U+b-F.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(L),l=i.getUTCMonth()+1,h=i.getUTCDate()}if(u=o(n),1>l||l>12||1>h||(2!==l||!u)&&h>y[l-1]||u&&2===l&&h>_)throw new a(M);var z;if(r(C)){if(s=C.match(w),null!==s){if(D=C.split(":").length-1,D>0&&2!==D&&3!==D)throw new a(M);m=+s[1],v=+s[2],N=+s[3],x=1e3*+(s[4]||0),z=5}else if(s=C.match(O),null!==s){if(D=C.split(":").length-1,D>2)throw new a(M);m=+s[1],v=+s[2],N=60*+(s[3]||0),z=4}else{if(s=C.match(I),null===s)throw new a(M);m=+s[1],v=60*+(s[2]||0),z=3}if(v>=60||N>=61||m>24||24===m&&(v>0||N>0||x>0))throw new a(M);var B=s[z],G=+s[z+1],q=+(s[z+2]||0);switch(B){case"+":m-=G,v-=q;break;case"-":m+=G,v+=q;break;case"Z":break;default:v+=new Date(Date.UTC(n,l-1,h,m,v)).getTimezoneOffset()}}else v+=new Date(n,l-1,h).getTimezoneOffset();var W=60===N;for(W&&N--;v>=60;)v-=60,m++;for(;m>=24;)m-=24,h++;for(i=u&&2===l?_:y[l-1];h>i;)h-=i,l++,l>12&&(l-=12,n++),i=u&&2===l?_:y[l-1];for(;0>v;)v+=60,m--;for(;0>m;)m+=24,h--;for(;1>h;)l--,1>l&&(l+=12,n--),i=u&&2===l?_:y[l-1],h+=i;var H=E(n,l,h,m,v,N,x);return r(t)?(d(H[0],H[1],t),f(t)):t=new p(H[0],H[1],c.UTC),W&&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,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=y,t.month=m,t.day=E,t.hour=_,t.minute=T,t.second=R,t.millisecond=A,t.isLeapSecond=n,t):new i(y,m,E,_,T,R,A,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){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new p(e.dayNumber,e.secondsOfDay,c.TAI):void 0},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){v.julianDate=e;var n=p.leapSeconds,r=t(n,v,l);return 0>r&&(r=~r,--r,0>r&&(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)],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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,n,r,a,i){"use strict";function o(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,u=n.headers,s=n.overrideMimeType,c=n.withCredentials;return e(n.url,function(t){var n=e.defer();return o.load(t,r,a,i,u,n,s,c),n.promise})}function u(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function s(e,t){for(var n=u(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 c(e,n){n=t(n,"");var a=e[1],i=!!e[2],o=e[3];switch(n){case"":case"text":return u(i,o);case"arraybuffer":return s(i,o);case"blob":var c=s(i,o);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(u(i,o),a);case"json":return JSON.parse(u(i,o));default:throw new r("Unhandled responseType: "+n)}}var l=/^data:(.*?)(;base64)?,(.*)$/;return o.load=function(e,t,r,o,u,s,f,h){var d=l.exec(e);if(null!==d)return void s.resolve(c(d,t));var E=new XMLHttpRequest;if(n(f)&&n(E.overrideMimeType)&&E.overrideMimeType(f),E.open(r,e,!0),n(u))for(var p in u)u.hasOwnProperty(p)&&E.setRequestHeader(p,u[p]);n(t)&&(E.responseType=t),n(h)&&(E.withCredentials=h),E.onload=function(){E.status>=200&&E.status<300?n(E.response)?s.resolve(E.response):n(E.responseXML)&&E.responseXML.hasChildNodes()?s.resolve(E.responseXML):n(E.responseText)?s.resolve(E.responseText):s.reject(new i("unknown XMLHttpRequest response type.")):s.reject(new a(E.status,E.response,E.getAllResponseHeaders()))},E.onerror=function(e){s.reject(new a)},E.send(o)},o.defaultLoad=o.load,o}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";function n(n,r){return e({url:n,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return n}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)||(a={}),t(a.headers)?t(a.headers.Accept)||(a.headers=e(a.headers),a.headers.Accept=i.Accept):a.headers=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(0>a||0>i||0>s||0>c||0>h||0>E||0>p)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 _,v=e._addNewLeapSeconds,T=0,R=m.length;R>T;T+=e._columnCount){var A=m[T+a],g=m[T+p],S=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(S,g,f.TAI);if(y.push(N),v){if(g!==_&&r(_)){var I=o.leapSeconds,O=t(I,N,d);if(0>O){var w=new u(N,g);I.splice(~O,0,w)}}_=g}}}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 v=n[h+e._taiMinusUtcSecondsColumn],T=n[d+e._taiMinusUtcSecondsColumn];v!==T&&(l.equals(r)?E=y:y-=T-v)}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,0>s&&(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("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/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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","require"],function(e,t,n,r,a){"use strict";function i(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),a=d.exec(r);if(null!==a)return a[1]}}function o(){if(t(l))return l;var a;if(a="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:i(),!t(a))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new e(r(a))}function u(e){return a.toUrl("../"+e)}function s(t){return new e(t).resolve(o()).toString()}function c(e){t(f)||(f=t(a.toUrl)?u:s),t(h)||(h=document.createElement("a"));var n=f(e);return h.href=n,h.href=h.href,h.href}var l,f,h,d=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=d,c.setBaseUrl=function(t){l=new e(t).resolve(new e(document.location.href))},c}),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;t>=s;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;t>=c;++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;s>u;++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;0>u&&(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;h>=E;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(0>i)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);0>s&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,0>s&&(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,v=this._coef,T=this._xTable;for(E=0;u>=E;++E)y[E]=m-T[E];for(E=0;u>=E;++E){for(v[E]=1,p=0;u>=p;++p)p!==E&&(v[E]*=y[p]);v[E]*=_[E];var R=3*(s+E);n.x+=v[E]*d[R++],n.y+=v[E]*d[R++],n.s+=v[E]*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],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],v=m[_];r=Math.sqrt(e[u.getElementIndex(y,y)]-e[u.getElementIndex(_,_)]-e[u.getElementIndex(v,v)]+1);var T=f;T[y]=.5*r,r=.5/r,c=(e[u.getElementIndex(v,_)]-e[u.getElementIndex(_,v)])*r,T[_]=(e[u.getElementIndex(_,y)]+e[u.getElementIndex(y,_)])*r,T[v]=(e[u.getElementIndex(v,y)]+e[u.getElementIndex(y,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,E=new e,p=new s,m=new s,y=new s;s.packedLength=4,s.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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;i>a;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){return n(e)?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):void 0},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 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(0>a&&(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,g=new e,S=new s,N=new s;s.computeInnerQuadrangle=function(t,n,r,a){var i=s.conjugate(n,S);s.multiply(i,r,N);var o=s.log(N,A);s.multiply(i,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(n,S,a)},s.squad=function(e,t,n,r,a,i){var o=s.slerp(e,t,a,S),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,w=a.supportsTypedArrays()?new Float32Array(8):[],M=a.supportsTypedArrays()?new Float32Array(8):[],x=a.supportsTypedArrays()?new Float32Array(8):[],P=a.supportsTypedArrays()?new Float32Array(8):[],C=0;7>C;++C){var D=C+1,L=2*D+1;w[C]=1/(D*L),M[C]=D/L}return w[7]=O/136,M[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)x[f]=(w[f]*c-M[f])*o,P[f]=(w[f]*l-M[f])*o;var h=a*n*(1+x[0]*(1+x[1]*(1+x[2]*(1+x[3]*(1+x[4]*(1+x[5]*(1+x[6]*(1+x[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=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,S),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","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./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){"use strict";var _={},v=new n,T=new n,R=new n;_.eastNorthUpToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=v,s=T,l=R;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.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,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var A=new n,g=new n,S=new n;_.northEastDownToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=-o,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]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=A,s=g,l=S;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.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(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},_.northUpEastToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=o,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(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=v,s=T,l=R;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(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 p(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 N=new m,I=new n(1,1,1),O=new p;_.headingPitchRollToFixedFrame=function(e,t,r,a,i,o){var u=m.fromHeadingPitchRoll(t,r,a,N),s=p.fromTranslationQuaternionRotationScale(n.ZERO,u,I,O);return o=_.eastNorthUpToFixedFrame(e,i,o),p.multiply(o,s,o)};var w=new p,M=new E;_.headingPitchRollQuaternion=function(e,t,n,r,a,i){var o=_.headingPitchRollToFixedFrame(e,t,n,r,a,w),u=p.getRotation(o,M);return m.fromRotationMatrix(u,i)};var x=24110.54841,P=8640184.812866,C=.093104,D=-62e-7,L=1.1772758384668e-19,U=72921158553e-15,b=d.TWO_PI/86400,F=new h;_.computeTemeToPseudoFixedMatrix=function(e,t){F=h.addSeconds(e,-h.computeTaiMinusUtc(e),F);var n,r=F.dayNumber,a=F.secondsOfDay,o=r-2451545;n=a>=43200?(o+.5)/y.DAYS_PER_JULIAN_CENTURY:(o-.5)/y.DAYS_PER_JULIAN_CENTURY;var u=x+n*(P+n*(C+n*D)),s=u*b%d.TWO_PI,c=U+L*(r-2451545.5),l=(a+.5*y.SECONDS_PER_DAY)%y.SECONDS_PER_DAY,f=s+c*l,p=Math.cos(f),m=Math.sin(f);return i(t)?(t[0]=p,t[1]=-m,t[2]=0,t[3]=m,t[4]=p,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(p,m,0,-m,p,0,0,0,1)},_.iau2006XysData=new l,_.earthOrientationParameters=u.NONE;var z=32.184,B=2451545;_.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+z,a=t.stop.dayNumber,i=t.stop.secondsOfDay+z,o=_.iau2006XysData.preload(n,r,a,i),u=_.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},_.computeIcrfToFixedMatrix=function(e,t){i(t)||(t=new E);var n=_.computeFixedToIcrfMatrix(e,t);if(i(n))return E.transpose(n,t)};var G=new f(0,0,0),q=new s(0,0,0,0,0,0),W=new E,H=new E;_.computeFixedToIcrfMatrix=function(e,t){i(t)||(t=new E);var n=_.earthOrientationParameters.compute(e,q);if(i(n)){var r=e.dayNumber,a=e.secondsOfDay+z,o=_.iau2006XysData.computeXysRadians(r,a,G);if(i(o)){var u=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=W;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=E.fromRotationZ(-o.s,H),p=E.multiply(l,f,W),m=e.dayNumber,v=e.secondsOfDay-h.computeTaiMinusUtc(e)+n.ut1MinusUtc,T=m-2451545,R=v/y.SECONDS_PER_DAY,A=.779057273264+R+.00273781191135448*(T+R);A=A%1*d.TWO_PI;var g=E.fromRotationZ(A,H),S=E.multiply(p,g,W),N=Math.cos(n.xPoleWander),I=Math.cos(n.yPoleWander),O=Math.sin(n.xPoleWander),w=Math.sin(n.yPoleWander),M=r-B+a/y.SECONDS_PER_DAY;M/=36525;var x=-47e-6*M*d.RADIANS_PER_DEGREE/3600,P=Math.cos(x),C=Math.sin(x),D=H;return D[0]=N*P,D[1]=N*C,D[2]=O,D[3]=-I*C+w*O*P,D[4]=I*P+w*O*C,D[5]=-w*N,D[6]=-w*C-I*O*P,D[7]=w*P-I*O*C,D[8]=I*N,E.multiply(S,D,t)}}};var V=new r;_.pointToWindowCoordinates=function(e,t,n,r){return r=_.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},_.pointToGLWindowCoordinates=function(e,n,a,o){i(o)||(o=new t);var u=V;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,o)};var X=new n,Y=new n,k=new n;return _.rotationMatrixFromPositionVelocity=function(e,t,r,o){var u=a(r,c.WGS84).geodeticSurfaceNormal(e,X),s=n.cross(t,u,Y);n.equalsEpsilon(s,n.ZERO,d.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var l=n.cross(s,t,k);return n.cross(t,l,s),n.negate(s,s),i(o)||(o=new E),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=s.x,o[4]=s.y,o[5]=s.z,o[6]=l.x,o[7]=l.y,o[8]=l.z,o},_}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix3","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E){"use strict";function p(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(f.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(f.getColumn(r,1,m));var i=n.fromCartesian4(f.getColumn(r,2,m));this._plane=h.fromPointNormal(e,i)}var m=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 _=new d,v=new n;p.prototype.projectPointOntoPlane=function(e,r){var a=_;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,v);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,v)),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;r>a;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=_;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,v);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,v));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;n>r;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=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=T,l=0;r>l;++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/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(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=void 0}return i.computeNumberOfVertices=function(e){var r=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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/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.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=t.x,r=t.y;t.x=(1-Math.abs(r))*a.signNotZero(n),t.y=(1-Math.abs(n))*a.signNotZero(r)}return t.x=a.toSNorm(t.x),t.y=a.toSNorm(t.y),t},i.octDecode=function(e,n,r){if(r.x=a.fromSNorm(e),r.y=a.fromSNorm(n),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){var i=r.x;r.x=(1-Math.abs(r.y))*a.signNotZero(i),r.y=(1-Math.abs(i))*a.signNotZero(r.y)}return t.normalize(r,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 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=1===e.x?4095:4096*e.x|0,n=1===e.y?4095:4096*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096;return t.x=Math.floor(n)/4096,t.y=n-Math.floor(n),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,E,p,m,y,_;n(a.z)?(f=t.subtract(s,a,i),h=t.subtract(c,a,o),d=t.subtract(r,a,u),E=t.dot(f,f),p=t.dot(f,h),m=t.dot(f,d),y=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),E=e.dot(f,f),p=e.dot(f,h),m=e.dot(f,d),y=e.dot(h,h),_=e.dot(h,d));var v=1/(E*y-p*p);return l.y=(y*m-p*_)*v,l.z=(E*_-p*m)*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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,r){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,r):new Uint16Array(t,n,r)},r(i)}),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];o>u;)s>a&&(a=s),++u,s=r[u]}for(var c=[],l=0;a+1>l;l++)c[l]=0;for(var f=i+1,h=0;o>h;++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(;r>i;){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||-1===l)&&(l=s,c=h)),++f}return-1===c?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(;d>f;)h>l&&(l=h),++f,h=o[f];if(-1===l)return 0;++l}for(var E=[],p=0;l>p;p++)E[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var m=0;d>f;)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 v,T,R=[],A=[],g=0,S=[],N=c/3,I=[];for(p=0;N>p;p++)I[p]=!1;for(var O,w;-1!==y;){R=[],T=E[y],w=T.vertexTriangles.length;for(var M=0;w>M;++M)if(m=T.vertexTriangles[M],!I[m]){I[m]=!0,f=m+m+m;for(var x=0;3>x;++x)O=o[f],R.push(O),A.push(O),S[g]=O,++g,v=E[O],--v.numLiveTriangles,_-v.timeStamp>s&&(v.timeStamp=_,++_),++f}y=a(o,s,R,E,_,A,l)}return S},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryInstance","./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,E,p,m,y,_,v,T,R,A,g,S,N){"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 O(e){for(var t=e.length,n=t/3*6,r=y.createTypedArray(t,n),a=0,i=0;t>i;i+=3,a+=6)I(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=y.createTypedArray(t,n);I(r,0,e[0],e[1],e[2]);for(var a=6,i=3;t>i;++i,a+=6)I(r,a,e[i-1],e[i],e[i-2]);return r}return new Uint16Array}function M(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;t>o;++o,i+=6)I(r,i,a,e[o],e[o+1]);return r}return new Uint16Array}function x(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 P(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;r>i;i+=3)a.unpack(n,i,ie),A.multiplyByPoint(e,ie,ie),a.pack(ie,n,i)}function D(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;r>i;i+=3)a.unpack(n,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,n,i)}function L(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;r>f;++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 U(e,t){var r,i,o,u,s,l,f,h=e.length,E=(e[0].modelMatrix,c(e[0][t].indices)),p=e[0][t].primitiveType,m=L(e,t);for(r in m)if(m.hasOwnProperty(r))for(s=m[r].values,u=0,i=0;h>i;++i)for(l=e[i][t].attributes[r].values,f=l.length,o=0;f>o;++o)s[u++]=l[o];var _;if(E){var v=0;for(i=0;h>i;++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;h>i;++i){var N=e[i][t].indices,I=N.length;for(u=0;I>u;++u)R[A++]=g+N[u];g+=d.computeNumberOfVertices(e[i][t])}_=R}var O,w=new a,M=0;for(i=0;h>i;++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;h>i;++i){O=e[i][t].boundingSphere;var x=a.magnitude(a.subtract(O.center,w,se))+O.radius;x>M&&(M=x)}return new d({attributes:m,indices:_,primitiveType:p,boundingSphere:c(w)?new n(w,M):void 0})}function b(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),n=y.createTypedArray(t,t),r=0;t>r;++r)n[r]=r;return e.indices=n,e}function F(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;t>a;++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=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;t-1>a;a+=2)n[r++]=a,n[r++]=a-1,n[r++]=a+1,t>a+2&&(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=d.computeNumberOfVertices(e),n=y.createTypedArray(t,t),r=0;t>r;++r)n[r]=r;return e.indices=n,e}function G(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;t>a;++a)n[r++]=a-1,n[r++]=a;return e.indices=n,e.primitiveType=S.LINES,e}function q(e){var t=d.computeNumberOfVertices(e),n=y.createTypedArray(t,2*t);n[0]=0,n[1]=1;for(var r=2,a=2;t>a;++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 H(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function V(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return H(e,e.y<0),H(t,t.y<0),void H(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=0>r;H(e,u),H(t,u),H(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),H(n,!0),H(r,!1)}function Y(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,ge),X(e,n,Ae,Se),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(X(t,n,Re,ge),X(t,e,Ae,Se),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(X(n,e,Re,ge),X(n,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,r?a?i||(X(n,e,Re,ge),X(n,t,Ae,Se),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(X(t,n,Re,ge),X(t,e,Ae,Se),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(X(e,t,Re,ge),X(e,n,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]=n,s.length=3,(1===o||2===o)&&(s[3]=Re,s[4]=Ae,s[5]=ge,s[6]=Se,s.length=7),Ne}}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=y.createTypedArray(o,e.indices),t&&(e.boundingSphere=n.fromVertices(r.position.values)),e}}function j(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 d({attributes:n,indices:[],primitiveType:e.primitiveType})}function Z(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,E){if(c(s)||c(l)||c(f)||c(h)){var p=a.fromArray(u,3*e,Ie),m=a.fromArray(u,3*n,Oe),y=a.fromArray(u,3*i,we),_=t(o,p,m,y,Me);if(c(s)){var v=a.fromArray(s,3*e,Ie),T=a.fromArray(s,3*n,Oe),R=a.fromArray(s,3*i,we);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*E)}if(c(l)){var g=a.fromArray(l,3*e,Ie),S=a.fromArray(l,3*n,Oe),N=a.fromArray(l,3*i,we);a.multiplyByScalar(g,_.x,g),a.multiplyByScalar(S,_.y,S),a.multiplyByScalar(N,_.z,N);var I=a.add(g,S,g);a.add(I,N,I),a.normalize(I,I),a.pack(I,d.binormal.values,3*E)}if(c(f)){var O=a.fromArray(f,3*e,Ie),w=a.fromArray(f,3*n,Oe),M=a.fromArray(f,3*i,we);a.multiplyByScalar(O,_.x,O),a.multiplyByScalar(w,_.y,w),a.multiplyByScalar(M,_.z,M);var x=a.add(O,w,O);a.add(x,M,x),a.normalize(x,x),a.pack(x,d.tangent.values,3*E)}if(c(h)){var P=r.fromArray(h,2*e,xe),C=r.fromArray(h,2*n,Pe),D=r.fromArray(h,2*i,Ce);r.multiplyByScalar(P,_.x,P),r.multiplyByScalar(C,_.y,C),r.multiplyByScalar(D,_.z,D);var L=r.add(P,C,P);r.add(L,D,L),r.pack(L,d.st.values,2*E)}}}function J(e,t,n,r,a,i){var o=e.position.values.length/3;if(-1!==a){var u=r[a],s=n[u];return-1===s?(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.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,m=j(u),y=j(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;T>o;o+=3){var R=p[o],A=p[o+1],g=p[o+2],S=a.fromArray(l,3*R),N=a.fromArray(l,3*A),I=a.fromArray(l,3*g),O=Y(S,N,I);if(c(O)&&O.positions.length>3)for(var w=O.positions,M=O.indices,x=M.length,P=0;x>P;++P){var C=M[P],D=w[C];D.y<0?(t=y.attributes,n=y.indices,r=_):(t=m.attributes,n=m.indices,r=v),i=J(t,n,r,p,3>C?o+C:-1,D),K(R,A,g,D,l,f,h,d,E,t,i)}else c(O)&&(S=O.positions[0],N=O.positions[1],I=O.positions[2]),S.y<0?(t=y.attributes,n=y.indices,r=_):(t=m.attributes,n=m.indices,r=v),i=J(t,n,r,p,o,S),K(R,A,g,S,l,f,h,d,E,t,i),i=J(t,n,r,p,o+1,N),K(R,A,g,N,l,f,h,d,E,t,i),i=J(t,n,r,p,o+2,I),K(R,A,g,I,l,f,h,d,E,t,i)}Z(e,y,m)}function $(e){var t,n=e.geometry,r=n.attributes,i=r.position.values,o=n.indices,u=j(n),s=j(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;l>t;t+=2){var d=o[t],E=o[t+1],p=a.fromArray(i,3*d,Ie),m=a.fromArray(i,3*E,Oe);Math.abs(p.y)<T.EPSILON6&&(p.y<0?p.y=-T.EPSILON6:p.y=T.EPSILON6),Math.abs(m.y)<T.EPSILON6&&(m.y<0?m.y=-T.EPSILON6:m.y=T.EPSILON6);var y=u.attributes,_=u.indices,R=h,A=s.attributes,g=s.indices,S=f,N=v.lineSegmentPlane(p,m,De,we);if(c(N)){var I=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Le);p.y<0&&(a.negate(I,I),y=s.attributes,_=s.indices,R=f,A=u.attributes,g=u.indices,S=h);var O=a.add(N,I,Ue);J(y,_,R,o,t,p),J(y,_,R,o,-1,O),a.negate(I,I),a.add(N,I,O),J(A,g,S,o,-1,O),J(A,g,S,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=h),J(w,M,x,o,t,p),J(w,M,x,o,t+1,m)}}Z(e,s,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,E=c(s.st)?s.st.values:void 0,p=c(s.color)?s.color.values:void 0,m=j(u),y=j(u),_=l.length/3;for(t=0;_>t;t+=4){var R=t,A=t+1,g=t+2,S=t+3,N=a.fromArray(l,3*R,ze),I=a.fromArray(l,3*A,Be),O=a.fromArray(l,3*g,Ge),w=a.fromArray(l,3*S,qe);Math.abs(N.y)<T.EPSILON6&&(N.y=T.EPSILON6*(O.y<0?-1:1),I.y=N.y),Math.abs(O.y)<T.EPSILON6&&(O.y=T.EPSILON6*(N.y<0?-1:1),w.y=O.y);var M=m.attributes,x=m.indices,P=y.attributes,C=y.indices,D=v.lineSegmentPlane(N,O,De,We);if(c(D)){var L=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,He);N.y<0&&(a.negate(L,L),M=y.attributes,x=y.indices,P=m.attributes,C=m.indices);var U=a.add(D,L,Ve);for(M.position.values.push(N.x,N.y,N.z,I.x,I.y,I.z),M.position.values.push(U.x,U.y,U.z),M.position.values.push(U.x,U.y,U.z),a.negate(L,L),a.add(D,L,U),P.position.values.push(U.x,U.y,U.z),P.position.values.push(U.x,U.y,U.z),P.position.values.push(O.x,O.y,O.z,w.x,w.y,w.z),n=3*R;3*R+6>n;++n)M.prevPosition.values.push(f[n]);for(M.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),P.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),n=3*g;3*g+6>n;++n)P.prevPosition.values.push(f[n]);for(n=3*R;3*R+6>n;++n)M.nextPosition.values.push(h[n]);for(M.nextPosition.values.push(O.x,O.y,O.z,O.x,O.y,O.z),P.nextPosition.values.push(O.x,O.y,O.z,O.x,O.y,O.z),n=3*g;3*g+6>n;++n)P.nextPosition.values.push(h[n]);var b=r.fromArray(d,2*R,be),F=Math.abs(b.y);M.expandAndWidth.values.push(-1,F,1,F),M.expandAndWidth.values.push(-1,-F,1,-F),P.expandAndWidth.values.push(-1,F,1,F),P.expandAndWidth.values.push(-1,-F,1,-F);var z=a.magnitudeSquared(a.subtract(D,N,qe));if(z/=a.magnitudeSquared(a.subtract(O,N,qe)),c(p)){var B=i.fromArray(p,4*R,Xe),G=i.fromArray(p,4*g,Xe),q=T.lerp(B.x,G.x,z),W=T.lerp(B.y,G.y,z),H=T.lerp(B.z,G.z,z),V=T.lerp(B.w,G.w,z);for(n=4*R;4*R+8>n;++n)M.color.values.push(p[n]);for(M.color.values.push(q,W,H,V),M.color.values.push(q,W,H,V),P.color.values.push(q,W,H,V),P.color.values.push(q,W,H,V),n=4*g;4*g+8>n;++n)P.color.values.push(p[n])}if(c(E)){var X=r.fromArray(E,2*R,be),Y=r.fromArray(E,2*(t+3),Fe),k=T.lerp(X.x,Y.x,z);for(n=2*R;2*R+4>n;++n)M.st.values.push(E[n]);for(M.st.values.push(k,X.y),M.st.values.push(k,Y.y),P.st.values.push(k,X.y),P.st.values.push(k,Y.y),n=2*g;2*g+4>n;++n)P.st.values.push(E[n])}o=M.position.values.length/3-4,x.push(o,o+2,o+1),x.push(o+1,o+2,o+3),o=P.position.values.length/3-4,C.push(o,o+2,o+1),C.push(o+1,o+2,o+3)}else{var K,J;for(N.y<0?(K=y.attributes,J=y.indices):(K=m.attributes,J=m.indices),K.position.values.push(N.x,N.y,N.z),K.position.values.push(I.x,I.y,I.z),K.position.values.push(O.x,O.y,O.z),K.position.values.push(w.x,w.y,w.z),n=3*t;3*t+12>n;++n)K.prevPosition.values.push(f[n]),K.nextPosition.values.push(h[n]);for(n=2*t;2*t+8>n;++n)K.expandAndWidth.values.push(d[n]),c(E)&&K.st.values.push(E[n]);if(c(p))for(n=4*t;4*t+16>n;++n)K.color.values.push(p[n]);o=K.position.values.length/3-4,J.push(o,o+2,o+1),J.push(o+1,o+2,o+3)}}Z(e,y,m)}var te={};te.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=M(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}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;o>h;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 p,m=e.boundingSphere;return c(m)&&(p=new n(m.center,m.radius+r)),new d({attributes:{position:new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:p})},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;o>t;++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;t>a;a++)r[a]=-1;for(var i,o=n,s=o.length,l=y.createTypedArray(t,s),f=0,h=0,E=0;s>f;)i=r[o[f]],-1!==i?l[h]=i:(i=o[f],r[i]=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 g=r[T];if(-1!==g)for(a=0;R>a;a++)A[R*g+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;r>i;i++)n[i]>a&&(a=n[i]);e.indices=N.tipsify({indices:n,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],n=d.computeNumberOfVertices(e);if(c(e.indices)&&n>=T.SIXTY_FOUR_KILOBYTES){var r,a=[],i=[],o=0,u=x(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;l>f;f+=r){for(var h=0;r>h;++h){var E=s[f+h],p=a[E];c(p)||(p=o++,a[E]=p,P(u,e.attributes,E)),i.push(p)}o+r>=T.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=x(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,f=o.values,d=new Float64Array(f.length),p=0,m=0;m<f.length;m+=3){var y=a.fromArray(f,m,ne),_=s.cartesianToCartographic(y,re);if(!c(_))throw new l("Could not project point ("+y.x+", "+y.y+", "+y.z+") to 2D.");var v=i.project(_,ne);d[p++]=v.x,d[p++]=v.y,d[p++]=v.z}return e.attributes[n]=o,e.attributes[r]=new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:d}),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;o>l;++l)f.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var h=a.componentsPerAttribute;return e.attributes[n]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:s}),e.attributes[r]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:h,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 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))&&(A.inverse(t,oe),A.transpose(oe,oe),A.getRotation(oe,ue),D(ue,r.normal),D(ue,r.binormal),D(ue,r.tangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=n.transform(a,t,a)),e.modelMatrix=A.clone(A.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],n=[],r=e.length,a=0;r>a;++a){var i=e[a];c(i.geometry)?t.push(i):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;i>f;f++)s[f]={indexOffset:0,count:0,currentCount:0};var h=0;for(f=0;o>f;f+=3){var d=t[f],p=t[f+1],m=t[f+2],y=3*d,_=3*p,v=3*m;le.x=r[y],le.y=r[y+1],le.z=r[y+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[p].count++,s[m].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;i>f;f++)s[f].indexOffset+=T,T+=s[f].count;h=0;var R;for(f=0;o>f;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;i>f;f++){var S=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),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 E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:g}),e};var de=new a,Ee=new a,pe=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;s>l;l+=3){var p=t[l],m=t[l+1],y=t[l+2];f=3*p,h=3*m,d=3*y;var _=2*p,v=2*m,T=2*y,R=n[f],A=n[f+1],g=n[f+2],S=i[_],N=i[_+1],I=i[v+1]-N,O=i[T+1]-N,w=1/((i[v]-S)*O-(i[T]-S)*I),M=(O*(n[h]-R)-I*(n[d]-R))*w,x=(O*(n[h+1]-A)-I*(n[d+1]-A))*w,P=(O*(n[h+2]-g)-I*(n[d+2]-g))*w;c[f]+=M,c[f+1]+=x,c[f+2]+=P,c[h]+=M,c[h+1]+=x,c[h+2]+=P,c[d]+=M,c[d+1]+=x,c[d+2]+=P}var C=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;o>l;l++){f=3*l,h=f+1,d=f+2;var L=a.fromArray(r,f,de),U=a.fromArray(c,f,pe),b=a.dot(L,U);a.multiplyByScalar(L,b,Ee),a.normalize(a.subtract(U,Ee,U),U),D[f]=U.x,D[h]=U.y,D[d]=U.z,a.normalize(a.cross(L,U,U),U),C[f]=U.x,C[h]=U.y,C[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:C}),e};var me=new r,ye=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 p=c(o)?o.length:s.length,m=c(o)?3:2,y=p/m,_=y,v=c(s)&&c(o)?2:1;v+=c(l)||c(f)?1:0,_*=v;for(var T=new Float32Array(_),R=0,A=0;y>A;++A){c(s)&&(r.fromArray(s,2*A,me),T[R++]=e.compressTextureCoordinates(me));var g=3*A;c(o)&&c(l)&&c(f)?(a.fromArray(o,g,ye),a.fromArray(l,g,_e),a.fromArray(f,g,ve),e.octPack(ye,_e,ve,me),T[R++]=me.x,T[R++]=me.y):(c(o)&&(a.fromArray(o,g,ye),T[R++]=e.octEncodeFloat(ye)),c(l)&&(a.fromArray(l,g,ye),T[R++]=e.octEncodeFloat(ye)),c(f)&&(a.fromArray(f,g,ye),T[R++]=e.octEncodeFloat(ye)))}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 a,Re=new a,Ae=new a,ge=new a,Se=new a,Ne={positions:new Array(7),indices:new Array(9)},Ie=new a,Oe=new a,we=new a,Me=new a,xe=new r,Pe=new r,Ce=new r,De=g.fromPointNormal(a.ZERO,a.UNIT_Y),Le=new a,Ue=new a,be=new r,Fe=new r,ze=new a,Be=new a,Ge=new a,qe=new a,We=new a,He=new a,Ve=new a,Xe=new i;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,g.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==m.NONE)switch(t.geometryType){case m.POLYLINES:ee(e);break;case m.TRIANGLES:Q(e);break;case m.LINES:$(e)}else W(t),t.primitiveType===S.TRIANGLES?Q(e):t.primitiveType===S.LINES&&$(e);return e},te}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";function n(t,n,a,i){return e(t,n,a,i,r),r.x>0&&r.y>0&&r.z>0}var r=new t;return n}),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,v=1+p-3*m/4+5*y/4-175*_/64,T=1-p+15*m/8-35*y/8,R=1-3*p+35*m/4,A=1-5*p,g=v*l-T*Math.sin(2*l)*p/2-R*Math.sin(4*l)*m/16-A*Math.sin(6*l)*y/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=E,S.u2Over4=p,S.u4Over16=m,S.u6Over64=y,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,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),v=Math.sin(m),T=Math.cos(y),R=Math.sin(y),A=_*T,g=_*R,S=v*R,N=v*T,I=p,O=u.TWO_PI,w=Math.cos(I),M=Math.sin(I);do{w=Math.cos(I),M=Math.sin(I);var x=g-N*w;f=Math.sqrt(T*T*M*M+x*x),c=S+A*w,s=Math.atan2(f,c);var P;0===f?(P=0,h=1):(P=A*M/f,h=1-P*P),O=I,d=c-2*S/h,isNaN(d)&&(d=0),I=p+l(E,P,h,s,f,c,d)}while(Math.abs(I-O)>u.EPSILON12);var C=h*(t*t-n*n)/(n*n),D=1+C*(4096+C*(C*(320-175*C)-768))/16384,L=C*(256+C*(C*(74-47*C)-128))/1024,U=d*d,b=L*f*(d+L*(c*(2*U-1)-L*d*(4*f*f-3)*(4*U-3)/6)/4),F=n*D*(s-b),z=Math.atan2(T*M,g-N*w),B=Math.atan2(_*M,g*w-N);e._distance=F,e._startHeading=z,e._endHeading=B,e._uSquared=C}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,v=a.u4Over16,T=2*p*m*o/3+i*(1-y+7*v/4-15*_/4+579*m/64-(v-15*_/4+187*m/16)*o-(5*_/4-115*m/16)*u-29*m*s/16)+(y/2-v+71*_/32-85*m/16)*c+(5*v/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,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),I=a.cosineU*N,O=a.sineU*S,w=Math.atan2(S*a.sineHeading,I-O*a.cosineHeading),M=w-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,T,S,N,g);return r(n)?(n.longitude=this._start.longitude+M,n.latitude=A,n.height=0,n):new t(this._start.longitude+M,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;e>a;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;e>a;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,M),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,N),p=a.cartesianToCartographic(l,I),m=h(f,i,o);x.setEndPoints(d,p);var y=x.surfaceDistance/f,_=s;d.height=i;var v=a.cartographicToCartesian(d,O);e.pack(v,u,_),_+=3;for(var T=1;f>T;T++){var R=x.interpolateUsingSurfaceDistance(T*y,I);R.height=m[T],v=a.cartographicToCartesian(R,O),e.pack(v,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;n>a;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,p).height}return r};var m=new l,y=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,I=new t,O=new e,w=new e,M=new e,x=new o;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,v),E=l.multiplyByPointAsVector(s,e.UNIT_X,T),p=f.fromPointNormal(c,E,R),S=1;i.push(e.clone(t[0]));for(var N=i[0],I=t.length,O=1;I>O;++O){var w=t[O];if(f.getPointDistance(p,N)<0||f.getPointDistance(p,w)<0){var M=u.lineSegmentPlane(N,w,d,A);if(r(M)){var x=e.multiplyByScalar(h,5e-9,g);f.getPointDistance(d,N)<0&&e.negate(x,x),i.push(e.add(M,x,new e)),o.push(S+1),e.negate(x,x),i.push(e.add(M,x,new e)),S=1}}i.push(e.clone(t[O])),S++,N=w}o.push(S)}return{positions:i,lengths:o}};var P=c.EPSILON10;return E.removeDuplicates=function(t){var n=t.length;if(2>n)return t;var r,a,i;for(r=1;n>r&&(a=t[r-1],i=t[r],!e.equalsEpsilon(a,i,P));++r);if(r===n)return t;for(var o=t.slice(0,r);n>r;++r)i=t[r],e.equalsEpsilon(a,i,P)||(o.push(e.clone(i)),a=i);return 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);if(1>o)return[];if(1===o){var f=u.scaleToGeodeticSurface(a[0],w);if(0!==l){var h=u.geodeticSurfaceNormal(f,O);e.multiplyByScalar(h,l,h),e.add(f,h,f)}return[f.x,f.y,f.z]}var p=t.minDistance;if(!r(p)){var m=n(t.granularity,c.RADIANS_PER_DEGREE);p=c.chordLength(m,u.maximumRadius)}var y,_=0;for(y=0;o-1>y;y++)_+=E.numberOfPoints(a[y],a[y+1],p);var v=3*(_+1),T=new Array(v),R=0,A=s(l);for(y=0;o-1>y;y++){var g=a[y],I=a[y+1],M=A?l[y]:l,x=A?l[y+1]:l;R=d(g,I,p,u,M,x,T,R)}S.length=0;var P=a[o-1],C=u.cartesianToCartographic(P,N);C.height=A?l[o-1]:l;var D=u.cartographicToCartesian(C,O);return e.pack(D,T,v-3),T},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;r>i;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/Queue",["../Core/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(){return 0!==this._length?this._array[this._offset]:void 0},t.prototype.contains=function(e){return-1!==this._array.indexOf(e)},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/WindingOrder",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"use strict";var n={CLOCKWISE:e.CW,COUNTER_CLOCKWISE:e.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return t(n)}),define("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PolylinePipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,p){"use strict";function m(t,n,r){var a=e.subtract(n,t,b),i=e.subtract(r,n,F);return a.x*i.y-a.y*i.x>=0}function y(e){for(var t=e[0].x,n=0,r=0;r<e.length;r++)e[r].x>t&&(t=e[r].x,n=r);return n}function _(e){for(var t=e[0][0].x,n=0,r=0;r<e.length;r++){var a=e[r][y(e[r])].x;a>t&&(t=a,n=r)}return n}function v(e){for(var t=[],n=0;n<e.length;n++){var r=e[(n-1+e.length)%e.length],a=e[n],i=e[(n+1)%e.length];m(r,a,i)||t.push(a)}return t}function T(t,n){for(var r=0;r<t.length;r++)if(e.equals(n,t[r]))return r;return-1}function R(n,a,i){i=r(i,[]);var o=Number.MAX_VALUE,u=y(a),s=new e(a[u].x,n.y);i.push(u),i.push((u+1)%a.length);for(var c=a[0].x,l=c,f=1;f<a.length;++f)a[f].x<c?c=a[f].x:a[f].x>l&&(l=a[f].x);l+=l-c;var h=new t(l,n.y,0);for(f=0;f<a.length;f++){var d=a[f],E=a[(f+1)%a.length];if((d.x>=n.x||E.x>=n.x)&&(d.y>=n.y&&E.y<=n.y||d.y<=n.y&&E.y>=n.y)){var p=(E.y-d.y)*(h.x-n.x)-(E.x-d.x)*(h.y-n.y);if(0!==p){p=1/p;var m=((E.x-d.x)*(n.y-d.y)-(E.y-d.y)*(n.x-d.x))*p,_=((h.x-n.x)*(n.y-d.y)-(h.y-n.y)*(n.x-d.x))*p;if(m>=0&&1>=m&&_>=0&&1>=_){var v=new e(n.x+m*(h.x-n.x),n.y+m*(h.y-n.y)),T=e.subtract(v,n,z);p=e.magnitudeSquared(T),o>p&&(s=v,o=p,i[0]=f,i[1]=(f+1)%a.length)}}}}return s}function A(t,n){var r=_(n),a=n[r],i=y(a),o=a[i],u=[],s=R(o,t,u),c=T(t,s);if(-1!==c)return c;var h=e.magnitudeSquared(e.subtract(t[u[0]],o,B)),d=e.magnitudeSquared(e.subtract(t[u[1]],o,B)),E=d>h?t[u[0]]:t[u[1]],p=v(t),m=p.indexOf(E);-1!==m&&p.splice(m,1);for(var A=[],g=0;g<p.length;g++){var S=p[g];f(S,o,s,E)&&A.push(S)}var N=Number.MAX_VALUE;if(A.length>0){var I=e.fromElements(1,0,B);for(g=0;g<A.length;g++){var O=e.subtract(A[g],o,G),w=e.magnitude(I)*e.magnitudeSquared(O);if(0!==w){var M=Math.abs(l.acosClamped(e.dot(I,O)/w));N>M&&(N=M,E=A[g])}}}return t.indexOf(E)}function g(e,n,r){for(var a=ee.computeWindingOrder2D(e),i=0;i<n.length;i++){var o=n[i];t.equals(o[0],o[o.length-1])||o.push(o[0]);var s=ee.computeWindingOrder2D(o);s===a&&o.reverse()}var c=u.fromPoints(e,r),l=c.projectPointsOntoPlane(e),f=[];for(i=0;i<n.length;i++)f.push(c.projectPointsOntoPlane(n[i]));var h=A(l,f),d=_(f),E=y(f[d]),p=n[d],m=[];for(i=0;i<e.length;i++)m.push(e[i]);var v,T=[];if(0!==E)for(v=0;v<=p.length;v++){var R=(v+E)%p.length;0!==R&&T.push(p[R])}else for(v=0;v<p.length;v++)T.push(p[(v+E)%p.length]);var g=m.lastIndexOf(e[h]);T.push(e[g]);var S=m.slice(0,g+1),N=m.slice(g+1);return m=S.concat(T,N),n.splice(d,1),m}function S(e){var t=l.nextRandomNumber(),n=Math.floor(t*e);return n===e&&n--,n}function N(e,t,n,r){var a=r[e].position,i=r[t].position,o=r[n].position,u=o.x,s=o.y,c=a.x-u,l=a.y-s,f=i.x-u,h=i.y-s;return c*h-l*f}function I(e,t){return e.x*t.y-e.y*t.x}function O(e,t){var n=t.length,r=l.mod(e-1,n),a=l.mod(e+1,n);return 0===N(r,a,e,t)?!1:!0}function w(t,n){return e.magnitudeSquared(n)<e.magnitudeSquared(t)}function M(t,n,r){if(!O(t,r))return t;var a=r[t].position,i=r[n].position,o=r.length,u=l.mod(t-1,o);if(!O(u,r))return u;var s=l.mod(t+1,o);if(!O(s,r))return s;var c=e.subtract(r[u].position,a,H),f=e.subtract(r[s].position,a,V),h=e.subtract(i,a,X),d=I(c,h),E=I(f,h);if(0===d)return w(c,h)?q:W;if(0===E)return w(f,h)?q:W;var p=I(c,f);return 0>p?0>d&&E>0?q:W:p>0?d>0&&0>E?W:q:void 0}function x(e,t,n){return(e>t||e>n)&&(t>e||n>e)||t===n&&t===e}function P(t,n,r,a){var i=e.subtract(r,t,k),o=n.x*a.y-n.y*a.x,u=o*o,s=e.magnitudeSquared(n),c=e.magnitudeSquared(a);if(u>Y*s*c){var l=(i.x*a.y-i.y*a.x)/o;return e.add(t,e.multiplyByScalar(n,l,k),k)}}function C(t,n,r){for(var i=e.subtract(n,t,j),o=r.length,u=0;o>u;u++){var s=r[u].position,c=r[l.mod(u+1,o)].position;if(!(e.equals(t,s)||e.equals(n,c)||e.equals(t,c)||e.equals(n,s))){var f=e.subtract(c,s,Z),h=P(t,i,s,f);if(a(h)&&!(e.equals(h,t)||e.equals(h,n)||e.equals(h,s)||e.equals(h,c))){var d=h.x,E=h.y,p=x(d,t.x,n.x)&&x(E,t.y,n.y)&&x(d,s.x,c.x)&&x(E,s.y,c.y);if(p)return!0}}}return!1}function D(t,n,r){var a=M(t,n,r);if(a>=0)return a;var i=M(n,t,r);return i>=0?i:a!==q||i!==q||C(r[t].position,r[n].position,r)||e.equals(r[t].position,r[n].position)?J:K}function L(e){return 0===N(1,2,0,e)}function U(e){var t=e.length;if(3===t)return L(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new i("Invalid polygon: must have at least three vertices.");for(var n,r,a=0,o=10*e.length,u=J;K>u&&a++<o;){for(n=S(e.length),r=n+1;Math.abs(n-r)<2||Math.abs(n-r)>e.length-2;)r=S(e.length);if(n>r){var s=n;n=r,r=s}u=D(n,r,e)}if(u===K){var c=e.splice(n,r-n+1,e[n],e[r]);return U(e).concat(U(c))}return u>=0?(e.splice(u,1),U(e)):[]}var b=new e,F=new e,z=new e,B=new e(1,0),G=new e,q=-1,W=-2,H=new t,V=new t,X=new t,Y=l.EPSILON14,k=new e,j=new e,Z=new e,K=-1,J=-2,Q=new t,$=new t,ee={};ee.removeDuplicates=function(e){var n=h.removeDuplicates(e);return t.equals(n[0],n[n.length-1])?n.slice(1):n},ee.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;t>a;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},ee.computeWindingOrder2D=function(e){var t=ee.computeArea2D(e);return t>0?p.COUNTER_CLOCKWISE:p.CLOCKWISE},ee.triangulate=function(e){for(var t=e.length,n=[],r=0;t>r;++r)n[r]={position:e[r],index:r};return U(n)};var te=new t,ne=new t,re=new t,ae=new t,ie=new t,oe=new t,ue=new t;return ee.computeSubdivision=function(e,i,o,u){u=r(u,l.RADIANS_PER_DEGREE);var f,h=o.slice(0),E=i.length,p=new Array(3*E),m=0;for(f=0;E>f;f++){var y=i[f];p[m++]=y.x,p[m++]=y.y,p[m++]=y.z}for(var _=[],v={},T=e.maximumRadius,R=l.chordLength(u,T),A=R*R;h.length>0;){var g,S,N=h.pop(),I=h.pop(),O=h.pop(),w=t.fromArray(p,3*O,te),M=t.fromArray(p,3*I,ne),x=t.fromArray(p,3*N,re),P=t.multiplyByScalar(t.normalize(w,ae),T,ae),C=t.multiplyByScalar(t.normalize(M,ie),T,ie),D=t.multiplyByScalar(t.normalize(x,oe),T,oe),L=t.magnitudeSquared(t.subtract(P,C,ue)),U=t.magnitudeSquared(t.subtract(C,D,ue)),b=t.magnitudeSquared(t.subtract(D,P,ue)),F=Math.max(L,U,b);F>A?L===F?(g=Math.min(O,I)+" "+Math.max(O,I),f=v[g],a(f)||(S=t.add(w,M,ue),t.multiplyByScalar(S,.5,S),p.push(S.x,S.y,S.z),f=p.length/3-1,v[g]=f),h.push(O,f,N),h.push(f,I,N)):U===F?(g=Math.min(I,N)+" "+Math.max(I,N),f=v[g],a(f)||(S=t.add(M,x,ue),t.multiplyByScalar(S,.5,S),p.push(S.x,S.y,S.z),f=p.length/3-1,v[g]=f),h.push(I,f,O),h.push(f,N,O)):b===F&&(g=Math.min(N,O)+" "+Math.max(N,O),f=v[g],a(f)||(S=t.add(x,w,ue),t.multiplyByScalar(S,.5,S),p.push(S.x,S.y,S.z),f=p.length/3-1,v[g]=f),h.push(N,f,I),h.push(f,O,I)):(_.push(O),_.push(I),_.push(N))}return new s({attributes:{position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:p})},indices:_,primitiveType:d.TRIANGLES})},ee.scaleToGeodeticHeight=function(e,n,i,u){i=r(i,o.WGS84);var s=Q,c=$;if(n=r(n,0),u=r(u,!0),a(e)&&a(e.attributes)&&a(e.attributes.position))for(var l=e.attributes.position.values,f=l.length,h=0;f>h;h+=3)t.fromArray(l,h,c),u&&(c=i.scaleToGeodeticSurface(c,c)),0!==n&&(s=i.geodeticSurfaceNormal(c,s),t.multiplyByScalar(s,n,s),t.add(c,s,c)),l[h]=c.x,l[h+1]=c.y,l[h+2]=c.z;return e},ee.eliminateHoles=function(e,n,a){a=r(a,o.WGS84);for(var i=[],u=0;u<n.length;u++){for(var s=[],c=0;c<n[u].length;c++)s.push(t.clone(n[u][c]));i.push(s)}for(var l=e;i.length>0;)l=g(l,i,a);return l},ee}),define("Core/PolygonGeometryLibrary",["./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E){"use strict";function p(t,n,r,a){return e.subtract(n,t,y),e.multiplyByScalar(y,r/a,y),e.add(t,y,y),[y.x,y.y,y.z]}var m={};m.computeHierarchyPackedLength=function(t){for(var n=0,a=[t];a.length>0;){var i=a.pop();if(r(i)){n+=2;var o=i.positions,u=i.holes;if(r(o)&&(n+=o.length*e.packedLength),r(u))for(var s=u.length,c=0;s>c;++c)a.push(u[c])}}return n},m.packPolygonHierarchy=function(t,n,a){for(var i=[t];i.length>0;){var o=i.pop();if(r(o)){var u=o.positions,s=o.holes;if(n[a++]=r(u)?u.length:0,n[a++]=r(s)?s.length:0,r(u))for(var c=u.length,l=0;c>l;++l,a+=3)e.pack(u[l],n,a);if(r(s))for(var f=s.length,h=0;f>h;++h)i.push(s[h])}}return a},m.unpackPolygonHierarchy=function(t,n){for(var r=t[n++],a=t[n++],i=new Array(r),o=a>0?new Array(a):void 0,u=0;r>u;++u,n+=e.packedLength)i[u]=e.unpack(t,n);for(var s=0;a>s;++s)o[s]=m.unpackPolygonHierarchy(t,n),n=o[s].startingIndex,delete o[s].startingIndex;return{positions:i,holes:o,startingIndex:n}};var y=new e;m.subdivideLineCount=function(t,n,r){var a=e.distance(t,n),i=a/r,o=Math.max(0,Math.ceil(Math.log(i)/Math.log(2)));return Math.pow(2,o)},m.subdivideLine=function(t,n,a,i){var o=m.subdivideLineCount(t,n,a),u=e.distance(t,n),s=u/o;r(i)||(i=[]);var c=i;c.length=3*o;for(var l=0,f=0;o>f;f++){var h=p(t,n,f*s,u);c[l++]=h[0],c[l++]=h[1],c[l++]=h[2]}return c};var _=new e,v=new e,T=new e,R=new e;m.scaleToGeodeticHeightExtruded=function(t,i,o,u,s){u=n(u,a.WGS84);var c=_,l=v,f=T,h=R;if(r(t)&&r(t.attributes)&&r(t.attributes.position))for(var d=t.attributes.position.values,E=d.length/2,p=0;E>p;p+=3)e.fromArray(d,p,f),u.geodeticSurfaceNormal(f,c),h=u.scaleToGeodeticSurface(f,h),l=e.multiplyByScalar(c,o,l),l=e.add(h,l,l),d[p+E]=l.x,d[p+1+E]=l.y,d[p+2+E]=l.z,s&&(h=e.clone(f,h)),l=e.multiplyByScalar(c,i,l),l=e.add(h,l,l),d[p]=l.x,d[p+1]=l.y,d[p+2]=l.z;return t},m.polygonsFromHierarchy=function(e){var t=[],n=[],a=new d;for(a.enqueue(e);0!==a.length;){var i=a.dequeue(),o=i.positions,u=i.holes;if(o=f.removeDuplicates(o),!(o.length<3)){for(var s=r(u)?u.length:0,c=[],l=0;s>l;l++){var h=u[l];if(h.positions=f.removeDuplicates(h.positions),!(h.positions.length<3)){c.push(h.positions);var E=0;r(h.holes)&&(E=h.holes.length);for(var p=0;E>p;p++)a.enqueue(h.holes[p])}}n.push({outerRing:o,holes:c});var m=c.length>0?f.eliminateHoles(o,c):o;t.push(m)}}return{hierarchy:n,polygons:t}};var A=[];m.createGeometryFromPositions=function(e,n,r,a){var s=i.fromPoints(n,e),c=s.projectPointsOntoPlane(n,A),l=f.computeWindingOrder2D(c);l===E.CLOCKWISE&&(c.reverse(),n=n.slice().reverse());var d=f.triangulate(c);if(d.length<3&&(d=[0,1,2]),a){for(var p=n.length,m=new Array(3*p),y=0,_=0;p>_;_++){var v=n[_];m[y++]=v.x,m[y++]=v.y,m[y++]=v.z}return new o({attributes:{position:new u({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:m})},indices:d,primitiveType:h.TRIANGLES})}return f.computeSubdivision(e,n,d,r)};var g=[],S=new e,N=new e;return m.computeWallGeometry=function(n,r,a,i){var f,d,E,p,y,_=n.length,v=0;if(i)for(d=3*_*2,f=new Array(2*d),E=0;_>E;E++)p=n[E],y=n[(E+1)%_],f[v]=f[v+d]=p.x,++v,f[v]=f[v+d]=p.y,++v,f[v]=f[v+d]=p.z,++v,f[v]=f[v+d]=y.x,++v,f[v]=f[v+d]=y.y,++v,f[v]=f[v+d]=y.z,++v;else{var T=l.chordLength(a,r.maximumRadius),R=0;for(E=0;_>E;E++)R+=m.subdivideLineCount(n[E],n[(E+1)%_],T);for(d=3*(R+_),f=new Array(2*d),E=0;_>E;E++){p=n[E],y=n[(E+1)%_];for(var A=m.subdivideLine(p,y,T,g),I=A.length,O=0;I>O;++O,++v)f[v]=A[O],f[v+d]=A[O];f[v]=y.x,f[v+d]=y.x,++v,f[v]=y.y,f[v+d]=y.y,++v,f[v]=y.z,f[v+d]=y.z,++v}}_=f.length;var w=c.createTypedArray(_/3,_-6*n.length),M=0;for(_/=6,E=0;_>E;E++){var x=E,P=x+1,C=x+_,D=C+1;p=e.fromArray(f,3*x,S),y=e.fromArray(f,3*P,N),e.equalsEpsilon(p,y,l.EPSILON14)||(w[M++]=x,w[M++]=C,w[M++]=P,w[M++]=P,w[M++]=C,w[M++]=D)}return new o({attributes:new s({position:new u({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:f})}),indices:w,primitiveType:h.TRIANGLES})},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){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},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){return t(e)?(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):void 0},a}),define("Core/PolygonGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./Quaternion","./VertexFormat","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,p,m,y,_,v,T,R,A){"use strict";function g(e,t,n,a){for(var i=T.fromAxisAngle(e._plane.normal,n,M),u=y.fromQuaternion(i,x),s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,h=t.length,d=0;h>d;++d){var E=r.clone(t[d],w);y.multiplyByVector(u,E,E);var p=e.projectPointOntoPlane(E,O);o(p)&&(s=Math.min(s,p.x),c=Math.max(c,p.x),l=Math.min(l,p.y),f=Math.max(f,p.y))}return a.x=s,a.y=l,a.width=c-s,a.height=f-l,a}function S(e,t,i,o,u,s,l){if(e.st||e.normal||e.tangent||e.binormal){var h=c.fromPoints(i,o),d=g(h,i,u,P),E=z;E.x=d.x,E.y=d.y;var p=t.attributes.position.values,_=p.length,v=e.st?new Float32Array(2*(_/3)):void 0,R=e.normal?new Float32Array(_):void 0,A=e.tangent?new Float32Array(_):void 0,S=e.binormal?new Float32Array(_):void 0,N=0,I=0,O=D,w=L,M=U,x=!0,H=T.fromAxisAngle(h._plane.normal,u,q),V=y.fromQuaternion(H,W),X=_/2,Y=_/3;s&&(_/=2);for(var k=0;_>k;k+=3){var j=r.fromArray(p,k,G);if(e.st){var Z=y.multiplyByVector(V,j,C);Z=o.scaleToGeodeticSurface(Z,Z);var K=h.projectPointOntoPlane(Z,B);n.subtract(K,E,K),s&&(v[N+Y]=K.x/d.width,v[N+1+Y]=K.y/d.height),v[N]=K.x/d.width,v[N+1]=K.y/d.height,N+=2}if(e.normal||e.tangent||e.binormal){var J=I+1,Q=I+2;if(l){if(_>k+3){var $=r.fromArray(p,k+3,b);if(x){var ee=r.fromArray(p,k+_,F);r.subtract($,j,$),r.subtract(ee,j,ee),O=r.normalize(r.cross(ee,$,O),O),x=!1}r.equalsEpsilon($,j,m.EPSILON10)&&(x=!0)}(e.tangent||e.binormal)&&(M=o.geodeticSurfaceNormal(j,M),e.tangent&&(w=r.normalize(r.cross(M,O,w),w)))}else O=o.geodeticSurfaceNormal(j,O),(e.tangent||e.binormal)&&(w=r.cross(r.UNIT_Z,O,w),w=r.normalize(y.multiplyByVector(V,w,w),w),e.binormal&&(M=r.normalize(r.cross(O,w,M),M)));e.normal&&(s&&!l?(R[I+X]=-O.x,R[J+X]=-O.y,R[Q+X]=-O.z):(R[I+X]=O.x,R[J+X]=O.y,R[Q+X]=O.z),R[I]=O.x,R[J]=O.y,R[Q]=O.z),e.tangent&&(s&&!l?(A[I+X]=-w.x,A[J+X]=-w.y,A[Q+X]=-w.z):(A[I+X]=w.x,A[J+X]=w.y,A[Q+X]=w.z),A[I]=w.x,A[J]=w.y,A[Q]=w.z),e.binormal&&(s&&(S[I+X]=M.x,S[J+X]=M.y,S[Q+X]=M.z),S[I]=M.x,S[J]=M.y,S[Q]=M.z),I+=3}}e.st&&(t.attributes.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:v})),e.normal&&(t.attributes.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),e.tangent&&(t.attributes.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:A})),e.binormal&&(t.attributes.binormal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S}))}return t}function N(e,t,n,r,i){var o=_.createGeometryFromPositions(e,t,n,i),u=o.attributes.position.values,s=o.indices,E=u.concat(u),m=E.length/3,y=p.createTypedArray(m,2*s.length);y.set(s);var T,R=s.length,g=m/2;for(T=0;R>T;T+=3){var S=y[T]+g,N=y[T+1]+g,I=y[T+2]+g;y[T+R]=I,y[T+1+R]=N,y[T+2+R]=S}var O=new l({attributes:new h({position:new f({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:E})}),indices:y,primitiveType:o.primitiveType}),w={topAndBottom:new d({geometry:O}),walls:[]},M=r.outerRing,x=c.fromPoints(M,e),P=x.projectPointsOntoPlane(M,H),C=v.computeWindingOrder2D(P);C===A.CLOCKWISE&&(M=M.slice().reverse());var D=_.computeWallGeometry(M,e,n,i);w.walls.push(new d({geometry:D}));var L=r.holes;for(T=0;T<L.length;T++){var U=L[T];x=c.fromPoints(U,e),P=x.projectPointsOntoPlane(U,H),C=v.computeWindingOrder2D(P),C===A.COUNTER_CLOCKWISE&&(U=U.slice().reverse()),D=_.computeWallGeometry(U,e,n),w.walls.push(new d({geometry:D}))}return w}function I(e){var t=e.polygonHierarchy,n=i(e.vertexFormat,R.DEFAULT),r=i(e.ellipsoid,s.WGS84),a=i(e.granularity,m.RADIANS_PER_DEGREE),u=i(e.stRotation,0),c=i(e.height,0),l=i(e.perPositionHeight,!1),f=e.extrudedHeight,h=o(f);if(h&&!l){var d=f;f=Math.min(d,c),c=Math.max(d,c)}this._vertexFormat=R.clone(n),this._ellipsoid=s.clone(r),this._granularity=a,this._stRotation=u,this._height=c,this._extrudedHeight=i(f,0),this._extrude=h,this._polygonHierarchy=t,this._perPositionHeight=l,this._workerName="createPolygonGeometry",this.packedLength=_.computeHierarchyPackedLength(t)+s.packedLength+R.packedLength+7}var O=new n,w=new r,M=new T,x=new y,P=new e,C=new r,D=new r,L=new r,U=new r,b=new r,F=new r,z=new n,B=new n,G=new r,q=new T,W=new y,H=[];I.fromPositions=function(e){e=i(e,i.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};return new I(t)},I.pack=function(e,t,n){n=i(n,0),n=_.packPolygonHierarchy(e._polygonHierarchy,t,n),s.pack(e._ellipsoid,t,n),n+=s.packedLength,R.pack(e._vertexFormat,t,n),n+=R.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.packedLength};var V=s.clone(s.UNIT_SPHERE),X=new R,Y={polygonHierarchy:{}};return I.unpack=function(e,t,n){ +t=i(t,0);var r=_.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var a=s.unpack(e,t,V);t+=s.packedLength;var u=R.unpack(e,t,X);t+=R.packedLength;var c=e[t++],l=e[t++],f=e[t++],h=e[t++],d=1===e[t++],E=1===e[t++],p=e[t];return o(n)||(n=new I(Y)),n._polygonHierarchy=r,n._ellipsoid=s.clone(a,n._ellipsoid),n._vertexFormat=R.clone(u,n._vertexFormat),n._height=c,n._extrudedHeight=l,n._granularity=f,n._stRotation=h,n._extrude=d,n._perPositionHeight=E,n.packedLength=p,n},I.createGeometry=function(e){var n,r,a,i=e._vertexFormat,o=e._ellipsoid,u=e._granularity,s=e._stRotation,c=e._height,f=e._extrudedHeight,h=e._extrude,m=e._polygonHierarchy,y=e._perPositionHeight,T=_.polygonsFromHierarchy(m),R=T.hierarchy,A=T.polygons;if(0!==A.length){a=A[0];var g,I,O=[];if(h)for(I=0;I<A.length;I++){g=N(o,A[I],u,R[I],y),r=g.topAndBottom,r.geometry=_.scaleToGeodeticHeightExtruded(r.geometry,c,f,o,y),r.geometry=S(i,r.geometry,a,o,s,!0,!1),O.push(r),n=g.walls;for(var w=0;w<n.length;w++){var M=n[w];M.geometry=_.scaleToGeodeticHeightExtruded(M.geometry,c,f,o,y),M.geometry=S(i,M.geometry,a,o,s,!0,!0),O.push(M)}}else for(I=0;I<A.length;I++)g=new d({geometry:_.createGeometryFromPositions(o,A[I],u,y)}),g.geometry=v.scaleToGeodeticHeight(g.geometry,c,o,!y),g.geometry=S(i,g.geometry,a,o,s,!1,!1),O.push(g);g=E.combineInstances(O)[0],g.attributes.position.values=new Float64Array(g.attributes.position.values),g.indices=p.createTypedArray(g.attributes.position.values.length/3,g.indices);var x=g.attributes,P=t.fromVertices(x.position.values);return i.position||delete x.position,new l({attributes:x,indices:g.indices,primitiveType:g.primitiveType,boundingSphere:P})}},I.createShadowVolume=function(e,t,n){var r=e._granularity,a=e._ellipsoid,i=t(r,a),o=n(r,a);return new I({polygonHierarchy:e._polygonHierarchy,ellipsoid:a,stRotation:e._stRotation,granularity:r,perPositionHeight:!1,extrudedHeight:i,height:o,vertexFormat:R.POSITION_ONLY})},I}),define("Workers/createPolygonGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolygonGeometry"],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/Workers/createPolygonOutlineGeometry.js b/Workers/createPolygonOutlineGeometry.js index f70e338..89f5af6 100644 --- a/Workers/createPolygonOutlineGeometry.js +++ b/Workers/createPolygonOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,8 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};r.EPSILON1=.1,r.EPSILON2=.01,r.EPSILON3=.001,r.EPSILON4=1e-4,r.EPSILON5=1e-5,r.EPSILON6=1e-6,r.EPSILON7=1e-7,r.EPSILON8=1e-8,r.EPSILON9=1e-9,r.EPSILON10=1e-10,r.EPSILON11=1e-11,r.EPSILON12=1e-12,r.EPSILON13=1e-13,r.EPSILON14=1e-14,r.EPSILON15=1e-15,r.EPSILON16=1e-16,r.EPSILON17=1e-17,r.EPSILON18=1e-18,r.EPSILON19=1e-19,r.EPSILON20=1e-20,r.GRAVITATIONALPARAMETER=3986004418e5,r.SOLAR_RADIUS=6955e5,r.LUNAR_RADIUS=1737400,r.SIXTY_FOUR_KILOBYTES=65536,r.sign=function(e){return e>0?1:0>e?-1:0},r.signNotZero=function(e){return 0>e?-1:1},r.toSNorm=function(e){return Math.round(255*(.5*r.clamp(e,-1,1)+.5))},r.fromSNorm=function(e){return 2*(r.clamp(e,0,255)/255)-1},r.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},r.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},r.lerp=function(e,t,r){return(1-r)*e+r*t},r.PI=Math.PI,r.ONE_OVER_PI=1/Math.PI,r.PI_OVER_TWO=.5*Math.PI,r.PI_OVER_THREE=Math.PI/3,r.PI_OVER_FOUR=Math.PI/4,r.PI_OVER_SIX=Math.PI/6,r.THREE_PI_OVER_TWO=.5*3*Math.PI,r.TWO_PI=2*Math.PI,r.ONE_OVER_TWO_PI=1/(2*Math.PI),r.RADIANS_PER_DEGREE=Math.PI/180,r.DEGREES_PER_RADIAN=180/Math.PI,r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600,r.toRadians=function(e){return e*r.RADIANS_PER_DEGREE},r.toDegrees=function(e){return e*r.DEGREES_PER_RADIAN},r.convertLongitudeRange=function(e){var t=r.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},r.negativePiToPi=function(e){for(var t=r.EPSILON10,n=r.PI,i=r.TWO_PI;-(n+t)>e;)e+=i;if(-n>e)return-n;for(;e>n+t;)e-=i;return e>n?n:e},r.zeroToTwoPi=function(e){var t=e%r.TWO_PI;return 0>t?(t+r.TWO_PI)%r.TWO_PI:t},r.equalsEpsilon=function(e,r,n){return n=t(n,0),Math.abs(e-r)<=n};var n=[1];r.factorial=function(e){var t=n.length;if(e>=t)for(var r=n[t-1],i=t;e>=i;i++)n.push(r*i);return n[e]},r.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},r.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},r.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},r.clamp=function(e,t,r){return t>e?t:e>r?r:e};var i=new e;return r.setRandomNumberSeed=function(t){i=new e(t)},r.nextRandomNumber=function(){return i.random()},r.acosClamped=function(e){return Math.acos(r.clamp(e,-1,1))},r.asinClamped=function(e){return Math.asin(r.clamp(e,-1,1))},r}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i){"use strict";var a=function(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)};a.fromSpherical=function(r,n){t(n)||(n=new a);var i=r.clock,o=r.cone,u=e(r.magnitude,1),s=u*Math.sin(o);return n.x=s*Math.cos(i),n.y=s*Math.sin(i),n.z=u*Math.cos(o),n},a.fromElements=function(e,r,n,i){return t(i)?(i.x=e,i.y=r,i.z=n,i):new a(e,r,n)},a.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new a(e.x,e.y,e.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z},a.unpack=function(r,n,i){return n=e(n,0),t(i)||(i=new a),i.x=r[n++],i.y=r[n++],i.z=r[n],i},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},a.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},a.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(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},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var u=new a;a.lerp=function(e,t,r,n){return a.multiplyByScalar(t,r,u),n=a.multiplyByScalar(e,1-r,n),a.add(u,n,n)};var s=new a,c=new a;a.angleBetween=function(e,t){a.normalize(e,s),a.normalize(t,c);var r=a.dot(s,c),n=a.magnitude(a.cross(s,c,s));return Math.atan2(n,r)};var l=new a;a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,l);return a.abs(r,r),t=r.x<=r.y?r.x<=r.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):r.y<=r.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,t)},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z},a.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n},a.cross=function(e,t,r){var n=e.x,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},a.fromDegrees=function(e,t,r,n,o){var u=i.toRadians(e),s=i.toRadians(t);return a.fromRadians(u,s,r,n,o)};var f=new a,d=new a,h=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(r,n,i,o,u){i=e(i,0);var s=t(o)?o.radiiSquared:h,c=Math.cos(n);f.x=c*Math.cos(r),f.y=c*Math.sin(r),f.z=Math.sin(n),f=a.normalize(f,f),a.multiplyComponents(s,f,d);var l=Math.sqrt(a.dot(f,d));return d=a.divideByScalar(d,l,d),f=a.multiplyByScalar(f,i,f),t(u)||(u=new a),a.add(d,f,u)},a.fromDegreesArray=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o++)n[o]=i.toRadians(e[o]);return a.fromRadiansArray(n,t,r)},a.fromRadiansArray=function(e,r,n){var i=e.length;t(n)?n.length=i/2:n=new Array(i/2);for(var o=0;i>o;o+=2){var u=e[o],s=e[o+1];n[o/2]=a.fromRadians(u,s,0,r,n[o/2])}return n},a.fromDegreesArrayHeights=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o+=3)n[o]=i.toRadians(e[o]),n[o+1]=i.toRadians(e[o+1]),n[o+2]=e[o+2];return a.fromRadiansArrayHeights(n,t,r)},a.fromRadiansArrayHeights=function(e,r,n){var i=e.length;t(n)?n.length=i/3:n=new Array(i/3);for(var o=0;i>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];n[o/3]=a.fromRadians(u,s,c,r,n[o/3])}return n},a.ZERO=n(new a(0,0,0)),a.UNIT_X=n(new a(1,0,0)),a.UNIT_Y=n(new a(0,1,0)),a.UNIT_Z=n(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i){"use strict";var a=function(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)};return a.fromRadians=function(r,n,i,o){return i=e(i,0),t(o)?(o.longitude=r,o.latitude=n,o.height=i,o):new a(r,n,i)},a.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),a.fromRadians(e,t,r,n)},a.clone=function(e,r){return t(e)?t(r)?(r.longitude=e.longitude,r.latitude=e.latitude,r.height=e.height,r):new a(e.longitude,e.latitude,e.height):void 0},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.longitude===r.longitude&&e.latitude===r.latitude&&e.height===r.height},a.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.longitude-r.longitude)<=n&&Math.abs(e.latitude-r.latitude)<=n&&Math.abs(e.height-r.height)<=n},a.ZERO=n(new a(0,0,0)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,a,o,u){"use strict";function s(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}var c=function(e,t,r){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,s(this,e,t,r)};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,r){if(!n(t))return void 0;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 c(i.x,i.y,i.z)},c.fromCartesian3=function(e,t){return n(t)||(t=new c),n(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=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.prototype.geocentricSurfaceNormal=e.normalize,c.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)},c.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var l=new e,f=new e;c.prototype.cartographicToCartesian=function(t,r){var i=l,a=f;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)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var i=0;r>i;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var d=new e,h=new e,m=new e;c.prototype.cartesianToCartographic=function(r,i){var a=this.scaleToGeodeticSurface(r,h);if(!n(a))return void 0;var o=this.geodeticSurfaceNormal(a,d),s=e.subtract(r,a,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(i)?(i.longitude=c,i.latitude=l,i.height=f,i):new t(c,l,f)},c.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var i=0;r>i;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};var y=new e,p=new e;return c.prototype.scaleToGeodeticSurface=function(t,r){var i=t.x,a=t.y,o=t.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,d=i*i*c*c,h=a*a*l*l,m=o*o*f*f,v=d+h+m,g=Math.sqrt(1/v),w=e.multiplyByScalar(t,g,y);if(v<this._centerToleranceSquared)return isFinite(g)?e.clone(w,r):void 0;var x=this._oneOverRadiiSquared,E=x.x,S=x.y,O=x.z,T=p;T.x=2*w.x*E,T.y=2*w.y*S,T.z=2*w.z*O;var M,b,_,P,N,A,I,C,R,z,D,L=(1-g)*e.magnitude(t)/(.5*e.magnitude(T)),U=0;do{L-=U,_=1/(1+L*E),P=1/(1+L*S),N=1/(1+L*O),A=_*_,I=P*P,C=N*N,R=A*_,z=I*P,D=C*N,M=d*A+h*I+m*C-1,b=d*R*E+h*z*S+m*D*O;var q=-2*b;U=M/q}while(Math.abs(M)>u.EPSILON12);return n(r)?(r.x=i*_,r.y=a*P,r.z=o*N,r):new e(i*_,a*P,o*N)},c.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)},c.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},c.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},c.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,i,a,o){"use strict";var u=function(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";var t=function(t,r){this.start=e(t,0),this.stop=e(r,0)};return t}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";var i=function(t,r,n,i){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(i,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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w},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.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 a=new i;i.distance=function(e,t){return i.subtract(e,t,a),i.magnitude(a)},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.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 o=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,o),n=i.multiplyByScalar(e,1-r,n),i.add(o,n,n)};var u=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,u);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.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n&&Math.abs(e.w-r.w)<=n},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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,a){"use strict";function o(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function u(e){for(var t=0,r=0;3>r;++r){var n=e[c.getElementIndex(h[r],d[r])];t+=2*n*n}return Math.sqrt(t)}function s(e,t){for(var r=a.EPSILON15,n=0,i=1,o=0;3>o;++o){var u=Math.abs(e[c.getElementIndex(h[o],d[o])]);u>n&&(i=o,n=u)}var s=1,l=0,f=d[i],m=h[i];if(Math.abs(e[c.getElementIndex(m,f)])>r){var y,p=e[c.getElementIndex(m,m)],v=e[c.getElementIndex(f,f)],g=e[c.getElementIndex(m,f)],w=(p-v)/2/g;y=0>w?-1/(-w+Math.sqrt(1+w*w)):1/(w+Math.sqrt(1+w*w)),s=1/Math.sqrt(1+y*y),l=y*s}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(f,f)]=t[c.getElementIndex(m,m)]=s,t[c.getElementIndex(m,f)]=l,t[c.getElementIndex(f,m)]=-l,t}var c=function(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)};c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,n,i){return n=t(n,0),r(i)||(i=new c),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},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var n=e.x*e.x,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,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,m=n-u-f+h,y=2*(i-d),p=2*(a+l),v=2*(i+d),g=-n+u-f+h,w=2*(s-o),x=2*(a-l),E=2*(s+o),S=-n-u+f+h;return r(t)?(t[0]=m,t[1]=v,t[2]=x,t[3]=y,t[4]=g,t[5]=E,t[6]=p,t[7]=w,t[8]=S,t):new c(m,y,p,v,g,w,x,E,S)},c.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new c(e.x,0,0,0,e.y,0,0,0,e.z)},c.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new c(e,0,0,0,e,0,0,0,e)},c.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.fromRotationX=function(e,t){var n=Math.cos(e),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 c(1,0,0,0,n,-i,0,i,n)},c.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 c(n,0,i,0,1,0,-i,0,n)},c.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 c(n,-i,0,i,n,0,0,0,1)},c.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},c.getElementIndex=function(e,t){return 3*e+t},c.getColumn=function(e,t,r){var n=3*t,i=e[n],a=e[n+1],o=e[n+2];return r.x=i,r.y=a,r.z=o,r},c.setColumn=function(e,t,r,n){n=c.clone(e,n);var i=3*t;return n[i]=r.x,n[i+1]=r.y,n[i+2]=r.z,n},c.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},c.setRow=function(e,t,r,n){return n=c.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var l=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),r};var f=new e;c.getMaximumScale=function(t){return c.getScale(t,f),e.maximumComponent(f)},c.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],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},c.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},c.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},c.multiplyByVector=function(e,t,r){var n=t.x,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},c.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},c.transpose=function(e,t){var r=e[0],n=e[3],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],h=[2,2,1],m=new c,y=new c;return c.computeEigenDecomposition=function(e,t){var n=a.EPSILON20,i=10,l=0,f=0;r(t)||(t={});for(var d=t.unitary=c.clone(c.IDENTITY,t.unitary),h=t.diagonal=c.clone(e,t.diagonal),p=n*o(h);i>f&&u(h)>p;)s(h,m),c.transpose(m,y),c.multiply(h,m,h),c.multiply(y,h,h),c.multiply(d,m,d),++l>2&&(++f,l=0);return t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},c.determinant=function(e){var t=e[0],r=e[3],n=e[6],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)},c.inverse=function(e,t){var r=e[0],i=e[1],o=e[2],u=e[3],s=e[4],l=e[5],f=e[6],d=e[7],h=e[8],m=c.determinant(e);if(Math.abs(m)<=a.EPSILON15)throw new n("matrix is not invertible");t[0]=s*h-d*l,t[1]=d*o-i*h,t[2]=i*l-s*o,t[3]=f*l-u*h,t[4]=r*h-f*o,t[5]=u*o-r*l,t[6]=u*d-f*s,t[7]=f*i-r*d,t[8]=r*s-u*i;var y=1/m;return c.multiplyByScalar(t,y,t)},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},c.IDENTITY=i(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,i,a,o,u,s){"use strict";var c=function(e,t,n,i,a,o,u,s,c,l,f,d,h,m,y,p){this[0]=r(e,0),this[1]=r(a,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(m,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(d,0),this[15]=r(p,0)};c.packedLength=16,c.pack=function(e,t,n){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]},c.unpack=function(e,t,i){return t=r(t,0),n(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){return n(e)?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 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]):void 0},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 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=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 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,r,i){n(i)||(i=new c);var a=r.x,o=r.y,u=r.z,s=t.x*t.x,l=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,m=t.y*t.z,y=t.y*t.w,p=t.z*t.z,v=t.z*t.w,g=t.w*t.w,w=s-h-p+g,x=2*(l-v),E=2*(f+y),S=2*(l+v),O=-s+h-p+g,T=2*(m-d),M=2*(f-y),b=2*(m+d),_=-s-h+p+g;return i[0]=w*a,i[1]=S*a,i[2]=M*a,i[3]=0,i[4]=x*o,i[5]=O*o,i[6]=b*o,i[7]=0,i[8]=E*u,i[9]=T*u,i[10]=_*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.IDENTITY,e,t)},c.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 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 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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,f=new e,d=new e;c.fromCamera=function(t,r){var i=t.eye,a=t.target,o=t.up;e.normalize(e.subtract(a,i,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,d),d);var u=f.x,s=f.y,h=f.z,m=l.x,y=l.y,p=l.z,v=d.x,g=d.y,w=d.z,x=i.x,E=i.y,S=i.z,O=u*-x+s*-E+h*-S,T=v*-x+g*-E+w*-S,M=m*x+y*E+p*S;return n(r)?(r[0]=u,r[1]=v,r[2]=-m,r[3]=0,r[4]=s,r[5]=g,r[6]=-y,r[7]=0,r[8]=h,r[9]=w,r[10]=-p,r[11]=0,r[12]=O,r[13]=T,r[14]=M,r[15]=1,r):new c(u,s,h,O,v,g,w,T,-m,-y,-p,M,0,0,0,1)},c.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},c.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,d=-(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]=d,o[15]=1,o},c.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),d=-1,h=-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]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},c.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,d=-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]=d,a[15]=0,a},c.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),d=c,h=l,m=f,y=a+c,p=o+l,v=t+f,g=1;return i[0]=d,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=h,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=m,i[11]=0,i[12]=y,i[13]=p,i[14]=v,i[15]=g,i},c.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]]},c.getElementIndex=function(e,t){return 4*e+t},c.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},c.setColumn=function(e,t,r,n){n=c.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},c.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},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 h=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],h)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],h)),r};var m=new e;c.getMaximumScale=function(t){return c.getScale(t,m),e.maximumComponent(m)},c.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],d=e[9],h=e[10],m=e[11],y=e[12],p=e[13],v=e[14],g=e[15],w=t[0],x=t[1],E=t[2],S=t[3],O=t[4],T=t[5],M=t[6],b=t[7],_=t[8],P=t[9],N=t[10],A=t[11],I=t[12],C=t[13],R=t[14],z=t[15],D=n*w+u*x+f*E+y*S,L=i*w+s*x+d*E+p*S,U=a*w+c*x+h*E+v*S,q=o*w+l*x+m*E+g*S,B=n*O+u*T+f*M+y*b,F=i*O+s*T+d*M+p*b,W=a*O+c*T+h*M+v*b,G=o*O+l*T+m*M+g*b,Y=n*_+u*P+f*N+y*A,V=i*_+s*P+d*N+p*A,j=a*_+c*P+h*N+v*A,k=o*_+l*P+m*N+g*A,H=n*I+u*C+f*R+y*z,X=i*I+s*C+d*R+p*z,Z=a*I+c*C+h*R+v*z,J=o*I+l*C+m*R+g*z;return r[0]=D,r[1]=L,r[2]=U,r[3]=q,r[4]=B,r[5]=F,r[6]=W,r[7]=G,r[8]=Y,r[9]=V,r[10]=j,r[11]=k,r[12]=H,r[13]=X,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],i=e[1],a=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],m=e[14],y=t[0],p=t[1],v=t[2],g=t[4],w=t[5],x=t[6],E=t[8],S=t[9],O=t[10],T=t[12],M=t[13],b=t[14],_=n*y+o*p+c*v,P=i*y+u*p+l*v,N=a*y+s*p+f*v,A=n*g+o*w+c*x,I=i*g+u*w+l*x,C=a*g+s*w+f*x,R=n*E+o*S+c*O,z=i*E+u*S+l*O,D=a*E+s*S+f*O,L=n*T+o*M+c*b+d,U=i*T+u*M+l*b+h,q=a*T+s*M+f*b+m;return r[0]=_,r[1]=P,r[2]=N,r[3]=0,r[4]=A,r[5]=I,r[6]=C,r[7]=0,r[8]=R,r[9]=z,r[10]=D,r[11]=0,r[12]=L,r[13]=U,r[14]=q,r[15]=1,r},c.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;c.multiplyByUniformScale=function(e,t,r){return y.x=t,y.y=t,y.z=t,c.multiplyByScale(e,y,r)},c.multiplyByScale=function(e,t,r){var n=t.x,i=t.y,a=t.z;return 1===n&&1===i&&1===a?c.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)},c.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},c.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},c.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},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],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},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||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]&&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]},c.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},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 p=new u,v=new u,g=new t,w=new t(0,0,0,1);return c.inverse=function(e,r){if(u.equalsEpsilon(c.getRotation(e,p),v,o.EPSILON7)&&t.equals(c.getRow(e,3,g),w))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],l=e[12],f=e[1],d=e[5],h=e[9],m=e[13],y=e[2],x=e[6],E=e[10],S=e[14],O=e[3],T=e[7],M=e[11],b=e[15],_=E*b,P=S*M,N=x*b,A=S*T,I=x*M,C=E*T,R=y*b,z=S*O,D=y*M,L=E*O,U=y*T,q=x*O,B=_*d+A*h+I*m-(P*d+N*h+C*m),F=P*f+R*h+L*m-(_*f+z*h+D*m),W=N*f+z*d+U*m-(A*f+R*d+q*m),G=C*f+D*d+q*h-(I*f+L*d+U*h),Y=P*i+N*a+C*l-(_*i+A*a+I*l),V=_*n+z*a+D*l-(P*n+R*a+L*l),j=A*n+R*i+q*l-(N*n+z*i+U*l),k=I*n+L*i+U*a-(C*n+D*i+q*a);_=a*m,P=l*h,N=i*m,A=l*d,I=i*h,C=a*d,R=n*m,z=l*f,D=n*h,L=a*f,U=n*d,q=i*f;var H=_*T+A*M+I*b-(P*T+N*M+C*b),X=P*O+R*M+L*b-(_*O+z*M+D*b),Z=N*O+z*T+U*b-(A*O+R*T+q*b),J=C*O+D*T+q*M-(I*O+L*T+U*M),K=N*E+C*S+P*x-(I*S+_*x+A*E),Q=D*S+_*y+z*E-(R*E+L*S+P*y),$=R*x+q*S+A*y-(U*S+N*y+z*x),et=U*E+I*y+L*x-(D*x+q*E+C*y),tt=n*B+i*F+a*W+l*G;if(Math.abs(tt)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return tt=1/tt,r[0]=B*tt,r[1]=F*tt,r[2]=W*tt,r[3]=G*tt,r[4]=Y*tt,r[5]=V*tt,r[6]=j*tt,r[7]=k*tt,r[8]=H*tt,r[9]=X*tt,r[10]=Z*tt,r[11]=J*tt,r[12]=K*tt,r[13]=Q*tt,r[14]=$*tt,r[15]=et*tt,r},c.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],d=e[13],h=e[14],m=-r*f-n*d-i*h,y=-a*f-o*d-u*h,p=-s*f-c*d-l*h;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]=m,t[13]=y,t[14]=p,t[15]=1,t},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,i,a,o){"use strict";var u=function(e,r,n,i){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(i,0)};u.fromDegrees=function(e,n,i,a,s){return e=o.toRadians(t(e,0)),n=o.toRadians(t(n,0)),i=o.toRadians(t(i,0)),a=o.toRadians(t(a,0)),r(s)?(s.west=e,s.south=n,s.east=i,s.north=a,s):new u(e,n,i,a)},u.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=e.length;c>s;s++){var l=e[s];n=Math.min(n,l.longitude),i=Math.max(i,l.longitude),a=Math.min(a,l.latitude),o=Math.max(o,l.latitude)}return r(t)?(t.west=n,t.south=a,t.east=i,t.north=o,t):new u(n,a,i,o)},u.packedLength=4,u.pack=function(e,r,n){n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north},u.unpack=function(e,n,i){return n=t(n,0),r(i)||(i=new u),i.west=e[n++],i.south=e[n++],i.east=e[n++],i.north=e[n],i},u.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},u.validate=function(){},u.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},u.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},u.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},u.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},u.center=function(t,n){var i=t.east,a=t.west,u=.5*(a+i);return a>i&&(u=o.negativePiToPi(u+o.PI)),r(n)?(n.longitude=u,n.latitude=.5*(t.south+t.north),n.height=0,n):new e(u,.5*(t.south+t.north))},u.intersectWith=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),s=Math.min(e.north,t.north);return r(n)?(n.west=i,n.south=a,n.east=o,n.north=s,n):new u(i,a,o,s)},u.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},u.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var s=new e;return u.subsample=function(e,n,a,u){n=t(n,i.WGS84),a=t(a,0),r(u)||(u=[]);var c=0,l=e.north,f=e.south,d=e.east,h=e.west,m=s;m.height=a,m.longitude=h,m.latitude=l,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.latitude=f,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:f>0?f:0;for(var y=1;8>y;++y){var p=-Math.PI+y*o.PI_OVER_TWO;p>h&&d>p&&(m.longitude=p,u[c]=n.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=h,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=n.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,r,n,i,a,o,u,s,c,l){"use strict";var f=function(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)},d=new e,h=new e,m=new e,y=new e,p=new e,v=new e,g=new e,w=new e,x=new e,E=new e,S=new e,O=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 i=e.clone(t[0],g),a=e.clone(i,d),o=e.clone(i,h),u=e.clone(i,m),s=e.clone(i,y),c=e.clone(i,p),l=e.clone(i,v),T=t.length,M=1;T>M;M++){e.clone(t[M],i);var b=i.x,_=i.y,P=i.z;b<a.x&&e.clone(i,a),b>s.x&&e.clone(i,s),_<o.y&&e.clone(i,o),_>c.y&&e.clone(i,c),P<u.z&&e.clone(i,u),P>l.z&&e.clone(i,l)}var N=e.magnitudeSquared(e.subtract(s,a,w)),A=e.magnitudeSquared(e.subtract(c,o,w)),I=e.magnitudeSquared(e.subtract(l,u,w)),C=a,R=s,z=N;A>z&&(z=A,C=o,R=c),I>z&&(z=I,C=u,R=l);var D=x;D.x=.5*(C.x+R.x),D.y=.5*(C.y+R.y),D.z=.5*(C.z+R.z);var L=e.magnitudeSquared(e.subtract(R,D,w)),U=Math.sqrt(L),q=E;q.x=a.x,q.y=o.y,q.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var F=e.multiplyByScalar(e.add(q,B,w),.5,O),W=0;for(M=0;T>M;M++){e.clone(t[M],i);var G=e.magnitude(e.subtract(i,F,w));G>W&&(W=G);var Y=e.magnitudeSquared(e.subtract(i,D,w));if(Y>L){var V=Math.sqrt(Y);U=.5*(U+V),L=U*U;var j=V-U;D.x=(U*D.x+j*i.x)/V,D.y=(U*D.y+j*i.y)/V,D.z=(U*D.z+j*i.z)/V}}return W>U?(e.clone(D,r.center),r.radius=U):(e.clone(F,r.center),r.radius=W),r};var T=new o,M=new e,b=new e,_=new t,P=new t;f.fromRectangle2D=function(e,t,r){return f.fromRectangleWithHeights2D(e,t,0,0,r)},f.fromRectangleWithHeights2D=function(t,i,a,o,u){if(n(u)||(u=new f),!n(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=r(i,T),l.southwest(t,_),_.height=a,l.northeast(t,P),P.height=o;var s=i.project(_,M),c=i.project(P,b),d=c.x-s.x,h=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(d*d+h*h+m*m);var y=u.center;return y.x=s.x+.5*d,y.y=s.y+.5*h,y.z=s.z+.5*m,u};var N=[];f.fromRectangle3D=function(e,t,i,o){t=r(t,a.WGS84),i=r(i,0);var u;return n(e)&&(u=l.subsample(e,t,i,N)),f.fromPoints(u,o)},f.fromVertices=function(t,i,a,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;i=r(i,e.ZERO),a=r(a,3);var u=g;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,h),l=e.clone(u,m),T=e.clone(u,y),M=e.clone(u,p),b=e.clone(u,v),_=t.length,P=0;_>P;P+=a){var N=t[P]+i.x,A=t[P+1]+i.y,I=t[P+2]+i.z;u.x=N,u.y=A,u.z=I,N<s.x&&e.clone(u,s),N>T.x&&e.clone(u,T),A<c.y&&e.clone(u,c),A>M.y&&e.clone(u,M),I<l.z&&e.clone(u,l),I>b.z&&e.clone(u,b)}var C=e.magnitudeSquared(e.subtract(T,s,w)),R=e.magnitudeSquared(e.subtract(M,c,w)),z=e.magnitudeSquared(e.subtract(b,l,w)),D=s,L=T,U=C;R>U&&(U=R,D=c,L=M),z>U&&(U=z,D=l,L=b);var q=x;q.x=.5*(D.x+L.x),q.y=.5*(D.y+L.y),q.z=.5*(D.z+L.z);var B=e.magnitudeSquared(e.subtract(L,q,w)),F=Math.sqrt(B),W=E;W.x=s.x,W.y=c.y,W.z=l.z;var G=S;G.x=T.x,G.y=M.y,G.z=b.z;var Y=e.multiplyByScalar(e.add(W,G,w),.5,O),V=0;for(P=0;_>P;P+=a){u.x=t[P]+i.x,u.y=t[P+1]+i.y,u.z=t[P+2]+i.z;var j=e.magnitude(e.subtract(u,Y,w));j>V&&(V=j);var k=e.magnitudeSquared(e.subtract(u,q,w));if(k>B){var H=Math.sqrt(k);F=.5*(F+H),B=F*F;var X=H-F;q.x=(F*q.x+X*u.x)/H,q.y=(F*q.y+X*u.y)/H,q.z=(F*q.z+X*u.z)/H}}return V>F?(e.clone(q,o.center),o.radius=F):(e.clone(Y,o.center),o.radius=V),o},f.fromCornerPoints=function(t,r,i){n(i)||(i=new f);var a=i.center;return e.add(t,r,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,r),i},f.fromEllipsoid=function(t,r){return n(r)||(r=new f),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r},f.clone=function(t,r){return n(t)?n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius):void 0},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var i=e.center;t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius},f.unpack=function(e,t,i){t=r(t,0),n(i)||(i=new f);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var A=new e,I=new e;f.union=function(t,r,i){n(i)||(i=new f);var a=t.center,o=r.center;e.add(a,o,I);var u=e.multiplyByScalar(I,.5,I),s=e.magnitude(e.subtract(a,u,A))+t.radius,c=e.magnitude(e.subtract(o,u,A))+r.radius;return i.radius=Math.max(s,c),e.clone(u,i.center),i};var C=new e;f.expand=function(t,r,n){n=f.clone(t,n);var i=e.magnitude(e.subtract(r,n.center,C));return i>n.radius&&(n.radius=i),n},f.intersect=function(t,r){var n=t.center,i=t.radius,a=e.dot(r,n)+r.w;return-i>a?u.OUTSIDE:i>a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=c.getMaximumScale(t)*e.radius,r};var R=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,R);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var z=new e;f.computePlaneDistances=function(t,r,i,a){n(a)||(a=new s);var o=e.subtract(t.center,r,z),u=e.multiplyByScalar(i,e.dot(i,o),z),c=e.magnitude(u);return a.start=c-t.radius,a.stop=c+t.radius,a};for(var D=new e,L=new e,U=new e,q=new e,B=new e,F=new t,W=new Array(8),G=0;8>G;++G)W[G]=new e;var Y=new o;return f.projectTo2D=function(t,n,i){n=r(n,Y);var a=n.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,D),c=e.cross(e.UNIT_Z,s,L);e.normalize(c,c);var l=e.cross(s,c,U);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var d=e.negate(l,B),h=e.negate(c,q),m=W,y=m[0];e.add(s,l,y),e.add(y,c,y),y=m[1],e.add(s,l,y),e.add(y,h,y),y=m[2],e.add(s,d,y),e.add(y,h,y),y=m[3],e.add(s,d,y),e.add(y,c,y),e.negate(s,s),y=m[4],e.add(s,l,y),e.add(y,c,y),y=m[5],e.add(s,l,y),e.add(y,h,y),y=m[6],e.add(s,d,y),e.add(y,h,y),y=m[7],e.add(s,d,y),e.add(y,c,y);for(var p=m.length,v=0;p>v;++v){var g=m[v];e.add(o,g,g);var w=a.cartesianToCartographic(g,F);n.project(w,g)}i=f.fromPoints(m,i),o=i.center;var x=o.x,E=o.y,S=o.z;return o.x=S,o.y=x,o.z=E,i},f.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersect=function(e){return f.intersect(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){return i.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++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",e(document[i])?n.fullscreenEnabled=i:(i=s+"FullScreenEnabled",e(document[i])&&(n.fullscreenEnabled=i)),i=s+"FullscreenElement",e(document[i])?n.fullscreenElement=i:(i=s+"FullScreenElement",e(document[i])&&(n.fullscreenElement=i)),i=s+"fullscreenchange",e(document["on"+i])&&("ms"===s&&(i="MSFullscreenChange"),n.fullscreenchange=i),i=s+"fullscreenerror",e(document["on"+i])&&("ms"===s&&(i="MSFullscreenError"),n.fullscreenerror=i)}return r},i.requestFullscreen=function(e){i.supportsFullscreen()&&e[n.requestFullscreen]()},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;n>r;++r)t[r]=parseInt(t[r],10);return t}function i(){if(!t(m)){m=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(m=!0,y=n(e[1]))}return m}function a(){return i()&&y}function o(){if(!t(p)&&(p=!1,!i()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(p=!0,v=n(e[1]))}return p}function u(){return o()&&v}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(g=!0,w=n(e[1]),w.isNightly=!!e[2])}return g}function c(){return s()&&w}function l(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=n(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=n(e[1])))}return x}function f(){return l()&&E}function d(){if(!t(S)){S=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(S=!0,O=n(e[1]))}return S}function h(){return d()&&O}var m,y,p,v,g,w,x,E,S,O,T={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:d,firefoxVersion:h,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};return T.supportsFullscreen=function(){return r.supportsFullscreen()},T.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},T.supportsWebWorkers=function(){return"undefined"!=typeof Worker},T}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,r,n,i){"use strict";if(!n.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return t(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(t,n,i,o){switch(i=e(i,0),o=e(o,(n.byteLength-i)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(n,i,o);case a.UNSIGNED_BYTE:return new Uint8Array(n,i,o);case a.SHORT:return new Int16Array(n,i,o);case a.UNSIGNED_SHORT:return new Uint16Array(n,i,o);case a.FLOAT:return new Float32Array(n,i,o);case a.DOUBLE:return new Float64Array(n,i,o);default:throw new r("componentDatatype is not a valid value.")}},i(a)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,r,n,i){"use strict";var a=function(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,d=1;f>d;d++){var h=t[d],m=h.x,y=h.y,p=h.z;i=Math.min(m,i),s=Math.max(m,s),o=Math.min(y,o),c=Math.max(y,c),u=Math.min(p,u),l=Math.max(p,l)}var v=n.minimum;v.x=i,v.y=o,v.z=u;var g=n.maximum;g.x=s,g.y=c,g.z=l;var w=e.add(v,g,n.center);return e.multiplyByScalar(w,.5,w),n},a.clone=function(t,n){return r(t)?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):void 0},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.intersect=function(t,r){o=e.subtract(t.maximum,t.minimum,o);var n=e.multiplyByScalar(o,.5,o),a=n.x*Math.abs(r.x)+n.y*Math.abs(r.y)+n.z*Math.abs(r.z),u=e.dot(t.center,r)+r.w;return u-a>0?i.INSIDE:0>u+a?i.OUTSIDE:i.INTERSECTING},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.intersect=function(e){return a.intersect(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";var a=function(t,r){this.x=e(t,0),this.y=e(r,0)};a.fromElements=function(e,r,n){return t(n)?(n.x=e,n.y=r,n):new a(e,r)},a.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new a(e.x,e.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n]=t.y},a.unpack=function(r,n,i){return n=e(n,0),t(i)||(i=new a),i.x=r[n++],i.y=r[n],i},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.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var u=new a;a.lerp=function(e,t,r,n){return a.multiplyByScalar(t,r,u),n=a.multiplyByScalar(e,1-r,n),a.add(u,n,n)};var s=new a,c=new a;a.angleBetween=function(e,t){return a.normalize(e,s),a.normalize(t,c),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.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n},a.ZERO=n(new a(0,0)),a.UNIT_X=n(new a(1,0)),a.UNIT_Y=n(new a(0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(a=-i/e,0>a)return[];var s=Math.sqrt(a);return[-s,s]}if(0===i)return a=-n/e,0>a?[a,0]:[0,a];var c=n*n,l=4*e*i,f=r(c,-l,t.EPSILON14);if(0>f)return[];var d=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[d/e,i/d]:[i/d,d/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,d=u*u,h=s*s,m=o*s-d,y=o*c-u*s,p=u*c-h,v=4*m*p-y*y;if(0>v){var g,w,x;d*f>=l*h?(g=o,w=m,x=-2*u*m+o*y):(g=c,w=p,x=-c*y+2*s*p);var E=0>x?-1:1,S=-E*Math.abs(g)*Math.sqrt(-v);a=-x+S;var O=a/2,T=0>O?-Math.pow(-O,1/3):Math.pow(O,1/3),M=a===S?-T:-w/T;return i=0>=w?T+M:-x/(T*T+M*M+w),d*f>=l*h?[(i-u)/o]:[-c/(i+s)]}var b=m,_=-2*u*m+o*y,P=p,N=-c*y+2*s*p,A=Math.sqrt(v),I=Math.sqrt(3)/2,C=Math.abs(Math.atan2(o*A,-_)/3);i=2*Math.sqrt(-b);var R=Math.cos(C);a=i*R;var z=i*(-R/2-I*Math.sin(C)),D=a+z>2*u?a-u:z-u,L=o,U=D/L;C=Math.abs(Math.atan2(c*A,-N)/3),i=2*Math.sqrt(-P),R=Math.cos(C),a=i*R,z=i*(-R/2-I*Math.sin(C));var q=-c,B=2*s>a+z?a+s:z+s,F=q/B,W=L*B,G=-D*B-L*q,Y=D*q,V=(s*G-u*Y)/(-u*G+s*W);return V>=U?F>=U?F>=V?[U,V,F]:[U,F,V]:[F,U,V]:F>=U?[V,U,F]:F>=V?[V,F,U]:[F,V,U]}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=0>u?-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,0>u?[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 d=-t/4,h=f[f.length-1];if(Math.abs(h)<r.EPSILON14){var m=n.computeRealRoots(1,s,l);if(2===m.length){var y,p=m[0],v=m[1];if(p>=0&&v>=0){var g=Math.sqrt(p),w=Math.sqrt(v);return[d-w,d-g,d+g,d+w]}if(p>=0&&0>v)return y=Math.sqrt(p),[d-y,d+y];if(0>p&&v>=0)return y=Math.sqrt(v),[d-y,d+y]}return[]}if(h>0){var x=Math.sqrt(h),E=(s+h-c/x)/2,S=(s+h+c/x)/2,O=n.computeRealRoots(1,x,E),T=n.computeRealRoots(1,-x,S);return 0!==O.length?(O[0]+=d,O[1]+=d,0!==T.length?(T[0]+=d,T[1]+=d,O[1]<=T[0]?[O[0],O[1],T[0],T[1]]:T[1]<=O[0]?[T[0],T[1],O[0],O[1]]:O[0]>=T[0]&&O[1]<=T[1]?[T[0],O[0],O[1],T[1]]:T[0]>=O[0]&&T[1]<=O[1]?[O[0],T[0],T[1],O[1]]:O[0]>T[0]&&O[0]<T[1]?[T[0],O[0],T[1],O[1]]:[O[0],T[0],O[1],T[1]]):O):0!==T.length?(T[0]+=d,T[1]+=d,T):[]}}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,d=c*o-a*i*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var m,y,p=h[0],v=i-p,g=v*v,w=t/2,x=v/2,E=g-4*o,S=g+4*Math.abs(o),O=c-4*p,T=c+4*Math.abs(p);if(0>p||O*S>E*T){var M=Math.sqrt(O);m=M/2,y=0===M?0:(t*x-a)/M}else{var b=Math.sqrt(E);m=0===b?0:(t*x-a)/b,y=b/2}var _,P;0===w&&0===m?(_=0,P=0):r.sign(w)===r.sign(m)?(_=w+m,P=p/_):(P=w-m,_=p/P);var N,A;0===x&&0===y?(N=0,A=0):r.sign(x)===r.sign(y)?(N=x+y,A=o/N):(A=x-y,N=o/A);var I=n.computeRealRoots(1,_,N),C=n.computeRealRoots(1,P,A);if(0!==I.length)return 0!==C.length?I[1]<=C[0]?[I[0],I[1],C[0],C[1]]:C[1]<=I[0]?[C[0],C[1],I[0],I[1]]:I[0]>=C[0]&&I[1]<=C[1]?[C[0],I[0],I[1],C[1]]:C[0]>=I[0]&&C[1]<=I[1]?[I[0],C[0],C[1],I[1]]:I[0]>C[0]&&I[0]<C[1]?[C[0],I[0],C[1],I[1]]:[I[0],C[0],I[1],C[1]]:I;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,d=f*n,h=i*i,m=h*i,y=u*c*f-4*s*d-4*e*l*f+18*e*t*r*d-27*a*f*f+256*o*m+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)+h*(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,d=s/t,h=0>c?1:0;switch(h+=0>l?h+1:h,h+=0>f?h+1:h,h+=0>d?h+1:h){case 0:return i(c,l,f,d);case 1:return a(c,l,f,d);case 2:return a(c,l,f,d);case 3:return i(c,l,f,d);case 4:return i(c,l,f,d);case 5:return a(c,l,f,d);case 6:return i(c,l,f,d);case 7:return i(c,l,f,d);case 8:return a(c,l,f,d);case 9:return i(c,l,f,d); -case 10:return i(c,l,f,d);case 11:return a(c,l,f,d);case 12:return i(c,l,f,d);case 13:return i(c,l,f,d);case 14:return i(c,l,f,d);case 15:return i(c,l,f,d);default:return void 0}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=function(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n};return n.getPoint=function(t,n,i){return r(i)||(i=new e),i=e.multiplyByScalar(t.direction,n,i),e.add(t.origin,i,i)},n}),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(t,n,i,o,u){u=r(u,!1);var s,c,l,f,d,h=t.origin,m=t.direction,y=e.subtract(i,n,p),E=e.subtract(o,n,v),S=e.cross(m,E,g),O=e.dot(y,S);if(u){if(O<a.EPSILON6)return void 0;if(s=e.subtract(h,n,w),l=e.dot(s,S),0>l||l>O)return void 0;if(c=e.cross(s,y,x),f=e.dot(m,c),0>f||l+f>O)return void 0;d=e.dot(E,c)/O}else{if(Math.abs(O)<a.EPSILON6)return void 0;var T=1/O;if(s=e.subtract(h,n,w),l=e.dot(s,S)*T,0>l||l>1)return void 0;if(c=e.cross(s,y,x),f=e.dot(m,c)*T,0>f||l+f>1)return void 0;d=e.dot(E,c)*T}return d}function f(e,t,r,n){var i=t*t-4*e*r;if(0>i)return void 0;if(i>0){var a=1/(2*e),o=Math.sqrt(i),u=(-t+o)*a,s=(-t-o)*a;return s>u?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);return 0===c?void 0:(n.root0=n.root1=c,n)}function d(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,g),l=e.dot(o,o),d=2*e.dot(o,c),h=e.magnitudeSquared(c)-s,m=f(l,d,h,S);return n(m)?(i.start=m.root0,i.stop=m.root1,i):void 0}function h(e,t,r){var n=e+t;return a.sign(e)!==a.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function m(t,r,n,i,c){var l,f=i*i,d=c*c,m=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*d,y=c*(i*h(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],a.EPSILON15)+r.y),p=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*d+i*r.x+n,v=d*h(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],a.EPSILON15),g=c*(i*h(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+r.z),w=[];if(0===g&&0===v){if(l=u.computeRealRoots(m,y,p),0===l.length)return w;var x=l[0],E=Math.sqrt(Math.max(1-x*x,0));if(w.push(new e(i,c*x,c*-E)),w.push(new e(i,c*x,c*E)),2===l.length){var S=l[1],O=Math.sqrt(Math.max(1-S*S,0));w.push(new e(i,c*S,c*-O)),w.push(new e(i,c*S,c*O))}return w}var T=g*g,M=v*v,b=m*m,_=g*v,P=b+M,N=2*(y*m+_),A=2*p*m+y*y-M+T,I=2*(p*y-_),C=p*p-T;if(0===P&&0===N&&0===A&&0===I)return w;l=s.computeRealRoots(P,N,A,I,C);var R=l.length;if(0===R)return w;for(var z=0;R>z;++z){var D,L=l[z],U=L*L,q=Math.max(1-U,0),B=Math.sqrt(q);D=a.sign(m)===a.sign(p)?h(m*U+p,y*L,a.EPSILON12):a.sign(p)===a.sign(y*L)?h(m*U,y*L+p,a.EPSILON12):h(m*U+y*L,p,a.EPSILON12);var F=h(v*L,g,a.EPSILON15),W=D*F;0>W?w.push(new e(i,c*L,c*B)):W>0?w.push(new e(i,c*L,c*-B)):0!==B?(w.push(new e(i,c*L,c*-B)),w.push(new e(i,c*L,c*B)),++z):w.push(new e(i,c*L,c*B))}return w}var y={};y.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)return void 0;var l=(-r.distance-e.dot(s,o))/c;return 0>l?void 0:(i=e.multiplyByScalar(u,l,i),e.add(o,i,i))};var p=new e,v=new e,g=new e,w=new e,x=new e;y.rayTriangle=function(t,r,i,a,o,u){var s=l(t,r,i,a,o);return!n(s)||0>s?void 0:(n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u))};var E=new c;y.lineSegmentTriangle=function(t,r,i,a,o,u,s){var c=E;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var f=l(c,i,a,o,u);return!n(f)||0>f||f>e.distance(t,r)?void 0:(n(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var S={root0:0,root1:0};y.raySphere=function(e,t,r){return r=d(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var O=new c;y.lineSegmentSphere=function(t,r,i,a){var o=O;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),a=d(o,i,a),!n(a)||a.stop<0||a.start>s?void 0:(a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a)};var T=new e,M=new e;y.rayEllipsoid=function(t,r){var n,i,a,o,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,T),l=e.multiplyComponents(s,t.direction,M),f=e.magnitudeSquared(c),d=e.dot(c,l);if(f>1){if(d>=0)return void 0;var h=d*d;if(n=f-1,i=e.magnitudeSquared(l),a=i*n,a>h)return void 0;if(h>a){o=d*d-a,u=-d+Math.sqrt(o);var m=u/i,y=n/u;return y>m?{start:m,stop:y}:{start:y,stop:m}}var p=Math.sqrt(n/i);return{start:p,stop:p}}return 1>f?(n=f-1,i=e.magnitudeSquared(l),a=i*n,o=d*d-a,u=-d+Math.sqrt(o),{start:0,stop:u/i}):0>d?(i=e.magnitudeSquared(l),{start:0,stop:-d/i}):void 0};var b=new e,_=new e,P=new e,N=new e,A=new e,I=new o,C=new o,R=new o,z=new o,D=new o,L=new o,U=new o,q=new e,B=new e,F=new t;y.grazingAltitudeLocation=function(t,r){var i=t.origin,u=t.direction,s=r.geodeticSurfaceNormal(i);if(e.dot(u,s)>=0)return i;var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u),f=e.normalize(l,b),d=e.mostOrthogonalAxis(l,N),h=e.normalize(e.cross(d,f,_),_),y=e.normalize(e.cross(f,h,P),P),p=I;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]=y.x,p[7]=y.y,p[8]=y.z;var v=o.transpose(p,C),g=o.fromScale(r.radii,R),w=o.fromScale(r.oneOverRadii,z),x=D;x[0]=0,x[1]=-u.z,x[2]=u.y,x[3]=u.z,x[4]=0,x[5]=-u.x,x[6]=-u.y,x[7]=u.x,x[8]=0;var E,S,O=o.multiply(o.multiply(v,w,L),x,L),T=o.multiply(o.multiply(O,g,U),p,U),M=o.multiplyByVector(O,i,A),W=m(T,e.negate(M,b),0,0,1),G=W.length;if(G>0){for(var Y=e.clone(e.ZERO,B),V=Number.NEGATIVE_INFINITY,j=0;G>j;++j){E=o.multiplyByVector(g,o.multiplyByVector(p,W[j],q),q);var k=e.normalize(e.subtract(E,i,N),N),H=e.dot(k,u);H>V&&(V=H,Y=e.clone(E,Y))}var X=r.cartesianToCartographic(Y,F);return V=a.clamp(V,0,1),S=e.magnitude(e.subtract(Y,i,N))*Math.sqrt(1-V*V),S=c?-S:S,X.height=S,r.cartographicToCartesian(X)}return void 0};var W=new e;return y.lineSegmentPlane=function(t,r,i,o){n(o)||(o=new e);var u=e.subtract(r,t,W),s=i.normal,c=e.dot(s,u);if(Math.abs(c)<a.EPSILON6)return void 0;var l=e.dot(s,t),f=-(i.distance+l)/c;return 0>f||f>1?void 0:(e.multiplyByScalar(u,f,o),e.add(t,o,o),o)},y.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,d;if((1===l||2===l)&&(f=new e,d=new e),1===l){if(u)return y.lineSegmentPlane(t,r,i,f),y.lineSegmentPlane(t,n,i,d),{positions:[t,r,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return y.lineSegmentPlane(r,n,i,f),y.lineSegmentPlane(r,t,i,d),{positions:[t,r,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return y.lineSegmentPlane(n,t,i,f),y.lineSegmentPlane(n,r,i,d),{positions:[t,r,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return y.lineSegmentPlane(r,t,i,f),y.lineSegmentPlane(n,t,i,d),{positions:[t,r,n,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return y.lineSegmentPlane(n,r,i,f),y.lineSegmentPlane(t,r,i,d),{positions:[t,r,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return y.lineSegmentPlane(t,n,i,f),y.lineSegmentPlane(r,n,i,d),{positions:[t,r,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},y}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(t,r){this.normal=e.clone(t),this.distance=r};return r.fromPointNormal=function(n,i,a){var o=-e.dot(i,n);return t(a)?(e.clone(i,a.normal),a.distance=o,a):new r(i,o)},r.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},r}),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(n){return a(n)}});return r}function a(e){var r=new n(function(r,n){try{return n?t(n(e)):a(e)}catch(i){return a(i)}});return r}function o(){function e(e,t,r){return d(e,t,r)}function r(e){return m(e)}function i(e){return m(a(e))}function u(e){return h(e)}var s,c,l,f,d,h,m;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=[],d=function(e,t,r){var n,i;return n=o(),i="function"==typeof r?function(e){try{n.progress(r(e))}catch(t){n.progress(t)}}:function(e){n.progress(e)},l.push(function(r){r.then(e,t).then(n.resolve,n.reject,i)}),f.push(i),n.promise},h=function(e){return y(f,e),e},m=function(e){return e=t(e),d=e.then,m=t,h=v,y(l,e),f=l=E,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,r,n,i,a){return p(2,arguments),e(t,function(t){function u(e){y(e)}function s(e){m(e)}var c,l,f,d,h,m,y,p,g,w;if(g=t.length>>>0,c=Math.max(0,Math.min(r,g)),f=[],l=g-c+1,d=[],h=o(),c)for(p=h.progress,y=function(e){d.push(e),--l||(m=y=v,h.reject(d))},m=function(e){f.push(e),--c||(m=y=v,h.resolve(f))},w=0;g>w;++w)w in t&&e(t[w],s,u,p);else h.resolve(f);return h.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 p(1,arguments),d(e,g).then(t,r,n)}function f(){return d(arguments,g)}function d(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;i>s;s++)s in t?u(t[s],s):--a;else c.resolve(n);return c.promise})}function h(t,r){var n=x.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)})})},w.apply(t,n)})}function m(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 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 v(){}function g(e){return e}var w,x,E;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=m,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(E,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(E,t)})})}},x=[].slice,w=[].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(;i>a;++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/binarySearch",["./defined","./DeveloperError"],function(){"use strict";var e=function(e,t,r){for(var n,i,a=0,o=e.length-1;o>=a;)if(n=~~((a+o)/2),i=r(e[n],t),0>i)a=n+1;else{if(!(i>0))return n;o=n-1}return~(o+1)};return e}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";var e=function(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,d){var h,m,y,p,v;if("%%"==e)return"%";for(var g=!1,w="",x=!1,E=!1,S=" ",O=s.length,T=0;s&&O>T;T++)switch(s.charAt(T)){case" ":w=" ";break;case"+":w="+";break;case"-":g=!0;break;case"'":S=s.charAt(T+1);break;case"0":x=!0;break;case"#":E=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(c=-c,g=!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,v=n?t[n.slice(0,-1)]:t[r++],d){case"s":return u(String(v),g,c,f,x,S);case"c":return u(String.fromCharCode(+v),g,c,f,x);case"b":return o(v,2,E,g,c,f,x);case"o":return o(v,8,E,g,c,f,x);case"x":return o(v,16,E,g,c,f,x);case"X":return o(v,16,E,g,c,f,x).toUpperCase();case"u":return o(v,10,E,g,c,f,x);case"i":case"d":return h=+v||0,h=Math.round(h-h%1),m=0>h?"-":w,v=m+i(String(Math.abs(h)),f,"0",!1),a(v,m,g,c,x);case"e":case"E":case"f":case"F":case"g":case"G":return h=+v,m=0>h?"-":w,y=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],v=m+Math.abs(h)[y](f),a(v,m,g,c,x)[p]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";var e=function(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(){"use strict";function e(e){return 0===e%4&&0!==e%100||0===e%400}return e}),define("Core/LeapSecond",[],function(){"use strict";var e=function(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 N.compare(e.julianDate,t.julianDate)}function f(e){g.julianDate=e;var r=N.leapSeconds,n=t(r,g,l);0>n&&(n=~n),n>=r.length&&(n=r.length-1);var i=r[n].offset;if(n>0){var a=N.secondsDifference(r[n].julianDate,e);a>i&&(n--,i=r[n].offset)}N.addSeconds(e,i,e)}function d(e,r){g.julianDate=e;var n=N.leapSeconds,i=t(n,g,l);if(0>i&&(i=~i),0===i)return N.addSeconds(e,-n[0].offset,r);if(i>=n.length)return N.addSeconds(e,-n[i-1].offset,r);var a=N.secondsDifference(n[i].julianDate,e);return 0===a?N.addSeconds(e,-n[i].offset,r):1>=a?void 0:N.addSeconds(e,-n[--i].offset,r)}function h(e,t,r){var n=0|t/s.SECONDS_PER_DAY;return e+=n,t-=s.SECONDS_PER_DAY*n,0>t&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function m(e,t,r,n,i,a,o){var u=0|(t-14)/12,c=e+4800+u,l=(0|1461*c/4)+(0|367*(t-2-12*u)/12)-(0|3*((c+100)/100)/4)+r-32075;n-=12,0>n&&(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]}var y=new a,p=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,g=new u,w=/^(\d{4})$/,x=/^(\d{4})-(\d{2})$/,E=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,O=/^(\d{4})-?(\d{2})-?(\d{2})$/,T=/([Z+\-])?(\d{2})?:?(\d{2})?$/,M=/^(\d{2})(\.\d+)?/.source+T.source,b=/^(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,_=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,P="Invalid ISO 8601 date.",N=function(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,h(i,t,this),n===c.UTC&&f(this)};N.fromDate=function(e,t){var r=m(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 N(r[0],r[1],c.UTC)},N.fromIso8601=function(e,t){e=e.replace(",",".");var r,a,u,s=e.split("T"),l=1,d=1,y=0,g=0,T=0,A=0,I=s[0],C=s[1];if(!n(I))throw new i(P);var R;if(s=I.match(O),null!==s){if(R=I.split("-").length-1,R>0&&2!==R)throw new i(P);r=+s[1],l=+s[2],d=+s[3]}else if(s=I.match(x),null!==s)r=+s[1],l=+s[2];else if(s=I.match(w),null!==s)r=+s[1];else{var z;if(s=I.match(E),null!==s){if(r=+s[1],z=+s[2],u=o(r),1>z||u&&z>366||!u&&z>365)throw new i(P)}else{if(s=I.match(S),null===s)throw new i(P);r=+s[1];var D=+s[2],L=+s[3]||0;if(R=I.split("-").length-1,R>0&&(!n(s[3])&&1!==R||n(s[3])&&2!==R))throw new i(P);var U=new Date(Date.UTC(r,0,4));z=7*D+L-U.getUTCDay()-3}a=new Date(Date.UTC(r,0,1)),a.setUTCDate(z),l=a.getUTCMonth()+1,d=a.getUTCDate()}if(u=o(r),1>l||l>12||1>d||(2!==l||!u)&&d>p[l-1]||u&&2===l&&d>v)throw new i(P);var q;if(n(C)){if(s=C.match(_),null!==s){if(R=C.split(":").length-1,R>0&&2!==R&&3!==R)throw new i(P);y=+s[1],g=+s[2],T=+s[3],A=1e3*+(s[4]||0),q=5}else if(s=C.match(b),null!==s){if(R=C.split(":").length-1,R>0&&1!==R)throw new i(P);y=+s[1],g=+s[2],T=60*+(s[3]||0),q=4}else{if(s=C.match(M),null===s)throw new i(P);y=+s[1],g=60*+(s[2]||0),q=3}if(g>=60||T>=61||y>24||24===y&&(g>0||T>0||A>0))throw new i(P);var B=s[q],F=+s[q+1],W=+(s[q+2]||0);switch(B){case"+":y-=F,g-=W;break;case"-":y+=F,g+=W;break;case"Z":break;default:g+=new Date(Date.UTC(r,l-1,d,y,g)).getTimezoneOffset()}}else g+=new Date(Date.UTC(r,l-1,d)).getTimezoneOffset();var G=60===T;for(G&&T--;g>=60;)g-=60,y++;for(;y>=24;)y-=24,d++;for(a=u&&2===l?v:p[l-1];d>a;)d-=a,l++,l>12&&(l-=12,r++),a=u&&2===l?v:p[l-1];for(;0>g;)g+=60,y--;for(;0>y;)y+=24,d--;for(;1>d;)l--,1>l&&(l+=12,r--),a=u&&2===l?v:p[l-1],d+=a;var Y=m(r,l,d,y,g,T,A);return n(t)?(h(Y[0],Y[1],t),f(t)):t=new N(Y[0],Y[1],c.UTC),G&&N.addSeconds(t,1,t),t},N.now=function(e){return N.fromDate(new Date,e)};var A=new N(0,0,c.TAI);return N.toGregorianDate=function(e,t){var r=!1,i=d(e,A);n(i)||(N.addSeconds(e,-1,A),i=d(A,A),r=!0);var o=i.dayNumber,u=i.secondsOfDay;u>=43200&&(o+=1);var c=0|o+68569,l=0|4*c/146097;c=0|c-(0|(146097*l+3)/4);var f=0|4e3*(c+1)/1461001;c=0|c-(0|1461*f/4)+31;var h=0|80*c/2447,m=0|c-(0|2447*h/80);c=0|h/11;var y=0|h+2-12*c,p=0|100*(l-49)+f+c,v=0|u/s.SECONDS_PER_HOUR,g=u-v*s.SECONDS_PER_HOUR,w=0|g/s.SECONDS_PER_MINUTE;g-=w*s.SECONDS_PER_MINUTE;var x=0|g,E=(g-x)/s.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),r&&(x+=1),n(t)?(t.year=p,t.month=y,t.day=m,t.hour=v,t.minute=w,t.second=x,t.millisecond=E,t.isLeapSecond=r,t):new a(p,y,m,v,w,x,E,r)},N.toDate=function(e){var t=N.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))},N.toIso8601=function(t,r){var i,a=N.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))},N.clone=function(e,t){return n(e)?n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new N(e.dayNumber,e.secondsOfDay,c.TAI):void 0},N.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},N.equals=function(e,t){return e===t||n(e)&&n(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},N.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(N.secondsDifference(e,t))<=r},N.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},N.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},N.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,n=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+n},N.computeTaiMinusUtc=function(e){g.julianDate=e;var r=N.leapSeconds,n=t(r,g,l);return 0>n&&(n=~n,--n,0>n&&(n=0)),r[n].offset},N.addSeconds=function(e,t,r){return h(e.dayNumber,e.secondsOfDay+t,r)},N.addMinutes=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,n,r)},N.addHours=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,n,r)},N.addDays=function(e,t,r){var n=e.dayNumber+t;return h(n,e.secondsOfDay,r)},N.lessThan=function(e,t){return N.compare(e,t)<0},N.lessThanOrEquals=function(e,t){return N.compare(e,t)<=0},N.greaterThan=function(e,t){return N.compare(e,t)>0},N.greaterThanOrEquals=function(e,t){return N.compare(e,t)>=0},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){return N.equalsEpsilon(this,e,t)},N.prototype.toString=function(){return N.toIso8601(this)},N.leapSeconds=[new u(new N(2441317,43210,c.TAI),10),new u(new N(2441499,43211,c.TAI),11),new u(new N(2441683,43212,c.TAI),12),new u(new N(2442048,43213,c.TAI),13),new u(new N(2442413,43214,c.TAI),14),new u(new N(2442778,43215,c.TAI),15),new u(new N(2443144,43216,c.TAI),16),new u(new N(2443509,43217,c.TAI),17),new u(new N(2443874,43218,c.TAI),18),new u(new N(2444239,43219,c.TAI),19),new u(new N(2444786,43220,c.TAI),20),new u(new N(2445151,43221,c.TAI),21),new u(new N(2445516,43222,c.TAI),22),new u(new N(2446247,43223,c.TAI),23),new u(new N(2447161,43224,c.TAI),24),new u(new N(2447892,43225,c.TAI),25),new u(new N(2448257,43226,c.TAI),26),new u(new N(2448804,43227,c.TAI),27),new u(new N(2449169,43228,c.TAI),28),new u(new N(2449534,43229,c.TAI),29),new u(new N(2450083,43230,c.TAI),30),new u(new N(2450630,43231,c.TAI),31),new u(new N(2451179,43232,c.TAI),32),new u(new N(2453736,43233,c.TAI),33),new u(new N(2454832,43234,c.TAI),34),new u(new N(2456109,43235,c.TAI),35)],N}),define("Core/clone",["./defaultValue"],function(e){"use strict";var t=function(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";var e=function(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";var r=function(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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,r,n,i,a){"use strict";function o(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function u(e,t){for(var r=o(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 s(e,r){r=t(r,"");var i=e[1],a=!!e[2],s=e[3];switch(r){case"":case"text":return o(a,s);case"arraybuffer":return u(a,s);case"blob":var c=u(a,s);return new Blob([c],{type:i});case"document":var l=new DOMParser;return l.parseFromString(o(a,s),i);case"json":return JSON.parse(o(a,s));default:throw new n("Unhandled responseType: "+r)}}var c=function(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,i=t(r.method,"GET"),a=r.data,o=r.headers,u=r.overrideMimeType,s=r.withCredentials;return e(r.url,function(t){var r=e.defer();return c.load(t,n,i,a,o,r,u,s),r.promise})},l=/^data:(.*?)(;base64)?,(.*)$/;return c.load=function(e,t,n,o,u,c,f,d){var h=l.exec(e);if(null!==h)return c.resolve(s(h,t)),void 0;var m=new XMLHttpRequest;if(r(f)&&r(m.overrideMimeType)&&m.overrideMimeType(f),m.open(n,e,!0),r(u))for(var y in u)u.hasOwnProperty(y)&&m.setRequestHeader(y,u[y]);r(t)&&(m.responseType=t),r(d)&&(m.withCredentials=d),m.onload=function(){200===m.status?r(m.response)?c.resolve(m.response):r(m.responseXML)&&m.responseXML.hasChildNodes()?c.resolve(m.responseXML):r(m.responseText)?c.resolve(m.responseText):c.reject(new a("unknown XMLHttpRequest response type.")):c.reject(new i(m.status,m.response,m.getAllResponseHeaders()))},m.onerror=function(){c.reject(new i)},m.send(o)},c.defaultLoad=c.load,c}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";var r=function(r,n){return e({url:r,headers:t(n)?n.headers:void 0,overrideMimeType:t(n)?n.overrideMimeType:void 0,withCredentials:t(n)?n.withCredentials:void 0})};return r}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";var i={Accept:"application/json,*/*;q=0.01"},a=function(r,a){return t(a)||(a={}),t(a.headers)?t(a.headers.Accept)||(a.headers=e(a.headers),a.headers.Accept=i.Accept):a.headers=i,n(r,a).then(function(e){return JSON.parse(e)})};return a}),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 d(e,t){return o.compare(e.julianDate,t)}function h(e,r){if(!n(r.columnNames))return e._dataError="Error in loaded EOP data: The columnNames property is required.",void 0;if(!n(r.samples))return e._dataError="Error in loaded EOP data: The samples property is required.",void 0;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"),m=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),y=r.columnNames.indexOf("taiMinusUtcSeconds");if(0>i||0>a||0>s||0>c||0>h||0>m||0>y)return e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns",void 0;var p=e._samples=r.samples,v=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=a,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=m,e._taiMinusUtcSecondsColumn=y,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var g,w=e._addNewLeapSeconds,x=0,E=p.length;E>x;x+=e._columnCount){var S=p[x+i],O=p[x+y],T=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,M=new o(T,O,f.TAI);if(v.push(M),w){if(O!==g&&n(g)){var b=o.leapSeconds,_=t(b,M,d);if(0>_){var P=new u(M,O);b.splice(~_,0,P)}}g=O}}}function m(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 p(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 m(e,r,i,s,u),u;if(n.equals(l))return m(e,r,a,s,u),u;var f=o.secondsDifference(n,c)/o.secondsDifference(l,c),d=i*s,h=a*s,p=r[d+e._ut1MinusUtcSecondsColumn],v=r[h+e._ut1MinusUtcSecondsColumn],g=v-p;if(g>.5||-.5>g){var w=r[d+e._taiMinusUtcSecondsColumn],x=r[h+e._taiMinusUtcSecondsColumn];w!==x&&(l.equals(n)?p=v:v-=x-w)}return u.xPoleWander=y(f,r[d+e._xPoleWanderRadiansColumn],r[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=y(f,r[d+e._yPoleWanderRadiansColumn],r[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=y(f,r[d+e._xCelestialPoleOffsetRadiansColumn],r[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=y(f,r[d+e._yCelestialPoleOffsetRadiansColumn],r[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=y(f,p,v),u}var v=function(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))h(this,t.data);else if(n(t.url)){var i=this;this._downloadPromise=e(s(t.url),function(e){h(i,e)},function(){i._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else h(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})};return v.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}}),v.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},v.prototype.compute=function(e,r){if(!n(this._samples)){if(n(this._dataError))throw new c(this._dataError);return void 0}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],d=a[u+1],h=o.lessThanOrEquals(f,e),m=!n(d),y=m||o.greaterThanOrEquals(d,e);if(h&&y)return s=u,!m&&d.equals(e)&&++s,l=s+1,p(this,a,this._samples,e,s,l,r),r}var v=t(a,e,o.compare,this._dateColumn);return v>=0?(v<a.length-1&&a[v+1].equals(e)&&++v,s=v,l=v):(l=~v,s=l-1,0>s&&(s=0)),this._lastIndex=s,p(this,a,this._samples,e,s,l,r),r},v}),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()):(r.path=t.authority&&""==t.path?"/"+this.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];for(n&&t.shift(),""==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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","require"],function(e,t,r,n){"use strict";function i(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;r>t;++t){var n=e[t].getAttribute("src"),i=f.exec(n);if(null!==i)return i[1]}return void 0}function a(){if(t(s))return s;var n;if(n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:i(),!t(n))throw new r("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return s=new e(n).resolve(new e(document.location.href))}function o(e){return n.toUrl("../"+e)}function u(t){return new e(t).resolve(a()).toString()}var s,c,l,f=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i,d=function(e){t(c)||(c=t(n.toUrl)?o:u),t(l)||(l=document.createElement("a"));var r=c(e);return l.href=r,l.href=l.href,l.href};return d._cesiumScriptRegex=f,d}),define("Core/Iau2006XysSample",[],function(){"use strict";var e=function(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,t,r){var n=f;return n.dayNumber=t,n.secondsOfDay=r,a.daysDifference(n,e._sampleZeroDateTT)}function c(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=3*i*r._samplesPerXysFile,u=0,s=n.length;s>u;++u)t[o+u]=n[u];a.resolve()}),a.promise}var l=function(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;t>=s;++s){n[s]=o,i[s]=s*this._stepSizeDays;for(var c=0;t>=c;++c)c!==s&&(n[s]*=s-c);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)},f=new a(0,0,u.TAI);return l.prototype.preload=function(t,r,n,i){var a=s(this,t,r),o=s(this,n,i),u=0|a/this._stepSizeDays-this._interpolationOrder/2;0>u&&(u=0);var l=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var f=0|u/this._samplesPerXysFile,d=0|l/this._samplesPerXysFile,h=[],m=f;d>=m;++m)h.push(c(this,m));return e.all(h)},l.prototype.computeXysRadians=function(e,t,r){var a=s(this,e,t);if(0>a)return void 0;var o=0|a/this._stepSizeDays;if(o>=this._totalSamples)return void 0;var u=this._interpolationOrder,l=o-(0|u/2);0>l&&(l=0);var f=l+u;f>=this._totalSamples&&(f=this._totalSamples-1,l=f-u,0>l&&(l=0));var d=!1,h=this._samples;if(n(h[3*l])||(c(this,0|l/this._samplesPerXysFile),d=!0),n(h[3*f])||(c(this,0|f/this._samplesPerXysFile),d=!0),d)return void 0;n(r)?(r.x=0,r.y=0,r.s=0):r=new i(0,0,0);var m,y,p=a-l*this._stepSizeDays,v=this._work,g=this._denominators,w=this._coef,x=this._xTable;for(m=0;u>=m;++m)v[m]=p-x[m];for(m=0;u>=m;++m){for(w[m]=1,y=0;u>=y;++y)y!==m&&(w[m]*=v[y]);w[m]*=g[m];var E=3*(l+m);r.x+=w[m]*h[E++],r.y+=w[m]*h[E++],r.s+=w[m]*h[E]}return r},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./TimeConstants"],function(e,t,r,n,i,a,o,u,s,c,l,f,d,h,m,y,p){"use strict";var v={},g=new r,w=new r,x=new r;v.eastNorthUpToFixedFrame=function(e,t,n){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return a(n)?(n[0]=0,n[1]=1,n[2]=0,n[3]=0,n[4]=-o,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=o,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new y(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=g,s=w,l=x;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),a(n)?(n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=l.x,n[5]=l.y,n[6]=l.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 y(s.x,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var E=new r,S=new r,O=new r;v.northEastDownToFixedFrame=function(e,t,n){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return a(n)?(n[0]=-o,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]=-o,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new y(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=E,s=S,l=O;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),a(n)?(n[0]=l.x,n[1]=l.y,n[2]=l.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 y(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},v.northUpEastToFixedFrame=function(e,t,n){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return a(n)?(n[0]=-o,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=o,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 y(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=g,s=w,l=x;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),a(n)?(n[0]=l.x,n[1]=l.y,n[2]=l.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 y(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=24110.54841,M=8640184.812866,b=.093104,_=-62e-7,P=1.1772758384668e-19,N=72921158553e-15,A=h.TWO_PI/86400,I=new d;v.computeTemeToPseudoFixedMatrix=function(e,t){I=d.addSeconds(e,-d.computeTaiMinusUtc(e),I);var r,n=I.dayNumber,i=I.secondsOfDay,o=n-2451545;r=i>=43200?(o+.5)/p.DAYS_PER_JULIAN_CENTURY:(o-.5)/p.DAYS_PER_JULIAN_CENTURY;var u=T+r*(M+r*(b+r*_)),s=u*A%h.TWO_PI,c=N+P*(n-2451545.5),l=(i+.5*p.SECONDS_PER_DAY)%p.SECONDS_PER_DAY,f=s+c*l,y=Math.cos(f),v=Math.sin(f);return a(t)?(t[0]=y,t[1]=-v,t[2]=0,t[3]=v,t[4]=y,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(y,v,0,-v,y,0,0,0,1)},v.iau2006XysData=new l,v.earthOrientationParameters=u.NONE;var C=32.184,R=2451545;v.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+C,i=t.stop.dayNumber,a=t.stop.secondsOfDay+C,o=v.iau2006XysData.preload(r,n,i,a),u=v.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},v.computeIcrfToFixedMatrix=function(e,t){a(t)||(t=new m);var r=v.computeFixedToIcrfMatrix(e,t);return a(r)?m.transpose(r,t):void 0};var z=new f(0,0,0),D=new s(0,0,0,0,0,0),L=new m,U=new m;v.computeFixedToIcrfMatrix=function(e,t){a(t)||(t=new m);var r=v.earthOrientationParameters.compute(e,D);if(!a(r))return void 0;var n=e.dayNumber,i=e.secondsOfDay+C,o=v.iau2006XysData.computeXysRadians(n,i,z);if(!a(o))return void 0;var u=o.x+r.xPoleOffset,s=o.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=L;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(-o.s,U),y=m.multiply(l,f,L),g=e.dayNumber,w=e.secondsOfDay-d.computeTaiMinusUtc(e)+r.ut1MinusUtc,x=g-2451545,E=w/p.SECONDS_PER_DAY,S=.779057273264+E+.00273781191135448*(x+E);S=S%1*h.TWO_PI;var O=m.fromRotationZ(S,U),T=m.multiply(y,O,L),M=Math.cos(r.xPoleWander),b=Math.cos(r.yPoleWander),_=Math.sin(r.xPoleWander),P=Math.sin(r.yPoleWander),N=n-R+i/p.SECONDS_PER_DAY;N/=36525;var A=-47e-6*N*h.RADIANS_PER_DEGREE/3600,I=Math.cos(A),q=Math.sin(A),B=U;return B[0]=M*I,B[1]=M*q,B[2]=_,B[3]=-b*q+P*_*I,B[4]=b*I+P*_*q,B[5]=-P*M,B[6]=-P*q-b*_*I,B[7]=P*I-b*_*q,B[8]=b*M,m.multiply(T,B,t)};var q=new n;return 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,i,o){a(o)||(o=new t);var u=q;return y.multiplyByVector(e,n.fromElements(i.x,i.y,i.z,1,u),u),n.multiplyByScalar(u,1/u.w,u),y.multiplyByVector(r,u,u),t.fromCartesian4(u,o)},v}),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,d,h){"use strict";var m=new n,y=function(e,t){t=i(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var n=h.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=r.fromCartesian4(l.getColumn(n,0,m)),this._yAxis=r.fromCartesian4(l.getColumn(n,1,m));var a=r.fromCartesian4(l.getColumn(n,2,m));this._plane=f.fromPointNormal(e,a)};o(y.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}}});var p=new e;y.fromPoints=function(t,r){var n=e.fromPoints(t,p);return new y(n.center,r)};var v=new d,g=new r;y.prototype.projectPointOntoPlane=function(e,n){var i=v;i.origin=e,r.normalize(e,i.direction);var o=c.rayPlane(i,this._plane,g);if(a(o)||(r.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,g)),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)}return void 0},y.prototype.projectPointsOntoPlane=function(e,t){a(t)||(t=[]);for(var r=0,n=e.length,i=0;n>i;i++){var o=this.projectPointOntoPlane(e[i],t[r]);a(o)&&(t[r]=o,r++)}return t.length=r,t};var w=new r;return y.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=w,l=0;n>l;++l){var f=e[l];r.multiplyByScalar(u,f.x,c),a(t[l])||(t[l]=new r);var d=r.add(o,c,t[l]);r.multiplyByScalar(s,f.y,c),r.add(d,c,d),i.scaleToGeocentricSurface(d,d)}return t},y}),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"],function(e){"use strict";var t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===t.POINTS||e===t.LINES||e===t.LINE_LOOP||e===t.LINE_STRIP||e===t.TRIANGLES||e===t.TRIANGLE_STRIP||e===t.TRIANGLE_FAN}};return e(t)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,i){"use strict";var a=function(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)};return a.computeNumberOfVertices=function(e){var n=-1;for(var i in e.attributes)if(e.attributes.hasOwnProperty(i)&&t(e.attributes[i])&&t(e.attributes[i].values)){var a=e.attributes[i],o=a.values.length/a.componentsPerAttribute;if(n!==o&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=o}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(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";var i=function(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,{})};return i}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,i){"use strict";var a={};a.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=t.x,n=t.y;t.x=(1-Math.abs(n))*i.signNotZero(r),t.y=(1-Math.abs(r))*i.signNotZero(n)}return t.x=i.toSNorm(t.x),t.y=i.toSNorm(t.y),t},a.octDecode=function(e,r,n){if(n.x=i.fromSNorm(e),n.y=i.fromSNorm(r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var a=n.x;n.x=(1-Math.abs(n.y))*i.signNotZero(a),n.y=(1-Math.abs(a))*i.signNotZero(n.y)}return t.normalize(n,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 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=1===e.x?4095:0|4096*e.x,r=1===e.y?4095:0|4096*e.y;return 4096*t+r},a.decompressTextureCoordinates=function(e,t){var r=e/4096;return t.x=Math.floor(r)/4096,t.y=r-Math.floor(r),t},a}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=new t,i=new t,a=new t,o=function(o,u,s,c,l){r(l)||(l=new t);var f,d,h,m,y,p,v,g;r(u.z)?(f=t.subtract(s,u,n),d=t.subtract(c,u,i),h=t.subtract(o,u,a),m=t.dot(f,f),y=t.dot(f,d),p=t.dot(f,h),v=t.dot(d,d),g=t.dot(d,h)):(f=e.subtract(s,u,n),d=e.subtract(c,u,i),h=e.subtract(o,u,a),m=e.dot(f,f),y=e.dot(f,d),p=e.dot(f,h),v=e.dot(d,d),g=e.dot(d,h));var w=1/(m*v-y*y);return l.y=(v*p-y*g)*w,l.z=(m*g-y*p)*w,l.x=1-l.y-l.z,l};return o}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)};r.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var n={high:0,low:0};r.fromCartesian=function(e,i){t(i)||(i=new r);var a=i.high,o=i.low;return r.encode(e.x,n),a.x=n.high,o.x=n.low,r.encode(e.y,n),a.y=n.high,o.y=n.low,r.encode(e.z,n),a.z=n.high,o.z=n.low,i};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"],function(e,t,r,n){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,i){return e>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,i):new Uint16Array(t,r,i)},r(i)}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};return r.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,i=r.maximumIndex,a=e(r.cacheSize,24),o=n.length;if(!t(i)){i=0;for(var u=0,s=n[u];o>u;)s>i&&(i=s),++u,s=n[u]}for(var c=[],l=0;i+1>l;l++)c[l]=0;for(var f=a+1,d=0;o>d;++d)f-c[n[d]]>a&&(c[n[d]]=f,++f);return(f-a+1)/(o/3)},r.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(;n>a;){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 d=r[f];i[d].numLiveTriangles&&(s=0,a-i[d].timeStamp+2*i[d].numLiveTriangles<=t&&(s=a-i[d].timeStamp),(s>l||-1===l)&&(l=s,c=d)),++f}return-1===c?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,d=o[f],h=c;if(t(u))l=u+1;else{for(;h>f;)d>l&&(l=d),++f,d=o[f];if(-1===l)return 0;++l}for(var m=[],y=0;l>y;y++)m[y]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var p=0;h>f;)m[o[f]].vertexTriangles.push(p),++m[o[f]].numLiveTriangles,m[o[f+1]].vertexTriangles.push(p),++m[o[f+1]].numLiveTriangles,m[o[f+2]].vertexTriangles.push(p),++m[o[f+2]].numLiveTriangles,++p,f+=3;var v=0,g=s+1;a=1;var w,x,E=[],S=[],O=0,T=[],M=c/3,b=[];for(y=0;M>y;y++)b[y]=!1;for(var _,P;-1!==v;){E=[],x=m[v],P=x.vertexTriangles.length;for(var N=0;P>N;++N)if(p=x.vertexTriangles[N],!b[p]){b[p]=!0,f=p+p+p;for(var A=0;3>A;++A)_=o[f],E.push(_),S.push(_),T[O]=_,++O,w=m[_],--w.numLiveTriangles,g-w.timeStamp>s&&(w.timeStamp=g,++g),++f}v=i(o,s,E,m,g,S,l)}return T},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,r,n,i,a,o,u,s,c,l,f,d,h,m,y,p,v,g,w,x,E,S,O,T){"use strict";function M(e,t,r,n,i){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=i,e[t++]=i,e[t]=r}function b(e){for(var t=e.length,r=6*(t/3),n=p.createTypedArray(t,r),i=0,a=0;t>a;a+=3,i+=6)M(n,i,e[a],e[a+1],e[a+2]);return n}function _(e){var t=e.length;if(t>=3){var r=6*(t-2),n=p.createTypedArray(t,r);M(n,0,e[0],e[1],e[2]);for(var i=6,a=3;t>a;++a,i+=6)M(n,i,e[a-1],e[a],e[a-2]);return n}return new Uint16Array}function P(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=p.createTypedArray(t,r),i=e[0],a=0,o=1;t>o;++o,a+=6)M(n,a,i,e[o],e[o+1]);return n}return new Uint16Array}function N(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 A(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 I(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;n>a;a+=3)i.unpack(r,a,Q),E.multiplyByPoint(e,Q,Q),i.pack(Q,r,a)}function C(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;n>a;a+=3)i.unpack(r,a,Q),x.multiplyByVector(e,Q,Q),Q=i.normalize(Q,Q),i.pack(Q,r,a)}function R(e){var t,r=e.length,n={},i=e[0].geometry.attributes;for(t in i)if(i.hasOwnProperty(t)&&c(i[t])&&c(i[t].values)){for(var a=i[t],o=a.values.length,s=!0,l=1;r>l;++l){var f=e[l].geometry.attributes[t];if(!c(f)||a.componentDatatype!==f.componentDatatype||a.componentsPerAttribute!==f.componentsPerAttribute||a.normalize!==f.normalize){s=!1;break}o+=f.values.length}s&&(n[t]=new m({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:u.createTypedArray(a.componentDatatype,o)}))}return n}function z(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function D(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,i=3;t>i;++i)r[n++]=i-1,r[n++]=0,r[n++]=i;return e.indices=r,e.primitiveType=O.TRIANGLES,e}function L(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,i=3;t-1>i;i+=2)r[n++]=i,r[n++]=i-1,r[n++]=i+1,t>i+2&&(r[n++]=i,r[n++]=i+1,r[n++]=i+2);return e.indices=r,e.primitiveType=O.TRIANGLES,e}function U(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function q(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,i=2;t>i;++i)r[n++]=i-1,r[n++]=i;return e.indices=r,e.primitiveType=O.LINES,e}function B(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,i=2;t>i;++i)r[n++]=i-1,r[n++]=i;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=O.LINES,e}function F(e){switch(e.primitiveType){case O.TRIANGLE_FAN:return D(e);case O.TRIANGLE_STRIP:return L(e);case O.TRIANGLES:return z(e);case O.LINE_STRIP:return q(e);case O.LINE_LOOP:return B(e);case O.LINES:return U(e)}return e}function W(e,t){Math.abs(e.y)<w.EPSILON11&&(e.y=t?-w.EPSILON11:w.EPSILON11)}function G(e,t,r,n){i.add(e,i.multiplyByScalar(i.subtract(t,e,ht),e.y/(e.y-t.y),ht),r),i.clone(r,n),W(r,!0),W(n,!1)}function Y(e,t,r){if(e.x>=0||t.x>=0||r.x>=0)return void 0;var n=e.y<0,i=t.y<0,a=r.y<0;W(e,n),W(t,i),W(r,a);var o=0;o+=n?1:0,o+=i?1:0,o+=a?1:0;var u=gt.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(G(e,t,mt,pt),G(e,r,yt,vt),u[0]=0,u[3]=1,u[4]=2,u[6]=1):i?(G(t,r,mt,pt),G(t,e,yt,vt),u[0]=1,u[3]=2,u[4]=0,u[6]=2):a&&(G(r,e,mt,pt),G(r,t,yt,vt),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||(G(r,e,mt,pt),G(r,t,yt,vt),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(G(t,r,mt,pt),G(t,e,yt,vt),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(G(e,t,mt,pt),G(e,r,yt,vt),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=gt.positions;return s[0]=e,s[1]=t,s[2]=r,gt.length=3,(1===o||2===o)&&(s[3]=mt,s[4]=yt,s[5]=pt,s[6]=vt,gt.length=7),gt}function V(e,r,a,o,u,s,l,f){if(c(u)||c(s)||c(l)||c(f)){var d,h,m,y,p,v,g,w,x,E,S,O,T=o.positions,M=T[0],b=T[1],_=T[2],P=wt,N=xt,A=Et,I=St,C=Ot,R=Tt;c(u)&&(d=i.fromArray(u,3*e),h=i.fromArray(u,3*r),m=i.fromArray(u,3*a)),c(s)&&(y=i.fromArray(s,3*e),p=i.fromArray(s,3*r),v=i.fromArray(s,3*a)),c(l)&&(g=i.fromArray(l,3*e),w=i.fromArray(l,3*r),x=i.fromArray(l,3*a)),c(f)&&(E=n.fromArray(f,2*e),S=n.fromArray(f,2*r),O=n.fromArray(f,2*a));for(var z=3;z<T.length;++z){var D=T[z],L=t(D,M,b,_);if(c(u)){P=i.multiplyByScalar(d,L.x,P),N=i.multiplyByScalar(h,L.y,N),A=i.multiplyByScalar(m,L.z,A);var U=i.add(P,N,Mt);i.add(U,A,U),i.normalize(U,U),u.push(U.x,U.y,U.z)}if(c(s)){P=i.multiplyByScalar(y,L.x,P),N=i.multiplyByScalar(p,L.y,N),A=i.multiplyByScalar(v,L.z,A);var q=i.add(P,N,Mt);i.add(q,A,q),i.normalize(q,q),s.push(q.x,q.y,q.z)}if(c(l)){P=i.multiplyByScalar(g,L.x,P),N=i.multiplyByScalar(w,L.y,N),A=i.multiplyByScalar(x,L.z,A);var B=i.add(P,N,Mt);i.add(B,A,B),i.normalize(B,B),l.push(B.x,B.y,B.z)}if(c(f)){I=n.multiplyByScalar(E,L.x,I),C=n.multiplyByScalar(S,L.y,C),R=n.multiplyByScalar(O,L.z,R);var F=n.add(I,C,I);n.add(F,R,F),f.push(F.x,F.y)}}}}function j(e){for(var t=e.attributes,r=t.position.values,n=c(t.normal)?t.normal.values:void 0,a=c(t.binormal)?t.binormal.values:void 0,o=c(t.tangent)?t.tangent.values:void 0,s=c(t.st)?t.st.values:void 0,l=e.indices,f=Array.prototype.slice.call(r,0),d=c(n)?Array.prototype.slice.call(n,0):void 0,m=c(a)?Array.prototype.slice.call(a,0):void 0,y=c(o)?Array.prototype.slice.call(o,0):void 0,v=c(s)?Array.prototype.slice.call(s,0):void 0,g=[],w=l.length,x=0;w>x;x+=3){var E=l[x],S=l[x+1],O=l[x+2],T=i.fromArray(r,3*E),M=i.fromArray(r,3*S),b=i.fromArray(r,3*O),_=Y(T,M,b);if(c(_))if(f[3*E+1]=_.positions[0].y,f[3*S+1]=_.positions[1].y,f[3*O+1]=_.positions[2].y,_.length>3){for(var P=f.length/3,N=0;N<_.indices.length;++N){var A=_.indices[N];3>A?g.push(l[x+A]):g.push(A-3+P)}for(var I=3;I<_.positions.length;++I){var C=_.positions[I];f.push(C.x,C.y,C.z)}V(E,S,O,_,d,m,y,v)}else g.push(E,S,O);else g.push(E,S,O)}e.attributes.position.values=new Float64Array(f),c(d)&&(t.normal.values=u.createTypedArray(t.normal.componentDatatype,d)),c(m)&&(t.binormal.values=u.createTypedArray(t.binormal.componentDatatype,m)),c(y)&&(t.tangent.values=u.createTypedArray(t.tangent.componentDatatype,y)),c(v)&&(t.st.values=u.createTypedArray(t.st.componentDatatype,v));var R=h.computeNumberOfVertices(e);e.indices=p.createTypedArray(R,g)}function k(e){for(var t=e.attributes,r=t.position.values,n=e.indices,a=Array.prototype.slice.call(r,0),o=[],u=n.length,s=0;u>s;s+=2){var l=n[s],f=n[s+1],d=i.fromArray(r,3*l),m=i.fromArray(r,3*f);if(Math.abs(d.y)<w.EPSILON6&&(d.y=d.y<0?-w.EPSILON6:w.EPSILON6,a[3*l+1]=d.y),Math.abs(m.y)<w.EPSILON6&&(m.y=m.y<0?-w.EPSILON6:w.EPSILON6,a[3*f+1]=m.y),o.push(l),d.x<0||m.x<0){var y=g.lineSegmentPlane(d,m,bt);if(c(y)){var v=i.multiplyByScalar(i.UNIT_Y,5*w.EPSILON9,_t);d.y<0&&i.negate(v,v);var x=a.length/3;o.push(x,x+1);var E=i.add(y,v,Pt);a.push(E.x,E.y,E.z),i.negate(v,v),i.add(y,v,E),a.push(E.x,E.y,E.z)}}o.push(f)}e.attributes.position.values=new Float64Array(a);var S=h.computeNumberOfVertices(e);e.indices=p.createTypedArray(S,o)}function H(e){var t=e.attributes,r=t.position.values,o=c(t.st)?t.st.values:void 0,s=c(t.prevPosition)?t.prevPosition.values:void 0,l=c(t.nextPosition)?t.nextPosition.values:void 0,f=c(t.expandAndWidth)?t.expandAndWidth.values:void 0,d=c(t.color)?t.color.values:void 0;e.indices;for(var m=Array.prototype.slice.call(r,0),y=c(o)?Array.prototype.slice.call(o,0):void 0,v=c(s)?Array.prototype.slice.call(s,0):void 0,x=c(l)?Array.prototype.slice.call(l,0):void 0,E=c(f)?Array.prototype.slice.call(f,0):void 0,S=c(d)?Array.prototype.slice.call(d,0):void 0,O=[],T=m.length/3,M=0;T>M;M+=4){var b=M,_=M+1,P=M+2,N=i.fromArray(m,3*b,It),A=i.fromArray(m,3*_,Ct),I=i.fromArray(m,3*P,Rt),C=i.equals(N,A);Math.abs(N.y)<w.EPSILON6&&(N.y=I.y<0?-w.EPSILON6:w.EPSILON6,m[3*b+1]=N.y),Math.abs(I.y)<w.EPSILON6&&(I.y=N.y<0?-w.EPSILON6:w.EPSILON6,m[3*P+1]=I.y),m[3*_+1]=A.y=C?N.y:I.y;var R=!1;if(N.x<0||I.x<0){var z=g.lineSegmentPlane(N,I,bt,Ct);if(c(z)){var D=i.multiplyByScalar(i.UNIT_Y,5*w.EPSILON9,zt);N.y<0&&i.negate(D,D);var L=i.add(z,D,Dt);m.push(L.x,L.y,L.z),m.push(L.x,L.y,L.z),i.negate(D,D),i.add(z,D,L),m.push(L.x,L.y,L.z),m.push(L.x,L.y,L.z),v.push(N.x,N.y,N.z,N.x,N.y,N.z),v.push(N.x,N.y,N.z,N.x,N.y,N.z),x.push(I.x,I.y,I.z,I.x,I.y,I.z),x.push(I.x,I.y,I.z,I.x,I.y,I.z);var U=n.fromArray(E,2*b),q=Math.abs(U.y);E.push(-1,-q,1,-q),E.push(-1,q,1,q);var B=i.magnitudeSquared(i.subtract(z,N,zt));if(B/=i.magnitudeSquared(i.subtract(I,N,zt)),c(S)){var F=a.fromArray(S,4*b,Lt),W=a.fromArray(S,4*P,Lt),G=w.lerp(F.x,W.x,B),Y=w.lerp(F.y,W.y,B),V=w.lerp(F.z,W.z,B),j=w.lerp(F.w,W.w,B);S.push(G,Y,V,j),S.push(G,Y,V,j),S.push(G,Y,V,j),S.push(G,Y,V,j)}if(c(y)){var k=n.fromArray(y,2*b,Nt),H=n.fromArray(y,2*(M+3),At),X=w.lerp(k.x,H.x,B);y.push(X,k.y),y.push(X,H.y),y.push(X,k.y),y.push(X,H.y)}R=!0}}if(R){var Z=m.length/3-4;O.push(M,Z,M+1),O.push(M+1,Z,Z+1),O.push(Z+2,M+2,Z+3),O.push(Z+3,M+2,M+3)}else O.push(M,M+2,M+1),O.push(M+1,M+2,M+3)}t.position.values=new Float64Array(m),t.prevPosition.values=u.createTypedArray(t.prevPosition.componentDatatype,v),t.nextPosition.values=u.createTypedArray(t.nextPosition.componentDatatype,x),t.expandAndWidth.values=u.createTypedArray(t.expandAndWidth.componentDatatype,E),c(y)&&(t.st.values=u.createTypedArray(t.st.componentDatatype,y)),c(S)&&(t.color.values=u.createTypedArray(t.color.componentDatatype,S));var J=h.computeNumberOfVertices(e);e.indices=p.createTypedArray(J,O)}var X={};X.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case O.TRIANGLES:e.indices=b(t);break;case O.TRIANGLE_STRIP:e.indices=_(t);break;case O.TRIANGLE_FAN:e.indices=P(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=O.LINES}return e},X.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,d=0;o>d;d+=3)l[f++]=i[d],l[f++]=i[d+1],l[f++]=i[d+2],l[f++]=i[d]+a[d]*n,l[f++]=i[d+1]+a[d+1]*n,l[f++]=i[d+2]+a[d+2]*n;var y,p=e.boundingSphere;return c(p)&&(y=new r(p.center,p.radius+n)),new h({attributes:{position:new m({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:O.LINES,boundingSphere:y})},X.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;o>t;++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},X.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),i=0;t>i;i++)n[i]=-1;for(var a,o=r,s=o.length,l=p.createTypedArray(t,s),f=0,d=0,m=0;s>f;)a=n[o[f]],-1!==a?l[d]=a:(a=o[f],n[a]=m,l[d]=m,++m),++f,++d;e.indices=l;var y=e.attributes;for(var v in y)if(y.hasOwnProperty(v)&&c(y[v])&&c(y[v].values)){for(var g=y[v],w=g.values,x=0,E=g.componentsPerAttribute,S=u.createTypedArray(g.componentDatatype,m*E);t>x;){var O=n[x];if(-1!==O)for(i=0;E>i;i++)S[E*O+i]=w[E*x+i];++x}g.values=S}}return e},X.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===O.TRIANGLES&&c(r)){for(var n=r.length,i=0,a=0;n>a;a++)r[a]>i&&(i=r[a]);e.indices=T.tipsify({indices:r,maximumIndex:i,cacheSize:t})}return e},X.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>w.SIXTY_FOUR_KILOBYTES){var n,i=[],a=[],o=0,u=N(e.attributes),s=e.indices,l=s.length;e.primitiveType===O.TRIANGLES?n=3:e.primitiveType===O.LINES?n=2:e.primitiveType===O.POINTS&&(n=1);for(var f=0;l>f;f+=n){for(var d=0;n>d;++d){var m=s[f+d],y=i[m];c(y)||(y=o++,i[m]=y,A(u,e.attributes,m)),a.push(y)}o+n>w.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere})),i=[],a=[],o=0,u=N(e.attributes))}0!==a.length&&t.push(new h({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere}))}else t.push(e);return t};var Z=new i,J=new o;X.projectTo2D=function(e,t,r,n,a){var o=e.attributes[t];a=c(a)?a:new d;for(var s=a.ellipsoid,f=o.values,h=new Float64Array(f.length),y=0,p=0;p<f.length;p+=3){var v=i.fromArray(f,p,Z),g=s.cartesianToCartographic(v,J);if(!c(g))throw new l("Could not project point ("+v.x+", "+v.y+", "+v.z+") to 2D.");var w=a.project(g,Z);h[y++]=w.x,h[y++]=w.y,h[y++]=w.z}return e.attributes[r]=o,e.attributes[n]=new m({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:h}),delete e.attributes[t],e};var K={high:0,low:0};X.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;o>l;++l)f.encode(a[l],K),s[l]=K.high,c[l]=K.low;var d=i.componentsPerAttribute;return e.attributes[r]=new m({componentDatatype:u.FLOAT,componentsPerAttribute:d,values:s}),e.attributes[n]=new m({componentDatatype:u.FLOAT,componentsPerAttribute:d,values:c}),delete e.attributes[t],e};var Q=new i,$=new E,et=new x;X.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(E.equals(t,E.IDENTITY))return e;var n=e.geometry.attributes;I(t,n.position),I(t,n.prevPosition),I(t,n.nextPosition),(c(n.normal)||c(n.binormal)||c(n.tangent))&&(E.inverse(t,$),E.transpose($,$),E.getRotation($,et),C(et,n.normal),C(et,n.binormal),C(et,n.tangent)); -var i=e.geometry.boundingSphere;return c(i)&&(e.geometry.boundingSphere=r.transform(i,t,i)),e.modelMatrix=E.clone(E.IDENTITY),e};var tt=new i;X.combine=function(e){var t,n,a,o,u=e.length;e[0].modelMatrix;var s,l,f,d=c(e[0].geometry.indices),m=e[0].geometry.primitiveType,y=R(e);for(t in y)if(y.hasOwnProperty(t))for(s=y[t].values,o=0,n=0;u>n;++n)for(l=e[n].geometry.attributes[t].values,f=l.length,a=0;f>a;++a)s[o++]=l[a];var v;if(d){var g=0;for(n=0;u>n;++n)g+=e[n].geometry.indices.length;var w=h.computeNumberOfVertices(new h({attributes:y,primitiveType:O.POINTS})),x=p.createTypedArray(w,g),E=0,S=0;for(n=0;u>n;++n){var T=e[n].geometry.indices,M=T.length;for(o=0;M>o;++o)x[E++]=S+T[o];S+=h.computeNumberOfVertices(e[n].geometry)}v=x}var b,_=new i,P=0;for(n=0;u>n;++n){if(b=e[n].geometry.boundingSphere,!c(b)){_=void 0;break}i.add(b.center,_,_)}if(c(_))for(i.divideByScalar(_,u,_),n=0;u>n;++n){b=e[n].geometry.boundingSphere;var N=i.magnitude(i.subtract(b.center,_,tt))+b.radius;N>P&&(P=N)}return new h({attributes:y,indices:v,primitiveType:m,boundingSphere:c(_)?new r(_,P):void 0})};var rt=new i,nt=new i,it=new i,at=new i;X.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;a>f;f++)s[f]={indexOffset:0,count:0,currentCount:0};var d=0;for(f=0;o>f;f+=3){var h=t[f],y=t[f+1],p=t[f+2],v=3*h,g=3*y,w=3*p;nt.x=n[v],nt.y=n[v+1],nt.z=n[v+2],it.x=n[g],it.y=n[g+1],it.z=n[g+2],at.x=n[w],at.y=n[w+1],at.z=n[w+2],s[h].count++,s[y].count++,s[p].count++,i.subtract(it,nt,it),i.subtract(at,nt,at),c[d]=i.cross(it,at,new i),d++}var x=0;for(f=0;a>f;f++)s[f].indexOffset+=x,x+=s[f].count;d=0;var E;for(f=0;o>f;f+=3){E=s[t[f]];var S=E.indexOffset+E.currentCount;l[S]=d,E.currentCount++,E=s[t[f+1]],S=E.indexOffset+E.currentCount,l[S]=d,E.currentCount++,E=s[t[f+2]],S=E.indexOffset+E.currentCount,l[S]=d,E.currentCount++,d++}var O=new Float32Array(3*a);for(f=0;a>f;f++){var T=3*f;if(E=s[f],E.count>0){for(i.clone(i.ZERO,rt),d=0;d<E.count;d++)i.add(rt,c[l[E.indexOffset+d]],rt);i.normalize(rt,rt),O[T]=rt.x,O[T+1]=rt.y,O[T+2]=rt.z}else O[T]=0,O[T+1]=0,O[T+2]=1}return e.attributes.normal=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:O}),e};var ot=new i,ut=new i,st=new i;X.computeBinormalAndTangent=function(e){e.attributes;for(var t=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,d,h;for(l=0;s>l;l+=3){var y=t[l],p=t[l+1],v=t[l+2];f=3*y,d=3*p,h=3*v;var g=2*y,w=2*p,x=2*v,E=r[f],S=r[f+1],O=r[f+2],T=a[g],M=a[g+1],b=a[w+1]-M,_=a[x+1]-M,P=1/((a[w]-T)*_-(a[x]-T)*b),N=(_*(r[d]-E)-b*(r[h]-E))*P,A=(_*(r[d+1]-S)-b*(r[h+1]-S))*P,I=(_*(r[d+2]-O)-b*(r[h+2]-O))*P;c[f]+=N,c[f+1]+=A,c[f+2]+=I,c[d]+=N,c[d+1]+=A,c[d+2]+=I,c[h]+=N,c[h+1]+=A,c[h+2]+=I}var C=new Float32Array(3*o),R=new Float32Array(3*o);for(l=0;o>l;l++){f=3*l,d=f+1,h=f+2;var z=i.fromArray(n,f,ot),D=i.fromArray(c,f,st),L=i.dot(z,D);i.multiplyByScalar(z,L,ut),i.normalize(i.subtract(D,ut,D),D),R[f]=D.x,R[d]=D.y,R[h]=D.z,i.normalize(i.cross(z,D,D),D),C[f]=D.x,C[d]=D.y,C[h]=D.z}return e.attributes.tangent=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:R}),e.attributes.binormal=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:C}),e};var ct=new n,lt=new i,ft=new i,dt=new i;X.compressVertices=function(t){var r=t.attributes.normal,a=t.attributes.st;if(!c(r)&&!c(a))return t;var o,s,l,f,d=t.attributes.tangent,h=t.attributes.binormal;c(r)&&(o=r.values),c(a)&&(s=a.values),c(d)&&(l=d.values),h&&(f=h.values);var y=c(o)?o.length:s.length,p=c(o)?3:2,v=y/p,g=v,w=c(s)&&c(o)?2:1;w+=c(l)||c(f)?1:0,g*=w;for(var x=new Float32Array(g),E=0,S=0;v>S;++S){c(s)&&(n.fromArray(s,2*S,ct),x[E++]=e.compressTextureCoordinates(ct));var O=3*S;c(o)&&c(l)&&c(f)?(i.fromArray(o,O,lt),i.fromArray(l,O,ft),i.fromArray(f,O,dt),e.octPack(lt,ft,dt,ct),x[E++]=ct.x,x[E++]=ct.y):(c(o)&&(i.fromArray(o,O,lt),x[E++]=e.octEncodeFloat(lt)),c(l)&&(i.fromArray(l,O,lt),x[E++]=e.octEncodeFloat(lt)),c(f)&&(i.fromArray(f,O,lt),x[E++]=e.octEncodeFloat(lt)))}return t.attributes.compressedAttributes=new m({componentDatatype:u.FLOAT,componentsPerAttribute:w,values:x}),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 ht=new i,mt=new i,yt=new i,pt=new i,vt=new i,gt={positions:new Array(7),indices:new Array(9)},wt=new i,xt=new i,Et=new i,St=new n,Ot=new n,Tt=new n,Mt=new i,bt=S.fromPointNormal(i.ZERO,i.UNIT_Y),_t=new i,Pt=new i,Nt=new n,At=new n,It=new i,Ct=new i,Rt=new i,zt=new i,Dt=new i,Lt=new a;return new a,X.wrapLongitude=function(e){var t=e.boundingSphere;if(c(t)){var n=t.center.x-t.radius;if(n>0||r.intersect(t,a.UNIT_Y)!==v.INTERSECTING)return e}if(e.geometryType!==y.NONE)switch(e.geometryType){case y.POLYLINES:H(e);break;case y.TRIANGLES:j(e);break;case y.LINES:k(e)}else F(e),e.primitiveType===O.TRIANGLES?j(e):e.primitiveType===O.LINES&&k(e);return e},X}),define("Core/PolygonGeometryLibrary",["./Cartesian3","./defaultValue","./defined","./Ellipsoid"],function(e,t,r,n){"use strict";function i(t,r,n,i){return e.subtract(r,t,o),e.multiplyByScalar(o,n/i,o),e.add(t,o,o),[o.x,o.y,o.z]}var a={},o=new e;a.subdivideLine=function(t,r,n){var a=e.distance(t,r),o=e.angleBetween(t,r),u=o/n,s=Math.ceil(Math.log(u)/Math.log(2));1>s&&(s=0);var c=Math.pow(2,s),l=a/c,f=new Array(3*c),d=0;f[d++]=t.x,f[d++]=t.y,f[d++]=t.z;for(var h=1;c>h;h++){var m=i(t,r,h*l,a);f[d++]=m[0],f[d++]=m[1],f[d++]=m[2]}return f};var u=new e,s=new e,c=new e,l=new e;return a.scaleToGeodeticHeightExtruded=function(i,a,o,f,d){f=t(f,n.WGS84);var h=u,m=s,y=c,p=l;if(r(i)&&r(i.attributes)&&r(i.attributes.position))for(var v=i.attributes.position.values,g=v.length/2,w=0;g>w;w+=3)e.fromArray(v,w,y),f.geodeticSurfaceNormal(y,h),p=f.scaleToGeodeticSurface(y,p),m=e.multiplyByScalar(h,o,m),m=e.add(p,m,m),v[w+g]=m.x,v[w+1+g]=m.y,v[w+2+g]=m.z,d&&(p=e.clone(y,p)),m=e.multiplyByScalar(h,a,m),m=e.add(p,m,m),v[w]=m.x,v[w+1]=m.y,v[w+2]=m.z;return i},a}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";var r=new t,n=function(t,n,i,a){return e(t,n,i,a,r),r.x>0&&r.y>0&&r.z>0};return n}),define("Core/Queue",[],function(){"use strict";var e=function(){this._array=[],this._offset=0,this.length=0};return e.prototype.enqueue=function(e){this._array.push(e),this.length++},e.prototype.dequeue=function(){if(0===this.length)return void 0;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},e.prototype.contains=function(e){return-1!==this._array.indexOf(e)},e.prototype.clear=function(){this._array.length=this._offset=this.length=0},e.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},e}),define("Core/WindingOrder",["./freezeObject"],function(e){"use strict";var t={CLOCKWISE:2304,COUNTER_CLOCKWISE:2305,validate:function(e){return e===t.CLOCKWISE||e===t.COUNTER_CLOCKWISE}};return e(t)}),define("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,n,i,a,o,u,s,c,l,f,d,h,m){"use strict";function y(t,r,n){var i=e.subtract(r,t,q),a=e.subtract(n,r,B);return i.x*a.y-i.y*a.x>=0}function p(e){for(var t=e[0].x,r=0,n=0;n<e.length;n++)e[n].x>t&&(t=e[n].x,r=n);return r}function v(e){for(var t=e[0][0].x,r=0,n=0;n<e.length;n++){var i=e[n][p(e[n])].x;i>t&&(t=i,r=n)}return r}function g(e){for(var t=[],r=0;r<e.length;r++){var n=e[(r-1+e.length)%e.length],i=e[r],a=e[(r+1)%e.length];y(n,i,a)||t.push(i)}return t}function w(t,r){for(var n=0;n<t.length;n++)if(e.equals(r,t[n]))return n;return-1}function x(r,i,a){a=n(a,[]);var o=Number.MAX_VALUE,u=p(i),s=new e(i[u].x,r.y);a.push(u),a.push((u+1)%i.length);for(var c=i[0].x,l=c,f=1;f<i.length;++f)i[f].x<c?c=i[f].x:i[f].x>l&&(l=i[f].x);l+=l-c;var d=new t(l,r.y,0);for(f=0;f<i.length;f++){var h=i[f],m=i[(f+1)%i.length];if((h.x>=r.x||m.x>=r.x)&&(h.y>=r.y&&m.y<=r.y||h.y<=r.y&&m.y>=r.y)){var y=(m.y-h.y)*(d.x-r.x)-(m.x-h.x)*(d.y-r.y);if(0!==y){y=1/y;var v=((m.x-h.x)*(r.y-h.y)-(m.y-h.y)*(r.x-h.x))*y,g=((d.x-r.x)*(r.y-h.y)-(d.y-r.y)*(r.x-h.x))*y;if(v>=0&&1>=v&&g>=0&&1>=g){var w=new e(r.x+v*(d.x-r.x),r.y+v*(d.y-r.y)),x=e.subtract(w,r,F);y=e.magnitudeSquared(x),o>y&&(s=w,o=y,a[0]=f,a[1]=(f+1)%i.length)}}}}return s}function E(t,r){var n=v(r),i=r[n],a=p(i),o=i[a],u=[],s=x(o,t,u),c=w(t,s);if(-1!==c)return c;var d=e.magnitudeSquared(e.subtract(t[u[0]],o,W)),h=e.magnitudeSquared(e.subtract(t[u[1]],o,W)),m=h>d?t[u[0]]:t[u[1]],y=g(t),E=y.indexOf(m);-1!==E&&y.splice(E,1);for(var S=[],O=0;O<y.length;O++){var T=y[O];f(T,o,s,m)&&S.push(T)}var M=Number.MAX_VALUE;if(S.length>0){var b=e.fromElements(1,0,W);for(O=0;O<S.length;O++){var _=e.subtract(S[O],o,G),P=e.magnitude(b)*e.magnitudeSquared(_);if(0!==P){var N=Math.abs(l.acosClamped(e.dot(b,_)/P));M>N&&(M=N,m=S[O])}}}return t.indexOf(m)}function S(e,r,n){for(var i=ut.computeWindingOrder2D(e),a=0;a<r.length;a++){var o=r[a];t.equals(o[0],o[o.length-1])||o.push(o[0]);var s=ut.computeWindingOrder2D(o);s===i&&o.reverse()}var c=u.fromPoints(e,n),l=c.projectPointsOntoPlane(e),f=[];for(a=0;a<r.length;a++)f.push(c.projectPointsOntoPlane(r[a]));var d=E(l,f),h=v(f),m=p(f[h]),y=r[h],g=[];for(a=0;a<e.length;a++)g.push(e[a]);var w,x=[];if(0!==m)for(w=0;w<=y.length;w++){var S=(w+m)%y.length;0!==S&&x.push(y[S])}else for(w=0;w<y.length;w++)x.push(y[(w+m)%y.length]);var O=g.lastIndexOf(e[d]);x.push(e[O]);var T=g.slice(0,O+1),M=g.slice(O+1);return g=T.concat(x,M),r.splice(h,1),g}function O(e){var t="0."+Math.sin(Y).toString().substr(5);Y+=.2;var r=Math.floor(t*e);return r===e&&r--,r}function T(t,r,n){return M(t,r,n)&&M(r,t,n)&&!z(n[t].position,n[r].position,n)&&!e.equals(n[t].position,n[r].position)}function M(t,r,n){P(t,n);var i=n[t],a=n[r],o=_(t,n,V),u=_(t,n,j),s=e.subtract(n[o].position,i.position,k),c=e.subtract(n[u].position,i.position,H),l=e.subtract(a.position,i.position,X);return N(s,l)?b(s,l):N(c,l)?b(c,l):A(s,c)?R(s,c,l)?!0:!1:I(s,c)?C(s,c,l)?!1:!0:void 0}function b(t,r){return e.magnitude(r)<e.magnitude(t)}function _(e,t,r){var n=e+r;return 0>n&&(n=t.length-1),n===t.length&&(n=0),P(n,t),n}function P(t,r){var n=t-1,i=t+1;0>n&&(n=r.length-1),i===r.length&&(i=0);var o=e.subtract(r[n].position,r[t].position,Z),u=e.subtract(r[i].position,r[t].position,J);if(N(o,u)){var s=new a("Superfluous vertex found.");throw s.vertexIndex=t,s}}function N(e,r){return 0===t.cross(e,r,K).z}function A(e,r){return t.cross(e,r,Q).z<0}function I(e,r){return t.cross(e,r,$).z>0}function C(e,r,n){return t.cross(e,n,et).z>0&&t.cross(n,r,et).z>0}function R(e,r,n){return t.cross(e,n,tt).z<0&&t.cross(n,r,tt).z<0}function z(t,r,n){for(var i=0;i<n.length;i++){var a,o=n[i].position;if(a=i<n.length-1?n[i+1].position:n[0].position,!(e.equals(t,o)||e.equals(r,a)||e.equals(t,a)||e.equals(r,o))){var u=(r.y-t.y)/(r.x-t.x),s=(a.y-o.y)/(a.x-o.x);if(!(u===s||isNaN(u)&&isNaN(s))){var c;c=isNaN(u)?t.x:isNaN(s)?o.x:(t.y-o.y-u*t.x+s*o.x)/(s-u);var l=u*c+t.y-u*t.x,f=e.fromElements(c,l,rt);if(!(e.equals(f,t)||e.equals(f,r)||e.equals(f,o)||e.equals(f,a))){var d=L(c,t.x,r.x)&&L(l,t.y,r.y)&&L(c,o.x,a.x)&&L(l,o.y,a.y);if(d)return!0}}}}return!1}function D(t){var r=t[0].position,n=t[1].position,i=t[2].position,a=e.subtract(n,r,nt),o=e.subtract(i,r,it);return N(a,o)}function L(e,t,r){return(e>t||e>r)&&(t>e||r>e)||t===r&&t===e}function U(e){var t=e.length;if(3===t)return D(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new a("Invalid polygon: must have at least three vertices.");for(var r=!1,n=0;!r;){var i=10*e.length;if(n>i)return[];n++;for(var o=O(e.length),u=o+1;Math.abs(o-u)<2||Math.abs(o-u)>e.length-2;)u=O(e.length);if(o>u){var s=o;o=u,u=s}try{if(T(o,u,e)){var c=e.splice(o,u-o+1,e[o],e[u]);return U(e).concat(U(c))}}catch(l){if(l.hasOwnProperty("vertexIndex"))return e.splice(l.vertexIndex,1),U(e);throw l}}}var q=new e,B=new e,F=new e,W=new e(1,0),G=new e,Y=0,V=-1,j=1,k=new t,H=new t,X=new t,Z=new t,J=new t,K=new t,Q=new t,$=new t,et=new t,tt=new t,rt=new e,nt=new t,it=new t,at=new t,ot=new t,ut={};return ut.removeDuplicates=function(e){for(var r=e.length,n=[],i=r-1,a=0;r>a;i=a++){var o=e[i],u=e[a];t.equals(o,u)||n.push(u)}return n},ut.computeArea2D=function(e){for(var t=e.length,r=0,n=t-1,i=0;t>i;n=i++){var a=e[n],o=e[i];r+=a.x*o.y-o.x*a.y}return.5*r},ut.computeWindingOrder2D=function(e){var t=ut.computeArea2D(e);return t>0?m.COUNTER_CLOCKWISE:m.CLOCKWISE},ut.triangulate=function(e){for(var t=e.length,r=[],n=0;t>n;++n)r[n]={position:e[n],index:n};return U(r)},ut.resetSeed=function(e){Y=n(e,0)},ut.computeSubdivision=function(e,i,a){a=n(a,l.RADIANS_PER_DEGREE);for(var o=new h,u=i.length,f=0;u>f;f+=3)o.enqueue({i0:i[f],i1:i[f+1],i2:i[f+2]});for(var m,y=e.slice(0),p=[],v={};o.length>0;){var g,w,x=o.dequeue(),E=y[x.i0],S=y[x.i1],O=y[x.i2],T=t.angleBetween(E,S),M=t.angleBetween(S,O),b=t.angleBetween(O,E),_=Math.max(T,Math.max(M,b));_>a?T===_?(g=Math.min(x.i0,x.i1).toString()+" "+Math.max(x.i0,x.i1).toString(),m=v[g],m||(w=t.add(E,S,new t),t.multiplyByScalar(w,.5,w),y.push(w),m=y.length-1,v[g]=m),o.enqueue({i0:x.i0,i1:m,i2:x.i2}),o.enqueue({i0:m,i1:x.i1,i2:x.i2})):M===_?(g=Math.min(x.i1,x.i2).toString()+" "+Math.max(x.i1,x.i2).toString(),m=v[g],m||(w=t.add(S,O,new t),t.multiplyByScalar(w,.5,w),y.push(w),m=y.length-1,v[g]=m),o.enqueue({i0:x.i1,i1:m,i2:x.i0}),o.enqueue({i0:m,i1:x.i2,i2:x.i0})):b===_&&(g=Math.min(x.i2,x.i0).toString()+" "+Math.max(x.i2,x.i0).toString(),m=v[g],m||(w=t.add(O,E,new t),t.multiplyByScalar(w,.5,w),y.push(w),m=y.length-1,v[g]=m),o.enqueue({i0:x.i2,i1:m,i2:x.i1}),o.enqueue({i0:m,i1:x.i0,i2:x.i1})):(p.push(x.i0),p.push(x.i1),p.push(x.i2))}var P=y.length,N=new Array(3*P),A=0;for(m=0;P>m;m++){var I=y[m];N[A++]=I.x,N[A++]=I.y,N[A++]=I.z}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:N})},indices:p,primitiveType:d.TRIANGLES})},ut.scaleToGeodeticHeight=function(e,r,a,u){a=n(a,o.WGS84);var s=at,c=ot;if(r=n(r,0),u=n(u,!0),i(e)&&i(e.attributes)&&i(e.attributes.position))for(var l=e.attributes.position.values,f=l.length,d=0;f>d;d+=3)t.fromArray(l,d,c),u&&(c=a.scaleToGeodeticSurface(c,c)),s=a.geodeticSurfaceNormal(c,s),t.multiplyByScalar(s,r,s),t.add(c,s,c),l[d]=c.x,l[d+1]=c.y,l[d+2]=c.z;return e},ut.eliminateHoles=function(e,r,i){i=n(i,o.WGS84);for(var a=[],u=0;u<r.length;u++){for(var s=[],c=0;c<r[u].length;c++)s.push(t.clone(r[u][c]));a.push(s)}for(var l=e;a.length>0;)l=S(l,a,i);return l},ut}),define("Core/PolygonOutlineGeometry",["./BoundingSphere","./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,d,h,m,y,p,v,g){"use strict";function w(e,r,n,i){var a=y.removeDuplicates(r),f=o.fromPoints(a,e),h=f.projectPointsOntoPlane(a,E),v=y.computeWindingOrder2D(h);v===g.CLOCKWISE&&(h.reverse(),a.reverse());var w,x=[],S=a.length;if(i)for(w=0;S>w;w++){var O=a[w],T=a[(w+1)%S];x.push(O.x,O.y,O.z,T.x,T.y,T.z)}else for(w=0;S>w;w++)x=x.concat(m.subdivideLine(a[w],a[(w+1)%S],n));S=x.length/3;var M=2*S,b=d.createTypedArray(x.length/3,M),_=0;for(w=0;S-1>w;w++)b[_++]=w,b[_++]=w+1;return b[_++]=S-1,b[_++]=0,new l({geometry:new u({attributes:new c({position:new s({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:new Float64Array(x)})}),indices:b,primitiveType:p.LINES})})}function x(e,r,n,i){var a=y.removeDuplicates(r),f=o.fromPoints(a,e),h=f.projectPointsOntoPlane(a,E),v=y.computeWindingOrder2D(h);v===g.CLOCKWISE&&(h.reverse(),a.reverse());var w,x=[],S=a.length,O=new Array(S);if(O[0]=0,i){var T,M;for(w=0;S-1>w;w++)T=a[w],M=a[(w+1)%S],x.push(T.x,T.y,T.z,M.x,M.y,M.z),O[w+1]=x.length/3;T=a[S-1],M=a[0],x.push(T.x,T.y,T.z,M.x,M.y,M.z)}else{for(w=0;S-1>w;w++)x=x.concat(m.subdivideLine(a[w],a[w+1],n)),O[w+1]=x.length/3;x=x.concat(m.subdivideLine(a[S-1],a[0],n))}S=x.length/3;var b=2*(2*S+O.length),_=d.createTypedArray(x.length/3,b),P=0;for(w=0;S-1>w;w++)_[P++]=w,_[P++]=w+1,_[P++]=w+S,_[P++]=w+1+S;for(_[P++]=S-1,_[P++]=0,_[P++]=S+S-1,_[P++]=S,w=0;w<O.length;w++){var N=O[w];_[P++]=N,_[P++]=N+S}return x=x.concat(x),new l({geometry:new u({attributes:new c({position:new s({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:new Float64Array(x)})}),indices:_,primitiveType:p.LINES})})}var E=[],S=function(e){e=r(e,r.EMPTY_OBJECT);var t=r(e.ellipsoid,a.WGS84),i=r(e.granularity,h.RADIANS_PER_DEGREE),o=r(e.height,0),u=r(e.perPositionHeight,!1),s=e.extrudedHeight,c=n(s)&&(!h.equalsEpsilon(o,s,h.EPSILON6)||u);if(c){var l=s;s=Math.min(l,o),o=Math.max(l,o)}var f=e.polygonHierarchy;this._ellipsoid=t,this._granularity=i,this._height=o,this._extrudedHeight=s,this._extrude=c,this._polygonHierarchy=f,this._perPositionHeight=u,this._workerName="createPolygonOutlineGeometry"};return S.fromPositions=function(e){e=r(e,r.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(t){var r=t._ellipsoid,a=t._granularity,o=t._height,s=t._extrudedHeight,c=t._extrude,l=t._polygonHierarchy,d=t._perPositionHeight,h=[],p=new v;p.enqueue(l);for(var g;0!==p.length;){var E=p.dequeue(),S=E.positions;if(S.length<3)throw new i("At least three positions are required.");var O=E.holes?E.holes.length:0;for(g=0;O>g;g++){var T=E.holes[g];h.push(T.positions);var M=0;n(T.holes)&&(M=T.holes.length);for(var b=0;M>b;b++)p.enqueue(T.holes[b])}h.push(S)}var _,P=[];if(c)for(g=0;g<h.length;g++)_=x(r,h[g],a,d),n(_)&&(_.geometry=m.scaleToGeodeticHeightExtruded(_.geometry,o,s,r,d),P.push(_));else for(g=0;g<h.length;g++)_=w(r,h[g],a,d),n(_)&&(_.geometry=y.scaleToGeodeticHeight(_.geometry,o,r,!d),P.push(_));_=f.combine(P);var N=e.fromVertices(_.attributes.position.values);return new u({attributes:_.attributes,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:N})},S}),define("Workers/createPolygonOutlineGeometry",["../Core/Ellipsoid","../Core/PolygonOutlineGeometry"],function(e,t){"use strict";function r(r){return r._ellipsoid=e.clone(r._ellipsoid),t.createGeometry(r)}return r})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";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(r){t=r.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=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:0>e?-1:0},a.signNotZero=function(e){return 0>e?-1:1},a.toSNorm=function(e){return Math.round(255*(.5*a.clamp(e,-1,1)+.5))},a.fromSNorm=function(e){return a.clamp(e,0,255)/255*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.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 a>=i||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;e>=n;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,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(r,n){t(n)||(n=new i);var a=r.clock,o=r.cone,u=e(r.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,r,n,a){return t(a)?(a.x=e,a.y=r,a.z=n,a):new i(e,r,n)},i.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z},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},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 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},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.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 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){i.normalize(e,s),i.normalize(t,c);var r=i.dot(s,c),n=i.magnitude(i.cross(s,c,s));return Math.atan2(n,r)};var l=new i;i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);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,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.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,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)},i.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},i.fromDegrees=function(e,t,r,n,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,r,n,o)};var f=new i,h=new i,d=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(r,n,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(n);f.x=c*Math.cos(r),f.y=c*Math.sin(r),f.z=Math.sin(n),f=i.normalize(f,f),i.multiplyComponents(s,f,h);var l=Math.sqrt(i.dot(f,h));return h=i.divideByScalar(h,l,h),f=i.multiplyByScalar(f,a,f),t(u)||(u=new i),i.add(h,f,u)},i.fromDegreesArray=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o++)n[o]=a.toRadians(e[o]);return i.fromRadiansArray(n,t,r)},i.fromRadiansArray=function(e,r,n){var a=e.length;t(n)?n.length=a/2:n=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];n[o/2]=i.fromRadians(u,s,0,r,n[o/2])}return n},i.fromDegreesArrayHeights=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o+=3)n[o]=a.toRadians(e[o]),n[o+1]=a.toRadians(e[o+1]),n[o+2]=e[o+2];return i.fromRadiansArrayHeights(n,t,r)},i.fromRadiansArrayHeights=function(e,r,n){var a=e.length;t(n)?n.length=a/3:n=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];n[o/3]=i.fromRadians(u,s,c,r,n[o/3])}return n},i.ZERO=n(new i(0,0,0)),i.UNIT_X=n(new i(1,0,0)),i.UNIT_Y=n(new i(0,1,0)),i.UNIT_Z=n(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,c){var l=r.x,f=r.y,h=r.z,d=a.x,E=a.y,p=a.z,m=l*l*d*d,y=f*f*E*E,_=h*h*p*p,v=m+y+_,T=Math.sqrt(1/v),R=e.multiplyByScalar(r,T,i);if(s>v)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 I,O,M,w,x,C,P,D,L,U,b,F=(1-T)*e.magnitude(r)/(.5*e.magnitude(N)),z=0;do{F-=z,M=1/(1+F*A),w=1/(1+F*S),x=1/(1+F*g),C=M*M,P=w*w,D=x*x,L=C*M,U=P*w,b=D*x,I=m*C+y*P+_*D-1,O=m*L*A+y*U*S+_*b*g;var B=-2*O;z=I/B}while(Math.abs(I)>n.EPSILON12);return t(c)?(c.x=l*M,c.y=f*w,c.z=h*x,c):new e(l*M,f*w,h*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),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,n,a){var E=r(n)?n.oneOverRadii:f,p=r(n)?n.oneOverRadiiSquared:h,m=r(n)?n._centerToleranceSquared:d,y=o(t,E,p,m,c);if(r(y)){var _=e.multiplyComponents(t,p,s);_=e.normalize(_,_);var v=e.subtract(t,y,l),T=Math.atan2(_.y,_.x),R=Math.asin(_.z),A=i.sign(e.dot(v,t))*e.magnitude(v);return r(a)?(a.longitude=T,a.latitude=R,a.height=A,a):new u(T,R,A)}},u.clone=function(e,t){return r(e)?r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){a=r(a,0),e.pack(t._radii,n,a)},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,h=new e;l.prototype.cartographicToCartesian=function(t,r){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),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;r>a;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(r,a){var i=this.scaleToGeodeticSurface(r,E);if(n(i)){var o=this.geodeticSurfaceNormal(i,d),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;r>a;++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}),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","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(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 u(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function s(e){for(var t=0,r=0;3>r;++r){var n=e[o.getElementIndex(d[r],h[r])];t+=2*n*n}return Math.sqrt(t)}function c(e,t){for(var r=i.EPSILON15,n=0,a=1,u=0;3>u;++u){var s=Math.abs(e[o.getElementIndex(d[u],h[u])]);s>n&&(a=u,n=s)}var c=1,l=0,f=h[a],E=d[a];if(Math.abs(e[o.getElementIndex(E,f)])>r){var p,m=e[o.getElementIndex(E,E)],y=e[o.getElementIndex(f,f)],_=e[o.getElementIndex(E,f)],v=(m-y)/2/_;p=0>v?-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=o.clone(o.IDENTITY,t),t[o.getElementIndex(f,f)]=t[o.getElementIndex(E,E)]=c,t[o.getElementIndex(E,f)]=l,t[o.getElementIndex(f,E)]=-l,t}o.packedLength=9,o.pack=function(e,r,n){n=t(n,0),r[n++]=e[0],r[n++]=e[1],r[n++]=e[2],r[n++]=e[3],r[n++]=e[4],r[n++]=e[5],r[n++]=e[6],r[n++]=e[7],r[n++]=e[8]},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[4]=e[n++],a[5]=e[n++],a[6]=e[n++],a[7]=e[n++],a[8]=e[n++],a},o.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},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[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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,u=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*(a-h),m=2*(i+l),y=2*(a+h),_=-n+s-f+d,v=2*(c-u),T=2*(i-l),R=2*(c+u),A=-n-s+f+d;return r(t)?(t[0]=E,t[1]=y,t[2]=T,t[3]=p,t[4]=_,t[5]=R,t[6]=m,t[7]=v,t[8]=A,t):new o(E,p,m,y,_,v,T,R,A)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,n,-a,0,a,n)},o.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 o(n,0,a,0,1,0,-a,0,n)},o.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 o(n,-a,0,a,n,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,r,n){n=o.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},o.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},o.setRow=function(e,t,r,n){return n=o.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var l=new e;o.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),r};var f=new e;o.getMaximumScale=function(t){return o.getScale(t,f),e.maximumComponent(f)},o.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},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[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},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[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},o.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},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[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},o.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},o.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},o.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],E=new o,p=new o;return o.computeEigenDecomposition=function(e,t){var n=i.EPSILON20,a=10,l=0,f=0;r(t)||(t={});for(var h=t.unitary=o.clone(o.IDENTITY,t.unitary),d=t.diagonal=o.clone(e,t.diagonal),m=n*u(d);a>f&&s(d)>m;)c(d,E),o.transpose(E,p),o.multiply(d,E,d),o.multiply(p,d,d),o.multiply(h,E,h),++l>2&&(++f,l=0);return 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[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},o.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)},o.inverse=function(e,t){var r=e[0],a=e[1],u=e[2],s=e[3],c=e[4],l=e[5],f=e[6],h=e[7],d=e[8],E=o.determinant(e);if(Math.abs(E)<=i.EPSILON15)throw new n("matrix is not invertible");t[0]=c*d-h*l,t[1]=h*u-a*d,t[2]=a*l-c*u,t[3]=f*l-s*d,t[4]=r*d-f*u,t[5]=s*u-r*l,t[6]=s*h-f*c,t[7]=f*a-r*h,t[8]=r*c-s*a;var p=1/E;return o.multiplyByScalar(t,p,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=a(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=a(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w},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.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.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(r){t=r.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(e,t,n,a,i,o,u,s,c,l,f,h,d,E,p,m){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(m,0)}c.packedLength=16,c.pack=function(e,t,n){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]},c.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new c),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},c.clone=function(e,t){return n(e)?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 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]):void 0},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,r,a){n(a)||(a=new c);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,l=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,v=s-d-m+_,T=2*(l-y),R=2*(f+p),A=2*(l+y),S=-s+d-m+_,g=2*(E-h),N=2*(f-p),I=2*(E+h),O=-s-d+m+_;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]=I*o,a[7]=0,a[8]=R*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},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.IDENTITY,e,t)},c.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 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 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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,f=new e,h=new e;c.fromCamera=function(t,r){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,E=l.x,p=l.y,m=l.z,y=h.x,_=h.y,v=h.z,T=a.x,R=a.y,A=a.z,S=u*-T+s*-R+d*-A,g=y*-T+_*-R+v*-A,N=E*T+p*R+m*A; +return n(r)?(r[0]=u,r[1]=y,r[2]=-E,r[3]=0,r[4]=s,r[5]=_,r[6]=-p,r[7]=0,r[8]=d,r[9]=v,r[10]=-m,r[11]=0,r[12]=S,r[13]=g,r[14]=N,r[15]=1,r):new c(u,s,d,S,y,_,v,g,-E,-p,-m,N,0,0,0,1)},c.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},c.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,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},c.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),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},c.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,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},c.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,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},c.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]]},c.getElementIndex=function(e,t){return 4*e+t},c.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},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],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,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 d=new e;c.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 E=new e;c.getMaximumScale=function(t){return c.getScale(t,E),e.maximumComponent(E)},c.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],h=e[9],d=e[10],E=e[11],p=e[12],m=e[13],y=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],I=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*v+u*T+f*R+p*A,b=a*v+s*T+h*R+m*A,F=i*v+c*T+d*R+y*A,z=o*v+l*T+E*R+_*A,B=n*S+u*g+f*N+p*I,G=a*S+s*g+h*N+m*I,q=i*S+c*g+d*N+y*I,W=o*S+l*g+E*N+_*I,H=n*O+u*M+f*w+p*x,X=a*O+s*M+h*w+m*x,V=i*O+c*M+d*w+y*x,Y=o*O+l*M+E*w+_*x,k=n*C+u*P+f*D+p*L,Z=a*C+s*P+h*D+m*L,j=i*C+c*P+d*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]=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},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],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],v=t[5],T=t[6],R=t[8],A=t[9],S=t[10],g=t[12],N=t[13],I=t[14],O=n*p+o*m+c*y,M=a*p+u*m+l*y,w=i*p+s*m+f*y,x=n*_+o*v+c*T,C=a*_+u*v+l*T,P=i*_+s*v+f*T,D=n*R+o*A+c*S,L=a*R+u*A+l*S,U=i*R+s*A+f*S,b=n*g+o*N+c*I+h,F=a*g+u*N+l*I+d,z=i*g+s*N+f*I+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},c.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],h=t[0],d=t[1],E=t[2],p=t[3],m=t[4],y=t[5],_=t[6],v=t[7],T=t[8],R=n*h+o*d+c*E,A=a*h+u*d+l*E,S=i*h+s*d+f*E,g=n*p+o*m+c*y,N=a*p+u*m+l*y,I=i*p+s*m+f*y,O=n*_+o*v+c*T,M=a*_+u*v+l*T,w=i*_+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]=I,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},c.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;c.multiplyByUniformScale=function(e,t,r){return p.x=t,p.y=t,p.z=t,c.multiplyByScale(e,p,r)},c.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?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]=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)},c.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},c.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},c.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},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],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},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||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]},c.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},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 m=new u,y=new u,_=new t,v=new t(0,0,0,1);return c.inverse=function(e,r){if(u.equalsEpsilon(c.getRotation(e,m),y,o.EPSILON7)&&t.equals(c.getRow(e,3,_),v))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],l=e[12],f=e[1],h=e[5],d=e[9],E=e[13],p=e[2],T=e[6],R=e[10],A=e[14],S=e[3],g=e[7],N=e[11],I=e[15],O=R*I,M=A*N,w=T*I,x=A*g,C=T*N,P=R*g,D=p*I,L=A*S,U=p*N,b=R*S,F=p*g,z=T*S,B=O*h+x*d+C*E-(M*h+w*d+P*E),G=M*f+D*d+b*E-(O*f+L*d+U*E),q=w*f+L*h+F*E-(x*f+D*h+z*E),W=P*f+U*h+z*d-(C*f+b*h+F*d),H=M*a+w*i+P*l-(O*a+x*i+C*l),X=O*n+L*i+U*l-(M*n+D*i+b*l),V=x*n+D*a+z*l-(w*n+L*a+F*l),Y=C*n+b*a+F*i-(P*n+U*a+z*i);O=i*E,M=l*d,w=a*E,x=l*h,C=a*d,P=i*h,D=n*E,L=l*f,U=n*d,b=i*f,F=n*h,z=a*f;var k=O*g+x*N+C*I-(M*g+w*N+P*I),Z=M*S+D*N+b*I-(O*S+L*N+U*I),j=w*S+L*g+F*I-(x*S+D*g+z*I),K=P*S+U*g+z*N-(C*S+b*g+F*N),J=w*R+P*A+M*T-(C*A+O*T+x*R),Q=U*A+O*p+L*R-(D*R+b*A+M*p),$=D*T+z*A+x*p-(F*A+w*p+L*T),ee=F*R+C*p+b*T-(U*T+z*R+P*p),te=n*B+a*G+i*q+l*W;if(Math.abs(te)<o.EPSILON20)throw new s("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},c.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],h=e[13],d=e[14],E=-r*f-n*h-a*d,p=-i*f-o*h-u*d,m=-s*f-c*h-l*d;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},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,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/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/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){n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north},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 r>t&&(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,h=e.length;h>f;f++){var d=e[f];n=Math.min(n,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-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.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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;i>a&&(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;i>a&&o>0?a+=u.TWO_PI:c>o&&a>0&&(o+=u.TWO_PI),i>a&&0>c?c+=u.TWO_PI:c>o&&0>i&&(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)&&l>=f)){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.union=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.west),n.south=Math.min(e.south,t.south),n.east=Math.max(e.east,t.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 r=t.longitude,n=t.latitude,a=e.west,i=e.east;return a>i&&(i+=u.TWO_PI,0>r&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(i>r||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,h=e.south,d=e.east,E=e.west,p=c;p.height=a,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++,0>f?p.latitude=f:h>0?p.latitude=h:p.latitude=0;for(var m=1;8>m;++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=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","./Plane","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,f,h){"use strict";function d(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var E=new e,p=new e,m=new e,y=new e,_=new e,v=new e,T=new e,R=new e,A=new e,S=new e,g=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,E),o=e.clone(a,p),u=e.clone(a,m),s=e.clone(a,y),c=e.clone(a,_),l=e.clone(a,v),f=t.length,h=1;f>h;h++){e.clone(t[h],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 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=A;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=S;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,R),.5,N),q=0;for(h=0;f>h;h++){e.clone(t[h],a);var W=e.magnitude(e.subtract(a,G,R));W>q&&(q=W);var H=e.magnitudeSquared(e.subtract(a,U,R));if(H>b){var X=Math.sqrt(H);F=.5*(F+X),b=F*F;var V=X-F;U.x=(F*U.x+V*a.x)/X,U.y=(F*U.y+V*a.y)/X,U.z=(F*U.z+V*a.z)/X}}return q>F?(e.clone(U,r.center),r.radius=F):(e.clone(G,r.center),r.radius=q),r};var I=new o,O=new e,M=new e,w=new t,x=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),h.southwest(t,w),w.height=i,h.northeast(t,x),x.height=o;var s=a.project(w,O),c=a.project(x,M),l=c.x-s.x,f=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+f*f+E*E);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*f,p.z=s.z+.5*E,u};var C=[];d.fromRectangle3D=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0);var u;return n(e)&&(u=h.subsample(e,t,a,C)),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,E),c=e.clone(u,p),l=e.clone(u,m),f=e.clone(u,y),h=e.clone(u,_),I=e.clone(u,v),O=t.length,M=0;O>M;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>h.y&&e.clone(u,h),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(h,c,R)),L=e.magnitudeSquared(e.subtract(I,l,R)),U=s,b=f,F=P;D>F&&(F=D,U=c,b=h),L>F&&(F=L,U=l,b=I);var z=A;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=S;q.x=s.x,q.y=c.y,q.z=l.z;var W=g;W.x=f.x,W.y=h.y,W.z=I.z;var H=e.multiplyByScalar(e.add(q,W,R),.5,N),X=0;for(M=0;O>M;M+=i){u.x=t[M]+a.x,u.y=t[M+1]+a.y,u.z=t[M+2]+a.z;var V=e.magnitude(e.subtract(u,H,R));V>X&&(X=V);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 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 X>G?(e.clone(z,o.center),o.radius=G):(e.clone(H,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,E),u=e.clone(i,p),s=e.clone(i,m),c=e.clone(i,y),l=e.clone(i,_),f=e.clone(i,v),h=t.length,I=0;h>I;I+=3){var O=t[I]+r[I],M=t[I+1]+r[I+1],w=t[I+2]+r[I+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=A;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=S;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,R),.5,N),W=0;for(I=0;h>I;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 H=e.magnitude(e.subtract(i,q,R));H>W&&(W=H);var X=e.magnitudeSquared(e.subtract(i,b,R));if(X>F){var V=Math.sqrt(X);z=.5*(z+V),F=z*z;var Y=V-z;b.x=(z*b.x+Y*i.x)/V,b.y=(z*b.y+Y*i.y)/V,b.z=(z*b.z+Y*i.z)/V}}return W>z?(e.clone(b,a.center),a.radius=z):(e.clone(q,a.center),a.radius=W),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;a>o;o++)i.push(t[o].center);r=d.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;a>o;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return r.radius=s,r};var D=new e,L=new e,U=new e;d.fromOrientedBoundingBox=function(t,r){n(r)||(r=new d);var a=t.halfAxes,i=c.getColumn(a,0,D),o=c.getColumn(a,1,L),u=c.getColumn(a,2,U),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){return n(t)?n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new d(t.center,t.radius):void 0},d.packedLength=4,d.pack=function(e,t,n){n=r(n,0);var a=e.center;t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius},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 b=new e,F=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,b),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,F);return e.add(h,i,h),e.clone(h,a.center),a.radius=f,a};var z=new e;d.expand=function(t,r,n){n=d.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,z));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-a>o?u.OUTSIDE:a>o?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 B=new e;d.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,B);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 G=new e;d.computePlaneDistances=function(t,r,a,i){n(i)||(i=new s);var o=e.subtract(t.center,r,G),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,W=new e,H=new e,X=new e,V=new e,Y=new t,k=new Array(8),Z=0;8>Z;++Z)k[Z]=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,W);e.normalize(c,c);var l=e.cross(s,c,H);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=k,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;m>y;++y){var _=E[y];e.add(o,_,_);var v=i.cartesianToCartographic(_,Y);n.project(v,_)}a=d.fromPoints(E,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},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("Renderer/WebGLConstants",["../Core/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/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(){return a.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?n.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(n.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",e(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;n>r;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(v)){v=!1;var e=/ Chrome\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(v=!0,T=n(e[1]))}return v}function i(){return a()&&T}function o(){if(!t(R)&&(R=!1,!a()&&/ Safari\/[\.0-9]+/.test(_.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(R=!0,A=n(e[1]))}return R}function u(){return o()&&A}function s(){if(!t(S)){S=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(_.userAgent);null!==e&&(S=!0,g=n(e[1]),g.isNightly=!!e[2])}return S}function c(){return s()&&g}function l(){if(!t(N)){N=!1;var e;"Microsoft Internet Explorer"===_.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(_.userAgent),null!==e&&(N=!0,I=n(e[1]))):"Netscape"===_.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(_.userAgent),null!==e&&(N=!0,I=n(e[1])))}return N}function f(){return l()&&I}function h(){if(!t(O)){O=!1;var e=/Firefox\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(O=!0,M=n(e[1]))}return O}function d(){return t(w)||(w=/Windows/i.test(_.appVersion)),w}function E(){return h()&&M}function p(){return t(x)||(x="undefined"!=typeof PointerEvent&&(!t(_.pointerEnabled)||_.pointerEnabled)),x}function m(){if(!t(P)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;P=t(r)&&""!==r,P&&(C=r)}return P}function y(){return m()?C:void 0}var _;_="undefined"!=typeof navigator?navigator:{};var v,T,R,A,S,g,N,I,O,M,w,x,C,P,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:E,isWindows:d,hardwareConcurrency:e(_.hardwareConcurrency,3),supportsPointerEvents:p,supportsImageRenderingPixelated:m,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/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,r,n,a,i){"use strict";if(!a.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return r(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new n("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,r,a,i){switch(a=t(a,0),i=t(i,(r.byteLength-a)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(r,a,i);case o.UNSIGNED_BYTE:return new Uint8Array(r,a,i);case o.SHORT:return new Int16Array(r,a,i);case o.UNSIGNED_SHORT:return new Uint16Array(r,a,i);case o.FLOAT:return new Float32Array(r,a,i);case o.DOUBLE:return new Float64Array(r,a,i);default:throw new n("componentDatatype is not a valid value.")}},i(o)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,r,n,a){"use strict";function i(n,a,i){this.minimum=e.clone(t(n,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),r(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,n){if(r(n)||(n=new i),!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 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;f>h;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=n.minimum;y.x=a,y.y=o,y.z=u;var _=n.maximum;_.x=s,_.y=c,_.z=l;var v=e.add(y,_,n.center);return e.multiplyByScalar(v,.5,v),n},i.clone=function(t,n){return r(t)?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 i(t.minimum,t.maximum):void 0},i.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 i.intersectPlane=function(t,r){o=e.subtract(t.maximum,t.minimum,o);var n=e.multiplyByScalar(o,.5,o),i=r.normal,u=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),s=e.dot(t.center,i)+r.distance;return s-u>0?a.INSIDE:0>s+u?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",["./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){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n]=t.y},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.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.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/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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,0>i?[i,0]:[0,i];var c=n*n,l=4*e*a,f=r(c,-l,t.EPSILON14);if(0>f)return[];var h=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[h/e,a/h]:[a/h,h/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,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(0>y){var _,v,T;h*f>=l*d?(_=o,v=E,T=-2*u*E+o*p):(_=c,v=m,T=-c*p+2*s*m);var R=0>T?-1:1,A=-R*Math.abs(_)*Math.sqrt(-y);i=-T+A;var S=i/2,g=0>S?-Math.pow(-S,1/3):Math.pow(S,1/3),N=i===A?-g:-v/g;return a=0>=v?g+N:-T/(g*g+N*N+v),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var I=E,O=-2*u*E+o*p,M=m,w=-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(-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,-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=2*s>i+L?i+s:L+s,G=z/B,q=b*B,W=-U*B-b*z,H=U*z,X=(s*W-u*H)/(-u*W+s*q);return X>=F?G>=F?G>=X?[F,X,G]:[F,G,X]:[G,F,X]:G>=F?[X,F,G]:G>=X?[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=0>u?-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,0>u?[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 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,m=E[0],y=E[1];if(m>=0&&y>=0){var _=Math.sqrt(m),v=Math.sqrt(y);return[h-v,h-_,h+_,h+v]}if(m>=0&&0>y)return p=Math.sqrt(m),[h-p,h+p];if(0>m&&y>=0)return p=Math.sqrt(y),[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 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,v=t/2,T=y/2,R=_-4*o,A=_+4*Math.abs(o),S=c-4*m,g=c+4*Math.abs(m);if(0>m||S*A>R*g){var N=Math.sqrt(S);E=N/2,p=0===N?0:(t*T-i)/N}else{var I=Math.sqrt(R);E=0===I?0:(t*T-i)/I,p=I/2}var O,M;0===v&&0===E?(O=0,M=0):r.sign(v)===r.sign(E)?(O=v+E,M=m/O):(M=v-E,O=m/M);var w,x;0===T&&0===p?(w=0,x=0):r.sign(T)===r.sign(p)?(w=T+p,x=o/w):(x=T-p,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,h=f*n,d=a*a,E=d*a,p=u*c*f-4*s*h-4*e*l*f+18*e*t*r*h-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)+d*(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,h=s/t,d=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>f?d+1:d,d+=0>h?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,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(t,n,a,o,u){u=r(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,p=e.subtract(a,n,m),R=e.subtract(o,n,y),A=e.cross(E,R,_),S=e.dot(p,A);if(u){if(S<i.EPSILON6)return;if(s=e.subtract(d,n,v),l=e.dot(s,A),0>l||l>S)return;if(c=e.cross(s,p,T),f=e.dot(E,c),0>f||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,n,v),l=e.dot(s,A)*g,0>l||l>1)return;if(c=e.cross(s,p,T),f=e.dot(E,c)*g,0>f||l+f>1)return;h=e.dot(R,c)*g}return h}function f(e,t,r,n){var a=t*t-4*e*r;if(!(0>a)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(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 h(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,_),l=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,E=f(l,h,d,A);return n(E)?(a.start=E.root0,a.stop=E.root1,a):void 0}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 E(t,r,n,a,c){var l,f=a*a,h=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,p=c*(a*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+r.y),m=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),v=[];if(0===_&&0===y){if(l=u.computeRealRoots(E,p,m),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=y*y,I=E*E,O=_*y,M=I+N,w=2*(p*E+O),x=2*m*E+p*p-N+g,C=2*(m*p-O),P=m*m-g;if(0===M&&0===w&&0===x&&0===C)return v;l=s.computeRealRoots(M,w,x,C,P);var D=l.length;if(0===D)return v;for(var L=0;D>L;++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(m)?d(E*F+m,p*b,i.EPSILON12):i.sign(m)===i.sign(p*b)?d(E*F,p*b+m,i.EPSILON12):d(E*F+p*b,m,i.EPSILON12);var G=d(y*b,_,i.EPSILON15),q=U*G;0>q?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)),++L):v.push(new e(a,c*b,c*B))}return v}var p={};p.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(!(0>l))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var m=new e,y=new e,_=new e,v=new e,T=new e;p.rayTriangle=function(t,r,a,i,o,u){var s=l(t,r,a,i,o);if(n(s)&&!(0>s))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;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 f=l(c,a,i,o,u);return!n(f)||0>f||f>e.distance(t,r)?void 0:(n(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var A={root0:0,root1:0};p.raySphere=function(e,t,r){return r=h(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var S=new c;p.lineSegmentSphere=function(t,r,a,i){var o=S,u=e.subtract(r,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=h(o,a,i),!n(i)||i.stop<0||i.start>s?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i)};var g=new e,N=new e;p.rayEllipsoid=function(t,r){var n,a,i,o,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,g),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(n=f-1,a=e.magnitudeSquared(l),i=a*n,i>d)return;if(d>i){o=h*h-i,u=-h+Math.sqrt(o);var E=u/a,p=n/u;return p>E?{start:E,stop:p}:{start:p,stop:E}}var m=Math.sqrt(n/a);return{start:m,stop:m}}return 1>f?(n=f-1,a=e.magnitudeSquared(l),i=a*n,o=h*h-i,u=-h+Math.sqrt(o),{start:0,stop:u/a}):0>h?(a=e.magnitudeSquared(l),{start:0,stop:-h/a}):void 0};var I=new e,O=new e,M=new e,w=new e,x=new e,C=new o,P=new o,D=new o,L=new o,U=new o,b=new o,F=new o,z=new e,B=new e,G=new t;p.grazingAltitudeLocation=function(t,r){var a=t.origin,u=t.direction,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),h=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(h,f,O),O),p=e.normalize(e.cross(f,d,M),M),m=C;m[0]=f.x,m[1]=f.y,m[2]=f.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 y=o.transpose(m,P),_=o.fromScale(r.radii,D),v=o.fromScale(r.oneOverRadii,L),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(y,v,b),T,b),g=o.multiply(o.multiply(S,_,F),m,F),N=o.multiplyByVector(S,a,x),q=E(g,e.negate(N,I),0,0,1),W=q.length;if(W>0){for(var H=e.clone(e.ZERO,B),X=Number.NEGATIVE_INFINITY,V=0;W>V;++V){R=o.multiplyByVector(_,o.multiplyByVector(m,q[V],z),z);var Y=e.normalize(e.subtract(R,a,w),w),k=e.dot(Y,u);k>X&&(X=k,H=e.clone(R,H))}var Z=r.cartesianToCartographic(H,G);return X=i.clamp(X,0,1),A=e.magnitude(e.subtract(H,a,w))*Math.sqrt(1-X*X),A=c?-A:A,Z.height=A,r.cartographicToCartesian(Z,new e)}};var q=new e;return p.lineSegmentPlane=function(t,r,a,o){n(o)||(o=new e);var u=e.subtract(r,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(!(0>f||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},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,h;if((1===l||2===l)&&(f=new e,h=new e),1===l){if(u)return p.lineSegmentPlane(t,r,a,f),p.lineSegmentPlane(t,n,a,h),{positions:[t,r,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(r,n,a,f),p.lineSegmentPlane(r,t,a,h),{positions:[t,r,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(n,t,a,f),p.lineSegmentPlane(n,r,a,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,a,f),p.lineSegmentPlane(n,t,a,h),{positions:[t,r,n,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(n,r,a,f),p.lineSegmentPlane(t,r,a,h),{positions:[t,r,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,n,a,f),p.lineSegmentPlane(r,n,a,h),{positions:[t,r,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},p}),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(n){return i(n)}});return r}function i(e){var r=new n(function(r,n){try{return n?t(n(e)):i(e)}catch(a){return i(a)}});return r}function o(){function e(e,t,r){return h(e,t,r)}function r(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 n(e),s={then:e,resolve:r,reject:a,progress:u,promise:c,resolver:{resolve:r,reject:a,progress:u}},l=[],f=[],h=function(e,t,r){var n,a;return n=o(),a="function"==typeof r?function(e){try{n.progress(r(e))}catch(t){n.progress(t)}}:function(e){n.progress(e)},l.push(function(r){r.then(e,t).then(n.resolve,n.reject,a)}),f.push(a),n.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=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,h,d,E,p,m,_,v;if(_=t.length>>>0,c=Math.max(0,Math.min(r,_)),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))},v=0;_>v;++v)v in t&&e(t[v],s,u,m);else d.resolve(f);return d.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),h(e,_).then(t,r,n)}function f(){return h(arguments,_)}function h(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;a>s;s++)s in t?u(t[s],s):--i;else c.resolve(n);return c.promise})}function d(t,r){var n=T.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)})})},v.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 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,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(;a>i;++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;o>=i;)if(n=~~((i+o)/2),a=r(e[n],t),0>a)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,h){var d,E,p,m,y;if("%%"==e)return"%";for(var _=!1,v="",T=!1,R=!1,A=" ",S=s.length,g=0;s&&S>g;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,0>c&&(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,y=n?t[n.slice(0,-1)]:t[r++],h){case"s":return u(String(y),_,c,f,T,A);case"c":return u(String.fromCharCode(+y),_,c,f,T);case"b":return o(y,2,R,_,c,f,T);case"o":return o(y,8,R,_,c,f,T);case"x":return o(y,16,R,_,c,f,T);case"X":return o(y,16,R,_,c,f,T).toUpperCase();case"u":return o(y,10,R,_,c,f,T);case"i":case"d":return d=+y||0,d=Math.round(d-d%1),E=0>d?"-":v,y=E+a(String(Math.abs(d)),f,"0",!1),i(y,E,_,c,T);case"e":case"E":case"f":case"F":case"g":case"G":return d=+y,E=0>d?"-":v,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,T)[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){v.julianDate=e;var r=p.leapSeconds,n=t(r,v,l);0>n&&(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 h(e,r){v.julianDate=e;var n=p.leapSeconds,a=t(n,v,l);if(0>a&&(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):1>=i?void 0:p.addSeconds(e,-n[--a].offset,r)}function d(e,t,r){var n=t/s.SECONDS_PER_DAY|0;return e+=n,t-=s.SECONDS_PER_DAY*n,0>t&&(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,0>n&&(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,d(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,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})?$/,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,w="Invalid ISO 8601 date.";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,u,s=e.split("T"),l=1,h=1,m=0,v=0,N=0,x=0,C=s[0],P=s[1];if(!n(C))throw new a(w);var D;if(s=C.match(g),null!==s){if(D=C.split("-").length-1,D>0&&2!==D)throw new a(w);r=+s[1],l=+s[2],h=+s[3]}else if(s=C.match(R),null!==s)r=+s[1],l=+s[2];else if(s=C.match(T),null!==s)r=+s[1];else{var L;if(s=C.match(A),null!==s){if(r=+s[1],L=+s[2],u=o(r),1>L||u&&L>366||!u&&L>365)throw new a(w)}else{if(s=C.match(S),null===s)throw new a(w);r=+s[1];var U=+s[2],b=+s[3]||0;if(D=C.split("-").length-1,D>0&&(!n(s[3])&&1!==D||n(s[3])&&2!==D))throw new a(w);var F=new Date(Date.UTC(r,0,4));L=7*U+b-F.getUTCDay()-3}i=new Date(Date.UTC(r,0,1)),i.setUTCDate(L),l=i.getUTCMonth()+1,h=i.getUTCDate()}if(u=o(r),1>l||l>12||1>h||(2!==l||!u)&&h>y[l-1]||u&&2===l&&h>_)throw new a(w);var z;if(n(P)){if(s=P.match(M),null!==s){if(D=P.split(":").length-1,D>0&&2!==D&&3!==D)throw new a(w);m=+s[1],v=+s[2],N=+s[3],x=1e3*+(s[4]||0),z=5}else if(s=P.match(O),null!==s){if(D=P.split(":").length-1,D>2)throw new a(w);m=+s[1],v=+s[2],N=60*+(s[3]||0),z=4}else{if(s=P.match(I),null===s)throw new a(w);m=+s[1],v=60*+(s[2]||0),z=3}if(v>=60||N>=61||m>24||24===m&&(v>0||N>0||x>0))throw new a(w);var B=s[z],G=+s[z+1],q=+(s[z+2]||0);switch(B){case"+":m-=G,v-=q;break;case"-":m+=G,v+=q;break;case"Z":break;default:v+=new Date(Date.UTC(r,l-1,h,m,v)).getTimezoneOffset()}}else v+=new Date(r,l-1,h).getTimezoneOffset();var W=60===N;for(W&&N--;v>=60;)v-=60,m++;for(;m>=24;)m-=24,h++;for(i=u&&2===l?_:y[l-1];h>i;)h-=i,l++,l>12&&(l-=12,r++),i=u&&2===l?_:y[l-1];for(;0>v;)v+=60,m--;for(;0>m;)m+=24,h--;for(;1>h;)l--,1>l&&(l+=12,r--),i=u&&2===l?_:y[l-1],h+=i;var H=E(r,l,h,m,v,N,x);return n(t)?(d(H[0],H[1],t),f(t)):t=new p(H[0],H[1],c.UTC),W&&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 r=!1,a=h(e,x);n(a)||(p.addSeconds(e,-1,x),a=h(x,x),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 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,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=y,t.month=m,t.day=E,t.hour=_,t.minute=T,t.second=R,t.millisecond=A,t.isLeapSecond=r,t):new i(y,m,E,_,T,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){return n(e)?n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new p(e.dayNumber,e.secondsOfDay,c.TAI):void 0},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 0>n&&(n=~n,--n,0>n&&(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)],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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,r,n,a,i){"use strict";function o(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,a=t(r.method,"GET"),i=r.data,u=r.headers,s=r.overrideMimeType,c=r.withCredentials;return e(r.url,function(t){var r=e.defer();return o.load(t,n,a,i,u,r,s,c),r.promise})}function u(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function s(e,t){for(var r=u(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 c(e,r){r=t(r,"");var a=e[1],i=!!e[2],o=e[3];switch(r){case"":case"text":return u(i,o);case"arraybuffer":return s(i,o);case"blob":var c=s(i,o);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(u(i,o),a);case"json":return JSON.parse(u(i,o));default:throw new n("Unhandled responseType: "+r)}}var l=/^data:(.*?)(;base64)?,(.*)$/;return o.load=function(e,t,n,o,u,s,f,h){var d=l.exec(e);if(null!==d)return void s.resolve(c(d,t));var E=new XMLHttpRequest;if(r(f)&&r(E.overrideMimeType)&&E.overrideMimeType(f),E.open(n,e,!0),r(u))for(var p in u)u.hasOwnProperty(p)&&E.setRequestHeader(p,u[p]);r(t)&&(E.responseType=t),r(h)&&(E.withCredentials=h),E.onload=function(){E.status>=200&&E.status<300?r(E.response)?s.resolve(E.response):r(E.responseXML)&&E.responseXML.hasChildNodes()?s.resolve(E.responseXML):r(E.responseText)?s.resolve(E.responseText):s.reject(new i("unknown XMLHttpRequest response type.")):s.reject(new a(E.status,E.response,E.getAllResponseHeaders()))},E.onerror=function(e){s.reject(new a)},E.send(o)},o.defaultLoad=o.load,o}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";function r(r,n){return e({url:r,headers:t(n)?n.headers:void 0,overrideMimeType:t(n)?n.overrideMimeType:void 0,withCredentials:t(n)?n.withCredentials:void 0})}return r}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";function a(r,a){return t(a)||(a={}),t(a.headers)?t(a.headers.Accept)||(a.headers=e(a.headers),a.headers.Accept=i.Accept):a.headers=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 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 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,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"),h=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),p=r.columnNames.indexOf("taiMinusUtcSeconds");if(0>a||0>i||0>s||0>c||0>h||0>E||0>p)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=h,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=p,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var _,v=e._addNewLeapSeconds,T=0,R=m.length;R>T;T+=e._columnCount){var A=m[T+a],S=m[T+p],g=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(g,S,f.TAI);if(y.push(N),v){if(S!==_&&n(_)){var I=o.leapSeconds,O=t(I,N,d);if(0>O){var M=new u(N,S);I.splice(~O,0,M)}}_=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),h=a*s,d=i*s,E=r[h+e._ut1MinusUtcSecondsColumn],y=r[d+e._ut1MinusUtcSecondsColumn],_=y-E;if(_>.5||-.5>_){var v=r[h+e._taiMinusUtcSecondsColumn],T=r[d+e._taiMinusUtcSecondsColumn];v!==T&&(l.equals(n)?E=y:y-=T-v)}return u.xPoleWander=m(f,r[h+e._xPoleWanderRadiansColumn],r[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=m(f,r[h+e._yPoleWanderRadiansColumn],r[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=m(f,r[h+e._xCelestialPoleOffsetRadiansColumn],r[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=m(f,r[h+e._yCelestialPoleOffsetRadiansColumn],r[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=m(f,E,y),u}return h.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}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.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],h=i[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,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,0>s&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,r),r}if(n(this._dataError))throw new c(this._dataError)},h}),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/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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","require"],function(e,t,r,n,a){"use strict";function i(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;r>t;++t){var n=e[t].getAttribute("src"),a=d.exec(n);if(null!==a)return a[1]}}function o(){if(t(l))return l;var a;if(a="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:i(),!t(a))throw new r("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new e(n(a))}function u(e){return a.toUrl("../"+e)}function s(t){return new e(t).resolve(o()).toString()}function c(e){t(f)||(f=t(a.toUrl)?u:s),t(h)||(h=document.createElement("a"));var r=f(e);return h.href=r,h.href=h.href,h.href}var l,f,h,d=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=d,c.setBaseUrl=function(t){l=new e(t).resolve(new e(document.location.href))},c}),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;t>=s;++s){n[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;t>=c;++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;s>u;++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;0>u&&(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;h>=E;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,r){var i=c(this,e,t);if(!(0>i)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);0>s&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,0>s&&(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 a(0,0,0);var E,p,m=i-s*this._stepSizeDays,y=this._work,_=this._denominators,v=this._coef,T=this._xTable;for(E=0;u>=E;++E)y[E]=m-T[E];for(E=0;u>=E;++E){for(v[E]=1,p=0;u>=p;++p)p!==E&&(v[E]*=y[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,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,h=Math.cos(i);return r(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 n,a,i,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,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 m=l,y=0;d>h&&(y=1),E>h&&E>d&&(y=2);var _=m[y],v=m[_];n=Math.sqrt(e[u.getElementIndex(y,y)]-e[u.getElementIndex(_,_)]-e[u.getElementIndex(v,v)]+1);var T=f;T[y]=.5*n,n=.5/n,c=(e[u.getElementIndex(v,_)]-e[u.getElementIndex(_,v)])*n,T[_]=(e[u.getElementIndex(_,y)]+e[u.getElementIndex(y,_)])*n,T[v]=(e[u.getElementIndex(v,y)]+e[u.getElementIndex(y,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=c,t):new s(a,i,o,c)};var h=new s;s.fromHeadingPitchRoll=function(t,r,n,a){var i=s.fromAxisAngle(e.UNIT_X,n,h),o=s.fromAxisAngle(e.UNIT_Y,-r,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,r,n){n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w},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;i>a;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);n[o]=d.x*u,n[o+1]=d.y*u,n[o+2]=d.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,m),0===u?s.clone(s.IDENTITY,p):s.fromAxisAngle(E,u,p),s.multiply(p,m,o)},s.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w):void 0},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,h=o*s-n*c+a*l+i*u,d=o*c+n*s-a*u+i*l,E=o*l-n*u-a*s-i*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 a=s.dot(e,t),i=t;if(0>a&&(a=-a,i=v=s.negate(t,v)),1-a<o.EPSILON6)return s.lerp(e,i,r,n);var u=Math.acos(a);return T=s.multiplyByScalar(e,Math.sin((1-r)*u),T),R=s.multiplyByScalar(i,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),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,g=new s,N=new s;s.computeInnerQuadrangle=function(t,r,n,a){var i=s.conjugate(r,g);s.multiply(i,n,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(r,g,a)},s.squad=function(e,t,r,n,a,i){var o=s.slerp(e,t,a,g),u=s.slerp(r,n,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):[],w=a.supportsTypedArrays()?new Float32Array(8):[],x=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],P=0;7>P;++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 h=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])))))))),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,n),s.add(E,n,n)},s.fastSquad=function(e,t,r,n,a,i){var o=s.fastSlerp(e,t,a,g),u=s.fastSlerp(r,n,a,N);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/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,r,n,a,i,o,u,s,c,l,f,h,d,E,p,m,y){"use strict";var _={},v=new r,T=new r,R=new r;_.eastNorthUpToFixedFrame=function(e,t,n){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(n)?(n[0]=0,n[1]=1,n[2]=0,n[3]=0,n[4]=-o,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=o,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new p(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=v,s=T,l=R;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),i(n)?(n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=l.x,n[5]=l.y,n[6]=l.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 p(s.x,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var A=new r,S=new r,g=new r;_.northEastDownToFixedFrame=function(e,t,n){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(n)?(n[0]=-o,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]=-o,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new p(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=A,s=S,l=g;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),i(n)?(n[0]=l.x,n[1]=l.y,n[2]=l.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 p(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},_.northUpEastToFixedFrame=function(e,t,n){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(n)?(n[0]=-o,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=o,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 p(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=v,s=T,l=R;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),i(n)?(n[0]=l.x,n[1]=l.y,n[2]=l.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 p(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 N=new m,I=new r(1,1,1),O=new p;_.headingPitchRollToFixedFrame=function(e,t,n,a,i,o){var u=m.fromHeadingPitchRoll(t,n,a,N),s=p.fromTranslationQuaternionRotationScale(r.ZERO,u,I,O);return o=_.eastNorthUpToFixedFrame(e,i,o),p.multiply(o,s,o)};var M=new p,w=new E;_.headingPitchRollQuaternion=function(e,t,r,n,a,i){var o=_.headingPitchRollToFixedFrame(e,t,r,n,a,M),u=p.getRotation(o,w);return m.fromRotationMatrix(u,i)};var x=24110.54841,C=8640184.812866,P=.093104,D=-62e-7,L=1.1772758384668e-19,U=72921158553e-15,b=d.TWO_PI/86400,F=new h;_.computeTemeToPseudoFixedMatrix=function(e,t){F=h.addSeconds(e,-h.computeTaiMinusUtc(e),F);var r,n=F.dayNumber,a=F.secondsOfDay,o=n-2451545;r=a>=43200?(o+.5)/y.DAYS_PER_JULIAN_CENTURY:(o-.5)/y.DAYS_PER_JULIAN_CENTURY;var u=x+r*(C+r*(P+r*D)),s=u*b%d.TWO_PI,c=U+L*(n-2451545.5),l=(a+.5*y.SECONDS_PER_DAY)%y.SECONDS_PER_DAY,f=s+c*l,p=Math.cos(f),m=Math.sin(f);return i(t)?(t[0]=p,t[1]=-m,t[2]=0,t[3]=m,t[4]=p,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(p,m,0,-m,p,0,0,0,1)},_.iau2006XysData=new l,_.earthOrientationParameters=u.NONE;var z=32.184,B=2451545;_.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+z,a=t.stop.dayNumber,i=t.stop.secondsOfDay+z,o=_.iau2006XysData.preload(r,n,a,i),u=_.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},_.computeIcrfToFixedMatrix=function(e,t){i(t)||(t=new E);var r=_.computeFixedToIcrfMatrix(e,t);if(i(r))return E.transpose(r,t)};var G=new f(0,0,0),q=new s(0,0,0,0,0,0),W=new E,H=new E;_.computeFixedToIcrfMatrix=function(e,t){i(t)||(t=new E);var r=_.earthOrientationParameters.compute(e,q);if(i(r)){var n=e.dayNumber,a=e.secondsOfDay+z,o=_.iau2006XysData.computeXysRadians(n,a,G);if(i(o)){var u=o.x+r.xPoleOffset,s=o.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=W;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=E.fromRotationZ(-o.s,H),p=E.multiply(l,f,W),m=e.dayNumber,v=e.secondsOfDay-h.computeTaiMinusUtc(e)+r.ut1MinusUtc,T=m-2451545,R=v/y.SECONDS_PER_DAY,A=.779057273264+R+.00273781191135448*(T+R);A=A%1*d.TWO_PI;var S=E.fromRotationZ(A,H),g=E.multiply(p,S,W),N=Math.cos(r.xPoleWander),I=Math.cos(r.yPoleWander),O=Math.sin(r.xPoleWander),M=Math.sin(r.yPoleWander),w=n-B+a/y.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*d.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),D=H;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,E.multiply(g,D,t)}}};var X=new n;_.pointToWindowCoordinates=function(e,t,r,n){return n=_.pointToGLWindowCoordinates(e,t,r,n),n.y=2*t[5]-n.y,n},_.pointToGLWindowCoordinates=function(e,r,a,o){i(o)||(o=new t);var u=X;return p.multiplyByVector(e,n.fromElements(a.x,a.y,a.z,1,u),u),n.multiplyByScalar(u,1/u.w,u),p.multiplyByVector(r,u,u),t.fromCartesian4(u,o)};var V=new r,Y=new r,k=new r;return _.rotationMatrixFromPositionVelocity=function(e,t,n,o){var u=a(n,c.WGS84).geodeticSurfaceNormal(e,V),s=r.cross(t,u,Y);r.equalsEpsilon(s,r.ZERO,d.EPSILON6)&&(s=r.clone(r.UNIT_X,s));var l=r.cross(s,t,k);return r.cross(t,l,s),r.negate(s,s),i(o)||(o=new E),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=s.x,o[4]=s.y,o[5]=s.z,o[6]=l.x,o[7]=l.y,o[8]=l.z,o},_}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix3","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,r,n,a,i,o,u,s,c,l,f,h,d,E){"use strict";function p(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var n=E.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=r.fromCartesian4(f.getColumn(n,0,m)),this._yAxis=r.fromCartesian4(f.getColumn(n,1,m));var i=r.fromCartesian4(f.getColumn(n,2,m));this._plane=h.fromPointNormal(e,i)}var m=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 y=new e;p.fromPoints=function(t,r){var n=e.fromPoints(t,y);return new p(n.center,r)};var _=new d,v=new r;p.prototype.projectPointOntoPlane=function(e,n){var a=_;a.origin=e,r.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,v);if(i(o)||(r.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,v)),i(o)){var u=r.subtract(o,this._origin,o),s=r.dot(this._xAxis,u),l=r.dot(this._yAxis,u);return i(n)?(n.x=s,n.y=l,n):new t(s,l)}},p.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var r=0,n=e.length,a=0;n>a;a++){var o=this.projectPointOntoPlane(e[a],t[r]);i(o)&&(t[r]=o,r++)}return t.length=r,t},p.prototype.projectPointToNearestOnPlane=function(e,n){i(n)||(n=new t);var a=_;a.origin=e,r.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,v);i(o)||(r.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,v));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){i(t)||(t=[]);var r=e.length;t.length=r;for(var n=0;r>n;n++)t[n]=this.projectPointToNearestOnPlane(e[n],t[n]);return t};var T=new r;return p.prototype.projectPointsOntoEllipsoid=function(e,t){var n=e.length;i(t)?t.length=n:t=new Array(n);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;n>l;++l){var f=e[l];r.multiplyByScalar(u,f.x,c),i(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),a.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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(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=void 0}return i.computeNumberOfVertices=function(e){var n=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(n!==o&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=o}return n},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.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=t.x,n=t.y;t.x=(1-Math.abs(n))*a.signNotZero(r),t.y=(1-Math.abs(r))*a.signNotZero(n)}return t.x=a.toSNorm(t.x),t.y=a.toSNorm(t.y),t},i.octDecode=function(e,r,n){if(n.x=a.fromSNorm(e),n.y=a.fromSNorm(r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var i=n.x;n.x=(1-Math.abs(n.y))*a.signNotZero(i),n.y=(1-Math.abs(i))*a.signNotZero(n.y)}return t.normalize(n,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 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=1===e.x?4095:4096*e.x|0,r=1===e.y?4095:4096*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096;return t.x=Math.floor(r)/4096,t.y=r-Math.floor(r),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,h,d,E,p,m,y,_;r(a.z)?(f=t.subtract(s,a,i),h=t.subtract(c,a,o),d=t.subtract(n,a,u),E=t.dot(f,f),p=t.dot(f,h),m=t.dot(f,d),y=t.dot(h,h),_=t.dot(h,d)):(f=e.subtract(s,a,i),h=e.subtract(c,a,o),d=e.subtract(n,a,u),E=e.dot(f,f),p=e.dot(f,h),m=e.dot(f,d),y=e.dot(h,h),_=e.dot(h,d));var v=1/(E*y-p*p);return l.y=(y*m-p*_)*v,l.z=(E*_-p*m)*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,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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,n){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,n):new Uint16Array(t,r,n)},n(i)}),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];o>u;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;a+1>l;l++)c[l]=0;for(var f=i+1,h=0;o>h;++h)f-c[n[h]]>i&&(c[n[h]]=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(;n>i;){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 h=r[f];a[h].numLiveTriangles&&(s=0,i-a[h].timeStamp+2*a[h].numLiveTriangles<=t&&(s=i-a[h].timeStamp),(s>l||-1===l)&&(l=s,c=h)),++f}return-1===c?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,h=o[f],d=c;if(t(u))l=u+1;else{for(;d>f;)h>l&&(l=h),++f,h=o[f];if(-1===l)return 0;++l}for(var E=[],p=0;l>p;p++)E[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var m=0;d>f;)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 v,T,R=[],A=[],S=0,g=[],N=c/3,I=[];for(p=0;N>p;p++)I[p]=!1;for(var O,M;-1!==y;){R=[],T=E[y],M=T.vertexTriangles.length;for(var w=0;M>w;++w)if(m=T.vertexTriangles[w],!I[m]){I[m]=!0,f=m+m+m;for(var x=0;3>x;++x)O=o[f],R.push(O),A.push(O),g[S]=O,++S,v=E[O],--v.numLiveTriangles,_-v.timeStamp>s&&(v.timeStamp=_,++_),++f}y=a(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","./GeometryInstance","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,f,h,d,E,p,m,y,_,v,T,R,A,S,g,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 O(e){for(var t=e.length,r=t/3*6,n=y.createTypedArray(t,r),a=0,i=0;t>i;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;t>i;++i,a+=6)I(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function w(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;t>o;++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 E({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;n>i;i+=3)a.unpack(r,i,ie),A.multiplyByPoint(e,ie,ie),a.pack(ie,r,i)}function D(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;n>i;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,f=1;n>f;++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&&(a[r]=new E({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,h=e.length,E=(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;h>i;++i)for(l=e[i][t].attributes[n].values,f=l.length,o=0;f>o;++o)s[u++]=l[o];var _;if(E){var v=0;for(i=0;h>i;++i)v+=e[i][t].indices.length;var T=d.computeNumberOfVertices(new d({attributes:m,primitiveType:g.POINTS})),R=y.createTypedArray(T,v),A=0,S=0;for(i=0;h>i;++i){var N=e[i][t].indices,I=N.length;for(u=0;I>u;++u)R[A++]=S+N[u];S+=d.computeNumberOfVertices(e[i][t])}_=R}var O,M=new a,w=0;for(i=0;h>i;++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,h,M),i=0;h>i;++i){O=e[i][t].boundingSphere;var x=a.magnitude(a.subtract(O.center,M,se))+O.radius;x>w&&(w=x)}return new d({attributes:m,indices:_,primitiveType:p,boundingSphere:c(M)?new r(M,w):void 0})}function b(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function F(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,a=3;t>a;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=g.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,a=3;t-1>a;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,t>a+2&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=g.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function G(e){var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;t>a;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=g.LINES,e}function q(e){var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;t>a;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=g.LINES,e}function W(e){switch(e.primitiveType){case g.TRIANGLE_FAN:return F(e);case g.TRIANGLE_STRIP:return z(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 H(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 H(e,e.y<0),H(t,t.y<0),void H(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=0>n;H(e,u),H(t,u),H(r,u)}function V(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,Te),e.y/(e.y-t.y),Te),r),a.clone(r,n),H(r,!0),H(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=Ne.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(V(e,t,Re,Se),V(e,r,Ae,ge),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(V(t,r,Re,Se),V(t,e,Ae,ge),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(V(r,e,Re,Se),V(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?a?i||(V(r,e,Re,Se),V(r,t,Ae,ge),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(V(t,r,Re,Se),V(t,e,Ae,ge),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(V(e,t,Re,Se),V(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 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=d.computeNumberOfVertices(e);return e.indices=y.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 E({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new d({attributes:r,indices:[],primitiveType:e.primitiveType})}function j(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,h,d,E){if(c(s)||c(l)||c(f)||c(h)){var p=a.fromArray(u,3*e,Ie),m=a.fromArray(u,3*r,Oe),y=a.fromArray(u,3*i,Me),_=t(o,p,m,y,we);if(c(s)){var v=a.fromArray(s,3*e,Ie),T=a.fromArray(s,3*r,Oe),R=a.fromArray(s,3*i,Me);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*E)}if(c(l)){var S=a.fromArray(l,3*e,Ie),g=a.fromArray(l,3*r,Oe),N=a.fromArray(l,3*i,Me);a.multiplyByScalar(S,_.x,S),a.multiplyByScalar(g,_.y,g),a.multiplyByScalar(N,_.z,N);var I=a.add(S,g,S);a.add(I,N,I),a.normalize(I,I),a.pack(I,d.binormal.values,3*E)}if(c(f)){var O=a.fromArray(f,3*e,Ie),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,d.tangent.values,3*E)}if(c(h)){var C=n.fromArray(h,2*e,xe),P=n.fromArray(h,2*r,Ce),D=n.fromArray(h,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,d.st.values,2*E)}}}function J(e,t,r,n,a,i){var o=e.position.values.length/3;if(-1!==a){var u=n[a],s=r[u];return-1===s?(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,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,m=Z(u),y=Z(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;T>o;o+=3){var R=p[o],A=p[o+1],S=p[o+2],g=a.fromArray(l,3*R),N=a.fromArray(l,3*A),I=a.fromArray(l,3*S),O=Y(g,N,I);if(c(O)&&O.positions.length>3)for(var M=O.positions,w=O.indices,x=w.length,C=0;x>C;++C){var P=w[C],D=M[P];D.y<0?(t=y.attributes,r=y.indices,n=_):(t=m.attributes,r=m.indices,n=v),i=J(t,r,n,p,3>P?o+P:-1,D),K(R,A,S,D,l,f,h,d,E,t,i)}else c(O)&&(g=O.positions[0],N=O.positions[1],I=O.positions[2]),g.y<0?(t=y.attributes,r=y.indices,n=_):(t=m.attributes,r=m.indices,n=v),i=J(t,r,n,p,o,g),K(R,A,S,g,l,f,h,d,E,t,i),i=J(t,r,n,p,o+1,N),K(R,A,S,N,l,f,h,d,E,t,i),i=J(t,r,n,p,o+2,I),K(R,A,S,I,l,f,h,d,E,t,i)}j(e,y,m)}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,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;l>t;t+=2){var d=o[t],E=o[t+1],p=a.fromArray(i,3*d,Ie),m=a.fromArray(i,3*E,Oe);Math.abs(p.y)<T.EPSILON6&&(p.y<0?p.y=-T.EPSILON6:p.y=T.EPSILON6),Math.abs(m.y)<T.EPSILON6&&(m.y<0?m.y=-T.EPSILON6:m.y=T.EPSILON6);var y=u.attributes,_=u.indices,R=h,A=s.attributes,S=s.indices,g=f,N=v.lineSegmentPlane(p,m,De,Me);if(c(N)){var I=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Le);p.y<0&&(a.negate(I,I),y=s.attributes,_=s.indices,R=f,A=u.attributes,S=u.indices,g=h);var O=a.add(N,I,Ue);J(y,_,R,o,t,p),J(y,_,R,o,-1,O),a.negate(I,I),a.add(N,I,O),J(A,S,g,o,-1,O),J(A,S,g,o,t+1,m)}else{var M,w,x;p.y<0?(M=s.attributes,w=s.indices,x=f):(M=u.attributes,w=u.indices,x=h),J(M,w,x,o,t,p),J(M,w,x,o,t+1,m)}}j(e,s,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,m=Z(u),y=Z(u),_=l.length/3;for(t=0;_>t;t+=4){var R=t,A=t+1,S=t+2,g=t+3,N=a.fromArray(l,3*R,ze),I=a.fromArray(l,3*A,Be),O=a.fromArray(l,3*S,Ge),M=a.fromArray(l,3*g,qe);Math.abs(N.y)<T.EPSILON6&&(N.y=T.EPSILON6*(O.y<0?-1:1),I.y=N.y),Math.abs(O.y)<T.EPSILON6&&(O.y=T.EPSILON6*(N.y<0?-1:1),M.y=O.y);var w=m.attributes,x=m.indices,C=y.attributes,P=y.indices,D=v.lineSegmentPlane(N,O,De,We);if(c(D)){var L=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,He);N.y<0&&(a.negate(L,L),w=y.attributes,x=y.indices,C=m.attributes,P=m.indices);var U=a.add(D,L,Xe);for(w.position.values.push(N.x,N.y,N.z,I.x,I.y,I.z),w.position.values.push(U.x,U.y,U.z),w.position.values.push(U.x,U.y,U.z),a.negate(L,L),a.add(D,L,U),C.position.values.push(U.x,U.y,U.z),C.position.values.push(U.x,U.y,U.z),C.position.values.push(O.x,O.y,O.z,M.x,M.y,M.z),r=3*R;3*R+6>r;++r)w.prevPosition.values.push(f[r]);for(w.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),C.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),r=3*S;3*S+6>r;++r)C.prevPosition.values.push(f[r]);for(r=3*R;3*R+6>r;++r)w.nextPosition.values.push(h[r]);for(w.nextPosition.values.push(O.x,O.y,O.z,O.x,O.y,O.z),C.nextPosition.values.push(O.x,O.y,O.z,O.x,O.y,O.z),r=3*S;3*S+6>r;++r)C.nextPosition.values.push(h[r]);var b=n.fromArray(d,2*R,be),F=Math.abs(b.y);w.expandAndWidth.values.push(-1,F,1,F),w.expandAndWidth.values.push(-1,-F,1,-F),C.expandAndWidth.values.push(-1,F,1,F),C.expandAndWidth.values.push(-1,-F,1,-F);var z=a.magnitudeSquared(a.subtract(D,N,qe));if(z/=a.magnitudeSquared(a.subtract(O,N,qe)),c(p)){var B=i.fromArray(p,4*R,Ve),G=i.fromArray(p,4*S,Ve),q=T.lerp(B.x,G.x,z),W=T.lerp(B.y,G.y,z),H=T.lerp(B.z,G.z,z),X=T.lerp(B.w,G.w,z);for(r=4*R;4*R+8>r;++r)w.color.values.push(p[r]);for(w.color.values.push(q,W,H,X),w.color.values.push(q,W,H,X),C.color.values.push(q,W,H,X),C.color.values.push(q,W,H,X),r=4*S;4*S+8>r;++r)C.color.values.push(p[r])}if(c(E)){var V=n.fromArray(E,2*R,be),Y=n.fromArray(E,2*(t+3),Fe),k=T.lerp(V.x,Y.x,z);for(r=2*R;2*R+4>r;++r)w.st.values.push(E[r]);for(w.st.values.push(k,V.y),w.st.values.push(k,Y.y),C.st.values.push(k,V.y),C.st.values.push(k,Y.y),r=2*S;2*S+4>r;++r)C.st.values.push(E[r])}o=w.position.values.length/3-4,x.push(o,o+2,o+1),x.push(o+1,o+2,o+3),o=C.position.values.length/3-4,P.push(o,o+2,o+1),P.push(o+1,o+2,o+3)}else{var K,J;for(N.y<0?(K=y.attributes,J=y.indices):(K=m.attributes,J=m.indices),K.position.values.push(N.x,N.y,N.z),K.position.values.push(I.x,I.y,I.z),K.position.values.push(O.x,O.y,O.z),K.position.values.push(M.x,M.y,M.z),r=3*t;3*t+12>r;++r)K.prevPosition.values.push(f[r]),K.nextPosition.values.push(h[r]);for(r=2*t;2*t+8>r;++r)K.expandAndWidth.values.push(d[r]),c(E)&&K.st.values.push(E[r]);if(c(p))for(r=4*t;4*t+16>r;++r)K.color.values.push(p[r]);o=K.position.values.length/3-4,J.push(o,o+2,o+1),J.push(o+1,o+2,o+3)}}j(e,y,m)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case g.TRIANGLES:e.indices=O(t);break;case g.TRIANGLE_STRIP:e.indices=M(t);break;case g.TRIANGLE_FAN:e.indices=w(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=g.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,h=0;o>h;h+=3)l[f++]=a[h],l[f++]=a[h+1],l[f++]=a[h+2],l[f++]=a[h]+i[h]*n,l[f++]=a[h+1]+i[h+1]*n,l[f++]=a[h+2]+i[h+2]*n;var p,m=e.boundingSphere;return c(m)&&(p=new r(m.center,m.radius+n)),new d({attributes:{position:new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:g.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;o>t;++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=d.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;t>a;a++)n[a]=-1;for(var i,o=r,s=o.length,l=y.createTypedArray(t,s),f=0,h=0,E=0;s>f;)i=n[o[f]],-1!==i?l[h]=i:(i=o[f],n[i]=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(-1!==S)for(a=0;R>a;a++)A[R*S+a]=v[R*T+a];++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,a=0,i=0;n>i;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=d.computeNumberOfVertices(e);if(c(e.indices)&&r>=T.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=x(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;l>f;f+=n){for(var h=0;n>h;++h){var E=s[f+h],p=a[E];c(p)||(p=o++,a[E]=p,C(u,e.attributes,E)),i.push(p)}o+n>=T.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=x(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,ne=new o;te.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new h;for(var s=i.ellipsoid,f=o.values,d=new Float64Array(f.length),p=0,m=0;m<f.length;m+=3){var y=a.fromArray(f,m,re),_=s.cartesianToCartographic(y,ne);if(!c(_))throw new l("Could not project point ("+y.x+", "+y.y+", "+y.z+") to 2D.");var v=i.project(_,re);d[p++]=v.x,d[p++]=v.y,d[p++]=v.z}return e.attributes[r]=o,e.attributes[n]=new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:d}),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;o>l;++l)f.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var h=a.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 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),D(ue,n.normal),D(ue,n.binormal),D(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;n>a;++a){var i=e[a];c(i.geometry)?t.push(i):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,fe=new a,he=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;i>f;f++)s[f]={ +indexOffset:0,count:0,currentCount:0};var h=0;for(f=0;o>f;f+=3){var d=t[f],p=t[f+1],m=t[f+2],y=3*d,_=3*p,v=3*m;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],he.x=n[v],he.y=n[v+1],he.z=n[v+2],s[d].count++,s[p].count++,s[m].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;i>f;f++)s[f].indexOffset+=T,T+=s[f].count;h=0;var R;for(f=0;o>f;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;i>f;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 E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:S}),e};var de=new a,Ee=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 f,h,d;for(l=0;s>l;l+=3){var p=t[l],m=t[l+1],y=t[l+2];f=3*p,h=3*m,d=3*y;var _=2*p,v=2*m,T=2*y,R=r[f],A=r[f+1],S=r[f+2],g=i[_],N=i[_+1],I=i[v+1]-N,O=i[T+1]-N,M=1/((i[v]-g)*O-(i[T]-g)*I),w=(O*(r[h]-R)-I*(r[d]-R))*M,x=(O*(r[h+1]-A)-I*(r[d+1]-A))*M,C=(O*(r[h+2]-S)-I*(r[d+2]-S))*M;c[f]+=w,c[f+1]+=x,c[f+2]+=C,c[h]+=w,c[h+1]+=x,c[h+2]+=C,c[d]+=w,c[d+1]+=x,c[d+2]+=C}var P=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;o>l;l++){f=3*l,h=f+1,d=f+2;var L=a.fromArray(n,f,de),U=a.fromArray(c,f,pe),b=a.dot(L,U);a.multiplyByScalar(L,b,Ee),a.normalize(a.subtract(U,Ee,U),U),D[f]=U.x,D[h]=U.y,D[d]=U.z,a.normalize(a.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 me=new n,ye=new a,_e=new a,ve=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,h=t.attributes.tangent,d=t.attributes.binormal;c(r)&&(o=r.values),c(i)&&(s=i.values),c(h)&&(l=h.values),d&&(f=d.values);var p=c(o)?o.length:s.length,m=c(o)?3:2,y=p/m,_=y,v=c(s)&&c(o)?2:1;v+=c(l)||c(f)?1:0,_*=v;for(var T=new Float32Array(_),R=0,A=0;y>A;++A){c(s)&&(n.fromArray(s,2*A,me),T[R++]=e.compressTextureCoordinates(me));var S=3*A;c(o)&&c(l)&&c(f)?(a.fromArray(o,S,ye),a.fromArray(l,S,_e),a.fromArray(f,S,ve),e.octPack(ye,_e,ve,me),T[R++]=me.x,T[R++]=me.y):(c(o)&&(a.fromArray(o,S,ye),T[R++]=e.octEncodeFloat(ye)),c(l)&&(a.fromArray(l,S,ye),T[R++]=e.octEncodeFloat(ye)),c(f)&&(a.fromArray(f,S,ye),T[R++]=e.octEncodeFloat(ye)))}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 a,Re=new a,Ae=new a,Se=new a,ge=new a,Ne={positions:new Array(7),indices:new Array(9)},Ie=new a,Oe=new a,Me=new a,we=new a,xe=new n,Ce=new n,Pe=new n,De=S.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,We=new a,He=new a,Xe=new a,Ve=new i;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,S.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==m.NONE)switch(t.geometryType){case m.POLYLINES:ee(e);break;case m.TRIANGLES:Q(e);break;case m.LINES:$(e)}else W(t),t.primitiveType===g.TRIANGLES?Q(e):t.primitiveType===g.LINES&&$(e);return e},te}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";function r(t,r,a,i){return e(t,r,a,i,n),n.x>0&&n.y>0&&n.z>0}var n=new t;return r}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){var t=e._uSquared,r=e._ellipsoid.maximumRadius,n=e._ellipsoid.minimumRadius,a=(r-n)/r,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,v=1+p-3*m/4+5*y/4-175*_/64,T=1-p+15*m/8-35*y/8,R=1-3*p+35*m/4,A=1-5*p,S=v*l-T*Math.sin(2*l)*p/2-R*Math.sin(4*l)*m/16-A*Math.sin(6*l)*y/48-5*Math.sin(8*l)*_/512,g=e._constants;g.a=r,g.b=n,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=E,g.u2Over4=p,g.u4Over16=m,g.u6Over64=y,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,r,n,a,i,o){var u=c(e,r);return(1-u)*e*t*(n+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,r,n,a,i,o){var s,c,f,h,d,E=(t-r)/t,p=i-n,m=Math.atan((1-E)*Math.tan(a)),y=Math.atan((1-E)*Math.tan(o)),_=Math.cos(m),v=Math.sin(m),T=Math.cos(y),R=Math.sin(y),A=_*T,S=_*R,g=v*R,N=v*T,I=p,O=u.TWO_PI,M=Math.cos(I),w=Math.sin(I);do{M=Math.cos(I),w=Math.sin(I);var x=S-N*M;f=Math.sqrt(T*T*w*w+x*x),c=g+A*M,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=A*w/f,h=1-C*C),O=I,d=c-2*g/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-r*r)/(r*r),D=1+P*(4096+P*(P*(320-175*P)-768))/16384,L=P*(256+P*(P*(74-47*P)-128))/1024,U=d*d,b=L*f*(d+L*(c*(2*U-1)-L*d*(4*f*f-3)*(4*U-3)/6)/4),F=r*D*(s-b),z=Math.atan2(T*w,S-N*M),B=Math.atan2(_*w,S*M-N);e._distance=F,e._startHeading=z,e._endHeading=B,e._uSquared=P}function h(r,n,a,i){e.normalize(i.cartographicToCartesian(n,p),E),e.normalize(i.cartographicToCartesian(a,p),p);f(r,i.maximumRadius,i.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 d(e,a,i){var u=r(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,n(e)&&n(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,r){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,v=a.u4Over16,T=2*p*m*o/3+i*(1-y+7*v/4-15*_/4+579*m/64-(v-15*_/4+187*m/16)*o-(5*_/4-115*m/16)*u-29*m*s/16)+(y/2-v+71*_/32-85*m/16)*c+(5*v/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,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),I=a.cosineU*N,O=a.sineU*g,M=Math.atan2(g*a.sineHeading,I-O*a.cosineHeading),w=M-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,T,g,N,S);return n(r)?(r.longitude=this._start.longitude+w,r.latitude=A,r.height=0,r):new t(this._start.longitude+w,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,r,n,a,i,o,u,s,c,l,f){"use strict";function h(e,t,r){var n=g;n.length=e;var a;if(t===r){for(a=0;e>a;a++)n[a]=t;return n}var i=r-t,o=i/e;for(a=0;e>a;a++){var u=t+a*o;n[a]=u}return n}function d(t,r,n,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,M),l=a.scaleToGeodeticSurface(r,w),f=E.numberOfPoints(t,r,n),d=a.cartesianToCartographic(c,N),p=a.cartesianToCartographic(l,I),m=h(f,i,o);x.setEndPoints(d,p);var y=x.surfaceDistance/f,_=s;d.height=i;var v=a.cartographicToCartesian(d,O);e.pack(v,u,_),_+=3;for(var T=1;f>T;T++){var R=x.interpolateUsingSurfaceDistance(T*y,I);R.height=m[T],v=a.cartographicToCartesian(R,O),e.pack(v,u,_),_+=3}return _}var E={};E.numberOfPoints=function(t,r,n){var a=e.distance(t,r);return Math.ceil(a/n)};var p=new t;E.extractHeights=function(e,t){for(var r=e.length,n=new Array(r),a=0;r>a;a++){var i=e[a];n[a]=t.cartesianToCartographic(i,p).height}return n};var m=new l,y=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,I=new t,O=new e,M=new e,w=new e,x=new o;E.wrapLongitude=function(t,a){var i=[],o=[];if(n(t)&&t.length>0){a=r(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,v),E=l.multiplyByPointAsVector(s,e.UNIT_X,T),p=f.fromPointNormal(c,E,R),g=1;i.push(e.clone(t[0]));for(var N=i[0],I=t.length,O=1;I>O;++O){var M=t[O];if(f.getPointDistance(p,N)<0||f.getPointDistance(p,M)<0){var w=u.lineSegmentPlane(N,M,d,A);if(n(w)){var x=e.multiplyByScalar(h,5e-9,S);f.getPointDistance(d,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[O])),g++,N=M}o.push(g)}return{positions:i,lengths:o}};var C=c.EPSILON10;return E.removeDuplicates=function(t){var r=t.length;if(2>r)return t;var n,a,i;for(n=1;r>n&&(a=t[n-1],i=t[n],!e.equalsEpsilon(a,i,C));++n);if(n===r)return t;for(var o=t.slice(0,n);r>n;++n)i=t[n],e.equalsEpsilon(a,i,C)||(o.push(e.clone(i)),a=i);return o},E.generateArc=function(t){n(t)||(t={});var a=t.positions,o=a.length,u=r(t.ellipsoid,i.WGS84),l=r(t.height,0);if(1>o)return[];if(1===o){var f=u.scaleToGeodeticSurface(a[0],M);if(0!==l){var h=u.geodeticSurfaceNormal(f,O);e.multiplyByScalar(h,l,h),e.add(f,h,f)}return[f.x,f.y,f.z]}var p=t.minDistance;if(!n(p)){var m=r(t.granularity,c.RADIANS_PER_DEGREE);p=c.chordLength(m,u.maximumRadius)}var y,_=0;for(y=0;o-1>y;y++)_+=E.numberOfPoints(a[y],a[y+1],p);var v=3*(_+1),T=new Array(v),R=0,A=s(l);for(y=0;o-1>y;y++){var S=a[y],I=a[y+1],w=A?l[y]:l,x=A?l[y+1]:l;R=d(S,I,p,u,w,x,T,R)}g.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,N);P.height=A?l[o-1]:l;var D=u.cartographicToCartesian(P,O);return e.pack(D,T,v-3),T},E.generateCartesianArc=function(t){for(var r=E.generateArc(t),n=r.length/3,a=new Array(n),i=0;n>i;i++)a[i]=e.unpack(r,3*i);return a},E}),define("Core/Queue",["../Core/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(){return 0!==this._length?this._array[this._offset]:void 0},t.prototype.contains=function(e){return-1!==this._array.indexOf(e)},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/WindingOrder",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"use strict";var r={CLOCKWISE:e.CW,COUNTER_CLOCKWISE:e.CCW,validate:function(e){return e===r.CLOCKWISE||e===r.COUNTER_CLOCKWISE}};return t(r)}),define("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PolylinePipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,n,a,i,o,u,s,c,l,f,h,d,E,p){"use strict";function m(t,r,n){var a=e.subtract(r,t,b),i=e.subtract(n,r,F);return a.x*i.y-a.y*i.x>=0}function y(e){for(var t=e[0].x,r=0,n=0;n<e.length;n++)e[n].x>t&&(t=e[n].x,r=n);return r}function _(e){for(var t=e[0][0].x,r=0,n=0;n<e.length;n++){var a=e[n][y(e[n])].x;a>t&&(t=a,r=n)}return r}function v(e){for(var t=[],r=0;r<e.length;r++){var n=e[(r-1+e.length)%e.length],a=e[r],i=e[(r+1)%e.length];m(n,a,i)||t.push(a)}return t}function T(t,r){for(var n=0;n<t.length;n++)if(e.equals(r,t[n]))return n;return-1}function R(r,a,i){i=n(i,[]);var o=Number.MAX_VALUE,u=y(a),s=new e(a[u].x,r.y);i.push(u),i.push((u+1)%a.length);for(var c=a[0].x,l=c,f=1;f<a.length;++f)a[f].x<c?c=a[f].x:a[f].x>l&&(l=a[f].x);l+=l-c;var h=new t(l,r.y,0);for(f=0;f<a.length;f++){var d=a[f],E=a[(f+1)%a.length];if((d.x>=r.x||E.x>=r.x)&&(d.y>=r.y&&E.y<=r.y||d.y<=r.y&&E.y>=r.y)){var p=(E.y-d.y)*(h.x-r.x)-(E.x-d.x)*(h.y-r.y);if(0!==p){p=1/p;var m=((E.x-d.x)*(r.y-d.y)-(E.y-d.y)*(r.x-d.x))*p,_=((h.x-r.x)*(r.y-d.y)-(h.y-r.y)*(r.x-d.x))*p;if(m>=0&&1>=m&&_>=0&&1>=_){var v=new e(r.x+m*(h.x-r.x),r.y+m*(h.y-r.y)),T=e.subtract(v,r,z);p=e.magnitudeSquared(T),o>p&&(s=v,o=p,i[0]=f,i[1]=(f+1)%a.length)}}}}return s}function A(t,r){var n=_(r),a=r[n],i=y(a),o=a[i],u=[],s=R(o,t,u),c=T(t,s);if(-1!==c)return c;var h=e.magnitudeSquared(e.subtract(t[u[0]],o,B)),d=e.magnitudeSquared(e.subtract(t[u[1]],o,B)),E=d>h?t[u[0]]:t[u[1]],p=v(t),m=p.indexOf(E);-1!==m&&p.splice(m,1);for(var A=[],S=0;S<p.length;S++){var g=p[S];f(g,o,s,E)&&A.push(g)}var N=Number.MAX_VALUE;if(A.length>0){var I=e.fromElements(1,0,B);for(S=0;S<A.length;S++){var O=e.subtract(A[S],o,G),M=e.magnitude(I)*e.magnitudeSquared(O);if(0!==M){var w=Math.abs(l.acosClamped(e.dot(I,O)/M));N>w&&(N=w,E=A[S])}}}return t.indexOf(E)}function S(e,r,n){for(var a=ee.computeWindingOrder2D(e),i=0;i<r.length;i++){var o=r[i];t.equals(o[0],o[o.length-1])||o.push(o[0]);var s=ee.computeWindingOrder2D(o);s===a&&o.reverse()}var c=u.fromPoints(e,n),l=c.projectPointsOntoPlane(e),f=[];for(i=0;i<r.length;i++)f.push(c.projectPointsOntoPlane(r[i]));var h=A(l,f),d=_(f),E=y(f[d]),p=r[d],m=[];for(i=0;i<e.length;i++)m.push(e[i]);var v,T=[];if(0!==E)for(v=0;v<=p.length;v++){var R=(v+E)%p.length;0!==R&&T.push(p[R])}else for(v=0;v<p.length;v++)T.push(p[(v+E)%p.length]);var S=m.lastIndexOf(e[h]);T.push(e[S]);var g=m.slice(0,S+1),N=m.slice(S+1);return m=g.concat(T,N),r.splice(d,1),m}function g(e){var t=l.nextRandomNumber(),r=Math.floor(t*e);return r===e&&r--,r}function N(e,t,r,n){var a=n[e].position,i=n[t].position,o=n[r].position,u=o.x,s=o.y,c=a.x-u,l=a.y-s,f=i.x-u,h=i.y-s;return c*h-l*f}function I(e,t){return e.x*t.y-e.y*t.x}function O(e,t){var r=t.length,n=l.mod(e-1,r),a=l.mod(e+1,r);return 0===N(n,a,e,t)?!1:!0}function M(t,r){return e.magnitudeSquared(r)<e.magnitudeSquared(t)}function w(t,r,n){if(!O(t,n))return t;var a=n[t].position,i=n[r].position,o=n.length,u=l.mod(t-1,o);if(!O(u,n))return u;var s=l.mod(t+1,o);if(!O(s,n))return s;var c=e.subtract(n[u].position,a,H),f=e.subtract(n[s].position,a,X),h=e.subtract(i,a,V),d=I(c,h),E=I(f,h);if(0===d)return M(c,h)?q:W;if(0===E)return M(f,h)?q:W;var p=I(c,f);return 0>p?0>d&&E>0?q:W:p>0?d>0&&0>E?W:q:void 0}function x(e,t,r){return(e>t||e>r)&&(t>e||r>e)||t===r&&t===e}function C(t,r,n,a){var i=e.subtract(n,t,k),o=r.x*a.y-r.y*a.x,u=o*o,s=e.magnitudeSquared(r),c=e.magnitudeSquared(a);if(u>Y*s*c){var l=(i.x*a.y-i.y*a.x)/o;return e.add(t,e.multiplyByScalar(r,l,k),k)}}function P(t,r,n){for(var i=e.subtract(r,t,Z),o=n.length,u=0;o>u;u++){var s=n[u].position,c=n[l.mod(u+1,o)].position;if(!(e.equals(t,s)||e.equals(r,c)||e.equals(t,c)||e.equals(r,s))){var f=e.subtract(c,s,j),h=C(t,i,s,f);if(a(h)&&!(e.equals(h,t)||e.equals(h,r)||e.equals(h,s)||e.equals(h,c))){var d=h.x,E=h.y,p=x(d,t.x,r.x)&&x(E,t.y,r.y)&&x(d,s.x,c.x)&&x(E,s.y,c.y);if(p)return!0}}}return!1}function D(t,r,n){var a=w(t,r,n);if(a>=0)return a;var i=w(r,t,n);return i>=0?i:a!==q||i!==q||P(n[t].position,n[r].position,n)||e.equals(n[t].position,n[r].position)?J:K}function L(e){return 0===N(1,2,0,e)}function U(e){var t=e.length;if(3===t)return L(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new i("Invalid polygon: must have at least three vertices.");for(var r,n,a=0,o=10*e.length,u=J;K>u&&a++<o;){for(r=g(e.length),n=r+1;Math.abs(r-n)<2||Math.abs(r-n)>e.length-2;)n=g(e.length);if(r>n){var s=r;r=n,n=s}u=D(r,n,e)}if(u===K){var c=e.splice(r,n-r+1,e[r],e[n]);return U(e).concat(U(c))}return u>=0?(e.splice(u,1),U(e)):[]}var b=new e,F=new e,z=new e,B=new e(1,0),G=new e,q=-1,W=-2,H=new t,X=new t,V=new t,Y=l.EPSILON14,k=new e,Z=new e,j=new e,K=-1,J=-2,Q=new t,$=new t,ee={};ee.removeDuplicates=function(e){var r=h.removeDuplicates(e);return t.equals(r[0],r[r.length-1])?r.slice(1):r},ee.computeArea2D=function(e){for(var t=e.length,r=0,n=t-1,a=0;t>a;n=a++){var i=e[n],o=e[a];r+=i.x*o.y-o.x*i.y}return.5*r},ee.computeWindingOrder2D=function(e){var t=ee.computeArea2D(e);return t>0?p.COUNTER_CLOCKWISE:p.CLOCKWISE},ee.triangulate=function(e){for(var t=e.length,r=[],n=0;t>n;++n)r[n]={position:e[n],index:n};return U(r)};var te=new t,re=new t,ne=new t,ae=new t,ie=new t,oe=new t,ue=new t;return ee.computeSubdivision=function(e,i,o,u){u=n(u,l.RADIANS_PER_DEGREE);var f,h=o.slice(0),E=i.length,p=new Array(3*E),m=0;for(f=0;E>f;f++){var y=i[f];p[m++]=y.x,p[m++]=y.y,p[m++]=y.z}for(var _=[],v={},T=e.maximumRadius,R=l.chordLength(u,T),A=R*R;h.length>0;){var S,g,N=h.pop(),I=h.pop(),O=h.pop(),M=t.fromArray(p,3*O,te),w=t.fromArray(p,3*I,re),x=t.fromArray(p,3*N,ne),C=t.multiplyByScalar(t.normalize(M,ae),T,ae),P=t.multiplyByScalar(t.normalize(w,ie),T,ie),D=t.multiplyByScalar(t.normalize(x,oe),T,oe),L=t.magnitudeSquared(t.subtract(C,P,ue)),U=t.magnitudeSquared(t.subtract(P,D,ue)),b=t.magnitudeSquared(t.subtract(D,C,ue)),F=Math.max(L,U,b);F>A?L===F?(S=Math.min(O,I)+" "+Math.max(O,I),f=v[S],a(f)||(g=t.add(M,w,ue),t.multiplyByScalar(g,.5,g),p.push(g.x,g.y,g.z),f=p.length/3-1,v[S]=f),h.push(O,f,N),h.push(f,I,N)):U===F?(S=Math.min(I,N)+" "+Math.max(I,N),f=v[S],a(f)||(g=t.add(w,x,ue),t.multiplyByScalar(g,.5,g),p.push(g.x,g.y,g.z),f=p.length/3-1,v[S]=f),h.push(I,f,O),h.push(f,N,O)):b===F&&(S=Math.min(N,O)+" "+Math.max(N,O),f=v[S],a(f)||(g=t.add(x,M,ue),t.multiplyByScalar(g,.5,g),p.push(g.x,g.y,g.z),f=p.length/3-1,v[S]=f),h.push(N,f,I),h.push(f,O,I)):(_.push(O),_.push(I),_.push(N))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})},indices:_,primitiveType:d.TRIANGLES})},ee.scaleToGeodeticHeight=function(e,r,i,u){i=n(i,o.WGS84);var s=Q,c=$;if(r=n(r,0),u=n(u,!0),a(e)&&a(e.attributes)&&a(e.attributes.position))for(var l=e.attributes.position.values,f=l.length,h=0;f>h;h+=3)t.fromArray(l,h,c),u&&(c=i.scaleToGeodeticSurface(c,c)),0!==r&&(s=i.geodeticSurfaceNormal(c,s),t.multiplyByScalar(s,r,s),t.add(c,s,c)),l[h]=c.x,l[h+1]=c.y,l[h+2]=c.z;return e},ee.eliminateHoles=function(e,r,a){a=n(a,o.WGS84);for(var i=[],u=0;u<r.length;u++){for(var s=[],c=0;c<r[u].length;c++)s.push(t.clone(r[u][c]));i.push(s)}for(var l=e;i.length>0;)l=S(l,i,a);return l},ee}),define("Core/PolygonGeometryLibrary",["./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,n,a,i,o,u,s,c,l,f,h,d,E){"use strict";function p(t,r,n,a){return e.subtract(r,t,y),e.multiplyByScalar(y,n/a,y),e.add(t,y,y),[y.x,y.y,y.z]}var m={};m.computeHierarchyPackedLength=function(t){for(var r=0,a=[t];a.length>0;){var i=a.pop();if(n(i)){r+=2;var o=i.positions,u=i.holes;if(n(o)&&(r+=o.length*e.packedLength),n(u))for(var s=u.length,c=0;s>c;++c)a.push(u[c])}}return r},m.packPolygonHierarchy=function(t,r,a){for(var i=[t];i.length>0;){var o=i.pop();if(n(o)){var u=o.positions,s=o.holes;if(r[a++]=n(u)?u.length:0,r[a++]=n(s)?s.length:0,n(u))for(var c=u.length,l=0;c>l;++l,a+=3)e.pack(u[l],r,a);if(n(s))for(var f=s.length,h=0;f>h;++h)i.push(s[h])}}return a},m.unpackPolygonHierarchy=function(t,r){for(var n=t[r++],a=t[r++],i=new Array(n),o=a>0?new Array(a):void 0,u=0;n>u;++u,r+=e.packedLength)i[u]=e.unpack(t,r);for(var s=0;a>s;++s)o[s]=m.unpackPolygonHierarchy(t,r),r=o[s].startingIndex,delete o[s].startingIndex;return{positions:i,holes:o,startingIndex:r}};var y=new e;m.subdivideLineCount=function(t,r,n){var a=e.distance(t,r),i=a/n,o=Math.max(0,Math.ceil(Math.log(i)/Math.log(2)));return Math.pow(2,o)},m.subdivideLine=function(t,r,a,i){var o=m.subdivideLineCount(t,r,a),u=e.distance(t,r),s=u/o;n(i)||(i=[]);var c=i;c.length=3*o;for(var l=0,f=0;o>f;f++){var h=p(t,r,f*s,u);c[l++]=h[0],c[l++]=h[1],c[l++]=h[2]}return c};var _=new e,v=new e,T=new e,R=new e;m.scaleToGeodeticHeightExtruded=function(t,i,o,u,s){u=r(u,a.WGS84);var c=_,l=v,f=T,h=R;if(n(t)&&n(t.attributes)&&n(t.attributes.position))for(var d=t.attributes.position.values,E=d.length/2,p=0;E>p;p+=3)e.fromArray(d,p,f),u.geodeticSurfaceNormal(f,c),h=u.scaleToGeodeticSurface(f,h),l=e.multiplyByScalar(c,o,l),l=e.add(h,l,l),d[p+E]=l.x,d[p+1+E]=l.y,d[p+2+E]=l.z,s&&(h=e.clone(f,h)),l=e.multiplyByScalar(c,i,l),l=e.add(h,l,l),d[p]=l.x,d[p+1]=l.y,d[p+2]=l.z;return t},m.polygonsFromHierarchy=function(e){var t=[],r=[],a=new d;for(a.enqueue(e);0!==a.length;){var i=a.dequeue(),o=i.positions,u=i.holes;if(o=f.removeDuplicates(o),!(o.length<3)){for(var s=n(u)?u.length:0,c=[],l=0;s>l;l++){var h=u[l];if(h.positions=f.removeDuplicates(h.positions),!(h.positions.length<3)){c.push(h.positions);var E=0;n(h.holes)&&(E=h.holes.length);for(var p=0;E>p;p++)a.enqueue(h.holes[p])}}r.push({outerRing:o,holes:c});var m=c.length>0?f.eliminateHoles(o,c):o;t.push(m)}}return{hierarchy:r,polygons:t}};var A=[];m.createGeometryFromPositions=function(e,r,n,a){var s=i.fromPoints(r,e),c=s.projectPointsOntoPlane(r,A),l=f.computeWindingOrder2D(c);l===E.CLOCKWISE&&(c.reverse(),r=r.slice().reverse());var d=f.triangulate(c);if(d.length<3&&(d=[0,1,2]),a){for(var p=r.length,m=new Array(3*p),y=0,_=0;p>_;_++){var v=r[_];m[y++]=v.x,m[y++]=v.y,m[y++]=v.z}return new o({attributes:{position:new u({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:m})},indices:d,primitiveType:h.TRIANGLES})}return f.computeSubdivision(e,r,d,n)};var S=[],g=new e,N=new e;return m.computeWallGeometry=function(r,n,a,i){var f,d,E,p,y,_=r.length,v=0;if(i)for(d=3*_*2,f=new Array(2*d),E=0;_>E;E++)p=r[E],y=r[(E+1)%_],f[v]=f[v+d]=p.x,++v,f[v]=f[v+d]=p.y,++v,f[v]=f[v+d]=p.z,++v,f[v]=f[v+d]=y.x,++v,f[v]=f[v+d]=y.y,++v,f[v]=f[v+d]=y.z,++v;else{var T=l.chordLength(a,n.maximumRadius),R=0;for(E=0;_>E;E++)R+=m.subdivideLineCount(r[E],r[(E+1)%_],T);for(d=3*(R+_),f=new Array(2*d),E=0;_>E;E++){p=r[E],y=r[(E+1)%_];for(var A=m.subdivideLine(p,y,T,S),I=A.length,O=0;I>O;++O,++v)f[v]=A[O],f[v+d]=A[O];f[v]=y.x,f[v+d]=y.x,++v,f[v]=y.y,f[v+d]=y.y,++v,f[v]=y.z,f[v+d]=y.z,++v}}_=f.length;var M=c.createTypedArray(_/3,_-6*r.length),w=0;for(_/=6,E=0;_>E;E++){var x=E,C=x+1,P=x+_,D=P+1;p=e.fromArray(f,3*x,g),y=e.fromArray(f,3*C,N),e.equalsEpsilon(p,y,l.EPSILON14)||(M[w++]=x,M[w++]=P,M[w++]=C,M[w++]=C,M[w++]=P,M[w++]=D)}return new o({attributes:new s({position:new u({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:f})}),indices:M,primitiveType:h.TRIANGLES})},m}),define("Core/PolygonOutlineGeometry",["./BoundingSphere","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,n,a,i,o,u,s,c,l,f,h,d,E,p,m,y,_){"use strict";function v(e,r,n,a){var i=o.fromPoints(r,e),f=i.projectPointsOntoPlane(r,A),d=p.computeWindingOrder2D(f);d===_.CLOCKWISE&&(f.reverse(),r=r.slice().reverse());var y,v,T=r.length,R=0;if(a)for(y=new Float64Array(2*T*3),v=0;T>v;v++){var g=r[v],N=r[(v+1)%T];y[R++]=g.x,y[R++]=g.y,y[R++]=g.z,y[R++]=N.x,y[R++]=N.y,y[R++]=N.z}else{var I=0;for(v=0;T>v;v++)I+=E.subdivideLineCount(r[v],r[(v+1)%T],n);for(y=new Float64Array(3*I),v=0;T>v;v++)for(var O=E.subdivideLine(r[v],r[(v+1)%T],n,S),M=O.length,w=0;M>w;++w)y[R++]=O[w]}T=y.length/3;var x=2*T,C=h.createTypedArray(T,x);for(R=0,v=0;T-1>v;v++)C[R++]=v,C[R++]=v+1;return C[R++]=T-1,C[R++]=0,new l({geometry:new u({attributes:new c({position:new s({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:y})}),indices:C,primitiveType:m.LINES})})}function T(e,r,n,a){var i=o.fromPoints(r,e),f=i.projectPointsOntoPlane(r,A),d=p.computeWindingOrder2D(f);d===_.CLOCKWISE&&(f.reverse(),r=r.slice().reverse());var y,v,T=r.length,R=new Array(T),g=0;if(a)for(y=new Float64Array(2*T*3*2),v=0;T>v;++v){R[v]=g/3;var N=r[v],I=r[(v+1)%T];y[g++]=N.x,y[g++]=N.y,y[g++]=N.z,y[g++]=I.x,y[g++]=I.y,y[g++]=I.z}else{var O=0;for(v=0;T>v;v++)O+=E.subdivideLineCount(r[v],r[(v+1)%T],n);for(y=new Float64Array(3*O*2),v=0;T>v;++v){R[v]=g/3;for(var M=E.subdivideLine(r[v],r[(v+1)%T],n,S),w=M.length,x=0;w>x;++x)y[g++]=M[x]}}T=y.length/6;var C=R.length,P=2*(2*T+C),D=h.createTypedArray(T,P);for(g=0,v=0;T>v;++v)D[g++]=v,D[g++]=(v+1)%T,D[g++]=v+T,D[g++]=(v+1)%T+T;for(v=0;C>v;v++){var L=R[v];D[g++]=L,D[g++]=L+T}return new l({geometry:new u({attributes:new c({position:new s({componentDatatype:t.DOUBLE,componentsPerAttribute:3,values:y})}),indices:D,primitiveType:m.LINES})})}function R(e){var t=e.polygonHierarchy,a=r(e.ellipsoid,i.WGS84),o=r(e.granularity,d.RADIANS_PER_DEGREE),u=r(e.height,0),s=r(e.perPositionHeight,!1),c=e.extrudedHeight,l=n(c);if(l&&!s){var f=c;c=Math.min(f,u),u=Math.max(f,u)}this._ellipsoid=i.clone(a),this._granularity=o,this._height=u,this._extrudedHeight=r(c,0),this._extrude=l,this._polygonHierarchy=t,this._perPositionHeight=s,this._workerName="createPolygonOutlineGeometry",this.packedLength=E.computeHierarchyPackedLength(t)+i.packedLength+6}var A=[],S=[];R.pack=function(e,t,n){n=r(n,0),n=E.packPolygonHierarchy(e._polygonHierarchy,t,n),i.pack(e._ellipsoid,t,n),n+=i.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};var g=i.clone(i.UNIT_SPHERE),N={polygonHierarchy:{}};return R.unpack=function(e,t,a){t=r(t,0);var o=E.unpackPolygonHierarchy(e,t);t=o.startingIndex,delete o.startingIndex;var u=i.unpack(e,t,g);t+=i.packedLength;var s=e[t++],c=e[t++],l=e[t++],f=1===e[t++],h=1===e[t++],d=e[t++];return n(a)||(a=new R(N)),a._polygonHierarchy=o,a._ellipsoid=i.clone(u,a._ellipsoid),a._height=s,a._extrudedHeight=c,a._granularity=l,a._extrude=f,a._perPositionHeight=h,a.packedLength=d,a},R.fromPositions=function(e){e=r(e,r.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 R(t)},R.createGeometry=function(t){var r=t._ellipsoid,a=t._granularity,i=t._height,o=t._extrudedHeight,s=t._extrude,c=t._polygonHierarchy,l=t._perPositionHeight,h=[],m=new y;m.enqueue(c);for(var _;0!==m.length;){var R=m.dequeue(),A=R.positions;if(A=p.removeDuplicates(A),!(A.length<3)){var S=R.holes?R.holes.length:0;for(_=0;S>_;_++){var g=R.holes[_];if(g.positions=p.removeDuplicates(g.positions),!(g.positions.length<3)){h.push(g.positions);var N=0;n(g.holes)&&(N=g.holes.length);for(var I=0;N>I;I++)m.enqueue(g.holes[I])}}h.push(A)}}if(0!==h.length){var O,M=[],w=d.chordLength(a,r.maximumRadius);if(s)for(_=0;_<h.length;_++)O=T(r,h[_],w,l),O.geometry=E.scaleToGeodeticHeightExtruded(O.geometry,i,o,r,l),M.push(O);else for(_=0;_<h.length;_++)O=v(r,h[_],w,l),O.geometry=p.scaleToGeodeticHeight(O.geometry,i,r,!l),M.push(O);O=f.combineInstances(M)[0];var x=e.fromVertices(O.attributes.position.values);return new u({attributes:O.attributes,indices:O.indices,primitiveType:O.primitiveType,boundingSphere:x})}},R}),define("Workers/createPolygonOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolygonOutlineGeometry"],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/Workers/createPolylineGeometry.js b/Workers/createPolylineGeometry.js index 1f7be47..13e8bac 100644 --- a/Workers/createPolylineGeometry.js +++ b/Workers/createPolylineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +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";var t=function(t){return void 0!==t};return t}),define("Core/freezeObject",["./defined"],function(t){"use strict";var r=Object.freeze;return t(r)||(r=function(t){return t}),r}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";var r=function(t,r){return void 0!==t?t:r};return r.EMPTY_OBJECT=t({}),r}),define("Core/DeveloperError",["./defined"],function(t){"use strict";var r=function(t){this.name="DeveloperError",this.message=t;var r;try{throw new Error}catch(e){r=e.stack}this.stack=r};return r.prototype.toString=function(){var r=this.name+": "+this.message;return t(this.stack)&&(r+="\n"+this.stack.toString()),r},r.throwInstantiationError=function(){throw new r("This function defines an interface and should not be called directly.")},r}),define("ThirdParty/mersenne-twister",[],function(){var 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,r=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var e;for(this.mti==this.N+1&&this.init_genrand(5489),e=0;e<this.N-this.M;e++)t=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+this.M]^t>>>1^r[1&t];for(;e<this.N-1;e++)t=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+(this.M-this.N)]^t>>>1^r[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^r[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=2636928640&t<<7,t^=4022730752&t<<15,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,r){"use strict";var e={};e.EPSILON1=.1,e.EPSILON2=.01,e.EPSILON3=.001,e.EPSILON4=1e-4,e.EPSILON5=1e-5,e.EPSILON6=1e-6,e.EPSILON7=1e-7,e.EPSILON8=1e-8,e.EPSILON9=1e-9,e.EPSILON10=1e-10,e.EPSILON11=1e-11,e.EPSILON12=1e-12,e.EPSILON13=1e-13,e.EPSILON14=1e-14,e.EPSILON15=1e-15,e.EPSILON16=1e-16,e.EPSILON17=1e-17,e.EPSILON18=1e-18,e.EPSILON19=1e-19,e.EPSILON20=1e-20,e.GRAVITATIONALPARAMETER=3986004418e5,e.SOLAR_RADIUS=6955e5,e.LUNAR_RADIUS=1737400,e.SIXTY_FOUR_KILOBYTES=65536,e.sign=function(t){return t>0?1:0>t?-1:0},e.signNotZero=function(t){return 0>t?-1:1},e.toSNorm=function(t){return Math.round(255*(.5*e.clamp(t,-1,1)+.5))},e.fromSNorm=function(t){return 2*(e.clamp(t,0,255)/255)-1},e.sinh=function(t){var r=Math.pow(Math.E,t),e=Math.pow(Math.E,-1*t);return.5*(r-e)},e.cosh=function(t){var r=Math.pow(Math.E,t),e=Math.pow(Math.E,-1*t);return.5*(r+e)},e.lerp=function(t,r,e){return(1-e)*t+e*r},e.PI=Math.PI,e.ONE_OVER_PI=1/Math.PI,e.PI_OVER_TWO=.5*Math.PI,e.PI_OVER_THREE=Math.PI/3,e.PI_OVER_FOUR=Math.PI/4,e.PI_OVER_SIX=Math.PI/6,e.THREE_PI_OVER_TWO=.5*3*Math.PI,e.TWO_PI=2*Math.PI,e.ONE_OVER_TWO_PI=1/(2*Math.PI),e.RADIANS_PER_DEGREE=Math.PI/180,e.DEGREES_PER_RADIAN=180/Math.PI,e.RADIANS_PER_ARCSECOND=e.RADIANS_PER_DEGREE/3600,e.toRadians=function(t){return t*e.RADIANS_PER_DEGREE},e.toDegrees=function(t){return t*e.DEGREES_PER_RADIAN},e.convertLongitudeRange=function(t){var r=e.TWO_PI,n=t-Math.floor(t/r)*r;return n<-Math.PI?n+r:n>=Math.PI?n-r:n},e.negativePiToPi=function(t){for(var r=e.EPSILON10,n=e.PI,o=e.TWO_PI;-(n+r)>t;)t+=o;if(-n>t)return-n;for(;t>n+r;)t-=o;return t>n?n:t},e.zeroToTwoPi=function(t){var r=t%e.TWO_PI;return 0>r?(r+e.TWO_PI)%e.TWO_PI:r},e.equalsEpsilon=function(t,e,n){return n=r(n,0),Math.abs(t-e)<=n};var n=[1];e.factorial=function(t){var r=n.length;if(t>=r)for(var e=n[r-1],o=r;t>=o;o++)n.push(e*o);return n[t]},e.incrementWrap=function(t,e,n){return n=r(n,0),++t,t>e&&(t=n),t},e.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},e.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},e.clamp=function(t,r,e){return r>t?r:t>e?e:t};var o=new t;return e.setRandomNumberSeed=function(r){o=new t(r)},e.nextRandomNumber=function(){return o.random()},e.acosClamped=function(t){return Math.acos(e.clamp(t,-1,1))},e.asinClamped=function(t){return Math.asin(e.clamp(t,-1,1))},e}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,r,e,n,o){"use strict";var i=function(r,e,n){this.x=t(r,0),this.y=t(e,0),this.z=t(n,0)};i.fromSpherical=function(e,n){r(n)||(n=new i);var o=e.clock,a=e.cone,s=t(e.magnitude,1),u=s*Math.sin(a);return n.x=u*Math.cos(o),n.y=u*Math.sin(o),n.z=s*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){return r(t)?r(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new i(t.x,t.y,t.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(r,e,n){n=t(n,0),e[n++]=r.x,e[n++]=r.y,e[n]=r.z},i.unpack=function(e,n,o){return n=t(n,0),r(o)||(o=new i),o.x=e[n++],o.y=e[n++],o.z=e[n],o},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,r,e){return e.x=Math.min(t.x,r.x),e.y=Math.min(t.y,r.y),e.z=Math.min(t.z,r.z),e},i.maximumByComponent=function(t,r,e){return e.x=Math.max(t.x,r.x),e.y=Math.max(t.y,r.y),e.z=Math.max(t.z,r.z),e},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 a=new i;i.distance=function(t,r){return i.subtract(t,r,a),i.magnitude(a)},i.normalize=function(t,r){var e=i.magnitude(t);return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r},i.dot=function(t,r){return t.x*r.x+t.y*r.y+t.z*r.z},i.multiplyComponents=function(t,r,e){return e.x=t.x*r.x,e.y=t.y*r.y,e.z=t.z*r.z,e},i.add=function(t,r,e){return e.x=t.x+r.x,e.y=t.y+r.y,e.z=t.z+r.z,e},i.subtract=function(t,r,e){return e.x=t.x-r.x,e.y=t.y-r.y,e.z=t.z-r.z,e},i.multiplyByScalar=function(t,r,e){return e.x=t.x*r,e.y=t.y*r,e.z=t.z*r,e},i.divideByScalar=function(t,r,e){return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e},i.negate=function(t,r){return r.x=-t.x,r.y=-t.y,r.z=-t.z,r},i.abs=function(t,r){return r.x=Math.abs(t.x),r.y=Math.abs(t.y),r.z=Math.abs(t.z),r};var s=new i;i.lerp=function(t,r,e,n){return i.multiplyByScalar(r,e,s),n=i.multiplyByScalar(t,1-e,n),i.add(s,n,n)};var u=new i,l=new i;i.angleBetween=function(t,r){i.normalize(t,u),i.normalize(r,l);var e=i.dot(u,l),n=i.magnitude(i.cross(u,l,u));return Math.atan2(n,e)};var c=new i;i.mostOrthogonalAxis=function(t,r){var e=i.normalize(t,c);return i.abs(e,e),r=e.x<=e.y?e.x<=e.z?i.clone(i.UNIT_X,r):i.clone(i.UNIT_Z,r):e.y<=e.z?i.clone(i.UNIT_Y,r):i.clone(i.UNIT_Z,r)},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.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.x-e.x)<=n&&Math.abs(t.y-e.y)<=n&&Math.abs(t.z-e.z)<=n},i.cross=function(t,r,e){var n=t.x,o=t.y,i=t.z,a=r.x,s=r.y,u=r.z,l=o*u-i*s,c=i*a-n*u,f=n*s-o*a;return e.x=l,e.y=c,e.z=f,e},i.fromDegrees=function(t,r,e,n,a){var s=o.toRadians(t),u=o.toRadians(r);return i.fromRadians(s,u,e,n,a)};var f=new i,h=new i,d=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(e,n,o,a,s){o=t(o,0);var u=r(a)?a.radiiSquared:d,l=Math.cos(n);f.x=l*Math.cos(e),f.y=l*Math.sin(e),f.z=Math.sin(n),f=i.normalize(f,f),i.multiplyComponents(u,f,h);var c=Math.sqrt(i.dot(f,h));return h=i.divideByScalar(h,c,h),f=i.multiplyByScalar(f,o,f),r(s)||(s=new i),i.add(h,f,s)},i.fromDegreesArray=function(t,r,e){for(var n=new Array(t.length),a=0;a<t.length;a++)n[a]=o.toRadians(t[a]);return i.fromRadiansArray(n,r,e)},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;o>a;a+=2){var s=t[a],u=t[a+1];n[a/2]=i.fromRadians(s,u,0,e,n[a/2])}return n},i.fromDegreesArrayHeights=function(t,r,e){for(var n=new Array(t.length),a=0;a<t.length;a+=3)n[a]=o.toRadians(t[a]),n[a+1]=o.toRadians(t[a+1]),n[a+2]=t[a+2];return i.fromRadiansArrayHeights(n,r,e)},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;o>a;a+=3){var s=t[a],u=t[a+1],l=t[a+2];n[a/3]=i.fromRadians(s,u,l,e,n[a/3])}return n},i.ZERO=n(new i(0,0,0)),i.UNIT_X=n(new i(1,0,0)),i.UNIT_Y=n(new i(0,1,0)),i.UNIT_Z=n(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,r){return i.equalsEpsilon(this,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,r,e,n,o){"use strict";var i=function(r,e,n){this.longitude=t(r,0),this.latitude=t(e,0),this.height=t(n,0)};return i.fromRadians=function(e,n,o,a){return o=t(o,0),r(a)?(a.longitude=e,a.latitude=n,a.height=o,a):new i(e,n,o)},i.fromDegrees=function(t,r,e,n){return t=o.toRadians(t),r=o.toRadians(r),i.fromRadians(t,r,e,n)},i.clone=function(t,e){return r(t)?r(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new i(t.longitude,t.latitude,t.height):void 0},i.equals=function(t,e){return t===e||r(t)&&r(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},i.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},i.ZERO=n(new i(0,0,0)),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,r){return i.equalsEpsilon(this,t,r)},i.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},i}),define("Core/defineProperties",["./defined"],function(t){"use strict";var r=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),e=Object.defineProperties;return r&&t(e)||(e=function(t){return t}),e}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,r,e,n,o,i,a,s){"use strict";function u(r,n,o,i){n=e(n,0),o=e(o,0),i=e(i,0),r._radii=new t(n,o,i),r._radiiSquared=new t(n*n,o*o,i*i),r._radiiToTheFourth=new t(n*n*n*n,o*o*o*o,i*i*i*i),r._oneOverRadii=new t(0===n?0:1/n,0===o?0:1/o,0===i?0:1/i),r._oneOverRadiiSquared=new t(0===n?0:1/(n*n),0===o?0:1/(o*o),0===i?0:1/(i*i)),r._minimumRadius=Math.min(n,o,i),r._maximumRadius=Math.max(n,o,i),r._centerToleranceSquared=s.EPSILON1}var l=function(t,r,e){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,u(this,t,r,e)};o(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(r,e){if(!n(r))return void 0;var o=r._radii;return n(e)?(t.clone(o,e._radii),t.clone(r._radiiSquared,e._radiiSquared),t.clone(r._radiiToTheFourth,e._radiiToTheFourth),t.clone(r._oneOverRadii,e._oneOverRadii),t.clone(r._oneOverRadiiSquared,e._oneOverRadiiSquared),e._minimumRadius=r._minimumRadius,e._maximumRadius=r._maximumRadius,e._centerToleranceSquared=r._centerToleranceSquared,e):new l(o.x,o.y,o.z)},l.fromCartesian3=function(t,r){return n(r)||(r=new l),n(t)?(u(r,t.x,t.y,t.z),r):r},l.WGS84=a(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=a(new l(1,1,1)),l.MOON=a(new l(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),l.prototype.clone=function(t){return l.clone(this,t)},l.prototype.geocentricSurfaceNormal=t.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(r,e){var o=r.longitude,i=r.latitude,a=Math.cos(i),s=a*Math.cos(o),u=a*Math.sin(o),l=Math.sin(i);return n(e)||(e=new t),e.x=s,e.y=u,e.z=l,t.normalize(e,e)},l.prototype.geodeticSurfaceNormal=function(r,e){return n(e)||(e=new t),e=t.multiplyComponents(r,this._oneOverRadiiSquared,e),t.normalize(e,e)};var c=new t,f=new t;l.prototype.cartographicToCartesian=function(r,e){var o=c,i=f;this.geodeticSurfaceNormalCartographic(r,o),t.multiplyComponents(this._radiiSquared,o,i);var a=Math.sqrt(t.dot(o,i));return t.divideByScalar(i,a,i),t.multiplyByScalar(o,r.height,o),n(e)||(e=new t),t.add(i,o,e)},l.prototype.cartographicArrayToCartesianArray=function(t,r){var e=t.length;n(r)?r.length=e:r=new Array(e);for(var o=0;e>o;o++)r[o]=this.cartographicToCartesian(t[o],r[o]);return r};var h=new t,d=new t,m=new t;l.prototype.cartesianToCartographic=function(e,o){var i=this.scaleToGeodeticSurface(e,d);if(!n(i))return void 0;var a=this.geodeticSurfaceNormal(i,h),u=t.subtract(e,i,m),l=Math.atan2(a.y,a.x),c=Math.asin(a.z),f=s.sign(t.dot(u,e))*t.magnitude(u);return n(o)?(o.longitude=l,o.latitude=c,o.height=f,o):new r(l,c,f)},l.prototype.cartesianArrayToCartographicArray=function(t,r){var e=t.length;n(r)?r.length=e:r=new Array(e);for(var o=0;e>o;++o)r[o]=this.cartesianToCartographic(t[o],r[o]);return r};var p=new t,g=new t;return l.prototype.scaleToGeodeticSurface=function(r,e){var o=r.x,i=r.y,a=r.z,u=this._oneOverRadii,l=u.x,c=u.y,f=u.z,h=o*o*l*l,d=i*i*c*c,m=a*a*f*f,E=h+d+m,y=Math.sqrt(1/E),v=t.multiplyByScalar(r,y,p);if(E<this._centerToleranceSquared)return isFinite(y)?t.clone(v,e):void 0;var C=this._oneOverRadiiSquared,S=C.x,w=C.y,M=C.z,R=g;R.x=2*v.x*S,R.y=2*v.y*w,R.z=2*v.z*M;var A,O,T,N,I,x,F,_,b,L,D,P=(1-y)*t.magnitude(r)/(.5*t.magnitude(R)),z=0;do{P-=z,T=1/(1+P*S),N=1/(1+P*w),I=1/(1+P*M),x=T*T,F=N*N,_=I*I,b=x*T,L=F*N,D=_*I,A=h*x+d*F+m*_-1,O=h*b*S+d*L*w+m*D*M;var B=-2*O;z=A/B}while(Math.abs(A)>s.EPSILON12);return n(e)?(e.x=o*T,e.y=i*N,e.z=a*I,e):new t(o*T,i*N,a*I)},l.prototype.scaleToGeocentricSurface=function(r,e){n(e)||(e=new t);var o=r.x,i=r.y,a=r.z,s=this._oneOverRadiiSquared,u=1/Math.sqrt(o*o*s.x+i*i*s.y+a*a*s.z);return t.multiplyByScalar(r,u,e)},l.prototype.transformPositionToScaledSpace=function(r,e){return n(e)||(e=new t),t.multiplyComponents(r,this._oneOverRadii,e)},l.prototype.transformPositionFromScaledSpace=function(r,e){return n(e)||(e=new t),t.multiplyComponents(r,this._radii,e)},l.prototype.equals=function(r){return this===r||n(r)&&t.equals(this._radii,r._radii)},l.prototype.toString=function(){return this._radii.toString()},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,r,e,n,o,i,a){"use strict";var s=function(t){this._ellipsoid=e(t,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return o(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.prototype.project=function(r,e){var o=this._semimajorAxis,i=r.longitude*o,a=r.latitude*o,s=r.height;return n(e)?(e.x=i,e.y=a,e.z=s,e):new t(i,a,s)},s.prototype.unproject=function(t,e){var o=this._oneOverSemimajorAxis,i=t.x*o,a=t.y*o,s=t.z;return n(e)?(e.longitude=i,e.latitude=a,e.height=s,e):new r(i,a,s)},s}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var r={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(r)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";var r=function(r,e){this.start=t(r,0),this.stop=t(e,0)};return r}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,r,e,n){"use strict";var o=function(r,e,n,o){this.x=t(r,0),this.y=t(e,0),this.z=t(n,0),this.w=t(o,0)};o.fromElements=function(t,e,n,i,a){return r(a)?(a.x=t,a.y=e,a.z=n,a.w=i,a):new o(t,e,n,i)},o.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 o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){return r(t)?r(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):void 0},o.packedLength=4,o.pack=function(r,e,n){n=t(n,0),e[n++]=r.x,e[n++]=r.y,e[n++]=r.z,e[n]=r.w},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.w=e[n],i},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,r,e){return e.x=Math.min(t.x,r.x),e.y=Math.min(t.y,r.y),e.z=Math.min(t.z,r.z),e.w=Math.min(t.w,r.w),e},o.maximumByComponent=function(t,r,e){return e.x=Math.max(t.x,r.x),e.y=Math.max(t.y,r.y),e.z=Math.max(t.z,r.z),e.w=Math.max(t.w,r.w),e},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,r){return o.subtract(t,r,i),o.magnitude(i)},o.normalize=function(t,r){var e=o.magnitude(t);return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r.w=t.w/e,r},o.dot=function(t,r){return t.x*r.x+t.y*r.y+t.z*r.z+t.w*r.w},o.multiplyComponents=function(t,r,e){return e.x=t.x*r.x,e.y=t.y*r.y,e.z=t.z*r.z,e.w=t.w*r.w,e},o.add=function(t,r,e){return e.x=t.x+r.x,e.y=t.y+r.y,e.z=t.z+r.z,e.w=t.w+r.w,e},o.subtract=function(t,r,e){return e.x=t.x-r.x,e.y=t.y-r.y,e.z=t.z-r.z,e.w=t.w-r.w,e},o.multiplyByScalar=function(t,r,e){return e.x=t.x*r,e.y=t.y*r,e.z=t.z*r,e.w=t.w*r,e},o.divideByScalar=function(t,r,e){return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e.w=t.w/r,e},o.negate=function(t,r){return r.x=-t.x,r.y=-t.y,r.z=-t.z,r.w=-t.w,r},o.abs=function(t,r){return r.x=Math.abs(t.x),r.y=Math.abs(t.y),r.z=Math.abs(t.z),r.w=Math.abs(t.w),r};var a=new o;o.lerp=function(t,r,e,n){return o.multiplyByScalar(r,e,a),n=o.multiplyByScalar(t,1-e,n),o.add(a,n,n)};var s=new o;return o.mostOrthogonalAxis=function(t,r){var e=o.normalize(t,s);return o.abs(e,e),r=e.x<=e.y?e.x<=e.z?e.x<=e.w?o.clone(o.UNIT_X,r):o.clone(o.UNIT_W,r):e.z<=e.w?o.clone(o.UNIT_Z,r):o.clone(o.UNIT_W,r):e.y<=e.z?e.y<=e.w?o.clone(o.UNIT_Y,r):o.clone(o.UNIT_W,r):e.z<=e.w?o.clone(o.UNIT_Z,r):o.clone(o.UNIT_W,r)},o.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},o.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.x-e.x)<=n&&Math.abs(t.y-e.y)<=n&&Math.abs(t.z-e.z)<=n&&Math.abs(t.w-e.w)<=n},o.ZERO=n(new o(0,0,0,0)),o.UNIT_X=n(new o(1,0,0,0)),o.UNIT_Y=n(new o(0,1,0,0)),o.UNIT_Z=n(new o(0,0,1,0)),o.UNIT_W=n(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,r){return o.equalsEpsilon(this,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,r,e,n,o,i){"use strict";function a(t){for(var r=0,e=0;9>e;++e){var n=t[e];r+=n*n}return Math.sqrt(r)}function s(t){for(var r=0,e=0;3>e;++e){var n=t[l.getElementIndex(d[e],h[e])];r+=2*n*n}return Math.sqrt(r)}function u(t,r){for(var e=i.EPSILON15,n=0,o=1,a=0;3>a;++a){var s=Math.abs(t[l.getElementIndex(d[a],h[a])]);s>n&&(o=a,n=s)}var u=1,c=0,f=h[o],m=d[o];if(Math.abs(t[l.getElementIndex(m,f)])>e){var p,g=t[l.getElementIndex(m,m)],E=t[l.getElementIndex(f,f)],y=t[l.getElementIndex(m,f)],v=(g-E)/2/y;p=0>v?-1/(-v+Math.sqrt(1+v*v)):1/(v+Math.sqrt(1+v*v)),u=1/Math.sqrt(1+p*p),c=p*u}return r=l.clone(l.IDENTITY,r),r[l.getElementIndex(f,f)]=r[l.getElementIndex(m,m)]=u,r[l.getElementIndex(m,f)]=c,r[l.getElementIndex(f,m)]=-c,r}var l=function(t,e,n,o,i,a,s,u,l){this[0]=r(t,0),this[1]=r(o,0),this[2]=r(s,0),this[3]=r(e,0),this[4]=r(i,0),this[5]=r(u,0),this[6]=r(n,0),this[7]=r(a,0),this[8]=r(l,0)};l.clone=function(t,r){return e(t)?e(r)?(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):new l(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},l.fromArray=function(t,n,o){return n=r(n,0),e(o)||(o=new l),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},l.fromColumnMajorArray=function(t,r){return l.clone(t,r)},l.fromRowMajorArray=function(t,r){return e(r)?(r[0]=t[0],r[1]=t[3],r[2]=t[6],r[3]=t[1],r[4]=t[4],r[5]=t[7],r[6]=t[2],r[7]=t[5],r[8]=t[8],r):new l(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},l.fromQuaternion=function(t,r){var n=t.x*t.x,o=t.x*t.y,i=t.x*t.z,a=t.x*t.w,s=t.y*t.y,u=t.y*t.z,c=t.y*t.w,f=t.z*t.z,h=t.z*t.w,d=t.w*t.w,m=n-s-f+d,p=2*(o-h),g=2*(i+c),E=2*(o+h),y=-n+s-f+d,v=2*(u-a),C=2*(i-c),S=2*(u+a),w=-n-s+f+d;return e(r)?(r[0]=m,r[1]=E,r[2]=C,r[3]=p,r[4]=y,r[5]=S,r[6]=g,r[7]=v,r[8]=w,r):new l(m,p,g,E,y,v,C,S,w)},l.fromScale=function(t,r){return e(r)?(r[0]=t.x,r[1]=0,r[2]=0,r[3]=0,r[4]=t.y,r[5]=0,r[6]=0,r[7]=0,r[8]=t.z,r):new l(t.x,0,0,0,t.y,0,0,0,t.z)},l.fromUniformScale=function(t,r){return e(r)?(r[0]=t,r[1]=0,r[2]=0,r[3]=0,r[4]=t,r[5]=0,r[6]=0,r[7]=0,r[8]=t,r):new l(t,0,0,0,t,0,0,0,t)},l.fromCrossProduct=function(t,r){return e(r)?(r[0]=0,r[1]=t.z,r[2]=-t.y,r[3]=-t.z,r[4]=0,r[5]=t.x,r[6]=t.y,r[7]=-t.x,r[8]=0,r):new l(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},l.fromRotationX=function(t,r){var n=Math.cos(t),o=Math.sin(t);return e(r)?(r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=n,r[5]=o,r[6]=0,r[7]=-o,r[8]=n,r):new l(1,0,0,0,n,-o,0,o,n)},l.fromRotationY=function(t,r){var n=Math.cos(t),o=Math.sin(t);return e(r)?(r[0]=n,r[1]=0,r[2]=-o,r[3]=0,r[4]=1,r[5]=0,r[6]=o,r[7]=0,r[8]=n,r):new l(n,0,o,0,1,0,-o,0,n)},l.fromRotationZ=function(t,r){var n=Math.cos(t),o=Math.sin(t);return e(r)?(r[0]=n,r[1]=o,r[2]=0,r[3]=-o,r[4]=n,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r):new l(n,-o,0,o,n,0,0,0,1)},l.toArray=function(t,r){return e(r)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},l.getElementIndex=function(t,r){return 3*t+r},l.getColumn=function(t,r,e){var n=3*r,o=t[n],i=t[n+1],a=t[n+2];return e.x=o,e.y=i,e.z=a,e},l.setColumn=function(t,r,e,n){n=l.clone(t,n);var o=3*r;return n[o]=e.x,n[o+1]=e.y,n[o+2]=e.z,n},l.getRow=function(t,r,e){var n=t[r],o=t[r+3],i=t[r+6];return e.x=n,e.y=o,e.z=i,e},l.setRow=function(t,r,e,n){return n=l.clone(t,n),n[r]=e.x,n[r+3]=e.y,n[r+6]=e.z,n};var c=new t;l.getScale=function(r,e){return e.x=t.magnitude(t.fromElements(r[0],r[1],r[2],c)),e.y=t.magnitude(t.fromElements(r[3],r[4],r[5],c)),e.z=t.magnitude(t.fromElements(r[6],r[7],r[8],c)),e};var f=new t;l.getMaximumScale=function(r){return l.getScale(r,f),t.maximumComponent(f)},l.multiply=function(t,r,e){var n=t[0]*r[0]+t[3]*r[1]+t[6]*r[2],o=t[1]*r[0]+t[4]*r[1]+t[7]*r[2],i=t[2]*r[0]+t[5]*r[1]+t[8]*r[2],a=t[0]*r[3]+t[3]*r[4]+t[6]*r[5],s=t[1]*r[3]+t[4]*r[4]+t[7]*r[5],u=t[2]*r[3]+t[5]*r[4]+t[8]*r[5],l=t[0]*r[6]+t[3]*r[7]+t[6]*r[8],c=t[1]*r[6]+t[4]*r[7]+t[7]*r[8],f=t[2]*r[6]+t[5]*r[7]+t[8]*r[8];return e[0]=n,e[1]=o,e[2]=i,e[3]=a,e[4]=s,e[5]=u,e[6]=l,e[7]=c,e[8]=f,e},l.add=function(t,r,e){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},l.subtract=function(t,r,e){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e},l.multiplyByVector=function(t,r,e){var n=r.x,o=r.y,i=r.z,a=t[0]*n+t[3]*o+t[6]*i,s=t[1]*n+t[4]*o+t[7]*i,u=t[2]*n+t[5]*o+t[8]*i;return e.x=a,e.y=s,e.z=u,e},l.multiplyByScalar=function(t,r,e){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e},l.negate=function(t,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},l.transpose=function(t,r){var e=t[0],n=t[3],o=t[6],i=t[1],a=t[4],s=t[7],u=t[2],l=t[5],c=t[8];return r[0]=e,r[1]=n,r[2]=o,r[3]=i,r[4]=a,r[5]=s,r[6]=u,r[7]=l,r[8]=c,r};var h=[1,0,0],d=[2,2,1],m=new l,p=new l;return l.computeEigenDecomposition=function(t,r){var n=i.EPSILON20,o=10,c=0,f=0;e(r)||(r={});for(var h=r.unitary=l.clone(l.IDENTITY,r.unitary),d=r.diagonal=l.clone(t,r.diagonal),g=n*a(d);o>f&&s(d)>g;)u(d,m),l.transpose(m,p),l.multiply(d,m,d),l.multiply(p,d,d),l.multiply(h,m,h),++c>2&&(++f,c=0);return r},l.abs=function(t,r){return r[0]=Math.abs(t[0]),r[1]=Math.abs(t[1]),r[2]=Math.abs(t[2]),r[3]=Math.abs(t[3]),r[4]=Math.abs(t[4]),r[5]=Math.abs(t[5]),r[6]=Math.abs(t[6]),r[7]=Math.abs(t[7]),r[8]=Math.abs(t[8]),r},l.determinant=function(t){var r=t[0],e=t[3],n=t[6],o=t[1],i=t[4],a=t[7],s=t[2],u=t[5],l=t[8];return r*(i*l-u*a)+o*(u*n-e*l)+s*(e*a-i*n)},l.inverse=function(t,r){var e=t[0],o=t[1],a=t[2],s=t[3],u=t[4],c=t[5],f=t[6],h=t[7],d=t[8],m=l.determinant(t);if(Math.abs(m)<=i.EPSILON15)throw new n("matrix is not invertible");r[0]=u*d-h*c,r[1]=h*a-o*d,r[2]=o*c-u*a,r[3]=f*c-s*d,r[4]=e*d-f*a,r[5]=s*a-e*c,r[6]=s*h-f*u,r[7]=f*o-e*h,r[8]=e*u-s*o;var p=1/m;return l.multiplyByScalar(r,p,r)},l.equals=function(t,r){return t===r||e(t)&&e(r)&&t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]&&t[3]===r[3]&&t[4]===r[4]&&t[5]===r[5]&&t[6]===r[6]&&t[7]===r[7]&&t[8]===r[8]},l.equalsEpsilon=function(t,r,n){return t===r||e(t)&&e(r)&&Math.abs(t[0]-r[0])<=n&&Math.abs(t[1]-r[1])<=n&&Math.abs(t[2]-r[2])<=n&&Math.abs(t[3]-r[3])<=n&&Math.abs(t[4]-r[4])<=n&&Math.abs(t[5]-r[5])<=n&&Math.abs(t[6]-r[6])<=n&&Math.abs(t[7]-r[7])<=n&&Math.abs(t[8]-r[8])<=n},l.IDENTITY=o(new l(1,0,0,0,1,0,0,0,1)),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,l.prototype.clone=function(t){return l.clone(this,t)},l.prototype.equals=function(t){return l.equals(this,t)},l.prototype.equalsEpsilon=function(t,r){return l.equalsEpsilon(this,t,r)},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}),define("Core/RuntimeError",["./defined"],function(t){"use strict";var r=function(t){this.name="RuntimeError",this.message=t;var r;try{throw new Error}catch(e){r=e.stack}this.stack=r};return r.prototype.toString=function(){var r=this.name+": "+this.message;return t(this.stack)&&(r+="\n"+this.stack.toString()),r},r}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,r,e,n,o,i,a,s,u){"use strict";var l=function(t,r,n,o,i,a,s,u,l,c,f,h,d,m,p,g){this[0]=e(t,0),this[1]=e(i,0),this[2]=e(l,0),this[3]=e(d,0),this[4]=e(r,0),this[5]=e(a,0),this[6]=e(c,0),this[7]=e(m,0),this[8]=e(n,0),this[9]=e(s,0),this[10]=e(f,0),this[11]=e(p,0),this[12]=e(o,0),this[13]=e(u,0),this[14]=e(h,0),this[15]=e(g,0)};l.packedLength=16,l.pack=function(t,r,n){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[n++]=t[9],r[n++]=t[10],r[n++]=t[11],r[n++]=t[12],r[n++]=t[13],r[n++]=t[14],r[n]=t[15]},l.unpack=function(t,r,o){return r=e(r,0),n(o)||(o=new l),o[0]=t[r++],o[1]=t[r++],o[2]=t[r++],o[3]=t[r++],o[4]=t[r++],o[5]=t[r++],o[6]=t[r++],o[7]=t[r++],o[8]=t[r++],o[9]=t[r++],o[10]=t[r++],o[11]=t[r++],o[12]=t[r++],o[13]=t[r++],o[14]=t[r++],o[15]=t[r],o},l.clone=function(t,r){return n(t)?n(r)?(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]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r):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]):void 0},l.fromArray=l.unpack,l.fromColumnMajorArray=function(t,r){return l.clone(t,r)},l.fromRowMajorArray=function(t,r){return n(r)?(r[0]=t[0],r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=t[1],r[5]=t[5],r[6]=t[9],r[7]=t[13],r[8]=t[2],r[9]=t[6],r[10]=t[10],r[11]=t[14],r[12]=t[3],r[13]=t[7],r[14]=t[11],r[15]=t[15],r):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(r,o,i){return o=e(o,t.ZERO),n(i)?(i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=0,i[4]=r[3],i[5]=r[4],i[6]=r[5],i[7]=0,i[8]=r[6],i[9]=r[7],i[10]=r[8],i[11]=0,i[12]=o.x,i[13]=o.y,i[14]=o.z,i[15]=1,i):new l(r[0],r[3],r[6],o.x,r[1],r[4],r[7],o.y,r[2],r[5],r[8],o.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(t,r,e,o){n(o)||(o=new l);var i=e.x,a=e.y,s=e.z,u=r.x*r.x,c=r.x*r.y,f=r.x*r.z,h=r.x*r.w,d=r.y*r.y,m=r.y*r.z,p=r.y*r.w,g=r.z*r.z,E=r.z*r.w,y=r.w*r.w,v=u-d-g+y,C=2*(c-E),S=2*(f+p),w=2*(c+E),M=-u+d-g+y,R=2*(m-h),A=2*(f-p),O=2*(m+h),T=-u-d+g+y;return o[0]=v*i,o[1]=w*i,o[2]=A*i,o[3]=0,o[4]=C*a,o[5]=M*a,o[6]=O*a,o[7]=0,o[8]=S*s,o[9]=R*s,o[10]=T*s,o[11]=0,o[12]=t.x,o[13]=t.y,o[14]=t.z,o[15]=1,o},l.fromTranslation=function(t,r){return l.fromRotationTranslation(s.IDENTITY,t,r)},l.fromScale=function(t,r){return n(r)?(r[0]=t.x,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t.y,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=t.z,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r):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,r){return n(r)?(r[0]=t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=t,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r):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,h=new t;l.fromCamera=function(r,e){var o=r.eye,i=r.target,a=r.up;t.normalize(t.subtract(i,o,c),c),t.normalize(t.cross(c,a,f),f),t.normalize(t.cross(f,c,h),h);var s=f.x,u=f.y,d=f.z,m=c.x,p=c.y,g=c.z,E=h.x,y=h.y,v=h.z,C=o.x,S=o.y,w=o.z,M=s*-C+u*-S+d*-w,R=E*-C+y*-S+v*-w,A=m*C+p*S+g*w;return n(e)?(e[0]=s,e[1]=E,e[2]=-m,e[3]=0,e[4]=u,e[5]=y,e[6]=-p,e[7]=0,e[8]=d,e[9]=v,e[10]=-g,e[11]=0,e[12]=M,e[13]=R,e[14]=A,e[15]=1,e):new l(s,u,d,M,E,y,v,R,-m,-p,-g,A,0,0,0,1)},l.computePerspectiveFieldOfView=function(t,r,e,n,o){var i=Math.tan(.5*t),a=1/i,s=a/r,u=(n+e)/(e-n),l=2*n*e/(e-n);return o[0]=s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=u,o[11]=-1,o[12]=0,o[13]=0,o[14]=l,o[15]=0,o},l.computeOrthographicOffCenter=function(t,r,e,n,o,i,a){var s=1/(r-t),u=1/(n-e),l=1/(i-o),c=-(r+t)*s,f=-(n+e)*u,h=-(i+o)*l;return s*=2,u*=2,l*=-2,a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=l,a[11]=0,a[12]=c,a[13]=f,a[14]=h,a[15]=1,a},l.computePerspectiveOffCenter=function(t,r,e,n,o,i,a){var s=2*o/(r-t),u=2*o/(n-e),l=(r+t)/(r-t),c=(n+e)/(n-e),f=-(i+o)/(i-o),h=-1,d=-2*i*o/(i-o);return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=l,a[9]=c,a[10]=f,a[11]=h,a[12]=0,a[13]=0,a[14]=d,a[15]=0,a},l.computeInfinitePerspectiveOffCenter=function(t,r,e,n,o,i){var a=2*o/(r-t),s=2*o/(n-e),u=(r+t)/(r-t),l=(n+e)/(n-e),c=-1,f=-1,h=-2*o;return i[0]=a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=u,i[9]=l,i[10]=c,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},l.computeViewportTransformation=function(t,r,n,o){t=e(t,e.EMPTY_OBJECT);var i=e(t.x,0),a=e(t.y,0),s=e(t.width,0),u=e(t.height,0);r=e(r,0),n=e(n,1);var l=.5*s,c=.5*u,f=.5*(n-r),h=l,d=c,m=f,p=i+l,g=a+c,E=r+f,y=1;return o[0]=h,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=d,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=m,o[11]=0,o[12]=p,o[13]=g,o[14]=E,o[15]=y,o},l.toArray=function(t,r){return n(r)?(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]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r):[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,r){return 4*t+r},l.getColumn=function(t,r,e){var n=4*r,o=t[n],i=t[n+1],a=t[n+2],s=t[n+3];return e.x=o,e.y=i,e.z=a,e.w=s,e},l.setColumn=function(t,r,e,n){n=l.clone(t,n);var o=4*r;return n[o]=e.x,n[o+1]=e.y,n[o+2]=e.z,n[o+3]=e.w,n},l.getRow=function(t,r,e){var n=t[r],o=t[r+4],i=t[r+8],a=t[r+12];return e.x=n,e.y=o,e.z=i,e.w=a,e},l.setRow=function(t,r,e,n){return n=l.clone(t,n),n[r]=e.x,n[r+4]=e.y,n[r+8]=e.z,n[r+12]=e.w,n -};var d=new t;l.getScale=function(r,e){return e.x=t.magnitude(t.fromElements(r[0],r[1],r[2],d)),e.y=t.magnitude(t.fromElements(r[4],r[5],r[6],d)),e.z=t.magnitude(t.fromElements(r[8],r[9],r[10],d)),e};var m=new t;l.getMaximumScale=function(r){return l.getScale(r,m),t.maximumComponent(m)},l.multiply=function(t,r,e){var n=t[0],o=t[1],i=t[2],a=t[3],s=t[4],u=t[5],l=t[6],c=t[7],f=t[8],h=t[9],d=t[10],m=t[11],p=t[12],g=t[13],E=t[14],y=t[15],v=r[0],C=r[1],S=r[2],w=r[3],M=r[4],R=r[5],A=r[6],O=r[7],T=r[8],N=r[9],I=r[10],x=r[11],F=r[12],_=r[13],b=r[14],L=r[15],D=n*v+s*C+f*S+p*w,P=o*v+u*C+h*S+g*w,z=i*v+l*C+d*S+E*w,B=a*v+c*C+m*S+y*w,U=n*M+s*R+f*A+p*O,q=o*M+u*R+h*A+g*O,G=i*M+l*R+d*A+E*O,W=a*M+c*R+m*A+y*O,Y=n*T+s*N+f*I+p*x,H=o*T+u*N+h*I+g*x,V=i*T+l*N+d*I+E*x,K=a*T+c*N+m*I+y*x,k=n*F+s*_+f*b+p*L,j=o*F+u*_+h*b+g*L,Z=i*F+l*_+d*b+E*L,Q=a*F+c*_+m*b+y*L;return e[0]=D,e[1]=P,e[2]=z,e[3]=B,e[4]=U,e[5]=q,e[6]=G,e[7]=W,e[8]=Y,e[9]=H,e[10]=V,e[11]=K,e[12]=k,e[13]=j,e[14]=Z,e[15]=Q,e},l.add=function(t,r,e){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e},l.subtract=function(t,r,e){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e},l.multiplyTransformation=function(t,r,e){var n=t[0],o=t[1],i=t[2],a=t[4],s=t[5],u=t[6],l=t[8],c=t[9],f=t[10],h=t[12],d=t[13],m=t[14],p=r[0],g=r[1],E=r[2],y=r[4],v=r[5],C=r[6],S=r[8],w=r[9],M=r[10],R=r[12],A=r[13],O=r[14],T=n*p+a*g+l*E,N=o*p+s*g+c*E,I=i*p+u*g+f*E,x=n*y+a*v+l*C,F=o*y+s*v+c*C,_=i*y+u*v+f*C,b=n*S+a*w+l*M,L=o*S+s*w+c*M,D=i*S+u*w+f*M,P=n*R+a*A+l*O+h,z=o*R+s*A+c*O+d,B=i*R+u*A+f*O+m;return e[0]=T,e[1]=N,e[2]=I,e[3]=0,e[4]=x,e[5]=F,e[6]=_,e[7]=0,e[8]=b,e[9]=L,e[10]=D,e[11]=0,e[12]=P,e[13]=z,e[14]=B,e[15]=1,e},l.multiplyByTranslation=function(t,r,e){var n=r.x,o=r.y,i=r.z,a=n*t[0]+o*t[4]+i*t[8]+t[12],s=n*t[1]+o*t[5]+i*t[9]+t[13],u=n*t[2]+o*t[6]+i*t[10]+t[14];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]=a,e[13]=s,e[14]=u,e[15]=t[15],e};var p=new t;l.multiplyByUniformScale=function(t,r,e){return p.x=r,p.y=r,p.z=r,l.multiplyByScale(t,p,e)},l.multiplyByScale=function(t,r,e){var n=r.x,o=r.y,i=r.z;return 1===n&&1===o&&1===i?l.clone(t,e):(e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=0,e[4]=o*t[4],e[5]=o*t[5],e[6]=o*t[6],e[7]=0,e[8]=i*t[8],e[9]=i*t[9],e[10]=i*t[10],e[11]=0,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=1,e)},l.multiplyByVector=function(t,r,e){var n=r.x,o=r.y,i=r.z,a=r.w,s=t[0]*n+t[4]*o+t[8]*i+t[12]*a,u=t[1]*n+t[5]*o+t[9]*i+t[13]*a,l=t[2]*n+t[6]*o+t[10]*i+t[14]*a,c=t[3]*n+t[7]*o+t[11]*i+t[15]*a;return e.x=s,e.y=u,e.z=l,e.w=c,e},l.multiplyByPointAsVector=function(t,r,e){var n=r.x,o=r.y,i=r.z,a=t[0]*n+t[4]*o+t[8]*i,s=t[1]*n+t[5]*o+t[9]*i,u=t[2]*n+t[6]*o+t[10]*i;return e.x=a,e.y=s,e.z=u,e},l.multiplyByPoint=function(t,r,e){var n=r.x,o=r.y,i=r.z,a=t[0]*n+t[4]*o+t[8]*i+t[12],s=t[1]*n+t[5]*o+t[9]*i+t[13],u=t[2]*n+t[6]*o+t[10]*i+t[14];return e.x=a,e.y=s,e.z=u,e},l.multiplyByScalar=function(t,r,e){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e},l.negate=function(t,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]=-t[12],r[13]=-t[13],r[14]=-t[14],r[15]=-t[15],r},l.transpose=function(t,r){var e=t[1],n=t[2],o=t[3],i=t[6],a=t[7],s=t[11];return r[0]=t[0],r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=e,r[5]=t[5],r[6]=t[9],r[7]=t[13],r[8]=n,r[9]=i,r[10]=t[10],r[11]=t[14],r[12]=o,r[13]=a,r[14]=s,r[15]=t[15],r},l.abs=function(t,r){return r[0]=Math.abs(t[0]),r[1]=Math.abs(t[1]),r[2]=Math.abs(t[2]),r[3]=Math.abs(t[3]),r[4]=Math.abs(t[4]),r[5]=Math.abs(t[5]),r[6]=Math.abs(t[6]),r[7]=Math.abs(t[7]),r[8]=Math.abs(t[8]),r[9]=Math.abs(t[9]),r[10]=Math.abs(t[10]),r[11]=Math.abs(t[11]),r[12]=Math.abs(t[12]),r[13]=Math.abs(t[13]),r[14]=Math.abs(t[14]),r[15]=Math.abs(t[15]),r},l.equals=function(t,r){return t===r||n(t)&&n(r)&&t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]&&t[3]===r[3]&&t[4]===r[4]&&t[5]===r[5]&&t[6]===r[6]&&t[7]===r[7]&&t[8]===r[8]&&t[9]===r[9]&&t[10]===r[10]&&t[11]===r[11]&&t[12]===r[12]&&t[13]===r[13]&&t[14]===r[14]&&t[15]===r[15]},l.equalsEpsilon=function(t,r,e){return t===r||n(t)&&n(r)&&Math.abs(t[0]-r[0])<=e&&Math.abs(t[1]-r[1])<=e&&Math.abs(t[2]-r[2])<=e&&Math.abs(t[3]-r[3])<=e&&Math.abs(t[4]-r[4])<=e&&Math.abs(t[5]-r[5])<=e&&Math.abs(t[6]-r[6])<=e&&Math.abs(t[7]-r[7])<=e&&Math.abs(t[8]-r[8])<=e&&Math.abs(t[9]-r[9])<=e&&Math.abs(t[10]-r[10])<=e&&Math.abs(t[11]-r[11])<=e&&Math.abs(t[12]-r[12])<=e&&Math.abs(t[13]-r[13])<=e&&Math.abs(t[14]-r[14])<=e&&Math.abs(t[15]-r[15])<=e},l.getTranslation=function(t,r){return r.x=t[12],r.y=t[13],r.z=t[14],r},l.getRotation=function(t,r){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[4],r[4]=t[5],r[5]=t[6],r[6]=t[8],r[7]=t[9],r[8]=t[10],r};var g=new s,E=new s,y=new r,v=new r(0,0,0,1);return l.inverse=function(t,e){if(s.equalsEpsilon(l.getRotation(t,g),E,a.EPSILON7)&&r.equals(l.getRow(t,3,y),v))return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=0,e[11]=0,e[12]=-t[12],e[13]=-t[13],e[14]=-t[14],e[15]=1,e;var n=t[0],o=t[4],i=t[8],c=t[12],f=t[1],h=t[5],d=t[9],m=t[13],p=t[2],C=t[6],S=t[10],w=t[14],M=t[3],R=t[7],A=t[11],O=t[15],T=S*O,N=w*A,I=C*O,x=w*R,F=C*A,_=S*R,b=p*O,L=w*M,D=p*A,P=S*M,z=p*R,B=C*M,U=T*h+x*d+F*m-(N*h+I*d+_*m),q=N*f+b*d+P*m-(T*f+L*d+D*m),G=I*f+L*h+z*m-(x*f+b*h+B*m),W=_*f+D*h+B*d-(F*f+P*h+z*d),Y=N*o+I*i+_*c-(T*o+x*i+F*c),H=T*n+L*i+D*c-(N*n+b*i+P*c),V=x*n+b*o+B*c-(I*n+L*o+z*c),K=F*n+P*o+z*i-(_*n+D*o+B*i);T=i*m,N=c*d,I=o*m,x=c*h,F=o*d,_=i*h,b=n*m,L=c*f,D=n*d,P=i*f,z=n*h,B=o*f;var k=T*R+x*A+F*O-(N*R+I*A+_*O),j=N*M+b*A+P*O-(T*M+L*A+D*O),Z=I*M+L*R+z*O-(x*M+b*R+B*O),Q=_*M+D*R+B*A-(F*M+P*R+z*A),X=I*S+_*w+N*C-(F*w+T*C+x*S),J=D*w+T*p+L*S-(b*S+P*w+N*p),$=b*C+B*w+x*p-(z*w+I*p+L*C),tr=z*S+F*p+P*C-(D*C+B*S+_*p),rr=n*U+o*q+i*G+c*W;if(Math.abs(rr)<a.EPSILON20)throw new u("matrix is not invertible because its determinate is zero.");return rr=1/rr,e[0]=U*rr,e[1]=q*rr,e[2]=G*rr,e[3]=W*rr,e[4]=Y*rr,e[5]=H*rr,e[6]=V*rr,e[7]=K*rr,e[8]=k*rr,e[9]=j*rr,e[10]=Z*rr,e[11]=Q*rr,e[12]=X*rr,e[13]=J*rr,e[14]=$*rr,e[15]=tr*rr,e},l.inverseTransformation=function(t,r){var e=t[0],n=t[1],o=t[2],i=t[4],a=t[5],s=t[6],u=t[8],l=t[9],c=t[10],f=t[12],h=t[13],d=t[14],m=-e*f-n*h-o*d,p=-i*f-a*h-s*d,g=-u*f-l*h-c*d;return r[0]=e,r[1]=i,r[2]=u,r[3]=0,r[4]=n,r[5]=a,r[6]=l,r[7]=0,r[8]=o,r[9]=s,r[10]=c,r[11]=0,r[12]=m,r[13]=p,r[14]=g,r[15]=1,r},l.IDENTITY=i(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,l.prototype.clone=function(t){return l.clone(this,t)},l.prototype.equals=function(t){return l.equals(this,t)},l.prototype.equalsEpsilon=function(t,r){return l.equalsEpsilon(this,t,r)},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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,r,e,n,o,i,a){"use strict";var s=function(t,e,n,o){this.west=r(t,0),this.south=r(e,0),this.east=r(n,0),this.north=r(o,0)};s.fromDegrees=function(t,n,o,i,u){return t=a.toRadians(r(t,0)),n=a.toRadians(r(n,0)),o=a.toRadians(r(o,0)),i=a.toRadians(r(i,0)),e(u)?(u.west=t,u.south=n,u.east=o,u.north=i,u):new s(t,n,o,i)},s.fromCartographicArray=function(t,r){for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,a=-Number.MAX_VALUE,u=0,l=t.length;l>u;u++){var c=t[u];n=Math.min(n,c.longitude),o=Math.max(o,c.longitude),i=Math.min(i,c.latitude),a=Math.max(a,c.latitude)}return e(r)?(r.west=n,r.south=i,r.east=o,r.north=a,r):new s(n,i,o,a)},s.packedLength=4,s.pack=function(t,e,n){n=r(n,0),e[n++]=t.west,e[n++]=t.south,e[n++]=t.east,e[n]=t.north},s.unpack=function(t,n,o){return n=r(n,0),e(o)||(o=new s),o.west=t[n++],o.south=t[n++],o.east=t[n++],o.north=t[n],o},s.clone=function(t,r){return e(t)?e(r)?(r.west=t.west,r.south=t.south,r.east=t.east,r.north=t.north,r):new s(t.west,t.south,t.east,t.north):void 0},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equals=function(t,r){return t===r||e(t)&&e(r)&&t.west===r.west&&t.south===r.south&&t.east===r.east&&t.north===r.north},s.prototype.equalsEpsilon=function(t,r){return e(t)&&Math.abs(this.west-t.west)<=r&&Math.abs(this.south-t.south)<=r&&Math.abs(this.east-t.east)<=r&&Math.abs(this.north-t.north)<=r},s.validate=function(){},s.southwest=function(r,n){return e(n)?(n.longitude=r.west,n.latitude=r.south,n.height=0,n):new t(r.west,r.south)},s.northwest=function(r,n){return e(n)?(n.longitude=r.west,n.latitude=r.north,n.height=0,n):new t(r.west,r.north)},s.northeast=function(r,n){return e(n)?(n.longitude=r.east,n.latitude=r.north,n.height=0,n):new t(r.east,r.north)},s.southeast=function(r,n){return e(n)?(n.longitude=r.east,n.latitude=r.south,n.height=0,n):new t(r.east,r.south)},s.center=function(r,n){var o=r.east,i=r.west,s=.5*(i+o);return i>o&&(s=a.negativePiToPi(s+a.PI)),e(n)?(n.longitude=s,n.latitude=.5*(r.south+r.north),n.height=0,n):new t(s,.5*(r.south+r.north))},s.intersectWith=function(t,r,n){var o=Math.max(t.west,r.west),i=Math.max(t.south,r.south),a=Math.min(t.east,r.east),u=Math.min(t.north,r.north);return e(n)?(n.west=o,n.south=i,n.east=a,n.north=u,n):new s(o,i,a,u)},s.contains=function(t,r){return r.longitude>=t.west&&r.longitude<=t.east&&r.latitude>=t.south&&r.latitude<=t.north},s.isEmpty=function(t){return t.west>=t.east||t.south>=t.north};var u=new t;return s.subsample=function(t,n,i,s){n=r(n,o.WGS84),i=r(i,0),e(s)||(s=[]);var l=0,c=t.north,f=t.south,h=t.east,d=t.west,m=u;m.height=i,m.longitude=d,m.latitude=c,s[l]=n.cartographicToCartesian(m,s[l]),l++,m.longitude=h,s[l]=n.cartographicToCartesian(m,s[l]),l++,m.latitude=f,s[l]=n.cartographicToCartesian(m,s[l]),l++,m.longitude=d,s[l]=n.cartographicToCartesian(m,s[l]),l++,m.latitude=0>c?c:f>0?f:0;for(var p=1;8>p;++p){var g=-Math.PI+p*a.PI_OVER_TWO;g>d&&h>g&&(m.longitude=g,s[l]=n.cartographicToCartesian(m,s[l]),l++)}return 0===m.latitude&&(m.longitude=d,s[l]=n.cartographicToCartesian(m,s[l]),l++,m.longitude=h,s[l]=n.cartographicToCartesian(m,s[l]),l++),s.length=l,s},s.MAX_VALUE=i(new s(-Math.PI,-a.PI_OVER_TWO,Math.PI,a.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(t,r,e,n,o,i,a,s,u,l,c){"use strict";var f=function(r,n){this.center=t.clone(e(r,t.ZERO)),this.radius=e(n,0)},h=new t,d=new t,m=new t,p=new t,g=new t,E=new t,y=new t,v=new t,C=new t,S=new t,w=new t,M=new t;f.fromPoints=function(r,e){if(n(e)||(e=new f),!n(r)||0===r.length)return e.center=t.clone(t.ZERO,e.center),e.radius=0,e;for(var o=t.clone(r[0],y),i=t.clone(o,h),a=t.clone(o,d),s=t.clone(o,m),u=t.clone(o,p),l=t.clone(o,g),c=t.clone(o,E),R=r.length,A=1;R>A;A++){t.clone(r[A],o);var O=o.x,T=o.y,N=o.z;O<i.x&&t.clone(o,i),O>u.x&&t.clone(o,u),T<a.y&&t.clone(o,a),T>l.y&&t.clone(o,l),N<s.z&&t.clone(o,s),N>c.z&&t.clone(o,c)}var I=t.magnitudeSquared(t.subtract(u,i,v)),x=t.magnitudeSquared(t.subtract(l,a,v)),F=t.magnitudeSquared(t.subtract(c,s,v)),_=i,b=u,L=I;x>L&&(L=x,_=a,b=l),F>L&&(L=F,_=s,b=c);var D=C;D.x=.5*(_.x+b.x),D.y=.5*(_.y+b.y),D.z=.5*(_.z+b.z);var P=t.magnitudeSquared(t.subtract(b,D,v)),z=Math.sqrt(P),B=S;B.x=i.x,B.y=a.y,B.z=s.z;var U=w;U.x=u.x,U.y=l.y,U.z=c.z;var q=t.multiplyByScalar(t.add(B,U,v),.5,M),G=0;for(A=0;R>A;A++){t.clone(r[A],o);var W=t.magnitude(t.subtract(o,q,v));W>G&&(G=W);var Y=t.magnitudeSquared(t.subtract(o,D,v));if(Y>P){var H=Math.sqrt(Y);z=.5*(z+H),P=z*z;var V=H-z;D.x=(z*D.x+V*o.x)/H,D.y=(z*D.y+V*o.y)/H,D.z=(z*D.z+V*o.z)/H}}return G>z?(t.clone(D,e.center),e.radius=z):(t.clone(q,e.center),e.radius=G),e};var R=new a,A=new t,O=new t,T=new r,N=new r;f.fromRectangle2D=function(t,r,e){return f.fromRectangleWithHeights2D(t,r,0,0,e)},f.fromRectangleWithHeights2D=function(r,o,i,a,s){if(n(s)||(s=new f),!n(r))return s.center=t.clone(t.ZERO,s.center),s.radius=0,s;o=e(o,R),c.southwest(r,T),T.height=i,c.northeast(r,N),N.height=a;var u=o.project(T,A),l=o.project(N,O),h=l.x-u.x,d=l.y-u.y,m=l.z-u.z;s.radius=.5*Math.sqrt(h*h+d*d+m*m);var p=s.center;return p.x=u.x+.5*h,p.y=u.y+.5*d,p.z=u.z+.5*m,s};var I=[];f.fromRectangle3D=function(t,r,o,a){r=e(r,i.WGS84),o=e(o,0);var s;return n(t)&&(s=c.subsample(t,r,o,I)),f.fromPoints(s,a)},f.fromVertices=function(r,o,i,a){if(n(a)||(a=new f),!n(r)||0===r.length)return a.center=t.clone(t.ZERO,a.center),a.radius=0,a;o=e(o,t.ZERO),i=e(i,3);var s=y;s.x=r[0]+o.x,s.y=r[1]+o.y,s.z=r[2]+o.z;for(var u=t.clone(s,h),l=t.clone(s,d),c=t.clone(s,m),R=t.clone(s,p),A=t.clone(s,g),O=t.clone(s,E),T=r.length,N=0;T>N;N+=i){var I=r[N]+o.x,x=r[N+1]+o.y,F=r[N+2]+o.z;s.x=I,s.y=x,s.z=F,I<u.x&&t.clone(s,u),I>R.x&&t.clone(s,R),x<l.y&&t.clone(s,l),x>A.y&&t.clone(s,A),F<c.z&&t.clone(s,c),F>O.z&&t.clone(s,O)}var _=t.magnitudeSquared(t.subtract(R,u,v)),b=t.magnitudeSquared(t.subtract(A,l,v)),L=t.magnitudeSquared(t.subtract(O,c,v)),D=u,P=R,z=_;b>z&&(z=b,D=l,P=A),L>z&&(z=L,D=c,P=O);var B=C;B.x=.5*(D.x+P.x),B.y=.5*(D.y+P.y),B.z=.5*(D.z+P.z);var U=t.magnitudeSquared(t.subtract(P,B,v)),q=Math.sqrt(U),G=S;G.x=u.x,G.y=l.y,G.z=c.z;var W=w;W.x=R.x,W.y=A.y,W.z=O.z;var Y=t.multiplyByScalar(t.add(G,W,v),.5,M),H=0;for(N=0;T>N;N+=i){s.x=r[N]+o.x,s.y=r[N+1]+o.y,s.z=r[N+2]+o.z;var V=t.magnitude(t.subtract(s,Y,v));V>H&&(H=V);var K=t.magnitudeSquared(t.subtract(s,B,v));if(K>U){var k=Math.sqrt(K);q=.5*(q+k),U=q*q;var j=k-q;B.x=(q*B.x+j*s.x)/k,B.y=(q*B.y+j*s.y)/k,B.z=(q*B.z+j*s.z)/k}}return H>q?(t.clone(B,a.center),a.radius=q):(t.clone(Y,a.center),a.radius=H),a},f.fromCornerPoints=function(r,e,o){n(o)||(o=new f);var i=o.center;return t.add(r,e,i),t.multiplyByScalar(i,.5,i),o.radius=t.distance(i,e),o},f.fromEllipsoid=function(r,e){return n(e)||(e=new f),t.clone(t.ZERO,e.center),e.radius=r.maximumRadius,e},f.clone=function(r,e){return n(r)?n(e)?(e.center=t.clone(r.center,e.center),e.radius=r.radius,e):new f(r.center,r.radius):void 0},f.packedLength=4,f.pack=function(t,r,n){n=e(n,0);var o=t.center;r[n++]=o.x,r[n++]=o.y,r[n++]=o.z,r[n]=t.radius},f.unpack=function(t,r,o){r=e(r,0),n(o)||(o=new f);var i=o.center;return i.x=t[r++],i.y=t[r++],i.z=t[r++],o.radius=t[r],o};var x=new t,F=new t;f.union=function(r,e,o){n(o)||(o=new f);var i=r.center,a=e.center;t.add(i,a,F);var s=t.multiplyByScalar(F,.5,F),u=t.magnitude(t.subtract(i,s,x))+r.radius,l=t.magnitude(t.subtract(a,s,x))+e.radius;return o.radius=Math.max(u,l),t.clone(s,o.center),o};var _=new t;f.expand=function(r,e,n){n=f.clone(r,n);var o=t.magnitude(t.subtract(e,n.center,_));return o>n.radius&&(n.radius=o),n},f.intersect=function(r,e){var n=r.center,o=r.radius,i=t.dot(e,n)+e.w;return-o>i?s.OUTSIDE:o>i?s.INTERSECTING:s.INSIDE},f.transform=function(t,r,e){return n(e)||(e=new f),e.center=l.multiplyByPoint(r,t.center,e.center),e.radius=l.getMaximumScale(r)*t.radius,e};var b=new t;f.distanceSquaredTo=function(r,e){var n=t.subtract(r.center,e,b);return t.magnitudeSquared(n)-r.radius*r.radius},f.transformWithoutScale=function(t,r,e){return n(e)||(e=new f),e.center=l.multiplyByPoint(r,t.center,e.center),e.radius=t.radius,e};var L=new t;f.computePlaneDistances=function(r,e,o,i){n(i)||(i=new u);var a=t.subtract(r.center,e,L),s=t.multiplyByScalar(o,t.dot(o,a),L),l=t.magnitude(s);return i.start=l-r.radius,i.stop=l+r.radius,i};for(var D=new t,P=new t,z=new t,B=new t,U=new t,q=new r,G=new Array(8),W=0;8>W;++W)G[W]=new t;var Y=new a;return f.projectTo2D=function(r,n,o){n=e(n,Y);var i=n.ellipsoid,a=r.center,s=r.radius,u=i.geodeticSurfaceNormal(a,D),l=t.cross(t.UNIT_Z,u,P);t.normalize(l,l);var c=t.cross(u,l,z);t.normalize(c,c),t.multiplyByScalar(u,s,u),t.multiplyByScalar(c,s,c),t.multiplyByScalar(l,s,l);var h=t.negate(c,U),d=t.negate(l,B),m=G,p=m[0];t.add(u,c,p),t.add(p,l,p),p=m[1],t.add(u,c,p),t.add(p,d,p),p=m[2],t.add(u,h,p),t.add(p,d,p),p=m[3],t.add(u,h,p),t.add(p,l,p),t.negate(u,u),p=m[4],t.add(u,c,p),t.add(p,l,p),p=m[5],t.add(u,c,p),t.add(p,d,p),p=m[6],t.add(u,h,p),t.add(p,d,p),p=m[7],t.add(u,h,p),t.add(p,l,p);for(var g=m.length,E=0;g>E;++E){var y=m[E];t.add(a,y,y);var v=i.cartesianToCartographic(y,q);n.project(v,y)}o=f.fromPoints(m,o),a=o.center;var C=a.x,S=a.y,w=a.z;return a.x=w,a.y=C,a.z=S,o},f.equals=function(r,e){return r===e||n(r)&&n(e)&&t.equals(r.center,e.center)&&r.radius===e.radius},f.prototype.intersect=function(t){return f.intersect(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,r){"use strict";var e,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},o={};return r(o,{element:{get:function(){return o.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return o.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return o.supportsFullscreen()?null!==o.element:void 0}}}),o.supportsFullscreen=function(){if(t(e))return e;e=!1;var r=document.body;if("function"==typeof r.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",e=!0;for(var o,i=["webkit","moz","o","ms","khtml"],a=0,s=i.length;s>a;++a){var u=i[a];o=u+"RequestFullscreen","function"==typeof r[o]?(n.requestFullscreen=o,e=!0):(o=u+"RequestFullScreen","function"==typeof r[o]&&(n.requestFullscreen=o,e=!0)),o=u+"ExitFullscreen","function"==typeof document[o]?n.exitFullscreen=o:(o=u+"CancelFullScreen","function"==typeof document[o]&&(n.exitFullscreen=o)),o=u+"FullscreenEnabled",t(document[o])?n.fullscreenEnabled=o:(o=u+"FullScreenEnabled",t(document[o])&&(n.fullscreenEnabled=o)),o=u+"FullscreenElement",t(document[o])?n.fullscreenElement=o:(o=u+"FullScreenElement",t(document[o])&&(n.fullscreenElement=o)),o=u+"fullscreenchange",t(document["on"+o])&&("ms"===u&&(o="MSFullscreenChange"),n.fullscreenchange=o),o=u+"fullscreenerror",t(document["on"+o])&&("ms"===u&&(o="MSFullscreenError"),n.fullscreenerror=o)}return e},o.requestFullscreen=function(t){o.supportsFullscreen()&&t[n.requestFullscreen]()},o.exitFullscreen=function(){o.supportsFullscreen()&&document[n.exitFullscreen]()},o}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,r,e){"use strict";function n(t){for(var r=t.split("."),e=0,n=r.length;n>e;++e)r[e]=parseInt(r[e],10);return r}function o(){if(!r(m)){m=!1;var t=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(m=!0,p=n(t[1]))}return m}function i(){return o()&&p}function a(){if(!r(g)&&(g=!1,!o()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(g=!0,E=n(t[1]))}return g}function s(){return a()&&E}function u(){if(!r(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==t&&(y=!0,v=n(t[1]),v.isNightly=!!t[2])}return y}function l(){return u()&&v}function c(){if(!r(C)){C=!1;var t;"Microsoft Internet Explorer"===navigator.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(C=!0,S=n(t[1]))):"Netscape"===navigator.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(C=!0,S=n(t[1])))}return C}function f(){return c()&&S}function h(){if(!r(w)){w=!1;var t=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(w=!0,M=n(t[1]))}return w}function d(){return h()&&M}var m,p,g,E,y,v,C,S,w,M,R={isChrome:o,chromeVersion:i,isSafari:a,safariVersion:s,isWebkit:u,webkitVersion:l,isInternetExplorer:c,internetExplorerVersion:f,isFirefox:h,firefoxVersion:d,hardwareConcurrency:t(navigator.hardwareConcurrency,3)};return R.supportsFullscreen=function(){return e.supportsFullscreen()},R.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},R.supportsWebWorkers=function(){return"undefined"!=typeof Worker},R}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(t,r,e,n,o,i){"use strict";function a(t,r,e){return 0>e&&(e+=1),e>1&&(e-=1),1>6*e?t+6*(r-t)*e:1>2*e?r:2>3*e?t+6*(r-t)*(2/3-e):t}var s=function(r,e,n,o){this.red=t(r,1),this.green=t(e,1),this.blue=t(n,1),this.alpha=t(o,1)};s.fromCartesian4=function(t,e){return r(e)?(e.red=t.x,e.green=t.y,e.blue=t.z,e.alpha=t.w,e):new s(t.x,t.y,t.z,t.w)},s.fromBytes=function(r,e,n,o){return r=s.byteToFloat(t(r,255)),e=s.byteToFloat(t(e,255)),n=s.byteToFloat(t(n,255)),o=s.byteToFloat(t(o,255)),new s(r,e,n,o)};var u,l,c;n.supportsTypedArrays()&&(u=new ArrayBuffer(4),l=new Uint32Array(u),c=new Uint8Array(u)),s.fromRgba=function(t){return l[0]=t,s.fromBytes(c[0],c[1],c[2],c[3])},s.fromHsl=function(r,e,n,o){r=t(r,0)%1,e=t(e,0),n=t(n,0),o=t(o,1);var i=n,u=n,l=n;if(0!==e){var c;c=.5>n?n*(1+e):n+e-n*e;var f=2*n-c;i=a(f,c,r+1/3),u=a(f,c,r),l=a(f,c,r-1/3)}return new s(i,u,l,o)},s.fromRandom=function(e,n){e=t(e,t.EMPTY_OBJECT);var o=e.red;if(!r(o)){var a=t(e.minimumRed,0),u=t(e.maximumRed,1);o=a+i.nextRandomNumber()*(u-a)}var l=e.green;if(!r(l)){var c=t(e.minimumGreen,0),f=t(e.maximumGreen,1);l=c+i.nextRandomNumber()*(f-c)}var h=e.blue;if(!r(h)){var d=t(e.minimumBlue,0),m=t(e.maximumBlue,1);h=d+i.nextRandomNumber()*(m-d)}var p=e.alpha;if(!r(p)){var g=t(e.minimumAlpha,0),E=t(e.maximumAlpha,1);p=g+i.nextRandomNumber()*(E-g)}return r(n)?(n.red=o,n.green=l,n.blue=h,n.alpha=p,n):new s(o,l,h,p)};var f=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,h=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,d=/^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(e){var n=s[e.toUpperCase()];if(r(n))return s.clone(n);var o=f.exec(e);return null!==o?new s(parseInt(o[1],16)/15,parseInt(o[2],16)/15,parseInt(o[3],16)/15):(o=h.exec(e),null!==o?new s(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255):(o=d.exec(e),null!==o?new s(parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),parseFloat(t(o[4],"1.0"))):(o=m.exec(e),null!==o?s.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(t(o[4],"1.0"))):void 0)))},s.packedLength=4,s.pack=function(r,e,n){n=t(n,0),e[n++]=r.red,e[n++]=r.green,e[n++]=r.blue,e[n]=r.alpha},s.unpack=function(e,n,o){return n=t(n,0),r(o)||(o=new s),o.red=e[n++],o.green=e[n++],o.blue=e[n++],o.alpha=e[n],o},s.byteToFloat=function(t){return t/255},s.floatToByte=function(t){return 1===t?255:0|256*t},s.clone=function(t,e){return r(t)?r(e)?(e.red=t.red,e.green=t.green,e.blue=t.blue,e.alpha=t.alpha,e):new s(t.red,t.green,t.blue,t.alpha):void 0},s.equals=function(t,e){return t===e||r(t)&&r(e)&&t.red===e.red&&t.green===e.green&&t.blue===e.blue&&t.alpha===e.alpha},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.prototype.equalsEpsilon=function(t,e){return this===t||r(t)&&Math.abs(this.red-t.red)<=e&&Math.abs(this.green-t.green)<=e&&Math.abs(this.blue-t.blue)<=e&&Math.abs(this.alpha-t.alpha)<=e},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var t=s.floatToByte(this.red),r=s.floatToByte(this.green),e=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+t+","+r+","+e+")":"rgba("+t+","+r+","+e+","+this.alpha+")"},s.prototype.toBytes=function(t){var e=s.floatToByte(this.red),n=s.floatToByte(this.green),o=s.floatToByte(this.blue),i=s.floatToByte(this.alpha);return r(t)?(t[0]=e,t[1]=n,t[2]=o,t[3]=i,t):[e,n,o,i]},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),l[0]},s.prototype.brighten=function(t,r){return t=1-t,r.red=1-(1-this.red)*t,r.green=1-(1-this.green)*t,r.blue=1-(1-this.blue)*t,r.alpha=this.alpha,r},s.prototype.darken=function(t,r){return t=1-t,r.red=this.red*t,r.green=this.green*t,r.blue=this.blue*t,r.alpha=this.alpha,r},s.ALICEBLUE=o(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=o(s.fromCssColorString("#FAEBD7")),s.AQUA=o(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=o(s.fromCssColorString("#7FFFD4")),s.AZURE=o(s.fromCssColorString("#F0FFFF")),s.BEIGE=o(s.fromCssColorString("#F5F5DC")),s.BISQUE=o(s.fromCssColorString("#FFE4C4")),s.BLACK=o(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=o(s.fromCssColorString("#FFEBCD")),s.BLUE=o(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=o(s.fromCssColorString("#8A2BE2")),s.BROWN=o(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=o(s.fromCssColorString("#DEB887")),s.CADETBLUE=o(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=o(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=o(s.fromCssColorString("#D2691E")),s.CORAL=o(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=o(s.fromCssColorString("#6495ED")),s.CORNSILK=o(s.fromCssColorString("#FFF8DC")),s.CRIMSON=o(s.fromCssColorString("#DC143C")),s.CYAN=o(s.fromCssColorString("#00FFFF")),s.DARKBLUE=o(s.fromCssColorString("#00008B")),s.DARKCYAN=o(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=o(s.fromCssColorString("#B8860B")),s.DARKGRAY=o(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=o(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=o(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=o(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=o(s.fromCssColorString("#556B2F")),s.DARKORANGE=o(s.fromCssColorString("#FF8C00")),s.DARKORCHID=o(s.fromCssColorString("#9932CC")),s.DARKRED=o(s.fromCssColorString("#8B0000")),s.DARKSALMON=o(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=o(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=o(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=o(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=o(s.fromCssColorString("#00CED1")),s.DARKVIOLET=o(s.fromCssColorString("#9400D3")),s.DEEPPINK=o(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=o(s.fromCssColorString("#00BFFF")),s.DIMGRAY=o(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=o(s.fromCssColorString("#1E90FF")),s.FIREBRICK=o(s.fromCssColorString("#B22222")),s.FLORALWHITE=o(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=o(s.fromCssColorString("#228B22")),s.FUSCHIA=o(s.fromCssColorString("#FF00FF")),s.GAINSBORO=o(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=o(s.fromCssColorString("#F8F8FF")),s.GOLD=o(s.fromCssColorString("#FFD700")),s.GOLDENROD=o(s.fromCssColorString("#DAA520")),s.GRAY=o(s.fromCssColorString("#808080")),s.GREEN=o(s.fromCssColorString("#008000")),s.GREENYELLOW=o(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=o(s.fromCssColorString("#F0FFF0")),s.HOTPINK=o(s.fromCssColorString("#FF69B4")),s.INDIANRED=o(s.fromCssColorString("#CD5C5C")),s.INDIGO=o(s.fromCssColorString("#4B0082")),s.IVORY=o(s.fromCssColorString("#FFFFF0")),s.KHAKI=o(s.fromCssColorString("#F0E68C")),s.LAVENDER=o(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=o(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=o(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=o(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=o(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=o(s.fromCssColorString("#F08080")),s.LIGHTCYAN=o(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=o(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=o(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=o(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=o(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=o(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=o(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=o(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=o(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=o(s.fromCssColorString("#FFFFE0")),s.LIME=o(s.fromCssColorString("#00FF00")),s.LIMEGREEN=o(s.fromCssColorString("#32CD32")),s.LINEN=o(s.fromCssColorString("#FAF0E6")),s.MAGENTA=o(s.fromCssColorString("#FF00FF")),s.MAROON=o(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=o(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=o(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=o(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=o(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=o(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=o(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=o(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=o(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=o(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=o(s.fromCssColorString("#191970")),s.MINTCREAM=o(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=o(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=o(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=o(s.fromCssColorString("#FFDEAD")),s.NAVY=o(s.fromCssColorString("#000080")),s.OLDLACE=o(s.fromCssColorString("#FDF5E6")),s.OLIVE=o(s.fromCssColorString("#808000")),s.OLIVEDRAB=o(s.fromCssColorString("#6B8E23")),s.ORANGE=o(s.fromCssColorString("#FFA500")),s.ORANGERED=o(s.fromCssColorString("#FF4500")),s.ORCHID=o(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=o(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=o(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=o(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=o(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=o(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=o(s.fromCssColorString("#FFDAB9")),s.PERU=o(s.fromCssColorString("#CD853F")),s.PINK=o(s.fromCssColorString("#FFC0CB")),s.PLUM=o(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=o(s.fromCssColorString("#B0E0E6")),s.PURPLE=o(s.fromCssColorString("#800080")),s.RED=o(s.fromCssColorString("#FF0000")),s.ROSYBROWN=o(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=o(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=o(s.fromCssColorString("#8B4513")),s.SALMON=o(s.fromCssColorString("#FA8072")),s.SANDYBROWN=o(s.fromCssColorString("#F4A460")),s.SEAGREEN=o(s.fromCssColorString("#2E8B57")),s.SEASHELL=o(s.fromCssColorString("#FFF5EE")),s.SIENNA=o(s.fromCssColorString("#A0522D")),s.SILVER=o(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=o(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=o(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=o(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=o(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=o(s.fromCssColorString("#00FF7F")),s.STEELBLUE=o(s.fromCssColorString("#4682B4")),s.TAN=o(s.fromCssColorString("#D2B48C")),s.TEAL=o(s.fromCssColorString("#008080")),s.THISTLE=o(s.fromCssColorString("#D8BFD8")),s.TOMATO=o(s.fromCssColorString("#FF6347")),s.TURQUOISE=o(s.fromCssColorString("#40E0D0")),s.VIOLET=o(s.fromCssColorString("#EE82EE")),s.WHEAT=o(s.fromCssColorString("#F5DEB3")),s.WHITE=o(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=o(s.fromCssColorString("#F5F5F5")),s.YELLOW=o(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=o(s.fromCssColorString("#9ACD32")),s -}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,r,e,n,o){"use strict";if(!n.supportsTypedArrays())return{};var i={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new e("componentDatatype is not a valid value.")}},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 Float32Array?i.FLOAT:t instanceof Float64Array?i.DOUBLE:void 0},i.validate=function(t){return r(t)&&(t===i.BYTE||t===i.UNSIGNED_BYTE||t===i.SHORT||t===i.UNSIGNED_SHORT||t===i.FLOAT||t===i.DOUBLE)},i.createTypedArray=function(t,r){switch(t){case i.BYTE:return new Int8Array(r);case i.UNSIGNED_BYTE:return new Uint8Array(r);case i.SHORT:return new Int16Array(r);case i.UNSIGNED_SHORT:return new Uint16Array(r);case i.FLOAT:return new Float32Array(r);case i.DOUBLE:return new Float64Array(r);default:throw new e("componentDatatype is not a valid value.")}},i.createArrayBufferView=function(r,n,o,a){switch(o=t(o,0),a=t(a,(n.byteLength-o)/i.getSizeInBytes(r)),r){case i.BYTE:return new Int8Array(n,o,a);case i.UNSIGNED_BYTE:return new Uint8Array(n,o,a);case i.SHORT:return new Int16Array(n,o,a);case i.UNSIGNED_SHORT:return new Uint16Array(n,o,a);case i.FLOAT:return new Float32Array(n,o,a);case i.DOUBLE:return new Float64Array(n,o,a);default:throw new e("componentDatatype is not a valid value.")}},o(i)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var r={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(r)}),define("Core/PrimitiveType",["./freezeObject"],function(t){"use strict";var r={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,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,r,e,n,o){"use strict";var i=function(r){r=t(r,t.EMPTY_OBJECT),this.attributes=r.attributes,this.indices=r.indices,this.primitiveType=t(r.primitiveType,o.TRIANGLES),this.boundingSphere=r.boundingSphere,this.geometryType=t(r.geometryType,n.NONE)};return i.computeNumberOfVertices=function(t){var n=-1;for(var o in t.attributes)if(t.attributes.hasOwnProperty(o)&&r(t.attributes[o])&&r(t.attributes[o].values)){var i=t.attributes[o],a=i.values.length/i.componentsPerAttribute;if(n!==a&&-1!==n)throw new e("All attribute lists must have the same number of attributes.");n=a}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t){"use strict";var r=function(r){r=t(r,t.EMPTY_OBJECT),this.componentDatatype=r.componentDatatype,this.componentsPerAttribute=r.componentsPerAttribute,this.normalize=t(r.normalize,!1),this.values=r.values};return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";var r=function(r){r=t(r,t.EMPTY_OBJECT),this.position=r.position,this.normal=r.normal,this.st=r.st,this.binormal=r.binormal,this.tangent=r.tangent,this.color=r.color};return r}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math"],function(t,r,e,n){"use strict";var o={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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(r){return t(r)&&(r===o.UNSIGNED_BYTE||r===o.UNSIGNED_SHORT||r===o.UNSIGNED_INT)},o.createTypedArray=function(t,r){return t>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(r):new Uint16Array(r)},o.createTypedArrayFromArrayBuffer=function(t,r,e,o){return t>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(r,e,o):new Uint16Array(r,e,o)},e(o)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(t,r,e,n,o,i,a,s){"use strict";function u(t){var r=t._uSquared,e=t._ellipsoid.maximumRadius,n=t._ellipsoid.minimumRadius,o=(e-n)/e,i=Math.cos(t._startHeading),a=Math.sin(t._startHeading),s=(1-o)*Math.tan(t._start.latitude),u=1/Math.sqrt(1+s*s),l=u*s,c=Math.atan2(s,i),f=u*a,h=f*f,d=1-h,m=Math.sqrt(d),p=r/4,g=p*p,E=g*p,y=g*g,v=1+p-3*g/4+5*E/4-175*y/64,C=1-p+15*g/8-35*E/8,S=1-3*p+35*g/4,w=1-5*p,M=v*c-C*Math.sin(2*c)*p/2-S*Math.sin(4*c)*g/16-w*Math.sin(6*c)*E/48-5*Math.sin(8*c)*y/512,R=t._constants;R.a=e,R.b=n,R.f=o,R.cosineHeading=i,R.sineHeading=a,R.tanU=s,R.cosineU=u,R.sineU=l,R.sigma=c,R.sineAlpha=f,R.sineSquaredAlpha=h,R.cosineSquaredAlpha=d,R.cosineAlpha=m,R.u2Over4=p,R.u4Over16=g,R.u6Over64=E,R.u8Over256=y,R.a0=v,R.a1=C,R.a2=S,R.a3=w,R.distanceRatio=M}function l(t,r){return t*r*(4+t*(4-3*r))/16}function c(t,r,e,n,o,i,a){var s=l(t,e);return(1-s)*t*r*(n+s*o*(a+s*i*(2*a*a-1)))}function f(t,r,e,n,o,i,a){var u,l,f,h,d,m=(r-e)/r,p=i-n,g=Math.atan((1-m)*Math.tan(o)),E=Math.atan((1-m)*Math.tan(a)),y=Math.cos(g),v=Math.sin(g),C=Math.cos(E),S=Math.sin(E),w=y*C,M=y*S,R=v*S,A=v*C,O=p,T=s.TWO_PI,N=Math.cos(O),I=Math.sin(O);do{N=Math.cos(O),I=Math.sin(O);var x=M-A*N;f=Math.sqrt(C*C*I*I+x*x),l=R+w*N,u=Math.atan2(f,l);var F;0===f?(F=0,h=1):(F=w*I/f,h=1-F*F),T=O,d=l-2*R/h,isNaN(d)&&(d=0),O=p+c(m,F,h,u,f,l,d)}while(Math.abs(O-T)>s.EPSILON12);var _=h*(r*r-e*e)/(e*e),b=1+_*(4096+_*(_*(320-175*_)-768))/16384,L=_*(256+_*(_*(74-47*_)-128))/1024,D=d*d,P=L*f*(d+L*(l*(2*D-1)-L*d*(4*f*f-3)*(4*D-3)/6)/4),z=e*b*(u-P),B=Math.atan2(C*I,M-A*N),U=Math.atan2(y*I,M*N-A);t._distance=z,t._startHeading=B,t._endHeading=U,t._uSquared=_}function h(e,n,o,i){t.normalize(i.cartographicToCartesian(n,m),d),t.normalize(i.cartographicToCartesian(o,m),m),f(e,i.maximumRadius,i.minimumRadius,n.longitude,n.latitude,o.longitude,o.latitude),n.height=0,o.height=0,e._start=r.clone(n,e._start),e._end=r.clone(o,e._end),u(e)}var d=new t,m=new t,p=function(t,o,i){var s=e(i,a.WGS84);this._ellipsoid=s,this._start=new r,this._end=new r,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,n(t)&&n(o)&&h(this,t,o,s)};return o(p.prototype,{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(t,r){h(this,t,r,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(t,r){return this.interpolateUsingSurfaceDistance(this._distance*t,r)},p.prototype.interpolateUsingSurfaceDistance=function(t,e){var o=this._constants,i=o.distanceRatio+t/o.b,a=Math.cos(2*i),s=Math.cos(4*i),u=Math.cos(6*i),l=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),m=i*i,p=i*m,g=o.u8Over256,E=o.u2Over4,y=o.u6Over64,v=o.u4Over16,C=2*p*g*a/3+i*(1-E+7*v/4-15*y/4+579*g/64-(v-15*y/4+187*g/16)*a-(5*y/4-115*g/16)*s-29*g*u/16)+(E/2-v+71*y/32-85*g/16)*l+(5*v/16-5*y/4+383*g/96)*f-m*((y-11*g/2)*l+5*g*f/2)+(29*y/96-29*g/16)*h+539*g*d/1536,S=Math.asin(Math.sin(C)*o.cosineAlpha),w=Math.atan(o.a/o.b*Math.tan(S));C-=o.sigma;var M=Math.cos(2*o.sigma+C),R=Math.sin(C),A=Math.cos(C),O=o.cosineU*A,T=o.sineU*R,N=Math.atan2(R*o.sineHeading,O-T*o.cosineHeading),I=N-c(o.f,o.sineAlpha,o.cosineSquaredAlpha,C,R,A,M);return n(e)?(e.longitude=this._start.longitude+I,e.latitude=w,e.height=0,e):new r(this._start.longitude+I,w,0)},p}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(t,r){"use strict";function e(t,e,n){var o=t+e;return r.sign(t)!==r.sign(e)&&Math.abs(o/Math.max(Math.abs(t),Math.abs(e)))<n?0:o}var n={};return n.computeDiscriminant=function(t,r,e){var n=r*r-4*t*e;return n},n.computeRealRoots=function(t,n,o){var i;if(0===t)return 0===n?[]:[-o/n];if(0===n){if(0===o)return[0,0];var a=Math.abs(o),s=Math.abs(t);if(s>a&&a/s<r.EPSILON14)return[0,0];if(a>s&&s/a<r.EPSILON14)return[];if(i=-o/t,0>i)return[];var u=Math.sqrt(i);return[-u,u]}if(0===o)return i=-n/t,0>i?[i,0]:[0,i];var l=n*n,c=4*t*o,f=e(l,-c,r.EPSILON14);if(0>f)return[];var h=-.5*e(n,r.sign(n)*Math.sqrt(f),r.EPSILON14);return n>0?[h/t,o/h]:[o/h,h/t]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(t,r){"use strict";function e(t,r,e,n){var o,i,a=t,s=r/3,u=e/3,l=n,c=a*u,f=s*l,h=s*s,d=u*u,m=a*u-h,p=a*l-s*u,g=s*l-d,E=4*m*g-p*p;if(0>E){var y,v,C;h*f>=c*d?(y=a,v=m,C=-2*s*m+a*p):(y=l,v=g,C=-l*p+2*u*g);var S=0>C?-1:1,w=-S*Math.abs(y)*Math.sqrt(-E);i=-C+w;var M=i/2,R=0>M?-Math.pow(-M,1/3):Math.pow(M,1/3),A=i===w?-R:-v/R;return o=0>=v?R+A:-C/(R*R+A*A+v),h*f>=c*d?[(o-s)/a]:[-l/(o+u)]}var O=m,T=-2*s*m+a*p,N=g,I=-l*p+2*u*g,x=Math.sqrt(E),F=Math.sqrt(3)/2,_=Math.abs(Math.atan2(a*x,-T)/3);o=2*Math.sqrt(-O);var b=Math.cos(_);i=o*b;var L=o*(-b/2-F*Math.sin(_)),D=i+L>2*s?i-s:L-s,P=a,z=D/P;_=Math.abs(Math.atan2(l*x,-I)/3),o=2*Math.sqrt(-N),b=Math.cos(_),i=o*b,L=o*(-b/2-F*Math.sin(_));var B=-l,U=2*u>i+L?i+u:L+u,q=B/U,G=P*U,W=-D*U-P*B,Y=D*B,H=(u*W-s*Y)/(-s*W+u*G);return H>=z?q>=z?q>=H?[z,H,q]:[z,q,H]:[q,z,H]:q>=z?[H,z,q]:q>=H?[H,q,z]:[q,H,z]}var n={};return n.computeDiscriminant=function(t,r,e,n){var o=t*t,i=r*r,a=e*e,s=n*n,u=18*t*r*e*n+i*a-27*o*s-4*(t*a*e+i*r*n);return u},n.computeRealRoots=function(t,n,o,i){var a,s;if(0===t)return r.computeRealRoots(n,o,i);if(0===n){if(0===o){if(0===i)return[0,0,0];s=-i/t;var u=0>s?-Math.pow(-s,1/3):Math.pow(s,1/3);return[u,u,u]}return 0===i?(a=r.computeRealRoots(t,0,o),0===a.Length?[0]:[a[0],0,a[1]]):e(t,0,o,i)}return 0===o?0===i?(s=-n/t,0>s?[s,0,0]:[0,0,s]):e(t,n,0,i):0===i?(a=r.computeRealRoots(t,n,o),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]]):e(t,n,o,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(t,r,e,n){"use strict";function o(r,o,i,a){var s=r*r,u=o-3*s/8,l=i-o*r/2+s*r/8,c=a-i*r/4+o*s/16-3*s*s/256,f=t.computeRealRoots(1,2*u,u*u-4*c,-l*l);if(f.length>0){var h=-r/4,d=f[f.length-1];if(Math.abs(d)<e.EPSILON14){var m=n.computeRealRoots(1,u,c);if(2===m.length){var p,g=m[0],E=m[1];if(g>=0&&E>=0){var y=Math.sqrt(g),v=Math.sqrt(E);return[h-v,h-y,h+y,h+v]}if(g>=0&&0>E)return p=Math.sqrt(g),[h-p,h+p];if(0>g&&E>=0)return p=Math.sqrt(E),[h-p,h+p]}return[]}if(d>0){var C=Math.sqrt(d),S=(u+d-l/C)/2,w=(u+d+l/C)/2,M=n.computeRealRoots(1,C,S),R=n.computeRealRoots(1,-C,w);return 0!==M.length?(M[0]+=h,M[1]+=h,0!==R.length?(R[0]+=h,R[1]+=h,M[1]<=R[0]?[M[0],M[1],R[0],R[1]]:R[1]<=M[0]?[R[0],R[1],M[0],M[1]]:M[0]>=R[0]&&M[1]<=R[1]?[R[0],M[0],M[1],R[1]]:R[0]>=M[0]&&R[1]<=M[1]?[M[0],R[0],R[1],M[1]]:M[0]>R[0]&&M[0]<R[1]?[R[0],M[0],R[1],M[1]]:[M[0],R[0],M[1],R[1]]):M):0!==R.length?(R[0]+=h,R[1]+=h,R):[]}}return[]}function i(r,o,i,a){var s=i*i,u=o*o,l=r*r,c=-2*o,f=i*r+u-4*a,h=l*a-i*o*r+s,d=t.computeRealRoots(1,c,f,h);if(d.length>0){var m,p,g=d[0],E=o-g,y=E*E,v=r/2,C=E/2,S=y-4*a,w=y+4*Math.abs(a),M=l-4*g,R=l+4*Math.abs(g);if(0>g||M*w>S*R){var A=Math.sqrt(M);m=A/2,p=0===A?0:(r*C-i)/A}else{var O=Math.sqrt(S);m=0===O?0:(r*C-i)/O,p=O/2}var T,N;0===v&&0===m?(T=0,N=0):e.sign(v)===e.sign(m)?(T=v+m,N=g/T):(N=v-m,T=g/N);var I,x;0===C&&0===p?(I=0,x=0):e.sign(C)===e.sign(p)?(I=C+p,x=a/I):(x=C-p,I=a/x);var F=n.computeRealRoots(1,T,I),_=n.computeRealRoots(1,N,x);if(0!==F.length)return 0!==_.length?F[1]<=_[0]?[F[0],F[1],_[0],_[1]]:_[1]<=F[0]?[_[0],_[1],F[0],F[1]]:F[0]>=_[0]&&F[1]<=_[1]?[_[0],F[0],F[1],_[1]]:_[0]>=F[0]&&_[1]<=F[1]?[F[0],_[0],_[1],F[1]]:F[0]>_[0]&&F[0]<_[1]?[_[0],F[0],_[1],F[1]]:[F[0],_[0],F[1],_[1]]:F;if(0!==_.length)return _}return[]}var a={};return a.computeDiscriminant=function(t,r,e,n,o){var i=t*t,a=i*t,s=r*r,u=s*r,l=e*e,c=l*e,f=n*n,h=f*n,d=o*o,m=d*o,p=s*l*f-4*u*h-4*t*c*f+18*t*r*e*h-27*i*f*f+256*a*m+o*(18*u*e*n-4*s*c+16*t*l*l-80*t*r*l*n-6*t*s*f+144*i*e*f)+d*(144*t*s*e-27*s*s-128*i*l-192*i*r*n);return p},a.computeRealRoots=function(r,n,a,s,u){if(Math.abs(r)<e.EPSILON15)return t.computeRealRoots(n,a,s,u);var l=n/r,c=a/r,f=s/r,h=u/r,d=0>l?1:0;switch(d+=0>c?d+1:d,d+=0>f?d+1:d,d+=0>h?d+1:d){case 0:return o(l,c,f,h);case 1:return i(l,c,f,h);case 2:return i(l,c,f,h);case 3:return o(l,c,f,h);case 4:return o(l,c,f,h);case 5:return i(l,c,f,h);case 6:return o(l,c,f,h);case 7:return o(l,c,f,h);case 8:return i(l,c,f,h);case 9:return o(l,c,f,h);case 10:return o(l,c,f,h);case 11:return i(l,c,f,h);case 12:return o(l,c,f,h);case 13:return o(l,c,f,h);case 14:return o(l,c,f,h);case 15:return o(l,c,f,h);default:return void 0}},a}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(t,r,e){"use strict";var n=function(e,n){n=t.clone(r(n,t.ZERO)),t.equals(n,t.ZERO)||t.normalize(n,n),this.origin=t.clone(r(e,t.ZERO)),this.direction=n};return n.getPoint=function(r,n,o){return e(o)||(o=new t),o=t.multiplyByScalar(r.direction,n,o),t.add(r.origin,o,o)},n}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(t,r,e,n,o,i,a,s,u,l){"use strict";function c(r,n,o,a,s){s=e(s,!1);var u,l,c,f,h,d=r.origin,m=r.direction,p=t.subtract(o,n,g),S=t.subtract(a,n,E),w=t.cross(m,S,y),M=t.dot(p,w);if(s){if(M<i.EPSILON6)return void 0;if(u=t.subtract(d,n,v),c=t.dot(u,w),0>c||c>M)return void 0;if(l=t.cross(u,p,C),f=t.dot(m,l),0>f||c+f>M)return void 0;h=t.dot(S,l)/M}else{if(Math.abs(M)<i.EPSILON6)return void 0;var R=1/M;if(u=t.subtract(d,n,v),c=t.dot(u,w)*R,0>c||c>1)return void 0;if(l=t.cross(u,p,C),f=t.dot(m,l)*R,0>f||c+f>1)return void 0;h=t.dot(S,l)*R}return h}function f(t,r,e,n){var o=r*r-4*t*e;if(0>o)return void 0;if(o>0){var i=1/(2*t),a=Math.sqrt(o),s=(-r+a)*i,u=(-r-a)*i;return u>s?(n.root0=s,n.root1=u):(n.root0=u,n.root1=s),n}var l=-r/(2*t);return 0===l?void 0:(n.root0=n.root1=l,n)}function h(r,e,o){n(o)||(o={});var i=r.origin,a=r.direction,s=e.center,u=e.radius*e.radius,l=t.subtract(i,s,y),c=t.dot(a,a),h=2*t.dot(a,l),d=t.magnitudeSquared(l)-u,m=f(c,h,d,w);return n(m)?(o.start=m.root0,o.stop=m.root1,o):void 0}function d(t,r,e){var n=t+r;return i.sign(t)!==i.sign(r)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(r)))<e?0:n}function m(r,e,n,o,l){var c,f=o*o,h=l*l,m=(r[a.COLUMN1ROW1]-r[a.COLUMN2ROW2])*h,p=l*(o*d(r[a.COLUMN1ROW0],r[a.COLUMN0ROW1],i.EPSILON15)+e.y),g=r[a.COLUMN0ROW0]*f+r[a.COLUMN2ROW2]*h+o*e.x+n,E=h*d(r[a.COLUMN2ROW1],r[a.COLUMN1ROW2],i.EPSILON15),y=l*(o*d(r[a.COLUMN2ROW0],r[a.COLUMN0ROW2])+e.z),v=[];if(0===y&&0===E){if(c=s.computeRealRoots(m,p,g),0===c.length)return v;var C=c[0],S=Math.sqrt(Math.max(1-C*C,0));if(v.push(new t(o,l*C,l*-S)),v.push(new t(o,l*C,l*S)),2===c.length){var w=c[1],M=Math.sqrt(Math.max(1-w*w,0));v.push(new t(o,l*w,l*-M)),v.push(new t(o,l*w,l*M))}return v}var R=y*y,A=E*E,O=m*m,T=y*E,N=O+A,I=2*(p*m+T),x=2*g*m+p*p-A+R,F=2*(g*p-T),_=g*g-R;if(0===N&&0===I&&0===x&&0===F)return v;c=u.computeRealRoots(N,I,x,F,_);var b=c.length;if(0===b)return v;for(var L=0;b>L;++L){var D,P=c[L],z=P*P,B=Math.max(1-z,0),U=Math.sqrt(B);D=i.sign(m)===i.sign(g)?d(m*z+g,p*P,i.EPSILON12):i.sign(g)===i.sign(p*P)?d(m*z,p*P+g,i.EPSILON12):d(m*z+p*P,g,i.EPSILON12);var q=d(E*P,y,i.EPSILON15),G=D*q;0>G?v.push(new t(o,l*P,l*U)):G>0?v.push(new t(o,l*P,l*-U)):0!==U?(v.push(new t(o,l*P,l*-U)),v.push(new t(o,l*P,l*U)),++L):v.push(new t(o,l*P,l*U))}return v}var p={};p.rayPlane=function(r,e,o){n(o)||(o=new t);var a=r.origin,s=r.direction,u=e.normal,l=t.dot(u,s);if(Math.abs(l)<i.EPSILON15)return void 0;var c=(-e.distance-t.dot(u,a))/l;return 0>c?void 0:(o=t.multiplyByScalar(s,c,o),t.add(a,o,o))};var g=new t,E=new t,y=new t,v=new t,C=new t;p.rayTriangle=function(r,e,o,i,a,s){var u=c(r,e,o,i,a);return!n(u)||0>u?void 0:(n(s)||(s=new t),t.multiplyByScalar(r.direction,u,s),t.add(r.origin,s,s))};var S=new l;p.lineSegmentTriangle=function(r,e,o,i,a,s,u){var l=S;t.clone(r,l.origin),t.subtract(e,r,l.direction),t.normalize(l.direction,l.direction);var f=c(l,o,i,a,s);return!n(f)||0>f||f>t.distance(r,e)?void 0:(n(u)||(u=new t),t.multiplyByScalar(l.direction,f,u),t.add(l.origin,u,u))};var w={root0:0,root1:0};p.raySphere=function(t,r,e){return e=h(t,r,e),!n(e)||e.stop<0?void 0:(e.start=Math.max(e.start,0),e)};var M=new l;p.lineSegmentSphere=function(r,e,o,i){var a=M;t.clone(r,a.origin);var s=t.subtract(e,r,a.direction),u=t.magnitude(s);return t.normalize(s,s),i=h(a,o,i),!n(i)||i.stop<0||i.start>u?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,u),i)};var R=new t,A=new t;p.rayEllipsoid=function(r,e){var n,o,i,a,s,u=e.oneOverRadii,l=t.multiplyComponents(u,r.origin,R),c=t.multiplyComponents(u,r.direction,A),f=t.magnitudeSquared(l),h=t.dot(l,c);if(f>1){if(h>=0)return void 0;var d=h*h;if(n=f-1,o=t.magnitudeSquared(c),i=o*n,i>d)return void 0;if(d>i){a=h*h-i,s=-h+Math.sqrt(a);var m=s/o,p=n/s;return p>m?{start:m,stop:p}:{start:p,stop:m}}var g=Math.sqrt(n/o);return{start:g,stop:g}}return 1>f?(n=f-1,o=t.magnitudeSquared(c),i=o*n,a=h*h-i,s=-h+Math.sqrt(a),{start:0,stop:s/o}):0>h?(o=t.magnitudeSquared(c),{start:0,stop:-h/o}):void 0};var O=new t,T=new t,N=new t,I=new t,x=new t,F=new a,_=new a,b=new a,L=new a,D=new a,P=new a,z=new a,B=new t,U=new t,q=new r;p.grazingAltitudeLocation=function(r,e){var o=r.origin,s=r.direction,u=e.geodeticSurfaceNormal(o);if(t.dot(s,u)>=0)return o;var l=n(this.rayEllipsoid(r,e)),c=e.transformPositionToScaledSpace(s),f=t.normalize(c,O),h=t.mostOrthogonalAxis(c,I),d=t.normalize(t.cross(h,f,T),T),p=t.normalize(t.cross(f,d,N),N),g=F;g[0]=f.x,g[1]=f.y,g[2]=f.z,g[3]=d.x,g[4]=d.y,g[5]=d.z,g[6]=p.x,g[7]=p.y,g[8]=p.z;var E=a.transpose(g,_),y=a.fromScale(e.radii,b),v=a.fromScale(e.oneOverRadii,L),C=D;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 S,w,M=a.multiply(a.multiply(E,v,P),C,P),R=a.multiply(a.multiply(M,y,z),g,z),A=a.multiplyByVector(M,o,x),G=m(R,t.negate(A,O),0,0,1),W=G.length;if(W>0){for(var Y=t.clone(t.ZERO,U),H=Number.NEGATIVE_INFINITY,V=0;W>V;++V){S=a.multiplyByVector(y,a.multiplyByVector(g,G[V],B),B);var K=t.normalize(t.subtract(S,o,I),I),k=t.dot(K,s);k>H&&(H=k,Y=t.clone(S,Y))}var j=e.cartesianToCartographic(Y,q);return H=i.clamp(H,0,1),w=t.magnitude(t.subtract(Y,o,I))*Math.sqrt(1-H*H),w=l?-w:w,j.height=w,e.cartographicToCartesian(j)}return void 0};var G=new t;return p.lineSegmentPlane=function(r,e,o,a){n(a)||(a=new t);var s=t.subtract(e,r,G),u=o.normal,l=t.dot(u,s);if(Math.abs(l)<i.EPSILON6)return void 0;var c=t.dot(u,r),f=-(o.distance+c)/l;return 0>f||f>1?void 0:(t.multiplyByScalar(s,f,a),t.add(r,a,a),a)},p.trianglePlaneIntersection=function(r,e,n,o){var i=o.normal,a=o.distance,s=t.dot(i,r)+a<0,u=t.dot(i,e)+a<0,l=t.dot(i,n)+a<0,c=0;c+=s?1:0,c+=u?1:0,c+=l?1:0;var f,h;if((1===c||2===c)&&(f=new t,h=new t),1===c){if(s)return p.lineSegmentPlane(r,e,o,f),p.lineSegmentPlane(r,n,o,h),{positions:[r,e,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(u)return p.lineSegmentPlane(e,n,o,f),p.lineSegmentPlane(e,r,o,h),{positions:[r,e,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(l)return p.lineSegmentPlane(n,r,o,f),p.lineSegmentPlane(n,e,o,h),{positions:[r,e,n,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!s)return p.lineSegmentPlane(e,r,o,f),p.lineSegmentPlane(n,r,o,h),{positions:[r,e,n,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!u)return p.lineSegmentPlane(n,e,o,f),p.lineSegmentPlane(r,e,o,h),{positions:[r,e,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!l)return p.lineSegmentPlane(r,n,o,f),p.lineSegmentPlane(e,n,o,h),{positions:[r,e,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},p}),define("Core/isArray",["./defined"],function(t){"use strict";var r=Array.isArray;return t(r)||(r=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),r}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(t,r){"use strict";var e=function(r,e){this.normal=t.clone(r),this.distance=e};return e.fromPointNormal=function(n,o,i){var a=-t.dot(o,n);return r(i)?(t.clone(o,i.normal),i.distance=a,i):new e(o,a)},e.getPointDistance=function(r,e){return t.dot(r.normal,e)+r.distance},e}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(t,r,e,n,o,i,a,s,u,l,c,f){"use strict";function h(t,r,e){var n,o=new Array(t);if(r===e){for(n=0;t>n;n++)o[n]=r;return o}var i=e-r,a=i/t;for(n=1;t>n;n++){var s=r+n*a;o[n]=s}return o[0]=r,o}function d(r,e,n,o,i,a,s,u){var l=o.scaleToGeodeticSurface(r,T),c=o.scaleToGeodeticSurface(e,N),f=m.numberOfPoints(r,e,n),d=o.cartesianToCartographic(l,R),p=o.cartesianToCartographic(c,A),g=h(f,i,a);I.setEndPoints(d,p);var E=I.surfaceDistance/f,y=u;d.height=i;var v=o.cartographicToCartesian(d,O);t.pack(v,s,y),y+=3;for(var C=1;f>C;C++){var S=I.interpolateUsingSurfaceDistance(C*E,A);S.height=g[C],v=o.cartographicToCartesian(S,O),t.pack(v,s,y),y+=3}return y}var m={};m.numberOfPoints=function(r,e,n){var o=t.angleBetween(r,e);return Math.ceil(o/n)};var p=new r;m.extractHeights=function(t,r){for(var e=t.length,n=new Array(e),o=0;e>o;o++){var i=t[o];n[o]=r.cartesianToCartographic(i,p).height}return n};var g=new c,E=new t,y=new t,v=new f(t.ZERO,0),C=new t,S=new f(t.ZERO,0),w=new t,M=new t,R=new r,A=new r,O=new t,T=new t,N=new t,I=new a;return m.wrapLongitude=function(r,o){var i=[],a=[];if(n(r)&&r.length>0){o=e(o,c.IDENTITY);var u=c.inverseTransformation(o,g),l=c.multiplyByPoint(u,t.ZERO,E),h=c.multiplyByPointAsVector(u,t.UNIT_Y,y),d=f.fromPointNormal(l,h,v),m=c.multiplyByPointAsVector(u,t.UNIT_X,C),p=f.fromPointNormal(l,m,S),R=1;i.push(t.clone(r[0]));for(var A=i[0],O=r.length,T=1;O>T;++T){var N=r[T];if(f.getPointDistance(p,A)<0||f.getPointDistance(p,N)<0){var I=s.lineSegmentPlane(A,N,d,w);if(n(I)){var x=t.multiplyByScalar(h,5e-9,M);f.getPointDistance(d,A)<0&&t.negate(x,x),i.push(t.add(I,x,new t)),a.push(R+1),t.negate(x,x),i.push(t.add(I,x,new t)),R=1}}i.push(t.clone(r[T])),R++,A=N}a.push(R)}return{positions:i,lengths:a}},m.removeDuplicates=function(r){var e=r.length;if(2>e)return void 0;var n,o,i;for(n=1;e>n&&(o=r[n-1],i=r[n],!t.equals(o,i));++n);if(n===e)return void 0;var a=[];for(a.push(r[0]);e>n;++n)o=r[n-1],i=r[n],t.equals(o,i)||a.push(t.clone(i));return a},m.generateArc=function(r){n(r)||(r={});var o,a,s,c=r.positions,f=e(r.ellipsoid,i.WGS84),h=e(r.height,0),p=e(r.granularity,l.RADIANS_PER_DEGREE),g=c.length,E=0;for(o=0;g-1>o;o++)a=c[o],s=c[o+1],E+=m.numberOfPoints(a,s,p);E++;var y=3*E,v=new Array(y),C=0;for(o=0;g-1>o;o++){a=c[o],s=c[o+1];var S,w;u(h)?(S=h[o],w=h[o+1]):(S=h,w=h),C=d(a,s,p,f,S,w,v,C)}var M=c[g-1],A=f.cartesianToCartographic(M,R);A.height=u(h)?h[g-1]:h;var T=f.cartographicToCartesian(A,O);return t.pack(T,v,y-3),v},m.generateCartesianArc=function(r){for(var e=m.generateArc(r),n=e.length/3,o=new Array(n),i=0;n>i;i++)o[i]=t.unpack(e,3*i);return o},m}),define("Core/VertexFormat",["./defaultValue","./freezeObject"],function(t,r){"use strict";var e=function(r){r=t(r,t.EMPTY_OBJECT),this.position=t(r.position,!1),this.normal=t(r.normal,!1),this.st=t(r.st,!1),this.binormal=t(r.binormal,!1),this.tangent=t(r.tangent,!1),this.color=t(r.color,!1)};return e.POSITION_ONLY=r(new e({position:!0})),e.POSITION_AND_NORMAL=r(new e({position:!0,normal:!0})),e.POSITION_NORMAL_AND_ST=r(new e({position:!0,normal:!0,st:!0})),e.POSITION_AND_ST=r(new e({position:!0,st:!0})),e.POSITION_AND_COLOR=r(new e({position:!0,color:!0})),e.ALL=r(new e({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),e.DEFAULT=e.POSITION_NORMAL_AND_ST,e}),define("Core/PolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryType","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(t,r,e,n,o,i,a,s,u,l,c,f,h,d,m,p,g){"use strict";function E(t,r,n,o,i){var a,s=m.numberOfPoints(t,r,i),u=new Array(s),l=n.red,c=n.green,f=n.blue,h=n.alpha,d=o.red,p=o.green,g=o.blue,E=o.alpha;if(e.equals(n,o)){for(a=0;s>a;a++)u[a]=e.clone(n);return u}var y=(d-l)/s,v=(p-c)/s,C=(g-f)/s,S=(E-h)/s;for(a=0;s>a;a++)u[a]=new e(l+a*y,c+a*v,f+a*C,h+a*S);return u}var y=function(t){t=o(t,o.EMPTY_OBJECT);var r=t.positions,e=t.colors,n=o(t.width,1),i=o(t.colorsPerVertex,!1);this._positions=r,this._colors=e,this._width=n,this._perVertex=i,this._vertexFormat=o(t.vertexFormat,g.DEFAULT),this._followSurface=o(t.followSurface,!0),this._granularity=o(t.granularity,d.RADIANS_PER_DEGREE),this._ellipsoid=o(t.ellipsoid,s.WGS84),this._workerName="createPolylineGeometry"},v=new r,C=new r,S=new r,w=new r;return y.createGeometry=function(o){var a,s,d,g,y,M,R,A=o._width,O=o._vertexFormat,T=o._colors,N=o._perVertex,I=o._followSurface,x=o._granularity,F=o._ellipsoid,_=o._positions;if(I){var b=m.extractHeights(_,F),L=i(T)?[]:void 0;if(i(T)){for(a=0;a<_.length-1;a++)if(g=_[a],y=_[a+1],M=T[a],N&&a<T.length)R=T[a+1],L=L.concat(E(g,y,M,R,x));else{var D=m.numberOfPoints(g,y,x);for(s=0;D>s;s++)L.push(e.clone(M))}L.push(e.clone(T[T.length-1])),T=L}_=m.generateCartesianArc({positions:_,granularity:x,ellipsoid:F,height:b})}else _=o._positions;var P,z=4*_.length-4,B=new Float64Array(3*z),U=new Float64Array(3*z),q=new Float64Array(3*z),G=new Float32Array(2*z),W=O.st?new Float32Array(2*z):void 0,Y=i(T)?new Uint8Array(4*z):void 0,H=0,V=0,K=0,k=0,j=_.length;for(s=0;j>s;++s){0===s?(P=v,r.subtract(_[0],_[1],P),r.add(_[0],P,P)):P=_[s-1],r.clone(P,S),r.clone(_[s],C),s===j-1?(P=v,r.subtract(_[j-1],_[j-2],P),r.add(_[j-1],P,P)):P=_[s+1],r.clone(P,w);var Z,Q;i(Y)&&(Z=0===s||N?T[s]:T[s-1],s!==j-1&&(Q=T[s]));var X=0===s?2:0,J=s===j-1?2:4;for(d=X;J>d;++d){r.pack(C,B,H),r.pack(S,U,H),r.pack(w,q,H),H+=3;var $=0>d-2?-1:1;if(G[V++]=2*(d%2)-1,G[V++]=$*A,O.st&&(W[K++]=s/(j-1),W[K++]=Math.max(G[V-2],0)),i(Y)){var tr=2>d?Z:Q;Y[k++]=e.floatToByte(tr.red),Y[k++]=e.floatToByte(tr.green),Y[k++]=e.floatToByte(tr.blue),Y[k++]=e.floatToByte(tr.alpha)}}}var rr=new c;rr.position=new l({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:B}),rr.prevPosition=new l({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:U}),rr.nextPosition=new l({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:q}),rr.expandAndWidth=new l({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:G}),O.st&&(rr.st=new l({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:W})),i(Y)&&(rr.color=new l({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:4,values:Y,normalize:!0}));var er=h.createTypedArray(z,6*_.length-6),nr=0,or=0,ir=_.length-1;for(s=0;ir>s;++s)er[or++]=nr,er[or++]=nr+2,er[or++]=nr+1,er[or++]=nr+1,er[or++]=nr+2,er[or++]=nr+3,nr+=4;return new u({attributes:rr,indices:er,primitiveType:p.TRIANGLES,boundingSphere:t.fromPoints(_),geometryType:f.POLYLINES})},y}),define("Workers/createPolylineGeometry",["../Core/Ellipsoid","../Core/PolylineGeometry"],function(t,r){"use strict";function e(e){return e._ellipsoid=t.clone(e._ellipsoid),r.createGeometry(e)}return e})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==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(r){e=r.stack}this.stack=e}return 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("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:0>t?-1:0},o.signNotZero=function(t){return 0>t?-1:1},o.toSNorm=function(t){return Math.round(255*(.5*o.clamp(t,-1,1)+.5))},o.fromSNorm=function(t){return o.clamp(t,0,255)/255*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.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 i=Math.abs(t-r);return o>=i||i<=n*Math.max(Math.abs(t),Math.abs(r))};var i=[1];o.factorial=function(t){var e=i.length;if(t>=e)for(var r=i[e-1],n=e;t>=n;n++)i.push(r*n);return i[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 e>t?e:t>r?r:t};var a=new t;return o.setRandomNumberSeed=function(e){a=new t(e)},o.nextRandomNumber=function(){return a.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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,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(r,n){e(n)||(n=new i);var o=r.clock,a=r.cone,s=t(r.magnitude,1),u=s*Math.sin(a);return n.x=u*Math.cos(o),n.y=u*Math.sin(o),n.z=s*Math.cos(a),n},i.fromElements=function(t,r,n,o){return e(o)?(o.x=t,o.y=r,o.z=n,o):new i(t,r,n)},i.clone=function(t,r){return e(t)?e(r)?(r.x=t.x,r.y=t.y,r.z=t.z,r):new i(t.x,t.y,t.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(e,r,n){n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z},i.unpack=function(r,n,o){return n=t(n,0),e(o)||(o=new i),o.x=r[n++],o.y=r[n++],o.z=r[n],o},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 a=new i;i.distance=function(t,e){return i.subtract(t,e,a),i.magnitude(a)},i.distanceSquared=function(t,e){return i.subtract(t,e,a),i.magnitudeSquared(a)},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.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 u=new i,E=new i;i.angleBetween=function(t,e){i.normalize(t,u),i.normalize(e,E);var r=i.dot(u,E),n=i.magnitude(i.cross(u,E,u));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,r){return t===r||e(t)&&e(r)&&t.x===r.x&&t.y===r.y&&t.z===r.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,r,n,i){return t===r||e(t)&&e(r)&&o.equalsEpsilon(t.x,r.x,n,i)&&o.equalsEpsilon(t.y,r.y,n,i)&&o.equalsEpsilon(t.z,r.z,n,i)},i.cross=function(t,e,r){var n=t.x,o=t.y,i=t.z,a=e.x,s=e.y,u=e.z,E=o*u-i*s,l=i*a-n*u,c=n*s-o*a;return r.x=E,r.y=l,r.z=c,r},i.fromDegrees=function(t,e,r,n,a){var s=o.toRadians(t),u=o.toRadians(e);return i.fromRadians(s,u,r,n,a)};var c=new i,_=new i,R=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(r,n,o,a,s){o=t(o,0);var u=e(a)?a.radiiSquared:R,E=Math.cos(n);c.x=E*Math.cos(r),c.y=E*Math.sin(r),c.z=Math.sin(n),c=i.normalize(c,c),i.multiplyComponents(u,c,_);var l=Math.sqrt(i.dot(c,_));return _=i.divideByScalar(_,l,_),c=i.multiplyByScalar(c,o,c),e(s)||(s=new i),i.add(_,c,s)},i.fromDegreesArray=function(t,e,r){for(var n=new Array(t.length),a=0;a<t.length;a++)n[a]=o.toRadians(t[a]);return i.fromRadiansArray(n,e,r)},i.fromRadiansArray=function(t,r,n){var o=t.length;e(n)?n.length=o/2:n=new Array(o/2);for(var a=0;o>a;a+=2){var s=t[a],u=t[a+1];n[a/2]=i.fromRadians(s,u,0,r,n[a/2])}return n},i.fromDegreesArrayHeights=function(t,e,r){for(var n=new Array(t.length),a=0;a<t.length;a+=3)n[a]=o.toRadians(t[a]),n[a+1]=o.toRadians(t[a+1]),n[a+2]=t[a+2];return i.fromRadiansArrayHeights(n,e,r)},i.fromRadiansArrayHeights=function(t,r,n){var o=t.length;e(n)?n.length=o/3:n=new Array(o/3);for(var a=0;o>a;a+=3){var s=t[a],u=t[a+1],E=t[a+2];n[a/3]=i.fromRadians(s,u,E,r,n[a/3])}return n},i.ZERO=n(new i(0,0,0)),i.UNIT_X=n(new i(1,0,0)),i.UNIT_Y=n(new i(0,1,0)),i.UNIT_Z=n(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,s,u,E){var l=r.x,c=r.y,_=r.z,R=o.x,f=o.y,T=o.z,h=l*l*R*R,A=c*c*f*f,d=_*_*T*T,S=h+A+d,m=Math.sqrt(1/S),C=t.multiplyByScalar(r,m,i);if(u>S)return isFinite(m)?t.clone(C,E):void 0;var N=s.x,I=s.y,M=s.z,p=a;p.x=C.x*N*2,p.y=C.y*I*2,p.z=C.z*M*2;var O,g,F,y,L,v,D,U,P,w,B,x=(1-m)*t.magnitude(r)/(.5*t.magnitude(p)),G=0;do{x-=G,F=1/(1+x*N),y=1/(1+x*I),L=1/(1+x*M),v=F*F,D=y*y,U=L*L,P=v*F,w=D*y,B=U*L,O=h*v+A*D+d*U-1,g=h*P*N+A*w*I+d*B*M;var b=-2*g;G=O/b}while(Math.abs(O)>n.EPSILON12);return e(E)?(E.x=l*F,E.y=c*y,E.z=_*L,E):new t(l*F,c*y,_*L)}var i=new t,a=new t;return o}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,r,n,o,i,a){"use strict";function s(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)}s.fromRadians=function(t,n,o,i){return o=e(o,0),r(i)?(i.longitude=t,i.latitude=n,i.height=o,i):new s(t,n,o)},s.fromDegrees=function(t,e,r,n){return t=i.toRadians(t),e=i.toRadians(e),s.fromRadians(t,e,r,n)};var u=new t,E=new t,l=new t,c=new t(1/6378137,1/6378137,1/6356752.314245179),_=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=i.EPSILON1;return s.fromCartesian=function(e,n,o){var f=r(n)?n.oneOverRadii:c,T=r(n)?n.oneOverRadiiSquared:_,h=r(n)?n._centerToleranceSquared:R,A=a(e,f,T,h,E);if(r(A)){var d=t.multiplyComponents(e,T,u);d=t.normalize(d,d);var S=t.subtract(e,A,l),m=Math.atan2(d.y,d.x),C=Math.asin(d.z),N=i.sign(t.dot(S,e))*t.magnitude(S);return r(o)?(o.longitude=m,o.latitude=C,o.height=N,o):new s(m,C,N)}},s.clone=function(t,e){return r(t)?r(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new s(t.longitude,t.latitude,t.height):void 0},s.equals=function(t,e){return t===e||r(t)&&r(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},s.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},s.ZERO=o(new s(0,0,0)),s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.prototype.equalsEpsilon=function(t,e){return s.equalsEpsilon(this,t,e)},s.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},s}),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,i,a,s,u){"use strict";function E(e,n,o,i){n=r(n,0),o=r(o,0),i=r(i,0),e._radii=new t(n,o,i),e._radiiSquared=new t(n*n,o*o,i*i),e._radiiToTheFourth=new t(n*n*n*n,o*o*o*o,i*i*i*i),e._oneOverRadii=new t(0===n?0:1/n,0===o?0:1/o,0===i?0:1/i),e._oneOverRadiiSquared=new t(0===n?0:1/(n*n),0===o?0:1/(o*o),0===i?0:1/(i*i)),e._minimumRadius=Math.min(n,o,i),e._maximumRadius=Math.max(n,o,i),e._centerToleranceSquared=s.EPSILON1}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,E(this,t,e,r)}o(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 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 l(o.x,o.y,o.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=a(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=a(new l(1,1,1)),l.MOON=a(new l(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),l.prototype.clone=function(t){return l.clone(this,t)},l.packedLength=t.packedLength,l.pack=function(e,n,o){o=r(o,0),t.pack(e._radii,n,o)},l.unpack=function(e,n,o){n=r(n,0);var i=t.unpack(e,n);return l.fromCartesian3(i,o)},l.prototype.geocentricSurfaceNormal=t.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(e,r){var o=e.longitude,i=e.latitude,a=Math.cos(i),s=a*Math.cos(o),u=a*Math.sin(o),E=Math.sin(i);return n(r)||(r=new t),r.x=s,r.y=u,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,_=new t;l.prototype.cartographicToCartesian=function(e,r){var o=c,i=_;this.geodeticSurfaceNormalCartographic(e,o),t.multiplyComponents(this._radiiSquared,o,i);var a=Math.sqrt(t.dot(o,i));return t.divideByScalar(i,a,i),t.multiplyByScalar(o,e.height,o),n(r)||(r=new t),t.add(i,o,r)},l.prototype.cartographicArrayToCartesianArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var o=0;r>o;o++)e[o]=this.cartographicToCartesian(t[o],e[o]);return e};var R=new t,f=new t,T=new t;return l.prototype.cartesianToCartographic=function(r,o){var i=this.scaleToGeodeticSurface(r,f);if(n(i)){var a=this.geodeticSurfaceNormal(i,R),u=t.subtract(r,i,T),E=Math.atan2(a.y,a.x),l=Math.asin(a.z),c=s.sign(t.dot(u,r))*t.magnitude(u);return n(o)?(o.longitude=E,o.latitude=l,o.height=c,o):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 o=0;r>o;++o)e[o]=this.cartesianToCartographic(t[o],e[o]);return e},l.prototype.scaleToGeodeticSurface=function(t,e){return u(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},l.prototype.scaleToGeocentricSurface=function(e,r){n(r)||(r=new t);var o=e.x,i=e.y,a=e.z,s=this._oneOverRadiiSquared,u=1/Math.sqrt(o*o*s.x+i*i*s.y+a*a*s.z);return t.multiplyByScalar(e,u,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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,r,n,o,i,a){"use strict";function s(t){this._ellipsoid=r(t,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return o(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.prototype.project=function(e,r){var o=this._semimajorAxis,i=e.longitude*o,a=e.latitude*o,s=e.height;return n(r)?(r.x=i,r.y=a,r.z=s,r):new t(i,a,s)},s.prototype.unproject=function(t,r){var o=this._oneOverSemimajorAxis,i=t.x*o,a=t.y*o,s=t.z;return n(r)?(r.longitude=i,r.latitude=a,r.height=s,r):new e(i,a,s)},s}),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","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,o,i){"use strict";function a(t,r,n,o,i,a,s,u,E){this[0]=e(t,0),this[1]=e(o,0),this[2]=e(s,0),this[3]=e(r,0),this[4]=e(i,0),this[5]=e(u,0),this[6]=e(n,0),this[7]=e(a,0),this[8]=e(E,0)}function s(t){for(var e=0,r=0;9>r;++r){var n=t[r];e+=n*n}return Math.sqrt(e)}function u(t){for(var e=0,r=0;3>r;++r){var n=t[a.getElementIndex(R[r],_[r])];e+=2*n*n}return Math.sqrt(e)}function E(t,e){for(var r=i.EPSILON15,n=0,o=1,s=0;3>s;++s){var u=Math.abs(t[a.getElementIndex(R[s],_[s])]);u>n&&(o=s,n=u)}var E=1,l=0,c=_[o],f=R[o];if(Math.abs(t[a.getElementIndex(f,c)])>r){var T,h=t[a.getElementIndex(f,f)],A=t[a.getElementIndex(c,c)],d=t[a.getElementIndex(f,c)],S=(h-A)/2/d;T=0>S?-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=a.clone(a.IDENTITY,e),e[a.getElementIndex(c,c)]=e[a.getElementIndex(f,f)]=E,e[a.getElementIndex(f,c)]=l,e[a.getElementIndex(c,f)]=-l,e}a.packedLength=9,a.pack=function(t,r,n){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]},a.unpack=function(t,n,o){return n=e(n,0),r(o)||(o=new a),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},a.clone=function(t,e){return r(t)?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 a(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},a.fromArray=function(t,n,o){return n=e(n,0),r(o)||(o=new a),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},a.fromColumnMajorArray=function(t,e){return a.clone(t,e)},a.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 a(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},a.fromQuaternion=function(t,e){var n=t.x*t.x,o=t.x*t.y,i=t.x*t.z,s=t.x*t.w,u=t.y*t.y,E=t.y*t.z,l=t.y*t.w,c=t.z*t.z,_=t.z*t.w,R=t.w*t.w,f=n-u-c+R,T=2*(o-_),h=2*(i+l),A=2*(o+_),d=-n+u-c+R,S=2*(E-s),m=2*(i-l),C=2*(E+s),N=-n-u+c+R;return r(e)?(e[0]=f,e[1]=A,e[2]=m,e[3]=T,e[4]=d,e[5]=C,e[6]=h,e[7]=S,e[8]=N,e):new a(f,T,h,A,d,S,m,C,N)},a.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 a(t.x,0,0,0,t.y,0,0,0,t.z)},a.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 a(t,0,0,0,t,0,0,0,t)},a.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 a(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},a.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 a(1,0,0,0,n,-o,0,o,n)},a.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 a(n,0,o,0,1,0,-o,0,n)},a.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 a(n,-o,0,o,n,0,0,0,1)},a.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]]},a.getElementIndex=function(t,e){return 3*t+e},a.getColumn=function(t,e,r){var n=3*e,o=t[n],i=t[n+1],a=t[n+2];return r.x=o,r.y=i,r.z=a,r},a.setColumn=function(t,e,r,n){n=a.clone(t,n);var o=3*e;return n[o]=r.x,n[o+1]=r.y,n[o+2]=r.z,n},a.getRow=function(t,e,r){var n=t[e],o=t[e+3],i=t[e+6];return r.x=n,r.y=o,r.z=i,r},a.setRow=function(t,e,r,n){return n=a.clone(t,n),n[e]=r.x,n[e+3]=r.y,n[e+6]=r.z,n};var l=new t;a.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 c=new t;a.getMaximumScale=function(e){return a.getScale(e,c),t.maximumComponent(c)},a.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],i=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],a=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],s=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],u=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]=o,r[2]=i,r[3]=a,r[4]=s,r[5]=u,r[6]=E,r[7]=l,r[8]=c,r},a.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},a.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},a.multiplyByVector=function(t,e,r){var n=e.x,o=e.y,i=e.z,a=t[0]*n+t[3]*o+t[6]*i,s=t[1]*n+t[4]*o+t[7]*i,u=t[2]*n+t[5]*o+t[8]*i;return r.x=a,r.y=s,r.z=u,r},a.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},a.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},a.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},a.transpose=function(t,e){var r=t[0],n=t[3],o=t[6],i=t[1],a=t[4],s=t[7],u=t[2],E=t[5],l=t[8];return e[0]=r,e[1]=n,e[2]=o,e[3]=i,e[4]=a,e[5]=s,e[6]=u,e[7]=E,e[8]=l,e};var _=[1,0,0],R=[2,2,1],f=new a,T=new a;return a.computeEigenDecomposition=function(t,e){var n=i.EPSILON20,o=10,l=0,c=0;r(e)||(e={});for(var _=e.unitary=a.clone(a.IDENTITY,e.unitary),R=e.diagonal=a.clone(t,e.diagonal),h=n*s(R);o>c&&u(R)>h;)E(R,f),a.transpose(f,T),a.multiply(R,f,R),a.multiply(T,R,R),a.multiply(_,f,_),++l>2&&(++c,l=0);return e},a.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},a.determinant=function(t){var e=t[0],r=t[3],n=t[6],o=t[1],i=t[4],a=t[7],s=t[2],u=t[5],E=t[8];return e*(i*E-u*a)+o*(u*n-r*E)+s*(r*a-i*n)},a.inverse=function(t,e){var r=t[0],o=t[1],s=t[2],u=t[3],E=t[4],l=t[5],c=t[6],_=t[7],R=t[8],f=a.determinant(t);if(Math.abs(f)<=i.EPSILON15)throw new n("matrix is not invertible");e[0]=E*R-_*l,e[1]=_*s-o*R,e[2]=o*l-E*s,e[3]=c*l-u*R,e[4]=r*R-c*s,e[5]=u*s-r*l,e[6]=u*_-c*E,e[7]=c*o-r*_,e[8]=r*E-u*o;var T=1/f;return a.multiplyByScalar(e,T,e)},a.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]},a.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},a.IDENTITY=o(new a(1,0,0,0,1,0,0,0,1)),a.ZERO=o(new a(0,0,0,0,0,0,0,0,0)),a.COLUMN0ROW0=0,a.COLUMN0ROW1=1,a.COLUMN0ROW2=2,a.COLUMN1ROW0=3,a.COLUMN1ROW1=4,a.COLUMN1ROW2=5,a.COLUMN2ROW0=6,a.COLUMN2ROW1=7,a.COLUMN2ROW2=8,a.prototype.clone=function(t){return a.clone(this,t)},a.prototype.equals=function(t){return a.equals(this,t)},a.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]},a.prototype.equalsEpsilon=function(t,e){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},a}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,o){"use strict";function i(e,r,n,o){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(o,0)}i.fromElements=function(t,r,n,o,a){return e(a)?(a.x=t,a.y=r,a.z=n,a.w=o,a):new i(t,r,n,o)},i.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 i(t.red,t.green,t.blue,t.alpha)},i.clone=function(t,r){return e(t)?e(r)?(r.x=t.x,r.y=t.y,r.z=t.z,r.w=t.w,r):new i(t.x,t.y,t.z,t.w):void 0},i.packedLength=4,i.pack=function(e,r,n){n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w},i.unpack=function(r,n,o){return n=t(n,0),e(o)||(o=new i),o.x=r[n++],o.y=r[n++],o.z=r[n++],o.w=r[n],o},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 a=new i;i.distance=function(t,e){return i.subtract(t,e,a),i.magnitude(a)},i.distanceSquared=function(t,e){return i.subtract(t,e,a),i.magnitudeSquared(a)},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.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 u=new i;return i.mostOrthogonalAxis=function(t,e){var r=i.normalize(t,u);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,r){return t===r||e(t)&&e(r)&&t.x===r.x&&t.y===r.y&&t.z===r.z&&t.w===r.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,r,n,i){return t===r||e(t)&&e(r)&&o.equalsEpsilon(t.x,r.x,n,i)&&o.equalsEpsilon(t.y,r.y,n,i)&&o.equalsEpsilon(t.z,r.z,n,i)&&o.equalsEpsilon(t.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(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(r){e=r.stack}this.stack=e}return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,r,n,o,i,a,s,u){"use strict";function E(t,e,n,o,i,a,s,u,E,l,c,_,R,f,T,h){this[0]=r(t,0),this[1]=r(i,0),this[2]=r(E,0),this[3]=r(R,0),this[4]=r(e,0),this[5]=r(a,0),this[6]=r(l,0),this[7]=r(f,0),this[8]=r(n,0),this[9]=r(s,0),this[10]=r(c,0),this[11]=r(T,0),this[12]=r(o,0),this[13]=r(u,0),this[14]=r(_,0),this[15]=r(h,0)}E.packedLength=16,E.pack=function(t,e,n){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,o){return e=r(e,0),n(o)||(o=new E),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},E.clone=function(t,e){return n(t)?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 E(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]):void 0},E.fromArray=E.unpack,E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.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 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])},E.fromRotationTranslation=function(e,o,i){return o=r(o,t.ZERO),n(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]=o.x,i[13]=o.y,i[14]=o.z,i[15]=1,i):new E(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)},E.fromTranslationQuaternionRotationScale=function(t,e,r,o){n(o)||(o=new E);var i=r.x,a=r.y,s=r.z,u=e.x*e.x,l=e.x*e.y,c=e.x*e.z,_=e.x*e.w,R=e.y*e.y,f=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=u-R-h+d,m=2*(l-A),C=2*(c+T),N=2*(l+A),I=-u+R-h+d,M=2*(f-_),p=2*(c-T),O=2*(f+_),g=-u-R+h+d;return o[0]=S*i,o[1]=N*i,o[2]=p*i,o[3]=0,o[4]=m*a,o[5]=I*a,o[6]=O*a,o[7]=0,o[8]=C*s,o[9]=M*s,o[10]=g*s,o[11]=0,o[12]=t.x,o[13]=t.y,o[14]=t.z,o[15]=1,o},E.fromTranslationRotationScale=function(t,e){return E.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},E.fromTranslation=function(t,e){return E.fromRotationTranslation(s.IDENTITY,t,e)},E.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 E(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},E.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 E(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var l=new t,c=new t,_=new t;E.fromCamera=function(e,r){var o=e.eye,i=e.target,a=e.up;t.normalize(t.subtract(i,o,l),l),t.normalize(t.cross(l,a,c),c),t.normalize(t.cross(c,l,_),_);var s=c.x,u=c.y,R=c.z,f=l.x,T=l.y,h=l.z,A=_.x,d=_.y,S=_.z,m=o.x,C=o.y,N=o.z,I=s*-m+u*-C+R*-N,M=A*-m+d*-C+S*-N,p=f*m+T*C+h*N; +return n(r)?(r[0]=s,r[1]=A,r[2]=-f,r[3]=0,r[4]=u,r[5]=d,r[6]=-T,r[7]=0,r[8]=R,r[9]=S,r[10]=-h,r[11]=0,r[12]=I,r[13]=M,r[14]=p,r[15]=1,r):new E(s,u,R,I,A,d,S,M,-f,-T,-h,p,0,0,0,1)},E.computePerspectiveFieldOfView=function(t,e,r,n,o){var i=Math.tan(.5*t),a=1/i,s=a/e,u=(n+r)/(r-n),E=2*n*r/(r-n);return o[0]=s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=u,o[11]=-1,o[12]=0,o[13]=0,o[14]=E,o[15]=0,o},E.computeOrthographicOffCenter=function(t,e,r,n,o,i,a){var s=1/(e-t),u=1/(n-r),E=1/(i-o),l=-(e+t)*s,c=-(n+r)*u,_=-(i+o)*E;return s*=2,u*=2,E*=-2,a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=l,a[13]=c,a[14]=_,a[15]=1,a},E.computePerspectiveOffCenter=function(t,e,r,n,o,i,a){var s=2*o/(e-t),u=2*o/(n-r),E=(e+t)/(e-t),l=(n+r)/(n-r),c=-(i+o)/(i-o),_=-1,R=-2*i*o/(i-o);return a[0]=s,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]=l,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=R,a[15]=0,a},E.computeInfinitePerspectiveOffCenter=function(t,e,r,n,o,i){var a=2*o/(e-t),s=2*o/(n-r),u=(e+t)/(e-t),E=(n+r)/(n-r),l=-1,c=-1,_=-2*o;return i[0]=a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=u,i[9]=E,i[10]=l,i[11]=c,i[12]=0,i[13]=0,i[14]=_,i[15]=0,i},E.computeViewportTransformation=function(t,e,n,o){t=r(t,r.EMPTY_OBJECT);var i=r(t.x,0),a=r(t.y,0),s=r(t.width,0),u=r(t.height,0);e=r(e,0),n=r(n,1);var E=.5*s,l=.5*u,c=.5*(n-e),_=E,R=l,f=c,T=i+E,h=a+l,A=e+c,d=1;return o[0]=_,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=R,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=f,o[11]=0,o[12]=T,o[13]=h,o[14]=A,o[15]=d,o},E.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]]},E.getElementIndex=function(t,e){return 4*t+e},E.getColumn=function(t,e,r){var n=4*e,o=t[n],i=t[n+1],a=t[n+2],s=t[n+3];return r.x=o,r.y=i,r.z=a,r.w=s,r},E.setColumn=function(t,e,r,n){n=E.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},E.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},E.getRow=function(t,e,r){var n=t[e],o=t[e+4],i=t[e+8],a=t[e+12];return r.x=n,r.y=o,r.z=i,r.w=a,r},E.setRow=function(t,e,r,n){return n=E.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;E.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 f=new t;E.getMaximumScale=function(e){return E.getScale(e,f),t.maximumComponent(f)},E.multiply=function(t,e,r){var n=t[0],o=t[1],i=t[2],a=t[3],s=t[4],u=t[5],E=t[6],l=t[7],c=t[8],_=t[9],R=t[10],f=t[11],T=t[12],h=t[13],A=t[14],d=t[15],S=e[0],m=e[1],C=e[2],N=e[3],I=e[4],M=e[5],p=e[6],O=e[7],g=e[8],F=e[9],y=e[10],L=e[11],v=e[12],D=e[13],U=e[14],P=e[15],w=n*S+s*m+c*C+T*N,B=o*S+u*m+_*C+h*N,x=i*S+E*m+R*C+A*N,G=a*S+l*m+f*C+d*N,b=n*I+s*M+c*p+T*O,z=o*I+u*M+_*p+h*O,H=i*I+E*M+R*p+A*O,V=a*I+l*M+f*p+d*O,q=n*g+s*F+c*y+T*L,X=o*g+u*F+_*y+h*L,W=i*g+E*F+R*y+A*L,Y=a*g+l*F+f*y+d*L,K=n*v+s*D+c*U+T*P,k=o*v+u*D+_*U+h*P,Z=i*v+E*D+R*U+A*P,j=a*v+l*D+f*U+d*P;return r[0]=w,r[1]=B,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},E.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},E.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},E.multiplyTransformation=function(t,e,r){var n=t[0],o=t[1],i=t[2],a=t[4],s=t[5],u=t[6],E=t[8],l=t[9],c=t[10],_=t[12],R=t[13],f=t[14],T=e[0],h=e[1],A=e[2],d=e[4],S=e[5],m=e[6],C=e[8],N=e[9],I=e[10],M=e[12],p=e[13],O=e[14],g=n*T+a*h+E*A,F=o*T+s*h+l*A,y=i*T+u*h+c*A,L=n*d+a*S+E*m,v=o*d+s*S+l*m,D=i*d+u*S+c*m,U=n*C+a*N+E*I,P=o*C+s*N+l*I,w=i*C+u*N+c*I,B=n*M+a*p+E*O+_,x=o*M+s*p+l*O+R,G=i*M+u*p+c*O+f;return r[0]=g,r[1]=F,r[2]=y,r[3]=0,r[4]=L,r[5]=v,r[6]=D,r[7]=0,r[8]=U,r[9]=P,r[10]=w,r[11]=0,r[12]=B,r[13]=x,r[14]=G,r[15]=1,r},E.multiplyByMatrix3=function(t,e,r){var n=t[0],o=t[1],i=t[2],a=t[4],s=t[5],u=t[6],E=t[8],l=t[9],c=t[10],_=e[0],R=e[1],f=e[2],T=e[3],h=e[4],A=e[5],d=e[6],S=e[7],m=e[8],C=n*_+a*R+E*f,N=o*_+s*R+l*f,I=i*_+u*R+c*f,M=n*T+a*h+E*A,p=o*T+s*h+l*A,O=i*T+u*h+c*A,g=n*d+a*S+E*m,F=o*d+s*S+l*m,y=i*d+u*S+c*m;return r[0]=C,r[1]=N,r[2]=I,r[3]=0,r[4]=M,r[5]=p,r[6]=O,r[7]=0,r[8]=g,r[9]=F,r[10]=y,r[11]=0,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r},E.multiplyByTranslation=function(t,e,r){var n=e.x,o=e.y,i=e.z,a=n*t[0]+o*t[4]+i*t[8]+t[12],s=n*t[1]+o*t[5]+i*t[9]+t[13],u=n*t[2]+o*t[6]+i*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]=a,r[13]=s,r[14]=u,r[15]=t[15],r};var T=new t;E.multiplyByUniformScale=function(t,e,r){return T.x=e,T.y=e,T.z=e,E.multiplyByScale(t,T,r)},E.multiplyByScale=function(t,e,r){var n=e.x,o=e.y,i=e.z;return 1===n&&1===o&&1===i?E.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]=i*t[8],r[9]=i*t[9],r[10]=i*t[10],r[11]=0,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=1,r)},E.multiplyByVector=function(t,e,r){var n=e.x,o=e.y,i=e.z,a=e.w,s=t[0]*n+t[4]*o+t[8]*i+t[12]*a,u=t[1]*n+t[5]*o+t[9]*i+t[13]*a,E=t[2]*n+t[6]*o+t[10]*i+t[14]*a,l=t[3]*n+t[7]*o+t[11]*i+t[15]*a;return r.x=s,r.y=u,r.z=E,r.w=l,r},E.multiplyByPointAsVector=function(t,e,r){var n=e.x,o=e.y,i=e.z,a=t[0]*n+t[4]*o+t[8]*i,s=t[1]*n+t[5]*o+t[9]*i,u=t[2]*n+t[6]*o+t[10]*i;return r.x=a,r.y=s,r.z=u,r},E.multiplyByPoint=function(t,e,r){var n=e.x,o=e.y,i=e.z,a=t[0]*n+t[4]*o+t[8]*i+t[12],s=t[1]*n+t[5]*o+t[9]*i+t[13],u=t[2]*n+t[6]*o+t[10]*i+t[14];return r.x=a,r.y=s,r.z=u,r},E.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},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[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},E.transpose=function(t,e){var r=t[1],n=t[2],o=t[3],i=t[6],a=t[7],s=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]=i,e[10]=t[10],e[11]=t[14],e[12]=o,e[13]=a,e[14]=s,e[15]=t[15],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[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},E.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]},E.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},E.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},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 h=new s,A=new s,d=new e,S=new e(0,0,0,1);return E.inverse=function(t,r){if(s.equalsEpsilon(E.getRotation(t,h),A,a.EPSILON7)&&e.equals(E.getRow(t,3,d),S))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],i=t[8],l=t[12],c=t[1],_=t[5],R=t[9],f=t[13],T=t[2],m=t[6],C=t[10],N=t[14],I=t[3],M=t[7],p=t[11],O=t[15],g=C*O,F=N*p,y=m*O,L=N*M,v=m*p,D=C*M,U=T*O,P=N*I,w=T*p,B=C*I,x=T*M,G=m*I,b=g*_+L*R+v*f-(F*_+y*R+D*f),z=F*c+U*R+B*f-(g*c+P*R+w*f),H=y*c+P*_+x*f-(L*c+U*_+G*f),V=D*c+w*_+G*R-(v*c+B*_+x*R),q=F*o+y*i+D*l-(g*o+L*i+v*l),X=g*n+P*i+w*l-(F*n+U*i+B*l),W=L*n+U*o+G*l-(y*n+P*o+x*l),Y=v*n+B*o+x*i-(D*n+w*o+G*i);g=i*f,F=l*R,y=o*f,L=l*_,v=o*R,D=i*_,U=n*f,P=l*c,w=n*R,B=i*c,x=n*_,G=o*c;var K=g*M+L*p+v*O-(F*M+y*p+D*O),k=F*I+U*p+B*O-(g*I+P*p+w*O),Z=y*I+P*M+x*O-(L*I+U*M+G*O),j=D*I+w*M+G*p-(v*I+B*M+x*p),Q=y*C+D*N+F*m-(v*N+g*m+L*C),J=w*N+g*T+P*C-(U*C+B*N+F*T),$=U*m+G*N+L*T-(x*N+y*T+P*m),tt=x*C+v*T+B*m-(w*m+G*C+D*T),et=n*b+o*z+i*H+l*V;if(Math.abs(et)<a.EPSILON20)throw new u("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},E.inverseTransformation=function(t,e){var r=t[0],n=t[1],o=t[2],i=t[4],a=t[5],s=t[6],u=t[8],E=t[9],l=t[10],c=t[12],_=t[13],R=t[14],f=-r*c-n*_-o*R,T=-i*c-a*_-s*R,h=-u*c-E*_-l*R;return e[0]=r,e[1]=i,e[2]=u,e[3]=0,e[4]=n,e[5]=a,e[6]=E,e[7]=0,e[8]=o,e[9]=s,e[10]=l,e[11]=0,e[12]=f,e[13]=T,e[14]=h,e[15]=1,e},E.IDENTITY=i(new E(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),E.ZERO=i(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,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,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]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},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/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,i){var a=-t.dot(n,r);return e(i)?(t.clone(n,i.normal),i.distance=a,i):new o(n,a)};var i=new t;return o.fromCartesian4=function(r,n){var a=t.fromCartesian4(r,i),s=r.w;return e(n)?(t.clone(a,n.normal),n.distance=s,n):new o(a,s)},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/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,r,n,o,i,a,s){"use strict";function u(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(u.prototype,{width:{get:function(){return u.computeWidth(this)}},height:{get:function(){return u.computeHeight(this)}}}),u.packedLength=4,u.pack=function(t,r,n){n=e(n,0),r[n++]=t.west,r[n++]=t.south,r[n++]=t.east,r[n]=t.north},u.unpack=function(t,n,o){return n=e(n,0),r(o)||(o=new u),o.west=t[n++],o.south=t[n++],o.east=t[n++],o.north=t[n],o},u.computeWidth=function(t){var e=t.east,r=t.west;return r>e&&(e+=s.TWO_PI),e-r},u.computeHeight=function(t){return t.north-t.south},u.fromDegrees=function(t,n,o,i,a){return t=s.toRadians(e(t,0)),n=s.toRadians(e(n,0)),o=s.toRadians(e(o,0)),i=s.toRadians(e(i,0)),r(a)?(a.west=t,a.south=n,a.east=o,a.north=i,a):new u(t,n,o,i)},u.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,a=-Number.MAX_VALUE,E=Number.MAX_VALUE,l=-Number.MAX_VALUE,c=0,_=t.length;_>c;c++){var R=t[c];n=Math.min(n,R.longitude),o=Math.max(o,R.longitude),E=Math.min(E,R.latitude),l=Math.max(l,R.latitude);var f=R.longitude>=0?R.longitude:R.longitude+s.TWO_PI;i=Math.min(i,f),a=Math.max(a,f)}return o-n>a-i&&(n=i,o=a,o>s.PI&&(o-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(e)?(e.west=n,e.south=E,e.east=o,e.north=l,e):new u(n,E,o,l)},u.clone=function(t,e){return r(t)?r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new u(t.west,t.south,t.east,t.north):void 0},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.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},u.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},u.validate=function(t){},u.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)},u.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)},u.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)},u.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)},u.center=function(e,n){var o=e.east,i=e.west;i>o&&(o+=s.TWO_PI);var a=s.negativePiToPi(.5*(i+o)),u=.5*(e.south+e.north);return r(n)?(n.longitude=a,n.latitude=u,n.height=0,n):new t(a,u)},u.intersection=function(t,e,n){var o=t.east,i=t.west,a=e.east,E=e.west;i>o&&a>0?o+=s.TWO_PI:E>a&&o>0&&(a+=s.TWO_PI),i>o&&0>E?E+=s.TWO_PI:E>a&&0>i&&(i+=s.TWO_PI);var l=s.negativePiToPi(Math.max(i,E)),c=s.negativePiToPi(Math.min(o,a));if(!((t.west<t.east||e.west<e.east)&&l>=c)){var _=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(_>=R))return r(n)?(n.west=l,n.south=_,n.east=c,n.north=R,n):new u(l,_,c,R)}},u.union=function(t,e,n){return r(n)||(n=new u),n.west=Math.min(t.west,e.west),n.south=Math.min(t.south,e.south),n.east=Math.max(t.east,e.east),n.north=Math.max(t.north,e.north),n},u.expand=function(t,e,n){return r(n)||(n=new u),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},u.contains=function(t,e){var r=e.longitude,n=e.latitude,o=t.west,i=t.east;return o>i&&(i+=s.TWO_PI,0>r&&(r+=s.TWO_PI)),(r>o||s.equalsEpsilon(r,o,s.EPSILON14))&&(i>r||s.equalsEpsilon(r,i,s.EPSILON14))&&n>=t.south&&n<=t.north};var E=new t;return u.subsample=function(t,n,o,a){n=e(n,i.WGS84),o=e(o,0),r(a)||(a=[]);var l=0,c=t.north,_=t.south,R=t.east,f=t.west,T=E;T.height=o,T.longitude=f,T.latitude=c,a[l]=n.cartographicToCartesian(T,a[l]),l++,T.longitude=R,a[l]=n.cartographicToCartesian(T,a[l]),l++,T.latitude=_,a[l]=n.cartographicToCartesian(T,a[l]),l++,T.longitude=f,a[l]=n.cartographicToCartesian(T,a[l]),l++,0>c?T.latitude=c:_>0?T.latitude=_:T.latitude=0;for(var h=1;8>h;++h)T.longitude=-Math.PI+h*s.PI_OVER_TWO,u.contains(t,T)&&(a[l]=n.cartographicToCartesian(T,a[l]),l++);return 0===T.latitude&&(T.longitude=f,a[l]=n.cartographicToCartesian(T,a[l]),l++,T.longitude=R,a[l]=n.cartographicToCartesian(T,a[l]),l++),a.length=l,a},u.MAX_VALUE=a(new u(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Plane","./Rectangle"],function(t,e,r,n,o,i,a,s,u,E,l,c,_){"use strict";function R(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var f=new t,T=new t,h=new t,A=new t,d=new t,S=new t,m=new t,C=new t,N=new t,I=new t,M=new t,p=new t;R.fromPoints=function(e,r){if(n(r)||(r=new R),!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],m),i=t.clone(o,f),a=t.clone(o,T),s=t.clone(o,h),u=t.clone(o,A),E=t.clone(o,d),l=t.clone(o,S),c=e.length,_=1;c>_;_++){t.clone(e[_],o);var O=o.x,g=o.y,F=o.z;O<i.x&&t.clone(o,i),O>u.x&&t.clone(o,u),g<a.y&&t.clone(o,a),g>E.y&&t.clone(o,E),F<s.z&&t.clone(o,s),F>l.z&&t.clone(o,l)}var y=t.magnitudeSquared(t.subtract(u,i,C)),L=t.magnitudeSquared(t.subtract(E,a,C)),v=t.magnitudeSquared(t.subtract(l,s,C)),D=i,U=u,P=y;L>P&&(P=L,D=a,U=E),v>P&&(P=v,D=s,U=l);var w=N;w.x=.5*(D.x+U.x),w.y=.5*(D.y+U.y),w.z=.5*(D.z+U.z);var B=t.magnitudeSquared(t.subtract(U,w,C)),x=Math.sqrt(B),G=I;G.x=i.x,G.y=a.y,G.z=s.z;var b=M;b.x=u.x,b.y=E.y,b.z=l.z;var z=t.multiplyByScalar(t.add(G,b,C),.5,p),H=0;for(_=0;c>_;_++){t.clone(e[_],o);var V=t.magnitude(t.subtract(o,z,C));V>H&&(H=V);var q=t.magnitudeSquared(t.subtract(o,w,C));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*o.x)/X,w.y=(x*w.y+W*o.y)/X,w.z=(x*w.z+W*o.z)/X}}return H>x?(t.clone(w,r.center),r.radius=x):(t.clone(z,r.center),r.radius=H),r};var O=new a,g=new t,F=new t,y=new e,L=new e;R.fromRectangle2D=function(t,e,r){return R.fromRectangleWithHeights2D(t,e,0,0,r)},R.fromRectangleWithHeights2D=function(e,o,i,a,s){if(n(s)||(s=new R),!n(e))return s.center=t.clone(t.ZERO,s.center),s.radius=0,s;o=r(o,O),_.southwest(e,y),y.height=i,_.northeast(e,L),L.height=a;var u=o.project(y,g),E=o.project(L,F),l=E.x-u.x,c=E.y-u.y,f=E.z-u.z;s.radius=.5*Math.sqrt(l*l+c*c+f*f);var T=s.center;return T.x=u.x+.5*l,T.y=u.y+.5*c,T.z=u.z+.5*f,s};var v=[];R.fromRectangle3D=function(t,e,o,a){e=r(e,i.WGS84),o=r(o,0);var s;return n(t)&&(s=_.subsample(t,e,o,v)),R.fromPoints(s,a)},R.fromVertices=function(e,o,i,a){if(n(a)||(a=new R),!n(e)||0===e.length)return a.center=t.clone(t.ZERO,a.center),a.radius=0,a;o=r(o,t.ZERO),i=r(i,3);var s=m;s.x=e[0]+o.x,s.y=e[1]+o.y,s.z=e[2]+o.z;for(var u=t.clone(s,f),E=t.clone(s,T),l=t.clone(s,h),c=t.clone(s,A),_=t.clone(s,d),O=t.clone(s,S),g=e.length,F=0;g>F;F+=i){var y=e[F]+o.x,L=e[F+1]+o.y,v=e[F+2]+o.z;s.x=y,s.y=L,s.z=v,y<u.x&&t.clone(s,u),y>c.x&&t.clone(s,c),L<E.y&&t.clone(s,E),L>_.y&&t.clone(s,_),v<l.z&&t.clone(s,l),v>O.z&&t.clone(s,O)}var D=t.magnitudeSquared(t.subtract(c,u,C)),U=t.magnitudeSquared(t.subtract(_,E,C)),P=t.magnitudeSquared(t.subtract(O,l,C)),w=u,B=c,x=D;U>x&&(x=U,w=E,B=_),P>x&&(x=P,w=l,B=O);var G=N;G.x=.5*(w.x+B.x),G.y=.5*(w.y+B.y),G.z=.5*(w.z+B.z);var b=t.magnitudeSquared(t.subtract(B,G,C)),z=Math.sqrt(b),H=I;H.x=u.x,H.y=E.y,H.z=l.z;var V=M;V.x=c.x,V.y=_.y,V.z=O.z;var q=t.multiplyByScalar(t.add(H,V,C),.5,p),X=0;for(F=0;g>F;F+=i){s.x=e[F]+o.x,s.y=e[F+1]+o.y,s.z=e[F+2]+o.z;var W=t.magnitude(t.subtract(s,q,C));W>X&&(X=W);var Y=t.magnitudeSquared(t.subtract(s,G,C));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*s.x)/K,G.y=(z*G.y+k*s.y)/K,G.z=(z*G.z+k*s.z)/K}}return X>z?(t.clone(G,a.center),a.radius=z):(t.clone(q,a.center),a.radius=X),a},R.fromEncodedCartesianVertices=function(e,r,o){if(n(o)||(o=new R),!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 i=m;i.x=e[0]+r[0],i.y=e[1]+r[1],i.z=e[2]+r[2];for(var a=t.clone(i,f),s=t.clone(i,T),u=t.clone(i,h),E=t.clone(i,A),l=t.clone(i,d),c=t.clone(i,S),_=e.length,O=0;_>O;O+=3){var g=e[O]+r[O],F=e[O+1]+r[O+1],y=e[O+2]+r[O+2];i.x=g,i.y=F,i.z=y,g<a.x&&t.clone(i,a),g>E.x&&t.clone(i,E),F<s.y&&t.clone(i,s),F>l.y&&t.clone(i,l),y<u.z&&t.clone(i,u),y>c.z&&t.clone(i,c)}var L=t.magnitudeSquared(t.subtract(E,a,C)),v=t.magnitudeSquared(t.subtract(l,s,C)),D=t.magnitudeSquared(t.subtract(c,u,C)),U=a,P=E,w=L;v>w&&(w=v,U=s,P=l),D>w&&(w=D,U=u,P=c);var B=N;B.x=.5*(U.x+P.x),B.y=.5*(U.y+P.y),B.z=.5*(U.z+P.z);var x=t.magnitudeSquared(t.subtract(P,B,C)),G=Math.sqrt(x),b=I;b.x=a.x,b.y=s.y,b.z=u.z;var z=M;z.x=E.x,z.y=l.y,z.z=c.z;var H=t.multiplyByScalar(t.add(b,z,C),.5,p),V=0;for(O=0;_>O;O+=3){i.x=e[O]+r[O],i.y=e[O+1]+r[O+1],i.z=e[O+2]+r[O+2];var q=t.magnitude(t.subtract(i,H,C));q>V&&(V=q);var X=t.magnitudeSquared(t.subtract(i,B,C));if(X>x){var W=Math.sqrt(X);G=.5*(G+W),x=G*G;var Y=W-G;B.x=(G*B.x+Y*i.x)/W,B.y=(G*B.y+Y*i.y)/W,B.z=(G*B.z+Y*i.z)/W}}return V>G?(t.clone(B,o.center),o.radius=G):(t.clone(H,o.center),o.radius=V),o},R.fromCornerPoints=function(e,r,o){n(o)||(o=new R);var i=o.center;return t.add(e,r,i),t.multiplyByScalar(i,.5,i),o.radius=t.distance(i,r),o},R.fromEllipsoid=function(e,r){return n(r)||(r=new R),t.clone(t.ZERO,r.center),r.radius=e.maximumRadius,r};var D=new t;R.fromBoundingSpheres=function(e,r){if(n(r)||(r=new R),!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 R.clone(e[0],r);if(2===o)return R.union(e[0],e[1],r);for(var i=[],a=0;o>a;a++)i.push(e[a].center);r=R.fromPoints(i,r);var s=r.center,u=r.radius;for(a=0;o>a;a++){var E=e[a];u=Math.max(u,t.distance(s,E.center,D)+E.radius)}return r.radius=u,r};var U=new t,P=new t,w=new t;R.fromOrientedBoundingBox=function(e,r){n(r)||(r=new R);var o=e.halfAxes,i=E.getColumn(o,0,U),a=E.getColumn(o,1,P),s=E.getColumn(o,2,w),u=t.magnitude(i),l=t.magnitude(a),c=t.magnitude(s);return r.center=t.clone(e.center,r.center),r.radius=Math.max(u,l,c),r},R.clone=function(e,r){return n(e)?n(r)?(r.center=t.clone(e.center,r.center),r.radius=e.radius,r):new R(e.center,e.radius):void 0},R.packedLength=4,R.pack=function(t,e,n){n=r(n,0);var o=t.center;e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n]=t.radius},R.unpack=function(t,e,o){e=r(e,0),n(o)||(o=new R);var i=o.center;return i.x=t[e++],i.y=t[e++],i.z=t[e++],o.radius=t[e],o};var B=new t,x=new t;R.union=function(e,r,o){n(o)||(o=new R);var i=e.center,a=e.radius,s=r.center,u=r.radius,E=t.subtract(s,i,B),l=t.magnitude(E);if(a>=l+u)return e.clone(o),o;if(u>=l+a)return r.clone(o),o;var c=.5*(a+l+u),_=t.multiplyByScalar(E,(-a+c)/l,x);return t.add(_,i,_),t.clone(_,o.center),o.radius=c,o};var G=new t;R.expand=function(e,r,n){n=R.clone(e,n);var o=t.magnitude(t.subtract(r,n.center,G));return o>n.radius&&(n.radius=o),n},R.intersectPlane=function(e,r){var n=e.center,o=e.radius,i=r.normal,a=t.dot(i,n)+r.distance;return-o>a?s.OUTSIDE:o>a?s.INTERSECTING:s.INSIDE},R.transform=function(t,e,r){return n(r)||(r=new R),r.center=l.multiplyByPoint(e,t.center,r.center),r.radius=l.getMaximumScale(e)*t.radius,r};var b=new t;R.distanceSquaredTo=function(e,r){var n=t.subtract(e.center,r,b);return t.magnitudeSquared(n)-e.radius*e.radius},R.transformWithoutScale=function(t,e,r){return n(r)||(r=new R),r.center=l.multiplyByPoint(e,t.center,r.center),r.radius=t.radius,r};var z=new t;R.computePlaneDistances=function(e,r,o,i){n(i)||(i=new u);var a=t.subtract(e.center,r,z),s=t.dot(o,a);return i.start=s-e.radius,i.stop=s+e.radius,i};for(var H=new t,V=new t,q=new t,X=new t,W=new t,Y=new e,K=new Array(8),k=0;8>k;++k)K[k]=new t;var Z=new a;return R.projectTo2D=function(e,n,o){n=r(n,Z);var i=n.ellipsoid,a=e.center,s=e.radius,u=i.geodeticSurfaceNormal(a,H),E=t.cross(t.UNIT_Z,u,V);t.normalize(E,E);var l=t.cross(u,E,q);t.normalize(l,l),t.multiplyByScalar(u,s,u),t.multiplyByScalar(l,s,l),t.multiplyByScalar(E,s,E);var c=t.negate(l,W),_=t.negate(E,X),f=K,T=f[0];t.add(u,l,T),t.add(T,E,T),T=f[1],t.add(u,l,T),t.add(T,_,T),T=f[2],t.add(u,c,T),t.add(T,_,T),T=f[3],t.add(u,c,T),t.add(T,E,T),t.negate(u,u),T=f[4],t.add(u,l,T),t.add(T,E,T),T=f[5],t.add(u,l,T),t.add(T,_,T),T=f[6],t.add(u,c,T),t.add(T,_,T),T=f[7],t.add(u,c,T),t.add(T,E,T);for(var h=f.length,A=0;h>A;++A){var d=f[A];t.add(a,d,d);var S=i.cartesianToCartographic(d,Y);n.project(S,d)}o=R.fromPoints(f,o),a=o.center;var m=a.x,C=a.y,N=a.z;return a.x=N,a.y=m,a.z=C,o},R.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},R.equals=function(e,r){return e===r||n(e)&&n(r)&&t.equals(e.center,r.center)&&e.radius===r.radius},R.prototype.intersectPlane=function(t){return R.intersectPlane(this,t)},R.prototype.distanceSquaredTo=function(t){return R.distanceSquaredTo(this,t)},R.prototype.computePlaneDistances=function(t,e,r){return R.computePlaneDistances(this,t,e,r)},R.prototype.isOccluded=function(t){return R.isOccluded(this,t)},R.prototype.equals=function(t){return R.equals(this,t)},R.prototype.clone=function(t){return R.clone(this,t)},R}),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(){return o.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return o.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return o.supportsFullscreen()?null!==o.element:void 0}}}),o.supportsFullscreen=function(){if(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,i=["webkit","moz","o","ms","khtml"],a=0,s=i.length;s>a;++a){var u=i[a];o=u+"RequestFullscreen","function"==typeof e[o]?(n.requestFullscreen=o,r=!0):(o=u+"RequestFullScreen","function"==typeof e[o]&&(n.requestFullscreen=o,r=!0)),o=u+"ExitFullscreen","function"==typeof document[o]?n.exitFullscreen=o:(o=u+"CancelFullScreen","function"==typeof document[o]&&(n.exitFullscreen=o)),o=u+"FullscreenEnabled",t(document[o])?n.fullscreenEnabled=o:(o=u+"FullScreenEnabled",t(document[o])&&(n.fullscreenEnabled=o)),o=u+"FullscreenElement",t(document[o])?n.fullscreenElement=o:(o=u+"FullScreenElement",t(document[o])&&(n.fullscreenElement=o)),o=u+"fullscreenchange",t(document["on"+o])&&("ms"===u&&(o="MSFullscreenChange"),n.fullscreenchange=o),o=u+"fullscreenerror",t(document["on"+o])&&("ms"===u&&(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;n>r;++r)e[r]=parseInt(e[r],10);return e}function o(){if(!e(S)){S=!1;var t=/ Chrome\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(S=!0,m=n(t[1]))}return S}function i(){return o()&&m}function a(){if(!e(C)&&(C=!1,!o()&&/ Safari\/[\.0-9]+/.test(d.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(C=!0,N=n(t[1]))}return C}function s(){return a()&&N}function u(){if(!e(I)){I=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(d.userAgent);null!==t&&(I=!0,M=n(t[1]),M.isNightly=!!t[2])}return I}function E(){return u()&&M}function l(){if(!e(p)){p=!1;var t;"Microsoft Internet Explorer"===d.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(d.userAgent),null!==t&&(p=!0,O=n(t[1]))):"Netscape"===d.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(d.userAgent),null!==t&&(p=!0,O=n(t[1])))}return p}function c(){return l()&&O}function _(){if(!e(g)){g=!1;var t=/Firefox\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(g=!0,F=n(t[1]))}return g}function R(){return e(y)||(y=/Windows/i.test(d.appVersion)),y}function f(){return _()&&F}function T(){return e(L)||(L="undefined"!=typeof PointerEvent&&(!e(d.pointerEnabled)||d.pointerEnabled)),L}function h(){if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=t.style.imageRendering;D=e(r)&&""!==r,D&&(v=r)}return D}function A(){return h()?v:void 0}var d;d="undefined"!=typeof navigator?navigator:{};var S,m,C,N,I,M,p,O,g,F,y,L,v,D,U={isChrome:o,chromeVersion:i,isSafari:a,safariVersion:s,isWebkit:u,webkitVersion:E,isInternetExplorer:l,internetExplorerVersion:c,isFirefox:_,firefoxVersion:f,isWindows:R,hardwareConcurrency:t(d.hardwareConcurrency,3),supportsPointerEvents:T,supportsImageRenderingPixelated:h,imageRenderingValue:A};return U.supportsFullscreen=function(){return r.supportsFullscreen()},U.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},U.supportsWebWorkers=function(){return"undefined"!=typeof Worker},U}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(t,e,r,n,o,i){"use strict";function a(t,e,r){return 0>r&&(r+=1),r>1&&(r-=1),1>6*r?t+6*(e-t)*r:1>2*r?e:2>3*r?t+(e-t)*(2/3-r)*6:t}function s(e,r,n,o){this.red=t(e,1),this.green=t(r,1),this.blue=t(n,1),this.alpha=t(o,1)}s.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 s(t.x,t.y,t.z,t.w)},s.fromBytes=function(r,n,o,i,a){return r=s.byteToFloat(t(r,255)),n=s.byteToFloat(t(n,255)),o=s.byteToFloat(t(o,255)),i=s.byteToFloat(t(i,255)),e(a)?(a.red=r,a.green=n,a.blue=o,a.alpha=i,a):new s(r,n,o,i)},s.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 s(t.red,t.green,t.blue,r)};var u,E,l;n.supportsTypedArrays()&&(u=new ArrayBuffer(4),E=new Uint32Array(u),l=new Uint8Array(u)),s.fromRgba=function(t){return E[0]=t,s.fromBytes(l[0],l[1],l[2],l[3])},s.fromHsl=function(e,r,n,o){e=t(e,0)%1,r=t(r,0),n=t(n,0),o=t(o,1);var i=n,u=n,E=n;if(0!==r){var l;l=.5>n?n*(1+r):n+r-n*r;var c=2*n-l;i=a(c,l,e+1/3),u=a(c,l,e),E=a(c,l,e-1/3)}return new s(i,u,E,o)},s.fromRandom=function(r,n){r=t(r,t.EMPTY_OBJECT);var o=r.red;if(!e(o)){var a=t(r.minimumRed,0),u=t(r.maximumRed,1);o=a+i.nextRandomNumber()*(u-a)}var E=r.green;if(!e(E)){var l=t(r.minimumGreen,0),c=t(r.maximumGreen,1);E=l+i.nextRandomNumber()*(c-l)}var _=r.blue;if(!e(_)){var R=t(r.minimumBlue,0),f=t(r.maximumBlue,1);_=R+i.nextRandomNumber()*(f-R)}var T=r.alpha;if(!e(T)){var h=t(r.minimumAlpha,0),A=t(r.maximumAlpha,1);T=h+i.nextRandomNumber()*(A-h)}return e(n)?(n.red=o,n.green=E,n.blue=_,n.alpha=T,n):new s(o,E,_,T)};var c=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,_=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,R=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,f=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(r){var n=s[r.toUpperCase()];if(e(n))return s.clone(n);var o=c.exec(r);return null!==o?new s(parseInt(o[1],16)/15,parseInt(o[2],16)/15,parseInt(o[3],16)/15):(o=_.exec(r),null!==o?new s(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255):(o=R.exec(r),null!==o?new s(parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),parseFloat(t(o[4],"1.0"))):(o=f.exec(r),null!==o?s.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(t(o[4],"1.0"))):void 0)))},s.packedLength=4,s.pack=function(e,r,n){n=t(n,0),r[n++]=e.red,r[n++]=e.green,r[n++]=e.blue,r[n]=e.alpha},s.unpack=function(r,n,o){return n=t(n,0),e(o)||(o=new s),o.red=r[n++],o.green=r[n++],o.blue=r[n++],o.alpha=r[n],o},s.byteToFloat=function(t){return t/255},s.floatToByte=function(t){return 1===t?255:256*t|0},s.clone=function(t,r){return e(t)?e(r)?(r.red=t.red,r.green=t.green,r.blue=t.blue,r.alpha=t.alpha,r):new s(t.red,t.green,t.blue,t.alpha):void 0; +},s.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},s.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]},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.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},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var t=s.floatToByte(this.red),e=s.floatToByte(this.green),r=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+t+","+e+","+r+")":"rgba("+t+","+e+","+r+","+this.alpha+")"},s.prototype.toBytes=function(t){var r=s.floatToByte(this.red),n=s.floatToByte(this.green),o=s.floatToByte(this.blue),i=s.floatToByte(this.alpha);return e(t)?(t[0]=r,t[1]=n,t[2]=o,t[3]=i,t):[r,n,o,i]},s.prototype.toRgba=function(){return l[0]=s.floatToByte(this.red),l[1]=s.floatToByte(this.green),l[2]=s.floatToByte(this.blue),l[3]=s.floatToByte(this.alpha),E[0]},s.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},s.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},s.prototype.withAlpha=function(t,e){return s.fromAlpha(this,t,e)},s.ALICEBLUE=o(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=o(s.fromCssColorString("#FAEBD7")),s.AQUA=o(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=o(s.fromCssColorString("#7FFFD4")),s.AZURE=o(s.fromCssColorString("#F0FFFF")),s.BEIGE=o(s.fromCssColorString("#F5F5DC")),s.BISQUE=o(s.fromCssColorString("#FFE4C4")),s.BLACK=o(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=o(s.fromCssColorString("#FFEBCD")),s.BLUE=o(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=o(s.fromCssColorString("#8A2BE2")),s.BROWN=o(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=o(s.fromCssColorString("#DEB887")),s.CADETBLUE=o(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=o(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=o(s.fromCssColorString("#D2691E")),s.CORAL=o(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=o(s.fromCssColorString("#6495ED")),s.CORNSILK=o(s.fromCssColorString("#FFF8DC")),s.CRIMSON=o(s.fromCssColorString("#DC143C")),s.CYAN=o(s.fromCssColorString("#00FFFF")),s.DARKBLUE=o(s.fromCssColorString("#00008B")),s.DARKCYAN=o(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=o(s.fromCssColorString("#B8860B")),s.DARKGRAY=o(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=o(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=o(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=o(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=o(s.fromCssColorString("#556B2F")),s.DARKORANGE=o(s.fromCssColorString("#FF8C00")),s.DARKORCHID=o(s.fromCssColorString("#9932CC")),s.DARKRED=o(s.fromCssColorString("#8B0000")),s.DARKSALMON=o(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=o(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=o(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=o(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=o(s.fromCssColorString("#00CED1")),s.DARKVIOLET=o(s.fromCssColorString("#9400D3")),s.DEEPPINK=o(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=o(s.fromCssColorString("#00BFFF")),s.DIMGRAY=o(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=o(s.fromCssColorString("#1E90FF")),s.FIREBRICK=o(s.fromCssColorString("#B22222")),s.FLORALWHITE=o(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=o(s.fromCssColorString("#228B22")),s.FUSCHIA=o(s.fromCssColorString("#FF00FF")),s.GAINSBORO=o(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=o(s.fromCssColorString("#F8F8FF")),s.GOLD=o(s.fromCssColorString("#FFD700")),s.GOLDENROD=o(s.fromCssColorString("#DAA520")),s.GRAY=o(s.fromCssColorString("#808080")),s.GREEN=o(s.fromCssColorString("#008000")),s.GREENYELLOW=o(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=o(s.fromCssColorString("#F0FFF0")),s.HOTPINK=o(s.fromCssColorString("#FF69B4")),s.INDIANRED=o(s.fromCssColorString("#CD5C5C")),s.INDIGO=o(s.fromCssColorString("#4B0082")),s.IVORY=o(s.fromCssColorString("#FFFFF0")),s.KHAKI=o(s.fromCssColorString("#F0E68C")),s.LAVENDER=o(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=o(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=o(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=o(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=o(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=o(s.fromCssColorString("#F08080")),s.LIGHTCYAN=o(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=o(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=o(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=o(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=o(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=o(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=o(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=o(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=o(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=o(s.fromCssColorString("#FFFFE0")),s.LIME=o(s.fromCssColorString("#00FF00")),s.LIMEGREEN=o(s.fromCssColorString("#32CD32")),s.LINEN=o(s.fromCssColorString("#FAF0E6")),s.MAGENTA=o(s.fromCssColorString("#FF00FF")),s.MAROON=o(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=o(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=o(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=o(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=o(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=o(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=o(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=o(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=o(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=o(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=o(s.fromCssColorString("#191970")),s.MINTCREAM=o(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=o(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=o(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=o(s.fromCssColorString("#FFDEAD")),s.NAVY=o(s.fromCssColorString("#000080")),s.OLDLACE=o(s.fromCssColorString("#FDF5E6")),s.OLIVE=o(s.fromCssColorString("#808000")),s.OLIVEDRAB=o(s.fromCssColorString("#6B8E23")),s.ORANGE=o(s.fromCssColorString("#FFA500")),s.ORANGERED=o(s.fromCssColorString("#FF4500")),s.ORCHID=o(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=o(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=o(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=o(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=o(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=o(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=o(s.fromCssColorString("#FFDAB9")),s.PERU=o(s.fromCssColorString("#CD853F")),s.PINK=o(s.fromCssColorString("#FFC0CB")),s.PLUM=o(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=o(s.fromCssColorString("#B0E0E6")),s.PURPLE=o(s.fromCssColorString("#800080")),s.RED=o(s.fromCssColorString("#FF0000")),s.ROSYBROWN=o(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=o(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=o(s.fromCssColorString("#8B4513")),s.SALMON=o(s.fromCssColorString("#FA8072")),s.SANDYBROWN=o(s.fromCssColorString("#F4A460")),s.SEAGREEN=o(s.fromCssColorString("#2E8B57")),s.SEASHELL=o(s.fromCssColorString("#FFF5EE")),s.SIENNA=o(s.fromCssColorString("#A0522D")),s.SILVER=o(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=o(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=o(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=o(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=o(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=o(s.fromCssColorString("#00FF7F")),s.STEELBLUE=o(s.fromCssColorString("#4682B4")),s.TAN=o(s.fromCssColorString("#D2B48C")),s.TEAL=o(s.fromCssColorString("#008080")),s.THISTLE=o(s.fromCssColorString("#D8BFD8")),s.TOMATO=o(s.fromCssColorString("#FF6347")),s.TURQUOISE=o(s.fromCssColorString("#40E0D0")),s.VIOLET=o(s.fromCssColorString("#EE82EE")),s.WHEAT=o(s.fromCssColorString("#F5DEB3")),s.WHITE=o(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=o(s.fromCssColorString("#F5F5F5")),s.YELLOW=o(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=o(s.fromCssColorString("#9ACD32")),s.TRANSPARENT=o(new s(0,0,0,0)),s}),define("Renderer/WebGLConstants",["../Core/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",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,e,r,n,o,i){"use strict";if(!o.supportsTypedArrays())return{};var a={BYTE:t.BYTE,UNSIGNED_BYTE:t.UNSIGNED_BYTE,SHORT:t.SHORT,UNSIGNED_SHORT:t.UNSIGNED_SHORT,FLOAT:t.FLOAT,DOUBLE:t.DOUBLE};return a.getSizeInBytes=function(t){switch(t){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(t){return t instanceof Int8Array?a.BYTE:t instanceof Uint8Array?a.UNSIGNED_BYTE:t instanceof Int16Array?a.SHORT:t instanceof Uint16Array?a.UNSIGNED_SHORT:t instanceof Float32Array?a.FLOAT:t instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(t){return r(t)&&(t===a.BYTE||t===a.UNSIGNED_BYTE||t===a.SHORT||t===a.UNSIGNED_SHORT||t===a.FLOAT||t===a.DOUBLE)},a.createTypedArray=function(t,e){switch(t){case a.BYTE:return new Int8Array(e);case a.UNSIGNED_BYTE:return new Uint8Array(e);case a.SHORT:return new Int16Array(e);case a.UNSIGNED_SHORT:return new Uint16Array(e);case a.FLOAT:return new Float32Array(e);case a.DOUBLE:return new Float64Array(e);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(t,r,o,i){switch(o=e(o,0),i=e(i,(r.byteLength-o)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(r,o,i);case a.UNSIGNED_BYTE:return new Uint8Array(r,o,i);case a.SHORT:return new Int16Array(r,o,i);case a.UNSIGNED_SHORT:return new Uint16Array(r,o,i);case a.FLOAT:return new Float32Array(r,o,i);case a.DOUBLE:return new Float64Array(r,o,i);default:throw new n("componentDatatype is not a valid value.")}},i(a)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["../Renderer/WebGLConstants","./freezeObject"],function(t,e){"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(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 e(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,r,n,o){"use strict";function i(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=void 0}return i.computeNumberOfVertices=function(t){var n=-1;for(var o in t.attributes)if(t.attributes.hasOwnProperty(o)&&e(t.attributes[o])&&e(t.attributes[o].values)){var i=t.attributes[o],a=i.values.length/i.componentsPerAttribute;if(n!==a&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=a}return n},i}),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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,o){"use strict";var i={UNSIGNED_BYTE:t.UNSIGNED_BYTE,UNSIGNED_SHORT:t.UNSIGNED_SHORT,UNSIGNED_INT:t.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(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(t,e){return t>=o.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},i.createTypedArrayFromArrayBuffer=function(t,e,r,n){return t>=o.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,r,n):new Uint16Array(e,r,n)},n(i)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(t,e,r,n,o,i,a,s){"use strict";function u(t){var e=t._uSquared,r=t._ellipsoid.maximumRadius,n=t._ellipsoid.minimumRadius,o=(r-n)/r,i=Math.cos(t._startHeading),a=Math.sin(t._startHeading),s=(1-o)*Math.tan(t._start.latitude),u=1/Math.sqrt(1+s*s),E=u*s,l=Math.atan2(s,i),c=u*a,_=c*c,R=1-_,f=Math.sqrt(R),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,C=1-3*T+35*h/4,N=1-5*T,I=S*l-m*Math.sin(2*l)*T/2-C*Math.sin(4*l)*h/16-N*Math.sin(6*l)*A/48-5*Math.sin(8*l)*d/512,M=t._constants;M.a=r,M.b=n,M.f=o,M.cosineHeading=i,M.sineHeading=a,M.tanU=s,M.cosineU=u,M.sineU=E,M.sigma=l,M.sineAlpha=c,M.sineSquaredAlpha=_,M.cosineSquaredAlpha=R,M.cosineAlpha=f,M.u2Over4=T,M.u4Over16=h,M.u6Over64=A,M.u8Over256=d,M.a0=S,M.a1=m,M.a2=C,M.a3=N,M.distanceRatio=I}function E(t,e){return t*e*(4+t*(4-3*e))/16}function l(t,e,r,n,o,i,a){var s=E(t,r);return(1-s)*t*e*(n+s*o*(a+s*i*(2*a*a-1)))}function c(t,e,r,n,o,i,a){var u,E,c,_,R,f=(e-r)/e,T=i-n,h=Math.atan((1-f)*Math.tan(o)),A=Math.atan((1-f)*Math.tan(a)),d=Math.cos(h),S=Math.sin(h),m=Math.cos(A),C=Math.sin(A),N=d*m,I=d*C,M=S*C,p=S*m,O=T,g=s.TWO_PI,F=Math.cos(O),y=Math.sin(O);do{F=Math.cos(O),y=Math.sin(O);var L=I-p*F;c=Math.sqrt(m*m*y*y+L*L),E=M+N*F,u=Math.atan2(c,E);var v;0===c?(v=0,_=1):(v=N*y/c,_=1-v*v),g=O,R=E-2*M/_,isNaN(R)&&(R=0),O=T+l(f,v,_,u,c,E,R)}while(Math.abs(O-g)>s.EPSILON12);var D=_*(e*e-r*r)/(r*r),U=1+D*(4096+D*(D*(320-175*D)-768))/16384,P=D*(256+D*(D*(74-47*D)-128))/1024,w=R*R,B=P*c*(R+P*(E*(2*w-1)-P*R*(4*c*c-3)*(4*w-3)/6)/4),x=r*U*(u-B),G=Math.atan2(m*y,I-p*F),b=Math.atan2(d*y,I*F-p);t._distance=x,t._startHeading=G,t._endHeading=b,t._uSquared=D}function _(r,n,o,i){t.normalize(i.cartographicToCartesian(n,T),f),t.normalize(i.cartographicToCartesian(o,T),T);c(r,i.maximumRadius,i.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,u(r)}function R(t,o,i){var s=r(i,a.WGS84);this._ellipsoid=s,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)&&_(this,t,o,s)}var f=new t,T=new t;return o(R.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}}}),R.prototype.setEndPoints=function(t,e){_(this,t,e,this._ellipsoid)},R.prototype.interpolateUsingFraction=function(t,e){return this.interpolateUsingSurfaceDistance(this._distance*t,e)},R.prototype.interpolateUsingSurfaceDistance=function(t,r){var o=this._constants,i=o.distanceRatio+t/o.b,a=Math.cos(2*i),s=Math.cos(4*i),u=Math.cos(6*i),E=Math.sin(2*i),c=Math.sin(4*i),_=Math.sin(6*i),R=Math.sin(8*i),f=i*i,T=i*f,h=o.u8Over256,A=o.u2Over4,d=o.u6Over64,S=o.u4Over16,m=2*T*h*a/3+i*(1-A+7*S/4-15*d/4+579*h/64-(S-15*d/4+187*h/16)*a-(5*d/4-115*h/16)*s-29*h*u/16)+(A/2-S+71*d/32-85*h/16)*E+(5*S/16-5*d/4+383*h/96)*c-f*((d-11*h/2)*E+5*h*c/2)+(29*d/96-29*h/16)*_+539*h*R/1536,C=Math.asin(Math.sin(m)*o.cosineAlpha),N=Math.atan(o.a/o.b*Math.tan(C));m-=o.sigma;var I=Math.cos(2*o.sigma+m),M=Math.sin(m),p=Math.cos(m),O=o.cosineU*p,g=o.sineU*M,F=Math.atan2(M*o.sineHeading,O-g*o.cosineHeading),y=F-l(o.f,o.sineAlpha,o.cosineSquaredAlpha,m,M,p,I);return n(r)?(r.longitude=this._start.longitude+y,r.latitude=N,r.height=0,r):new e(this._start.longitude+y,N,0)},R}),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 i;if(0===t)return 0===n?[]:[-o/n];if(0===n){if(0===o)return[0,0];var a=Math.abs(o),s=Math.abs(t);if(s>a&&a/s<e.EPSILON14)return[0,0];if(a>s&&s/a<e.EPSILON14)return[];if(i=-o/t,0>i)return[];var u=Math.sqrt(i);return[-u,u]}if(0===o)return i=-n/t,0>i?[i,0]:[0,i];var E=n*n,l=4*t*o,c=r(E,-l,e.EPSILON14);if(0>c)return[];var _=-.5*r(n,e.sign(n)*Math.sqrt(c),e.EPSILON14);return n>0?[_/t,o/_]:[o/_,_/t]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(t,e){"use strict";function r(t,e,r,n){var o,i,a=t,s=e/3,u=r/3,E=n,l=a*u,c=s*E,_=s*s,R=u*u,f=a*u-_,T=a*E-s*u,h=s*E-R,A=4*f*h-T*T;if(0>A){var d,S,m;_*c>=l*R?(d=a,S=f,m=-2*s*f+a*T):(d=E,S=h,m=-E*T+2*u*h);var C=0>m?-1:1,N=-C*Math.abs(d)*Math.sqrt(-A);i=-m+N;var I=i/2,M=0>I?-Math.pow(-I,1/3):Math.pow(I,1/3),p=i===N?-M:-S/M;return o=0>=S?M+p:-m/(M*M+p*p+S),_*c>=l*R?[(o-s)/a]:[-E/(o+u)]}var O=f,g=-2*s*f+a*T,F=h,y=-E*T+2*u*h,L=Math.sqrt(A),v=Math.sqrt(3)/2,D=Math.abs(Math.atan2(a*L,-g)/3);o=2*Math.sqrt(-O);var U=Math.cos(D);i=o*U;var P=o*(-U/2-v*Math.sin(D)),w=i+P>2*s?i-s:P-s,B=a,x=w/B;D=Math.abs(Math.atan2(E*L,-y)/3),o=2*Math.sqrt(-F),U=Math.cos(D),i=o*U,P=o*(-U/2-v*Math.sin(D));var G=-E,b=2*u>i+P?i+u:P+u,z=G/b,H=B*b,V=-w*b-B*G,q=w*G,X=(u*V-s*q)/(-s*V+u*H);return X>=x?z>=x?z>=X?[x,X,z]:[x,z,X]:[z,x,X]:z>=x?[X,x,z]:z>=X?[X,z,x]:[z,X,x]}var n={};return n.computeDiscriminant=function(t,e,r,n){var o=t*t,i=e*e,a=r*r,s=n*n,u=18*t*e*r*n+i*a-27*o*s-4*(t*a*r+i*e*n);return u},n.computeRealRoots=function(t,n,o,i){var a,s;if(0===t)return e.computeRealRoots(n,o,i);if(0===n){if(0===o){if(0===i)return[0,0,0];s=-i/t;var u=0>s?-Math.pow(-s,1/3):Math.pow(s,1/3);return[u,u,u]}return 0===i?(a=e.computeRealRoots(t,0,o),0===a.Length?[0]:[a[0],0,a[1]]):r(t,0,o,i)}return 0===o?0===i?(s=-n/t,0>s?[s,0,0]:[0,0,s]):r(t,n,0,i):0===i?(a=e.computeRealRoots(t,n,o),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]]):r(t,n,o,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(t,e,r,n){ +"use strict";function o(e,o,i,a){var s=e*e,u=o-3*s/8,E=i-o*e/2+s*e/8,l=a-i*e/4+o*s/16-3*s*s/256,c=t.computeRealRoots(1,2*u,u*u-4*l,-E*E);if(c.length>0){var _=-e/4,R=c[c.length-1];if(Math.abs(R)<r.EPSILON14){var f=n.computeRealRoots(1,u,l);if(2===f.length){var T,h=f[0],A=f[1];if(h>=0&&A>=0){var d=Math.sqrt(h),S=Math.sqrt(A);return[_-S,_-d,_+d,_+S]}if(h>=0&&0>A)return T=Math.sqrt(h),[_-T,_+T];if(0>h&&A>=0)return T=Math.sqrt(A),[_-T,_+T]}return[]}if(R>0){var m=Math.sqrt(R),C=(u+R-E/m)/2,N=(u+R+E/m)/2,I=n.computeRealRoots(1,m,C),M=n.computeRealRoots(1,-m,N);return 0!==I.length?(I[0]+=_,I[1]+=_,0!==M.length?(M[0]+=_,M[1]+=_,I[1]<=M[0]?[I[0],I[1],M[0],M[1]]:M[1]<=I[0]?[M[0],M[1],I[0],I[1]]:I[0]>=M[0]&&I[1]<=M[1]?[M[0],I[0],I[1],M[1]]:M[0]>=I[0]&&M[1]<=I[1]?[I[0],M[0],M[1],I[1]]:I[0]>M[0]&&I[0]<M[1]?[M[0],I[0],M[1],I[1]]:[I[0],M[0],I[1],M[1]]):I):0!==M.length?(M[0]+=_,M[1]+=_,M):[]}}return[]}function i(e,o,i,a){var s=i*i,u=o*o,E=e*e,l=-2*o,c=i*e+u-4*a,_=E*a-i*o*e+s,R=t.computeRealRoots(1,l,c,_);if(R.length>0){var f,T,h=R[0],A=o-h,d=A*A,S=e/2,m=A/2,C=d-4*a,N=d+4*Math.abs(a),I=E-4*h,M=E+4*Math.abs(h);if(0>h||I*N>C*M){var p=Math.sqrt(I);f=p/2,T=0===p?0:(e*m-i)/p}else{var O=Math.sqrt(C);f=0===O?0:(e*m-i)/O,T=O/2}var g,F;0===S&&0===f?(g=0,F=0):r.sign(S)===r.sign(f)?(g=S+f,F=h/g):(F=S-f,g=h/F);var y,L;0===m&&0===T?(y=0,L=0):r.sign(m)===r.sign(T)?(y=m+T,L=a/y):(L=m-T,y=a/L);var v=n.computeRealRoots(1,g,y),D=n.computeRealRoots(1,F,L);if(0!==v.length)return 0!==D.length?v[1]<=D[0]?[v[0],v[1],D[0],D[1]]:D[1]<=v[0]?[D[0],D[1],v[0],v[1]]:v[0]>=D[0]&&v[1]<=D[1]?[D[0],v[0],v[1],D[1]]:D[0]>=v[0]&&D[1]<=v[1]?[v[0],D[0],D[1],v[1]]:v[0]>D[0]&&v[0]<D[1]?[D[0],v[0],D[1],v[1]]:[v[0],D[0],v[1],D[1]]:v;if(0!==D.length)return D}return[]}var a={};return a.computeDiscriminant=function(t,e,r,n,o){var i=t*t,a=i*t,s=e*e,u=s*e,E=r*r,l=E*r,c=n*n,_=c*n,R=o*o,f=R*o,T=s*E*c-4*u*_-4*t*l*c+18*t*e*r*_-27*i*c*c+256*a*f+o*(18*u*r*n-4*s*l+16*t*E*E-80*t*e*E*n-6*t*s*c+144*i*r*c)+R*(144*t*s*r-27*s*s-128*i*E-192*i*e*n);return T},a.computeRealRoots=function(e,n,a,s,u){if(Math.abs(e)<r.EPSILON15)return t.computeRealRoots(n,a,s,u);var E=n/e,l=a/e,c=s/e,_=u/e,R=0>E?1:0;switch(R+=0>l?R+1:R,R+=0>c?R+1:R,R+=0>_?R+1:R){case 0:return o(E,l,c,_);case 1:return i(E,l,c,_);case 2:return i(E,l,c,_);case 3:return o(E,l,c,_);case 4:return o(E,l,c,_);case 5:return i(E,l,c,_);case 6:return o(E,l,c,_);case 7:return o(E,l,c,_);case 8:return i(E,l,c,_);case 9:return o(E,l,c,_);case 10:return o(E,l,c,_);case 11:return i(E,l,c,_);case 12:return o(E,l,c,_);case 13:return o(E,l,c,_);case 14:return o(E,l,c,_);case 15:return o(E,l,c,_);default:return}},a}),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,i,a,s,u,E){"use strict";function l(e,n,o,a,s){s=r(s,!1);var u,E,l,c,_,R=e.origin,f=e.direction,T=t.subtract(o,n,h),C=t.subtract(a,n,A),N=t.cross(f,C,d),I=t.dot(T,N);if(s){if(I<i.EPSILON6)return;if(u=t.subtract(R,n,S),l=t.dot(u,N),0>l||l>I)return;if(E=t.cross(u,T,m),c=t.dot(f,E),0>c||l+c>I)return;_=t.dot(C,E)/I}else{if(Math.abs(I)<i.EPSILON6)return;var M=1/I;if(u=t.subtract(R,n,S),l=t.dot(u,N)*M,0>l||l>1)return;if(E=t.cross(u,T,m),c=t.dot(f,E)*M,0>c||l+c>1)return;_=t.dot(C,E)*M}return _}function c(t,e,r,n){var o=e*e-4*t*r;if(!(0>o)){if(o>0){var i=1/(2*t),a=Math.sqrt(o),s=(-e+a)*i,u=(-e-a)*i;return u>s?(n.root0=s,n.root1=u):(n.root0=u,n.root1=s),n}var E=-e/(2*t);if(0!==E)return n.root0=n.root1=E,n}}function _(e,r,o){n(o)||(o={});var i=e.origin,a=e.direction,s=r.center,u=r.radius*r.radius,E=t.subtract(i,s,d),l=t.dot(a,a),_=2*t.dot(a,E),R=t.magnitudeSquared(E)-u,f=c(l,_,R,N);return n(f)?(o.start=f.root0,o.stop=f.root1,o):void 0}function R(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 f(e,r,n,o,E){var l,c=o*o,_=E*E,f=(e[a.COLUMN1ROW1]-e[a.COLUMN2ROW2])*_,T=E*(o*R(e[a.COLUMN1ROW0],e[a.COLUMN0ROW1],i.EPSILON15)+r.y),h=e[a.COLUMN0ROW0]*c+e[a.COLUMN2ROW2]*_+o*r.x+n,A=_*R(e[a.COLUMN2ROW1],e[a.COLUMN1ROW2],i.EPSILON15),d=E*(o*R(e[a.COLUMN2ROW0],e[a.COLUMN0ROW2])+r.z),S=[];if(0===d&&0===A){if(l=s.computeRealRoots(f,T,h),0===l.length)return S;var m=l[0],C=Math.sqrt(Math.max(1-m*m,0));if(S.push(new t(o,E*m,E*-C)),S.push(new t(o,E*m,E*C)),2===l.length){var N=l[1],I=Math.sqrt(Math.max(1-N*N,0));S.push(new t(o,E*N,E*-I)),S.push(new t(o,E*N,E*I))}return S}var M=d*d,p=A*A,O=f*f,g=d*A,F=O+p,y=2*(T*f+g),L=2*h*f+T*T-p+M,v=2*(h*T-g),D=h*h-M;if(0===F&&0===y&&0===L&&0===v)return S;l=u.computeRealRoots(F,y,L,v,D);var U=l.length;if(0===U)return S;for(var P=0;U>P;++P){var w,B=l[P],x=B*B,G=Math.max(1-x,0),b=Math.sqrt(G);w=i.sign(f)===i.sign(h)?R(f*x+h,T*B,i.EPSILON12):i.sign(h)===i.sign(T*B)?R(f*x,T*B+h,i.EPSILON12):R(f*x+T*B,h,i.EPSILON12);var z=R(A*B,d,i.EPSILON15),H=w*z;0>H?S.push(new t(o,E*B,E*b)):H>0?S.push(new t(o,E*B,E*-b)):0!==b?(S.push(new t(o,E*B,E*-b)),S.push(new t(o,E*B,E*b)),++P):S.push(new t(o,E*B,E*b))}return S}var T={};T.rayPlane=function(e,r,o){n(o)||(o=new t);var a=e.origin,s=e.direction,u=r.normal,E=t.dot(u,s);if(!(Math.abs(E)<i.EPSILON15)){var l=(-r.distance-t.dot(u,a))/E;if(!(0>l))return o=t.multiplyByScalar(s,l,o),t.add(a,o,o)}};var h=new t,A=new t,d=new t,S=new t,m=new t;T.rayTriangle=function(e,r,o,i,a,s){var u=l(e,r,o,i,a);if(n(u)&&!(0>u))return n(s)||(s=new t),t.multiplyByScalar(e.direction,u,s),t.add(e.origin,s,s)};var C=new E;T.lineSegmentTriangle=function(e,r,o,i,a,s,u){var E=C;t.clone(e,E.origin),t.subtract(r,e,E.direction),t.normalize(E.direction,E.direction);var c=l(E,o,i,a,s);return!n(c)||0>c||c>t.distance(e,r)?void 0:(n(u)||(u=new t),t.multiplyByScalar(E.direction,c,u),t.add(E.origin,u,u))};var N={root0:0,root1:0};T.raySphere=function(t,e,r){return r=_(t,e,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var I=new E;T.lineSegmentSphere=function(e,r,o,i){var a=I,s=t.subtract(r,e,a.direction),u=t.magnitude(s);return t.normalize(s,s),i=_(a,o,i),!n(i)||i.stop<0||i.start>u?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,u),i)};var M=new t,p=new t;T.rayEllipsoid=function(e,r){var n,o,i,a,s,u=r.oneOverRadii,E=t.multiplyComponents(u,e.origin,M),l=t.multiplyComponents(u,e.direction,p),c=t.magnitudeSquared(E),_=t.dot(E,l);if(c>1){if(_>=0)return;var R=_*_;if(n=c-1,o=t.magnitudeSquared(l),i=o*n,i>R)return;if(R>i){a=_*_-i,s=-_+Math.sqrt(a);var f=s/o,T=n/s;return T>f?{start:f,stop:T}:{start:T,stop:f}}var h=Math.sqrt(n/o);return{start:h,stop:h}}return 1>c?(n=c-1,o=t.magnitudeSquared(l),i=o*n,a=_*_-i,s=-_+Math.sqrt(a),{start:0,stop:s/o}):0>_?(o=t.magnitudeSquared(l),{start:0,stop:-_/o}):void 0};var O=new t,g=new t,F=new t,y=new t,L=new t,v=new a,D=new a,U=new a,P=new a,w=new a,B=new a,x=new a,G=new t,b=new t,z=new e;T.grazingAltitudeLocation=function(e,r){var o=e.origin,s=e.direction,u=r.geodeticSurfaceNormal(o,O);if(t.dot(s,u)>=0)return o;var E=n(this.rayEllipsoid(e,r)),l=r.transformPositionToScaledSpace(s,O),c=t.normalize(l,l),_=t.mostOrthogonalAxis(l,y),R=t.normalize(t.cross(_,c,g),g),T=t.normalize(t.cross(c,R,F),F),h=v;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=a.transpose(h,D),d=a.fromScale(r.radii,U),S=a.fromScale(r.oneOverRadii,P),m=w;m[0]=0,m[1]=-s.z,m[2]=s.y,m[3]=s.z,m[4]=0,m[5]=-s.x,m[6]=-s.y,m[7]=s.x,m[8]=0;var C,N,I=a.multiply(a.multiply(A,S,B),m,B),M=a.multiply(a.multiply(I,d,x),h,x),p=a.multiplyByVector(I,o,L),H=f(M,t.negate(p,O),0,0,1),V=H.length;if(V>0){for(var q=t.clone(t.ZERO,b),X=Number.NEGATIVE_INFINITY,W=0;V>W;++W){C=a.multiplyByVector(d,a.multiplyByVector(h,H[W],G),G);var Y=t.normalize(t.subtract(C,o,y),y),K=t.dot(Y,s);K>X&&(X=K,q=t.clone(C,q))}var k=r.cartesianToCartographic(q,z);return X=i.clamp(X,0,1),N=t.magnitude(t.subtract(q,o,y))*Math.sqrt(1-X*X),N=E?-N:N,k.height=N,r.cartographicToCartesian(k,new t)}};var H=new t;return T.lineSegmentPlane=function(e,r,o,a){n(a)||(a=new t);var s=t.subtract(r,e,H),u=o.normal,E=t.dot(u,s);if(!(Math.abs(E)<i.EPSILON6)){var l=t.dot(u,e),c=-(o.distance+l)/E;if(!(0>c||c>1))return t.multiplyByScalar(s,c,a),t.add(e,a,a),a}},T.trianglePlaneIntersection=function(e,r,n,o){var i=o.normal,a=o.distance,s=t.dot(i,e)+a<0,u=t.dot(i,r)+a<0,E=t.dot(i,n)+a<0,l=0;l+=s?1:0,l+=u?1:0,l+=E?1:0;var c,_;if((1===l||2===l)&&(c=new t,_=new t),1===l){if(s)return T.lineSegmentPlane(e,r,o,c),T.lineSegmentPlane(e,n,o,_),{positions:[e,r,n,c,_],indices:[0,3,4,1,2,4,1,4,3]};if(u)return T.lineSegmentPlane(r,n,o,c),T.lineSegmentPlane(r,e,o,_),{positions:[e,r,n,c,_],indices:[1,3,4,2,0,4,2,4,3]};if(E)return T.lineSegmentPlane(n,e,o,c),T.lineSegmentPlane(n,r,o,_),{positions:[e,r,n,c,_],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!s)return T.lineSegmentPlane(r,e,o,c),T.lineSegmentPlane(n,e,o,_),{positions:[e,r,n,c,_],indices:[1,2,4,1,4,3,0,3,4]};if(!u)return T.lineSegmentPlane(n,r,o,c),T.lineSegmentPlane(e,r,o,_),{positions:[e,r,n,c,_],indices:[2,0,4,2,4,3,1,3,4]};if(!E)return T.lineSegmentPlane(e,n,o,c),T.lineSegmentPlane(r,n,o,_),{positions:[e,r,n,c,_],indices:[0,1,4,0,4,3,2,3,4]}}},T}),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/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(t,e,r,n,o,i,a,s,u,E,l,c){"use strict";function _(t,e,r){var n=M;n.length=t;var o;if(e===r){for(o=0;t>o;o++)n[o]=e;return n}var i=r-e,a=i/t;for(o=0;t>o;o++){var s=e+o*a;n[o]=s}return n}function R(e,r,n,o,i,a,s,u){var E=o.scaleToGeodeticSurface(e,F),l=o.scaleToGeodeticSurface(r,y),c=f.numberOfPoints(e,r,n),R=o.cartesianToCartographic(E,p),T=o.cartesianToCartographic(l,O),h=_(c,i,a);L.setEndPoints(R,T);var A=L.surfaceDistance/c,d=u;R.height=i;var S=o.cartographicToCartesian(R,g);t.pack(S,s,d),d+=3;for(var m=1;c>m;m++){var C=L.interpolateUsingSurfaceDistance(m*A,O);C.height=h[m],S=o.cartographicToCartesian(C,g),t.pack(S,s,d),d+=3}return d}var f={};f.numberOfPoints=function(e,r,n){var o=t.distance(e,r);return Math.ceil(o/n)};var T=new e;f.extractHeights=function(t,e){for(var r=t.length,n=new Array(r),o=0;r>o;o++){var i=t[o];n[o]=e.cartesianToCartographic(i,T).height}return n};var h=new l,A=new t,d=new t,S=new c(t.ZERO,0),m=new t,C=new c(t.ZERO,0),N=new t,I=new t,M=[],p=new e,O=new e,g=new t,F=new t,y=new t,L=new a;f.wrapLongitude=function(e,o){var i=[],a=[];if(n(e)&&e.length>0){o=r(o,l.IDENTITY);var u=l.inverseTransformation(o,h),E=l.multiplyByPoint(u,t.ZERO,A),_=l.multiplyByPointAsVector(u,t.UNIT_Y,d),R=c.fromPointNormal(E,_,S),f=l.multiplyByPointAsVector(u,t.UNIT_X,m),T=c.fromPointNormal(E,f,C),M=1;i.push(t.clone(e[0]));for(var p=i[0],O=e.length,g=1;O>g;++g){var F=e[g];if(c.getPointDistance(T,p)<0||c.getPointDistance(T,F)<0){var y=s.lineSegmentPlane(p,F,R,N);if(n(y)){var L=t.multiplyByScalar(_,5e-9,I);c.getPointDistance(R,p)<0&&t.negate(L,L),i.push(t.add(y,L,new t)),a.push(M+1),t.negate(L,L),i.push(t.add(y,L,new t)),M=1}}i.push(t.clone(e[g])),M++,p=F}a.push(M)}return{positions:i,lengths:a}};var v=E.EPSILON10;return f.removeDuplicates=function(e){var r=e.length;if(2>r)return e;var n,o,i;for(n=1;r>n&&(o=e[n-1],i=e[n],!t.equalsEpsilon(o,i,v));++n);if(n===r)return e;for(var a=e.slice(0,n);r>n;++n)i=e[n],t.equalsEpsilon(o,i,v)||(a.push(t.clone(i)),o=i);return a},f.generateArc=function(e){n(e)||(e={});var o=e.positions,a=o.length,s=r(e.ellipsoid,i.WGS84),l=r(e.height,0);if(1>a)return[];if(1===a){var c=s.scaleToGeodeticSurface(o[0],F);if(0!==l){var _=s.geodeticSurfaceNormal(c,g);t.multiplyByScalar(_,l,_),t.add(c,_,c)}return[c.x,c.y,c.z]}var T=e.minDistance;if(!n(T)){var h=r(e.granularity,E.RADIANS_PER_DEGREE);T=E.chordLength(h,s.maximumRadius)}var A,d=0;for(A=0;a-1>A;A++)d+=f.numberOfPoints(o[A],o[A+1],T);var S=3*(d+1),m=new Array(S),C=0,N=u(l);for(A=0;a-1>A;A++){var I=o[A],O=o[A+1],y=N?l[A]:l,L=N?l[A+1]:l;C=R(I,O,T,s,y,L,m,C)}M.length=0;var v=o[a-1],D=s.cartesianToCartographic(v,p);D.height=N?l[a-1]:l;var U=s.cartographicToCartesian(D,g);return t.pack(U,m,S-3),m},f.generateCartesianArc=function(e){for(var r=f.generateArc(e),n=r.length/3,o=new Array(n),i=0;n>i;i++)o[i]=t.unpack(r,3*i);return o},f}),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){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},o.unpack=function(r,n,i){return n=t(n,0),e(i)||(i=new o),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},o.clone=function(t,r){return e(t)?(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):void 0},o}),define("Core/PolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryType","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(t,e,r,n,o,i,a,s,u,E,l,c,_,R,f,T,h){"use strict";function A(t,e,n,o,i){var a=S;a.length=i;var s,u=n.red,E=n.green,l=n.blue,c=n.alpha,_=o.red,R=o.green,f=o.blue,T=o.alpha;if(r.equals(n,o)){for(s=0;i>s;s++)a[s]=r.clone(n);return a}var h=(_-u)/i,A=(R-E)/i,d=(f-l)/i,m=(T-c)/i;for(s=0;i>s;s++)a[s]=new r(u+s*h,E+s*A,l+s*d,c+s*m);return a}function d(t){t=o(t,o.EMPTY_OBJECT);var n=t.positions,a=t.colors,u=o(t.width,1),E=o(t.colorsPerVertex,!1);this._positions=n,this._colors=a,this._width=u,this._colorsPerVertex=E,this._vertexFormat=h.clone(o(t.vertexFormat,h.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 l=1+n.length*e.packedLength;l+=i(a)?1+a.length*r.packedLength:1,this.packedLength=l+s.packedLength+h.packedLength+4}var S=[];d.pack=function(t,n,a){a=o(a,0);var u,E=t._positions,l=E.length;for(n[a++]=l,u=0;l>u;++u,a+=e.packedLength)e.pack(E[u],n,a);var c=t._colors;for(l=i(c)?c.length:0,n[a++]=l,u=0;l>u;++u,a+=r.packedLength)r.pack(c[u],n,a);s.pack(t._ellipsoid,n,a),a+=s.packedLength,h.pack(t._vertexFormat,n,a),a+=h.packedLength,n[a++]=t._width,n[a++]=t._colorsPerVertex?1:0,n[a++]=t._followSurface?1:0,n[a]=t._granularity};var m=s.clone(s.UNIT_SPHERE),C=new h,N={positions:void 0,colors:void 0,ellipsoid:m,vertexFormat:C,width:void 0,colorsPerVertex:void 0,followSurface:void 0,granularity:void 0};d.unpack=function(t,n,a){n=o(n,0);var u,E=t[n++],l=new Array(E);for(u=0;E>u;++u,n+=e.packedLength)l[u]=e.unpack(t,n);E=t[n++];var c=E>0?new Array(E):void 0;for(u=0;E>u;++u,n+=r.packedLength)c[u]=r.unpack(t,n);var _=s.unpack(t,n,m);n+=s.packedLength;var R=h.unpack(t,n,C);n+=h.packedLength;var f=t[n++],T=1===t[n++],A=1===t[n++],S=t[n];return i(a)?(a._positions=l,a._colors=c,a._ellipsoid=s.clone(_,a._ellipsoid),a._vertexFormat=h.clone(R,a._vertexFormat),a._width=f,a._colorsPerVertex=T,a._followSurface=A,a._granularity=S,a):(N.positions=l,N.colors=c,N.width=f,N.colorsPerVertex=T,N.followSurface=A,N.granularity=S,new d(N))};var I=new e,M=new e,p=new e,O=new e;return d.createGeometry=function(o){var a,s,h,d=o._width,m=o._vertexFormat,C=o._colors,N=o._colorsPerVertex,g=o._followSurface,F=o._granularity,y=o._ellipsoid,L=R.chordLength(F,y.maximumRadius),v=f.removeDuplicates(o._positions),D=v.length;if(!(2>D)){if(g){var U=f.extractHeights(v,y);if(i(C)){var P=1;for(a=0;D-1>a;++a)P+=f.numberOfPoints(v[a],v[a+1],L);var w=new Array(P),B=0;for(a=0;D-1>a;++a){var x=v[a],G=v[a+1],b=C[a],z=f.numberOfPoints(x,G,L);if(N&&P>a){var H=C[a+1],V=A(x,G,b,H,z),q=V.length;for(s=0;q>s;++s)w[B++]=V[s]}else for(s=0;z>s;++s)w[B++]=r.clone(b)}w[B]=r.clone(C[C.length-1]),C=w,S.length=0}v=f.generateCartesianArc({positions:v,minDistance:L,ellipsoid:y,height:U})}D=v.length;var X,W=4*D-4,Y=new Float64Array(3*W),K=new Float64Array(3*W),k=new Float64Array(3*W),Z=new Float32Array(2*W),j=m.st?new Float32Array(2*W):void 0,Q=i(C)?new Uint8Array(4*W):void 0,J=0,$=0,tt=0,et=0;for(s=0;D>s;++s){0===s?(X=I,e.subtract(v[0],v[1],X),e.add(v[0],X,X)):X=v[s-1],e.clone(X,p),e.clone(v[s],M),s===D-1?(X=I,e.subtract(v[D-1],v[D-2],X),e.add(v[D-1],X,X)):X=v[s+1],e.clone(X,O);var rt,nt;i(Q)&&(rt=0===s||N?C[s]:C[s-1],s!==D-1&&(nt=C[s]));var ot=0===s?2:0,it=s===D-1?2:4;for(h=ot;it>h;++h){e.pack(M,Y,J),e.pack(p,K,J),e.pack(O,k,J),J+=3;var at=0>h-2?-1:1;if(Z[$++]=2*(h%2)-1,Z[$++]=at*d,m.st&&(j[tt++]=s/(D-1),j[tt++]=Math.max(Z[$-2],0)),i(Q)){var st=2>h?rt:nt;Q[et++]=r.floatToByte(st.red),Q[et++]=r.floatToByte(st.green),Q[et++]=r.floatToByte(st.blue),Q[et++]=r.floatToByte(st.alpha)}}}var ut=new l;ut.position=new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:Y}),ut.prevPosition=new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:K}),ut.nextPosition=new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:k}),ut.expandAndWidth=new E({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:Z}),m.st&&(ut.st=new E({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:j})),i(Q)&&(ut.color=new E({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:4,values:Q,normalize:!0}));var Et=_.createTypedArray(W,6*D-6),lt=0,ct=0,_t=D-1;for(s=0;_t>s;++s)Et[ct++]=lt,Et[ct++]=lt+2,Et[ct++]=lt+1,Et[ct++]=lt+1,Et[ct++]=lt+2,Et[ct++]=lt+3,lt+=4;return new u({attributes:ut,indices:Et,primitiveType:T.TRIANGLES,boundingSphere:t.fromPoints(v),geometryType:c.POLYLINES})}},d}),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 diff --git a/Workers/createPolylineVolumeGeometry.js b/Workers/createPolylineVolumeGeometry.js index d23c5d5..56a2adc 100644 --- a/Workers/createPolylineVolumeGeometry.js +++ b/Workers/createPolylineVolumeGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};r.EPSILON1=.1,r.EPSILON2=.01,r.EPSILON3=.001,r.EPSILON4=1e-4,r.EPSILON5=1e-5,r.EPSILON6=1e-6,r.EPSILON7=1e-7,r.EPSILON8=1e-8,r.EPSILON9=1e-9,r.EPSILON10=1e-10,r.EPSILON11=1e-11,r.EPSILON12=1e-12,r.EPSILON13=1e-13,r.EPSILON14=1e-14,r.EPSILON15=1e-15,r.EPSILON16=1e-16,r.EPSILON17=1e-17,r.EPSILON18=1e-18,r.EPSILON19=1e-19,r.EPSILON20=1e-20,r.GRAVITATIONALPARAMETER=3986004418e5,r.SOLAR_RADIUS=6955e5,r.LUNAR_RADIUS=1737400,r.SIXTY_FOUR_KILOBYTES=65536,r.sign=function(e){return e>0?1:0>e?-1:0},r.signNotZero=function(e){return 0>e?-1:1},r.toSNorm=function(e){return Math.round(255*(.5*r.clamp(e,-1,1)+.5))},r.fromSNorm=function(e){return 2*(r.clamp(e,0,255)/255)-1},r.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},r.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},r.lerp=function(e,t,r){return(1-r)*e+r*t},r.PI=Math.PI,r.ONE_OVER_PI=1/Math.PI,r.PI_OVER_TWO=.5*Math.PI,r.PI_OVER_THREE=Math.PI/3,r.PI_OVER_FOUR=Math.PI/4,r.PI_OVER_SIX=Math.PI/6,r.THREE_PI_OVER_TWO=.5*3*Math.PI,r.TWO_PI=2*Math.PI,r.ONE_OVER_TWO_PI=1/(2*Math.PI),r.RADIANS_PER_DEGREE=Math.PI/180,r.DEGREES_PER_RADIAN=180/Math.PI,r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600,r.toRadians=function(e){return e*r.RADIANS_PER_DEGREE},r.toDegrees=function(e){return e*r.DEGREES_PER_RADIAN},r.convertLongitudeRange=function(e){var t=r.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},r.negativePiToPi=function(e){for(var t=r.EPSILON10,n=r.PI,a=r.TWO_PI;-(n+t)>e;)e+=a;if(-n>e)return-n;for(;e>n+t;)e-=a;return e>n?n:e},r.zeroToTwoPi=function(e){var t=e%r.TWO_PI;return 0>t?(t+r.TWO_PI)%r.TWO_PI:t},r.equalsEpsilon=function(e,r,n){return n=t(n,0),Math.abs(e-r)<=n};var n=[1];r.factorial=function(e){var t=n.length;if(e>=t)for(var r=n[t-1],a=t;e>=a;a++)n.push(r*a);return n[e]},r.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},r.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},r.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},r.clamp=function(e,t,r){return t>e?t:e>r?r:e};var a=new e;return r.setRandomNumberSeed=function(t){a=new e(t)},r.nextRandomNumber=function(){return a.random()},r.acosClamped=function(e){return Math.acos(r.clamp(e,-1,1))},r.asinClamped=function(e){return Math.asin(r.clamp(e,-1,1))},r}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i=function(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)};i.fromSpherical=function(r,n){t(n)||(n=new i);var a=r.clock,o=r.cone,u=e(r.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,r,n,a){return t(a)?(a.x=e,a.y=r,a.z=n,a):new i(e,r,n)},i.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z},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},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 o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(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},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.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 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){i.normalize(e,s),i.normalize(t,c);var r=i.dot(s,c),n=i.magnitude(i.cross(s,c,s));return Math.atan2(n,r)};var l=new i;i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);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,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z},i.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n},i.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},i.fromDegrees=function(e,t,r,n,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,r,n,o)};var f=new i,h=new i,d=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(r,n,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(n);f.x=c*Math.cos(r),f.y=c*Math.sin(r),f.z=Math.sin(n),f=i.normalize(f,f),i.multiplyComponents(s,f,h);var l=Math.sqrt(i.dot(f,h));return h=i.divideByScalar(h,l,h),f=i.multiplyByScalar(f,a,f),t(u)||(u=new i),i.add(h,f,u)},i.fromDegreesArray=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o++)n[o]=a.toRadians(e[o]);return i.fromRadiansArray(n,t,r)},i.fromRadiansArray=function(e,r,n){var a=e.length;t(n)?n.length=a/2:n=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];n[o/2]=i.fromRadians(u,s,0,r,n[o/2])}return n},i.fromDegreesArrayHeights=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o+=3)n[o]=a.toRadians(e[o]),n[o+1]=a.toRadians(e[o+1]),n[o+2]=e[o+2];return i.fromRadiansArrayHeights(n,t,r)},i.fromRadiansArrayHeights=function(e,r,n){var a=e.length;t(n)?n.length=a/3:n=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];n[o/3]=i.fromRadians(u,s,c,r,n[o/3])}return n},i.ZERO=n(new i(0,0,0)),i.UNIT_X=n(new i(1,0,0)),i.UNIT_Y=n(new i(0,1,0)),i.UNIT_Z=n(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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i=function(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)};return i.fromRadians=function(r,n,a,o){return a=e(a,0),t(o)?(o.longitude=r,o.latitude=n,o.height=a,o):new i(r,n,a)},i.fromDegrees=function(e,t,r,n){return e=a.toRadians(e),t=a.toRadians(t),i.fromRadians(e,t,r,n)},i.clone=function(e,r){return t(e)?t(r)?(r.longitude=e.longitude,r.latitude=e.latitude,r.height=e.height,r):new i(e.longitude,e.latitude,e.height):void 0},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.longitude===r.longitude&&e.latitude===r.latitude&&e.height===r.height},i.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.longitude-r.longitude)<=n&&Math.abs(e.latitude-r.latitude)<=n&&Math.abs(e.height-r.height)<=n},i.ZERO=n(new i(0,0,0)),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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},i}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(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}var c=function(e,t,r){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,s(this,e,t,r)};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(t,r){if(!n(t))return void 0;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 c(a.x,a.y,a.z)},c.fromCartesian3=function(e,t){return n(t)||(t=new c),n(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=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.prototype.geocentricSurfaceNormal=e.normalize,c.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)},c.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var l=new e,f=new e;c.prototype.cartographicToCartesian=function(t,r){var a=l,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)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;r>a;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,d=new e,y=new e;c.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,d);if(!n(i))return void 0;var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,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(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)},c.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;r>a;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t};var p=new e,m=new e;return c.prototype.scaleToGeodeticSurface=function(t,r){var a=t.x,i=t.y,o=t.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,h=a*a*c*c,d=i*i*l*l,y=o*o*f*f,v=h+d+y,g=Math.sqrt(1/v),w=e.multiplyByScalar(t,g,p);if(v<this._centerToleranceSquared)return isFinite(g)?e.clone(w,r):void 0;var x=this._oneOverRadiiSquared,E=x.x,S=x.y,O=x.z,T=m;T.x=2*w.x*E,T.y=2*w.y*S,T.z=2*w.z*O;var M,_,P,b,N,A,I,C,R,z,D,L=(1-g)*e.magnitude(t)/(.5*e.magnitude(T)),U=0;do{L-=U,P=1/(1+L*E),b=1/(1+L*S),N=1/(1+L*O),A=P*P,I=b*b,C=N*N,R=A*P,z=I*b,D=C*N,M=h*A+d*I+y*C-1,_=h*R*E+d*z*S+y*D*O;var q=-2*_;U=M/q}while(Math.abs(M)>u.EPSILON12);return n(r)?(r.x=a*P,r.y=i*b,r.z=o*N,r):new e(a*P,i*b,o*N)},c.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)},c.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},c.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},c.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i=function(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){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n]=t.y},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.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.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.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.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n},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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.x+", "+this.y+")"},i}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";var u=function(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/Rectangle",["./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o){"use strict";var u=function(e,r,n,a){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(a,0)};u.fromDegrees=function(e,n,a,i,s){return e=o.toRadians(t(e,0)),n=o.toRadians(t(n,0)),a=o.toRadians(t(a,0)),i=o.toRadians(t(i,0)),r(s)?(s.west=e,s.south=n,s.east=a,s.north=i,s):new u(e,n,a,i)},u.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=e.length;c>s;s++){var l=e[s];n=Math.min(n,l.longitude),a=Math.max(a,l.longitude),i=Math.min(i,l.latitude),o=Math.max(o,l.latitude)}return r(t)?(t.west=n,t.south=i,t.east=a,t.north=o,t):new u(n,i,a,o)},u.packedLength=4,u.pack=function(e,r,n){n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north},u.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new u),a.west=e[n++],a.south=e[n++],a.east=e[n++],a.north=e[n],a},u.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},u.validate=function(){},u.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},u.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},u.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},u.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},u.center=function(t,n){var a=t.east,i=t.west,u=.5*(i+a);return i>a&&(u=o.negativePiToPi(u+o.PI)),r(n)?(n.longitude=u,n.latitude=.5*(t.south+t.north),n.height=0,n):new e(u,.5*(t.south+t.north))},u.intersectWith=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),s=Math.min(e.north,t.north);return r(n)?(n.west=a,n.south=i,n.east=o,n.north=s,n):new u(a,i,o,s)},u.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},u.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var s=new e;return u.subsample=function(e,n,i,u){n=t(n,a.WGS84),i=t(i,0),r(u)||(u=[]);var c=0,l=e.north,f=e.south,h=e.east,d=e.west,y=s;y.height=i,y.longitude=d,y.latitude=l,u[c]=n.cartographicToCartesian(y,u[c]),c++,y.longitude=h,u[c]=n.cartographicToCartesian(y,u[c]),c++,y.latitude=f,u[c]=n.cartographicToCartesian(y,u[c]),c++,y.longitude=d,u[c]=n.cartographicToCartesian(y,u[c]),c++,y.latitude=0>l?l:f>0?f:0;for(var p=1;8>p;++p){var m=-Math.PI+p*o.PI_OVER_TWO;m>d&&h>m&&(y.longitude=m,u[c]=n.cartographicToCartesian(y,u[c]),c++)}return 0===y.latitude&&(y.longitude=d,u[c]=n.cartographicToCartesian(y,u[c]),c++,y.longitude=h,u[c]=n.cartographicToCartesian(y,u[c]),c++),u.length=c,u},u.MAX_VALUE=i(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./defaultValue","./defined","./DeveloperError","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,r,n,a,i,o,u){"use strict";var s=function(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.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,a=e[0].x,i=e[0].y,o=e[0].x,u=e[0].y,c=1;r>c;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(n(i)||(i=new s),!n(t))return i.x=0,i.y=0,i.width=0,i.height=0,i;a=r(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){return n(e)?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):void 0},s.union=function(e,t,r){n(r)||(r=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 r.x=a,r.y=i,r.width=o-a,r.height=u-i,r},s.expand=function(e,t,r){r=s.clone(e,r);var n=t.x-r.x,a=t.y-r.y;return n>r.width?r.width=n:0>n&&(r.width-=n,r.x=t.x),a>r.height?r.height=a:0>a&&(r.height-=a,r.y=t.y),r},s.intersect=function(e,t){var r=e.x,n=e.y,a=t.x,i=t.y;return r>a+t.width||r+e.width<a||n+e.height<i||n>i+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";var t=function(t,r){this.start=e(t,0),this.stop=e(r,0)};return t}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";var a=function(t,r,n,a){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(a,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){return t(e)?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):void 0},a.packedLength=4,a.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w},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.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 i=new a;a.distance=function(e,t){return a.subtract(e,t,i),a.magnitude(i)},a.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.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.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 o=new a;a.lerp=function(e,t,r,n){return a.multiplyByScalar(t,r,o),n=a.multiplyByScalar(e,1-r,n),a.add(o,n,n)};var u=new a;return a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,u);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.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n&&Math.abs(e.w-r.w)<=n},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){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function u(e){for(var t=0,r=0;3>r;++r){var n=e[c.getElementIndex(d[r],h[r])];t+=2*n*n}return Math.sqrt(t)}function s(e,t){for(var r=i.EPSILON15,n=0,a=1,o=0;3>o;++o){var u=Math.abs(e[c.getElementIndex(d[o],h[o])]);u>n&&(a=o,n=u)}var s=1,l=0,f=h[a],y=d[a];if(Math.abs(e[c.getElementIndex(y,f)])>r){var p,m=e[c.getElementIndex(y,y)],v=e[c.getElementIndex(f,f)],g=e[c.getElementIndex(y,f)],w=(m-v)/2/g;p=0>w?-1/(-w+Math.sqrt(1+w*w)):1/(w+Math.sqrt(1+w*w)),s=1/Math.sqrt(1+p*p),l=p*s}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(f,f)]=t[c.getElementIndex(y,y)]=s,t[c.getElementIndex(y,f)]=l,t[c.getElementIndex(f,y)]=-l,t}var c=function(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)};c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,n,a){return n=t(n,0),r(a)||(a=new c),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},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,s=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,y=n-u-f+d,p=2*(a-h),m=2*(i+l),v=2*(a+h),g=-n+u-f+d,w=2*(s-o),x=2*(i-l),E=2*(s+o),S=-n-u+f+d;return r(t)?(t[0]=y,t[1]=v,t[2]=x,t[3]=p,t[4]=g,t[5]=E,t[6]=m,t[7]=w,t[8]=S,t):new c(y,p,m,v,g,w,x,E,S)},c.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new c(e.x,0,0,0,e.y,0,0,0,e.z)},c.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new c(e,0,0,0,e,0,0,0,e)},c.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.fromRotationX=function(e,t){var n=Math.cos(e),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 c(1,0,0,0,n,-a,0,a,n)},c.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 c(n,0,a,0,1,0,-a,0,n)},c.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 c(n,-a,0,a,n,0,0,0,1)},c.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},c.getElementIndex=function(e,t){return 3*e+t},c.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},c.setColumn=function(e,t,r,n){n=c.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},c.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},c.setRow=function(e,t,r,n){return n=c.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var l=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),r};var f=new e;c.getMaximumScale=function(t){return c.getScale(t,f),e.maximumComponent(f)},c.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],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},c.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},c.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},c.multiplyByVector=function(e,t,r){var n=t.x,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},c.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},c.transpose=function(e,t){var r=e[0],n=e[3],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],y=new c,p=new c;return c.computeEigenDecomposition=function(e,t){var n=i.EPSILON20,a=10,l=0,f=0; -r(t)||(t={});for(var h=t.unitary=c.clone(c.IDENTITY,t.unitary),d=t.diagonal=c.clone(e,t.diagonal),m=n*o(d);a>f&&u(d)>m;)s(d,y),c.transpose(y,p),c.multiply(d,y,d),c.multiply(p,d,d),c.multiply(h,y,h),++l>2&&(++f,l=0);return t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},c.determinant=function(e){var t=e[0],r=e[3],n=e[6],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)},c.inverse=function(e,t){var r=e[0],a=e[1],o=e[2],u=e[3],s=e[4],l=e[5],f=e[6],h=e[7],d=e[8],y=c.determinant(e);if(Math.abs(y)<=i.EPSILON15)throw new n("matrix is not invertible");t[0]=s*d-h*l,t[1]=h*o-a*d,t[2]=a*l-s*o,t[3]=f*l-u*d,t[4]=r*d-f*o,t[5]=u*o-r*l,t[6]=u*h-f*s,t[7]=f*a-r*h,t[8]=r*s-u*a;var p=1/y;return c.multiplyByScalar(t,p,t)},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},c.IDENTITY=a(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s){"use strict";var c=function(e,t,n,a,i,o,u,s,c,l,f,h,d,y,p,m){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(y,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(m,0)};c.packedLength=16,c.pack=function(e,t,n){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]},c.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new c),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},c.clone=function(e,t){return n(e)?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 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]):void 0},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,r,a){n(a)||(a=new c);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,l=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,y=t.y*t.z,p=t.y*t.w,m=t.z*t.z,v=t.z*t.w,g=t.w*t.w,w=s-d-m+g,x=2*(l-v),E=2*(f+p),S=2*(l+v),O=-s+d-m+g,T=2*(y-h),M=2*(f-p),_=2*(y+h),P=-s-d+m+g;return a[0]=w*i,a[1]=S*i,a[2]=M*i,a[3]=0,a[4]=x*o,a[5]=O*o,a[6]=_*o,a[7]=0,a[8]=E*u,a[9]=T*u,a[10]=P*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.IDENTITY,e,t)},c.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 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 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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,f=new e,h=new e;c.fromCamera=function(t,r){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,y=l.x,p=l.y,m=l.z,v=h.x,g=h.y,w=h.z,x=a.x,E=a.y,S=a.z,O=u*-x+s*-E+d*-S,T=v*-x+g*-E+w*-S,M=y*x+p*E+m*S;return n(r)?(r[0]=u,r[1]=v,r[2]=-y,r[3]=0,r[4]=s,r[5]=g,r[6]=-p,r[7]=0,r[8]=d,r[9]=w,r[10]=-m,r[11]=0,r[12]=O,r[13]=T,r[14]=M,r[15]=1,r):new c(u,s,d,O,v,g,w,T,-y,-p,-m,M,0,0,0,1)},c.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},c.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,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},c.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),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},c.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,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},c.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,y=f,p=i+c,m=o+l,v=t+f,g=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]=y,a[11]=0,a[12]=p,a[13]=m,a[14]=v,a[15]=g,a},c.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]]},c.getElementIndex=function(e,t){return 4*e+t},c.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},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.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},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 d=new e;c.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 y=new e;c.getMaximumScale=function(t){return c.getScale(t,y),e.maximumComponent(y)},c.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],h=e[9],d=e[10],y=e[11],p=e[12],m=e[13],v=e[14],g=e[15],w=t[0],x=t[1],E=t[2],S=t[3],O=t[4],T=t[5],M=t[6],_=t[7],P=t[8],b=t[9],N=t[10],A=t[11],I=t[12],C=t[13],R=t[14],z=t[15],D=n*w+u*x+f*E+p*S,L=a*w+s*x+h*E+m*S,U=i*w+c*x+d*E+v*S,q=o*w+l*x+y*E+g*S,B=n*O+u*T+f*M+p*_,F=a*O+s*T+h*M+m*_,W=i*O+c*T+d*M+v*_,G=o*O+l*T+y*M+g*_,V=n*P+u*b+f*N+p*A,Y=a*P+s*b+h*N+m*A,j=i*P+c*b+d*N+v*A,k=o*P+l*b+y*N+g*A,H=n*I+u*C+f*R+p*z,Z=a*I+s*C+h*R+m*z,X=i*I+c*C+d*R+v*z,J=o*I+l*C+y*R+g*z;return r[0]=D,r[1]=L,r[2]=U,r[3]=q,r[4]=B,r[5]=F,r[6]=W,r[7]=G,r[8]=V,r[9]=Y,r[10]=j,r[11]=k,r[12]=H,r[13]=Z,r[14]=X,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],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],y=e[14],p=t[0],m=t[1],v=t[2],g=t[4],w=t[5],x=t[6],E=t[8],S=t[9],O=t[10],T=t[12],M=t[13],_=t[14],P=n*p+o*m+c*v,b=a*p+u*m+l*v,N=i*p+s*m+f*v,A=n*g+o*w+c*x,I=a*g+u*w+l*x,C=i*g+s*w+f*x,R=n*E+o*S+c*O,z=a*E+u*S+l*O,D=i*E+s*S+f*O,L=n*T+o*M+c*_+h,U=a*T+u*M+l*_+d,q=i*T+s*M+f*_+y;return r[0]=P,r[1]=b,r[2]=N,r[3]=0,r[4]=A,r[5]=I,r[6]=C,r[7]=0,r[8]=R,r[9]=z,r[10]=D,r[11]=0,r[12]=L,r[13]=U,r[14]=q,r[15]=1,r},c.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;c.multiplyByUniformScale=function(e,t,r){return p.x=t,p.y=t,p.z=t,c.multiplyByScale(e,p,r)},c.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?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]=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)},c.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},c.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},c.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},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],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},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||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]&&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]},c.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},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 m=new u,v=new u,g=new t,w=new t(0,0,0,1);return c.inverse=function(e,r){if(u.equalsEpsilon(c.getRotation(e,m),v,o.EPSILON7)&&t.equals(c.getRow(e,3,g),w))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],l=e[12],f=e[1],h=e[5],d=e[9],y=e[13],p=e[2],x=e[6],E=e[10],S=e[14],O=e[3],T=e[7],M=e[11],_=e[15],P=E*_,b=S*M,N=x*_,A=S*T,I=x*M,C=E*T,R=p*_,z=S*O,D=p*M,L=E*O,U=p*T,q=x*O,B=P*h+A*d+I*y-(b*h+N*d+C*y),F=b*f+R*d+L*y-(P*f+z*d+D*y),W=N*f+z*h+U*y-(A*f+R*h+q*y),G=C*f+D*h+q*d-(I*f+L*h+U*d),V=b*a+N*i+C*l-(P*a+A*i+I*l),Y=P*n+z*i+D*l-(b*n+R*i+L*l),j=A*n+R*a+q*l-(N*n+z*a+U*l),k=I*n+L*a+U*i-(C*n+D*a+q*i);P=i*y,b=l*d,N=a*y,A=l*h,I=a*d,C=i*h,R=n*y,z=l*f,D=n*d,L=i*f,U=n*h,q=a*f;var H=P*T+A*M+I*_-(b*T+N*M+C*_),Z=b*O+R*M+L*_-(P*O+z*M+D*_),X=N*O+z*T+U*_-(A*O+R*T+q*_),J=C*O+D*T+q*M-(I*O+L*T+U*M),K=N*E+C*S+b*x-(I*S+P*x+A*E),Q=D*S+P*p+z*E-(R*E+L*S+b*p),$=R*x+q*S+A*p-(U*S+N*p+z*x),et=U*E+I*p+L*x-(D*x+q*E+C*p),tt=n*B+a*F+i*W+l*G;if(Math.abs(tt)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return tt=1/tt,r[0]=B*tt,r[1]=F*tt,r[2]=W*tt,r[3]=G*tt,r[4]=V*tt,r[5]=Y*tt,r[6]=j*tt,r[7]=k*tt,r[8]=H*tt,r[9]=Z*tt,r[10]=X*tt,r[11]=J*tt,r[12]=K*tt,r[13]=Q*tt,r[14]=$*tt,r[15]=et*tt,r},c.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],h=e[13],d=e[14],y=-r*f-n*h-a*d,p=-i*f-o*h-u*d,m=-s*f-c*h-l*d;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]=y,t[13]=p,t[14]=m,t[15]=1,t},c.IDENTITY=i(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[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/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l){"use strict";var f=function(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)},h=new e,d=new e,y=new e,p=new e,m=new e,v=new e,g=new e,w=new e,x=new e,E=new e,S=new e,O=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],g),i=e.clone(a,h),o=e.clone(a,d),u=e.clone(a,y),s=e.clone(a,p),c=e.clone(a,m),l=e.clone(a,v),T=t.length,M=1;T>M;M++){e.clone(t[M],a);var _=a.x,P=a.y,b=a.z;_<i.x&&e.clone(a,i),_>s.x&&e.clone(a,s),P<o.y&&e.clone(a,o),P>c.y&&e.clone(a,c),b<u.z&&e.clone(a,u),b>l.z&&e.clone(a,l)}var N=e.magnitudeSquared(e.subtract(s,i,w)),A=e.magnitudeSquared(e.subtract(c,o,w)),I=e.magnitudeSquared(e.subtract(l,u,w)),C=i,R=s,z=N;A>z&&(z=A,C=o,R=c),I>z&&(z=I,C=u,R=l);var D=x;D.x=.5*(C.x+R.x),D.y=.5*(C.y+R.y),D.z=.5*(C.z+R.z);var L=e.magnitudeSquared(e.subtract(R,D,w)),U=Math.sqrt(L),q=E;q.x=i.x,q.y=o.y,q.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var F=e.multiplyByScalar(e.add(q,B,w),.5,O),W=0;for(M=0;T>M;M++){e.clone(t[M],a);var G=e.magnitude(e.subtract(a,F,w));G>W&&(W=G);var V=e.magnitudeSquared(e.subtract(a,D,w));if(V>L){var Y=Math.sqrt(V);U=.5*(U+Y),L=U*U;var j=Y-U;D.x=(U*D.x+j*a.x)/Y,D.y=(U*D.y+j*a.y)/Y,D.z=(U*D.z+j*a.z)/Y}}return W>U?(e.clone(D,r.center),r.radius=U):(e.clone(F,r.center),r.radius=W),r};var T=new o,M=new e,_=new e,P=new t,b=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,T),l.southwest(t,P),P.height=i,l.northeast(t,b),b.height=o;var s=a.project(P,M),c=a.project(b,_),h=c.x-s.x,d=c.y-s.y,y=c.z-s.z;u.radius=.5*Math.sqrt(h*h+d*d+y*y);var p=u.center;return p.x=s.x+.5*h,p.y=s.y+.5*d,p.z=s.z+.5*y,u};var N=[];f.fromRectangle3D=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0);var u;return n(e)&&(u=l.subsample(e,t,a,N)),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=g;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,y),T=e.clone(u,p),M=e.clone(u,m),_=e.clone(u,v),P=t.length,b=0;P>b;b+=i){var N=t[b]+a.x,A=t[b+1]+a.y,I=t[b+2]+a.z;u.x=N,u.y=A,u.z=I,N<s.x&&e.clone(u,s),N>T.x&&e.clone(u,T),A<c.y&&e.clone(u,c),A>M.y&&e.clone(u,M),I<l.z&&e.clone(u,l),I>_.z&&e.clone(u,_)}var C=e.magnitudeSquared(e.subtract(T,s,w)),R=e.magnitudeSquared(e.subtract(M,c,w)),z=e.magnitudeSquared(e.subtract(_,l,w)),D=s,L=T,U=C;R>U&&(U=R,D=c,L=M),z>U&&(U=z,D=l,L=_);var q=x;q.x=.5*(D.x+L.x),q.y=.5*(D.y+L.y),q.z=.5*(D.z+L.z);var B=e.magnitudeSquared(e.subtract(L,q,w)),F=Math.sqrt(B),W=E;W.x=s.x,W.y=c.y,W.z=l.z;var G=S;G.x=T.x,G.y=M.y,G.z=_.z;var V=e.multiplyByScalar(e.add(W,G,w),.5,O),Y=0;for(b=0;P>b;b+=i){u.x=t[b]+a.x,u.y=t[b+1]+a.y,u.z=t[b+2]+a.z;var j=e.magnitude(e.subtract(u,V,w));j>Y&&(Y=j);var k=e.magnitudeSquared(e.subtract(u,q,w));if(k>B){var H=Math.sqrt(k);F=.5*(F+H),B=F*F;var Z=H-F;q.x=(F*q.x+Z*u.x)/H,q.y=(F*q.y+Z*u.y)/H,q.z=(F*q.z+Z*u.z)/H}}return Y>F?(e.clone(q,o.center),o.radius=F):(e.clone(V,o.center),o.radius=Y),o},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},f.clone=function(t,r){return n(t)?n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius):void 0},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var a=e.center;t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius},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 A=new e,I=new e;f.union=function(t,r,a){n(a)||(a=new f);var i=t.center,o=r.center;e.add(i,o,I);var u=e.multiplyByScalar(I,.5,I),s=e.magnitude(e.subtract(i,u,A))+t.radius,c=e.magnitude(e.subtract(o,u,A))+r.radius;return a.radius=Math.max(s,c),e.clone(u,a.center),a};var C=new e;f.expand=function(t,r,n){n=f.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,C));return a>n.radius&&(n.radius=a),n},f.intersect=function(t,r){var n=t.center,a=t.radius,i=e.dot(r,n)+r.w;return-a>i?u.OUTSIDE:a>i?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=c.getMaximumScale(t)*e.radius,r};var R=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,R);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var 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.multiplyByScalar(a,e.dot(a,o),z),c=e.magnitude(u);return i.start=c-t.radius,i.stop=c+t.radius,i};for(var D=new e,L=new e,U=new e,q=new e,B=new e,F=new t,W=new Array(8),G=0;8>G;++G)W[G]=new e;var V=new o;return f.projectTo2D=function(t,n,a){n=r(n,V);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,D),c=e.cross(e.UNIT_Z,s,L);e.normalize(c,c);var l=e.cross(s,c,U);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var h=e.negate(l,B),d=e.negate(c,q),y=W,p=y[0];e.add(s,l,p),e.add(p,c,p),p=y[1],e.add(s,l,p),e.add(p,d,p),p=y[2],e.add(s,h,p),e.add(p,d,p),p=y[3],e.add(s,h,p),e.add(p,c,p),e.negate(s,s),p=y[4],e.add(s,l,p),e.add(p,c,p),p=y[5],e.add(s,l,p),e.add(p,d,p),p=y[6],e.add(s,h,p),e.add(p,d,p),p=y[7],e.add(s,h,p),e.add(p,c,p);for(var m=y.length,v=0;m>v;++v){var g=y[v];e.add(o,g,g);var w=i.cartesianToCartographic(g,F);n.project(w,g)}a=f.fromPoints(y,a),o=a.center;var x=o.x,E=o.y,S=o.z;return o.x=S,o.y=x,o.z=E,a},f.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersect=function(e){return f.intersect(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){return a.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?n.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(n.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e){a.supportsFullscreen()&&e[n.requestFullscreen]()},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;n>r;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(y)){y=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(y=!0,p=n(e[1]))}return y}function i(){return a()&&p}function o(){if(!t(m)&&(m=!1,!a()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(m=!0,v=n(e[1]))}return m}function u(){return o()&&v}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(g=!0,w=n(e[1]),w.isNightly=!!e[2])}return g}function c(){return s()&&w}function l(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=n(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=n(e[1])))}return x}function f(){return l()&&E}function h(){if(!t(S)){S=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(S=!0,O=n(e[1]))}return S}function d(){return h()&&O}var y,p,m,v,g,w,x,E,S,O,T={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:d,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};return T.supportsFullscreen=function(){return r.supportsFullscreen()},T.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},T.supportsWebWorkers=function(){return"undefined"!=typeof Worker},T}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,r,n,a){"use strict";if(!n.supportsTypedArrays())return{};var i={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},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 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.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.FLOAT:return new Float32Array(t);case i.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},i.createArrayBufferView=function(t,n,a,o){switch(a=e(a,0),o=e(o,(n.byteLength-a)/i.getSizeInBytes(t)),t){case i.BYTE:return new Int8Array(n,a,o);case i.UNSIGNED_BYTE:return new Uint8Array(n,a,o);case i.SHORT:return new Int16Array(n,a,o);case i.UNSIGNED_SHORT:return new Uint16Array(n,a,o);case i.FLOAT:return new Float32Array(n,a,o);case i.DOUBLE:return new Float64Array(n,a,o);default:throw new r("componentDatatype is not a valid value.")}},a(i)}),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"],function(e){"use strict";var t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===t.POINTS||e===t.LINES||e===t.LINE_LOOP||e===t.LINE_STRIP||e===t.TRIANGLES||e===t.TRIANGLE_STRIP||e===t.TRIANGLE_FAN}};return e(t)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,a){"use strict";var i=function(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)};return i.computeNumberOfVertices=function(e){var n=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(n!==o&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=o}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(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,r,n,a){"use strict";var i={};i.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=t.x,n=t.y;t.x=(1-Math.abs(n))*a.signNotZero(r),t.y=(1-Math.abs(r))*a.signNotZero(n)}return t.x=a.toSNorm(t.x),t.y=a.toSNorm(t.y),t},i.octDecode=function(e,r,n){if(n.x=a.fromSNorm(e),n.y=a.fromSNorm(r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var i=n.x;n.x=(1-Math.abs(n.y))*a.signNotZero(i),n.y=(1-Math.abs(i))*a.signNotZero(n.y)}return t.normalize(n,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 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=1===e.x?4095:0|4096*e.x,r=1===e.y?4095:0|4096*e.y;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096;return t.x=Math.floor(r)/4096,t.y=r-Math.floor(r),t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=new t,a=new t,i=new t,o=function(o,u,s,c,l){r(l)||(l=new t);var f,h,d,y,p,m,v,g;r(u.z)?(f=t.subtract(s,u,n),h=t.subtract(c,u,a),d=t.subtract(o,u,i),y=t.dot(f,f),p=t.dot(f,h),m=t.dot(f,d),v=t.dot(h,h),g=t.dot(h,d)):(f=e.subtract(s,u,n),h=e.subtract(c,u,a),d=e.subtract(o,u,i),y=e.dot(f,f),p=e.dot(f,h),m=e.dot(f,d),v=e.dot(h,h),g=e.dot(h,d));var w=1/(y*v-p*p);return l.y=(v*m-p*g)*w,l.z=(y*g-p*m)*w,l.x=1-l.y-l.z,l};return o}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)};r.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var n={high:0,low:0};r.fromCartesian=function(e,a){t(a)||(a=new r);var i=a.high,o=a.low;return r.encode(e.x,n),i.x=n.high,o.x=n.low,r.encode(e.y,n),i.y=n.high,o.y=n.low,r.encode(e.z,n),i.z=n.high,o.z=n.low,a};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"],function(e,t,r,n){"use strict";var a={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,a){return e>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(a)}),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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,0>i?[i,0]:[0,i];var c=n*n,l=4*e*a,f=r(c,-l,t.EPSILON14);if(0>f)return[];var h=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[h/e,a/h]:[a/h,h/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,h=u*u,d=s*s,y=o*s-h,p=o*c-u*s,m=u*c-d,v=4*y*m-p*p;if(0>v){var g,w,x;h*f>=l*d?(g=o,w=y,x=-2*u*y+o*p):(g=c,w=m,x=-c*p+2*s*m);var E=0>x?-1:1,S=-E*Math.abs(g)*Math.sqrt(-v);i=-x+S;var O=i/2,T=0>O?-Math.pow(-O,1/3):Math.pow(O,1/3),M=i===S?-T:-w/T;return a=0>=w?T+M:-x/(T*T+M*M+w),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var _=y,P=-2*u*y+o*p,b=m,N=-c*p+2*s*m,A=Math.sqrt(v),I=Math.sqrt(3)/2,C=Math.abs(Math.atan2(o*A,-P)/3);a=2*Math.sqrt(-_);var R=Math.cos(C);i=a*R;var z=a*(-R/2-I*Math.sin(C)),D=i+z>2*u?i-u:z-u,L=o,U=D/L;C=Math.abs(Math.atan2(c*A,-N)/3),a=2*Math.sqrt(-b),R=Math.cos(C),i=a*R,z=a*(-R/2-I*Math.sin(C));var q=-c,B=2*s>i+z?i+s:z+s,F=q/B,W=L*B,G=-D*B-L*q,V=D*q,Y=(s*G-u*V)/(-u*G+s*W);return Y>=U?F>=U?F>=Y?[U,Y,F]:[U,F,Y]:[F,U,Y]:F>=U?[Y,U,F]:F>=Y?[Y,F,U]:[F,Y,U]}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=0>u?-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,0>u?[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 h=-t/4,d=f[f.length-1];if(Math.abs(d)<r.EPSILON14){var y=n.computeRealRoots(1,s,l);if(2===y.length){var p,m=y[0],v=y[1];if(m>=0&&v>=0){var g=Math.sqrt(m),w=Math.sqrt(v);return[h-w,h-g,h+g,h+w]}if(m>=0&&0>v)return p=Math.sqrt(m),[h-p,h+p];if(0>m&&v>=0)return p=Math.sqrt(v),[h-p,h+p]}return[]}if(d>0){var x=Math.sqrt(d),E=(s+d-c/x)/2,S=(s+d+c/x)/2,O=n.computeRealRoots(1,x,E),T=n.computeRealRoots(1,-x,S);return 0!==O.length?(O[0]+=h,O[1]+=h,0!==T.length?(T[0]+=h,T[1]+=h,O[1]<=T[0]?[O[0],O[1],T[0],T[1]]:T[1]<=O[0]?[T[0],T[1],O[0],O[1]]:O[0]>=T[0]&&O[1]<=T[1]?[T[0],O[0],O[1],T[1]]:T[0]>=O[0]&&T[1]<=O[1]?[O[0],T[0],T[1],O[1]]:O[0]>T[0]&&O[0]<T[1]?[T[0],O[0],T[1],O[1]]:[O[0],T[0],O[1],T[1]]):O):0!==T.length?(T[0]+=h,T[1]+=h,T):[]}}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 y,p,m=d[0],v=a-m,g=v*v,w=t/2,x=v/2,E=g-4*o,S=g+4*Math.abs(o),O=c-4*m,T=c+4*Math.abs(m);if(0>m||O*S>E*T){var M=Math.sqrt(O);y=M/2,p=0===M?0:(t*x-i)/M}else{var _=Math.sqrt(E);y=0===_?0:(t*x-i)/_,p=_/2}var P,b;0===w&&0===y?(P=0,b=0):r.sign(w)===r.sign(y)?(P=w+y,b=m/P):(b=w-y,P=m/b);var N,A;0===x&&0===p?(N=0,A=0):r.sign(x)===r.sign(p)?(N=x+p,A=o/N):(A=x-p,N=o/A);var I=n.computeRealRoots(1,P,N),C=n.computeRealRoots(1,b,A);if(0!==I.length)return 0!==C.length?I[1]<=C[0]?[I[0],I[1],C[0],C[1]]:C[1]<=I[0]?[C[0],C[1],I[0],I[1]]:I[0]>=C[0]&&I[1]<=C[1]?[C[0],I[0],I[1],C[1]]:C[0]>=I[0]&&C[1]<=I[1]?[I[0],C[0],C[1],I[1]]:I[0]>C[0]&&I[0]<C[1]?[C[0],I[0],C[1],I[1]]:[I[0],C[0],I[1],C[1]]:I;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,h=f*n,d=a*a,y=d*a,p=u*c*f-4*s*h-4*e*l*f+18*e*t*r*h-27*i*f*f+256*o*y+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)+d*(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,h=s/t,d=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>f?d+1:d,d+=0>h?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 void 0}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=function(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n};return n.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},n}),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(t,n,a,o,u){u=r(u,!1);var s,c,l,f,h,d=t.origin,y=t.direction,p=e.subtract(a,n,m),E=e.subtract(o,n,v),S=e.cross(y,E,g),O=e.dot(p,S);if(u){if(O<i.EPSILON6)return void 0;if(s=e.subtract(d,n,w),l=e.dot(s,S),0>l||l>O)return void 0;if(c=e.cross(s,p,x),f=e.dot(y,c),0>f||l+f>O)return void 0;h=e.dot(E,c)/O}else{if(Math.abs(O)<i.EPSILON6)return void 0;var T=1/O;if(s=e.subtract(d,n,w),l=e.dot(s,S)*T,0>l||l>1)return void 0;if(c=e.cross(s,p,x),f=e.dot(y,c)*T,0>f||l+f>1)return void 0;h=e.dot(E,c)*T}return h}function f(e,t,r,n){var a=t*t-4*e*r;if(0>a)return void 0;if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);return 0===c?void 0:(n.root0=n.root1=c,n)}function h(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,g),l=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,y=f(l,h,d,S);return n(y)?(a.start=y.root0,a.stop=y.root1,a):void 0}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 y(t,r,n,a,c){var l,f=a*a,h=c*c,y=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,p=c*(a*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+r.y),m=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*h+a*r.x+n,v=h*d(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),g=c*(a*d(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+r.z),w=[];if(0===g&&0===v){if(l=u.computeRealRoots(y,p,m),0===l.length)return w;var x=l[0],E=Math.sqrt(Math.max(1-x*x,0));if(w.push(new e(a,c*x,c*-E)),w.push(new e(a,c*x,c*E)),2===l.length){var S=l[1],O=Math.sqrt(Math.max(1-S*S,0));w.push(new e(a,c*S,c*-O)),w.push(new e(a,c*S,c*O))}return w}var T=g*g,M=v*v,_=y*y,P=g*v,b=_+M,N=2*(p*y+P),A=2*m*y+p*p-M+T,I=2*(m*p-P),C=m*m-T;if(0===b&&0===N&&0===A&&0===I)return w;l=s.computeRealRoots(b,N,A,I,C);var R=l.length;if(0===R)return w;for(var z=0;R>z;++z){var D,L=l[z],U=L*L,q=Math.max(1-U,0),B=Math.sqrt(q);D=i.sign(y)===i.sign(m)?d(y*U+m,p*L,i.EPSILON12):i.sign(m)===i.sign(p*L)?d(y*U,p*L+m,i.EPSILON12):d(y*U+p*L,m,i.EPSILON12);var F=d(v*L,g,i.EPSILON15),W=D*F;0>W?w.push(new e(a,c*L,c*B)):W>0?w.push(new e(a,c*L,c*-B)):0!==B?(w.push(new e(a,c*L,c*-B)),w.push(new e(a,c*L,c*B)),++z):w.push(new e(a,c*L,c*B))}return w}var p={};p.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)return void 0;var l=(-r.distance-e.dot(s,o))/c;return 0>l?void 0:(a=e.multiplyByScalar(u,l,a),e.add(o,a,a))};var m=new e,v=new e,g=new e,w=new e,x=new e;p.rayTriangle=function(t,r,a,i,o,u){var s=l(t,r,a,i,o);return!n(s)||0>s?void 0:(n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u))};var E=new c;p.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=E;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var f=l(c,a,i,o,u);return!n(f)||0>f||f>e.distance(t,r)?void 0:(n(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var S={root0:0,root1:0};p.raySphere=function(e,t,r){return r=h(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var O=new c;p.lineSegmentSphere=function(t,r,a,i){var o=O;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=h(o,a,i),!n(i)||i.stop<0||i.start>s?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i)};var T=new e,M=new e;p.rayEllipsoid=function(t,r){var n,a,i,o,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,T),l=e.multiplyComponents(s,t.direction,M),f=e.magnitudeSquared(c),h=e.dot(c,l);if(f>1){if(h>=0)return void 0;var d=h*h;if(n=f-1,a=e.magnitudeSquared(l),i=a*n,i>d)return void 0;if(d>i){o=h*h-i,u=-h+Math.sqrt(o);var y=u/a,p=n/u;return p>y?{start:y,stop:p}:{start:p,stop:y}}var m=Math.sqrt(n/a);return{start:m,stop:m}}return 1>f?(n=f-1,a=e.magnitudeSquared(l),i=a*n,o=h*h-i,u=-h+Math.sqrt(o),{start:0,stop:u/a}):0>h?(a=e.magnitudeSquared(l),{start:0,stop:-h/a}):void 0};var _=new e,P=new e,b=new e,N=new e,A=new e,I=new o,C=new o,R=new o,z=new o,D=new o,L=new o,U=new o,q=new e,B=new e,F=new t;p.grazingAltitudeLocation=function(t,r){var a=t.origin,u=t.direction,s=r.geodeticSurfaceNormal(a);if(e.dot(u,s)>=0)return a;var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u),f=e.normalize(l,_),h=e.mostOrthogonalAxis(l,N),d=e.normalize(e.cross(h,f,P),P),p=e.normalize(e.cross(f,d,b),b),m=I;m[0]=f.x,m[1]=f.y,m[2]=f.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 v=o.transpose(m,C),g=o.fromScale(r.radii,R),w=o.fromScale(r.oneOverRadii,z),x=D;x[0]=0,x[1]=-u.z,x[2]=u.y,x[3]=u.z,x[4]=0,x[5]=-u.x,x[6]=-u.y,x[7]=u.x,x[8]=0;var E,S,O=o.multiply(o.multiply(v,w,L),x,L),T=o.multiply(o.multiply(O,g,U),m,U),M=o.multiplyByVector(O,a,A),W=y(T,e.negate(M,_),0,0,1),G=W.length;if(G>0){for(var V=e.clone(e.ZERO,B),Y=Number.NEGATIVE_INFINITY,j=0;G>j;++j){E=o.multiplyByVector(g,o.multiplyByVector(m,W[j],q),q);var k=e.normalize(e.subtract(E,a,N),N),H=e.dot(k,u);H>Y&&(Y=H,V=e.clone(E,V))}var Z=r.cartesianToCartographic(V,F);return Y=i.clamp(Y,0,1),S=e.magnitude(e.subtract(V,a,N))*Math.sqrt(1-Y*Y),S=c?-S:S,Z.height=S,r.cartographicToCartesian(Z)}return void 0};var W=new e;return p.lineSegmentPlane=function(t,r,a,o){n(o)||(o=new e);var u=e.subtract(r,t,W),s=a.normal,c=e.dot(s,u);if(Math.abs(c)<i.EPSILON6)return void 0;var l=e.dot(s,t),f=-(a.distance+l)/c;return 0>f||f>1?void 0:(e.multiplyByScalar(u,f,o),e.add(t,o,o),o)},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,h;if((1===l||2===l)&&(f=new e,h=new e),1===l){if(u)return p.lineSegmentPlane(t,r,a,f),p.lineSegmentPlane(t,n,a,h),{positions:[t,r,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(r,n,a,f),p.lineSegmentPlane(r,t,a,h),{positions:[t,r,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(n,t,a,f),p.lineSegmentPlane(n,r,a,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,a,f),p.lineSegmentPlane(n,t,a,h),{positions:[t,r,n,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(n,r,a,f),p.lineSegmentPlane(t,r,a,h),{positions:[t,r,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,n,a,f),p.lineSegmentPlane(r,n,a,h),{positions:[t,r,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},p}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(t,r){this.normal=e.clone(t),this.distance=r};return r.fromPointNormal=function(n,a,i){var o=-e.dot(a,n);return t(i)?(e.clone(a,i.normal),i.distance=o,i):new r(a,o)},r.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},r}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};return r.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];o>u;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;a+1>l;l++)c[l]=0;for(var f=i+1,h=0;o>h;++h)f-c[n[h]]>i&&(c[n[h]]=f,++f);return(f-i+1)/(o/3)},r.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(;n>i;){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 h=r[f];a[h].numLiveTriangles&&(s=0,i-a[h].timeStamp+2*a[h].numLiveTriangles<=t&&(s=i-a[h].timeStamp),(s>l||-1===l)&&(l=s,c=h)),++f}return-1===c?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,h=o[f],d=c;if(t(u))l=u+1;else{for(;d>f;)h>l&&(l=h),++f,h=o[f];if(-1===l)return 0;++l}for(var y=[],p=0;l>p;p++)y[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var m=0;d>f;)y[o[f]].vertexTriangles.push(m),++y[o[f]].numLiveTriangles,y[o[f+1]].vertexTriangles.push(m),++y[o[f+1]].numLiveTriangles,y[o[f+2]].vertexTriangles.push(m),++y[o[f+2]].numLiveTriangles,++m,f+=3;var v=0,g=s+1;i=1;var w,x,E=[],S=[],O=0,T=[],M=c/3,_=[];for(p=0;M>p;p++)_[p]=!1;for(var P,b;-1!==v;){E=[],x=y[v],b=x.vertexTriangles.length;for(var N=0;b>N;++N)if(m=x.vertexTriangles[N],!_[m]){_[m]=!0,f=m+m+m;for(var A=0;3>A;++A)P=o[f],E.push(P),S.push(P),T[O]=P,++O,w=y[P],--w.numLiveTriangles,g-w.timeStamp>s&&(w.timeStamp=g,++g),++f}v=a(o,s,E,y,g,S,l)}return T},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,r,n,a,i,o,u,s,c,l,f,h,d,y,p,m,v,g,w,x,E,S,O,T){"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 _(e){for(var t=e.length,r=6*(t/3),n=m.createTypedArray(t,r),a=0,i=0;t>i;i+=3,a+=6)M(n,a,e[i],e[i+1],e[i+2]);return n}function P(e){var t=e.length;if(t>=3){var r=6*(t-2),n=m.createTypedArray(t,r);M(n,0,e[0],e[1],e[2]);for(var a=6,i=3;t>i;++i,a+=6)M(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function b(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;t>o;++o,i+=6)M(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function N(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 y({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function A(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 I(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;n>i;i+=3)a.unpack(r,i,Q),E.multiplyByPoint(e,Q,Q),a.pack(Q,r,i)}function C(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;n>i;i+=3)a.unpack(r,i,Q),x.multiplyByVector(e,Q,Q),Q=a.normalize(Q,Q),a.pack(Q,r,i)}function R(e){var t,r=e.length,n={},a=e[0].geometry.attributes;for(t in a)if(a.hasOwnProperty(t)&&c(a[t])&&c(a[t].values)){for(var i=a[t],o=i.values.length,s=!0,l=1;r>l;++l){var f=e[l].geometry.attributes[t];if(!c(f)||i.componentDatatype!==f.componentDatatype||i.componentsPerAttribute!==f.componentsPerAttribute||i.normalize!==f.normalize){s=!1;break}o+=f.values.length}s&&(n[t]=new y({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:u.createTypedArray(i.componentDatatype,o)}))}return n}function z(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=m.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function D(e){var t=d.computeNumberOfVertices(e),r=m.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;t>a;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=O.TRIANGLES,e}function L(e){var t=d.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;t-1>a;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,t>a+2&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=O.TRIANGLES,e}function U(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=m.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function q(e){var t=d.computeNumberOfVertices(e),r=m.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;t>a;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=O.LINES,e}function B(e){var t=d.computeNumberOfVertices(e),r=m.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;t>a;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=O.LINES,e}function F(e){switch(e.primitiveType){case O.TRIANGLE_FAN:return D(e);case O.TRIANGLE_STRIP:return L(e);case O.TRIANGLES:return z(e);case O.LINE_STRIP:return q(e);case O.LINE_LOOP:return B(e);case O.LINES:return U(e)}return e}function W(e,t){Math.abs(e.y)<w.EPSILON11&&(e.y=t?-w.EPSILON11:w.EPSILON11)}function G(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,dt),e.y/(e.y-t.y),dt),r),a.clone(r,n),W(r,!0),W(n,!1)}function V(e,t,r){if(e.x>=0||t.x>=0||r.x>=0)return void 0;var n=e.y<0,a=t.y<0,i=r.y<0;W(e,n),W(t,a),W(r,i);var o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=gt.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(G(e,t,yt,mt),G(e,r,pt,vt),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(G(t,r,yt,mt),G(t,e,pt,vt),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(G(r,e,yt,mt),G(r,t,pt,vt),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||(G(r,e,yt,mt),G(r,t,pt,vt),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(G(t,r,yt,mt),G(t,e,pt,vt),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(G(e,t,yt,mt),G(e,r,pt,vt),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=gt.positions;return s[0]=e,s[1]=t,s[2]=r,gt.length=3,(1===o||2===o)&&(s[3]=yt,s[4]=pt,s[5]=mt,s[6]=vt,gt.length=7),gt}function Y(e,r,i,o,u,s,l,f){if(c(u)||c(s)||c(l)||c(f)){var h,d,y,p,m,v,g,w,x,E,S,O,T=o.positions,M=T[0],_=T[1],P=T[2],b=wt,N=xt,A=Et,I=St,C=Ot,R=Tt;c(u)&&(h=a.fromArray(u,3*e),d=a.fromArray(u,3*r),y=a.fromArray(u,3*i)),c(s)&&(p=a.fromArray(s,3*e),m=a.fromArray(s,3*r),v=a.fromArray(s,3*i)),c(l)&&(g=a.fromArray(l,3*e),w=a.fromArray(l,3*r),x=a.fromArray(l,3*i)),c(f)&&(E=n.fromArray(f,2*e),S=n.fromArray(f,2*r),O=n.fromArray(f,2*i));for(var z=3;z<T.length;++z){var D=T[z],L=t(D,M,_,P);if(c(u)){b=a.multiplyByScalar(h,L.x,b),N=a.multiplyByScalar(d,L.y,N),A=a.multiplyByScalar(y,L.z,A);var U=a.add(b,N,Mt);a.add(U,A,U),a.normalize(U,U),u.push(U.x,U.y,U.z)}if(c(s)){b=a.multiplyByScalar(p,L.x,b),N=a.multiplyByScalar(m,L.y,N),A=a.multiplyByScalar(v,L.z,A);var q=a.add(b,N,Mt);a.add(q,A,q),a.normalize(q,q),s.push(q.x,q.y,q.z)}if(c(l)){b=a.multiplyByScalar(g,L.x,b),N=a.multiplyByScalar(w,L.y,N),A=a.multiplyByScalar(x,L.z,A);var B=a.add(b,N,Mt);a.add(B,A,B),a.normalize(B,B),l.push(B.x,B.y,B.z)}if(c(f)){I=n.multiplyByScalar(E,L.x,I),C=n.multiplyByScalar(S,L.y,C),R=n.multiplyByScalar(O,L.z,R);var F=n.add(I,C,I);n.add(F,R,F),f.push(F.x,F.y)}}}}function j(e){for(var t=e.attributes,r=t.position.values,n=c(t.normal)?t.normal.values:void 0,i=c(t.binormal)?t.binormal.values:void 0,o=c(t.tangent)?t.tangent.values:void 0,s=c(t.st)?t.st.values:void 0,l=e.indices,f=Array.prototype.slice.call(r,0),h=c(n)?Array.prototype.slice.call(n,0):void 0,y=c(i)?Array.prototype.slice.call(i,0):void 0,p=c(o)?Array.prototype.slice.call(o,0):void 0,v=c(s)?Array.prototype.slice.call(s,0):void 0,g=[],w=l.length,x=0;w>x;x+=3){var E=l[x],S=l[x+1],O=l[x+2],T=a.fromArray(r,3*E),M=a.fromArray(r,3*S),_=a.fromArray(r,3*O),P=V(T,M,_);if(c(P))if(f[3*E+1]=P.positions[0].y,f[3*S+1]=P.positions[1].y,f[3*O+1]=P.positions[2].y,P.length>3){for(var b=f.length/3,N=0;N<P.indices.length;++N){var A=P.indices[N];3>A?g.push(l[x+A]):g.push(A-3+b)}for(var I=3;I<P.positions.length;++I){var C=P.positions[I];f.push(C.x,C.y,C.z)}Y(E,S,O,P,h,y,p,v)}else g.push(E,S,O);else g.push(E,S,O)}e.attributes.position.values=new Float64Array(f),c(h)&&(t.normal.values=u.createTypedArray(t.normal.componentDatatype,h)),c(y)&&(t.binormal.values=u.createTypedArray(t.binormal.componentDatatype,y)),c(p)&&(t.tangent.values=u.createTypedArray(t.tangent.componentDatatype,p)),c(v)&&(t.st.values=u.createTypedArray(t.st.componentDatatype,v));var R=d.computeNumberOfVertices(e);e.indices=m.createTypedArray(R,g)}function k(e){for(var t=e.attributes,r=t.position.values,n=e.indices,i=Array.prototype.slice.call(r,0),o=[],u=n.length,s=0;u>s;s+=2){var l=n[s],f=n[s+1],h=a.fromArray(r,3*l),y=a.fromArray(r,3*f);if(Math.abs(h.y)<w.EPSILON6&&(h.y=h.y<0?-w.EPSILON6:w.EPSILON6,i[3*l+1]=h.y),Math.abs(y.y)<w.EPSILON6&&(y.y=y.y<0?-w.EPSILON6:w.EPSILON6,i[3*f+1]=y.y),o.push(l),h.x<0||y.x<0){var p=g.lineSegmentPlane(h,y,_t);if(c(p)){var v=a.multiplyByScalar(a.UNIT_Y,5*w.EPSILON9,Pt);h.y<0&&a.negate(v,v);var x=i.length/3;o.push(x,x+1);var E=a.add(p,v,bt);i.push(E.x,E.y,E.z),a.negate(v,v),a.add(p,v,E),i.push(E.x,E.y,E.z)}}o.push(f)}e.attributes.position.values=new Float64Array(i);var S=d.computeNumberOfVertices(e);e.indices=m.createTypedArray(S,o)}function H(e){var t=e.attributes,r=t.position.values,o=c(t.st)?t.st.values:void 0,s=c(t.prevPosition)?t.prevPosition.values:void 0,l=c(t.nextPosition)?t.nextPosition.values:void 0,f=c(t.expandAndWidth)?t.expandAndWidth.values:void 0,h=c(t.color)?t.color.values:void 0;e.indices;for(var y=Array.prototype.slice.call(r,0),p=c(o)?Array.prototype.slice.call(o,0):void 0,v=c(s)?Array.prototype.slice.call(s,0):void 0,x=c(l)?Array.prototype.slice.call(l,0):void 0,E=c(f)?Array.prototype.slice.call(f,0):void 0,S=c(h)?Array.prototype.slice.call(h,0):void 0,O=[],T=y.length/3,M=0;T>M;M+=4){var _=M,P=M+1,b=M+2,N=a.fromArray(y,3*_,It),A=a.fromArray(y,3*P,Ct),I=a.fromArray(y,3*b,Rt),C=a.equals(N,A);Math.abs(N.y)<w.EPSILON6&&(N.y=I.y<0?-w.EPSILON6:w.EPSILON6,y[3*_+1]=N.y),Math.abs(I.y)<w.EPSILON6&&(I.y=N.y<0?-w.EPSILON6:w.EPSILON6,y[3*b+1]=I.y),y[3*P+1]=A.y=C?N.y:I.y;var R=!1;if(N.x<0||I.x<0){var z=g.lineSegmentPlane(N,I,_t,Ct);if(c(z)){var D=a.multiplyByScalar(a.UNIT_Y,5*w.EPSILON9,zt);N.y<0&&a.negate(D,D);var L=a.add(z,D,Dt);y.push(L.x,L.y,L.z),y.push(L.x,L.y,L.z),a.negate(D,D),a.add(z,D,L),y.push(L.x,L.y,L.z),y.push(L.x,L.y,L.z),v.push(N.x,N.y,N.z,N.x,N.y,N.z),v.push(N.x,N.y,N.z,N.x,N.y,N.z),x.push(I.x,I.y,I.z,I.x,I.y,I.z),x.push(I.x,I.y,I.z,I.x,I.y,I.z);var U=n.fromArray(E,2*_),q=Math.abs(U.y);E.push(-1,-q,1,-q),E.push(-1,q,1,q);var B=a.magnitudeSquared(a.subtract(z,N,zt));if(B/=a.magnitudeSquared(a.subtract(I,N,zt)),c(S)){var F=i.fromArray(S,4*_,Lt),W=i.fromArray(S,4*b,Lt),G=w.lerp(F.x,W.x,B),V=w.lerp(F.y,W.y,B),Y=w.lerp(F.z,W.z,B),j=w.lerp(F.w,W.w,B);S.push(G,V,Y,j),S.push(G,V,Y,j),S.push(G,V,Y,j),S.push(G,V,Y,j)}if(c(p)){var k=n.fromArray(p,2*_,Nt),H=n.fromArray(p,2*(M+3),At),Z=w.lerp(k.x,H.x,B);p.push(Z,k.y),p.push(Z,H.y),p.push(Z,k.y),p.push(Z,H.y)}R=!0}}if(R){var X=y.length/3-4;O.push(M,X,M+1),O.push(M+1,X,X+1),O.push(X+2,M+2,X+3),O.push(X+3,M+2,M+3)}else O.push(M,M+2,M+1),O.push(M+1,M+2,M+3)}t.position.values=new Float64Array(y),t.prevPosition.values=u.createTypedArray(t.prevPosition.componentDatatype,v),t.nextPosition.values=u.createTypedArray(t.nextPosition.componentDatatype,x),t.expandAndWidth.values=u.createTypedArray(t.expandAndWidth.componentDatatype,E),c(p)&&(t.st.values=u.createTypedArray(t.st.componentDatatype,p)),c(S)&&(t.color.values=u.createTypedArray(t.color.componentDatatype,S));var J=d.computeNumberOfVertices(e);e.indices=m.createTypedArray(J,O)}var Z={};Z.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case O.TRIANGLES:e.indices=_(t);break;case O.TRIANGLE_STRIP:e.indices=P(t);break;case O.TRIANGLE_FAN:e.indices=b(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=O.LINES}return e},Z.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,h=0;o>h;h+=3)l[f++]=a[h],l[f++]=a[h+1],l[f++]=a[h+2],l[f++]=a[h]+i[h]*n,l[f++]=a[h+1]+i[h+1]*n,l[f++]=a[h+2]+i[h+2]*n;var p,m=e.boundingSphere;return c(m)&&(p=new r(m.center,m.radius+n)),new d({attributes:{position:new y({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:O.LINES,boundingSphere:p})},Z.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;o>t;++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},Z.reorderForPreVertexCache=function(e){var t=d.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;t>a;a++)n[a]=-1;for(var i,o=r,s=o.length,l=m.createTypedArray(t,s),f=0,h=0,y=0;s>f;)i=n[o[f]],-1!==i?l[h]=i:(i=o[f],n[i]=y,l[h]=y,++y),++f,++h;e.indices=l;var p=e.attributes;for(var v in p)if(p.hasOwnProperty(v)&&c(p[v])&&c(p[v].values)){for(var g=p[v],w=g.values,x=0,E=g.componentsPerAttribute,S=u.createTypedArray(g.componentDatatype,y*E);t>x;){var O=n[x];if(-1!==O)for(a=0;E>a;a++)S[E*O+a]=w[E*x+a];++x}g.values=S}}return e},Z.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===O.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;n>i;i++)r[i]>a&&(a=r[i]);e.indices=T.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},Z.fitToUnsignedShortIndices=function(e){var t=[],r=d.computeNumberOfVertices(e);if(c(e.indices)&&r>w.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=N(e.attributes),s=e.indices,l=s.length;e.primitiveType===O.TRIANGLES?n=3:e.primitiveType===O.LINES?n=2:e.primitiveType===O.POINTS&&(n=1);for(var f=0;l>f;f+=n){for(var h=0;n>h;++h){var y=s[f+h],p=a[y];c(p)||(p=o++,a[y]=p,A(u,e.attributes,y)),i.push(p)}o+n>w.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere})),a=[],i=[],o=0,u=N(e.attributes))}0!==i.length&&t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere}))}else t.push(e);return t};var X=new a,J=new o;Z.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new h;for(var s=i.ellipsoid,f=o.values,d=new Float64Array(f.length),p=0,m=0;m<f.length;m+=3){var v=a.fromArray(f,m,X),g=s.cartesianToCartographic(v,J);if(!c(g))throw new l("Could not project point ("+v.x+", "+v.y+", "+v.z+") to 2D.");var w=i.project(g,X);d[p++]=w.x,d[p++]=w.y,d[p++]=w.z}return e.attributes[r]=o,e.attributes[n]=new y({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:d}),delete e.attributes[t],e};var K={high:0,low:0};Z.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;o>l;++l)f.encode(i[l],K),s[l]=K.high,c[l]=K.low;var h=a.componentsPerAttribute;return e.attributes[r]=new y({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:s}),e.attributes[n]=new y({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:c}),delete e.attributes[t],e};var Q=new a,$=new E,et=new x;Z.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(E.equals(t,E.IDENTITY))return e;var n=e.geometry.attributes;I(t,n.position),I(t,n.prevPosition),I(t,n.nextPosition),(c(n.normal)||c(n.binormal)||c(n.tangent))&&(E.inverse(t,$),E.transpose($,$),E.getRotation($,et),C(et,n.normal),C(et,n.binormal),C(et,n.tangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=E.clone(E.IDENTITY),e};var tt=new a;Z.combine=function(e){var t,n,i,o,u=e.length;e[0].modelMatrix;var s,l,f,h=c(e[0].geometry.indices),y=e[0].geometry.primitiveType,p=R(e);for(t in p)if(p.hasOwnProperty(t))for(s=p[t].values,o=0,n=0;u>n;++n)for(l=e[n].geometry.attributes[t].values,f=l.length,i=0;f>i;++i)s[o++]=l[i];var v;if(h){var g=0;for(n=0;u>n;++n)g+=e[n].geometry.indices.length;var w=d.computeNumberOfVertices(new d({attributes:p,primitiveType:O.POINTS})),x=m.createTypedArray(w,g),E=0,S=0;for(n=0;u>n;++n){var T=e[n].geometry.indices,M=T.length;for(o=0;M>o;++o)x[E++]=S+T[o];S+=d.computeNumberOfVertices(e[n].geometry)}v=x}var _,P=new a,b=0;for(n=0;u>n;++n){if(_=e[n].geometry.boundingSphere,!c(_)){P=void 0;break}a.add(_.center,P,P)}if(c(P))for(a.divideByScalar(P,u,P),n=0;u>n;++n){_=e[n].geometry.boundingSphere;var N=a.magnitude(a.subtract(_.center,P,tt))+_.radius;N>b&&(b=N)}return new d({attributes:p,indices:v,primitiveType:y,boundingSphere:c(P)?new r(P,b):void 0})};var rt=new a,nt=new a,at=new a,it=new a;Z.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;i>f;f++)s[f]={indexOffset:0,count:0,currentCount:0};var h=0;for(f=0;o>f;f+=3){var d=t[f],p=t[f+1],m=t[f+2],v=3*d,g=3*p,w=3*m;nt.x=n[v],nt.y=n[v+1],nt.z=n[v+2],at.x=n[g],at.y=n[g+1],at.z=n[g+2],it.x=n[w],it.y=n[w+1],it.z=n[w+2],s[d].count++,s[p].count++,s[m].count++,a.subtract(at,nt,at),a.subtract(it,nt,it),c[h]=a.cross(at,it,new a),h++}var x=0;for(f=0;i>f;f++)s[f].indexOffset+=x,x+=s[f].count;h=0;var E;for(f=0;o>f;f+=3){E=s[t[f]];var S=E.indexOffset+E.currentCount;l[S]=h,E.currentCount++,E=s[t[f+1]],S=E.indexOffset+E.currentCount,l[S]=h,E.currentCount++,E=s[t[f+2]],S=E.indexOffset+E.currentCount,l[S]=h,E.currentCount++,h++}var O=new Float32Array(3*i);for(f=0;i>f;f++){var T=3*f;if(E=s[f],E.count>0){for(a.clone(a.ZERO,rt),h=0;h<E.count;h++)a.add(rt,c[l[E.indexOffset+h]],rt);a.normalize(rt,rt),O[T]=rt.x,O[T+1]=rt.y,O[T+2]=rt.z}else O[T]=0,O[T+1]=0,O[T+2]=1}return e.attributes.normal=new y({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:O}),e};var ot=new a,ut=new a,st=new a;Z.computeBinormalAndTangent=function(e){e.attributes;for(var t=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,h,d;for(l=0;s>l;l+=3){var p=t[l],m=t[l+1],v=t[l+2];f=3*p,h=3*m,d=3*v;var g=2*p,w=2*m,x=2*v,E=r[f],S=r[f+1],O=r[f+2],T=i[g],M=i[g+1],_=i[w+1]-M,P=i[x+1]-M,b=1/((i[w]-T)*P-(i[x]-T)*_),N=(P*(r[h]-E)-_*(r[d]-E))*b,A=(P*(r[h+1]-S)-_*(r[d+1]-S))*b,I=(P*(r[h+2]-O)-_*(r[d+2]-O))*b;c[f]+=N,c[f+1]+=A,c[f+2]+=I,c[h]+=N,c[h+1]+=A,c[h+2]+=I,c[d]+=N,c[d+1]+=A,c[d+2]+=I}var C=new Float32Array(3*o),R=new Float32Array(3*o);for(l=0;o>l;l++){f=3*l,h=f+1,d=f+2;var z=a.fromArray(n,f,ot),D=a.fromArray(c,f,st),L=a.dot(z,D); -a.multiplyByScalar(z,L,ut),a.normalize(a.subtract(D,ut,D),D),R[f]=D.x,R[h]=D.y,R[d]=D.z,a.normalize(a.cross(z,D,D),D),C[f]=D.x,C[h]=D.y,C[d]=D.z}return e.attributes.tangent=new y({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:R}),e.attributes.binormal=new y({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:C}),e};var ct=new n,lt=new a,ft=new a,ht=new a;Z.compressVertices=function(t){var r=t.attributes.normal,i=t.attributes.st;if(!c(r)&&!c(i))return t;var o,s,l,f,h=t.attributes.tangent,d=t.attributes.binormal;c(r)&&(o=r.values),c(i)&&(s=i.values),c(h)&&(l=h.values),d&&(f=d.values);var p=c(o)?o.length:s.length,m=c(o)?3:2,v=p/m,g=v,w=c(s)&&c(o)?2:1;w+=c(l)||c(f)?1:0,g*=w;for(var x=new Float32Array(g),E=0,S=0;v>S;++S){c(s)&&(n.fromArray(s,2*S,ct),x[E++]=e.compressTextureCoordinates(ct));var O=3*S;c(o)&&c(l)&&c(f)?(a.fromArray(o,O,lt),a.fromArray(l,O,ft),a.fromArray(f,O,ht),e.octPack(lt,ft,ht,ct),x[E++]=ct.x,x[E++]=ct.y):(c(o)&&(a.fromArray(o,O,lt),x[E++]=e.octEncodeFloat(lt)),c(l)&&(a.fromArray(l,O,lt),x[E++]=e.octEncodeFloat(lt)),c(f)&&(a.fromArray(f,O,lt),x[E++]=e.octEncodeFloat(lt)))}return t.attributes.compressedAttributes=new y({componentDatatype:u.FLOAT,componentsPerAttribute:w,values:x}),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 dt=new a,yt=new a,pt=new a,mt=new a,vt=new a,gt={positions:new Array(7),indices:new Array(9)},wt=new a,xt=new a,Et=new a,St=new n,Ot=new n,Tt=new n,Mt=new a,_t=S.fromPointNormal(a.ZERO,a.UNIT_Y),Pt=new a,bt=new a,Nt=new n,At=new n,It=new a,Ct=new a,Rt=new a,zt=new a,Dt=new a,Lt=new i;return new i,Z.wrapLongitude=function(e){var t=e.boundingSphere;if(c(t)){var n=t.center.x-t.radius;if(n>0||r.intersect(t,i.UNIT_Y)!==v.INTERSECTING)return e}if(e.geometryType!==p.NONE)switch(e.geometryType){case p.POLYLINES:H(e);break;case p.TRIANGLES:j(e);break;case p.LINES:k(e)}else F(e),e.primitiveType===O.TRIANGLES?j(e):e.primitiveType===O.LINES&&k(e);return e},Z}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,r,n,a){"use strict";var i=function(n,a,i){this.minimum=e.clone(t(n,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),r(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,n){if(r(n)||(n=new i),!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 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;f>h;h++){var d=t[h],y=d.x,p=d.y,m=d.z;a=Math.min(y,a),s=Math.max(y,s),o=Math.min(p,o),c=Math.max(p,c),u=Math.min(m,u),l=Math.max(m,l)}var v=n.minimum;v.x=a,v.y=o,v.z=u;var g=n.maximum;g.x=s,g.y=c,g.z=l;var w=e.add(v,g,n.center);return e.multiplyByScalar(w,.5,w),n},i.clone=function(t,n){return r(t)?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 i(t.minimum,t.maximum):void 0},i.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 i.intersect=function(t,r){o=e.subtract(t.maximum,t.minimum,o);var n=e.multiplyByScalar(o,.5,o),i=n.x*Math.abs(r.x)+n.y*Math.abs(r.y)+n.z*Math.abs(r.z),u=e.dot(t.center,r)+r.w;return u-i>0?a.INSIDE:0>u+i?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersect=function(e){return i.intersect(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),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(n){return i(n)}});return r}function i(e){var r=new n(function(r,n){try{return n?t(n(e)):i(e)}catch(a){return i(a)}});return r}function o(){function e(e,t,r){return h(e,t,r)}function r(e){return y(e)}function a(e){return y(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,y;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=[],h=function(e,t,r){var n,a;return n=o(),a="function"==typeof r?function(e){try{n.progress(r(e))}catch(t){n.progress(t)}}:function(e){n.progress(e)},l.push(function(r){r.then(e,t).then(n.resolve,n.reject,a)}),f.push(a),n.promise},d=function(e){return p(f,e),e},y=function(e){return e=t(e),h=e.then,y=t,d=v,p(l,e),f=l=E,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){y(e)}var c,l,f,h,d,y,p,m,g,w;if(g=t.length>>>0,c=Math.max(0,Math.min(r,g)),f=[],l=g-c+1,h=[],d=o(),c)for(m=d.progress,p=function(e){h.push(e),--l||(y=p=v,d.reject(h))},y=function(e){f.push(e),--c||(y=p=v,d.resolve(f))},w=0;g>w;++w)w in t&&e(t[w],s,u,m);else d.resolve(f);return d.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),h(e,g).then(t,r,n)}function f(){return h(arguments,g)}function h(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;a>s;s++)s in t?u(t[s],s):--i;else c.resolve(n);return c.promise})}function d(t,r){var n=x.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)})})},w.apply(t,n)})}function y(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 v(){}function g(e){return e}var w,x,E;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=y,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(E,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(E,t)})})}},x=[].slice,w=[].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(;a>i;++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(){"use strict";var e=function(e,t,r){for(var n,a,i=0,o=e.length-1;o>=i;)if(n=~~((i+o)/2),a=r(e[n],t),0>a)i=n+1;else{if(!(a>0))return n;o=n-1}return~(o+1)};return e}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";var e=function(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,h){var d,y,p,m,v;if("%%"==e)return"%";for(var g=!1,w="",x=!1,E=!1,S=" ",O=s.length,T=0;s&&O>T;T++)switch(s.charAt(T)){case" ":w=" ";break;case"+":w="+";break;case"-":g=!0;break;case"'":S=s.charAt(T+1);break;case"0":x=!0;break;case"#":E=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(c=-c,g=!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,v=n?t[n.slice(0,-1)]:t[r++],h){case"s":return u(String(v),g,c,f,x,S);case"c":return u(String.fromCharCode(+v),g,c,f,x);case"b":return o(v,2,E,g,c,f,x);case"o":return o(v,8,E,g,c,f,x);case"x":return o(v,16,E,g,c,f,x);case"X":return o(v,16,E,g,c,f,x).toUpperCase();case"u":return o(v,10,E,g,c,f,x);case"i":case"d":return d=+v||0,d=Math.round(d-d%1),y=0>d?"-":w,v=y+a(String(Math.abs(d)),f,"0",!1),i(v,y,g,c,x);case"e":case"E":case"f":case"F":case"g":case"G":return d=+v,y=0>d?"-":w,p=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],v=y+Math.abs(d)[p](f),i(v,y,g,c,x)[m]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";var e=function(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(){"use strict";function e(e){return 0===e%4&&0!==e%100||0===e%400}return e}),define("Core/LeapSecond",[],function(){"use strict";var e=function(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 N.compare(e.julianDate,t.julianDate)}function f(e){g.julianDate=e;var r=N.leapSeconds,n=t(r,g,l);0>n&&(n=~n),n>=r.length&&(n=r.length-1);var a=r[n].offset;if(n>0){var i=N.secondsDifference(r[n].julianDate,e);i>a&&(n--,a=r[n].offset)}N.addSeconds(e,a,e)}function h(e,r){g.julianDate=e;var n=N.leapSeconds,a=t(n,g,l);if(0>a&&(a=~a),0===a)return N.addSeconds(e,-n[0].offset,r);if(a>=n.length)return N.addSeconds(e,-n[a-1].offset,r);var i=N.secondsDifference(n[a].julianDate,e);return 0===i?N.addSeconds(e,-n[a].offset,r):1>=i?void 0:N.addSeconds(e,-n[--a].offset,r)}function d(e,t,r){var n=0|t/s.SECONDS_PER_DAY;return e+=n,t-=s.SECONDS_PER_DAY*n,0>t&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function y(e,t,r,n,a,i,o){var u=0|(t-14)/12,c=e+4800+u,l=(0|1461*c/4)+(0|367*(t-2-12*u)/12)-(0|3*((c+100)/100)/4)+r-32075;n-=12,0>n&&(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]}var p=new i,m=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,g=new u,w=/^(\d{4})$/,x=/^(\d{4})-(\d{2})$/,E=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,O=/^(\d{4})-?(\d{2})-?(\d{2})$/,T=/([Z+\-])?(\d{2})?:?(\d{2})?$/,M=/^(\d{2})(\.\d+)?/.source+T.source,_=/^(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,P=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,b="Invalid ISO 8601 date.",N=function(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,d(a,t,this),n===c.UTC&&f(this)};N.fromDate=function(e,t){var r=y(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 N(r[0],r[1],c.UTC)},N.fromIso8601=function(e,t){e=e.replace(",",".");var r,i,u,s=e.split("T"),l=1,h=1,p=0,g=0,T=0,A=0,I=s[0],C=s[1];if(!n(I))throw new a(b);var R;if(s=I.match(O),null!==s){if(R=I.split("-").length-1,R>0&&2!==R)throw new a(b);r=+s[1],l=+s[2],h=+s[3]}else if(s=I.match(x),null!==s)r=+s[1],l=+s[2];else if(s=I.match(w),null!==s)r=+s[1];else{var z;if(s=I.match(E),null!==s){if(r=+s[1],z=+s[2],u=o(r),1>z||u&&z>366||!u&&z>365)throw new a(b)}else{if(s=I.match(S),null===s)throw new a(b);r=+s[1];var D=+s[2],L=+s[3]||0;if(R=I.split("-").length-1,R>0&&(!n(s[3])&&1!==R||n(s[3])&&2!==R))throw new a(b);var U=new Date(Date.UTC(r,0,4));z=7*D+L-U.getUTCDay()-3}i=new Date(Date.UTC(r,0,1)),i.setUTCDate(z),l=i.getUTCMonth()+1,h=i.getUTCDate()}if(u=o(r),1>l||l>12||1>h||(2!==l||!u)&&h>m[l-1]||u&&2===l&&h>v)throw new a(b);var q;if(n(C)){if(s=C.match(P),null!==s){if(R=C.split(":").length-1,R>0&&2!==R&&3!==R)throw new a(b);p=+s[1],g=+s[2],T=+s[3],A=1e3*+(s[4]||0),q=5}else if(s=C.match(_),null!==s){if(R=C.split(":").length-1,R>0&&1!==R)throw new a(b);p=+s[1],g=+s[2],T=60*+(s[3]||0),q=4}else{if(s=C.match(M),null===s)throw new a(b);p=+s[1],g=60*+(s[2]||0),q=3}if(g>=60||T>=61||p>24||24===p&&(g>0||T>0||A>0))throw new a(b);var B=s[q],F=+s[q+1],W=+(s[q+2]||0);switch(B){case"+":p-=F,g-=W;break;case"-":p+=F,g+=W;break;case"Z":break;default:g+=new Date(Date.UTC(r,l-1,h,p,g)).getTimezoneOffset()}}else g+=new Date(Date.UTC(r,l-1,h)).getTimezoneOffset();var G=60===T;for(G&&T--;g>=60;)g-=60,p++;for(;p>=24;)p-=24,h++;for(i=u&&2===l?v:m[l-1];h>i;)h-=i,l++,l>12&&(l-=12,r++),i=u&&2===l?v:m[l-1];for(;0>g;)g+=60,p--;for(;0>p;)p+=24,h--;for(;1>h;)l--,1>l&&(l+=12,r--),i=u&&2===l?v:m[l-1],h+=i;var V=y(r,l,h,p,g,T,A);return n(t)?(d(V[0],V[1],t),f(t)):t=new N(V[0],V[1],c.UTC),G&&N.addSeconds(t,1,t),t},N.now=function(e){return N.fromDate(new Date,e)};var A=new N(0,0,c.TAI);return N.toGregorianDate=function(e,t){var r=!1,a=h(e,A);n(a)||(N.addSeconds(e,-1,A),a=h(A,A),r=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=0|o+68569,l=0|4*c/146097;c=0|c-(0|(146097*l+3)/4);var f=0|4e3*(c+1)/1461001;c=0|c-(0|1461*f/4)+31;var d=0|80*c/2447,y=0|c-(0|2447*d/80);c=0|d/11;var p=0|d+2-12*c,m=0|100*(l-49)+f+c,v=0|u/s.SECONDS_PER_HOUR,g=u-v*s.SECONDS_PER_HOUR,w=0|g/s.SECONDS_PER_MINUTE;g-=w*s.SECONDS_PER_MINUTE;var x=0|g,E=(g-x)/s.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),r&&(x+=1),n(t)?(t.year=m,t.month=p,t.day=y,t.hour=v,t.minute=w,t.second=x,t.millisecond=E,t.isLeapSecond=r,t):new i(m,p,y,v,w,x,E,r)},N.toDate=function(e){var t=N.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))},N.toIso8601=function(t,r){var a,i=N.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))},N.clone=function(e,t){return n(e)?n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new N(e.dayNumber,e.secondsOfDay,c.TAI):void 0},N.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},N.equals=function(e,t){return e===t||n(e)&&n(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},N.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(N.secondsDifference(e,t))<=r},N.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},N.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},N.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,n=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+n},N.computeTaiMinusUtc=function(e){g.julianDate=e;var r=N.leapSeconds,n=t(r,g,l);return 0>n&&(n=~n,--n,0>n&&(n=0)),r[n].offset},N.addSeconds=function(e,t,r){return d(e.dayNumber,e.secondsOfDay+t,r)},N.addMinutes=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,n,r)},N.addHours=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,n,r)},N.addDays=function(e,t,r){var n=e.dayNumber+t;return d(n,e.secondsOfDay,r)},N.lessThan=function(e,t){return N.compare(e,t)<0},N.lessThanOrEquals=function(e,t){return N.compare(e,t)<=0},N.greaterThan=function(e,t){return N.compare(e,t)>0},N.greaterThanOrEquals=function(e,t){return N.compare(e,t)>=0},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){return N.equalsEpsilon(this,e,t)},N.prototype.toString=function(){return N.toIso8601(this)},N.leapSeconds=[new u(new N(2441317,43210,c.TAI),10),new u(new N(2441499,43211,c.TAI),11),new u(new N(2441683,43212,c.TAI),12),new u(new N(2442048,43213,c.TAI),13),new u(new N(2442413,43214,c.TAI),14),new u(new N(2442778,43215,c.TAI),15),new u(new N(2443144,43216,c.TAI),16),new u(new N(2443509,43217,c.TAI),17),new u(new N(2443874,43218,c.TAI),18),new u(new N(2444239,43219,c.TAI),19),new u(new N(2444786,43220,c.TAI),20),new u(new N(2445151,43221,c.TAI),21),new u(new N(2445516,43222,c.TAI),22),new u(new N(2446247,43223,c.TAI),23),new u(new N(2447161,43224,c.TAI),24),new u(new N(2447892,43225,c.TAI),25),new u(new N(2448257,43226,c.TAI),26),new u(new N(2448804,43227,c.TAI),27),new u(new N(2449169,43228,c.TAI),28),new u(new N(2449534,43229,c.TAI),29),new u(new N(2450083,43230,c.TAI),30),new u(new N(2450630,43231,c.TAI),31),new u(new N(2451179,43232,c.TAI),32),new u(new N(2453736,43233,c.TAI),33),new u(new N(2454832,43234,c.TAI),34),new u(new N(2456109,43235,c.TAI),35)],N}),define("Core/clone",["./defaultValue"],function(e){"use strict";var t=function(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";var e=function(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";var r=function(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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,r,n,a,i){"use strict";function o(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function u(e,t){for(var r=o(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 s(e,r){r=t(r,"");var a=e[1],i=!!e[2],s=e[3];switch(r){case"":case"text":return o(i,s);case"arraybuffer":return u(i,s);case"blob":var c=u(i,s);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(o(i,s),a);case"json":return JSON.parse(o(i,s));default:throw new n("Unhandled responseType: "+r)}}var c=function(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,a=t(r.method,"GET"),i=r.data,o=r.headers,u=r.overrideMimeType,s=r.withCredentials;return e(r.url,function(t){var r=e.defer();return c.load(t,n,a,i,o,r,u,s),r.promise})},l=/^data:(.*?)(;base64)?,(.*)$/;return c.load=function(e,t,n,o,u,c,f,h){var d=l.exec(e);if(null!==d)return c.resolve(s(d,t)),void 0;var y=new XMLHttpRequest;if(r(f)&&r(y.overrideMimeType)&&y.overrideMimeType(f),y.open(n,e,!0),r(u))for(var p in u)u.hasOwnProperty(p)&&y.setRequestHeader(p,u[p]);r(t)&&(y.responseType=t),r(h)&&(y.withCredentials=h),y.onload=function(){200===y.status?r(y.response)?c.resolve(y.response):r(y.responseXML)&&y.responseXML.hasChildNodes()?c.resolve(y.responseXML):r(y.responseText)?c.resolve(y.responseText):c.reject(new i("unknown XMLHttpRequest response type.")):c.reject(new a(y.status,y.response,y.getAllResponseHeaders()))},y.onerror=function(){c.reject(new a)},y.send(o)},c.defaultLoad=c.load,c}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";var r=function(r,n){return e({url:r,headers:t(n)?n.headers:void 0,overrideMimeType:t(n)?n.overrideMimeType:void 0,withCredentials:t(n)?n.withCredentials:void 0})};return r}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";var a={Accept:"application/json,*/*;q=0.01"},i=function(r,i){return t(i)||(i={}),t(i.headers)?t(i.headers.Accept)||(i.headers=e(i.headers),i.headers.Accept=a.Accept):i.headers=a,n(r,i).then(function(e){return JSON.parse(e)})};return i}),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 h(e,t){return o.compare(e.julianDate,t)}function d(e,r){if(!n(r.columnNames))return e._dataError="Error in loaded EOP data: The columnNames property is required.",void 0;if(!n(r.samples))return e._dataError="Error in loaded EOP data: The samples property is required.",void 0;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"),y=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),p=r.columnNames.indexOf("taiMinusUtcSeconds");if(0>a||0>i||0>s||0>c||0>d||0>y||0>p)return e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns",void 0;var m=e._samples=r.samples,v=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=y,e._taiMinusUtcSecondsColumn=p,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var g,w=e._addNewLeapSeconds,x=0,E=m.length;E>x;x+=e._columnCount){var S=m[x+a],O=m[x+p],T=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,M=new o(T,O,f.TAI);if(v.push(M),w){if(O!==g&&n(g)){var _=o.leapSeconds,P=t(_,M,h);if(0>P){var b=new u(M,O);_.splice(~P,0,b)}}g=O}}}function y(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 m(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 y(e,r,a,s,u),u;if(n.equals(l))return y(e,r,i,s,u),u;var f=o.secondsDifference(n,c)/o.secondsDifference(l,c),h=a*s,d=i*s,m=r[h+e._ut1MinusUtcSecondsColumn],v=r[d+e._ut1MinusUtcSecondsColumn],g=v-m;if(g>.5||-.5>g){var w=r[h+e._taiMinusUtcSecondsColumn],x=r[d+e._taiMinusUtcSecondsColumn];w!==x&&(l.equals(n)?m=v:v-=x-w)}return u.xPoleWander=p(f,r[h+e._xPoleWanderRadiansColumn],r[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=p(f,r[h+e._yPoleWanderRadiansColumn],r[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=p(f,r[h+e._xCelestialPoleOffsetRadiansColumn],r[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=p(f,r[h+e._yCelestialPoleOffsetRadiansColumn],r[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=p(f,m,v),u}var v=function(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))d(this,t.data);else if(n(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:[]})};return v.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}}),v.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},v.prototype.compute=function(e,r){if(!n(this._samples)){if(n(this._dataError))throw new c(this._dataError);return void 0}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],h=i[u+1],d=o.lessThanOrEquals(f,e),y=!n(h),p=y||o.greaterThanOrEquals(h,e);if(d&&p)return s=u,!y&&h.equals(e)&&++s,l=s+1,m(this,i,this._samples,e,s,l,r),r}var v=t(i,e,o.compare,this._dateColumn);return v>=0?(v<i.length-1&&i[v+1].equals(e)&&++v,s=v,l=v):(l=~v,s=l-1,0>s&&(s=0)),this._lastIndex=s,m(this,i,this._samples,e,s,l,r),r},v}),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()):(r.path=t.authority&&""==t.path?"/"+this.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];for(n&&t.shift(),""==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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","require"],function(e,t,r,n){"use strict";function a(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;r>t;++t){var n=e[t].getAttribute("src"),a=f.exec(n);if(null!==a)return a[1]}return void 0}function i(){if(t(s))return s;var n;if(n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:a(),!t(n))throw new r("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return s=new e(n).resolve(new e(document.location.href))}function o(e){return n.toUrl("../"+e)}function u(t){return new e(t).resolve(i()).toString()}var s,c,l,f=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i,h=function(e){t(c)||(c=t(n.toUrl)?o:u),t(l)||(l=document.createElement("a"));var r=c(e);return l.href=r,l.href=l.href,l.href};return h._cesiumScriptRegex=f,h}),define("Core/Iau2006XysSample",[],function(){"use strict";var e=function(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,t,r){var n=f;return n.dayNumber=t,n.secondsOfDay=r,i.daysDifference(n,e._sampleZeroDateTT)}function c(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=3*a*r._samplesPerXysFile,u=0,s=n.length;s>u;++u)t[o+u]=n[u];i.resolve()}),i.promise}var l=function(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;t>=s;++s){n[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;t>=c;++c)c!==s&&(n[s]*=s-c);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)},f=new i(0,0,u.TAI);return l.prototype.preload=function(t,r,n,a){var i=s(this,t,r),o=s(this,n,a),u=0|i/this._stepSizeDays-this._interpolationOrder/2;0>u&&(u=0);var l=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var f=0|u/this._samplesPerXysFile,h=0|l/this._samplesPerXysFile,d=[],y=f;h>=y;++y)d.push(c(this,y));return e.all(d)},l.prototype.computeXysRadians=function(e,t,r){var i=s(this,e,t);if(0>i)return void 0;var o=0|i/this._stepSizeDays;if(o>=this._totalSamples)return void 0;var u=this._interpolationOrder,l=o-(0|u/2);0>l&&(l=0);var f=l+u;f>=this._totalSamples&&(f=this._totalSamples-1,l=f-u,0>l&&(l=0));var h=!1,d=this._samples;if(n(d[3*l])||(c(this,0|l/this._samplesPerXysFile),h=!0),n(d[3*f])||(c(this,0|f/this._samplesPerXysFile),h=!0),h)return void 0; -n(r)?(r.x=0,r.y=0,r.s=0):r=new a(0,0,0);var y,p,m=i-l*this._stepSizeDays,v=this._work,g=this._denominators,w=this._coef,x=this._xTable;for(y=0;u>=y;++y)v[y]=m-x[y];for(y=0;u>=y;++y){for(w[y]=1,p=0;u>=p;++p)p!==y&&(w[y]*=v[p]);w[y]*=g[y];var E=3*(l+y);r.x+=w[y]*d[E++],r.y+=w[y]*d[E++],r.s+=w[y]*d[E]}return r},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./TimeConstants"],function(e,t,r,n,a,i,o,u,s,c,l,f,h,d,y,p,m){"use strict";var v={},g=new r,w=new r,x=new r;v.eastNorthUpToFixedFrame=function(e,t,n){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(n)?(n[0]=0,n[1]=1,n[2]=0,n[3]=0,n[4]=-o,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=o,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new p(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=g,s=w,l=x;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),i(n)?(n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=l.x,n[5]=l.y,n[6]=l.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 p(s.x,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var E=new r,S=new r,O=new r;v.northEastDownToFixedFrame=function(e,t,n){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(n)?(n[0]=-o,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]=-o,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new p(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=E,s=S,l=O;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),i(n)?(n[0]=l.x,n[1]=l.y,n[2]=l.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 p(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},v.northUpEastToFixedFrame=function(e,t,n){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(n)?(n[0]=-o,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=o,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 p(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=g,s=w,l=x;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),i(n)?(n[0]=l.x,n[1]=l.y,n[2]=l.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 p(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=24110.54841,M=8640184.812866,_=.093104,P=-62e-7,b=1.1772758384668e-19,N=72921158553e-15,A=d.TWO_PI/86400,I=new h;v.computeTemeToPseudoFixedMatrix=function(e,t){I=h.addSeconds(e,-h.computeTaiMinusUtc(e),I);var r,n=I.dayNumber,a=I.secondsOfDay,o=n-2451545;r=a>=43200?(o+.5)/m.DAYS_PER_JULIAN_CENTURY:(o-.5)/m.DAYS_PER_JULIAN_CENTURY;var u=T+r*(M+r*(_+r*P)),s=u*A%d.TWO_PI,c=N+b*(n-2451545.5),l=(a+.5*m.SECONDS_PER_DAY)%m.SECONDS_PER_DAY,f=s+c*l,p=Math.cos(f),v=Math.sin(f);return i(t)?(t[0]=p,t[1]=-v,t[2]=0,t[3]=v,t[4]=p,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(p,v,0,-v,p,0,0,0,1)},v.iau2006XysData=new l,v.earthOrientationParameters=u.NONE;var C=32.184,R=2451545;v.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+C,a=t.stop.dayNumber,i=t.stop.secondsOfDay+C,o=v.iau2006XysData.preload(r,n,a,i),u=v.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},v.computeIcrfToFixedMatrix=function(e,t){i(t)||(t=new y);var r=v.computeFixedToIcrfMatrix(e,t);return i(r)?y.transpose(r,t):void 0};var z=new f(0,0,0),D=new s(0,0,0,0,0,0),L=new y,U=new y;v.computeFixedToIcrfMatrix=function(e,t){i(t)||(t=new y);var r=v.earthOrientationParameters.compute(e,D);if(!i(r))return void 0;var n=e.dayNumber,a=e.secondsOfDay+C,o=v.iau2006XysData.computeXysRadians(n,a,z);if(!i(o))return void 0;var u=o.x+r.xPoleOffset,s=o.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=L;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(-o.s,U),p=y.multiply(l,f,L),g=e.dayNumber,w=e.secondsOfDay-h.computeTaiMinusUtc(e)+r.ut1MinusUtc,x=g-2451545,E=w/m.SECONDS_PER_DAY,S=.779057273264+E+.00273781191135448*(x+E);S=S%1*d.TWO_PI;var O=y.fromRotationZ(S,U),T=y.multiply(p,O,L),M=Math.cos(r.xPoleWander),_=Math.cos(r.yPoleWander),P=Math.sin(r.xPoleWander),b=Math.sin(r.yPoleWander),N=n-R+a/m.SECONDS_PER_DAY;N/=36525;var A=-47e-6*N*d.RADIANS_PER_DEGREE/3600,I=Math.cos(A),q=Math.sin(A),B=U;return B[0]=M*I,B[1]=M*q,B[2]=P,B[3]=-_*q+b*P*I,B[4]=_*I+b*P*q,B[5]=-b*M,B[6]=-b*q-_*P*I,B[7]=b*I-_*P*q,B[8]=_*M,y.multiply(T,B,t)};var q=new n;return 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,o){i(o)||(o=new t);var u=q;return p.multiplyByVector(e,n.fromElements(a.x,a.y,a.z,1,u),u),n.multiplyByScalar(u,1/u.w,u),p.multiplyByVector(r,u,u),t.fromCartesian4(u,o)},v}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,r,n,a,i,o,u,s,c,l,f,h,d){"use strict";var y=new n,p=function(e,t){t=a(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 i=r.fromCartesian4(l.getColumn(n,2,y));this._plane=f.fromPointNormal(e,i)};o(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}}});var m=new e;p.fromPoints=function(t,r){var n=e.fromPoints(t,m);return new p(n.center,r)};var v=new h,g=new r;p.prototype.projectPointOntoPlane=function(e,n){var a=v;a.origin=e,r.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,g);if(i(o)||(r.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,g)),i(o)){var u=r.subtract(o,this._origin,o),s=r.dot(this._xAxis,u),l=r.dot(this._yAxis,u);return i(n)?(n.x=s,n.y=l,n):new t(s,l)}return void 0},p.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var r=0,n=e.length,a=0;n>a;a++){var o=this.projectPointOntoPlane(e[a],t[r]);i(o)&&(t[r]=o,r++)}return t.length=r,t};var w=new r;return p.prototype.projectPointsOntoEllipsoid=function(e,t){var n=e.length;i(t)?t.length=n:t=new Array(n);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=w,l=0;n>l;++l){var f=e[l];r.multiplyByScalar(u,f.x,c),i(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),a.scaleToGeocentricSurface(h,h)}return t},p}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";var r=new t,n=function(t,n,a,i){return e(t,n,a,i,r),r.x>0&&r.y>0&&r.z>0};return n}),define("Core/Queue",[],function(){"use strict";var e=function(){this._array=[],this._offset=0,this.length=0};return e.prototype.enqueue=function(e){this._array.push(e),this.length++},e.prototype.dequeue=function(){if(0===this.length)return void 0;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},e.prototype.contains=function(e){return-1!==this._array.indexOf(e)},e.prototype.clear=function(){this._array.length=this._offset=this.length=0},e.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},e}),define("Core/WindingOrder",["./freezeObject"],function(e){"use strict";var t={CLOCKWISE:2304,COUNTER_CLOCKWISE:2305,validate:function(e){return e===t.CLOCKWISE||e===t.COUNTER_CLOCKWISE}};return e(t)}),define("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,n,a,i,o,u,s,c,l,f,h,d,y){"use strict";function p(t,r,n){var a=e.subtract(r,t,q),i=e.subtract(n,r,B);return a.x*i.y-a.y*i.x>=0}function m(e){for(var t=e[0].x,r=0,n=0;n<e.length;n++)e[n].x>t&&(t=e[n].x,r=n);return r}function v(e){for(var t=e[0][0].x,r=0,n=0;n<e.length;n++){var a=e[n][m(e[n])].x;a>t&&(t=a,r=n)}return r}function g(e){for(var t=[],r=0;r<e.length;r++){var n=e[(r-1+e.length)%e.length],a=e[r],i=e[(r+1)%e.length];p(n,a,i)||t.push(a)}return t}function w(t,r){for(var n=0;n<t.length;n++)if(e.equals(r,t[n]))return n;return-1}function x(r,a,i){i=n(i,[]);var o=Number.MAX_VALUE,u=m(a),s=new e(a[u].x,r.y);i.push(u),i.push((u+1)%a.length);for(var c=a[0].x,l=c,f=1;f<a.length;++f)a[f].x<c?c=a[f].x:a[f].x>l&&(l=a[f].x);l+=l-c;var h=new t(l,r.y,0);for(f=0;f<a.length;f++){var d=a[f],y=a[(f+1)%a.length];if((d.x>=r.x||y.x>=r.x)&&(d.y>=r.y&&y.y<=r.y||d.y<=r.y&&y.y>=r.y)){var p=(y.y-d.y)*(h.x-r.x)-(y.x-d.x)*(h.y-r.y);if(0!==p){p=1/p;var v=((y.x-d.x)*(r.y-d.y)-(y.y-d.y)*(r.x-d.x))*p,g=((h.x-r.x)*(r.y-d.y)-(h.y-r.y)*(r.x-d.x))*p;if(v>=0&&1>=v&&g>=0&&1>=g){var w=new e(r.x+v*(h.x-r.x),r.y+v*(h.y-r.y)),x=e.subtract(w,r,F);p=e.magnitudeSquared(x),o>p&&(s=w,o=p,i[0]=f,i[1]=(f+1)%a.length)}}}}return s}function E(t,r){var n=v(r),a=r[n],i=m(a),o=a[i],u=[],s=x(o,t,u),c=w(t,s);if(-1!==c)return c;var h=e.magnitudeSquared(e.subtract(t[u[0]],o,W)),d=e.magnitudeSquared(e.subtract(t[u[1]],o,W)),y=d>h?t[u[0]]:t[u[1]],p=g(t),E=p.indexOf(y);-1!==E&&p.splice(E,1);for(var S=[],O=0;O<p.length;O++){var T=p[O];f(T,o,s,y)&&S.push(T)}var M=Number.MAX_VALUE;if(S.length>0){var _=e.fromElements(1,0,W);for(O=0;O<S.length;O++){var P=e.subtract(S[O],o,G),b=e.magnitude(_)*e.magnitudeSquared(P);if(0!==b){var N=Math.abs(l.acosClamped(e.dot(_,P)/b));M>N&&(M=N,y=S[O])}}}return t.indexOf(y)}function S(e,r,n){for(var a=ut.computeWindingOrder2D(e),i=0;i<r.length;i++){var o=r[i];t.equals(o[0],o[o.length-1])||o.push(o[0]);var s=ut.computeWindingOrder2D(o);s===a&&o.reverse()}var c=u.fromPoints(e,n),l=c.projectPointsOntoPlane(e),f=[];for(i=0;i<r.length;i++)f.push(c.projectPointsOntoPlane(r[i]));var h=E(l,f),d=v(f),y=m(f[d]),p=r[d],g=[];for(i=0;i<e.length;i++)g.push(e[i]);var w,x=[];if(0!==y)for(w=0;w<=p.length;w++){var S=(w+y)%p.length;0!==S&&x.push(p[S])}else for(w=0;w<p.length;w++)x.push(p[(w+y)%p.length]);var O=g.lastIndexOf(e[h]);x.push(e[O]);var T=g.slice(0,O+1),M=g.slice(O+1);return g=T.concat(x,M),r.splice(d,1),g}function O(e){var t="0."+Math.sin(V).toString().substr(5);V+=.2;var r=Math.floor(t*e);return r===e&&r--,r}function T(t,r,n){return M(t,r,n)&&M(r,t,n)&&!z(n[t].position,n[r].position,n)&&!e.equals(n[t].position,n[r].position)}function M(t,r,n){b(t,n);var a=n[t],i=n[r],o=P(t,n,Y),u=P(t,n,j),s=e.subtract(n[o].position,a.position,k),c=e.subtract(n[u].position,a.position,H),l=e.subtract(i.position,a.position,Z);return N(s,l)?_(s,l):N(c,l)?_(c,l):A(s,c)?R(s,c,l)?!0:!1:I(s,c)?C(s,c,l)?!1:!0:void 0}function _(t,r){return e.magnitude(r)<e.magnitude(t)}function P(e,t,r){var n=e+r;return 0>n&&(n=t.length-1),n===t.length&&(n=0),b(n,t),n}function b(t,r){var n=t-1,a=t+1;0>n&&(n=r.length-1),a===r.length&&(a=0);var o=e.subtract(r[n].position,r[t].position,X),u=e.subtract(r[a].position,r[t].position,J);if(N(o,u)){var s=new i("Superfluous vertex found.");throw s.vertexIndex=t,s}}function N(e,r){return 0===t.cross(e,r,K).z}function A(e,r){return t.cross(e,r,Q).z<0}function I(e,r){return t.cross(e,r,$).z>0}function C(e,r,n){return t.cross(e,n,et).z>0&&t.cross(n,r,et).z>0}function R(e,r,n){return t.cross(e,n,tt).z<0&&t.cross(n,r,tt).z<0}function z(t,r,n){for(var a=0;a<n.length;a++){var i,o=n[a].position;if(i=a<n.length-1?n[a+1].position:n[0].position,!(e.equals(t,o)||e.equals(r,i)||e.equals(t,i)||e.equals(r,o))){var u=(r.y-t.y)/(r.x-t.x),s=(i.y-o.y)/(i.x-o.x);if(!(u===s||isNaN(u)&&isNaN(s))){var c;c=isNaN(u)?t.x:isNaN(s)?o.x:(t.y-o.y-u*t.x+s*o.x)/(s-u);var l=u*c+t.y-u*t.x,f=e.fromElements(c,l,rt);if(!(e.equals(f,t)||e.equals(f,r)||e.equals(f,o)||e.equals(f,i))){var h=L(c,t.x,r.x)&&L(l,t.y,r.y)&&L(c,o.x,i.x)&&L(l,o.y,i.y);if(h)return!0}}}}return!1}function D(t){var r=t[0].position,n=t[1].position,a=t[2].position,i=e.subtract(n,r,nt),o=e.subtract(a,r,at);return N(i,o)}function L(e,t,r){return(e>t||e>r)&&(t>e||r>e)||t===r&&t===e}function U(e){var t=e.length;if(3===t)return D(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new i("Invalid polygon: must have at least three vertices.");for(var r=!1,n=0;!r;){var a=10*e.length;if(n>a)return[];n++;for(var o=O(e.length),u=o+1;Math.abs(o-u)<2||Math.abs(o-u)>e.length-2;)u=O(e.length);if(o>u){var s=o;o=u,u=s}try{if(T(o,u,e)){var c=e.splice(o,u-o+1,e[o],e[u]);return U(e).concat(U(c))}}catch(l){if(l.hasOwnProperty("vertexIndex"))return e.splice(l.vertexIndex,1),U(e);throw l}}}var q=new e,B=new e,F=new e,W=new e(1,0),G=new e,V=0,Y=-1,j=1,k=new t,H=new t,Z=new t,X=new t,J=new t,K=new t,Q=new t,$=new t,et=new t,tt=new t,rt=new e,nt=new t,at=new t,it=new t,ot=new t,ut={};return ut.removeDuplicates=function(e){for(var r=e.length,n=[],a=r-1,i=0;r>i;a=i++){var o=e[a],u=e[i];t.equals(o,u)||n.push(u)}return n},ut.computeArea2D=function(e){for(var t=e.length,r=0,n=t-1,a=0;t>a;n=a++){var i=e[n],o=e[a];r+=i.x*o.y-o.x*i.y}return.5*r},ut.computeWindingOrder2D=function(e){var t=ut.computeArea2D(e);return t>0?y.COUNTER_CLOCKWISE:y.CLOCKWISE},ut.triangulate=function(e){for(var t=e.length,r=[],n=0;t>n;++n)r[n]={position:e[n],index:n};return U(r)},ut.resetSeed=function(e){V=n(e,0)},ut.computeSubdivision=function(e,a,i){i=n(i,l.RADIANS_PER_DEGREE);for(var o=new d,u=a.length,f=0;u>f;f+=3)o.enqueue({i0:a[f],i1:a[f+1],i2:a[f+2]});for(var y,p=e.slice(0),m=[],v={};o.length>0;){var g,w,x=o.dequeue(),E=p[x.i0],S=p[x.i1],O=p[x.i2],T=t.angleBetween(E,S),M=t.angleBetween(S,O),_=t.angleBetween(O,E),P=Math.max(T,Math.max(M,_));P>i?T===P?(g=Math.min(x.i0,x.i1).toString()+" "+Math.max(x.i0,x.i1).toString(),y=v[g],y||(w=t.add(E,S,new t),t.multiplyByScalar(w,.5,w),p.push(w),y=p.length-1,v[g]=y),o.enqueue({i0:x.i0,i1:y,i2:x.i2}),o.enqueue({i0:y,i1:x.i1,i2:x.i2})):M===P?(g=Math.min(x.i1,x.i2).toString()+" "+Math.max(x.i1,x.i2).toString(),y=v[g],y||(w=t.add(S,O,new t),t.multiplyByScalar(w,.5,w),p.push(w),y=p.length-1,v[g]=y),o.enqueue({i0:x.i1,i1:y,i2:x.i0}),o.enqueue({i0:y,i1:x.i2,i2:x.i0})):_===P&&(g=Math.min(x.i2,x.i0).toString()+" "+Math.max(x.i2,x.i0).toString(),y=v[g],y||(w=t.add(O,E,new t),t.multiplyByScalar(w,.5,w),p.push(w),y=p.length-1,v[g]=y),o.enqueue({i0:x.i2,i1:y,i2:x.i1}),o.enqueue({i0:y,i1:x.i0,i2:x.i1})):(m.push(x.i0),m.push(x.i1),m.push(x.i2))}var b=p.length,N=new Array(3*b),A=0;for(y=0;b>y;y++){var I=p[y];N[A++]=I.x,N[A++]=I.y,N[A++]=I.z}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:N})},indices:m,primitiveType:h.TRIANGLES})},ut.scaleToGeodeticHeight=function(e,r,i,u){i=n(i,o.WGS84);var s=it,c=ot;if(r=n(r,0),u=n(u,!0),a(e)&&a(e.attributes)&&a(e.attributes.position))for(var l=e.attributes.position.values,f=l.length,h=0;f>h;h+=3)t.fromArray(l,h,c),u&&(c=i.scaleToGeodeticSurface(c,c)),s=i.geodeticSurfaceNormal(c,s),t.multiplyByScalar(s,r,s),t.add(c,s,c),l[h]=c.x,l[h+1]=c.y,l[h+2]=c.z;return e},ut.eliminateHoles=function(e,r,a){a=n(a,o.WGS84);for(var i=[],u=0;u<r.length;u++){for(var s=[],c=0;c<r[u].length;c++)s.push(t.clone(r[u][c]));i.push(s)}for(var l=e;i.length>0;)l=S(l,i,a);return l},ut}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){var t=e._uSquared,r=e._ellipsoid.maximumRadius,n=e._ellipsoid.minimumRadius,a=(r-n)/r,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,y=Math.sqrt(d),p=t/4,m=p*p,v=m*p,g=m*m,w=1+p-3*m/4+5*v/4-175*g/64,x=1-p+15*m/8-35*v/8,E=1-3*p+35*m/4,S=1-5*p,O=w*l-x*Math.sin(2*l)*p/2-E*Math.sin(4*l)*m/16-S*Math.sin(6*l)*v/48-5*Math.sin(8*l)*g/512,T=e._constants;T.a=r,T.b=n,T.f=a,T.cosineHeading=i,T.sineHeading=o,T.tanU=u,T.cosineU=s,T.sineU=c,T.sigma=l,T.sineAlpha=f,T.sineSquaredAlpha=h,T.cosineSquaredAlpha=d,T.cosineAlpha=y,T.u2Over4=p,T.u4Over16=m,T.u6Over64=v,T.u8Over256=g,T.a0=w,T.a1=x,T.a2=E,T.a3=S,T.distanceRatio=O}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,r,n,a,i,o){var u=c(e,r);return(1-u)*e*t*(n+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,r,n,a,i,o){var s,c,f,h,d,y=(t-r)/t,p=i-n,m=Math.atan((1-y)*Math.tan(a)),v=Math.atan((1-y)*Math.tan(o)),g=Math.cos(m),w=Math.sin(m),x=Math.cos(v),E=Math.sin(v),S=g*x,O=g*E,T=w*E,M=w*x,_=p,P=u.TWO_PI,b=Math.cos(_),N=Math.sin(_);do{b=Math.cos(_),N=Math.sin(_);var A=O-M*b;f=Math.sqrt(x*x*N*N+A*A),c=T+S*b,s=Math.atan2(f,c);var I;0===f?(I=0,h=1):(I=S*N/f,h=1-I*I),P=_,d=c-2*T/h,isNaN(d)&&(d=0),_=p+l(y,I,h,s,f,c,d)}while(Math.abs(_-P)>u.EPSILON12);var C=h*(t*t-r*r)/(r*r),R=1+C*(4096+C*(C*(320-175*C)-768))/16384,z=C*(256+C*(C*(74-47*C)-128))/1024,D=d*d,L=z*f*(d+z*(c*(2*D-1)-z*d*(4*f*f-3)*(4*D-3)/6)/4),U=r*R*(s-L),q=Math.atan2(x*N,O-M*b),B=Math.atan2(g*N,O*b-M);e._distance=U,e._startHeading=q,e._endHeading=B,e._uSquared=C}function h(r,n,a,i){e.normalize(i.cartographicToCartesian(n,y),d),e.normalize(i.cartographicToCartesian(a,y),y),f(r,i.maximumRadius,i.minimumRadius,n.longitude,n.latitude,a.longitude,a.latitude),n.height=0,a.height=0,r._start=t.clone(n,r._start),r._end=t.clone(a,r._end),s(r)}var d=new e,y=new e,p=function(e,a,i){var u=r(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,n(e)&&n(a)&&h(this,e,a,u)};return a(p.prototype,{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){h(this,e,t,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.prototype.interpolateUsingSurfaceDistance=function(e,r){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),y=i*i,p=i*y,m=a.u8Over256,v=a.u2Over4,g=a.u6Over64,w=a.u4Over16,x=2*p*m*o/3+i*(1-v+7*w/4-15*g/4+579*m/64-(w-15*g/4+187*m/16)*o-(5*g/4-115*m/16)*u-29*m*s/16)+(v/2-w+71*g/32-85*m/16)*c+(5*w/16-5*g/4+383*m/96)*f-y*((g-11*m/2)*c+5*m*f/2)+(29*g/96-29*m/16)*h+539*m*d/1536,E=Math.asin(Math.sin(x)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(E));x-=a.sigma;var O=Math.cos(2*a.sigma+x),T=Math.sin(x),M=Math.cos(x),_=a.cosineU*M,P=a.sineU*T,b=Math.atan2(T*a.sineHeading,_-P*a.cosineHeading),N=b-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,x,T,M,O);return n(r)?(r.longitude=this._start.longitude+N,r.latitude=S,r.height=0,r):new t(this._start.longitude+N,S,0)},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/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function h(e,t,r){var n,a=new Array(e);if(t===r){for(n=0;e>n;n++)a[n]=t;return a}var i=r-t,o=i/e;for(n=1;e>n;n++){var u=t+n*o;a[n]=u}return a[0]=t,a}function d(t,r,n,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,P),l=a.scaleToGeodeticSurface(r,b),f=y.numberOfPoints(t,r,n),d=a.cartesianToCartographic(c,T),p=a.cartesianToCartographic(l,M),m=h(f,i,o);N.setEndPoints(d,p);var v=N.surfaceDistance/f,g=s;d.height=i;var w=a.cartographicToCartesian(d,_);e.pack(w,u,g),g+=3;for(var x=1;f>x;x++){var E=N.interpolateUsingSurfaceDistance(x*v,M);E.height=m[x],w=a.cartographicToCartesian(E,_),e.pack(w,u,g),g+=3}return g}var y={};y.numberOfPoints=function(t,r,n){var a=e.angleBetween(t,r);return Math.ceil(a/n)};var p=new t;y.extractHeights=function(e,t){for(var r=e.length,n=new Array(r),a=0;r>a;a++){var i=e[a];n[a]=t.cartesianToCartographic(i,p).height}return n};var m=new l,v=new e,g=new e,w=new f(e.ZERO,0),x=new e,E=new f(e.ZERO,0),S=new e,O=new e,T=new t,M=new t,_=new e,P=new e,b=new e,N=new o;return y.wrapLongitude=function(t,a){var i=[],o=[];if(n(t)&&t.length>0){a=r(a,l.IDENTITY);var s=l.inverseTransformation(a,m),c=l.multiplyByPoint(s,e.ZERO,v),h=l.multiplyByPointAsVector(s,e.UNIT_Y,g),d=f.fromPointNormal(c,h,w),y=l.multiplyByPointAsVector(s,e.UNIT_X,x),p=f.fromPointNormal(c,y,E),T=1;i.push(e.clone(t[0]));for(var M=i[0],_=t.length,P=1;_>P;++P){var b=t[P];if(f.getPointDistance(p,M)<0||f.getPointDistance(p,b)<0){var N=u.lineSegmentPlane(M,b,d,S);if(n(N)){var A=e.multiplyByScalar(h,5e-9,O);f.getPointDistance(d,M)<0&&e.negate(A,A),i.push(e.add(N,A,new e)),o.push(T+1),e.negate(A,A),i.push(e.add(N,A,new e)),T=1}}i.push(e.clone(t[P])),T++,M=b}o.push(T)}return{positions:i,lengths:o}},y.removeDuplicates=function(t){var r=t.length;if(2>r)return void 0;var n,a,i;for(n=1;r>n&&(a=t[n-1],i=t[n],!e.equals(a,i));++n);if(n===r)return void 0;var o=[];for(o.push(t[0]);r>n;++n)a=t[n-1],i=t[n],e.equals(a,i)||o.push(e.clone(i));return o},y.generateArc=function(t){n(t)||(t={});var a,o,u,l=t.positions,f=r(t.ellipsoid,i.WGS84),h=r(t.height,0),p=r(t.granularity,c.RADIANS_PER_DEGREE),m=l.length,v=0;for(a=0;m-1>a;a++)o=l[a],u=l[a+1],v+=y.numberOfPoints(o,u,p);v++;var g=3*v,w=new Array(g),x=0;for(a=0;m-1>a;a++){o=l[a],u=l[a+1];var E,S;s(h)?(E=h[a],S=h[a+1]):(E=h,S=h),x=d(o,u,p,f,E,S,w,x)}var O=l[m-1],M=f.cartesianToCartographic(O,T);M.height=s(h)?h[m-1]:h;var P=f.cartographicToCartesian(M,_);return e.pack(P,w,g-3),w},y.generateCartesianArc=function(t){for(var r=y.generateArc(t),n=r.length/3,a=new Array(n),i=0;n>i;i++)a[i]=e.unpack(r,3*i);return a},y}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,n,a,i,o,u){"use strict";var s=function(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)},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,h=Math.cos(i);return r(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 n,a,i,o,c,h=e[u.COLUMN0ROW0],d=e[u.COLUMN1ROW1],y=e[u.COLUMN2ROW2],p=h+d+y;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 m=l,v=0;d>h&&(v=1),y>h&&y>d&&(v=2);var g=m[v],w=m[g];n=Math.sqrt(e[u.getElementIndex(v,v)]-e[u.getElementIndex(g,g)]-e[u.getElementIndex(w,w)]+1);var x=f;x[v]=.5*n,n=.5/n,c=(e[u.getElementIndex(w,g)]-e[u.getElementIndex(g,w)])*n,x[g]=(e[u.getElementIndex(g,v)]+e[u.getElementIndex(v,g)])*n,x[w]=(e[u.getElementIndex(w,v)]+e[u.getElementIndex(v,w)])*n,a=-x[0],i=-x[1],o=-x[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=c,t):new s(a,i,o,c)};var h=new e,d=new e,y=new s,p=new s,m=new s;s.packedLength=4,s.pack=function(e,r,n){n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w},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;i>a;a++){var o=3*a;s.unpack(e,4*(t+a),y),s.multiply(y,m,y),y.w<0&&s.negate(y,y),s.computeAxis(y,h);var u=s.computeAngle(y);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,p),0===u?s.clone(s.IDENTITY,y):s.fromAxisAngle(d,u,y),s.multiply(y,p,o)},s.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w):void 0},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,h=o*s-n*c+a*l+i*u,d=o*c+n*s-a*u+i*l,y=o*l-n*u-a*s-i*c;return r.x=f,r.y=h,r.z=d,r.w=y,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 v=new s;s.lerp=function(e,t,r,n){return v=s.multiplyByScalar(t,r,v),n=s.multiplyByScalar(e,1-r,n),s.add(v,n,n)};var g=new s,w=new s,x=new s;s.slerp=function(e,t,r,n){var a=s.dot(e,t),i=t;if(0>a&&(a=-a,i=g=s.negate(t,g)),1-a<o.EPSILON6)return s.lerp(e,i,r,n);var u=Math.acos(a);return w=s.multiplyByScalar(e,Math.sin((1-r)*u),w),x=s.multiplyByScalar(i,Math.sin(r*u),x),n=s.add(w,x,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 E=new e,S=new e,O=new s,T=new s;s.computeInnerQuadrangle=function(t,r,n,a){var i=s.conjugate(r,O);s.multiply(i,n,T);var o=s.log(T,E);s.multiply(i,t,T);var u=s.log(T,S);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,O),s.multiply(r,O,a)},s.squad=function(e,t,r,n,a,i){var o=s.slerp(e,t,a,O),u=s.slerp(r,n,a,T);return s.slerp(o,u,2*a*(1-a),i)};for(var M=new s,_=1.9011074535173003,P=a.supportsTypedArrays()?new Float32Array(8):[],b=a.supportsTypedArrays()?new Float32Array(8):[],N=a.supportsTypedArrays()?new Float32Array(8):[],A=a.supportsTypedArrays()?new Float32Array(8):[],I=0;7>I;++I){var C=I+1,R=2*C+1;P[I]=1/(C*R),b[I]=C/R}return P[7]=_/136,b[7]=8*_/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)N[f]=(P[f]*c-b[f])*o,A[f]=(P[f]*l-b[f])*o;var h=a*r*(1+N[0]*(1+N[1]*(1+N[2]*(1+N[3]*(1+N[4]*(1+N[5]*(1+N[6]*(1+N[7])))))))),d=u*(1+A[0]*(1+A[1]*(1+A[2]*(1+A[3]*(1+A[4]*(1+A[5]*(1+A[6]*(1+A[7])))))))),y=s.multiplyByScalar(e,d,M);return s.multiplyByScalar(t,h,n),s.add(y,n,n)},s.fastSquad=function(e,t,r,n,a,i){var o=s.fastSlerp(e,t,a,O),u=s.fastSlerp(r,n,a,T);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/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function h(e,t){for(var r=new Array(e.length),n=0;n<e.length;n++){var a=e[n];z=t.cartesianToCartographic(a,z),r[n]=z.height,e[n]=t.scaleToGeodeticSurface(a,a)}return r}function d(e,r,n,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(r===n){for(i=0;c>i;i++)l[i]=r;return l.push(n),l}var f=n-r,h=f/c;for(i=1;c>i;i++){var d=r+i*h;l[i]=d}return l[0]=r,l.push(n),l}function y(r,n,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,r,H),H),c=u.projectPointOntoPlane(t.add(a,n,Z),Z),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function p(e,r,n,a,i,o,c,l){var h=F,d=W;L=f.eastNorthUpToFixedFrame(e,i,L),h=s.multiplyByPointAsVector(L,D,h),h=t.normalize(h,h);var p=y(h,r,e,i);q=u.fromRotationZ(p,q),G.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(q,G,U),L);var m=B;m[0]=c;for(var v=0;l>v;v++)for(var g=0;g<n.length;g+=3)d=t.fromArray(n,g,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,r,n,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,V);a=p(c,r,n,a,i,o[s/3],u,1)}return a}function v(e,t){var r=e.length,n=new Array(6*r),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];n[a++]=u.x-i,n[a++]=0,n[a++]=u.y-o;for(var s=1;r>s;s++){u=e[s];var c=u.x-i,l=u.y-o;n[a++]=c,n[a++]=0,n[a++]=l,n[a++]=c,n[a++]=0,n[a++]=l}return u=e[0],n[a++]=u.x-i,n[a++]=0,n[a++]=u.y-o,n}function g(e,t){for(var r=e.length,n=new Array(3*r),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;r>u;u++)n[a++]=e[u].x-i,n[a++]=0,n[a++]=e[u].y-o;return n}function w(e,r,n,i,s,c,f,h,d,y){var m,v=t.angleBetween(t.subtract(r,e,I),t.subtract(n,e,C)),g=i===a.BEVELED?0:Math.ceil(v/o.toRadians(5));m=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,I),v/(g+1),Y),k):u.fromQuaternion(l.fromAxisAngle(e,v/(g+1),Y),k);var w,x;if(r=t.clone(r,j),g>0)for(var E=y?2:1,S=0;g>S;S++)r=u.multiplyByVector(m,r,r),w=t.subtract(r,e,I),w=t.normalize(w,w),s||(w=t.negate(w,w)),x=c.scaleToGeodeticSurface(r,C),f=p(x,w,h,f,c,d,1,E);else w=t.subtract(r,e,I),w=t.normalize(w,w),s||(w=t.negate(w,w)),x=c.scaleToGeodeticSurface(r,C),f=p(x,w,h,f,c,d,1,1),n=t.clone(n,j),w=t.subtract(n,e,I),w=t.normalize(w,w),s||(w=t.negate(w,w)),x=c.scaleToGeodeticSurface(n,C),f=p(x,w,h,f,c,d,1,1);return f}function x(e,t){return o.equalsEpsilon(e.latitude,t.latitude,o.EPSILON6)&&o.equalsEpsilon(e.longitude,t.longitude,o.EPSILON6)}var E=[new t,new t],S=new t,O=new t,T=new t,M=new t,_=new t,P=new t,b=new t,N=new t,A=new t,I=new t,C=new t,R={},z=new n,D=new t(-1,0,0),L=new s,U=new s,q=new u,B=u.IDENTITY.clone(),F=new t,W=new r,G=new t,V=new t,Y=new l,j=new t,k=new u;R.removeDuplicatesFromShape=function(t){for(var r=t.length,n=[],a=r-1,i=0;r>i;a=i++){var o=t[a],u=t[i];e.equals(o,u)||n.push(u)}return n};var H=new t,Z=new t;R.angleIsGreaterThanPi=function(e,r,n,a){var o=new i(n,a),u=o.projectPointOntoPlane(t.add(n,e,H),H),s=o.projectPointOntoPlane(t.add(n,r,Z),Z);return s.x*u.y-s.y*u.x>=0};var X=new n,J=new n;return R.removeDuplicatesFromPositions=function(e,t){var r=e.length;if(2>r)return e.slice(0);var n=[];n.push(e[0]);for(var a=1;r>a;++a){var i=e[a-1],o=e[a],u=t.cartesianToCartographic(i,X),s=t.cartesianToCartographic(o,J);x(u,s)||n.push(o)}return n},R.computePositions=function(e,r,n,i,u){var s=i._ellipsoid,l=h(e,s),f=i._granularity,y=i._cornerType,x=u?v(r,n):g(r,n),C=u?g(r,n):void 0,z=n.height/2,D=n.width/2,L=e.length,U=[],q=u?[]:void 0,B=S,F=O,W=T,G=M,V=_,Y=P,j=b,k=N,H=A,Z=e[0],X=e[1];G=s.geodeticSurfaceNormal(Z,G),B=t.subtract(X,Z,B),B=t.normalize(B,B),k=t.cross(G,B,k),k=t.normalize(k,k);var J=l[0],K=l[1];u&&(q=p(Z,k,C,q,s,J+z,1,1)),H=t.clone(Z,H),Z=X,F=t.negate(B,F);for(var Q,$,et=1;L-1>et;et++){var tt=u?2:1;X=e[et+1],B=t.subtract(X,Z,B),B=t.normalize(B,B),W=t.add(B,F,W),W=t.normalize(W,W),G=s.geodeticSurfaceNormal(Z,G); -var rt=!t.equalsEpsilon(t.negate(W,I),G,o.EPSILON2);if(rt){W=t.cross(W,G,W),W=t.cross(G,W,W),W=t.normalize(W,W);var nt=1/Math.max(.25,t.magnitude(t.cross(W,F,I))),at=R.angleIsGreaterThanPi(B,F,Z,s);at?(V=t.add(Z,t.multiplyByScalar(W,nt*D,W),V),Y=t.add(V,t.multiplyByScalar(k,D,Y),Y),E[0]=t.clone(H,E[0]),E[1]=t.clone(Y,E[1]),Q=d(E,J+z,K+z,f),$=c.generateArc({positions:E,granularity:f,ellipsoid:s}),U=m($,k,x,U,s,Q,1),k=t.cross(G,B,k),k=t.normalize(k,k),j=t.add(V,t.multiplyByScalar(k,D,j),j),y===a.ROUNDED||y===a.BEVELED?w(V,Y,j,y,at,s,U,x,K+z,u):(W=t.negate(W,W),U=p(Z,W,x,U,s,K+z,nt,tt)),H=t.clone(j,H)):(V=t.add(Z,t.multiplyByScalar(W,nt*D,W),V),Y=t.add(V,t.multiplyByScalar(k,-D,Y),Y),E[0]=t.clone(H,E[0]),E[1]=t.clone(Y,E[1]),Q=d(E,J+z,K+z,f),$=c.generateArc({positions:E,granularity:f,ellipsoid:s}),U=m($,k,x,U,s,Q,1),k=t.cross(G,B,k),k=t.normalize(k,k),j=t.add(V,t.multiplyByScalar(k,-D,j),j),y===a.ROUNDED||y===a.BEVELED?w(V,Y,j,y,at,s,U,x,K+z,u):U=p(Z,W,x,U,s,K+z,nt,tt),H=t.clone(j,H)),F=t.negate(B,F)}else U=p(H,k,x,U,s,J+z,1,1),H=Z;J=K,K=l[et+1],Z=X}E[0]=t.clone(H,E[0]),E[1]=t.clone(Z,E[1]),Q=d(E,J+z,K+z,f),$=c.generateArc({positions:E,granularity:f,ellipsoid:s}),U=m($,k,x,U,s,Q,1),u&&(q=p(Z,k,C,q,s,K+z,1,1)),L=U.length;var it=u?L+q.length:L,ot=new Float64Array(it);return ot.set(U),u&&ot.set(q,L),ot},R}),define("Core/VertexFormat",["./defaultValue","./freezeObject"],function(e,t){"use strict";var r=function(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 r.POSITION_ONLY=t(new r({position:!0})),r.POSITION_AND_NORMAL=t(new r({position:!0,normal:!0})),r.POSITION_NORMAL_AND_ST=t(new r({position:!0,normal:!0,st:!0})),r.POSITION_AND_ST=t(new r({position:!0,st:!0})),r.POSITION_AND_COLOR=t(new r({position:!0,color:!0})),r.ALL=t(new r({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),r.DEFAULT=r.POSITION_NORMAL_AND_ST,r}),define("Core/PolylineVolumeGeometry",["./BoundingRectangle","./BoundingSphere","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./VertexFormat","./WindingOrder"],function(e,t,r,n,a,i,o,u,s,c,l,f,h,d,y,p,m,v,g){"use strict";function w(e,n,a,i){var o=new l;i.position&&(o.position=new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:e}));var u,d,p,v,g,w,x=n.length,E=e.length/3,S=(E-2*x)/(2*x),O=y.triangulate(n),T=6*(S-1)*x+2*O.length,M=h.createTypedArray(E,T),_=2*x,P=0;for(u=0;S-1>u;u++){for(d=0;x-1>d;d++)p=2*d+2*u*x,w=p+_,v=p+1,g=v+_,M[P++]=v,M[P++]=p,M[P++]=g,M[P++]=g,M[P++]=p,M[P++]=w;p=2*x-2+2*u*x,v=p+1,g=v+_,w=p+_,M[P++]=v,M[P++]=p,M[P++]=g,M[P++]=g,M[P++]=p,M[P++]=w}if(i.st||i.tangent||i.binormal){var b,N,A=new Float32Array(2*E),I=1/(S-1),C=1/a.height,R=a.height/2,z=0;for(u=0;S>u;u++){for(b=u*I,N=C*(n[0].y+R),A[z++]=b,A[z++]=N,d=1;x>d;d++)N=C*(n[d].y+R),A[z++]=b,A[z++]=N,A[z++]=b,A[z++]=N;N=C*(n[0].y+R),A[z++]=b,A[z++]=N}for(d=0;x>d;d++)b=0,N=C*(n[d].y+R),A[z++]=b,A[z++]=N;for(d=0;x>d;d++)b=(S-1)*I,N=C*(n[d].y+R),A[z++]=b,A[z++]=N;o.st=new c({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:new Float32Array(A)})}var D=E-2*x;for(u=0;u<O.length;u+=3){var L=O[u]+D,U=O[u+1]+D,q=O[u+2]+D;M[P++]=L,M[P++]=U,M[P++]=q,M[P++]=q+x,M[P++]=U+x,M[P++]=L+x}var B=new s({attributes:o,indices:M,boundingSphere:t.fromVertices(e),primitiveType:m.TRIANGLES});return i.normal&&(B=f.computeNormal(B)),(i.tangent||i.binormal)&&(B=f.computeBinormalAndTangent(B),i.tangent||(B.attributes.tangent=void 0),i.binormal||(B.attributes.binormal=void 0),i.st||(B.attributes.st=void 0)),B}var x=function(e){e=a(e,a.EMPTY_OBJECT);var t=e.polylinePositions,r=e.shapePositions;this._positions=t,this._shape=r,this._ellipsoid=a(e.ellipsoid,u.WGS84),this._height=a(e.height,0),this._cornerType=a(e.cornerType,n.ROUNDED),this._vertexFormat=a(e.vertexFormat,v.DEFAULT),this._granularity=a(e.granularity,d.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry"},E=new e;return x.createGeometry=function(t){var r=t._positions,n=p.removeDuplicatesFromPositions(r,t._ellipsoid),a=t._shape;a=p.removeDuplicatesFromShape(a),y.computeWindingOrder2D(a)===g.CLOCKWISE&&a.reverse();var i=e.fromPoints(a,E),o=p.computePositions(n,a,i,t,!0);return w(o,a,i,t._vertexFormat)},x}),define("Workers/createPolylineVolumeGeometry",["../Core/Ellipsoid","../Core/PolylineVolumeGeometry"],function(e,t){"use strict";function r(r){return r._ellipsoid=e.clone(r._ellipsoid),t.createGeometry(r)}return r})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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:0>e?-1:0},a.signNotZero=function(e){return 0>e?-1:1},a.toSNorm=function(e){return Math.round(255*(.5*a.clamp(e,-1,1)+.5))},a.fromSNorm=function(e){return a.clamp(e,0,255)/255*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.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 a>=i||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;e>=r;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}i.fromSpherical=function(n,r){t(r)||(r=new i);var a=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(o),r},i.fromElements=function(e,n,r,a){return t(a)?(a.x=e,a.y=n,a.z=r,a):new i(e,n,r)},i.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 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},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},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 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){i.normalize(e,s),i.normalize(t,c);var n=i.dot(s,c),r=i.magnitude(i.cross(s,c,s));return Math.atan2(r,n)};var l=new i;i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):n.y<=n.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,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},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},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)},i.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},i.fromDegrees=function(e,t,n,r,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,n,r,o)};var f=new i,h=new i,d=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(n,r,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=i.normalize(f,f),i.multiplyComponents(s,f,h);var l=Math.sqrt(i.dot(f,h));return h=i.divideByScalar(h,l,h),f=i.multiplyByScalar(f,a,f),t(u)||(u=new i),i.add(h,f,u)},i.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=a.toRadians(e[o]);return i.fromRadiansArray(r,t,n)},i.fromRadiansArray=function(e,n,r){var a=e.length;t(r)?r.length=a/2:r=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=i.fromRadians(u,s,0,n,r[o/2])}return r},i.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=a.toRadians(e[o]),r[o+1]=a.toRadians(e[o+1]),r[o+2]=e[o+2];return i.fromRadiansArrayHeights(r,t,n)},i.fromRadiansArrayHeights=function(e,n,r){var a=e.length;t(r)?r.length=a/3:r=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=i.fromRadians(u,s,c,n,r[o/3])}return r},i.ZERO=r(new i(0,0,0)),i.UNIT_X=r(new i(1,0,0)),i.UNIT_Y=r(new i(0,1,0)),i.UNIT_Z=r(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,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},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,p=a.z,m=l*l*d*d,y=f*f*E*E,_=h*h*p*p,v=m+y+_,T=Math.sqrt(1/v),R=e.multiplyByScalar(n,T,i);if(s>v)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 O,I,w,M,x,C,P,D,L,U,b,F=(1-T)*e.magnitude(n)/(.5*e.magnitude(N)),z=0;do{F-=z,w=1/(1+F*A),M=1/(1+F*S),x=1/(1+F*g),C=w*w,P=M*M,D=x*x,L=C*w,U=P*M,b=D*x,O=m*C+y*P+_*D-1,I=m*L*A+y*U*S+_*b*g;var B=-2*I;z=O/B}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=l*w,c.y=f*M,c.z=h*x,c):new e(l*w,f*M,h*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),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(t,p,s);_=e.normalize(_,_);var v=e.subtract(t,y,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){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){a=n(a,0),e.pack(t._radii,r,a)},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;n>a;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;n>a;++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}),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){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},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.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.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){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},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 n>t&&(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;h>f;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.clone=function(e,t){return n(e)?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):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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;i>a&&(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;i>a&&o>0?a+=u.TWO_PI:c>o&&a>0&&(o+=u.TWO_PI),i>a&&0>c?c+=u.TWO_PI:c>o&&0>i&&(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)&&l>=f)){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.union=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.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,a=e.west,i=e.east;return a>i&&(i+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(i>n||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++,0>f?p.latitude=f:h>0?p.latitude=h:p.latitude=0;for(var m=1;8>m;++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/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.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;n>c;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){return r(e)?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):void 0},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:0>r&&(n.width-=r,n.x=t.x),a>n.height?n.height=a:0>a&&(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","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(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 u(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;3>n;++n){var r=e[o.getElementIndex(d[n],h[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=i.EPSILON15,r=0,a=1,u=0;3>u;++u){var s=Math.abs(e[o.getElementIndex(d[u],h[u])]);s>r&&(a=u,r=s)}var c=1,l=0,f=h[a],E=d[a];if(Math.abs(e[o.getElementIndex(E,f)])>n){var p,m=e[o.getElementIndex(E,E)],y=e[o.getElementIndex(f,f)],_=e[o.getElementIndex(E,f)],v=(m-y)/2/_;p=0>v?-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=o.clone(o.IDENTITY,t),t[o.getElementIndex(f,f)]=t[o.getElementIndex(E,E)]=c,t[o.getElementIndex(E,f)]=l,t[o.getElementIndex(f,E)]=-l,t}o.packedLength=9,o.pack=function(e,n,r){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]},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},o.clone=function(e,t){return n(e)?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 o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},o.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,u=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,v=2*(c-u),T=2*(i-l),R=2*(c+u),A=-r-s+f+d;return n(t)?(t[0]=E,t[1]=y,t[2]=T,t[3]=p,t[4]=_,t[5]=R,t[6]=m,t[7]=v,t[8]=A,t):new o(E,p,m,y,_,v,T,R,A)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,r,-a,0,a,r)},o.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 o(r,0,a,0,1,0,-a,0,r)},o.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 o(r,-a,0,a,r,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},o.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},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;o.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 f=new e;o.getMaximumScale=function(t){return o.getScale(t,f),e.maximumComponent(f)},o.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},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[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},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[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},o.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},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[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},o.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},o.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},o.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],d=[2,2,1],E=new o,p=new o;return o.computeEigenDecomposition=function(e,t){var r=i.EPSILON20,a=10,l=0,f=0;n(t)||(t={});for(var h=t.unitary=o.clone(o.IDENTITY,t.unitary),d=t.diagonal=o.clone(e,t.diagonal),m=r*u(d);a>f&&s(d)>m;)c(d,E),o.transpose(E,p),o.multiply(d,E,d), +o.multiply(p,d,d),o.multiply(h,E,h),++l>2&&(++f,l=0);return 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[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},o.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)},o.inverse=function(e,t){var n=e[0],a=e[1],u=e[2],s=e[3],c=e[4],l=e[5],f=e[6],h=e[7],d=e[8],E=o.determinant(e);if(Math.abs(E)<=i.EPSILON15)throw new r("matrix is not invertible");t[0]=c*d-h*l,t[1]=h*u-a*d,t[2]=a*l-c*u,t[3]=f*l-s*d,t[4]=n*d-f*u,t[5]=s*u-n*l,t[6]=s*h-f*c,t[7]=f*a-n*h,t[8]=n*c-s*a;var p=1/E;return o.multiplyByScalar(t,p,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=a(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=a(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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.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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(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)}c.packedLength=16,c.pack=function(e,t,r){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]},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),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},c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[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]):void 0},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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new c);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,l=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,v=s-d-m+_,T=2*(l-y),R=2*(f+p),A=2*(l+y),S=-s+d-m+_,g=2*(E-h),N=2*(f-p),O=2*(E+h),I=-s-d+m+_;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]=O*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},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.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 l=new e,f=new e,h=new e;c.fromCamera=function(t,n){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,E=l.x,p=l.y,m=l.z,y=h.x,_=h.y,v=h.z,T=a.x,R=a.y,A=a.z,S=u*-T+s*-R+d*-A,g=y*-T+_*-R+v*-A,N=E*T+p*R+m*A;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]=d,n[9]=v,n[10]=-m,n[11]=0,n[12]=S,n[13]=g,n[14]=N,n[15]=1,n):new c(u,s,d,S,y,_,v,g,-E,-p,-m,N,0,0,0,1)},c.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},c.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},c.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},c.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},c.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},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,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},c.setColumn=function(e,t,n,r){r=c.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},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],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},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 d=new e;c.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 E=new e;c.getMaximumScale=function(t){return c.getScale(t,E),e.maximumComponent(E)},c.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],v=t[0],T=t[1],R=t[2],A=t[3],S=t[4],g=t[5],N=t[6],O=t[7],I=t[8],w=t[9],M=t[10],x=t[11],C=t[12],P=t[13],D=t[14],L=t[15],U=r*v+u*T+f*R+p*A,b=a*v+s*T+h*R+m*A,F=i*v+c*T+d*R+y*A,z=o*v+l*T+E*R+_*A,B=r*S+u*g+f*N+p*O,G=a*S+s*g+h*N+m*O,q=i*S+c*g+d*N+y*O,W=o*S+l*g+E*N+_*O,V=r*I+u*w+f*M+p*x,X=a*I+s*w+h*M+m*x,H=i*I+c*w+d*M+y*x,Y=o*I+l*w+E*M+_*x,k=r*C+u*P+f*D+p*L,j=a*C+s*P+h*D+m*L,Z=i*C+c*P+d*D+y*L,K=o*C+l*P+E*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]=X,n[10]=H,n[11]=Y,n[12]=k,n[13]=j,n[14]=Z,n[15]=K,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],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],v=t[5],T=t[6],R=t[8],A=t[9],S=t[10],g=t[12],N=t[13],O=t[14],I=r*p+o*m+c*y,w=a*p+u*m+l*y,M=i*p+s*m+f*y,x=r*_+o*v+c*T,C=a*_+u*v+l*T,P=i*_+s*v+f*T,D=r*R+o*A+c*S,L=a*R+u*A+l*S,U=i*R+s*A+f*S,b=r*g+o*N+c*O+h,F=a*g+u*N+l*O+d,z=i*g+s*N+f*O+E;return n[0]=I,n[1]=w,n[2]=M,n[3]=0,n[4]=x,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},c.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],v=t[7],T=t[8],R=r*h+o*d+c*E,A=a*h+u*d+l*E,S=i*h+s*d+f*E,g=r*p+o*m+c*y,N=a*p+u*m+l*y,O=i*p+s*m+f*y,I=r*_+o*v+c*T,w=a*_+u*v+l*T,M=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]=O,n[7]=0,n[8]=I,n[9]=w,n[10]=M,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,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;c.multiplyByUniformScale=function(e,t,n){return p.x=t,p.y=t,p.z=t,c.multiplyByScale(e,p,n)},c.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?c.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)},c.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},c.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},c.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},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],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},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 m=new u,y=new u,_=new t,v=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,m),y,o.EPSILON7)&&t.equals(c.getRow(e,3,_),v))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],l=e[12],f=e[1],h=e[5],d=e[9],E=e[13],p=e[2],T=e[6],R=e[10],A=e[14],S=e[3],g=e[7],N=e[11],O=e[15],I=R*O,w=A*N,M=T*O,x=A*g,C=T*N,P=R*g,D=p*O,L=A*S,U=p*N,b=R*S,F=p*g,z=T*S,B=I*h+x*d+C*E-(w*h+M*d+P*E),G=w*f+D*d+b*E-(I*f+L*d+U*E),q=M*f+L*h+F*E-(x*f+D*h+z*E),W=P*f+U*h+z*d-(C*f+b*h+F*d),V=w*a+M*i+P*l-(I*a+x*i+C*l),X=I*r+L*i+U*l-(w*r+D*i+b*l),H=x*r+D*a+z*l-(M*r+L*a+F*l),Y=C*r+b*a+F*i-(P*r+U*a+z*i);I=i*E,w=l*d,M=a*E,x=l*h,C=a*d,P=i*h,D=r*E,L=l*f,U=r*d,b=i*f,F=r*h,z=a*f;var k=I*g+x*N+C*O-(w*g+M*N+P*O),j=w*S+D*N+b*O-(I*S+L*N+U*O),Z=M*S+L*g+F*O-(x*S+D*g+z*O),K=P*S+U*g+z*N-(C*S+b*g+F*N),J=M*R+P*A+w*T-(C*A+I*T+x*R),Q=U*A+I*p+L*R-(D*R+b*A+w*p),$=D*T+z*A+x*p-(F*A+M*p+L*T),ee=F*R+C*p+b*T-(U*T+z*R+P*p),te=r*B+a*G+i*q+l*W;if(Math.abs(te)<o.EPSILON20)throw new s("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]=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},c.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},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,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/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/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";function d(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var E=new e,p=new e,m=new e,y=new e,_=new e,v=new e,T=new e,R=new e,A=new e,S=new e,g=new e,N=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,E),o=e.clone(a,p),u=e.clone(a,m),s=e.clone(a,y),c=e.clone(a,_),l=e.clone(a,v),f=t.length,h=1;f>h;h++){e.clone(t[h],a);var O=a.x,I=a.y,w=a.z;O<i.x&&e.clone(a,i),O>s.x&&e.clone(a,s),I<o.y&&e.clone(a,o),I>c.y&&e.clone(a,c),w<u.z&&e.clone(a,u),w>l.z&&e.clone(a,l)}var M=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=M;x>L&&(L=x,P=o,D=c),C>L&&(L=C,P=u,D=l);var U=A;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=S;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,R),.5,N),q=0;for(h=0;f>h;h++){e.clone(t[h],a);var W=e.magnitude(e.subtract(a,G,R));W>q&&(q=W);var V=e.magnitudeSquared(e.subtract(a,U,R));if(V>b){var X=Math.sqrt(V);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 q>F?(e.clone(U,n.center),n.radius=F):(e.clone(G,n.center),n.radius=q),n};var O=new o,I=new e,w=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,O),h.southwest(t,M),M.height=i,h.northeast(t,x),x.height=o;var s=a.project(M,I),c=a.project(x,w),l=c.x-s.x,f=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+f*f+E*E);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*f,p.z=s.z+.5*E,u};var C=[];d.fromRectangle3D=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0);var u;return r(e)&&(u=h.subsample(e,t,a,C)),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,E),c=e.clone(u,p),l=e.clone(u,m),f=e.clone(u,y),h=e.clone(u,_),O=e.clone(u,v),I=t.length,w=0;I>w;w+=i){var M=t[w]+a.x,x=t[w+1]+a.y,C=t[w+2]+a.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>h.y&&e.clone(u,h),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(h,c,R)),L=e.magnitudeSquared(e.subtract(O,l,R)),U=s,b=f,F=P;D>F&&(F=D,U=c,b=h),L>F&&(F=L,U=l,b=O);var z=A;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=S;q.x=s.x,q.y=c.y,q.z=l.z;var W=g;W.x=f.x,W.y=h.y,W.z=O.z;var V=e.multiplyByScalar(e.add(q,W,R),.5,N),X=0;for(w=0;I>w;w+=i){u.x=t[w]+a.x,u.y=t[w+1]+a.y,u.z=t[w+2]+a.z;var H=e.magnitude(e.subtract(u,V,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 X>G?(e.clone(z,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,E),u=e.clone(i,p),s=e.clone(i,m),c=e.clone(i,y),l=e.clone(i,_),f=e.clone(i,v),h=t.length,O=0;h>O;O+=3){var I=t[O]+n[O],w=t[O+1]+n[O+1],M=t[O+2]+n[O+2];i.x=I,i.y=w,i.z=M,I<o.x&&e.clone(i,o),I>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,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=A;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=S;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,R),.5,N),W=0;for(O=0;h>O;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,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 W>z?(e.clone(b,a.center),a.radius=z):(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 P=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;a>o;o++)i.push(t[o].center);n=d.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;a>o;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return n.radius=s,n};var D=new e,L=new e,U=new e;d.fromOrientedBoundingBox=function(t,n){r(n)||(n=new d);var a=t.halfAxes,i=c.getColumn(a,0,D),o=c.getColumn(a,1,L),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){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new d(t.center,t.radius):void 0},d.packedLength=4,d.pack=function(e,t,r){r=n(r,0);var a=e.center;t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius},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 b=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,b),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-a>o?u.OUTSIDE:a>o?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 G=new e;d.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,G),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,W=new e,V=new e,X=new e,H=new e,Y=new t,k=new Array(8),j=0;8>j;++j)k[j]=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,q),c=e.cross(e.UNIT_Z,s,W);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,H),h=e.negate(c,X),E=k,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;m>y;++y){var _=E[y];e.add(o,_,_);var v=i.cartesianToCartographic(_,Y);r.project(v,_)}a=d.fromPoints(E,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},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("Renderer/WebGLConstants",["../Core/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/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(){return a.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?r.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(r.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",e(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;r>n;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(v)){v=!1;var e=/ Chrome\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(v=!0,T=r(e[1]))}return v}function i(){return a()&&T}function o(){if(!t(R)&&(R=!1,!a()&&/ Safari\/[\.0-9]+/.test(_.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(R=!0,A=r(e[1]))}return R}function u(){return o()&&A}function s(){if(!t(S)){S=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(_.userAgent);null!==e&&(S=!0,g=r(e[1]),g.isNightly=!!e[2])}return S}function c(){return s()&&g}function l(){if(!t(N)){N=!1;var e;"Microsoft Internet Explorer"===_.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(_.userAgent),null!==e&&(N=!0,O=r(e[1]))):"Netscape"===_.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(_.userAgent),null!==e&&(N=!0,O=r(e[1])))}return N}function f(){return l()&&O}function h(){if(!t(I)){I=!1;var e=/Firefox\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(I=!0,w=r(e[1]))}return I}function d(){return t(M)||(M=/Windows/i.test(_.appVersion)),M}function E(){return h()&&w}function p(){return t(x)||(x="undefined"!=typeof PointerEvent&&(!t(_.pointerEnabled)||_.pointerEnabled)),x}function m(){if(!t(P)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;P=t(n)&&""!==n,P&&(C=n)}return P}function y(){return m()?C:void 0}var _;_="undefined"!=typeof navigator?navigator:{};var v,T,R,A,S,g,N,O,I,w,M,x,C,P,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:E,isWindows:d,hardwareConcurrency:e(_.hardwareConcurrency,3),supportsPointerEvents:p,supportsImageRenderingPixelated:m,imageRenderingValue:y};return D.supportsFullscreen=function(){return n.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,a,i){"use strict";if(!a.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return n(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,n,a,i){switch(a=t(a,0),i=t(i,(n.byteLength-a)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,a,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,a,i);case o.SHORT:return new Int16Array(n,a,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,a,i);case o.FLOAT:return new Float32Array(n,a,i);case o.DOUBLE:return new Float64Array(n,a,i);default:throw new r("componentDatatype is not a valid value.")}},i(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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(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=void 0}return i.computeNumberOfVertices=function(e){var r=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=t.x,r=t.y;t.x=(1-Math.abs(r))*a.signNotZero(n),t.y=(1-Math.abs(n))*a.signNotZero(r)}return t.x=a.toSNorm(t.x),t.y=a.toSNorm(t.y),t},i.octDecode=function(e,n,r){if(r.x=a.fromSNorm(e),r.y=a.fromSNorm(n),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){var i=r.x;r.x=(1-Math.abs(r.y))*a.signNotZero(i),r.y=(1-Math.abs(i))*a.signNotZero(r.y)}return t.normalize(r,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 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=1===e.x?4095:4096*e.x|0,n=1===e.y?4095:4096*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096;return t.x=Math.floor(n)/4096,t.y=n-Math.floor(n),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,E,p,m,y,_;n(a.z)?(f=t.subtract(s,a,i),h=t.subtract(c,a,o),d=t.subtract(r,a,u),E=t.dot(f,f),p=t.dot(f,h),m=t.dot(f,d),y=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),E=e.dot(f,f),p=e.dot(f,h),m=e.dot(f,d),y=e.dot(h,h),_=e.dot(h,d));var v=1/(E*y-p*p);return l.y=(y*m-p*_)*v,l.z=(E*_-p*m)*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/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/IndexDatatype",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,r){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,r):new Uint16Array(t,n,r)},r(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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,0>i?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(0>f)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(0>y){var _,v,T;h*f>=l*d?(_=o,v=E,T=-2*u*E+o*p):(_=c,v=m,T=-c*p+2*s*m);var R=0>T?-1:1,A=-R*Math.abs(_)*Math.sqrt(-y);i=-T+A;var S=i/2,g=0>S?-Math.pow(-S,1/3):Math.pow(S,1/3),N=i===A?-g:-v/g;return a=0>=v?g+N:-T/(g*g+N*N+v),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var O=E,I=-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,-I)/3);a=2*Math.sqrt(-O);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=2*s>i+L?i+s:L+s,G=z/B,q=b*B,W=-U*B-b*z,V=U*z,X=(s*W-u*V)/(-u*W+s*q);return X>=F?G>=F?G>=X?[F,X,G]:[F,G,X]:[G,F,X]:G>=F?[X,F,G]:G>=X?[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=0>u?-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,0>u?[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),v=Math.sqrt(y);return[h-v,h-_,h+_,h+v]}if(m>=0&&0>y)return p=Math.sqrt(m),[h-p,h+p];if(0>m&&y>=0)return p=Math.sqrt(y),[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=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 E,p,m=d[0],y=a-m,_=y*y,v=t/2,T=y/2,R=_-4*o,A=_+4*Math.abs(o),S=c-4*m,g=c+4*Math.abs(m);if(0>m||S*A>R*g){var N=Math.sqrt(S);E=N/2,p=0===N?0:(t*T-i)/N}else{var O=Math.sqrt(R);E=0===O?0:(t*T-i)/O,p=O/2}var I,w;0===v&&0===E?(I=0,w=0):n.sign(v)===n.sign(E)?(I=v+E,w=m/I):(w=v-E,I=m/w);var M,x;0===T&&0===p?(M=0,x=0):n.sign(T)===n.sign(p)?(M=T+p,x=o/M):(x=T-p,M=o/x);var C=r.computeRealRoots(1,I,M),P=r.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,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=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>f?d+1:d,d+=0>h?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(t,r,a,o,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,p=e.subtract(a,r,m),R=e.subtract(o,r,y),A=e.cross(E,R,_),S=e.dot(p,A);if(u){if(S<i.EPSILON6)return;if(s=e.subtract(d,r,v),l=e.dot(s,A),0>l||l>S)return;if(c=e.cross(s,p,T),f=e.dot(E,c),0>f||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,v),l=e.dot(s,A)*g,0>l||l>1)return;if(c=e.cross(s,p,T),f=e.dot(E,c)*g,0>f||l+f>1)return;h=e.dot(R,c)*g}return h}function f(e,t,n,r){var a=t*t-4*e*n;if(!(0>a)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(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={});var i=t.origin,o=t.direction,u=n.center,s=n.radius*n.radius,c=e.subtract(i,u,_),l=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,E=f(l,h,d,A);return r(E)?(a.start=E.root0,a.stop=E.root1,a):void 0}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 E(t,n,r,a,c){var l,f=a*a,h=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,p=c*(a*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),m=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),v=[];if(0===_&&0===y){if(l=u.computeRealRoots(E,p,m),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=y*y,O=E*E,I=_*y,w=O+N,M=2*(p*E+I),x=2*m*E+p*p-N+g,C=2*(m*p-I),P=m*m-g;if(0===w&&0===M&&0===x&&0===C)return v;l=s.computeRealRoots(w,M,x,C,P);var D=l.length;if(0===D)return v;for(var L=0;D>L;++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(m)?d(E*F+m,p*b,i.EPSILON12):i.sign(m)===i.sign(p*b)?d(E*F,p*b+m,i.EPSILON12):d(E*F+p*b,m,i.EPSILON12);var G=d(y*b,_,i.EPSILON15),q=U*G;0>q?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)),++L):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(!(0>l))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var m=new e,y=new e,_=new e,v=new e,T=new e;p.rayTriangle=function(t,n,a,i,o,u){var s=l(t,n,a,i,o);if(r(s)&&!(0>s))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;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 f=l(c,a,i,o,u);return!r(f)||0>f||f>e.distance(t,n)?void 0:(r(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var A={root0:0,root1:0};p.raySphere=function(e,t,n){return n=h(e,t,n),!r(n)||n.stop<0?void 0:(n.start=Math.max(n.start,0),n)};var S=new c;p.lineSegmentSphere=function(t,n,a,i){var o=S,u=e.subtract(n,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=h(o,a,i),!r(i)||i.stop<0||i.start>s?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i)};var g=new e,N=new e;p.rayEllipsoid=function(t,n){var r,a,i,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,g),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,i>d)return;if(d>i){o=h*h-i,u=-h+Math.sqrt(o);var E=u/a,p=r/u;return p>E?{start:E,stop:p}:{start:p,stop:E}}var m=Math.sqrt(r/a);return{start:m,stop:m}}return 1>f?(r=f-1,a=e.magnitudeSquared(l),i=a*r,o=h*h-i,u=-h+Math.sqrt(o),{start:0,stop:u/a}):0>h?(a=e.magnitudeSquared(l),{start:0,stop:-h/a}):void 0};var O=new e,I=new e,w=new e,M=new e,x=new e,C=new o,P=new o,D=new o,L=new o,U=new o,b=new o,F=new o,z=new e,B=new e,G=new t;p.grazingAltitudeLocation=function(t,n){ +var a=t.origin,u=t.direction,s=n.geodeticSurfaceNormal(a,O);if(e.dot(u,s)>=0)return a;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),p=e.normalize(e.cross(f,d,w),w),m=C;m[0]=f.x,m[1]=f.y,m[2]=f.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 y=o.transpose(m,P),_=o.fromScale(n.radii,D),v=o.fromScale(n.oneOverRadii,L),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(y,v,b),T,b),g=o.multiply(o.multiply(S,_,F),m,F),N=o.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;W>H;++H){R=o.multiplyByVector(_,o.multiplyByVector(m,q[H],z),z);var Y=e.normalize(e.subtract(R,a,M),M),k=e.dot(Y,u);k>X&&(X=k,V=e.clone(R,V))}var j=n.cartesianToCartographic(V,G);return X=i.clamp(X,0,1),A=e.magnitude(e.subtract(V,a,M))*Math.sqrt(1-X*X),A=c?-A:A,j.height=A,n.cartographicToCartesian(j,new e)}};var q=new e;return p.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(!(0>f||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/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];o>u;)s>a&&(a=s),++u,s=r[u]}for(var c=[],l=0;a+1>l;l++)c[l]=0;for(var f=i+1,h=0;o>h;++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(;r>i;){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||-1===l)&&(l=s,c=h)),++f}return-1===c?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(;d>f;)h>l&&(l=h),++f,h=o[f];if(-1===l)return 0;++l}for(var E=[],p=0;l>p;p++)E[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var m=0;d>f;)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 v,T,R=[],A=[],S=0,g=[],N=c/3,O=[];for(p=0;N>p;p++)O[p]=!1;for(var I,w;-1!==y;){R=[],T=E[y],w=T.vertexTriangles.length;for(var M=0;w>M;++M)if(m=T.vertexTriangles[M],!O[m]){O[m]=!0,f=m+m+m;for(var x=0;3>x;++x)I=o[f],R.push(I),A.push(I),g[S]=I,++S,v=E[I],--v.numLiveTriangles,_-v.timeStamp>s&&(v.timeStamp=_,++_),++f}y=a(o,s,R,E,_,A,l)}return g},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryInstance","./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,E,p,m,y,_,v,T,R,A,S,g,N){"use strict";function O(e,t,n,r,a){e[t++]=n,e[t++]=r,e[t++]=r,e[t++]=a,e[t++]=a,e[t]=n}function I(e){for(var t=e.length,n=t/3*6,r=y.createTypedArray(t,n),a=0,i=0;t>i;i+=3,a+=6)O(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=y.createTypedArray(t,n);O(r,0,e[0],e[1],e[2]);for(var a=6,i=3;t>i;++i,a+=6)O(r,a,e[i-1],e[i],e[i-2]);return r}return new Uint16Array}function M(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;t>o;++o,i+=6)O(r,i,a,e[o],e[o+1]);return r}return new Uint16Array}function x(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;r>i;i+=3)a.unpack(n,i,ie),A.multiplyByPoint(e,ie,ie),a.pack(ie,n,i)}function D(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;r>i;i+=3)a.unpack(n,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,n,i)}function L(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;r>f;++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 U(e,t){var r,i,o,u,s,l,f,h=e.length,E=(e[0].modelMatrix,c(e[0][t].indices)),p=e[0][t].primitiveType,m=L(e,t);for(r in m)if(m.hasOwnProperty(r))for(s=m[r].values,u=0,i=0;h>i;++i)for(l=e[i][t].attributes[r].values,f=l.length,o=0;f>o;++o)s[u++]=l[o];var _;if(E){var v=0;for(i=0;h>i;++i)v+=e[i][t].indices.length;var T=d.computeNumberOfVertices(new d({attributes:m,primitiveType:g.POINTS})),R=y.createTypedArray(T,v),A=0,S=0;for(i=0;h>i;++i){var N=e[i][t].indices,O=N.length;for(u=0;O>u;++u)R[A++]=S+N[u];S+=d.computeNumberOfVertices(e[i][t])}_=R}var I,w=new a,M=0;for(i=0;h>i;++i){if(I=e[i][t].boundingSphere,!c(I)){w=void 0;break}a.add(I.center,w,w)}if(c(w))for(a.divideByScalar(w,h,w),i=0;h>i;++i){I=e[i][t].boundingSphere;var x=a.magnitude(a.subtract(I.center,w,se))+I.radius;x>M&&(M=x)}return new d({attributes:m,indices:_,primitiveType:p,boundingSphere:c(w)?new n(w,M):void 0})}function b(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),n=y.createTypedArray(t,t),r=0;t>r;++r)n[r]=r;return e.indices=n,e}function F(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;t>a;++a)n[r++]=a-1,n[r++]=0,n[r++]=a;return e.indices=n,e.primitiveType=g.TRIANGLES,e}function z(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;t-1>a;a+=2)n[r++]=a,n[r++]=a-1,n[r++]=a+1,t>a+2&&(n[r++]=a,n[r++]=a+1,n[r++]=a+2);return e.indices=n,e.primitiveType=g.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),n=y.createTypedArray(t,t),r=0;t>r;++r)n[r]=r;return e.indices=n,e}function G(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;t>a;++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=y.createTypedArray(t,2*t);n[0]=0,n[1]=1;for(var r=2,a=2;t>a;++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 W(e){switch(e.primitiveType){case g.TRIANGLE_FAN:return F(e);case g.TRIANGLE_STRIP:return z(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 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=0>r;V(e,u),V(t,u),V(n,u)}function H(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),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=Ne.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,r?(H(e,t,Re,Se),H(e,n,Ae,ge),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(H(t,n,Re,Se),H(t,e,Ae,ge),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(H(n,e,Re,Se),H(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||(H(n,e,Re,Se),H(n,t,Ae,ge),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(H(t,n,Re,Se),H(t,e,Ae,ge),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(H(e,t,Re,Se),H(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 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=y.createTypedArray(o,e.indices),t&&(e.boundingSphere=n.fromVertices(r.position.values)),e}}function j(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 d({attributes:n,indices:[],primitiveType:e.primitiveType})}function Z(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,E){if(c(s)||c(l)||c(f)||c(h)){var p=a.fromArray(u,3*e,Oe),m=a.fromArray(u,3*n,Ie),y=a.fromArray(u,3*i,we),_=t(o,p,m,y,Me);if(c(s)){var v=a.fromArray(s,3*e,Oe),T=a.fromArray(s,3*n,Ie),R=a.fromArray(s,3*i,we);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*E)}if(c(l)){var S=a.fromArray(l,3*e,Oe),g=a.fromArray(l,3*n,Ie),N=a.fromArray(l,3*i,we);a.multiplyByScalar(S,_.x,S),a.multiplyByScalar(g,_.y,g),a.multiplyByScalar(N,_.z,N);var O=a.add(S,g,S);a.add(O,N,O),a.normalize(O,O),a.pack(O,d.binormal.values,3*E)}if(c(f)){var I=a.fromArray(f,3*e,Oe),w=a.fromArray(f,3*n,Ie),M=a.fromArray(f,3*i,we);a.multiplyByScalar(I,_.x,I),a.multiplyByScalar(w,_.y,w),a.multiplyByScalar(M,_.z,M);var x=a.add(I,w,I);a.add(x,M,x),a.normalize(x,x),a.pack(x,d.tangent.values,3*E)}if(c(h)){var C=r.fromArray(h,2*e,xe),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 L=r.add(C,P,C);r.add(L,D,L),r.pack(L,d.st.values,2*E)}}}function J(e,t,n,r,a,i){var o=e.position.values.length/3;if(-1!==a){var u=r[a],s=n[u];return-1===s?(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.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,m=j(u),y=j(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;T>o;o+=3){var R=p[o],A=p[o+1],S=p[o+2],g=a.fromArray(l,3*R),N=a.fromArray(l,3*A),O=a.fromArray(l,3*S),I=Y(g,N,O);if(c(I)&&I.positions.length>3)for(var w=I.positions,M=I.indices,x=M.length,C=0;x>C;++C){var P=M[C],D=w[P];D.y<0?(t=y.attributes,n=y.indices,r=_):(t=m.attributes,n=m.indices,r=v),i=J(t,n,r,p,3>P?o+P:-1,D),K(R,A,S,D,l,f,h,d,E,t,i)}else c(I)&&(g=I.positions[0],N=I.positions[1],O=I.positions[2]),g.y<0?(t=y.attributes,n=y.indices,r=_):(t=m.attributes,n=m.indices,r=v),i=J(t,n,r,p,o,g),K(R,A,S,g,l,f,h,d,E,t,i),i=J(t,n,r,p,o+1,N),K(R,A,S,N,l,f,h,d,E,t,i),i=J(t,n,r,p,o+2,O),K(R,A,S,O,l,f,h,d,E,t,i)}Z(e,y,m)}function $(e){var t,n=e.geometry,r=n.attributes,i=r.position.values,o=n.indices,u=j(n),s=j(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;l>t;t+=2){var d=o[t],E=o[t+1],p=a.fromArray(i,3*d,Oe),m=a.fromArray(i,3*E,Ie);Math.abs(p.y)<T.EPSILON6&&(p.y<0?p.y=-T.EPSILON6:p.y=T.EPSILON6),Math.abs(m.y)<T.EPSILON6&&(m.y<0?m.y=-T.EPSILON6:m.y=T.EPSILON6);var y=u.attributes,_=u.indices,R=h,A=s.attributes,S=s.indices,g=f,N=v.lineSegmentPlane(p,m,De,we);if(c(N)){var O=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Le);p.y<0&&(a.negate(O,O),y=s.attributes,_=s.indices,R=f,A=u.attributes,S=u.indices,g=h);var I=a.add(N,O,Ue);J(y,_,R,o,t,p),J(y,_,R,o,-1,I),a.negate(O,O),a.add(N,O,I),J(A,S,g,o,-1,I),J(A,S,g,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=h),J(w,M,x,o,t,p),J(w,M,x,o,t+1,m)}}Z(e,s,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,E=c(s.st)?s.st.values:void 0,p=c(s.color)?s.color.values:void 0,m=j(u),y=j(u),_=l.length/3;for(t=0;_>t;t+=4){var R=t,A=t+1,S=t+2,g=t+3,N=a.fromArray(l,3*R,ze),O=a.fromArray(l,3*A,Be),I=a.fromArray(l,3*S,Ge),w=a.fromArray(l,3*g,qe);Math.abs(N.y)<T.EPSILON6&&(N.y=T.EPSILON6*(I.y<0?-1:1),O.y=N.y),Math.abs(I.y)<T.EPSILON6&&(I.y=T.EPSILON6*(N.y<0?-1:1),w.y=I.y);var M=m.attributes,x=m.indices,C=y.attributes,P=y.indices,D=v.lineSegmentPlane(N,I,De,We);if(c(D)){var L=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Ve);N.y<0&&(a.negate(L,L),M=y.attributes,x=y.indices,C=m.attributes,P=m.indices);var U=a.add(D,L,Xe);for(M.position.values.push(N.x,N.y,N.z,O.x,O.y,O.z),M.position.values.push(U.x,U.y,U.z),M.position.values.push(U.x,U.y,U.z),a.negate(L,L),a.add(D,L,U),C.position.values.push(U.x,U.y,U.z),C.position.values.push(U.x,U.y,U.z),C.position.values.push(I.x,I.y,I.z,w.x,w.y,w.z),n=3*R;3*R+6>n;++n)M.prevPosition.values.push(f[n]);for(M.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),C.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),n=3*S;3*S+6>n;++n)C.prevPosition.values.push(f[n]);for(n=3*R;3*R+6>n;++n)M.nextPosition.values.push(h[n]);for(M.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),C.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),n=3*S;3*S+6>n;++n)C.nextPosition.values.push(h[n]);var b=r.fromArray(d,2*R,be),F=Math.abs(b.y);M.expandAndWidth.values.push(-1,F,1,F),M.expandAndWidth.values.push(-1,-F,1,-F),C.expandAndWidth.values.push(-1,F,1,F),C.expandAndWidth.values.push(-1,-F,1,-F);var z=a.magnitudeSquared(a.subtract(D,N,qe));if(z/=a.magnitudeSquared(a.subtract(I,N,qe)),c(p)){var B=i.fromArray(p,4*R,He),G=i.fromArray(p,4*S,He),q=T.lerp(B.x,G.x,z),W=T.lerp(B.y,G.y,z),V=T.lerp(B.z,G.z,z),X=T.lerp(B.w,G.w,z);for(n=4*R;4*R+8>n;++n)M.color.values.push(p[n]);for(M.color.values.push(q,W,V,X),M.color.values.push(q,W,V,X),C.color.values.push(q,W,V,X),C.color.values.push(q,W,V,X),n=4*S;4*S+8>n;++n)C.color.values.push(p[n])}if(c(E)){var H=r.fromArray(E,2*R,be),Y=r.fromArray(E,2*(t+3),Fe),k=T.lerp(H.x,Y.x,z);for(n=2*R;2*R+4>n;++n)M.st.values.push(E[n]);for(M.st.values.push(k,H.y),M.st.values.push(k,Y.y),C.st.values.push(k,H.y),C.st.values.push(k,Y.y),n=2*S;2*S+4>n;++n)C.st.values.push(E[n])}o=M.position.values.length/3-4,x.push(o,o+2,o+1),x.push(o+1,o+2,o+3),o=C.position.values.length/3-4,P.push(o,o+2,o+1),P.push(o+1,o+2,o+3)}else{var K,J;for(N.y<0?(K=y.attributes,J=y.indices):(K=m.attributes,J=m.indices),K.position.values.push(N.x,N.y,N.z),K.position.values.push(O.x,O.y,O.z),K.position.values.push(I.x,I.y,I.z),K.position.values.push(w.x,w.y,w.z),n=3*t;3*t+12>n;++n)K.prevPosition.values.push(f[n]),K.nextPosition.values.push(h[n]);for(n=2*t;2*t+8>n;++n)K.expandAndWidth.values.push(d[n]),c(E)&&K.st.values.push(E[n]);if(c(p))for(n=4*t;4*t+16>n;++n)K.color.values.push(p[n]);o=K.position.values.length/3-4,J.push(o,o+2,o+1),J.push(o+1,o+2,o+3)}}Z(e,y,m)}var te={};te.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=w(t);break;case g.TRIANGLE_FAN:e.indices=M(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=g.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;o>h;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 p,m=e.boundingSphere;return c(m)&&(p=new n(m.center,m.radius+r)),new d({attributes:{position:new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:g.LINES,boundingSphere:p})},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;o>t;++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;t>a;a++)r[a]=-1;for(var i,o=n,s=o.length,l=y.createTypedArray(t,s),f=0,h=0,E=0;s>f;)i=r[o[f]],-1!==i?l[h]=i:(i=o[f],r[i]=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=r[T];if(-1!==S)for(a=0;R>a;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===g.TRIANGLES&&c(n)){for(var r=n.length,a=0,i=0;r>i;i++)n[i]>a&&(a=n[i]);e.indices=N.tipsify({indices:n,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],n=d.computeNumberOfVertices(e);if(c(e.indices)&&n>=T.SIXTY_FOUR_KILOBYTES){var r,a=[],i=[],o=0,u=x(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;l>f;f+=r){for(var h=0;r>h;++h){var E=s[f+h],p=a[E];c(p)||(p=o++,a[E]=p,C(u,e.attributes,E)),i.push(p)}o+r>=T.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=x(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,f=o.values,d=new Float64Array(f.length),p=0,m=0;m<f.length;m+=3){var y=a.fromArray(f,m,ne),_=s.cartesianToCartographic(y,re);if(!c(_))throw new l("Could not project point ("+y.x+", "+y.y+", "+y.z+") to 2D.");var v=i.project(_,ne);d[p++]=v.x,d[p++]=v.y,d[p++]=v.z}return e.attributes[n]=o,e.attributes[r]=new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:d}),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;o>l;++l)f.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var h=a.componentsPerAttribute;return e.attributes[n]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:s}),e.attributes[r]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:h,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 r=e.geometry.attributes;P(t,r.position),P(t,r.prevPosition),P(t,r.nextPosition),(c(r.normal)||c(r.binormal)||c(r.tangent))&&(A.inverse(t,oe),A.transpose(oe,oe),A.getRotation(oe,ue),D(ue,r.normal),D(ue,r.binormal),D(ue,r.tangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=n.transform(a,t,a)),e.modelMatrix=A.clone(A.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],n=[],r=e.length,a=0;r>a;++a){var i=e[a];c(i.geometry)?t.push(i):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;i>f;f++)s[f]={indexOffset:0,count:0,currentCount:0};var h=0;for(f=0;o>f;f+=3){var d=t[f],p=t[f+1],m=t[f+2],y=3*d,_=3*p,v=3*m;le.x=r[y],le.y=r[y+1],le.z=r[y+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[p].count++,s[m].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;i>f;f++)s[f].indexOffset+=T,T+=s[f].count;h=0;var R;for(f=0;o>f;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;i>f;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 E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:S}),e};var de=new a,Ee=new a,pe=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;s>l;l+=3){var p=t[l],m=t[l+1],y=t[l+2];f=3*p,h=3*m,d=3*y;var _=2*p,v=2*m,T=2*y,R=n[f],A=n[f+1],S=n[f+2],g=i[_],N=i[_+1],O=i[v+1]-N,I=i[T+1]-N,w=1/((i[v]-g)*I-(i[T]-g)*O),M=(I*(n[h]-R)-O*(n[d]-R))*w,x=(I*(n[h+1]-A)-O*(n[d+1]-A))*w,C=(I*(n[h+2]-S)-O*(n[d+2]-S))*w;c[f]+=M,c[f+1]+=x,c[f+2]+=C,c[h]+=M,c[h+1]+=x,c[h+2]+=C,c[d]+=M,c[d+1]+=x,c[d+2]+=C}var P=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;o>l;l++){f=3*l,h=f+1,d=f+2;var L=a.fromArray(r,f,de),U=a.fromArray(c,f,pe),b=a.dot(L,U);a.multiplyByScalar(L,b,Ee),a.normalize(a.subtract(U,Ee,U),U),D[f]=U.x,D[h]=U.y,D[d]=U.z,a.normalize(a.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 me=new r,ye=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 p=c(o)?o.length:s.length,m=c(o)?3:2,y=p/m,_=y,v=c(s)&&c(o)?2:1;v+=c(l)||c(f)?1:0,_*=v;for(var T=new Float32Array(_),R=0,A=0;y>A;++A){c(s)&&(r.fromArray(s,2*A,me),T[R++]=e.compressTextureCoordinates(me));var S=3*A;c(o)&&c(l)&&c(f)?(a.fromArray(o,S,ye),a.fromArray(l,S,_e),a.fromArray(f,S,ve),e.octPack(ye,_e,ve,me),T[R++]=me.x,T[R++]=me.y):(c(o)&&(a.fromArray(o,S,ye),T[R++]=e.octEncodeFloat(ye)),c(l)&&(a.fromArray(l,S,ye),T[R++]=e.octEncodeFloat(ye)),c(f)&&(a.fromArray(f,S,ye),T[R++]=e.octEncodeFloat(ye)))}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 a,Re=new a,Ae=new a,Se=new a,ge=new a,Ne={positions:new Array(7),indices:new Array(9)},Oe=new a,Ie=new a,we=new a,Me=new a,xe=new r,Ce=new r,Pe=new r,De=S.fromPointNormal(a.ZERO,a.UNIT_Y),Le=new a,Ue=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 a,He=new i;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,S.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==m.NONE)switch(t.geometryType){case m.POLYLINES:ee(e);break;case m.TRIANGLES:Q(e);break;case m.LINES:$(e)}else W(t),t.primitiveType===g.TRIANGLES?Q(e):t.primitiveType===g.LINES&&$(e);return e},te}),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;f>h;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 v=e.add(y,_,r.center);return e.multiplyByScalar(v,.5,v),r},i.clone=function(t,r){return n(t)?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):void 0},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:0>s+u?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(r){return i(r)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(a){return i(a)}});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(t){r.progress(t)}}: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=R,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,_,v;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))},v=0;_>v;++v)v in t&&e(t[v],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;a>s;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 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 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=E,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(;a>i;++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;o>=i;)if(r=~~((i+o)/2),a=n(e[r],t),0>a)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,v="",T=!1,R=!1,A=" ",S=s.length,g=0;s&&S>g;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,0>c&&(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,T,A);case"c":return u(String.fromCharCode(+y),_,c,f,T);case"b":return o(y,2,R,_,c,f,T);case"o":return o(y,8,R,_,c,f,T);case"x":return o(y,16,R,_,c,f,T); +case"X":return o(y,16,R,_,c,f,T).toUpperCase();case"u":return o(y,10,R,_,c,f,T);case"i":case"d":return d=+y||0,d=Math.round(d-d%1),E=0>d?"-":v,y=E+a(String(Math.abs(d)),f,"0",!1),i(y,E,_,c,T);case"e":case"E":case"f":case"F":case"g":case"G":return d=+y,E=0>d?"-":v,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,T)[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){v.julianDate=e;var n=p.leapSeconds,r=t(n,v,l);0>r&&(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){v.julianDate=e;var r=p.leapSeconds,a=t(r,v,l);if(0>a&&(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):1>=i?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,0>t&&(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,0>r&&(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,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})?$/,O=/^(\d{2})(\.\d+)?/.source+N.source,I=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,w=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,M="Invalid ISO 8601 date.";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,i,u,s=e.split("T"),l=1,h=1,m=0,v=0,N=0,x=0,C=s[0],P=s[1];if(!r(C))throw new a(M);var D;if(s=C.match(g),null!==s){if(D=C.split("-").length-1,D>0&&2!==D)throw new a(M);n=+s[1],l=+s[2],h=+s[3]}else if(s=C.match(R),null!==s)n=+s[1],l=+s[2];else if(s=C.match(T),null!==s)n=+s[1];else{var L;if(s=C.match(A),null!==s){if(n=+s[1],L=+s[2],u=o(n),1>L||u&&L>366||!u&&L>365)throw new a(M)}else{if(s=C.match(S),null===s)throw new a(M);n=+s[1];var U=+s[2],b=+s[3]||0;if(D=C.split("-").length-1,D>0&&(!r(s[3])&&1!==D||r(s[3])&&2!==D))throw new a(M);var F=new Date(Date.UTC(n,0,4));L=7*U+b-F.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(L),l=i.getUTCMonth()+1,h=i.getUTCDate()}if(u=o(n),1>l||l>12||1>h||(2!==l||!u)&&h>y[l-1]||u&&2===l&&h>_)throw new a(M);var z;if(r(P)){if(s=P.match(w),null!==s){if(D=P.split(":").length-1,D>0&&2!==D&&3!==D)throw new a(M);m=+s[1],v=+s[2],N=+s[3],x=1e3*+(s[4]||0),z=5}else if(s=P.match(I),null!==s){if(D=P.split(":").length-1,D>2)throw new a(M);m=+s[1],v=+s[2],N=60*+(s[3]||0),z=4}else{if(s=P.match(O),null===s)throw new a(M);m=+s[1],v=60*+(s[2]||0),z=3}if(v>=60||N>=61||m>24||24===m&&(v>0||N>0||x>0))throw new a(M);var B=s[z],G=+s[z+1],q=+(s[z+2]||0);switch(B){case"+":m-=G,v-=q;break;case"-":m+=G,v+=q;break;case"Z":break;default:v+=new Date(Date.UTC(n,l-1,h,m,v)).getTimezoneOffset()}}else v+=new Date(n,l-1,h).getTimezoneOffset();var W=60===N;for(W&&N--;v>=60;)v-=60,m++;for(;m>=24;)m-=24,h++;for(i=u&&2===l?_:y[l-1];h>i;)h-=i,l++,l>12&&(l-=12,n++),i=u&&2===l?_:y[l-1];for(;0>v;)v+=60,m--;for(;0>m;)m+=24,h--;for(;1>h;)l--,1>l&&(l+=12,n--),i=u&&2===l?_:y[l-1],h+=i;var V=E(n,l,h,m,v,N,x);return r(t)?(d(V[0],V[1],t),f(t)):t=new p(V[0],V[1],c.UTC),W&&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,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=y,t.month=m,t.day=E,t.hour=_,t.minute=T,t.second=R,t.millisecond=A,t.isLeapSecond=n,t):new i(y,m,E,_,T,R,A,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){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new p(e.dayNumber,e.secondsOfDay,c.TAI):void 0},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){v.julianDate=e;var n=p.leapSeconds,r=t(n,v,l);return 0>r&&(r=~r,--r,0>r&&(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)],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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,n,r,a,i){"use strict";function o(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,u=n.headers,s=n.overrideMimeType,c=n.withCredentials;return e(n.url,function(t){var n=e.defer();return o.load(t,r,a,i,u,n,s,c),n.promise})}function u(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function s(e,t){for(var n=u(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 c(e,n){n=t(n,"");var a=e[1],i=!!e[2],o=e[3];switch(n){case"":case"text":return u(i,o);case"arraybuffer":return s(i,o);case"blob":var c=s(i,o);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(u(i,o),a);case"json":return JSON.parse(u(i,o));default:throw new r("Unhandled responseType: "+n)}}var l=/^data:(.*?)(;base64)?,(.*)$/;return o.load=function(e,t,r,o,u,s,f,h){var d=l.exec(e);if(null!==d)return void s.resolve(c(d,t));var E=new XMLHttpRequest;if(n(f)&&n(E.overrideMimeType)&&E.overrideMimeType(f),E.open(r,e,!0),n(u))for(var p in u)u.hasOwnProperty(p)&&E.setRequestHeader(p,u[p]);n(t)&&(E.responseType=t),n(h)&&(E.withCredentials=h),E.onload=function(){E.status>=200&&E.status<300?n(E.response)?s.resolve(E.response):n(E.responseXML)&&E.responseXML.hasChildNodes()?s.resolve(E.responseXML):n(E.responseText)?s.resolve(E.responseText):s.reject(new i("unknown XMLHttpRequest response type.")):s.reject(new a(E.status,E.response,E.getAllResponseHeaders()))},E.onerror=function(e){s.reject(new a)},E.send(o)},o.defaultLoad=o.load,o}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";function n(n,r){return e({url:n,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return n}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)||(a={}),t(a.headers)?t(a.headers.Accept)||(a.headers=e(a.headers),a.headers.Accept=i.Accept):a.headers=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(0>a||0>i||0>s||0>c||0>h||0>E||0>p)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 _,v=e._addNewLeapSeconds,T=0,R=m.length;R>T;T+=e._columnCount){var A=m[T+a],S=m[T+p],g=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(g,S,f.TAI);if(y.push(N),v){if(S!==_&&r(_)){var O=o.leapSeconds,I=t(O,N,d);if(0>I){var w=new u(N,S);O.splice(~I,0,w)}}_=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 v=n[h+e._taiMinusUtcSecondsColumn],T=n[d+e._taiMinusUtcSecondsColumn];v!==T&&(l.equals(r)?E=y:y-=T-v)}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,0>s&&(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("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/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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","require"],function(e,t,n,r,a){"use strict";function i(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),a=d.exec(r);if(null!==a)return a[1]}}function o(){if(t(l))return l;var a;if(a="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:i(),!t(a))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new e(r(a))}function u(e){return a.toUrl("../"+e)}function s(t){return new e(t).resolve(o()).toString()}function c(e){t(f)||(f=t(a.toUrl)?u:s),t(h)||(h=document.createElement("a"));var n=f(e);return h.href=n,h.href=h.href,h.href}var l,f,h,d=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=d,c.setBaseUrl=function(t){l=new e(t).resolve(new e(document.location.href))},c}),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;t>=s;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;t>=c;++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;s>u;++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;0>u&&(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;h>=E;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(0>i)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);0>s&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,0>s&&(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,v=this._coef,T=this._xTable;for(E=0;u>=E;++E)y[E]=m-T[E];for(E=0;u>=E;++E){for(v[E]=1,p=0;u>=p;++p)p!==E&&(v[E]*=y[p]);v[E]*=_[E];var R=3*(s+E);n.x+=v[E]*d[R++],n.y+=v[E]*d[R++],n.s+=v[E]*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],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],v=m[_];r=Math.sqrt(e[u.getElementIndex(y,y)]-e[u.getElementIndex(_,_)]-e[u.getElementIndex(v,v)]+1);var T=f;T[y]=.5*r,r=.5/r,c=(e[u.getElementIndex(v,_)]-e[u.getElementIndex(_,v)])*r,T[_]=(e[u.getElementIndex(_,y)]+e[u.getElementIndex(y,_)])*r,T[v]=(e[u.getElementIndex(v,y)]+e[u.getElementIndex(y,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,E=new e,p=new s,m=new s,y=new s;s.packedLength=4,s.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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;i>a;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){return n(e)?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):void 0},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 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(0>a&&(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 O=new s,I=1.9011074535173003,w=a.supportsTypedArrays()?new Float32Array(8):[],M=a.supportsTypedArrays()?new Float32Array(8):[],x=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],P=0;7>P;++P){var D=P+1,L=2*D+1;w[P]=1/(D*L),M[P]=D/L}return w[7]=I/136,M[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)x[f]=(w[f]*c-M[f])*o,C[f]=(w[f]*l-M[f])*o;var h=a*n*(1+x[0]*(1+x[1]*(1+x[2]*(1+x[3]*(1+x[4]*(1+x[5]*(1+x[6]*(1+x[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,O);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,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","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./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){"use strict";var _={},v=new n,T=new n,R=new n;_.eastNorthUpToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=v,s=T,l=R;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.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,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var A=new n,S=new n,g=new n;_.northEastDownToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=-o,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]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=A,s=S,l=g;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.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(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},_.northUpEastToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=o,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(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=v,s=T,l=R;return t=a(t,c.WGS84), +t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(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 p(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 N=new m,O=new n(1,1,1),I=new p;_.headingPitchRollToFixedFrame=function(e,t,r,a,i,o){var u=m.fromHeadingPitchRoll(t,r,a,N),s=p.fromTranslationQuaternionRotationScale(n.ZERO,u,O,I);return o=_.eastNorthUpToFixedFrame(e,i,o),p.multiply(o,s,o)};var w=new p,M=new E;_.headingPitchRollQuaternion=function(e,t,n,r,a,i){var o=_.headingPitchRollToFixedFrame(e,t,n,r,a,w),u=p.getRotation(o,M);return m.fromRotationMatrix(u,i)};var x=24110.54841,C=8640184.812866,P=.093104,D=-62e-7,L=1.1772758384668e-19,U=72921158553e-15,b=d.TWO_PI/86400,F=new h;_.computeTemeToPseudoFixedMatrix=function(e,t){F=h.addSeconds(e,-h.computeTaiMinusUtc(e),F);var n,r=F.dayNumber,a=F.secondsOfDay,o=r-2451545;n=a>=43200?(o+.5)/y.DAYS_PER_JULIAN_CENTURY:(o-.5)/y.DAYS_PER_JULIAN_CENTURY;var u=x+n*(C+n*(P+n*D)),s=u*b%d.TWO_PI,c=U+L*(r-2451545.5),l=(a+.5*y.SECONDS_PER_DAY)%y.SECONDS_PER_DAY,f=s+c*l,p=Math.cos(f),m=Math.sin(f);return i(t)?(t[0]=p,t[1]=-m,t[2]=0,t[3]=m,t[4]=p,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(p,m,0,-m,p,0,0,0,1)},_.iau2006XysData=new l,_.earthOrientationParameters=u.NONE;var z=32.184,B=2451545;_.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+z,a=t.stop.dayNumber,i=t.stop.secondsOfDay+z,o=_.iau2006XysData.preload(n,r,a,i),u=_.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},_.computeIcrfToFixedMatrix=function(e,t){i(t)||(t=new E);var n=_.computeFixedToIcrfMatrix(e,t);if(i(n))return E.transpose(n,t)};var G=new f(0,0,0),q=new s(0,0,0,0,0,0),W=new E,V=new E;_.computeFixedToIcrfMatrix=function(e,t){i(t)||(t=new E);var n=_.earthOrientationParameters.compute(e,q);if(i(n)){var r=e.dayNumber,a=e.secondsOfDay+z,o=_.iau2006XysData.computeXysRadians(r,a,G);if(i(o)){var u=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=W;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=E.fromRotationZ(-o.s,V),p=E.multiply(l,f,W),m=e.dayNumber,v=e.secondsOfDay-h.computeTaiMinusUtc(e)+n.ut1MinusUtc,T=m-2451545,R=v/y.SECONDS_PER_DAY,A=.779057273264+R+.00273781191135448*(T+R);A=A%1*d.TWO_PI;var S=E.fromRotationZ(A,V),g=E.multiply(p,S,W),N=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),I=Math.sin(n.xPoleWander),w=Math.sin(n.yPoleWander),M=r-B+a/y.SECONDS_PER_DAY;M/=36525;var x=-47e-6*M*d.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),D=V;return D[0]=N*C,D[1]=N*P,D[2]=I,D[3]=-O*P+w*I*C,D[4]=O*C+w*I*P,D[5]=-w*N,D[6]=-w*P-O*I*C,D[7]=w*C-O*I*P,D[8]=O*N,E.multiply(g,D,t)}}};var X=new r;_.pointToWindowCoordinates=function(e,t,n,r){return r=_.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},_.pointToGLWindowCoordinates=function(e,n,a,o){i(o)||(o=new t);var u=X;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,o)};var H=new n,Y=new n,k=new n;return _.rotationMatrixFromPositionVelocity=function(e,t,r,o){var u=a(r,c.WGS84).geodeticSurfaceNormal(e,H),s=n.cross(t,u,Y);n.equalsEpsilon(s,n.ZERO,d.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var l=n.cross(s,t,k);return n.cross(t,l,s),n.negate(s,s),i(o)||(o=new E),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=s.x,o[4]=s.y,o[5]=s.z,o[6]=l.x,o[7]=l.y,o[8]=l.z,o},_}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix3","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E){"use strict";function p(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(f.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(f.getColumn(r,1,m));var i=n.fromCartesian4(f.getColumn(r,2,m));this._plane=h.fromPointNormal(e,i)}var m=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 _=new d,v=new n;p.prototype.projectPointOntoPlane=function(e,r){var a=_;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,v);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,v)),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;r>a;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=_;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,v);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,v));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;n>r;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=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=T,l=0;r>l;++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/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";function n(t,n,a,i){return e(t,n,a,i,r),r.x>0&&r.y>0&&r.z>0}var r=new t;return n}),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,v=1+p-3*m/4+5*y/4-175*_/64,T=1-p+15*m/8-35*y/8,R=1-3*p+35*m/4,A=1-5*p,S=v*l-T*Math.sin(2*l)*p/2-R*Math.sin(4*l)*m/16-A*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=h,g.cosineSquaredAlpha=d,g.cosineAlpha=E,g.u2Over4=p,g.u4Over16=m,g.u6Over64=y,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,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),v=Math.sin(m),T=Math.cos(y),R=Math.sin(y),A=_*T,S=_*R,g=v*R,N=v*T,O=p,I=u.TWO_PI,w=Math.cos(O),M=Math.sin(O);do{w=Math.cos(O),M=Math.sin(O);var x=S-N*w;f=Math.sqrt(T*T*M*M+x*x),c=g+A*w,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=A*M/f,h=1-C*C),I=O,d=c-2*g/h,isNaN(d)&&(d=0),O=p+l(E,C,h,s,f,c,d)}while(Math.abs(O-I)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),D=1+P*(4096+P*(P*(320-175*P)-768))/16384,L=P*(256+P*(P*(74-47*P)-128))/1024,U=d*d,b=L*f*(d+L*(c*(2*U-1)-L*d*(4*f*f-3)*(4*U-3)/6)/4),F=n*D*(s-b),z=Math.atan2(T*M,S-N*w),B=Math.atan2(_*M,S*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,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,v=a.u4Over16,T=2*p*m*o/3+i*(1-y+7*v/4-15*_/4+579*m/64-(v-15*_/4+187*m/16)*o-(5*_/4-115*m/16)*u-29*m*s/16)+(y/2-v+71*_/32-85*m/16)*c+(5*v/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,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),O=a.cosineU*N,I=a.sineU*g,w=Math.atan2(g*a.sineHeading,O-I*a.cosineHeading),M=w-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,T,g,N,S);return r(n)?(n.longitude=this._start.longitude+M,n.latitude=A,n.height=0,n):new t(this._start.longitude+M,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=g;r.length=e;var a;if(t===n){for(a=0;e>a;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;e>a;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,M),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,N),p=a.cartesianToCartographic(l,O),m=h(f,i,o);x.setEndPoints(d,p);var y=x.surfaceDistance/f,_=s;d.height=i;var v=a.cartographicToCartesian(d,I);e.pack(v,u,_),_+=3;for(var T=1;f>T;T++){var R=x.interpolateUsingSurfaceDistance(T*y,O);R.height=m[T],v=a.cartographicToCartesian(R,I),e.pack(v,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;n>a;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,p).height}return r};var m=new l,y=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,O=new t,I=new e,w=new e,M=new e,x=new o;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,v),E=l.multiplyByPointAsVector(s,e.UNIT_X,T),p=f.fromPointNormal(c,E,R),g=1;i.push(e.clone(t[0]));for(var N=i[0],O=t.length,I=1;O>I;++I){var w=t[I];if(f.getPointDistance(p,N)<0||f.getPointDistance(p,w)<0){var M=u.lineSegmentPlane(N,w,d,A);if(r(M)){var x=e.multiplyByScalar(h,5e-9,S);f.getPointDistance(d,N)<0&&e.negate(x,x),i.push(e.add(M,x,new e)),o.push(g+1),e.negate(x,x),i.push(e.add(M,x,new e)),g=1}}i.push(e.clone(t[I])),g++,N=w}o.push(g)}return{positions:i,lengths:o}};var C=c.EPSILON10;return E.removeDuplicates=function(t){var n=t.length;if(2>n)return t;var r,a,i;for(r=1;n>r&&(a=t[r-1],i=t[r],!e.equalsEpsilon(a,i,C));++r);if(r===n)return t;for(var o=t.slice(0,r);n>r;++r)i=t[r],e.equalsEpsilon(a,i,C)||(o.push(e.clone(i)),a=i);return 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);if(1>o)return[];if(1===o){var f=u.scaleToGeodeticSurface(a[0],w);if(0!==l){var h=u.geodeticSurfaceNormal(f,I);e.multiplyByScalar(h,l,h),e.add(f,h,f)}return[f.x,f.y,f.z]}var p=t.minDistance;if(!r(p)){var m=n(t.granularity,c.RADIANS_PER_DEGREE);p=c.chordLength(m,u.maximumRadius)}var y,_=0;for(y=0;o-1>y;y++)_+=E.numberOfPoints(a[y],a[y+1],p);var v=3*(_+1),T=new Array(v),R=0,A=s(l);for(y=0;o-1>y;y++){var S=a[y],O=a[y+1],M=A?l[y]:l,x=A?l[y+1]:l;R=d(S,O,p,u,M,x,T,R)}g.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,N);P.height=A?l[o-1]:l;var D=u.cartographicToCartesian(P,I);return e.pack(D,T,v-3),T},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;r>i;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/Queue",["../Core/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(){return 0!==this._length?this._array[this._offset]:void 0},t.prototype.contains=function(e){return-1!==this._array.indexOf(e)},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/WindingOrder",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"use strict";var n={CLOCKWISE:e.CW,COUNTER_CLOCKWISE:e.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return t(n)}),define("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PolylinePipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,p){"use strict";function m(t,n,r){var a=e.subtract(n,t,b),i=e.subtract(r,n,F);return a.x*i.y-a.y*i.x>=0}function y(e){for(var t=e[0].x,n=0,r=0;r<e.length;r++)e[r].x>t&&(t=e[r].x,n=r);return n}function _(e){for(var t=e[0][0].x,n=0,r=0;r<e.length;r++){var a=e[r][y(e[r])].x;a>t&&(t=a,n=r)}return n}function v(e){for(var t=[],n=0;n<e.length;n++){var r=e[(n-1+e.length)%e.length],a=e[n],i=e[(n+1)%e.length];m(r,a,i)||t.push(a)}return t}function T(t,n){for(var r=0;r<t.length;r++)if(e.equals(n,t[r]))return r;return-1}function R(n,a,i){i=r(i,[]);var o=Number.MAX_VALUE,u=y(a),s=new e(a[u].x,n.y);i.push(u),i.push((u+1)%a.length);for(var c=a[0].x,l=c,f=1;f<a.length;++f)a[f].x<c?c=a[f].x:a[f].x>l&&(l=a[f].x);l+=l-c;var h=new t(l,n.y,0);for(f=0;f<a.length;f++){var d=a[f],E=a[(f+1)%a.length];if((d.x>=n.x||E.x>=n.x)&&(d.y>=n.y&&E.y<=n.y||d.y<=n.y&&E.y>=n.y)){var p=(E.y-d.y)*(h.x-n.x)-(E.x-d.x)*(h.y-n.y);if(0!==p){p=1/p;var m=((E.x-d.x)*(n.y-d.y)-(E.y-d.y)*(n.x-d.x))*p,_=((h.x-n.x)*(n.y-d.y)-(h.y-n.y)*(n.x-d.x))*p;if(m>=0&&1>=m&&_>=0&&1>=_){var v=new e(n.x+m*(h.x-n.x),n.y+m*(h.y-n.y)),T=e.subtract(v,n,z);p=e.magnitudeSquared(T),o>p&&(s=v,o=p,i[0]=f,i[1]=(f+1)%a.length)}}}}return s}function A(t,n){var r=_(n),a=n[r],i=y(a),o=a[i],u=[],s=R(o,t,u),c=T(t,s);if(-1!==c)return c;var h=e.magnitudeSquared(e.subtract(t[u[0]],o,B)),d=e.magnitudeSquared(e.subtract(t[u[1]],o,B)),E=d>h?t[u[0]]:t[u[1]],p=v(t),m=p.indexOf(E);-1!==m&&p.splice(m,1);for(var A=[],S=0;S<p.length;S++){var g=p[S];f(g,o,s,E)&&A.push(g)}var N=Number.MAX_VALUE;if(A.length>0){var O=e.fromElements(1,0,B);for(S=0;S<A.length;S++){var I=e.subtract(A[S],o,G),w=e.magnitude(O)*e.magnitudeSquared(I);if(0!==w){var M=Math.abs(l.acosClamped(e.dot(O,I)/w));N>M&&(N=M,E=A[S])}}}return t.indexOf(E)}function S(e,n,r){for(var a=ee.computeWindingOrder2D(e),i=0;i<n.length;i++){var o=n[i];t.equals(o[0],o[o.length-1])||o.push(o[0]);var s=ee.computeWindingOrder2D(o);s===a&&o.reverse()}var c=u.fromPoints(e,r),l=c.projectPointsOntoPlane(e),f=[];for(i=0;i<n.length;i++)f.push(c.projectPointsOntoPlane(n[i]));var h=A(l,f),d=_(f),E=y(f[d]),p=n[d],m=[];for(i=0;i<e.length;i++)m.push(e[i]);var v,T=[];if(0!==E)for(v=0;v<=p.length;v++){var R=(v+E)%p.length;0!==R&&T.push(p[R])}else for(v=0;v<p.length;v++)T.push(p[(v+E)%p.length]);var S=m.lastIndexOf(e[h]);T.push(e[S]);var g=m.slice(0,S+1),N=m.slice(S+1);return m=g.concat(T,N),n.splice(d,1),m}function g(e){var t=l.nextRandomNumber(),n=Math.floor(t*e);return n===e&&n--,n}function N(e,t,n,r){var a=r[e].position,i=r[t].position,o=r[n].position,u=o.x,s=o.y,c=a.x-u,l=a.y-s,f=i.x-u,h=i.y-s;return c*h-l*f}function O(e,t){return e.x*t.y-e.y*t.x}function I(e,t){var n=t.length,r=l.mod(e-1,n),a=l.mod(e+1,n);return 0===N(r,a,e,t)?!1:!0}function w(t,n){return e.magnitudeSquared(n)<e.magnitudeSquared(t)}function M(t,n,r){if(!I(t,r))return t;var a=r[t].position,i=r[n].position,o=r.length,u=l.mod(t-1,o);if(!I(u,r))return u;var s=l.mod(t+1,o);if(!I(s,r))return s;var c=e.subtract(r[u].position,a,V),f=e.subtract(r[s].position,a,X),h=e.subtract(i,a,H),d=O(c,h),E=O(f,h);if(0===d)return w(c,h)?q:W;if(0===E)return w(f,h)?q:W;var p=O(c,f);return 0>p?0>d&&E>0?q:W:p>0?d>0&&0>E?W:q:void 0}function x(e,t,n){return(e>t||e>n)&&(t>e||n>e)||t===n&&t===e}function C(t,n,r,a){var i=e.subtract(r,t,k),o=n.x*a.y-n.y*a.x,u=o*o,s=e.magnitudeSquared(n),c=e.magnitudeSquared(a);if(u>Y*s*c){var l=(i.x*a.y-i.y*a.x)/o;return e.add(t,e.multiplyByScalar(n,l,k),k)}}function P(t,n,r){for(var i=e.subtract(n,t,j),o=r.length,u=0;o>u;u++){var s=r[u].position,c=r[l.mod(u+1,o)].position;if(!(e.equals(t,s)||e.equals(n,c)||e.equals(t,c)||e.equals(n,s))){var f=e.subtract(c,s,Z),h=C(t,i,s,f);if(a(h)&&!(e.equals(h,t)||e.equals(h,n)||e.equals(h,s)||e.equals(h,c))){var d=h.x,E=h.y,p=x(d,t.x,n.x)&&x(E,t.y,n.y)&&x(d,s.x,c.x)&&x(E,s.y,c.y);if(p)return!0}}}return!1}function D(t,n,r){var a=M(t,n,r);if(a>=0)return a;var i=M(n,t,r);return i>=0?i:a!==q||i!==q||P(r[t].position,r[n].position,r)||e.equals(r[t].position,r[n].position)?J:K}function L(e){return 0===N(1,2,0,e)}function U(e){var t=e.length;if(3===t)return L(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new i("Invalid polygon: must have at least three vertices.");for(var n,r,a=0,o=10*e.length,u=J;K>u&&a++<o;){for(n=g(e.length),r=n+1;Math.abs(n-r)<2||Math.abs(n-r)>e.length-2;)r=g(e.length);if(n>r){var s=n;n=r,r=s}u=D(n,r,e)}if(u===K){var c=e.splice(n,r-n+1,e[n],e[r]);return U(e).concat(U(c))}return u>=0?(e.splice(u,1),U(e)):[]}var b=new e,F=new e,z=new e,B=new e(1,0),G=new e,q=-1,W=-2,V=new t,X=new t,H=new t,Y=l.EPSILON14,k=new e,j=new e,Z=new e,K=-1,J=-2,Q=new t,$=new t,ee={};ee.removeDuplicates=function(e){var n=h.removeDuplicates(e);return t.equals(n[0],n[n.length-1])?n.slice(1):n},ee.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;t>a;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},ee.computeWindingOrder2D=function(e){var t=ee.computeArea2D(e);return t>0?p.COUNTER_CLOCKWISE:p.CLOCKWISE},ee.triangulate=function(e){for(var t=e.length,n=[],r=0;t>r;++r)n[r]={position:e[r],index:r};return U(n)};var te=new t,ne=new t,re=new t,ae=new t,ie=new t,oe=new t,ue=new t;return ee.computeSubdivision=function(e,i,o,u){u=r(u,l.RADIANS_PER_DEGREE);var f,h=o.slice(0),E=i.length,p=new Array(3*E),m=0;for(f=0;E>f;f++){var y=i[f];p[m++]=y.x,p[m++]=y.y,p[m++]=y.z}for(var _=[],v={},T=e.maximumRadius,R=l.chordLength(u,T),A=R*R;h.length>0;){var S,g,N=h.pop(),O=h.pop(),I=h.pop(),w=t.fromArray(p,3*I,te),M=t.fromArray(p,3*O,ne),x=t.fromArray(p,3*N,re),C=t.multiplyByScalar(t.normalize(w,ae),T,ae),P=t.multiplyByScalar(t.normalize(M,ie),T,ie),D=t.multiplyByScalar(t.normalize(x,oe),T,oe),L=t.magnitudeSquared(t.subtract(C,P,ue)),U=t.magnitudeSquared(t.subtract(P,D,ue)),b=t.magnitudeSquared(t.subtract(D,C,ue)),F=Math.max(L,U,b);F>A?L===F?(S=Math.min(I,O)+" "+Math.max(I,O),f=v[S],a(f)||(g=t.add(w,M,ue),t.multiplyByScalar(g,.5,g),p.push(g.x,g.y,g.z),f=p.length/3-1,v[S]=f),h.push(I,f,N),h.push(f,O,N)):U===F?(S=Math.min(O,N)+" "+Math.max(O,N),f=v[S],a(f)||(g=t.add(M,x,ue),t.multiplyByScalar(g,.5,g),p.push(g.x,g.y,g.z),f=p.length/3-1,v[S]=f),h.push(O,f,I),h.push(f,N,I)):b===F&&(S=Math.min(N,I)+" "+Math.max(N,I),f=v[S],a(f)||(g=t.add(x,w,ue),t.multiplyByScalar(g,.5,g),p.push(g.x,g.y,g.z),f=p.length/3-1,v[S]=f),h.push(N,f,O),h.push(f,I,O)):(_.push(I),_.push(O),_.push(N))}return new s({attributes:{position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:p})},indices:_,primitiveType:d.TRIANGLES})},ee.scaleToGeodeticHeight=function(e,n,i,u){i=r(i,o.WGS84);var s=Q,c=$;if(n=r(n,0),u=r(u,!0),a(e)&&a(e.attributes)&&a(e.attributes.position))for(var l=e.attributes.position.values,f=l.length,h=0;f>h;h+=3)t.fromArray(l,h,c),u&&(c=i.scaleToGeodeticSurface(c,c)),0!==n&&(s=i.geodeticSurfaceNormal(c,s),t.multiplyByScalar(s,n,s),t.add(c,s,c)),l[h]=c.x,l[h+1]=c.y,l[h+2]=c.z;return e},ee.eliminateHoles=function(e,n,a){a=r(a,o.WGS84);for(var i=[],u=0;u<n.length;u++){for(var s=[],c=0;c<n[u].length;c++)s.push(t.clone(n[u][c]));i.push(s)}for(var l=e;i.length>0;)l=S(l,i,a);return l},ee}),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;c>i;i++)l[i]=n;return l.push(r),l}var f=r-n,h=f/c;for(i=1;c>i;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 p(e,n,r,a,i,o,c,l){var h=B,d=G;U=f.eastNorthUpToFixedFrame(e,i,U),h=s.multiplyByPointAsVector(U,L,h),h=t.normalize(h,h);var p=E(h,n,e,i);F=u.fromRotationZ(p,F),q.z=o,U=s.multiplyTransformation(U,s.fromRotationTranslation(F,q,b),U);var m=z;m[0]=c;for(var y=0;l>y;y++)for(var _=0;_<r.length;_+=3)d=t.fromArray(r,_,d),d=u.multiplyByVector(m,d,d),d=s.multiplyByPoint(U,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;n>s;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;n>u;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,E){var m,y=t.angleBetween(t.subtract(n,e,x),t.subtract(r,e,C)),_=i===a.BEVELED?0:Math.ceil(y/o.toRadians(5));m=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,x),y/(_+1),V),H):u.fromQuaternion(l.fromAxisAngle(e,y/(_+1),V),H);var v,T;if(n=t.clone(n,X),_>0)for(var R=E?2:1,A=0;_>A;A++)n=u.multiplyByVector(m,n,n),v=t.subtract(n,e,x),v=t.normalize(v,v),s||(v=t.negate(v,v)),T=c.scaleToGeodeticSurface(n,C),f=p(T,v,h,f,c,d,1,R);else v=t.subtract(n,e,x),v=t.normalize(v,v),s||(v=t.negate(v,v)),T=c.scaleToGeodeticSurface(n,C),f=p(T,v,h,f,c,d,1,1),r=t.clone(r,X),v=t.subtract(r,e,x),v=t.normalize(v,v),s||(v=t.negate(v,v)),T=c.scaleToGeodeticSurface(r,C),f=p(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,O=new t,I=new t,w=new t,M=new t,x=new t,C=new t,P={},D=new r,L=new t(-1,0,0),U=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;n>i;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 j=new t,Z=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,L=r.height/2,U=r.width/2,b=e.length,F=[],z=u?[]:void 0,B=R,G=A,q=S,W=g,V=N,X=O,H=I,Y=w,k=M,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=p(K,Y,D,z,s,Q+L,1,1)),k=t.clone(K,k),K=J,G=t.negate(B,G);for(var ee,te,ne=1;b-1>ne;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),j);t.subtract(B,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),Z);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*U,q),V),X=t.add(V,t.multiplyByScalar(Y,U,X),X),T[0]=t.clone(k,T[0]),T[1]=t.clone(X,T[1]),ee=d(T,Q+L,$+L,f),te=c.generateArc({positions:T,granularity:f,ellipsoid:s}),F=m(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,U,H),H),E===a.ROUNDED||E===a.BEVELED?v(V,X,H,E,se,s,F,C,$+L,u):(q=t.negate(q,q),F=p(K,q,C,F,s,$+L,ue,re)),k=t.clone(H,k)):(V=t.add(K,t.multiplyByScalar(q,ue*U,q),V),X=t.add(V,t.multiplyByScalar(Y,-U,X),X),T[0]=t.clone(k,T[0]),T[1]=t.clone(X,T[1]),ee=d(T,Q+L,$+L,f),te=c.generateArc({positions:T,granularity:f,ellipsoid:s}),F=m(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,-U,H),H),E===a.ROUNDED||E===a.BEVELED?v(V,X,H,E,se,s,F,C,$+L,u):F=p(K,q,C,F,s,$+L,ue,re),k=t.clone(H,k)),G=t.negate(B,G)}else F=p(k,Y,C,F,s,Q+L,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+L,$+L,f),te=c.generateArc({positions:T,granularity:f,ellipsoid:s}),F=m(te,Y,C,F,s,ee,1),u&&(z=p(K,Y,D,z,s,$+L,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){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},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){return t(e)?(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):void 0},a}),define("Core/PolylineVolumeGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./VertexFormat","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,p,m,y,_,v,T,R){"use strict";function A(e,n,r,i){var o=new h;i.position&&(o.position=new f({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:e}));var u,s,c,p,y,_,T=n.length,R=e.length/3,A=(R-2*T)/(2*T),S=m.triangulate(n),g=(A-1)*T*6+2*S.length,N=E.createTypedArray(R,g),O=2*T,I=0;for(u=0;A-1>u;u++){for(s=0;T-1>s;s++)c=2*s+u*T*2,_=c+O,p=c+1,y=p+O,N[I++]=p,N[I++]=c,N[I++]=y,N[I++]=y,N[I++]=c,N[I++]=_;c=2*T-2+u*T*2,p=c+1,y=p+O,_=c+O,N[I++]=p,N[I++]=c,N[I++]=y,N[I++]=y,N[I++]=c,N[I++]=_}if(i.st||i.tangent||i.binormal){var w,M,x=new Float32Array(2*R),C=1/(A-1),P=1/r.height,D=r.height/2,L=0;for(u=0;A>u;u++){for(w=u*C,M=P*(n[0].y+D),x[L++]=w,x[L++]=M,s=1;T>s;s++)M=P*(n[s].y+D),x[L++]=w,x[L++]=M,x[L++]=w,x[L++]=M;M=P*(n[0].y+D),x[L++]=w,x[L++]=M}for(s=0;T>s;s++)w=0,M=P*(n[s].y+D),x[L++]=w,x[L++]=M;for(s=0;T>s;s++)w=(A-1)*C,M=P*(n[s].y+D),x[L++]=w,x[L++]=M;o.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:new Float32Array(x)})}var U=R-2*T;for(u=0;u<S.length;u+=3){var b=S[u]+U,F=S[u+1]+U,z=S[u+2]+U;N[I++]=b,N[I++]=F,N[I++]=z,N[I++]=z+T,N[I++]=F+T,N[I++]=b+T}var B=new l({attributes:o,indices:N,boundingSphere:t.fromVertices(e),primitiveType:v.TRIANGLES});return i.normal&&(B=d.computeNormal(B)),(i.tangent||i.binormal)&&(B=d.computeBinormalAndTangent(B),i.tangent||(B.attributes.tangent=void 0),i.binormal||(B.attributes.binormal=void 0),i.st||(B.attributes.st=void 0)),B}function S(e){e=o(e,o.EMPTY_OBJECT);var t=e.polylinePositions,a=e.shapePositions;this._positions=t,this._shape=a,this._ellipsoid=c.clone(o(e.ellipsoid,c.WGS84)),this._cornerType=o(e.cornerType,i.ROUNDED),this._vertexFormat=T.clone(o(e.vertexFormat,T.DEFAULT)),this._granularity=o(e.granularity,p.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";var u=1+t.length*r.packedLength;u+=1+a.length*n.packedLength,this.packedLength=u+c.packedLength+T.packedLength+2}S.pack=function(e,t,a){a=o(a,0);var i,u=e._positions,s=u.length;for(t[a++]=s,i=0;s>i;++i,a+=r.packedLength)r.pack(u[i],t,a);var l=e._shape;for(s=l.length,t[a++]=s,i=0;s>i;++i,a+=n.packedLength)n.pack(l[i],t,a);c.pack(e._ellipsoid,t,a),a+=c.packedLength,T.pack(e._vertexFormat,t,a),a+=T.packedLength,t[a++]=e._cornerType,t[a]=e._granularity};var g=c.clone(c.UNIT_SPHERE),N=new T,O={polylinePositions:void 0,shapePositions:void 0,ellipsoid:g,vertexFormat:N,cornerType:void 0,granularity:void 0};S.unpack=function(e,t,a){t=o(t,0);var i,s=e[t++],l=new Array(s);for(i=0;s>i;++i,t+=r.packedLength)l[i]=r.unpack(e,t);s=e[t++];var f=new Array(s);for(i=0;s>i;++i,t+=n.packedLength)f[i]=n.unpack(e,t);var h=c.unpack(e,t,g);t+=c.packedLength;var d=T.unpack(e,t,N);t+=T.packedLength;var E=e[t++],p=e[t];return u(a)?(a._positions=l,a._shape=f,a._ellipsoid=c.clone(h,a._ellipsoid),a._vertexFormat=T.clone(d,a._vertexFormat),a._cornerType=E,a._granularity=p,a):(O.polylinePositions=l,O.shapePositions=f,O.cornerType=E,O.granularity=p,new S(O))};var I=new e;return S.createGeometry=function(t){var n=t._positions,r=y.removeDuplicates(n),a=t._shape;if(a=_.removeDuplicatesFromShape(a),!(r.length<2||a.length<3)){m.computeWindingOrder2D(a)===R.CLOCKWISE&&a.reverse();var i=e.fromPoints(a,I),o=_.computePositions(r,a,i,t,!0);return A(o,a,i,t._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/Workers/createPolylineVolumeOutlineGeometry.js b/Workers/createPolylineVolumeOutlineGeometry.js index 4e1a87b..dbe9817 100644 --- a/Workers/createPolylineVolumeOutlineGeometry.js +++ b/Workers/createPolylineVolumeOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,8 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(n){t=n.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:0>e?-1:0},n.signNotZero=function(e){return 0>e?-1:1},n.toSNorm=function(e){return Math.round(255*(.5*n.clamp(e,-1,1)+.5))},n.fromSNorm=function(e){return 2*(n.clamp(e,0,255)/255)-1},n.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},n.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},n.lerp=function(e,t,n){return(1-n)*e+n*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=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){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,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},n.negativePiToPi=function(e){for(var t=n.EPSILON10,r=n.PI,a=n.TWO_PI;-(r+t)>e;)e+=a;if(-r>e)return-r;for(;e>r+t;)e-=a;return e>r?r:e},n.zeroToTwoPi=function(e){var t=e%n.TWO_PI;return 0>t?(t+n.TWO_PI)%n.TWO_PI:t},n.equalsEpsilon=function(e,n,r){return r=t(r,0),Math.abs(e-n)<=r};var r=[1];n.factorial=function(e){var t=r.length;if(e>=t)for(var n=r[t-1],a=t;e>=a;a++)r.push(n*a);return r[e]},n.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(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,n){return t>e?t:e>n?n: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}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i=function(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)};i.fromSpherical=function(n,r){t(r)||(r=new i);var a=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(o),r},i.fromElements=function(e,n,r,a){return t(a)?(a.x=e,a.y=n,a.z=r,a):new i(e,n,r)},i.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(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},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},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 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){i.normalize(e,s),i.normalize(t,c);var n=i.dot(s,c),r=i.magnitude(i.cross(s,c,s));return Math.atan2(r,n)};var l=new i;i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):n.y<=n.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,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},i.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r&&Math.abs(e.z-n.z)<=r},i.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},i.fromDegrees=function(e,t,n,r,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,n,r,o)};var f=new i,h=new i,d=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(n,r,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=i.normalize(f,f),i.multiplyComponents(s,f,h);var l=Math.sqrt(i.dot(f,h));return h=i.divideByScalar(h,l,h),f=i.multiplyByScalar(f,a,f),t(u)||(u=new i),i.add(h,f,u)},i.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=a.toRadians(e[o]);return i.fromRadiansArray(r,t,n)},i.fromRadiansArray=function(e,n,r){var a=e.length;t(r)?r.length=a/2:r=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=i.fromRadians(u,s,0,n,r[o/2])}return r},i.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=a.toRadians(e[o]),r[o+1]=a.toRadians(e[o+1]),r[o+2]=e[o+2];return i.fromRadiansArrayHeights(r,t,n)},i.fromRadiansArrayHeights=function(e,n,r){var a=e.length;t(r)?r.length=a/3:r=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=i.fromRadians(u,s,c,n,r[o/3])}return r},i.ZERO=r(new i(0,0,0)),i.UNIT_X=r(new i(1,0,0)),i.UNIT_Y=r(new i(0,1,0)),i.UNIT_Z=r(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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i=function(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)};return i.fromRadians=function(n,r,a,o){return a=e(a,0),t(o)?(o.longitude=n,o.latitude=r,o.height=a,o):new i(n,r,a)},i.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),i.fromRadians(e,t,n,r)},i.clone=function(e,n){return t(e)?t(n)?(n.longitude=e.longitude,n.latitude=e.latitude,n.height=e.height,n):new i(e.longitude,e.latitude,e.height):void 0},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.longitude===n.longitude&&e.latitude===n.latitude&&e.height===n.height},i.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.longitude-n.longitude)<=r&&Math.abs(e.latitude-n.latitude)<=r&&Math.abs(e.height-n.height)<=r},i.ZERO=r(new i(0,0,0)),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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},i}),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"],function(e,t,n,r,a,i,o,u){"use strict";function s(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}var c=function(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,s(this,e,t,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(t,n){if(!r(t))return void 0;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 c(a.x,a.y,a.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.prototype.geocentricSurfaceNormal=e.normalize,c.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)},c.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,f=new e;c.prototype.cartographicToCartesian=function(t,n){var a=l,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)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;n>a;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,d=new e,m=new e;c.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,d);if(!r(i))return void 0;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)},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;n>a;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t};var y=new e,p=new e;return c.prototype.scaleToGeodeticSurface=function(t,n){var a=t.x,i=t.y,o=t.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,h=a*a*c*c,d=i*i*l*l,m=o*o*f*f,v=h+d+m,g=Math.sqrt(1/v),w=e.multiplyByScalar(t,g,y);if(v<this._centerToleranceSquared)return isFinite(g)?e.clone(w,n):void 0;var x=this._oneOverRadiiSquared,E=x.x,S=x.y,M=x.z,O=p;O.x=2*w.x*E,O.y=2*w.y*S,O.z=2*w.z*M;var _,T,P,C,R,N,z,I,b,A,D,q=(1-g)*e.magnitude(t)/(.5*e.magnitude(O)),U=0;do{q-=U,P=1/(1+q*E),C=1/(1+q*S),R=1/(1+q*M),N=P*P,z=C*C,I=R*R,b=N*P,A=z*C,D=I*R,_=h*N+d*z+m*I-1,T=h*b*E+d*A*S+m*D*M;var L=-2*T;U=_/L}while(Math.abs(_)>u.EPSILON12);return r(n)?(n.x=a*P,n.y=i*C,n.z=o*R,n):new e(a*P,i*C,o*R)},c.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)},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}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i=function(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){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},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.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.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.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.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r},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){return i.equalsEpsilon(this,e,t)},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";var u=function(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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o){"use strict";var u=function(e,n,r,a){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(a,0)};u.fromDegrees=function(e,r,a,i,s){return e=o.toRadians(t(e,0)),r=o.toRadians(t(r,0)),a=o.toRadians(t(a,0)),i=o.toRadians(t(i,0)),n(s)?(s.west=e,s.south=r,s.east=a,s.north=i,s):new u(e,r,a,i)},u.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=e.length;c>s;s++){var l=e[s];r=Math.min(r,l.longitude),a=Math.max(a,l.longitude),i=Math.min(i,l.latitude),o=Math.max(o,l.latitude)}return n(t)?(t.west=r,t.south=i,t.east=a,t.north=o,t):new u(r,i,a,o)},u.packedLength=4,u.pack=function(e,n,r){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},u.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new u),a.west=e[r++],a.south=e[r++],a.east=e[r++],a.north=e[r],a},u.clone=function(e,t){return n(e)?n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.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},u.validate=function(){},u.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)},u.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)},u.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)},u.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)},u.center=function(t,r){var a=t.east,i=t.west,u=.5*(i+a);return i>a&&(u=o.negativePiToPi(u+o.PI)),n(r)?(r.longitude=u,r.latitude=.5*(t.south+t.north),r.height=0,r):new e(u,.5*(t.south+t.north))},u.intersectWith=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),s=Math.min(e.north,t.north);return n(r)?(r.west=a,r.south=i,r.east=o,r.north=s,r):new u(a,i,o,s)},u.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},u.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var s=new e;return u.subsample=function(e,r,i,u){r=t(r,a.WGS84),i=t(i,0),n(u)||(u=[]);var c=0,l=e.north,f=e.south,h=e.east,d=e.west,m=s;m.height=i,m.longitude=d,m.latitude=l,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:f>0?f:0;for(var y=1;8>y;++y){var p=-Math.PI+y*o.PI_OVER_TWO;p>d&&h>p&&(m.longitude=p,u[c]=r.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=i(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./defaultValue","./defined","./DeveloperError","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,n,r,a,i,o,u){"use strict";var s=function(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.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;n>c;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){return r(e)?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):void 0},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:0>r&&(n.width-=r,n.x=t.x),a>n.height?n.height=a:0>a&&(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";var t=function(t,n){this.start=e(t,0),this.stop=e(n,0)};return t}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";var a=function(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,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){return t(e)?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):void 0},a.packedLength=4,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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 i=new a;a.distance=function(e,t){return a.subtract(e,t,i),a.magnitude(i)},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.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 o=new a;a.lerp=function(e,t,n,r){return a.multiplyByScalar(t,n,o),r=a.multiplyByScalar(e,1-n,r),a.add(o,r,r)};var u=new a;return a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,u);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.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r&&Math.abs(e.z-n.z)<=r&&Math.abs(e.w-n.w)<=r},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){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function u(e){for(var t=0,n=0;3>n;++n){var r=e[c.getElementIndex(d[n],h[n])];t+=2*r*r}return Math.sqrt(t)}function s(e,t){for(var n=i.EPSILON15,r=0,a=1,o=0;3>o;++o){var u=Math.abs(e[c.getElementIndex(d[o],h[o])]);u>r&&(a=o,r=u)}var s=1,l=0,f=h[a],m=d[a];if(Math.abs(e[c.getElementIndex(m,f)])>n){var y,p=e[c.getElementIndex(m,m)],v=e[c.getElementIndex(f,f)],g=e[c.getElementIndex(m,f)],w=(p-v)/2/g;y=0>w?-1/(-w+Math.sqrt(1+w*w)):1/(w+Math.sqrt(1+w*w)),s=1/Math.sqrt(1+y*y),l=y*s}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(f,f)]=t[c.getElementIndex(m,m)]=s,t[c.getElementIndex(m,f)]=l,t[c.getElementIndex(f,m)]=-l,t}var c=function(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)};c.clone=function(e,t){return n(e)?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 c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new c),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},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var 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,s=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,m=r-u-f+d,y=2*(a-h),p=2*(i+l),v=2*(a+h),g=-r+u-f+d,w=2*(s-o),x=2*(i-l),E=2*(s+o),S=-r-u+f+d;return n(t)?(t[0]=m,t[1]=v,t[2]=x,t[3]=y,t[4]=g,t[5]=E,t[6]=p,t[7]=w,t[8]=S,t):new c(m,y,p,v,g,w,x,E,S)},c.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 c(e.x,0,0,0,e.y,0,0,0,e.z)},c.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 c(e,0,0,0,e,0,0,0,e)},c.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 c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.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 c(1,0,0,0,r,-a,0,a,r)},c.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 c(r,0,a,0,1,0,-a,0,r)},c.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 c(r,-a,0,a,r,0,0,0,1)},c.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]]},c.getElementIndex=function(e,t){return 3*e+t},c.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},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},c.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},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,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[3],t[4],t[5],l)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),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]*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},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},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},c.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},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},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},c.transpose=function(e,t){var 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],d=[2,2,1],m=new c,y=new c;return c.computeEigenDecomposition=function(e,t){var r=i.EPSILON20,a=10,l=0,f=0; -n(t)||(t={});for(var h=t.unitary=c.clone(c.IDENTITY,t.unitary),d=t.diagonal=c.clone(e,t.diagonal),p=r*o(d);a>f&&u(d)>p;)s(d,m),c.transpose(m,y),c.multiply(d,m,d),c.multiply(y,d,d),c.multiply(h,m,h),++l>2&&(++f,l=0);return t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},c.determinant=function(e){var t=e[0],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)},c.inverse=function(e,t){var n=e[0],a=e[1],o=e[2],u=e[3],s=e[4],l=e[5],f=e[6],h=e[7],d=e[8],m=c.determinant(e);if(Math.abs(m)<=i.EPSILON15)throw new r("matrix is not invertible");t[0]=s*d-h*l,t[1]=h*o-a*d,t[2]=a*l-s*o,t[3]=f*l-u*d,t[4]=n*d-f*o,t[5]=u*o-n*l,t[6]=u*h-f*s,t[7]=f*a-n*h,t[8]=n*s-u*a;var y=1/m;return c.multiplyByScalar(t,y,t)},c.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]},c.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},c.IDENTITY=a(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(n){t=n.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s){"use strict";var c=function(e,t,r,a,i,o,u,s,c,l,f,h,d,m,y,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(m,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(y,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(p,0)};c.packedLength=16,c.pack=function(e,t,r){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]},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),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},c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[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]):void 0},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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new c);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,l=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,m=t.y*t.z,y=t.y*t.w,p=t.z*t.z,v=t.z*t.w,g=t.w*t.w,w=s-d-p+g,x=2*(l-v),E=2*(f+y),S=2*(l+v),M=-s+d-p+g,O=2*(m-h),_=2*(f-y),T=2*(m+h),P=-s-d+p+g;return a[0]=w*i,a[1]=S*i,a[2]=_*i,a[3]=0,a[4]=x*o,a[5]=M*o,a[6]=T*o,a[7]=0,a[8]=E*u,a[9]=O*u,a[10]=P*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.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 l=new e,f=new e,h=new e;c.fromCamera=function(t,n){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,m=l.x,y=l.y,p=l.z,v=h.x,g=h.y,w=h.z,x=a.x,E=a.y,S=a.z,M=u*-x+s*-E+d*-S,O=v*-x+g*-E+w*-S,_=m*x+y*E+p*S;return r(n)?(n[0]=u,n[1]=v,n[2]=-m,n[3]=0,n[4]=s,n[5]=g,n[6]=-y,n[7]=0,n[8]=d,n[9]=w,n[10]=-p,n[11]=0,n[12]=M,n[13]=O,n[14]=_,n[15]=1,n):new c(u,s,d,M,v,g,w,O,-m,-y,-p,_,0,0,0,1)},c.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},c.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},c.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},c.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},c.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,m=f,y=i+c,p=o+l,v=t+f,g=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]=m,a[11]=0,a[12]=y,a[13]=p,a[14]=v,a[15]=g,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,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},c.setColumn=function(e,t,n,r){r=c.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},c.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},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 d=new e;c.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;c.getMaximumScale=function(t){return c.getScale(t,m),e.maximumComponent(m)},c.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],m=e[11],y=e[12],p=e[13],v=e[14],g=e[15],w=t[0],x=t[1],E=t[2],S=t[3],M=t[4],O=t[5],_=t[6],T=t[7],P=t[8],C=t[9],R=t[10],N=t[11],z=t[12],I=t[13],b=t[14],A=t[15],D=r*w+u*x+f*E+y*S,q=a*w+s*x+h*E+p*S,U=i*w+c*x+d*E+v*S,L=o*w+l*x+m*E+g*S,B=r*M+u*O+f*_+y*T,W=a*M+s*O+h*_+p*T,F=i*M+c*O+d*_+v*T,G=o*M+l*O+m*_+g*T,j=r*P+u*C+f*R+y*N,V=a*P+s*C+h*R+p*N,Y=i*P+c*C+d*R+v*N,k=o*P+l*C+m*R+g*N,H=r*z+u*I+f*b+y*A,X=a*z+s*I+h*b+p*A,Z=i*z+c*I+d*b+v*A,J=o*z+l*I+m*b+g*A;return n[0]=D,n[1]=q,n[2]=U,n[3]=L,n[4]=B,n[5]=W,n[6]=F,n[7]=G,n[8]=j,n[9]=V,n[10]=Y,n[11]=k,n[12]=H,n[13]=X,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],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],m=e[14],y=t[0],p=t[1],v=t[2],g=t[4],w=t[5],x=t[6],E=t[8],S=t[9],M=t[10],O=t[12],_=t[13],T=t[14],P=r*y+o*p+c*v,C=a*y+u*p+l*v,R=i*y+s*p+f*v,N=r*g+o*w+c*x,z=a*g+u*w+l*x,I=i*g+s*w+f*x,b=r*E+o*S+c*M,A=a*E+u*S+l*M,D=i*E+s*S+f*M,q=r*O+o*_+c*T+h,U=a*O+u*_+l*T+d,L=i*O+s*_+f*T+m;return n[0]=P,n[1]=C,n[2]=R,n[3]=0,n[4]=N,n[5]=z,n[6]=I,n[7]=0,n[8]=b,n[9]=A,n[10]=D,n[11]=0,n[12]=q,n[13]=U,n[14]=L,n[15]=1,n},c.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;c.multiplyByUniformScale=function(e,t,n){return y.x=t,y.y=t,y.z=t,c.multiplyByScale(e,y,n)},c.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?c.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)},c.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},c.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},c.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},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],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},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[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]},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 p=new u,v=new u,g=new t,w=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,p),v,o.EPSILON7)&&t.equals(c.getRow(e,3,g),w))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],l=e[12],f=e[1],h=e[5],d=e[9],m=e[13],y=e[2],x=e[6],E=e[10],S=e[14],M=e[3],O=e[7],_=e[11],T=e[15],P=E*T,C=S*_,R=x*T,N=S*O,z=x*_,I=E*O,b=y*T,A=S*M,D=y*_,q=E*M,U=y*O,L=x*M,B=P*h+N*d+z*m-(C*h+R*d+I*m),W=C*f+b*d+q*m-(P*f+A*d+D*m),F=R*f+A*h+U*m-(N*f+b*h+L*m),G=I*f+D*h+L*d-(z*f+q*h+U*d),j=C*a+R*i+I*l-(P*a+N*i+z*l),V=P*r+A*i+D*l-(C*r+b*i+q*l),Y=N*r+b*a+L*l-(R*r+A*a+U*l),k=z*r+q*a+U*i-(I*r+D*a+L*i);P=i*m,C=l*d,R=a*m,N=l*h,z=a*d,I=i*h,b=r*m,A=l*f,D=r*d,q=i*f,U=r*h,L=a*f;var H=P*O+N*_+z*T-(C*O+R*_+I*T),X=C*M+b*_+q*T-(P*M+A*_+D*T),Z=R*M+A*O+U*T-(N*M+b*O+L*T),J=I*M+D*O+L*_-(z*M+q*O+U*_),K=R*E+I*S+C*x-(z*S+P*x+N*E),Q=D*S+P*y+A*E-(b*E+q*S+C*y),$=b*x+L*S+N*y-(U*S+R*y+A*x),et=U*E+z*y+q*x-(D*x+L*E+I*y),tt=r*B+a*W+i*F+l*G;if(Math.abs(tt)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return tt=1/tt,n[0]=B*tt,n[1]=W*tt,n[2]=F*tt,n[3]=G*tt,n[4]=j*tt,n[5]=V*tt,n[6]=Y*tt,n[7]=k*tt,n[8]=H*tt,n[9]=X*tt,n[10]=Z*tt,n[11]=J*tt,n[12]=K*tt,n[13]=Q*tt,n[14]=$*tt,n[15]=et*tt,n},c.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],m=-n*f-r*h-a*d,y=-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]=m,t[13]=y,t[14]=p,t[15]=1,t},c.IDENTITY=i(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[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/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";var f=function(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)},h=new e,d=new e,m=new e,y=new e,p=new e,v=new e,g=new e,w=new e,x=new e,E=new e,S=new e,M=new e;f.fromPoints=function(t,n){if(r(n)||(n=new f),!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],g),i=e.clone(a,h),o=e.clone(a,d),u=e.clone(a,m),s=e.clone(a,y),c=e.clone(a,p),l=e.clone(a,v),O=t.length,_=1;O>_;_++){e.clone(t[_],a);var T=a.x,P=a.y,C=a.z;T<i.x&&e.clone(a,i),T>s.x&&e.clone(a,s),P<o.y&&e.clone(a,o),P>c.y&&e.clone(a,c),C<u.z&&e.clone(a,u),C>l.z&&e.clone(a,l)}var R=e.magnitudeSquared(e.subtract(s,i,w)),N=e.magnitudeSquared(e.subtract(c,o,w)),z=e.magnitudeSquared(e.subtract(l,u,w)),I=i,b=s,A=R;N>A&&(A=N,I=o,b=c),z>A&&(A=z,I=u,b=l);var D=x;D.x=.5*(I.x+b.x),D.y=.5*(I.y+b.y),D.z=.5*(I.z+b.z);var q=e.magnitudeSquared(e.subtract(b,D,w)),U=Math.sqrt(q),L=E;L.x=i.x,L.y=o.y,L.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var W=e.multiplyByScalar(e.add(L,B,w),.5,M),F=0;for(_=0;O>_;_++){e.clone(t[_],a);var G=e.magnitude(e.subtract(a,W,w));G>F&&(F=G);var j=e.magnitudeSquared(e.subtract(a,D,w));if(j>q){var V=Math.sqrt(j);U=.5*(U+V),q=U*U;var Y=V-U;D.x=(U*D.x+Y*a.x)/V,D.y=(U*D.y+Y*a.y)/V,D.z=(U*D.z+Y*a.z)/V}}return F>U?(e.clone(D,n.center),n.radius=U):(e.clone(W,n.center),n.radius=F),n};var O=new o,_=new e,T=new e,P=new t,C=new t;f.fromRectangle2D=function(e,t,n){return f.fromRectangleWithHeights2D(e,t,0,0,n)},f.fromRectangleWithHeights2D=function(t,a,i,o,u){if(r(u)||(u=new f),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=n(a,O),l.southwest(t,P),P.height=i,l.northeast(t,C),C.height=o;var s=a.project(P,_),c=a.project(C,T),h=c.x-s.x,d=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(h*h+d*d+m*m);var y=u.center;return y.x=s.x+.5*h,y.y=s.y+.5*d,y.z=s.z+.5*m,u};var R=[];f.fromRectangle3D=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0);var u;return r(e)&&(u=l.subsample(e,t,a,R)),f.fromPoints(u,o)},f.fromVertices=function(t,a,i,o){if(r(o)||(o=new f),!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=g;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,m),O=e.clone(u,y),_=e.clone(u,p),T=e.clone(u,v),P=t.length,C=0;P>C;C+=i){var R=t[C]+a.x,N=t[C+1]+a.y,z=t[C+2]+a.z;u.x=R,u.y=N,u.z=z,R<s.x&&e.clone(u,s),R>O.x&&e.clone(u,O),N<c.y&&e.clone(u,c),N>_.y&&e.clone(u,_),z<l.z&&e.clone(u,l),z>T.z&&e.clone(u,T)}var I=e.magnitudeSquared(e.subtract(O,s,w)),b=e.magnitudeSquared(e.subtract(_,c,w)),A=e.magnitudeSquared(e.subtract(T,l,w)),D=s,q=O,U=I;b>U&&(U=b,D=c,q=_),A>U&&(U=A,D=l,q=T);var L=x;L.x=.5*(D.x+q.x),L.y=.5*(D.y+q.y),L.z=.5*(D.z+q.z);var B=e.magnitudeSquared(e.subtract(q,L,w)),W=Math.sqrt(B),F=E;F.x=s.x,F.y=c.y,F.z=l.z;var G=S;G.x=O.x,G.y=_.y,G.z=T.z;var j=e.multiplyByScalar(e.add(F,G,w),.5,M),V=0;for(C=0;P>C;C+=i){u.x=t[C]+a.x,u.y=t[C+1]+a.y,u.z=t[C+2]+a.z;var Y=e.magnitude(e.subtract(u,j,w));Y>V&&(V=Y);var k=e.magnitudeSquared(e.subtract(u,L,w));if(k>B){var H=Math.sqrt(k);W=.5*(W+H),B=W*W;var X=H-W;L.x=(W*L.x+X*u.x)/H,L.y=(W*L.y+X*u.y)/H,L.z=(W*L.z+X*u.z)/H}}return V>W?(e.clone(L,o.center),o.radius=W):(e.clone(j,o.center),o.radius=V),o},f.fromCornerPoints=function(t,n,a){r(a)||(a=new f);var i=a.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,n),a},f.fromEllipsoid=function(t,n){return r(n)||(n=new f),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n},f.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new f(t.center,t.radius):void 0},f.packedLength=4,f.pack=function(e,t,r){r=n(r,0);var a=e.center;t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius},f.unpack=function(e,t,a){t=n(t,0),r(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 N=new e,z=new e;f.union=function(t,n,a){r(a)||(a=new f);var i=t.center,o=n.center;e.add(i,o,z);var u=e.multiplyByScalar(z,.5,z),s=e.magnitude(e.subtract(i,u,N))+t.radius,c=e.magnitude(e.subtract(o,u,N))+n.radius;return a.radius=Math.max(s,c),e.clone(u,a.center),a};var I=new e;f.expand=function(t,n,r){r=f.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,I));return a>r.radius&&(r.radius=a),r},f.intersect=function(t,n){var r=t.center,a=t.radius,i=e.dot(n,r)+n.w;return-a>i?u.OUTSIDE:a>i?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.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 r(n)||(n=new f),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var A=new e;f.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,A),u=e.multiplyByScalar(a,e.dot(a,o),A),c=e.magnitude(u);return i.start=c-t.radius,i.stop=c+t.radius,i};for(var D=new e,q=new e,U=new e,L=new e,B=new e,W=new t,F=new Array(8),G=0;8>G;++G)F[G]=new e;var j=new o;return f.projectTo2D=function(t,r,a){r=n(r,j);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,D),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,U);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var h=e.negate(l,B),d=e.negate(c,L),m=F,y=m[0];e.add(s,l,y),e.add(y,c,y),y=m[1],e.add(s,l,y),e.add(y,d,y),y=m[2],e.add(s,h,y),e.add(y,d,y),y=m[3],e.add(s,h,y),e.add(y,c,y),e.negate(s,s),y=m[4],e.add(s,l,y),e.add(y,c,y),y=m[5],e.add(s,l,y),e.add(y,d,y),y=m[6],e.add(s,h,y),e.add(y,d,y),y=m[7],e.add(s,h,y),e.add(y,c,y);for(var p=m.length,v=0;p>v;++v){var g=m[v];e.add(o,g,g);var w=i.cartesianToCartographic(g,W);r.project(w,g)}a=f.fromPoints(m,a),o=a.center;var x=o.x,E=o.y,S=o.z;return o.x=S,o.y=x,o.z=E,a},f.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},f.prototype.intersect=function(e){return f.intersect(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var 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(){return a.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?r.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(r.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e){a.supportsFullscreen()&&e[r.requestFullscreen]()},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;r>n;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(m)){m=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(m=!0,y=r(e[1]))}return m}function i(){return a()&&y}function o(){if(!t(p)&&(p=!1,!a()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(p=!0,v=r(e[1]))}return p}function u(){return o()&&v}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(g=!0,w=r(e[1]),w.isNightly=!!e[2])}return g}function c(){return s()&&w}function l(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=r(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=r(e[1])))}return x}function f(){return l()&&E}function h(){if(!t(S)){S=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function d(){return h()&&M}var m,y,p,v,g,w,x,E,S,M,O={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:d,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};return O.supportsFullscreen=function(){return n.supportsFullscreen()},O.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},O.supportsWebWorkers=function(){return"undefined"!=typeof Worker},O}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,a){"use strict";if(!r.supportsTypedArrays())return{};var i={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},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 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.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.FLOAT:return new Float32Array(t);case i.DOUBLE:return new Float64Array(t);default:throw new n("componentDatatype is not a valid value.")}},i.createArrayBufferView=function(t,r,a,o){switch(a=e(a,0),o=e(o,(r.byteLength-a)/i.getSizeInBytes(t)),t){case i.BYTE:return new Int8Array(r,a,o);case i.UNSIGNED_BYTE:return new Uint8Array(r,a,o);case i.SHORT:return new Int16Array(r,a,o);case i.UNSIGNED_SHORT:return new Uint16Array(r,a,o);case i.FLOAT:return new Float32Array(r,a,o);case i.DOUBLE:return new Float64Array(r,a,o);default:throw new n("componentDatatype is not a valid value.")}},a(i)}),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"],function(e){"use strict";var t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===t.POINTS||e===t.LINES||e===t.LINE_LOOP||e===t.LINE_STRIP||e===t.TRIANGLES||e===t.TRIANGLE_STRIP||e===t.TRIANGLE_FAN}};return e(t)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";var i=function(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)};return i.computeNumberOfVertices=function(e){var r=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(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"],function(e,t,n,r){"use strict";var a={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,a){return e>r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(a)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";var i=function(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;f>h;h++){var d=t[h],m=d.x,y=d.y,p=d.z;a=Math.min(m,a),s=Math.max(m,s),o=Math.min(y,o),c=Math.max(y,c),u=Math.min(p,u),l=Math.max(p,l)}var v=r.minimum;v.x=a,v.y=o,v.z=u;var g=r.maximum;g.x=s,g.y=c,g.z=l;var w=e.add(v,g,r.center);return e.multiplyByScalar(w,.5,w),r},i.clone=function(t,r){return n(t)?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):void 0},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.intersect=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=r.x*Math.abs(n.x)+r.y*Math.abs(n.y)+r.z*Math.abs(n.z),u=e.dot(t.center,n)+n.w;return u-i>0?a.INSIDE:0>u+i?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersect=function(e){return i.intersect(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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,0>i?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(0>f)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,m=o*s-h,y=o*c-u*s,p=u*c-d,v=4*m*p-y*y;if(0>v){var g,w,x;h*f>=l*d?(g=o,w=m,x=-2*u*m+o*y):(g=c,w=p,x=-c*y+2*s*p);var E=0>x?-1:1,S=-E*Math.abs(g)*Math.sqrt(-v);i=-x+S;var M=i/2,O=0>M?-Math.pow(-M,1/3):Math.pow(M,1/3),_=i===S?-O:-w/O;return a=0>=w?O+_:-x/(O*O+_*_+w),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var T=m,P=-2*u*m+o*y,C=p,R=-c*y+2*s*p,N=Math.sqrt(v),z=Math.sqrt(3)/2,I=Math.abs(Math.atan2(o*N,-P)/3);a=2*Math.sqrt(-T);var b=Math.cos(I);i=a*b;var A=a*(-b/2-z*Math.sin(I)),D=i+A>2*u?i-u:A-u,q=o,U=D/q;I=Math.abs(Math.atan2(c*N,-R)/3),a=2*Math.sqrt(-C),b=Math.cos(I),i=a*b,A=a*(-b/2-z*Math.sin(I));var L=-c,B=2*s>i+A?i+s:A+s,W=L/B,F=q*B,G=-D*B-q*L,j=D*L,V=(s*G-u*j)/(-u*G+s*F);return V>=U?W>=U?W>=V?[U,V,W]:[U,W,V]:[W,U,V]:W>=U?[V,U,W]:W>=V?[V,W,U]:[W,V,U]}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=0>u?-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,0>u?[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 m=r.computeRealRoots(1,s,l);if(2===m.length){var y,p=m[0],v=m[1];if(p>=0&&v>=0){var g=Math.sqrt(p),w=Math.sqrt(v);return[h-w,h-g,h+g,h+w]}if(p>=0&&0>v)return y=Math.sqrt(p),[h-y,h+y];if(0>p&&v>=0)return y=Math.sqrt(v),[h-y,h+y]}return[]}if(d>0){var x=Math.sqrt(d),E=(s+d-c/x)/2,S=(s+d+c/x)/2,M=r.computeRealRoots(1,x,E),O=r.computeRealRoots(1,-x,S);return 0!==M.length?(M[0]+=h,M[1]+=h,0!==O.length?(O[0]+=h,O[1]+=h,M[1]<=O[0]?[M[0],M[1],O[0],O[1]]:O[1]<=M[0]?[O[0],O[1],M[0],M[1]]:M[0]>=O[0]&&M[1]<=O[1]?[O[0],M[0],M[1],O[1]]:O[0]>=M[0]&&O[1]<=M[1]?[M[0],O[0],O[1],M[1]]:M[0]>O[0]&&M[0]<O[1]?[O[0],M[0],O[1],M[1]]:[M[0],O[0],M[1],O[1]]):M):0!==O.length?(O[0]+=h,O[1]+=h,O):[]}}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 m,y,p=d[0],v=a-p,g=v*v,w=t/2,x=v/2,E=g-4*o,S=g+4*Math.abs(o),M=c-4*p,O=c+4*Math.abs(p);if(0>p||M*S>E*O){var _=Math.sqrt(M);m=_/2,y=0===_?0:(t*x-i)/_}else{var T=Math.sqrt(E);m=0===T?0:(t*x-i)/T,y=T/2}var P,C;0===w&&0===m?(P=0,C=0):n.sign(w)===n.sign(m)?(P=w+m,C=p/P):(C=w-m,P=p/C);var R,N;0===x&&0===y?(R=0,N=0):n.sign(x)===n.sign(y)?(R=x+y,N=o/R):(N=x-y,R=o/N);var z=r.computeRealRoots(1,P,R),I=r.computeRealRoots(1,C,N);if(0!==z.length)return 0!==I.length?z[1]<=I[0]?[z[0],z[1],I[0],I[1]]:I[1]<=z[0]?[I[0],I[1],z[0],z[1]]:z[0]>=I[0]&&z[1]<=I[1]?[I[0],z[0],z[1],I[1]]:I[0]>=z[0]&&I[1]<=z[1]?[z[0],I[0],I[1],z[1]]:z[0]>I[0]&&z[0]<I[1]?[I[0],z[0],I[1],z[1]]:[z[0],I[0],z[1],I[1]]:z;if(0!==I.length)return I}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,m=d*a,y=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*m+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 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=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>f?d+1:d,d+=0>h?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 void 0}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r=function(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 r.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},r}),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(t,r,a,o,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,m=t.direction,y=e.subtract(a,r,p),E=e.subtract(o,r,v),S=e.cross(m,E,g),M=e.dot(y,S);if(u){if(M<i.EPSILON6)return void 0;if(s=e.subtract(d,r,w),l=e.dot(s,S),0>l||l>M)return void 0;if(c=e.cross(s,y,x),f=e.dot(m,c),0>f||l+f>M)return void 0;h=e.dot(E,c)/M}else{if(Math.abs(M)<i.EPSILON6)return void 0;var O=1/M;if(s=e.subtract(d,r,w),l=e.dot(s,S)*O,0>l||l>1)return void 0;if(c=e.cross(s,y,x),f=e.dot(m,c)*O,0>f||l+f>1)return void 0;h=e.dot(E,c)*O}return h}function f(e,t,n,r){var a=t*t-4*e*n;if(0>a)return void 0;if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);return 0===c?void 0:(r.root0=r.root1=c,r)}function h(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,g),l=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,m=f(l,h,d,S);return r(m)?(a.start=m.root0,a.stop=m.root1,a):void 0}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 m(t,n,r,a,c){var l,f=a*a,h=c*c,m=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,y=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,v=h*d(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),g=c*(a*d(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),w=[];if(0===g&&0===v){if(l=u.computeRealRoots(m,y,p),0===l.length)return w;var x=l[0],E=Math.sqrt(Math.max(1-x*x,0));if(w.push(new e(a,c*x,c*-E)),w.push(new e(a,c*x,c*E)),2===l.length){var S=l[1],M=Math.sqrt(Math.max(1-S*S,0));w.push(new e(a,c*S,c*-M)),w.push(new e(a,c*S,c*M))}return w}var O=g*g,_=v*v,T=m*m,P=g*v,C=T+_,R=2*(y*m+P),N=2*p*m+y*y-_+O,z=2*(p*y-P),I=p*p-O;if(0===C&&0===R&&0===N&&0===z)return w;l=s.computeRealRoots(C,R,N,z,I);var b=l.length;if(0===b)return w;for(var A=0;b>A;++A){var D,q=l[A],U=q*q,L=Math.max(1-U,0),B=Math.sqrt(L);D=i.sign(m)===i.sign(p)?d(m*U+p,y*q,i.EPSILON12):i.sign(p)===i.sign(y*q)?d(m*U,y*q+p,i.EPSILON12):d(m*U+y*q,p,i.EPSILON12);var W=d(v*q,g,i.EPSILON15),F=D*W;0>F?w.push(new e(a,c*q,c*B)):F>0?w.push(new e(a,c*q,c*-B)):0!==B?(w.push(new e(a,c*q,c*-B)),w.push(new e(a,c*q,c*B)),++A):w.push(new e(a,c*q,c*B))}return w}var y={};y.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)return void 0;var l=(-n.distance-e.dot(s,o))/c;return 0>l?void 0:(a=e.multiplyByScalar(u,l,a),e.add(o,a,a))};var p=new e,v=new e,g=new e,w=new e,x=new e;y.rayTriangle=function(t,n,a,i,o,u){var s=l(t,n,a,i,o);return!r(s)||0>s?void 0:(r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u))};var E=new c;y.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=E;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var f=l(c,a,i,o,u);return!r(f)||0>f||f>e.distance(t,n)?void 0:(r(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var S={root0:0,root1:0};y.raySphere=function(e,t,n){return n=h(e,t,n),!r(n)||n.stop<0?void 0:(n.start=Math.max(n.start,0),n)};var M=new c;y.lineSegmentSphere=function(t,n,a,i){var o=M;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=h(o,a,i),!r(i)||i.stop<0||i.start>s?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i)};var O=new e,_=new e;y.rayEllipsoid=function(t,n){var r,a,i,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,O),l=e.multiplyComponents(s,t.direction,_),f=e.magnitudeSquared(c),h=e.dot(c,l);if(f>1){if(h>=0)return void 0;var d=h*h;if(r=f-1,a=e.magnitudeSquared(l),i=a*r,i>d)return void 0;if(d>i){o=h*h-i,u=-h+Math.sqrt(o);var m=u/a,y=r/u;return y>m?{start:m,stop:y}:{start:y,stop:m}}var p=Math.sqrt(r/a);return{start:p,stop:p}}return 1>f?(r=f-1,a=e.magnitudeSquared(l),i=a*r,o=h*h-i,u=-h+Math.sqrt(o),{start:0,stop:u/a}):0>h?(a=e.magnitudeSquared(l),{start:0,stop:-h/a}):void 0};var T=new e,P=new e,C=new e,R=new e,N=new e,z=new o,I=new o,b=new o,A=new o,D=new o,q=new o,U=new o,L=new e,B=new e,W=new t;y.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction,s=n.geodeticSurfaceNormal(a);if(e.dot(u,s)>=0)return a;var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u),f=e.normalize(l,T),h=e.mostOrthogonalAxis(l,R),d=e.normalize(e.cross(h,f,P),P),y=e.normalize(e.cross(f,d,C),C),p=z;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]=y.x,p[7]=y.y,p[8]=y.z;var v=o.transpose(p,I),g=o.fromScale(n.radii,b),w=o.fromScale(n.oneOverRadii,A),x=D;x[0]=0,x[1]=-u.z,x[2]=u.y,x[3]=u.z,x[4]=0,x[5]=-u.x,x[6]=-u.y,x[7]=u.x,x[8]=0;var E,S,M=o.multiply(o.multiply(v,w,q),x,q),O=o.multiply(o.multiply(M,g,U),p,U),_=o.multiplyByVector(M,a,N),F=m(O,e.negate(_,T),0,0,1),G=F.length;if(G>0){for(var j=e.clone(e.ZERO,B),V=Number.NEGATIVE_INFINITY,Y=0;G>Y;++Y){E=o.multiplyByVector(g,o.multiplyByVector(p,F[Y],L),L);var k=e.normalize(e.subtract(E,a,R),R),H=e.dot(k,u);H>V&&(V=H,j=e.clone(E,j))}var X=n.cartesianToCartographic(j,W);return V=i.clamp(V,0,1),S=e.magnitude(e.subtract(j,a,R))*Math.sqrt(1-V*V),S=c?-S:S,X.height=S,n.cartographicToCartesian(X)}return void 0};var F=new e;return y.lineSegmentPlane=function(t,n,a,o){r(o)||(o=new e);var u=e.subtract(n,t,F),s=a.normal,c=e.dot(s,u);if(Math.abs(c)<i.EPSILON6)return void 0;var l=e.dot(s,t),f=-(a.distance+l)/c;return 0>f||f>1?void 0:(e.multiplyByScalar(u,f,o),e.add(t,o,o),o)},y.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 y.lineSegmentPlane(t,n,a,f),y.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return y.lineSegmentPlane(n,r,a,f),y.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return y.lineSegmentPlane(r,t,a,f),y.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 y.lineSegmentPlane(n,t,a,f),y.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return y.lineSegmentPlane(r,n,a,f),y.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return y.lineSegmentPlane(t,r,a,f),y.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},y}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var n=function(t,n){this.normal=e.clone(t),this.distance=n};return n.fromPointNormal=function(r,a,i){var o=-e.dot(a,r);return t(i)?(e.clone(a,i.normal),i.distance=o,i):new n(a,o)},n.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},n}),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(r){return i(r)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(a){return i(a)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return m(e)}function a(e){return m(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,m;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(t){r.progress(t)}}: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 y(f,e),e},m=function(e){return e=t(e),h=e.then,m=t,d=v,y(l,e),f=l=E,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){y(e)}function s(e){m(e)}var c,l,f,h,d,m,y,p,g,w;if(g=t.length>>>0,c=Math.max(0,Math.min(n,g)),f=[],l=g-c+1,h=[],d=o(),c)for(p=d.progress,y=function(e){h.push(e),--l||(m=y=v,d.reject(h))},m=function(e){f.push(e),--c||(m=y=v,d.resolve(f))},w=0;g>w;++w)w in t&&e(t[w],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,g).then(t,n,r)}function f(){return h(arguments,g)}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;a>s;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=x.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)})})},w.apply(t,r)})}function m(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 y(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 v(){}function g(e){return e}var w,x,E;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=m,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(E,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(E,t)})})}},x=[].slice,w=[].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(;a>i;++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(){"use strict";var e=function(e,t,n){for(var r,a,i=0,o=e.length-1;o>=i;)if(r=~~((i+o)/2),a=n(e[r],t),0>a)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)};return e}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";var e=function(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,m,y,p,v;if("%%"==e)return"%";for(var g=!1,w="",x=!1,E=!1,S=" ",M=s.length,O=0;s&&M>O;O++)switch(s.charAt(O)){case" ":w=" ";break;case"+":w="+";break;case"-":g=!0;break;case"'":S=s.charAt(O+1);break;case"0":x=!0;break;case"#":E=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(c=-c,g=!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,v=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(v),g,c,f,x,S);case"c":return u(String.fromCharCode(+v),g,c,f,x);case"b":return o(v,2,E,g,c,f,x);case"o":return o(v,8,E,g,c,f,x);case"x":return o(v,16,E,g,c,f,x);case"X":return o(v,16,E,g,c,f,x).toUpperCase();case"u":return o(v,10,E,g,c,f,x);case"i":case"d":return d=+v||0,d=Math.round(d-d%1),m=0>d?"-":w,v=m+a(String(Math.abs(d)),f,"0",!1),i(v,m,g,c,x);case"e":case"E":case"f":case"F":case"g":case"G":return d=+v,m=0>d?"-":w,y=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],v=m+Math.abs(d)[y](f),i(v,m,g,c,x)[p]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";var e=function(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(){"use strict";function e(e){return 0===e%4&&0!==e%100||0===e%400}return e}),define("Core/LeapSecond",[],function(){"use strict";var e=function(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 R.compare(e.julianDate,t.julianDate)}function f(e){g.julianDate=e;var n=R.leapSeconds,r=t(n,g,l);0>r&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=R.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}R.addSeconds(e,a,e)}function h(e,n){g.julianDate=e;var r=R.leapSeconds,a=t(r,g,l);if(0>a&&(a=~a),0===a)return R.addSeconds(e,-r[0].offset,n);if(a>=r.length)return R.addSeconds(e,-r[a-1].offset,n);var i=R.secondsDifference(r[a].julianDate,e);return 0===i?R.addSeconds(e,-r[a].offset,n):1>=i?void 0:R.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=0|t/s.SECONDS_PER_DAY;return e+=r,t-=s.SECONDS_PER_DAY*r,0>t&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function m(e,t,n,r,a,i,o){var u=0|(t-14)/12,c=e+4800+u,l=(0|1461*c/4)+(0|367*(t-2-12*u)/12)-(0|3*((c+100)/100)/4)+n-32075;r-=12,0>r&&(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]}var y=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,g=new u,w=/^(\d{4})$/,x=/^(\d{4})-(\d{2})$/,E=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,M=/^(\d{4})-?(\d{2})-?(\d{2})$/,O=/([Z+\-])?(\d{2})?:?(\d{2})?$/,_=/^(\d{2})(\.\d+)?/.source+O.source,T=/^(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,P=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,C="Invalid ISO 8601 date.",R=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)};R.fromDate=function(e,t){var n=m(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 R(n[0],n[1],c.UTC)},R.fromIso8601=function(e,t){e=e.replace(",",".");var n,i,u,s=e.split("T"),l=1,h=1,y=0,g=0,O=0,N=0,z=s[0],I=s[1];if(!r(z))throw new a(C);var b;if(s=z.match(M),null!==s){if(b=z.split("-").length-1,b>0&&2!==b)throw new a(C);n=+s[1],l=+s[2],h=+s[3]}else if(s=z.match(x),null!==s)n=+s[1],l=+s[2];else if(s=z.match(w),null!==s)n=+s[1];else{var A;if(s=z.match(E),null!==s){if(n=+s[1],A=+s[2],u=o(n),1>A||u&&A>366||!u&&A>365)throw new a(C)}else{if(s=z.match(S),null===s)throw new a(C);n=+s[1];var D=+s[2],q=+s[3]||0;if(b=z.split("-").length-1,b>0&&(!r(s[3])&&1!==b||r(s[3])&&2!==b))throw new a(C);var U=new Date(Date.UTC(n,0,4));A=7*D+q-U.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(A),l=i.getUTCMonth()+1,h=i.getUTCDate()}if(u=o(n),1>l||l>12||1>h||(2!==l||!u)&&h>p[l-1]||u&&2===l&&h>v)throw new a(C);var L;if(r(I)){if(s=I.match(P),null!==s){if(b=I.split(":").length-1,b>0&&2!==b&&3!==b)throw new a(C);y=+s[1],g=+s[2],O=+s[3],N=1e3*+(s[4]||0),L=5}else if(s=I.match(T),null!==s){if(b=I.split(":").length-1,b>0&&1!==b)throw new a(C);y=+s[1],g=+s[2],O=60*+(s[3]||0),L=4}else{if(s=I.match(_),null===s)throw new a(C);y=+s[1],g=60*+(s[2]||0),L=3}if(g>=60||O>=61||y>24||24===y&&(g>0||O>0||N>0))throw new a(C);var B=s[L],W=+s[L+1],F=+(s[L+2]||0);switch(B){case"+":y-=W,g-=F;break;case"-":y+=W,g+=F;break;case"Z":break;default:g+=new Date(Date.UTC(n,l-1,h,y,g)).getTimezoneOffset()}}else g+=new Date(Date.UTC(n,l-1,h)).getTimezoneOffset();var G=60===O;for(G&&O--;g>=60;)g-=60,y++;for(;y>=24;)y-=24,h++;for(i=u&&2===l?v:p[l-1];h>i;)h-=i,l++,l>12&&(l-=12,n++),i=u&&2===l?v:p[l-1];for(;0>g;)g+=60,y--;for(;0>y;)y+=24,h--;for(;1>h;)l--,1>l&&(l+=12,n--),i=u&&2===l?v:p[l-1],h+=i;var j=m(n,l,h,y,g,O,N);return r(t)?(d(j[0],j[1],t),f(t)):t=new R(j[0],j[1],c.UTC),G&&R.addSeconds(t,1,t),t},R.now=function(e){return R.fromDate(new Date,e)};var N=new R(0,0,c.TAI);return R.toGregorianDate=function(e,t){var n=!1,a=h(e,N);r(a)||(R.addSeconds(e,-1,N),a=h(N,N),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=0|o+68569,l=0|4*c/146097;c=0|c-(0|(146097*l+3)/4);var f=0|4e3*(c+1)/1461001;c=0|c-(0|1461*f/4)+31;var d=0|80*c/2447,m=0|c-(0|2447*d/80);c=0|d/11;var y=0|d+2-12*c,p=0|100*(l-49)+f+c,v=0|u/s.SECONDS_PER_HOUR,g=u-v*s.SECONDS_PER_HOUR,w=0|g/s.SECONDS_PER_MINUTE;g-=w*s.SECONDS_PER_MINUTE;var x=0|g,E=(g-x)/s.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),n&&(x+=1),r(t)?(t.year=p,t.month=y,t.day=m,t.hour=v,t.minute=w,t.second=x,t.millisecond=E,t.isLeapSecond=n,t):new i(p,y,m,v,w,x,E,n)},R.toDate=function(e){var t=R.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))},R.toIso8601=function(t,n){var a,i=R.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))},R.clone=function(e,t){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new R(e.dayNumber,e.secondsOfDay,c.TAI):void 0},R.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},R.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},R.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(R.secondsDifference(e,t))<=n},R.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},R.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},R.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},R.computeTaiMinusUtc=function(e){g.julianDate=e;var n=R.leapSeconds,r=t(n,g,l);return 0>r&&(r=~r,--r,0>r&&(r=0)),n[r].offset},R.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},R.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},R.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},R.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},R.lessThan=function(e,t){return R.compare(e,t)<0},R.lessThanOrEquals=function(e,t){return R.compare(e,t)<=0},R.greaterThan=function(e,t){return R.compare(e,t)>0},R.greaterThanOrEquals=function(e,t){return R.compare(e,t)>=0},R.prototype.clone=function(e){return R.clone(this,e)},R.prototype.equals=function(e){return R.equals(this,e)},R.prototype.equalsEpsilon=function(e,t){return R.equalsEpsilon(this,e,t)},R.prototype.toString=function(){return R.toIso8601(this)},R.leapSeconds=[new u(new R(2441317,43210,c.TAI),10),new u(new R(2441499,43211,c.TAI),11),new u(new R(2441683,43212,c.TAI),12),new u(new R(2442048,43213,c.TAI),13),new u(new R(2442413,43214,c.TAI),14),new u(new R(2442778,43215,c.TAI),15),new u(new R(2443144,43216,c.TAI),16),new u(new R(2443509,43217,c.TAI),17),new u(new R(2443874,43218,c.TAI),18),new u(new R(2444239,43219,c.TAI),19),new u(new R(2444786,43220,c.TAI),20),new u(new R(2445151,43221,c.TAI),21),new u(new R(2445516,43222,c.TAI),22),new u(new R(2446247,43223,c.TAI),23),new u(new R(2447161,43224,c.TAI),24),new u(new R(2447892,43225,c.TAI),25),new u(new R(2448257,43226,c.TAI),26),new u(new R(2448804,43227,c.TAI),27),new u(new R(2449169,43228,c.TAI),28),new u(new R(2449534,43229,c.TAI),29),new u(new R(2450083,43230,c.TAI),30),new u(new R(2450630,43231,c.TAI),31),new u(new R(2451179,43232,c.TAI),32),new u(new R(2453736,43233,c.TAI),33),new u(new R(2454832,43234,c.TAI),34),new u(new R(2456109,43235,c.TAI),35)],R}),define("Core/clone",["./defaultValue"],function(e){"use strict";var t=function(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";var e=function(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";var n=function(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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,n,r,a,i){"use strict";function o(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function u(e,t){for(var n=o(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 s(e,n){n=t(n,"");var a=e[1],i=!!e[2],s=e[3];switch(n){case"":case"text":return o(i,s);case"arraybuffer":return u(i,s);case"blob":var c=u(i,s);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(o(i,s),a);case"json":return JSON.parse(o(i,s));default:throw new r("Unhandled responseType: "+n)}}var c=function(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,u=n.overrideMimeType,s=n.withCredentials;return e(n.url,function(t){var n=e.defer();return c.load(t,r,a,i,o,n,u,s),n.promise})},l=/^data:(.*?)(;base64)?,(.*)$/;return c.load=function(e,t,r,o,u,c,f,h){var d=l.exec(e);if(null!==d)return c.resolve(s(d,t)),void 0;var m=new XMLHttpRequest;if(n(f)&&n(m.overrideMimeType)&&m.overrideMimeType(f),m.open(r,e,!0),n(u))for(var y in u)u.hasOwnProperty(y)&&m.setRequestHeader(y,u[y]);n(t)&&(m.responseType=t),n(h)&&(m.withCredentials=h),m.onload=function(){200===m.status?n(m.response)?c.resolve(m.response):n(m.responseXML)&&m.responseXML.hasChildNodes()?c.resolve(m.responseXML):n(m.responseText)?c.resolve(m.responseText):c.reject(new i("unknown XMLHttpRequest response type.")):c.reject(new a(m.status,m.response,m.getAllResponseHeaders()))},m.onerror=function(){c.reject(new a)},m.send(o)},c.defaultLoad=c.load,c}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";var n=function(n,r){return e({url:n,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})};return n}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";var a={Accept:"application/json,*/*;q=0.01"},i=function(n,i){return t(i)||(i={}),t(i.headers)?t(i.headers.Accept)||(i.headers=e(i.headers),i.headers.Accept=a.Accept):i.headers=a,r(n,i).then(function(e){return JSON.parse(e)})};return i}),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(e,t){return o.compare(e.julianDate,t)}function d(e,n){if(!r(n.columnNames))return e._dataError="Error in loaded EOP data: The columnNames property is required.",void 0;if(!r(n.samples))return e._dataError="Error in loaded EOP data: The samples property is required.",void 0;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"),m=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),y=n.columnNames.indexOf("taiMinusUtcSeconds");if(0>a||0>i||0>s||0>c||0>d||0>m||0>y)return e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns",void 0;var p=e._samples=n.samples,v=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=m,e._taiMinusUtcSecondsColumn=y,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var g,w=e._addNewLeapSeconds,x=0,E=p.length;E>x;x+=e._columnCount){var S=p[x+a],M=p[x+y],O=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,_=new o(O,M,f.TAI);if(v.push(_),w){if(M!==g&&r(g)){var T=o.leapSeconds,P=t(T,_,h);if(0>P){var C=new u(_,M);T.splice(~P,0,C)}}g=M}}}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 y(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,d=i*s,p=n[h+e._ut1MinusUtcSecondsColumn],v=n[d+e._ut1MinusUtcSecondsColumn],g=v-p;if(g>.5||-.5>g){var w=n[h+e._taiMinusUtcSecondsColumn],x=n[d+e._taiMinusUtcSecondsColumn]; -w!==x&&(l.equals(r)?p=v:v-=x-w)}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,v),u}var v=function(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:[]})};return v.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}}),v.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},v.prototype.compute=function(e,n){if(!r(this._samples)){if(r(this._dataError))throw new c(this._dataError);return void 0}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),m=!r(h),y=m||o.greaterThanOrEquals(h,e);if(d&&y)return s=u,!m&&h.equals(e)&&++s,l=s+1,p(this,i,this._samples,e,s,l,n),n}var v=t(i,e,o.compare,this._dateColumn);return v>=0?(v<i.length-1&&i[v+1].equals(e)&&++v,s=v,l=v):(l=~v,s=l-1,0>s&&(s=0)),this._lastIndex=s,p(this,i,this._samples,e,s,l,n),n},v}),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()):(n.path=t.authority&&""==t.path?"/"+this.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];for(r&&t.shift(),""==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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","require"],function(e,t,n,r){"use strict";function a(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),a=f.exec(r);if(null!==a)return a[1]}return void 0}function i(){if(t(s))return s;var r;if(r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:a(),!t(r))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return s=new e(r).resolve(new e(document.location.href))}function o(e){return r.toUrl("../"+e)}function u(t){return new e(t).resolve(i()).toString()}var s,c,l,f=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i,h=function(e){t(c)||(c=t(r.toUrl)?o:u),t(l)||(l=document.createElement("a"));var n=c(e);return l.href=n,l.href=l.href,l.href};return h._cesiumScriptRegex=f,h}),define("Core/Iau2006XysSample",[],function(){"use strict";var e=function(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,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function c(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=3*a*n._samplesPerXysFile,u=0,s=r.length;s>u;++u)t[o+u]=r[u];i.resolve()}),i.promise}var l=function(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;t>=s;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;t>=c;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)},f=new i(0,0,u.TAI);return l.prototype.preload=function(t,n,r,a){var i=s(this,t,n),o=s(this,r,a),u=0|i/this._stepSizeDays-this._interpolationOrder/2;0>u&&(u=0);var l=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var f=0|u/this._samplesPerXysFile,h=0|l/this._samplesPerXysFile,d=[],m=f;h>=m;++m)d.push(c(this,m));return e.all(d)},l.prototype.computeXysRadians=function(e,t,n){var i=s(this,e,t);if(0>i)return void 0;var o=0|i/this._stepSizeDays;if(o>=this._totalSamples)return void 0;var u=this._interpolationOrder,l=o-(0|u/2);0>l&&(l=0);var f=l+u;f>=this._totalSamples&&(f=this._totalSamples-1,l=f-u,0>l&&(l=0));var h=!1,d=this._samples;if(r(d[3*l])||(c(this,0|l/this._samplesPerXysFile),h=!0),r(d[3*f])||(c(this,0|f/this._samplesPerXysFile),h=!0),h)return void 0;r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var m,y,p=i-l*this._stepSizeDays,v=this._work,g=this._denominators,w=this._coef,x=this._xTable;for(m=0;u>=m;++m)v[m]=p-x[m];for(m=0;u>=m;++m){for(w[m]=1,y=0;u>=y;++y)y!==m&&(w[m]*=v[y]);w[m]*=g[m];var E=3*(l+m);n.x+=w[m]*d[E++],n.y+=w[m]*d[E++],n.s+=w[m]*d[E]}return n},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,m,y,p){"use strict";var v={},g=new n,w=new n,x=new n;v.eastNorthUpToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=g,s=w,l=x;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.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,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var E=new n,S=new n,M=new n;v.northEastDownToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=-o,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]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=E,s=S,l=M;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.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(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},v.northUpEastToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=o,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(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=g,s=w,l=x;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(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 y(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 O=24110.54841,_=8640184.812866,T=.093104,P=-62e-7,C=1.1772758384668e-19,R=72921158553e-15,N=d.TWO_PI/86400,z=new h;v.computeTemeToPseudoFixedMatrix=function(e,t){z=h.addSeconds(e,-h.computeTaiMinusUtc(e),z);var n,r=z.dayNumber,a=z.secondsOfDay,o=r-2451545;n=a>=43200?(o+.5)/p.DAYS_PER_JULIAN_CENTURY:(o-.5)/p.DAYS_PER_JULIAN_CENTURY;var u=O+n*(_+n*(T+n*P)),s=u*N%d.TWO_PI,c=R+C*(r-2451545.5),l=(a+.5*p.SECONDS_PER_DAY)%p.SECONDS_PER_DAY,f=s+c*l,y=Math.cos(f),v=Math.sin(f);return i(t)?(t[0]=y,t[1]=-v,t[2]=0,t[3]=v,t[4]=y,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(y,v,0,-v,y,0,0,0,1)},v.iau2006XysData=new l,v.earthOrientationParameters=u.NONE;var I=32.184,b=2451545;v.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+I,a=t.stop.dayNumber,i=t.stop.secondsOfDay+I,o=v.iau2006XysData.preload(n,r,a,i),u=v.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},v.computeIcrfToFixedMatrix=function(e,t){i(t)||(t=new m);var n=v.computeFixedToIcrfMatrix(e,t);return i(n)?m.transpose(n,t):void 0};var A=new f(0,0,0),D=new s(0,0,0,0,0,0),q=new m,U=new m;v.computeFixedToIcrfMatrix=function(e,t){i(t)||(t=new m);var n=v.earthOrientationParameters.compute(e,D);if(!i(n))return void 0;var r=e.dayNumber,a=e.secondsOfDay+I,o=v.iau2006XysData.computeXysRadians(r,a,A);if(!i(o))return void 0;var u=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=q;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(-o.s,U),y=m.multiply(l,f,q),g=e.dayNumber,w=e.secondsOfDay-h.computeTaiMinusUtc(e)+n.ut1MinusUtc,x=g-2451545,E=w/p.SECONDS_PER_DAY,S=.779057273264+E+.00273781191135448*(x+E);S=S%1*d.TWO_PI;var M=m.fromRotationZ(S,U),O=m.multiply(y,M,q),_=Math.cos(n.xPoleWander),T=Math.cos(n.yPoleWander),P=Math.sin(n.xPoleWander),C=Math.sin(n.yPoleWander),R=r-b+a/p.SECONDS_PER_DAY;R/=36525;var N=-47e-6*R*d.RADIANS_PER_DEGREE/3600,z=Math.cos(N),L=Math.sin(N),B=U;return B[0]=_*z,B[1]=_*L,B[2]=P,B[3]=-T*L+C*P*z,B[4]=T*z+C*P*L,B[5]=-C*_,B[6]=-C*L-T*P*z,B[7]=C*z-T*P*L,B[8]=T*_,m.multiply(O,B,t)};var L=new r;return v.pointToWindowCoordinates=function(e,t,n,r){return r=v.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},v.pointToGLWindowCoordinates=function(e,n,a,o){i(o)||(o=new t);var u=L;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,o)},v}),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";var m=new r,y=function(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)};o(y.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}}});var p=new e;y.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new y(r.center,n)};var v=new h,g=new n;y.prototype.projectPointOntoPlane=function(e,r){var a=v;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,g);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,g)),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)}return void 0},y.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;r>a;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t};var w=new n;return y.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=w,l=0;r>l;++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},y}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";var r=new t,a=new t,i=new t,o=function(o,u,s,c,l){n(l)||(l=new t);var f,h,d,m,y,p,v,g;n(u.z)?(f=t.subtract(s,u,r),h=t.subtract(c,u,a),d=t.subtract(o,u,i),m=t.dot(f,f),y=t.dot(f,h),p=t.dot(f,d),v=t.dot(h,h),g=t.dot(h,d)):(f=e.subtract(s,u,r),h=e.subtract(c,u,a),d=e.subtract(o,u,i),m=e.dot(f,f),y=e.dot(f,h),p=e.dot(f,d),v=e.dot(h,h),g=e.dot(h,d));var w=1/(m*v-y*y);return l.y=(v*p-y*g)*w,l.z=(m*g-y*p)*w,l.x=1-l.y-l.z,l};return o}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";var n=new t,r=function(t,r,a,i){return e(t,r,a,i,n),n.x>0&&n.y>0&&n.z>0};return r}),define("Core/Queue",[],function(){"use strict";var e=function(){this._array=[],this._offset=0,this.length=0};return e.prototype.enqueue=function(e){this._array.push(e),this.length++},e.prototype.dequeue=function(){if(0===this.length)return void 0;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},e.prototype.contains=function(e){return-1!==this._array.indexOf(e)},e.prototype.clear=function(){this._array.length=this._offset=this.length=0},e.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},e}),define("Core/WindingOrder",["./freezeObject"],function(e){"use strict";var t={CLOCKWISE:2304,COUNTER_CLOCKWISE:2305,validate:function(e){return e===t.CLOCKWISE||e===t.COUNTER_CLOCKWISE}};return e(t)}),define("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,m){"use strict";function y(t,n,r){var a=e.subtract(n,t,L),i=e.subtract(r,n,B);return a.x*i.y-a.y*i.x>=0}function p(e){for(var t=e[0].x,n=0,r=0;r<e.length;r++)e[r].x>t&&(t=e[r].x,n=r);return n}function v(e){for(var t=e[0][0].x,n=0,r=0;r<e.length;r++){var a=e[r][p(e[r])].x;a>t&&(t=a,n=r)}return n}function g(e){for(var t=[],n=0;n<e.length;n++){var r=e[(n-1+e.length)%e.length],a=e[n],i=e[(n+1)%e.length];y(r,a,i)||t.push(a)}return t}function w(t,n){for(var r=0;r<t.length;r++)if(e.equals(n,t[r]))return r;return-1}function x(n,a,i){i=r(i,[]);var o=Number.MAX_VALUE,u=p(a),s=new e(a[u].x,n.y);i.push(u),i.push((u+1)%a.length);for(var c=a[0].x,l=c,f=1;f<a.length;++f)a[f].x<c?c=a[f].x:a[f].x>l&&(l=a[f].x);l+=l-c;var h=new t(l,n.y,0);for(f=0;f<a.length;f++){var d=a[f],m=a[(f+1)%a.length];if((d.x>=n.x||m.x>=n.x)&&(d.y>=n.y&&m.y<=n.y||d.y<=n.y&&m.y>=n.y)){var y=(m.y-d.y)*(h.x-n.x)-(m.x-d.x)*(h.y-n.y);if(0!==y){y=1/y;var v=((m.x-d.x)*(n.y-d.y)-(m.y-d.y)*(n.x-d.x))*y,g=((h.x-n.x)*(n.y-d.y)-(h.y-n.y)*(n.x-d.x))*y;if(v>=0&&1>=v&&g>=0&&1>=g){var w=new e(n.x+v*(h.x-n.x),n.y+v*(h.y-n.y)),x=e.subtract(w,n,W);y=e.magnitudeSquared(x),o>y&&(s=w,o=y,i[0]=f,i[1]=(f+1)%a.length)}}}}return s}function E(t,n){var r=v(n),a=n[r],i=p(a),o=a[i],u=[],s=x(o,t,u),c=w(t,s);if(-1!==c)return c;var h=e.magnitudeSquared(e.subtract(t[u[0]],o,F)),d=e.magnitudeSquared(e.subtract(t[u[1]],o,F)),m=d>h?t[u[0]]:t[u[1]],y=g(t),E=y.indexOf(m);-1!==E&&y.splice(E,1);for(var S=[],M=0;M<y.length;M++){var O=y[M];f(O,o,s,m)&&S.push(O)}var _=Number.MAX_VALUE;if(S.length>0){var T=e.fromElements(1,0,F);for(M=0;M<S.length;M++){var P=e.subtract(S[M],o,G),C=e.magnitude(T)*e.magnitudeSquared(P);if(0!==C){var R=Math.abs(l.acosClamped(e.dot(T,P)/C));_>R&&(_=R,m=S[M])}}}return t.indexOf(m)}function S(e,n,r){for(var a=ut.computeWindingOrder2D(e),i=0;i<n.length;i++){var o=n[i];t.equals(o[0],o[o.length-1])||o.push(o[0]);var s=ut.computeWindingOrder2D(o);s===a&&o.reverse()}var c=u.fromPoints(e,r),l=c.projectPointsOntoPlane(e),f=[];for(i=0;i<n.length;i++)f.push(c.projectPointsOntoPlane(n[i]));var h=E(l,f),d=v(f),m=p(f[d]),y=n[d],g=[];for(i=0;i<e.length;i++)g.push(e[i]);var w,x=[];if(0!==m)for(w=0;w<=y.length;w++){var S=(w+m)%y.length;0!==S&&x.push(y[S])}else for(w=0;w<y.length;w++)x.push(y[(w+m)%y.length]);var M=g.lastIndexOf(e[h]);x.push(e[M]);var O=g.slice(0,M+1),_=g.slice(M+1);return g=O.concat(x,_),n.splice(d,1),g}function M(e){var t="0."+Math.sin(j).toString().substr(5);j+=.2;var n=Math.floor(t*e);return n===e&&n--,n}function O(t,n,r){return _(t,n,r)&&_(n,t,r)&&!A(r[t].position,r[n].position,r)&&!e.equals(r[t].position,r[n].position)}function _(t,n,r){C(t,r);var a=r[t],i=r[n],o=P(t,r,V),u=P(t,r,Y),s=e.subtract(r[o].position,a.position,k),c=e.subtract(r[u].position,a.position,H),l=e.subtract(i.position,a.position,X);return R(s,l)?T(s,l):R(c,l)?T(c,l):N(s,c)?b(s,c,l)?!0:!1:z(s,c)?I(s,c,l)?!1:!0:void 0}function T(t,n){return e.magnitude(n)<e.magnitude(t)}function P(e,t,n){var r=e+n;return 0>r&&(r=t.length-1),r===t.length&&(r=0),C(r,t),r}function C(t,n){var r=t-1,a=t+1;0>r&&(r=n.length-1),a===n.length&&(a=0);var o=e.subtract(n[r].position,n[t].position,Z),u=e.subtract(n[a].position,n[t].position,J);if(R(o,u)){var s=new i("Superfluous vertex found.");throw s.vertexIndex=t,s}}function R(e,n){return 0===t.cross(e,n,K).z}function N(e,n){return t.cross(e,n,Q).z<0}function z(e,n){return t.cross(e,n,$).z>0}function I(e,n,r){return t.cross(e,r,et).z>0&&t.cross(r,n,et).z>0}function b(e,n,r){return t.cross(e,r,tt).z<0&&t.cross(r,n,tt).z<0}function A(t,n,r){for(var a=0;a<r.length;a++){var i,o=r[a].position;if(i=a<r.length-1?r[a+1].position:r[0].position,!(e.equals(t,o)||e.equals(n,i)||e.equals(t,i)||e.equals(n,o))){var u=(n.y-t.y)/(n.x-t.x),s=(i.y-o.y)/(i.x-o.x);if(!(u===s||isNaN(u)&&isNaN(s))){var c;c=isNaN(u)?t.x:isNaN(s)?o.x:(t.y-o.y-u*t.x+s*o.x)/(s-u);var l=u*c+t.y-u*t.x,f=e.fromElements(c,l,nt);if(!(e.equals(f,t)||e.equals(f,n)||e.equals(f,o)||e.equals(f,i))){var h=q(c,t.x,n.x)&&q(l,t.y,n.y)&&q(c,o.x,i.x)&&q(l,o.y,i.y);if(h)return!0}}}}return!1}function D(t){var n=t[0].position,r=t[1].position,a=t[2].position,i=e.subtract(r,n,rt),o=e.subtract(a,n,at);return R(i,o)}function q(e,t,n){return(e>t||e>n)&&(t>e||n>e)||t===n&&t===e}function U(e){var t=e.length;if(3===t)return D(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new i("Invalid polygon: must have at least three vertices.");for(var n=!1,r=0;!n;){var a=10*e.length;if(r>a)return[];r++;for(var o=M(e.length),u=o+1;Math.abs(o-u)<2||Math.abs(o-u)>e.length-2;)u=M(e.length);if(o>u){var s=o;o=u,u=s}try{if(O(o,u,e)){var c=e.splice(o,u-o+1,e[o],e[u]);return U(e).concat(U(c))}}catch(l){if(l.hasOwnProperty("vertexIndex"))return e.splice(l.vertexIndex,1),U(e);throw l}}}var L=new e,B=new e,W=new e,F=new e(1,0),G=new e,j=0,V=-1,Y=1,k=new t,H=new t,X=new t,Z=new t,J=new t,K=new t,Q=new t,$=new t,et=new t,tt=new t,nt=new e,rt=new t,at=new t,it=new t,ot=new t,ut={};return ut.removeDuplicates=function(e){for(var n=e.length,r=[],a=n-1,i=0;n>i;a=i++){var o=e[a],u=e[i];t.equals(o,u)||r.push(u)}return r},ut.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;t>a;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},ut.computeWindingOrder2D=function(e){var t=ut.computeArea2D(e);return t>0?m.COUNTER_CLOCKWISE:m.CLOCKWISE},ut.triangulate=function(e){for(var t=e.length,n=[],r=0;t>r;++r)n[r]={position:e[r],index:r};return U(n)},ut.resetSeed=function(e){j=r(e,0)},ut.computeSubdivision=function(e,a,i){i=r(i,l.RADIANS_PER_DEGREE);for(var o=new d,u=a.length,f=0;u>f;f+=3)o.enqueue({i0:a[f],i1:a[f+1],i2:a[f+2]});for(var m,y=e.slice(0),p=[],v={};o.length>0;){var g,w,x=o.dequeue(),E=y[x.i0],S=y[x.i1],M=y[x.i2],O=t.angleBetween(E,S),_=t.angleBetween(S,M),T=t.angleBetween(M,E),P=Math.max(O,Math.max(_,T));P>i?O===P?(g=Math.min(x.i0,x.i1).toString()+" "+Math.max(x.i0,x.i1).toString(),m=v[g],m||(w=t.add(E,S,new t),t.multiplyByScalar(w,.5,w),y.push(w),m=y.length-1,v[g]=m),o.enqueue({i0:x.i0,i1:m,i2:x.i2}),o.enqueue({i0:m,i1:x.i1,i2:x.i2})):_===P?(g=Math.min(x.i1,x.i2).toString()+" "+Math.max(x.i1,x.i2).toString(),m=v[g],m||(w=t.add(S,M,new t),t.multiplyByScalar(w,.5,w),y.push(w),m=y.length-1,v[g]=m),o.enqueue({i0:x.i1,i1:m,i2:x.i0}),o.enqueue({i0:m,i1:x.i2,i2:x.i0})):T===P&&(g=Math.min(x.i2,x.i0).toString()+" "+Math.max(x.i2,x.i0).toString(),m=v[g],m||(w=t.add(M,E,new t),t.multiplyByScalar(w,.5,w),y.push(w),m=y.length-1,v[g]=m),o.enqueue({i0:x.i2,i1:m,i2:x.i1}),o.enqueue({i0:m,i1:x.i0,i2:x.i1})):(p.push(x.i0),p.push(x.i1),p.push(x.i2))}var C=y.length,R=new Array(3*C),N=0;for(m=0;C>m;m++){var z=y[m];R[N++]=z.x,R[N++]=z.y,R[N++]=z.z}return new s({attributes:{position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:R})},indices:p,primitiveType:h.TRIANGLES})},ut.scaleToGeodeticHeight=function(e,n,i,u){i=r(i,o.WGS84);var s=it,c=ot;if(n=r(n,0),u=r(u,!0),a(e)&&a(e.attributes)&&a(e.attributes.position))for(var l=e.attributes.position.values,f=l.length,h=0;f>h;h+=3)t.fromArray(l,h,c),u&&(c=i.scaleToGeodeticSurface(c,c)),s=i.geodeticSurfaceNormal(c,s),t.multiplyByScalar(s,n,s),t.add(c,s,c),l[h]=c.x,l[h+1]=c.y,l[h+2]=c.z;return e},ut.eliminateHoles=function(e,n,a){a=r(a,o.WGS84);for(var i=[],u=0;u<n.length;u++){for(var s=[],c=0;c<n[u].length;c++)s.push(t.clone(n[u][c]));i.push(s)}for(var l=e;i.length>0;)l=S(l,i,a);return l},ut}),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,m=Math.sqrt(d),y=t/4,p=y*y,v=p*y,g=p*p,w=1+y-3*p/4+5*v/4-175*g/64,x=1-y+15*p/8-35*v/8,E=1-3*y+35*p/4,S=1-5*y,M=w*l-x*Math.sin(2*l)*y/2-E*Math.sin(4*l)*p/16-S*Math.sin(6*l)*v/48-5*Math.sin(8*l)*g/512,O=e._constants;O.a=n,O.b=r,O.f=a,O.cosineHeading=i,O.sineHeading=o,O.tanU=u,O.cosineU=s,O.sineU=c,O.sigma=l,O.sineAlpha=f,O.sineSquaredAlpha=h,O.cosineSquaredAlpha=d,O.cosineAlpha=m,O.u2Over4=y,O.u4Over16=p,O.u6Over64=v,O.u8Over256=g,O.a0=w,O.a1=x,O.a2=E,O.a3=S,O.distanceRatio=M}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,m=(t-n)/t,y=i-r,p=Math.atan((1-m)*Math.tan(a)),v=Math.atan((1-m)*Math.tan(o)),g=Math.cos(p),w=Math.sin(p),x=Math.cos(v),E=Math.sin(v),S=g*x,M=g*E,O=w*E,_=w*x,T=y,P=u.TWO_PI,C=Math.cos(T),R=Math.sin(T);do{C=Math.cos(T),R=Math.sin(T);var N=M-_*C;f=Math.sqrt(x*x*R*R+N*N),c=O+S*C,s=Math.atan2(f,c);var z;0===f?(z=0,h=1):(z=S*R/f,h=1-z*z),P=T,d=c-2*O/h,isNaN(d)&&(d=0),T=y+l(m,z,h,s,f,c,d)}while(Math.abs(T-P)>u.EPSILON12);var I=h*(t*t-n*n)/(n*n),b=1+I*(4096+I*(I*(320-175*I)-768))/16384,A=I*(256+I*(I*(74-47*I)-128))/1024,D=d*d,q=A*f*(d+A*(c*(2*D-1)-A*d*(4*f*f-3)*(4*D-3)/6)/4),U=n*b*(s-q),L=Math.atan2(x*R,M-_*C),B=Math.atan2(g*R,M*C-_);e._distance=U,e._startHeading=L,e._endHeading=B,e._uSquared=I}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),r.height=0,a.height=0,n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),s(n)}var d=new e,m=new e,y=function(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)};return a(y.prototype,{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}}}),y.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},y.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},y.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),m=i*i,y=i*m,p=a.u8Over256,v=a.u2Over4,g=a.u6Over64,w=a.u4Over16,x=2*y*p*o/3+i*(1-v+7*w/4-15*g/4+579*p/64-(w-15*g/4+187*p/16)*o-(5*g/4-115*p/16)*u-29*p*s/16)+(v/2-w+71*g/32-85*p/16)*c+(5*w/16-5*g/4+383*p/96)*f-m*((g-11*p/2)*c+5*p*f/2)+(29*g/96-29*p/16)*h+539*p*d/1536,E=Math.asin(Math.sin(x)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(E));x-=a.sigma;var M=Math.cos(2*a.sigma+x),O=Math.sin(x),_=Math.cos(x),T=a.cosineU*_,P=a.sineU*O,C=Math.atan2(O*a.sineHeading,T-P*a.cosineHeading),R=C-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,x,O,_,M);return r(n)?(n.longitude=this._start.longitude+R,n.latitude=S,n.height=0,n):new t(this._start.longitude+R,S,0)},y}),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,a=new Array(e);if(t===n){for(r=0;e>r;r++)a[r]=t;return a}var i=n-t,o=i/e;for(r=1;e>r;r++){var u=t+r*o;a[r]=u}return a[0]=t,a}function d(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,P),l=a.scaleToGeodeticSurface(n,C),f=m.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,O),y=a.cartesianToCartographic(l,_),p=h(f,i,o);R.setEndPoints(d,y);var v=R.surfaceDistance/f,g=s;d.height=i;var w=a.cartographicToCartesian(d,T);e.pack(w,u,g),g+=3;for(var x=1;f>x;x++){var E=R.interpolateUsingSurfaceDistance(x*v,_);E.height=p[x],w=a.cartographicToCartesian(E,T),e.pack(w,u,g),g+=3}return g}var m={};m.numberOfPoints=function(t,n,r){var a=e.angleBetween(t,n);return Math.ceil(a/r)};var y=new t;m.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;n>a;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,y).height}return r};var p=new l,v=new e,g=new e,w=new f(e.ZERO,0),x=new e,E=new f(e.ZERO,0),S=new e,M=new e,O=new t,_=new t,T=new e,P=new e,C=new e,R=new o;return m.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,v),h=l.multiplyByPointAsVector(s,e.UNIT_Y,g),d=f.fromPointNormal(c,h,w),m=l.multiplyByPointAsVector(s,e.UNIT_X,x),y=f.fromPointNormal(c,m,E),O=1;i.push(e.clone(t[0]));for(var _=i[0],T=t.length,P=1;T>P;++P){var C=t[P];if(f.getPointDistance(y,_)<0||f.getPointDistance(y,C)<0){var R=u.lineSegmentPlane(_,C,d,S);if(r(R)){var N=e.multiplyByScalar(h,5e-9,M);f.getPointDistance(d,_)<0&&e.negate(N,N),i.push(e.add(R,N,new e)),o.push(O+1),e.negate(N,N),i.push(e.add(R,N,new e)),O=1}}i.push(e.clone(t[P])),O++,_=C}o.push(O)}return{positions:i,lengths:o}},m.removeDuplicates=function(t){var n=t.length;if(2>n)return void 0;var r,a,i;for(r=1;n>r&&(a=t[r-1],i=t[r],!e.equals(a,i));++r);if(r===n)return void 0;var o=[];for(o.push(t[0]);n>r;++r)a=t[r-1],i=t[r],e.equals(a,i)||o.push(e.clone(i));return o},m.generateArc=function(t){r(t)||(t={});var a,o,u,l=t.positions,f=n(t.ellipsoid,i.WGS84),h=n(t.height,0),y=n(t.granularity,c.RADIANS_PER_DEGREE),p=l.length,v=0;for(a=0;p-1>a;a++)o=l[a],u=l[a+1],v+=m.numberOfPoints(o,u,y);v++;var g=3*v,w=new Array(g),x=0;for(a=0;p-1>a;a++){o=l[a],u=l[a+1];var E,S;s(h)?(E=h[a],S=h[a+1]):(E=h,S=h),x=d(o,u,y,f,E,S,w,x)}var M=l[p-1],_=f.cartesianToCartographic(M,O);_.height=s(h)?h[p-1]:h;var P=f.cartographicToCartesian(_,T);return e.pack(P,w,g-3),w},m.generateCartesianArc=function(t){for(var n=m.generateArc(t),r=n.length/3,a=new Array(r),i=0;r>i;i++)a[i]=e.unpack(n,3*i);return a},m}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u){"use strict";var s=function(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)},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],m=e[u.COLUMN2ROW2],y=h+d+m;if(y>0)r=Math.sqrt(y+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,v=0;d>h&&(v=1),m>h&&m>d&&(v=2);var g=p[v],w=p[g];r=Math.sqrt(e[u.getElementIndex(v,v)]-e[u.getElementIndex(g,g)]-e[u.getElementIndex(w,w)]+1); -var x=f;x[v]=.5*r,r=.5/r,c=(e[u.getElementIndex(w,g)]-e[u.getElementIndex(g,w)])*r,x[g]=(e[u.getElementIndex(g,v)]+e[u.getElementIndex(v,g)])*r,x[w]=(e[u.getElementIndex(w,v)]+e[u.getElementIndex(v,w)])*r,a=-x[0],i=-x[1],o=-x[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 e,d=new e,m=new s,y=new s,p=new s;s.packedLength=4,s.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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;i>a;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,d);var u=e.magnitude(d);return s.unpack(r,4*i,y),0===u?s.clone(s.IDENTITY,m):s.fromAxisAngle(d,u,m),s.multiply(m,y,o)},s.clone=function(e,t){return n(e)?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):void 0},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,m=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=m,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 v=new s;s.lerp=function(e,t,n,r){return v=s.multiplyByScalar(t,n,v),r=s.multiplyByScalar(e,1-n,r),s.add(v,r,r)};var g=new s,w=new s,x=new s;s.slerp=function(e,t,n,r){var a=s.dot(e,t),i=t;if(0>a&&(a=-a,i=g=s.negate(t,g)),1-a<o.EPSILON6)return s.lerp(e,i,n,r);var u=Math.acos(a);return w=s.multiplyByScalar(e,Math.sin((1-n)*u),w),x=s.multiplyByScalar(i,Math.sin(n*u),x),r=s.add(w,x,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 E=new e,S=new e,M=new s,O=new s;s.computeInnerQuadrangle=function(t,n,r,a){var i=s.conjugate(n,M);s.multiply(i,r,O);var o=s.log(O,E);s.multiply(i,t,O);var u=s.log(O,S);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,O);return s.slerp(o,u,2*a*(1-a),i)};for(var _=new s,T=1.9011074535173003,P=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],R=a.supportsTypedArrays()?new Float32Array(8):[],N=a.supportsTypedArrays()?new Float32Array(8):[],z=0;7>z;++z){var I=z+1,b=2*I+1;P[z]=1/(I*b),C[z]=I/b}return P[7]=T/136,C[7]=8*T/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)R[f]=(P[f]*c-C[f])*o,N[f]=(P[f]*l-C[f])*o;var h=a*n*(1+R[0]*(1+R[1]*(1+R[2]*(1+R[3]*(1+R[4]*(1+R[5]*(1+R[6]*(1+R[7])))))))),d=u*(1+N[0]*(1+N[1]*(1+N[2]*(1+N[3]*(1+N[4]*(1+N[5]*(1+N[6]*(1+N[7])))))))),m=s.multiplyByScalar(e,d,_);return s.multiplyByScalar(t,h,r),s.add(m,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,O);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/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];A=t.cartesianToCartographic(a,A),n[r]=A.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;c>i;i++)l[i]=n;return l.push(r),l}var f=r-n,h=f/c;for(i=1;c>i;i++){var d=n+i*h;l[i]=d}return l[0]=n,l.push(r),l}function m(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,H),H),c=u.projectPointOntoPlane(t.add(a,r,X),X),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function y(e,n,r,a,i,o,c,l){var h=W,d=F;q=f.eastNorthUpToFixedFrame(e,i,q),h=s.multiplyByPointAsVector(q,D,h),h=t.normalize(h,h);var y=m(h,n,e,i);L=u.fromRotationZ(y,L),G.z=o,q=s.multiplyTransformation(q,s.fromRotationTranslation(L,G,U),q);var p=B;p[0]=c;for(var v=0;l>v;v++)for(var g=0;g<r.length;g+=3)d=t.fromArray(r,g,d),d=u.multiplyByVector(p,d,d),d=s.multiplyByPoint(q,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,j);a=y(c,n,r,a,i,o[s/3],u,1)}return a}function v(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;n>s;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 g(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;n>u;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function w(e,n,r,i,s,c,f,h,d,m){var p,v=t.angleBetween(t.subtract(n,e,z),t.subtract(r,e,I)),g=i===a.BEVELED?0:Math.ceil(v/o.toRadians(5));p=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,z),v/(g+1),V),k):u.fromQuaternion(l.fromAxisAngle(e,v/(g+1),V),k);var w,x;if(n=t.clone(n,Y),g>0)for(var E=m?2:1,S=0;g>S;S++)n=u.multiplyByVector(p,n,n),w=t.subtract(n,e,z),w=t.normalize(w,w),s||(w=t.negate(w,w)),x=c.scaleToGeodeticSurface(n,I),f=y(x,w,h,f,c,d,1,E);else w=t.subtract(n,e,z),w=t.normalize(w,w),s||(w=t.negate(w,w)),x=c.scaleToGeodeticSurface(n,I),f=y(x,w,h,f,c,d,1,1),r=t.clone(r,Y),w=t.subtract(r,e,z),w=t.normalize(w,w),s||(w=t.negate(w,w)),x=c.scaleToGeodeticSurface(r,I),f=y(x,w,h,f,c,d,1,1);return f}function x(e,t){return o.equalsEpsilon(e.latitude,t.latitude,o.EPSILON6)&&o.equalsEpsilon(e.longitude,t.longitude,o.EPSILON6)}var E=[new t,new t],S=new t,M=new t,O=new t,_=new t,T=new t,P=new t,C=new t,R=new t,N=new t,z=new t,I=new t,b={},A=new r,D=new t(-1,0,0),q=new s,U=new s,L=new u,B=u.IDENTITY.clone(),W=new t,F=new n,G=new t,j=new t,V=new l,Y=new t,k=new u;b.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;n>i;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var H=new t,X=new t;b.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,H),H),s=o.projectPointOntoPlane(t.add(r,n,X),X);return s.x*u.y-s.y*u.x>=0};var Z=new r,J=new r;return b.removeDuplicatesFromPositions=function(e,t){var n=e.length;if(2>n)return e.slice(0);var r=[];r.push(e[0]);for(var a=1;n>a;++a){var i=e[a-1],o=e[a],u=t.cartesianToCartographic(i,Z),s=t.cartesianToCartographic(o,J);x(u,s)||r.push(o)}return r},b.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=h(e,s),f=i._granularity,m=i._cornerType,x=u?v(n,r):g(n,r),I=u?g(n,r):void 0,A=r.height/2,D=r.width/2,q=e.length,U=[],L=u?[]:void 0,B=S,W=M,F=O,G=_,j=T,V=P,Y=C,k=R,H=N,X=e[0],Z=e[1];G=s.geodeticSurfaceNormal(X,G),B=t.subtract(Z,X,B),B=t.normalize(B,B),k=t.cross(G,B,k),k=t.normalize(k,k);var J=l[0],K=l[1];u&&(L=y(X,k,I,L,s,J+A,1,1)),H=t.clone(X,H),X=Z,W=t.negate(B,W);for(var Q,$,et=1;q-1>et;et++){var tt=u?2:1;Z=e[et+1],B=t.subtract(Z,X,B),B=t.normalize(B,B),F=t.add(B,W,F),F=t.normalize(F,F),G=s.geodeticSurfaceNormal(X,G);var nt=!t.equalsEpsilon(t.negate(F,z),G,o.EPSILON2);if(nt){F=t.cross(F,G,F),F=t.cross(G,F,F),F=t.normalize(F,F);var rt=1/Math.max(.25,t.magnitude(t.cross(F,W,z))),at=b.angleIsGreaterThanPi(B,W,X,s);at?(j=t.add(X,t.multiplyByScalar(F,rt*D,F),j),V=t.add(j,t.multiplyByScalar(k,D,V),V),E[0]=t.clone(H,E[0]),E[1]=t.clone(V,E[1]),Q=d(E,J+A,K+A,f),$=c.generateArc({positions:E,granularity:f,ellipsoid:s}),U=p($,k,x,U,s,Q,1),k=t.cross(G,B,k),k=t.normalize(k,k),Y=t.add(j,t.multiplyByScalar(k,D,Y),Y),m===a.ROUNDED||m===a.BEVELED?w(j,V,Y,m,at,s,U,x,K+A,u):(F=t.negate(F,F),U=y(X,F,x,U,s,K+A,rt,tt)),H=t.clone(Y,H)):(j=t.add(X,t.multiplyByScalar(F,rt*D,F),j),V=t.add(j,t.multiplyByScalar(k,-D,V),V),E[0]=t.clone(H,E[0]),E[1]=t.clone(V,E[1]),Q=d(E,J+A,K+A,f),$=c.generateArc({positions:E,granularity:f,ellipsoid:s}),U=p($,k,x,U,s,Q,1),k=t.cross(G,B,k),k=t.normalize(k,k),Y=t.add(j,t.multiplyByScalar(k,-D,Y),Y),m===a.ROUNDED||m===a.BEVELED?w(j,V,Y,m,at,s,U,x,K+A,u):U=y(X,F,x,U,s,K+A,rt,tt),H=t.clone(Y,H)),W=t.negate(B,W)}else U=y(H,k,x,U,s,J+A,1,1),H=X;J=K,K=l[et+1],X=Z}E[0]=t.clone(H,E[0]),E[1]=t.clone(X,E[1]),Q=d(E,J+A,K+A,f),$=c.generateArc({positions:E,granularity:f,ellipsoid:s}),U=p($,k,x,U,s,Q,1),u&&(L=y(X,k,I,L,s,K+A,1,1)),q=U.length;var it=u?q+L.length:q,ot=new Float64Array(it);return ot.set(U),u&&ot.set(L,q),ot},b}),define("Core/PolylineVolumeOutlineGeometry",["./BoundingRectangle","./BoundingSphere","./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,m,y,p){"use strict";function v(e,r){var a=new l;a.position=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:e});var i,o,u=r.length,h=a.position.values.length/3,d=e.length/3,m=d/u,p=f.createTypedArray(h,2*u*(m+1)),v=0;i=0;var g=i*u;for(o=0;u-1>o;o++)p[v++]=o+g,p[v++]=o+g+1;for(p[v++]=u-1+g,p[v++]=g,i=m-1,g=i*u,o=0;u-1>o;o++)p[v++]=o+g,p[v++]=o+g+1;for(p[v++]=u-1+g,p[v++]=g,i=0;m-1>i;i++){var w=u*i,x=w+u;for(o=0;u>o;o++)p[v++]=o+w,p[v++]=o+x}var E=new s({attributes:a,indices:f.createTypedArray(h,p),boundingSphere:t.fromVertices(e),primitiveType:y.LINES});return E}var g=function(e){e=a(e,a.EMPTY_OBJECT);var t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=a(e.ellipsoid,u.WGS84),this._cornerType=a(e.cornerType,r.ROUNDED),this._granularity=a(e.granularity,h.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry"},w=new e;return g.createGeometry=function(t){var n=t._positions,r=m.removeDuplicatesFromPositions(n,t._ellipsoid),a=t._shape;a=m.removeDuplicatesFromShape(a),d.computeWindingOrder2D(a)===p.CLOCKWISE&&a.reverse();var i=e.fromPoints(a,w),o=m.computePositions(r,a,i,t,!1);return v(o,a)},g}),define("Workers/createPolylineVolumeOutlineGeometry",["../Core/Ellipsoid","../Core/PolylineVolumeOutlineGeometry"],function(e,t){"use strict";function n(n){return n._ellipsoid=e.clone(n._ellipsoid),t.createGeometry(n)}return n})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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:0>e?-1:0},a.signNotZero=function(e){return 0>e?-1:1},a.toSNorm=function(e){return Math.round(255*(.5*a.clamp(e,-1,1)+.5))},a.fromSNorm=function(e){return a.clamp(e,0,255)/255*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.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 a>=i||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;e>=r;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}i.fromSpherical=function(n,r){t(r)||(r=new i);var a=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(o),r},i.fromElements=function(e,n,r,a){return t(a)?(a.x=e,a.y=n,a.z=r,a):new i(e,n,r)},i.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 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},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},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 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){i.normalize(e,s),i.normalize(t,c);var n=i.dot(s,c),r=i.magnitude(i.cross(s,c,s));return Math.atan2(r,n)};var l=new i;i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):n.y<=n.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,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},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},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)},i.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},i.fromDegrees=function(e,t,n,r,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,n,r,o)};var f=new i,h=new i,d=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(n,r,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=i.normalize(f,f),i.multiplyComponents(s,f,h);var l=Math.sqrt(i.dot(f,h));return h=i.divideByScalar(h,l,h),f=i.multiplyByScalar(f,a,f),t(u)||(u=new i),i.add(h,f,u)},i.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=a.toRadians(e[o]);return i.fromRadiansArray(r,t,n)},i.fromRadiansArray=function(e,n,r){var a=e.length;t(r)?r.length=a/2:r=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=i.fromRadians(u,s,0,n,r[o/2])}return r},i.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=a.toRadians(e[o]),r[o+1]=a.toRadians(e[o+1]),r[o+2]=e[o+2];return i.fromRadiansArrayHeights(r,t,n)},i.fromRadiansArrayHeights=function(e,n,r){var a=e.length;t(r)?r.length=a/3:r=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=i.fromRadians(u,s,c,n,r[o/3])}return r},i.ZERO=r(new i(0,0,0)),i.UNIT_X=r(new i(1,0,0)),i.UNIT_Y=r(new i(0,1,0)),i.UNIT_Z=r(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,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},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,_=a.z,m=l*l*d*d,p=f*f*E*E,y=h*h*_*_,R=m+p+y,T=Math.sqrt(1/R),A=e.multiplyByScalar(n,T,i);if(s>R)return isFinite(T)?e.clone(A,c):void 0;var S=u.x,v=u.y,N=u.z,M=o;M.x=A.x*S*2,M.y=A.y*v*2,M.z=A.z*N*2;var O,g,I,w,C,x,P,U,D,L,F,B=(1-T)*e.magnitude(n)/(.5*e.magnitude(M)),z=0;do{B-=z,I=1/(1+B*S),w=1/(1+B*v),C=1/(1+B*N),x=I*I,P=w*w,U=C*C,D=x*I,L=P*w,F=U*C,O=m*x+p*P+y*U-1,g=m*D*S+p*L*v+y*F*N;var b=-2*g;z=O/b}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=l*I,c.y=f*w,c.z=h*C,c):new e(l*I,f*w,h*C)}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,m=n(r)?r._centerToleranceSquared:d,p=o(t,E,_,m,c);if(n(p)){var y=e.multiplyComponents(t,_,s);y=e.normalize(y,y);var R=e.subtract(t,p,l),T=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=i.sign(e.dot(R,t))*e.magnitude(R);return n(a)?(a.longitude=T,a.latitude=A,a.height=S,a):new u(T,A,S)}},u.clone=function(e,t){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){a=n(a,0),e.pack(t._radii,r,a)},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;n>a;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;n>a;++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}),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){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},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.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.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){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},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 n>t&&(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;h>f;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.clone=function(e,t){return n(e)?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):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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;i>a&&(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;i>a&&o>0?a+=u.TWO_PI:c>o&&a>0&&(o+=u.TWO_PI),i>a&&0>c?c+=u.TWO_PI:c>o&&0>i&&(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)&&l>=f)){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.union=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.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,a=e.west,i=e.east;return a>i&&(i+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(i>n||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,_=c;_.height=a,_.longitude=E,_.latitude=f,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.latitude=h,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.longitude=E,o[l]=r.cartographicToCartesian(_,o[l]),l++,0>f?_.latitude=f:h>0?_.latitude=h:_.latitude=0;for(var m=1;8>m;++m)_.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,_)&&(o[l]=r.cartographicToCartesian(_,o[l]),l++);return 0===_.latitude&&(_.longitude=E,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=r.cartographicToCartesian(_,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.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;n>c;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){return r(e)?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):void 0},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:0>r&&(n.width-=r,n.x=t.x),a>n.height?n.height=a:0>a&&(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","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(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 u(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;3>n;++n){var r=e[o.getElementIndex(d[n],h[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=i.EPSILON15,r=0,a=1,u=0;3>u;++u){var s=Math.abs(e[o.getElementIndex(d[u],h[u])]);s>r&&(a=u,r=s)}var c=1,l=0,f=h[a],E=d[a];if(Math.abs(e[o.getElementIndex(E,f)])>n){var _,m=e[o.getElementIndex(E,E)],p=e[o.getElementIndex(f,f)],y=e[o.getElementIndex(E,f)],R=(m-p)/2/y;_=0>R?-1/(-R+Math.sqrt(1+R*R)):1/(R+Math.sqrt(1+R*R)),c=1/Math.sqrt(1+_*_),l=_*c}return t=o.clone(o.IDENTITY,t),t[o.getElementIndex(f,f)]=t[o.getElementIndex(E,E)]=c,t[o.getElementIndex(E,f)]=l,t[o.getElementIndex(f,E)]=-l,t}o.packedLength=9,o.pack=function(e,n,r){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]},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},o.clone=function(e,t){return n(e)?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 o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},o.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,u=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,_=2*(a-h),m=2*(i+l),p=2*(a+h),y=-r+s-f+d,R=2*(c-u),T=2*(i-l),A=2*(c+u),S=-r-s+f+d;return n(t)?(t[0]=E,t[1]=p,t[2]=T,t[3]=_,t[4]=y,t[5]=A,t[6]=m,t[7]=R,t[8]=S,t):new o(E,_,m,p,y,R,T,A,S)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,r,-a,0,a,r)},o.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 o(r,0,a,0,1,0,-a,0,r)},o.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 o(r,-a,0,a,r,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},o.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},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;o.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 f=new e;o.getMaximumScale=function(t){return o.getScale(t,f),e.maximumComponent(f)},o.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},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[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},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[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},o.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},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[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},o.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},o.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},o.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],d=[2,2,1],E=new o,_=new o;return o.computeEigenDecomposition=function(e,t){var r=i.EPSILON20,a=10,l=0,f=0;n(t)||(t={});for(var h=t.unitary=o.clone(o.IDENTITY,t.unitary),d=t.diagonal=o.clone(e,t.diagonal),m=r*u(d);a>f&&s(d)>m;)c(d,E),o.transpose(E,_),o.multiply(d,E,d), +o.multiply(_,d,d),o.multiply(h,E,h),++l>2&&(++f,l=0);return 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[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},o.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)},o.inverse=function(e,t){var n=e[0],a=e[1],u=e[2],s=e[3],c=e[4],l=e[5],f=e[6],h=e[7],d=e[8],E=o.determinant(e);if(Math.abs(E)<=i.EPSILON15)throw new r("matrix is not invertible");t[0]=c*d-h*l,t[1]=h*u-a*d,t[2]=a*l-c*u,t[3]=f*l-s*d,t[4]=n*d-f*u,t[5]=s*u-n*l,t[6]=s*h-f*c,t[7]=f*a-n*h,t[8]=n*c-s*a;var _=1/E;return o.multiplyByScalar(t,_,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=a(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=a(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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.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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a,i,o,u,s,c,l,f,h,d,E,_,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(_,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(m,0)}c.packedLength=16,c.pack=function(e,t,r){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]},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),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},c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[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]):void 0},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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new c);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,l=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,_=t.y*t.w,m=t.z*t.z,p=t.z*t.w,y=t.w*t.w,R=s-d-m+y,T=2*(l-p),A=2*(f+_),S=2*(l+p),v=-s+d-m+y,N=2*(E-h),M=2*(f-_),O=2*(E+h),g=-s-d+m+y;return a[0]=R*i,a[1]=S*i,a[2]=M*i,a[3]=0,a[4]=T*o,a[5]=v*o,a[6]=O*o,a[7]=0,a[8]=A*u,a[9]=N*u,a[10]=g*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.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 l=new e,f=new e,h=new e;c.fromCamera=function(t,n){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,E=l.x,_=l.y,m=l.z,p=h.x,y=h.y,R=h.z,T=a.x,A=a.y,S=a.z,v=u*-T+s*-A+d*-S,N=p*-T+y*-A+R*-S,M=E*T+_*A+m*S;return r(n)?(n[0]=u,n[1]=p,n[2]=-E,n[3]=0,n[4]=s,n[5]=y,n[6]=-_,n[7]=0,n[8]=d,n[9]=R,n[10]=-m,n[11]=0,n[12]=v,n[13]=N,n[14]=M,n[15]=1,n):new c(u,s,d,v,p,y,R,N,-E,-_,-m,M,0,0,0,1)},c.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},c.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},c.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},c.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},c.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,_=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]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=_,a[13]=m,a[14]=p,a[15]=y,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,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},c.setColumn=function(e,t,n,r){r=c.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},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],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},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 d=new e;c.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 E=new e;c.getMaximumScale=function(t){return c.getScale(t,E),e.maximumComponent(E)},c.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],m=e[13],p=e[14],y=e[15],R=t[0],T=t[1],A=t[2],S=t[3],v=t[4],N=t[5],M=t[6],O=t[7],g=t[8],I=t[9],w=t[10],C=t[11],x=t[12],P=t[13],U=t[14],D=t[15],L=r*R+u*T+f*A+_*S,F=a*R+s*T+h*A+m*S,B=i*R+c*T+d*A+p*S,z=o*R+l*T+E*A+y*S,b=r*v+u*N+f*M+_*O,G=a*v+s*N+h*M+m*O,q=i*v+c*N+d*M+p*O,W=o*v+l*N+E*M+y*O,X=r*g+u*I+f*w+_*C,V=a*g+s*I+h*w+m*C,H=i*g+c*I+d*w+p*C,Y=o*g+l*I+E*w+y*C,k=r*x+u*P+f*U+_*D,j=a*x+s*P+h*U+m*D,Z=i*x+c*P+d*U+p*D,K=o*x+l*P+E*U+y*D;return n[0]=L,n[1]=F,n[2]=B,n[3]=z,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]=j,n[14]=Z,n[15]=K,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],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],m=t[1],p=t[2],y=t[4],R=t[5],T=t[6],A=t[8],S=t[9],v=t[10],N=t[12],M=t[13],O=t[14],g=r*_+o*m+c*p,I=a*_+u*m+l*p,w=i*_+s*m+f*p,C=r*y+o*R+c*T,x=a*y+u*R+l*T,P=i*y+s*R+f*T,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*M+c*O+h,B=a*N+u*M+l*O+d,z=i*N+s*M+f*O+E;return n[0]=g,n[1]=I,n[2]=w,n[3]=0,n[4]=C,n[5]=x,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=B,n[14]=z,n[15]=1,n},c.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],m=t[4],p=t[5],y=t[6],R=t[7],T=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*m+c*p,M=a*_+u*m+l*p,O=i*_+s*m+f*p,g=r*y+o*R+c*T,I=a*y+u*R+l*T,w=i*y+s*R+f*T;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=M,n[6]=O,n[7]=0,n[8]=g,n[9]=I,n[10]=w,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,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;c.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,c.multiplyByScale(e,_,n)},c.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?c.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)},c.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},c.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},c.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},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],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},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 m=new u,p=new u,y=new t,R=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,m),p,o.EPSILON7)&&t.equals(c.getRow(e,3,y),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],l=e[12],f=e[1],h=e[5],d=e[9],E=e[13],_=e[2],T=e[6],A=e[10],S=e[14],v=e[3],N=e[7],M=e[11],O=e[15],g=A*O,I=S*M,w=T*O,C=S*N,x=T*M,P=A*N,U=_*O,D=S*v,L=_*M,F=A*v,B=_*N,z=T*v,b=g*h+C*d+x*E-(I*h+w*d+P*E),G=I*f+U*d+F*E-(g*f+D*d+L*E),q=w*f+D*h+B*E-(C*f+U*h+z*E),W=P*f+L*h+z*d-(x*f+F*h+B*d),X=I*a+w*i+P*l-(g*a+C*i+x*l),V=g*r+D*i+L*l-(I*r+U*i+F*l),H=C*r+U*a+z*l-(w*r+D*a+B*l),Y=x*r+F*a+B*i-(P*r+L*a+z*i);g=i*E,I=l*d,w=a*E,C=l*h,x=a*d,P=i*h,U=r*E,D=l*f,L=r*d,F=i*f,B=r*h,z=a*f;var k=g*N+C*M+x*O-(I*N+w*M+P*O),j=I*v+U*M+F*O-(g*v+D*M+L*O),Z=w*v+D*N+B*O-(C*v+U*N+z*O),K=P*v+L*N+z*M-(x*v+F*N+B*M),J=w*A+P*S+I*T-(x*S+g*T+C*A),Q=L*S+g*_+D*A-(U*A+F*S+I*_),$=U*T+z*S+C*_-(B*S+w*_+D*T),ee=B*A+x*_+F*T-(L*T+z*A+P*_),te=r*b+a*G+i*q+l*W;if(Math.abs(te)<o.EPSILON20)throw new s("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]=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},c.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,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]=_,t[14]=m,t[15]=1,t},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,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/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/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";function d(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var E=new e,_=new e,m=new e,p=new e,y=new e,R=new e,T=new e,A=new e,S=new e,v=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,E),o=e.clone(a,_),u=e.clone(a,m),s=e.clone(a,p),c=e.clone(a,y),l=e.clone(a,R),f=t.length,h=1;f>h;h++){e.clone(t[h],a);var O=a.x,g=a.y,I=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),I<u.z&&e.clone(a,u),I>l.z&&e.clone(a,l)}var w=e.magnitudeSquared(e.subtract(s,i,A)),C=e.magnitudeSquared(e.subtract(c,o,A)),x=e.magnitudeSquared(e.subtract(l,u,A)),P=i,U=s,D=w;C>D&&(D=C,P=o,U=c),x>D&&(D=x,P=u,U=l);var L=S;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,A)),B=Math.sqrt(F),z=v;z.x=i.x,z.y=o.y,z.z=u.z;var b=N;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(z,b,A),.5,M),q=0;for(h=0;f>h;h++){e.clone(t[h],a);var W=e.magnitude(e.subtract(a,G,A));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(a,L,A));if(X>F){var V=Math.sqrt(X);B=.5*(B+V),F=B*B;var H=V-B;L.x=(B*L.x+H*a.x)/V,L.y=(B*L.y+H*a.y)/V,L.z=(B*L.z+H*a.z)/V}}return q>B?(e.clone(L,n.center),n.radius=B):(e.clone(G,n.center),n.radius=q),n};var O=new o,g=new e,I=new e,w=new t,C=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,O),h.southwest(t,w),w.height=i,h.northeast(t,C),C.height=o;var s=a.project(w,g),c=a.project(C,I),l=c.x-s.x,f=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+f*f+E*E);var _=u.center;return _.x=s.x+.5*l,_.y=s.y+.5*f,_.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0);var u;return r(e)&&(u=h.subsample(e,t,a,x)),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,E),c=e.clone(u,_),l=e.clone(u,m),f=e.clone(u,p),h=e.clone(u,y),O=e.clone(u,R),g=t.length,I=0;g>I;I+=i){var w=t[I]+a.x,C=t[I+1]+a.y,x=t[I+2]+a.z;u.x=w,u.y=C,u.z=x,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),C<c.y&&e.clone(u,c),C>h.y&&e.clone(u,h),x<l.z&&e.clone(u,l),x>O.z&&e.clone(u,O)}var P=e.magnitudeSquared(e.subtract(f,s,A)),U=e.magnitudeSquared(e.subtract(h,c,A)),D=e.magnitudeSquared(e.subtract(O,l,A)),L=s,F=f,B=P;U>B&&(B=U,L=c,F=h),D>B&&(B=D,L=l,F=O);var z=S;z.x=.5*(L.x+F.x),z.y=.5*(L.y+F.y),z.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,z,A)),G=Math.sqrt(b),q=v;q.x=s.x,q.y=c.y,q.z=l.z;var W=N;W.x=f.x,W.y=h.y,W.z=O.z;var X=e.multiplyByScalar(e.add(q,W,A),.5,M),V=0;for(I=0;g>I;I+=i){u.x=t[I]+a.x,u.y=t[I+1]+a.y,u.z=t[I+2]+a.z;var H=e.magnitude(e.subtract(u,X,A));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,z,A));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 V>G?(e.clone(z,o.center),o.radius=G):(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,E),u=e.clone(i,_),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,y),f=e.clone(i,R),h=t.length,O=0;h>O;O+=3){var g=t[O]+n[O],I=t[O+1]+n[O+1],w=t[O+2]+n[O+2];i.x=g,i.y=I,i.z=w,g<o.x&&e.clone(i,o),g>c.x&&e.clone(i,c),I<u.y&&e.clone(i,u),I>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var C=e.magnitudeSquared(e.subtract(c,o,A)),x=e.magnitudeSquared(e.subtract(l,u,A)),P=e.magnitudeSquared(e.subtract(f,s,A)),U=o,D=c,L=C;x>L&&(L=x,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=S;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,F,A)),z=Math.sqrt(B),b=v;b.x=o.x,b.y=u.y,b.z=s.z;var G=N;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,A),.5,M),W=0;for(O=0;h>O;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,A));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,F,A));if(V>B){var H=Math.sqrt(V);z=.5*(z+H),B=z*z;var Y=H-z;F.x=(z*F.x+Y*i.x)/H,F.y=(z*F.y+Y*i.y)/H,F.z=(z*F.z+Y*i.z)/H}}return W>z?(e.clone(F,a.center),a.radius=z):(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 P=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;a>o;o++)i.push(t[o].center);n=d.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;a>o;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return n.radius=s,n};var U=new e,D=new e,L=new e;d.fromOrientedBoundingBox=function(t,n){r(n)||(n=new d);var a=t.halfAxes,i=c.getColumn(a,0,U),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 n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},d.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new d(t.center,t.radius):void 0},d.packedLength=4,d.pack=function(e,t,r){r=n(r,0);var a=e.center;t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius},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 F=new e,B=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,F),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,B);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-a>o?u.OUTSIDE:a>o?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 G=new e;d.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,G),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,W=new e,X=new e,V=new e,H=new e,Y=new t,k=new Array(8),j=0;8>j;++j)k[j]=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,q),c=e.cross(e.UNIT_Z,s,W);e.normalize(c,c);var l=e.cross(s,c,X);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),h=e.negate(c,V),E=k,_=E[0];e.add(s,l,_),e.add(_,c,_),_=E[1],e.add(s,l,_),e.add(_,h,_),_=E[2],e.add(s,f,_),e.add(_,h,_),_=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(_,h,_),_=E[6],e.add(s,f,_),e.add(_,h,_),_=E[7],e.add(s,f,_),e.add(_,c,_);for(var m=E.length,p=0;m>p;++p){var y=E[p];e.add(o,y,y);var R=i.cartesianToCartographic(y,Y);r.project(R,y)}a=d.fromPoints(E,a),o=a.center;var T=o.x,A=o.y,S=o.z;return o.x=S,o.y=T,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("Renderer/WebGLConstants",["../Core/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/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(){return a.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?r.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(r.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",e(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;r>n;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(R)){R=!1;var e=/ Chrome\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(R=!0,T=r(e[1]))}return R}function i(){return a()&&T}function o(){if(!t(A)&&(A=!1,!a()&&/ Safari\/[\.0-9]+/.test(y.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function u(){return o()&&S}function s(){if(!t(v)){v=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(y.userAgent);null!==e&&(v=!0,N=r(e[1]),N.isNightly=!!e[2])}return v}function c(){return s()&&N}function l(){if(!t(M)){M=!1;var e;"Microsoft Internet Explorer"===y.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(y.userAgent),null!==e&&(M=!0,O=r(e[1]))):"Netscape"===y.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(y.userAgent),null!==e&&(M=!0,O=r(e[1])))}return M}function f(){return l()&&O}function h(){if(!t(g)){g=!1;var e=/Firefox\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(g=!0,I=r(e[1]))}return g}function d(){return t(w)||(w=/Windows/i.test(y.appVersion)),w}function E(){return h()&&I}function _(){return t(C)||(C="undefined"!=typeof PointerEvent&&(!t(y.pointerEnabled)||y.pointerEnabled)),C}function m(){if(!t(P)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;P=t(n)&&""!==n,P&&(x=n)}return P}function p(){return m()?x:void 0}var y;y="undefined"!=typeof navigator?navigator:{};var R,T,A,S,v,N,M,O,g,I,w,C,x,P,U={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:E,isWindows:d,hardwareConcurrency:e(y.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:m,imageRenderingValue:p};return U.supportsFullscreen=function(){return n.supportsFullscreen()},U.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},U.supportsWebWorkers=function(){return"undefined"!=typeof Worker},U}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,a,i){"use strict";if(!a.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return n(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,n,a,i){switch(a=t(a,0),i=t(i,(n.byteLength-a)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,a,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,a,i);case o.SHORT:return new Int16Array(n,a,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,a,i);case o.FLOAT:return new Float32Array(n,a,i);case o.DOUBLE:return new Float64Array(n,a,i);default:throw new r("componentDatatype is not a valid value.")}},i(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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(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=void 0}return i.computeNumberOfVertices=function(e){var r=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,r){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,r):new Uint16Array(t,n,r)},r(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;f>h;h++){var d=t[h],E=d.x,_=d.y,m=d.z;a=Math.min(E,a),s=Math.max(E,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 R=e.add(p,y,r.center);return e.multiplyByScalar(R,.5,R),r},i.clone=function(t,r){return n(t)?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):void 0},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:0>s+u?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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,0>i?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(0>f)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,m=u*c-d,p=4*E*m-_*_;if(0>p){var y,R,T;h*f>=l*d?(y=o,R=E,T=-2*u*E+o*_):(y=c,R=m,T=-c*_+2*s*m);var A=0>T?-1:1,S=-A*Math.abs(y)*Math.sqrt(-p);i=-T+S;var v=i/2,N=0>v?-Math.pow(-v,1/3):Math.pow(v,1/3),M=i===S?-N:-R/N;return a=0>=R?N+M:-T/(N*N+M*M+R),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var O=E,g=-2*u*E+o*_,I=m,w=-c*_+2*s*m,C=Math.sqrt(p),x=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*C,-g)/3);a=2*Math.sqrt(-O);var U=Math.cos(P);i=a*U;var D=a*(-U/2-x*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,B=L/F;P=Math.abs(Math.atan2(c*C,-w)/3),a=2*Math.sqrt(-I),U=Math.cos(P),i=a*U,D=a*(-U/2-x*Math.sin(P));var z=-c,b=2*s>i+D?i+s:D+s,G=z/b,q=F*b,W=-L*b-F*z,X=L*z,V=(s*W-u*X)/(-u*W+s*q);return V>=B?G>=B?G>=V?[B,V,G]:[B,G,V]:[G,B,V]:G>=B?[V,B,G]:G>=V?[V,G,B]:[G,V,B]}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=0>u?-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,0>u?[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=E[0],p=E[1];if(m>=0&&p>=0){var y=Math.sqrt(m),R=Math.sqrt(p);return[h-R,h-y,h+y,h+R]}if(m>=0&&0>p)return _=Math.sqrt(m),[h-_,h+_];if(0>m&&p>=0)return _=Math.sqrt(p),[h-_,h+_]}return[]}if(d>0){var T=Math.sqrt(d),A=(s+d-c/T)/2,S=(s+d+c/T)/2,v=r.computeRealRoots(1,T,A),N=r.computeRealRoots(1,-T,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,_,m=d[0],p=a-m,y=p*p,R=t/2,T=p/2,A=y-4*o,S=y+4*Math.abs(o),v=c-4*m,N=c+4*Math.abs(m);if(0>m||v*S>A*N){var M=Math.sqrt(v);E=M/2,_=0===M?0:(t*T-i)/M}else{var O=Math.sqrt(A);E=0===O?0:(t*T-i)/O,_=O/2}var g,I;0===R&&0===E?(g=0,I=0):n.sign(R)===n.sign(E)?(g=R+E,I=m/g):(I=R-E,g=m/I);var w,C;0===T&&0===_?(w=0,C=0):n.sign(T)===n.sign(_)?(w=T+_,C=o/w):(C=T-_,w=o/C);var x=r.computeRealRoots(1,g,w),P=r.computeRealRoots(1,I,C);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,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=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>f?d+1:d,d+=0>h?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(t,r,a,o,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,_=e.subtract(a,r,m),A=e.subtract(o,r,p),S=e.cross(E,A,y),v=e.dot(_,S);if(u){if(v<i.EPSILON6)return;if(s=e.subtract(d,r,R),l=e.dot(s,S),0>l||l>v)return;if(c=e.cross(s,_,T),f=e.dot(E,c),0>f||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,R),l=e.dot(s,S)*N,0>l||l>1)return;if(c=e.cross(s,_,T),f=e.dot(E,c)*N,0>f||l+f>1)return;h=e.dot(A,c)*N}return h}function f(e,t,n,r){var a=t*t-4*e*n;if(!(0>a)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(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={});var i=t.origin,o=t.direction,u=n.center,s=n.radius*n.radius,c=e.subtract(i,u,y),l=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,E=f(l,h,d,S);return r(E)?(a.start=E.root0,a.stop=E.root1,a):void 0}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 E(t,n,r,a,c){var l,f=a*a,h=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,_=c*(a*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),m=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),R=[];if(0===y&&0===p){if(l=u.computeRealRoots(E,_,m),0===l.length)return R;var T=l[0],A=Math.sqrt(Math.max(1-T*T,0));if(R.push(new e(a,c*T,c*-A)),R.push(new e(a,c*T,c*A)),2===l.length){var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));R.push(new e(a,c*S,c*-v)),R.push(new e(a,c*S,c*v))}return R}var N=y*y,M=p*p,O=E*E,g=y*p,I=O+M,w=2*(_*E+g),C=2*m*E+_*_-M+N,x=2*(m*_-g),P=m*m-N;if(0===I&&0===w&&0===C&&0===x)return R;l=s.computeRealRoots(I,w,C,x,P);var U=l.length;if(0===U)return R;for(var D=0;U>D;++D){var L,F=l[D],B=F*F,z=Math.max(1-B,0),b=Math.sqrt(z);L=i.sign(E)===i.sign(m)?d(E*B+m,_*F,i.EPSILON12):i.sign(m)===i.sign(_*F)?d(E*B,_*F+m,i.EPSILON12):d(E*B+_*F,m,i.EPSILON12);var G=d(p*F,y,i.EPSILON15),q=L*G;0>q?R.push(new e(a,c*F,c*b)):q>0?R.push(new e(a,c*F,c*-b)):0!==b?(R.push(new e(a,c*F,c*-b)),R.push(new e(a,c*F,c*b)),++D):R.push(new e(a,c*F,c*b))}return R}var _={};_.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(!(0>l))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var m=new e,p=new e,y=new e,R=new e,T=new e;_.rayTriangle=function(t,n,a,i,o,u){var s=l(t,n,a,i,o);if(r(s)&&!(0>s))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new c;_.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 f=l(c,a,i,o,u);return!r(f)||0>f||f>e.distance(t,n)?void 0:(r(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var S={root0:0,root1:0};_.raySphere=function(e,t,n){return n=h(e,t,n),!r(n)||n.stop<0?void 0:(n.start=Math.max(n.start,0),n)};var v=new c;_.lineSegmentSphere=function(t,n,a,i){var o=v,u=e.subtract(n,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=h(o,a,i),!r(i)||i.stop<0||i.start>s?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i)};var N=new e,M=new 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),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,i>d)return;if(d>i){o=h*h-i,u=-h+Math.sqrt(o);var E=u/a,_=r/u;return _>E?{start:E,stop:_}:{start:_,stop:E}}var m=Math.sqrt(r/a);return{start:m,stop:m}}return 1>f?(r=f-1,a=e.magnitudeSquared(l),i=a*r,o=h*h-i,u=-h+Math.sqrt(o),{start:0,stop:u/a}):0>h?(a=e.magnitudeSquared(l),{start:0,stop:-h/a}):void 0};var O=new e,g=new e,I=new e,w=new e,C=new e,x=new o,P=new o,U=new o,D=new o,L=new o,F=new o,B=new o,z=new e,b=new e,G=new t;_.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction,s=n.geodeticSurfaceNormal(a,O);if(e.dot(u,s)>=0)return a;var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u,O),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(h,f,g),g),_=e.normalize(e.cross(f,d,I),I),m=x;m[0]=f.x,m[1]=f.y,m[2]=f.z,m[3]=d.x,m[4]=d.y,m[5]=d.z,m[6]=_.x,m[7]=_.y,m[8]=_.z;var p=o.transpose(m,P),y=o.fromScale(n.radii,U),R=o.fromScale(n.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 A,S,v=o.multiply(o.multiply(p,R,F),T,F),N=o.multiply(o.multiply(v,y,B),m,B),M=o.multiplyByVector(v,a,C),q=E(N,e.negate(M,O),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,b),V=Number.NEGATIVE_INFINITY,H=0;W>H;++H){A=o.multiplyByVector(y,o.multiplyByVector(m,q[H],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,u);k>V&&(V=k,X=e.clone(A,X))}var j=n.cartesianToCartographic(X,G);return V=i.clamp(V,0,1),S=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-V*V),S=c?-S:S,j.height=S,n.cartographicToCartesian(j,new e)}};var q=new e;return _.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(!(0>f||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},_.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]}}},_}),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(r){return i(r)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(a){return i(a)}});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(t){r.progress(t)}}: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=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){E(e)}var c,l,f,h,d,E,_,m,y,R;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],d=o(),c)for(m=d.progress,_=function(e){h.push(e),--l||(E=_=p,d.reject(h))},E=function(e){f.push(e),--c||(E=_=p,d.resolve(f))},R=0;y>R;++R)R in t&&e(t[R],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,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;a>s;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)})})},R.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 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 R,T,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)})})}},T=[].slice,R=[].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(;a>i;++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;o>=i;)if(r=~~((i+o)/2),a=n(e[r],t),0>a)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,R="",T=!1,A=!1,S=" ",v=s.length,N=0;s&&v>N;N++)switch(s.charAt(N)){case" ":R=" ";break;case"+":R="+";break;case"-":y=!0;break;case"'":S=s.charAt(N+1);break;case"0":T=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(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,T,S);case"c":return u(String.fromCharCode(+p),y,c,f,T);case"b":return o(p,2,A,y,c,f,T);case"o":return o(p,8,A,y,c,f,T);case"x":return o(p,16,A,y,c,f,T);case"X":return o(p,16,A,y,c,f,T).toUpperCase();case"u":return o(p,10,A,y,c,f,T);case"i":case"d":return d=+p||0,d=Math.round(d-d%1),E=0>d?"-":R,p=E+a(String(Math.abs(d)),f,"0",!1),i(p,E,y,c,T);case"e":case"E":case"f":case"F":case"g":case"G":return d=+p,E=0>d?"-":R,_=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],p=E+Math.abs(d)[_](f),i(p,E,y,c,T)[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){R.julianDate=e;var n=_.leapSeconds,r=t(n,R,l);0>r&&(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){R.julianDate=e;var r=_.leapSeconds,a=t(r,R,l);if(0>a&&(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):1>=i?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,0>t&&(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,0>r&&(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 m=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,R=new u,T=/^(\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})$/,M=/([Z+\-])?(\d{2})?:?(\d{2})?$/,O=/^(\d{2})(\.\d+)?/.source+M.source,g=/^(\d{2}):?(\d{2})(\.\d+)?/.source+M.source,I=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+M.source,w="Invalid ISO 8601 date.";_.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,i,u,s=e.split("T"),l=1,h=1,m=0,R=0,M=0,C=0,x=s[0],P=s[1];if(!r(x))throw new a(w);var U;if(s=x.match(N),null!==s){if(U=x.split("-").length-1,U>0&&2!==U)throw new a(w);n=+s[1],l=+s[2],h=+s[3]}else if(s=x.match(A),null!==s)n=+s[1],l=+s[2];else if(s=x.match(T),null!==s)n=+s[1];else{var D;if(s=x.match(S),null!==s){if(n=+s[1],D=+s[2],u=o(n),1>D||u&&D>366||!u&&D>365)throw new a(w)}else{if(s=x.match(v),null===s)throw new a(w);n=+s[1];var L=+s[2],F=+s[3]||0;if(U=x.split("-").length-1,U>0&&(!r(s[3])&&1!==U||r(s[3])&&2!==U))throw new a(w);var B=new Date(Date.UTC(n,0,4));D=7*L+F-B.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(D),l=i.getUTCMonth()+1,h=i.getUTCDate()}if(u=o(n),1>l||l>12||1>h||(2!==l||!u)&&h>p[l-1]||u&&2===l&&h>y)throw new a(w);var z;if(r(P)){if(s=P.match(I),null!==s){if(U=P.split(":").length-1,U>0&&2!==U&&3!==U)throw new a(w);m=+s[1],R=+s[2],M=+s[3],C=1e3*+(s[4]||0),z=5}else if(s=P.match(g),null!==s){if(U=P.split(":").length-1,U>2)throw new a(w);m=+s[1],R=+s[2],M=60*+(s[3]||0),z=4}else{if(s=P.match(O),null===s)throw new a(w);m=+s[1],R=60*+(s[2]||0),z=3}if(R>=60||M>=61||m>24||24===m&&(R>0||M>0||C>0))throw new a(w);var b=s[z],G=+s[z+1],q=+(s[z+2]||0);switch(b){case"+":m-=G,R-=q;break;case"-":m+=G,R+=q;break;case"Z":break;default:R+=new Date(Date.UTC(n,l-1,h,m,R)).getTimezoneOffset()}}else R+=new Date(n,l-1,h).getTimezoneOffset();var W=60===M;for(W&&M--;R>=60;)R-=60,m++;for(;m>=24;)m-=24,h++;for(i=u&&2===l?y:p[l-1];h>i;)h-=i,l++,l>12&&(l-=12,n++),i=u&&2===l?y:p[l-1];for(;0>R;)R+=60,m--;for(;0>m;)m+=24,h--;for(;1>h;)l--,1>l&&(l+=12,n--),i=u&&2===l?y:p[l-1],h+=i;var X=E(n,l,h,m,R,M,C);return r(t)?(d(X[0],X[1],t),f(t)):t=new _(X[0],X[1],c.UTC),W&&_.addSeconds(t,1,t),t},_.now=function(e){return _.fromDate(new Date,e)};var C=new _(0,0,c.TAI);return _.toGregorianDate=function(e,t){var n=!1,a=h(e,C);r(a)||(_.addSeconds(e,-1,C),a=h(C,C),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,p=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,R=u-y*s.SECONDS_PER_HOUR,T=R/s.SECONDS_PER_MINUTE|0;R-=T*s.SECONDS_PER_MINUTE;var A=0|R,S=(R-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=E,t.hour=y,t.minute=T,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(p,m,E,y,T,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){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new _(e.dayNumber,e.secondsOfDay,c.TAI):void 0},_.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){R.julianDate=e;var n=_.leapSeconds,r=t(n,R,l);return 0>r&&(r=~r,--r,0>r&&(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)],_}),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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,n,r,a,i){"use strict";function o(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,u=n.headers,s=n.overrideMimeType,c=n.withCredentials;return e(n.url,function(t){var n=e.defer();return o.load(t,r,a,i,u,n,s,c),n.promise})}function u(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function s(e,t){for(var n=u(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 c(e,n){n=t(n,"");var a=e[1],i=!!e[2],o=e[3];switch(n){case"":case"text":return u(i,o);case"arraybuffer":return s(i,o);case"blob":var c=s(i,o);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(u(i,o),a);case"json":return JSON.parse(u(i,o));default:throw new r("Unhandled responseType: "+n)}}var l=/^data:(.*?)(;base64)?,(.*)$/;return o.load=function(e,t,r,o,u,s,f,h){var d=l.exec(e);if(null!==d)return void s.resolve(c(d,t));var E=new XMLHttpRequest;if(n(f)&&n(E.overrideMimeType)&&E.overrideMimeType(f),E.open(r,e,!0),n(u))for(var _ in u)u.hasOwnProperty(_)&&E.setRequestHeader(_,u[_]);n(t)&&(E.responseType=t),n(h)&&(E.withCredentials=h),E.onload=function(){E.status>=200&&E.status<300?n(E.response)?s.resolve(E.response):n(E.responseXML)&&E.responseXML.hasChildNodes()?s.resolve(E.responseXML):n(E.responseText)?s.resolve(E.responseText):s.reject(new i("unknown XMLHttpRequest response type.")):s.reject(new a(E.status,E.response,E.getAllResponseHeaders()))},E.onerror=function(e){s.reject(new a)},E.send(o)},o.defaultLoad=o.load,o}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";function n(n,r){return e({url:n,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return n}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)||(a={}),t(a.headers)?t(a.headers.Accept)||(a.headers=e(a.headers),a.headers.Accept=i.Accept):a.headers=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(0>a||0>i||0>s||0>c||0>h||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 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=E,e._taiMinusUtcSecondsColumn=_,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,R=e._addNewLeapSeconds,T=0,A=m.length;A>T;T+=e._columnCount){var S=m[T+a],v=m[T+_],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,M=new o(N,v,f.TAI);if(p.push(M),R){if(v!==y&&r(y)){var O=o.leapSeconds,g=t(O,M,d);if(0>g){var I=new u(M,v);O.splice(~g,0,I)}}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,d=i*s,E=n[h+e._ut1MinusUtcSecondsColumn],p=n[d+e._ut1MinusUtcSecondsColumn],y=p-E;if(y>.5||-.5>y){var R=n[h+e._taiMinusUtcSecondsColumn],T=n[d+e._taiMinusUtcSecondsColumn];R!==T&&(l.equals(r)?E=p:p-=T-R)}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,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],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,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,0>s&&(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("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/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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","require"],function(e,t,n,r,a){"use strict";function i(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),a=d.exec(r);if(null!==a)return a[1]}}function o(){if(t(l))return l;var a;if(a="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:i(),!t(a))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new e(r(a))}function u(e){return a.toUrl("../"+e)}function s(t){return new e(t).resolve(o()).toString()}function c(e){t(f)||(f=t(a.toUrl)?u:s),t(h)||(h=document.createElement("a"));var n=f(e);return h.href=n,h.href=h.href,h.href}var l,f,h,d=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=d,c.setBaseUrl=function(t){l=new e(t).resolve(new e(document.location.href))},c}),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;t>=s;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;t>=c;++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;s>u;++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;0>u&&(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;h>=E;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(0>i)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);0>s&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,0>s&&(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=i-s*this._stepSizeDays,p=this._work,y=this._denominators,R=this._coef,T=this._xTable;for(E=0;u>=E;++E)p[E]=m-T[E];for(E=0;u>=E;++E){for(R[E]=1,_=0;u>=_;++_)_!==E&&(R[E]*=p[_]);R[E]*=y[E];var A=3*(s+E);n.x+=R[E]*d[A++],n.y+=R[E]*d[A++],n.s+=R[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],_=h+d+E;if(_>0)r=Math.sqrt(_+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,p=0;d>h&&(p=1),E>h&&E>d&&(p=2);var y=m[p],R=m[y];r=Math.sqrt(e[u.getElementIndex(p,p)]-e[u.getElementIndex(y,y)]-e[u.getElementIndex(R,R)]+1);var T=f;T[p]=.5*r,r=.5/r,c=(e[u.getElementIndex(R,y)]-e[u.getElementIndex(y,R)])*r,T[y]=(e[u.getElementIndex(y,p)]+e[u.getElementIndex(p,y)])*r,T[R]=(e[u.getElementIndex(R,p)]+e[u.getElementIndex(p,R)])*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,E=new e,_=new s,m=new s,p=new s;s.packedLength=4,s.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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;i>a;a++){var o=3*a;s.unpack(e,4*(t+a),_),s.multiply(_,p,_),_.w<0&&s.negate(_,_),s.computeAxis(_,d);var u=s.computeAngle(_);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,_):s.fromAxisAngle(E,u,_),s.multiply(_,m,o)},s.clone=function(e,t){return n(e)?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):void 0},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 R=new s,T=new s,A=new s;s.slerp=function(e,t,n,r){var a=s.dot(e,t),i=t;if(0>a&&(a=-a,i=R=s.negate(t,R)),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),A=s.multiplyByScalar(i,Math.sin(n*u),A),r=s.add(T,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,M=new s;s.computeInnerQuadrangle=function(t,n,r,a){var i=s.conjugate(n,N);s.multiply(i,r,M);var o=s.log(M,S);s.multiply(i,t,M);var u=s.log(M,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,M);return s.slerp(o,u,2*a*(1-a),i)};for(var O=new s,g=1.9011074535173003,I=a.supportsTypedArrays()?new Float32Array(8):[],w=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],x=a.supportsTypedArrays()?new Float32Array(8):[],P=0;7>P;++P){var U=P+1,D=2*U+1;I[P]=1/(U*D),w[P]=U/D}return I[7]=g/136,w[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)C[f]=(I[f]*c-w[f])*o,x[f]=(I[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+x[0]*(1+x[1]*(1+x[2]*(1+x[3]*(1+x[4]*(1+x[5]*(1+x[6]*(1+x[7])))))))),E=s.multiplyByScalar(e,d,O);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,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","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./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){"use strict";var y={},R=new n,T=new n,A=new n;y.eastNorthUpToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=R,s=T,l=A;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.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,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var S=new n,v=new n,N=new n;y.northEastDownToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=-o,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]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=S,s=v,l=N;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.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 _(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},y.northUpEastToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=o,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 _(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=R,s=T,l=A;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(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 _(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 M=new m,O=new n(1,1,1),g=new _;y.headingPitchRollToFixedFrame=function(e,t,r,a,i,o){var u=m.fromHeadingPitchRoll(t,r,a,M),s=_.fromTranslationQuaternionRotationScale(n.ZERO,u,O,g);return o=y.eastNorthUpToFixedFrame(e,i,o),_.multiply(o,s,o)};var I=new _,w=new E;y.headingPitchRollQuaternion=function(e,t,n,r,a,i){var o=y.headingPitchRollToFixedFrame(e,t,n,r,a,I),u=_.getRotation(o,w);return m.fromRotationMatrix(u,i)};var C=24110.54841,x=8640184.812866,P=.093104,U=-62e-7,D=1.1772758384668e-19,L=72921158553e-15,F=d.TWO_PI/86400,B=new h;y.computeTemeToPseudoFixedMatrix=function(e,t){B=h.addSeconds(e,-h.computeTaiMinusUtc(e),B);var n,r=B.dayNumber,a=B.secondsOfDay,o=r-2451545;n=a>=43200?(o+.5)/p.DAYS_PER_JULIAN_CENTURY:(o-.5)/p.DAYS_PER_JULIAN_CENTURY;var u=C+n*(x+n*(P+n*U)),s=u*F%d.TWO_PI,c=L+D*(r-2451545.5),l=(a+.5*p.SECONDS_PER_DAY)%p.SECONDS_PER_DAY,f=s+c*l,_=Math.cos(f),m=Math.sin(f);return i(t)?(t[0]=_,t[1]=-m,t[2]=0,t[3]=m,t[4]=_,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(_,m,0,-m,_,0,0,0,1)},y.iau2006XysData=new l,y.earthOrientationParameters=u.NONE;var z=32.184,b=2451545;y.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+z,a=t.stop.dayNumber,i=t.stop.secondsOfDay+z,o=y.iau2006XysData.preload(n,r,a,i),u=y.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},y.computeIcrfToFixedMatrix=function(e,t){i(t)||(t=new E);var n=y.computeFixedToIcrfMatrix(e,t);if(i(n))return E.transpose(n,t)};var G=new f(0,0,0),q=new s(0,0,0,0,0,0),W=new E,X=new E;y.computeFixedToIcrfMatrix=function(e,t){i(t)||(t=new E);var n=y.earthOrientationParameters.compute(e,q);if(i(n)){var r=e.dayNumber,a=e.secondsOfDay+z,o=y.iau2006XysData.computeXysRadians(r,a,G);if(i(o)){var u=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=W;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=E.fromRotationZ(-o.s,X),_=E.multiply(l,f,W),m=e.dayNumber,R=e.secondsOfDay-h.computeTaiMinusUtc(e)+n.ut1MinusUtc,T=m-2451545,A=R/p.SECONDS_PER_DAY,S=.779057273264+A+.00273781191135448*(T+A);S=S%1*d.TWO_PI;var v=E.fromRotationZ(S,X),N=E.multiply(_,v,W),M=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),g=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),w=r-b+a/p.SECONDS_PER_DAY;w/=36525;var C=-47e-6*w*d.RADIANS_PER_DEGREE/3600,x=Math.cos(C),P=Math.sin(C),U=X;return U[0]=M*x,U[1]=M*P,U[2]=g,U[3]=-O*P+I*g*x,U[4]=O*x+I*g*P,U[5]=-I*M,U[6]=-I*P-O*g*x,U[7]=I*x-O*g*P,U[8]=O*M,E.multiply(N,U,t)}}};var V=new r;y.pointToWindowCoordinates=function(e,t,n,r){return r=y.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},y.pointToGLWindowCoordinates=function(e,n,a,o){i(o)||(o=new t);var u=V;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,o)};var H=new n,Y=new n,k=new n;return y.rotationMatrixFromPositionVelocity=function(e,t,r,o){var u=a(r,c.WGS84).geodeticSurfaceNormal(e,H),s=n.cross(t,u,Y);n.equalsEpsilon(s,n.ZERO,d.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var l=n.cross(s,t,k);return n.cross(t,l,s),n.negate(s,s),i(o)||(o=new E),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=s.x,o[4]=s.y,o[5]=s.z,o[6]=l.x,o[7]=l.y,o[8]=l.z,o},y}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix3","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E){"use strict";function _(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(f.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(f.getColumn(r,1,m));var i=n.fromCartesian4(f.getColumn(r,2,m));this._plane=h.fromPointNormal(e,i)}var m=new r;o(_.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;_.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new _(r.center,n)};var y=new d,R=new n;_.prototype.projectPointOntoPlane=function(e,r){var a=y;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,R);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,R)),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)}},_.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;r>a;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},_.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,R);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,R));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},_.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;n>r;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return _.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;r>l;++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},_}),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,E,_,m,p,y;n(a.z)?(f=t.subtract(s,a,i),h=t.subtract(c,a,o),d=t.subtract(r,a,u),E=t.dot(f,f),_=t.dot(f,h),m=t.dot(f,d),p=t.dot(h,h),y=t.dot(h,d)):(f=e.subtract(s,a,i),h=e.subtract(c,a,o),d=e.subtract(r,a,u),E=e.dot(f,f),_=e.dot(f,h),m=e.dot(f,d),p=e.dot(h,h),y=e.dot(h,d));var R=1/(E*p-_*_);return l.y=(p*m-_*y)*R,l.z=(E*y-_*m)*R,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";function n(t,n,a,i){return e(t,n,a,i,r),r.x>0&&r.y>0&&r.z>0}var r=new t;return n}),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,m=_*_,p=m*_,y=m*m,R=1+_-3*m/4+5*p/4-175*y/64,T=1-_+15*m/8-35*p/8,A=1-3*_+35*m/4,S=1-5*_,v=R*l-T*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=d,N.cosineAlpha=E,N.u2Over4=_,N.u4Over16=m,N.u6Over64=p,N.u8Over256=y,N.a0=R,N.a1=T,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,m=Math.atan((1-E)*Math.tan(a)),p=Math.atan((1-E)*Math.tan(o)),y=Math.cos(m),R=Math.sin(m),T=Math.cos(p),A=Math.sin(p),S=y*T,v=y*A,N=R*A,M=R*T,O=_,g=u.TWO_PI,I=Math.cos(O),w=Math.sin(O);do{I=Math.cos(O),w=Math.sin(O);var C=v-M*I;f=Math.sqrt(T*T*w*w+C*C),c=N+S*I,s=Math.atan2(f,c);var x;0===f?(x=0,h=1):(x=S*w/f,h=1-x*x),g=O,d=c-2*N/h,isNaN(d)&&(d=0),O=_+l(E,x,h,s,f,c,d)}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=d*d,F=D*f*(d+D*(c*(2*L-1)-D*d*(4*f*f-3)*(4*L-3)/6)/4),B=n*U*(s-F),z=Math.atan2(T*w,v-M*I),b=Math.atan2(y*w,v*I-M);e._distance=B,e._startHeading=z,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,m=a.u8Over256,p=a.u2Over4,y=a.u6Over64,R=a.u4Over16,T=2*_*m*o/3+i*(1-p+7*R/4-15*y/4+579*m/64-(R-15*y/4+187*m/16)*o-(5*y/4-115*m/16)*u-29*m*s/16)+(p/2-R+71*y/32-85*m/16)*c+(5*R/16-5*y/4+383*m/96)*f-E*((y-11*m/2)*c+5*m*f/2)+(29*y/96-29*m/16)*h+539*m*d/1536,A=Math.asin(Math.sin(T)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(A));T-=a.sigma;var v=Math.cos(2*a.sigma+T),N=Math.sin(T),M=Math.cos(T),O=a.cosineU*M,g=a.sineU*N,I=Math.atan2(N*a.sineHeading,O-g*a.cosineHeading),w=I-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,T,N,M,v);return r(n)?(n.longitude=this._start.longitude+w,n.latitude=S,n.height=0,n):new t(this._start.longitude+w,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;e>a;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;e>a;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,w),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,M),_=a.cartesianToCartographic(l,O),m=h(f,i,o);C.setEndPoints(d,_);var p=C.surfaceDistance/f,y=s;d.height=i;var R=a.cartographicToCartesian(d,g);e.pack(R,u,y),y+=3;for(var T=1;f>T;T++){var A=C.interpolateUsingSurfaceDistance(T*p,O);A.height=m[T],R=a.cartographicToCartesian(A,g),e.pack(R,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 _=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;n>a;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,_).height}return r};var m=new l,p=new e,y=new e,R=new f(e.ZERO,0),T=new e,A=new f(e.ZERO,0),S=new e,v=new e,N=[],M=new t,O=new t,g=new e,I=new e,w=new e,C=new o;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,p),h=l.multiplyByPointAsVector(s,e.UNIT_Y,y),d=f.fromPointNormal(c,h,R),E=l.multiplyByPointAsVector(s,e.UNIT_X,T),_=f.fromPointNormal(c,E,A),N=1;i.push(e.clone(t[0]));for(var M=i[0],O=t.length,g=1;O>g;++g){var I=t[g];if(f.getPointDistance(_,M)<0||f.getPointDistance(_,I)<0){var w=u.lineSegmentPlane(M,I,d,S);if(r(w)){var C=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(d,M)<0&&e.negate(C,C),i.push(e.add(w,C,new e)),o.push(N+1),e.negate(C,C),i.push(e.add(w,C,new e)),N=1}}i.push(e.clone(t[g])),N++,M=I}o.push(N)}return{positions:i,lengths:o}};var x=c.EPSILON10;return E.removeDuplicates=function(t){var n=t.length;if(2>n)return t;var r,a,i;for(r=1;n>r&&(a=t[r-1],i=t[r],!e.equalsEpsilon(a,i,x));++r);if(r===n)return t;for(var o=t.slice(0,r);n>r;++r)i=t[r],e.equalsEpsilon(a,i,x)||(o.push(e.clone(i)),a=i);return 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);if(1>o)return[];if(1===o){var f=u.scaleToGeodeticSurface(a[0],I);if(0!==l){var h=u.geodeticSurfaceNormal(f,g);e.multiplyByScalar(h,l,h),e.add(f,h,f)}return[f.x,f.y,f.z]}var _=t.minDistance;if(!r(_)){var m=n(t.granularity,c.RADIANS_PER_DEGREE);_=c.chordLength(m,u.maximumRadius)}var p,y=0;for(p=0;o-1>p;p++)y+=E.numberOfPoints(a[p],a[p+1],_);var R=3*(y+1),T=new Array(R),A=0,S=s(l);for(p=0;o-1>p;p++){var v=a[p],O=a[p+1],w=S?l[p]:l,C=S?l[p+1]:l;A=d(v,O,_,u,w,C,T,A)}N.length=0;var x=a[o-1],P=u.cartesianToCartographic(x,M);P.height=S?l[o-1]:l;var U=u.cartographicToCartesian(P,g);return e.pack(U,T,R-3),T},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;r>i;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/Queue",["../Core/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(){return 0!==this._length?this._array[this._offset]:void 0},t.prototype.contains=function(e){return-1!==this._array.indexOf(e)},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/WindingOrder",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"use strict";var n={CLOCKWISE:e.CW,COUNTER_CLOCKWISE:e.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return t(n)}),define("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PolylinePipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,_){"use strict";function m(t,n,r){var a=e.subtract(n,t,F),i=e.subtract(r,n,B);return a.x*i.y-a.y*i.x>=0}function p(e){for(var t=e[0].x,n=0,r=0;r<e.length;r++)e[r].x>t&&(t=e[r].x,n=r);return n}function y(e){for(var t=e[0][0].x,n=0,r=0;r<e.length;r++){var a=e[r][p(e[r])].x;a>t&&(t=a,n=r)}return n}function R(e){for(var t=[],n=0;n<e.length;n++){var r=e[(n-1+e.length)%e.length],a=e[n],i=e[(n+1)%e.length];m(r,a,i)||t.push(a)}return t}function T(t,n){for(var r=0;r<t.length;r++)if(e.equals(n,t[r]))return r;return-1}function A(n,a,i){i=r(i,[]);var o=Number.MAX_VALUE,u=p(a),s=new e(a[u].x,n.y);i.push(u),i.push((u+1)%a.length);for(var c=a[0].x,l=c,f=1;f<a.length;++f)a[f].x<c?c=a[f].x:a[f].x>l&&(l=a[f].x);l+=l-c;var h=new t(l,n.y,0);for(f=0;f<a.length;f++){var d=a[f],E=a[(f+1)%a.length];if((d.x>=n.x||E.x>=n.x)&&(d.y>=n.y&&E.y<=n.y||d.y<=n.y&&E.y>=n.y)){var _=(E.y-d.y)*(h.x-n.x)-(E.x-d.x)*(h.y-n.y);if(0!==_){_=1/_;var m=((E.x-d.x)*(n.y-d.y)-(E.y-d.y)*(n.x-d.x))*_,y=((h.x-n.x)*(n.y-d.y)-(h.y-n.y)*(n.x-d.x))*_;if(m>=0&&1>=m&&y>=0&&1>=y){var R=new e(n.x+m*(h.x-n.x),n.y+m*(h.y-n.y)),T=e.subtract(R,n,z);_=e.magnitudeSquared(T),o>_&&(s=R,o=_,i[0]=f,i[1]=(f+1)%a.length)}}}}return s}function S(t,n){var r=y(n),a=n[r],i=p(a),o=a[i],u=[],s=A(o,t,u),c=T(t,s);if(-1!==c)return c;var h=e.magnitudeSquared(e.subtract(t[u[0]],o,b)),d=e.magnitudeSquared(e.subtract(t[u[1]],o,b)),E=d>h?t[u[0]]:t[u[1]],_=R(t),m=_.indexOf(E);-1!==m&&_.splice(m,1);for(var S=[],v=0;v<_.length;v++){var N=_[v];f(N,o,s,E)&&S.push(N)}var M=Number.MAX_VALUE;if(S.length>0){var O=e.fromElements(1,0,b);for(v=0;v<S.length;v++){var g=e.subtract(S[v],o,G),I=e.magnitude(O)*e.magnitudeSquared(g);if(0!==I){var w=Math.abs(l.acosClamped(e.dot(O,g)/I));M>w&&(M=w,E=S[v])}}}return t.indexOf(E)}function v(e,n,r){for(var a=ee.computeWindingOrder2D(e),i=0;i<n.length;i++){var o=n[i];t.equals(o[0],o[o.length-1])||o.push(o[0]);var s=ee.computeWindingOrder2D(o);s===a&&o.reverse()}var c=u.fromPoints(e,r),l=c.projectPointsOntoPlane(e),f=[];for(i=0;i<n.length;i++)f.push(c.projectPointsOntoPlane(n[i]));var h=S(l,f),d=y(f),E=p(f[d]),_=n[d],m=[];for(i=0;i<e.length;i++)m.push(e[i]);var R,T=[];if(0!==E)for(R=0;R<=_.length;R++){var A=(R+E)%_.length;0!==A&&T.push(_[A])}else for(R=0;R<_.length;R++)T.push(_[(R+E)%_.length]);var v=m.lastIndexOf(e[h]);T.push(e[v]);var N=m.slice(0,v+1),M=m.slice(v+1);return m=N.concat(T,M),n.splice(d,1),m}function N(e){var t=l.nextRandomNumber(),n=Math.floor(t*e);return n===e&&n--,n}function M(e,t,n,r){var a=r[e].position,i=r[t].position,o=r[n].position,u=o.x,s=o.y,c=a.x-u,l=a.y-s,f=i.x-u,h=i.y-s;return c*h-l*f}function O(e,t){return e.x*t.y-e.y*t.x}function g(e,t){var n=t.length,r=l.mod(e-1,n),a=l.mod(e+1,n);return 0===M(r,a,e,t)?!1:!0}function I(t,n){return e.magnitudeSquared(n)<e.magnitudeSquared(t)}function w(t,n,r){if(!g(t,r))return t;var a=r[t].position,i=r[n].position,o=r.length,u=l.mod(t-1,o);if(!g(u,r))return u;var s=l.mod(t+1,o);if(!g(s,r))return s;var c=e.subtract(r[u].position,a,X),f=e.subtract(r[s].position,a,V),h=e.subtract(i,a,H),d=O(c,h),E=O(f,h);if(0===d)return I(c,h)?q:W;if(0===E)return I(f,h)?q:W;var _=O(c,f);return 0>_?0>d&&E>0?q:W:_>0?d>0&&0>E?W:q:void 0}function C(e,t,n){return(e>t||e>n)&&(t>e||n>e)||t===n&&t===e}function x(t,n,r,a){var i=e.subtract(r,t,k),o=n.x*a.y-n.y*a.x,u=o*o,s=e.magnitudeSquared(n),c=e.magnitudeSquared(a);if(u>Y*s*c){var l=(i.x*a.y-i.y*a.x)/o;return e.add(t,e.multiplyByScalar(n,l,k),k)}}function P(t,n,r){for(var i=e.subtract(n,t,j),o=r.length,u=0;o>u;u++){var s=r[u].position,c=r[l.mod(u+1,o)].position;if(!(e.equals(t,s)||e.equals(n,c)||e.equals(t,c)||e.equals(n,s))){var f=e.subtract(c,s,Z),h=x(t,i,s,f);if(a(h)&&!(e.equals(h,t)||e.equals(h,n)||e.equals(h,s)||e.equals(h,c))){var d=h.x,E=h.y,_=C(d,t.x,n.x)&&C(E,t.y,n.y)&&C(d,s.x,c.x)&&C(E,s.y,c.y);if(_)return!0}}}return!1}function U(t,n,r){var a=w(t,n,r);if(a>=0)return a;var i=w(n,t,r);return i>=0?i:a!==q||i!==q||P(r[t].position,r[n].position,r)||e.equals(r[t].position,r[n].position)?J:K}function D(e){return 0===M(1,2,0,e)}function L(e){var t=e.length;if(3===t)return D(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new i("Invalid polygon: must have at least three vertices.");for(var n,r,a=0,o=10*e.length,u=J;K>u&&a++<o;){for(n=N(e.length),r=n+1;Math.abs(n-r)<2||Math.abs(n-r)>e.length-2;)r=N(e.length);if(n>r){var s=n;n=r,r=s}u=U(n,r,e)}if(u===K){var c=e.splice(n,r-n+1,e[n],e[r]);return L(e).concat(L(c))}return u>=0?(e.splice(u,1),L(e)):[]}var F=new e,B=new e,z=new e,b=new e(1,0),G=new e,q=-1,W=-2,X=new t,V=new t,H=new t,Y=l.EPSILON14,k=new e,j=new e,Z=new e,K=-1,J=-2,Q=new t,$=new t,ee={};ee.removeDuplicates=function(e){var n=h.removeDuplicates(e);return t.equals(n[0],n[n.length-1])?n.slice(1):n},ee.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;t>a;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},ee.computeWindingOrder2D=function(e){var t=ee.computeArea2D(e);return t>0?_.COUNTER_CLOCKWISE:_.CLOCKWISE},ee.triangulate=function(e){for(var t=e.length,n=[],r=0;t>r;++r)n[r]={position:e[r],index:r};return L(n)};var te=new t,ne=new t,re=new t,ae=new t,ie=new t,oe=new t,ue=new t;return ee.computeSubdivision=function(e,i,o,u){u=r(u,l.RADIANS_PER_DEGREE);var f,h=o.slice(0),E=i.length,_=new Array(3*E),m=0;for(f=0;E>f;f++){var p=i[f];_[m++]=p.x,_[m++]=p.y,_[m++]=p.z}for(var y=[],R={},T=e.maximumRadius,A=l.chordLength(u,T),S=A*A;h.length>0;){var v,N,M=h.pop(),O=h.pop(),g=h.pop(),I=t.fromArray(_,3*g,te),w=t.fromArray(_,3*O,ne),C=t.fromArray(_,3*M,re),x=t.multiplyByScalar(t.normalize(I,ae),T,ae),P=t.multiplyByScalar(t.normalize(w,ie),T,ie),U=t.multiplyByScalar(t.normalize(C,oe),T,oe),D=t.magnitudeSquared(t.subtract(x,P,ue)),L=t.magnitudeSquared(t.subtract(P,U,ue)),F=t.magnitudeSquared(t.subtract(U,x,ue)),B=Math.max(D,L,F);B>S?D===B?(v=Math.min(g,O)+" "+Math.max(g,O),f=R[v],a(f)||(N=t.add(I,w,ue),t.multiplyByScalar(N,.5,N),_.push(N.x,N.y,N.z),f=_.length/3-1,R[v]=f),h.push(g,f,M),h.push(f,O,M)):L===B?(v=Math.min(O,M)+" "+Math.max(O,M),f=R[v],a(f)||(N=t.add(w,C,ue),t.multiplyByScalar(N,.5,N),_.push(N.x,N.y,N.z),f=_.length/3-1,R[v]=f),h.push(O,f,g),h.push(f,M,g)):F===B&&(v=Math.min(M,g)+" "+Math.max(M,g),f=R[v],a(f)||(N=t.add(C,I,ue),t.multiplyByScalar(N,.5,N),_.push(N.x,N.y,N.z),f=_.length/3-1,R[v]=f),h.push(M,f,O),h.push(f,g,O)):(y.push(g),y.push(O),y.push(M))}return new s({attributes:{position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:_})},indices:y,primitiveType:d.TRIANGLES})},ee.scaleToGeodeticHeight=function(e,n,i,u){i=r(i,o.WGS84);var s=Q,c=$;if(n=r(n,0),u=r(u,!0),a(e)&&a(e.attributes)&&a(e.attributes.position))for(var l=e.attributes.position.values,f=l.length,h=0;f>h;h+=3)t.fromArray(l,h,c),u&&(c=i.scaleToGeodeticSurface(c,c)),0!==n&&(s=i.geodeticSurfaceNormal(c,s),t.multiplyByScalar(s,n,s),t.add(c,s,c)),l[h]=c.x,l[h+1]=c.y,l[h+2]=c.z;return e},ee.eliminateHoles=function(e,n,a){a=r(a,o.WGS84);for(var i=[],u=0;u<n.length;u++){for(var s=[],c=0;c<n[u].length;c++)s.push(t.clone(n[u][c]));i.push(s)}for(var l=e;i.length>0;)l=v(l,i,a);return l},ee}),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;c>i;i++)l[i]=n;return l.push(r),l}var f=r-n,h=f/c;for(i=1;c>i;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);B=u.fromRotationZ(_,B),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(B,q,F),L);var m=z;m[0]=c;for(var p=0;l>p;p++)for(var y=0;y<r.length;y+=3)d=t.fromArray(r,y,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=_(c,n,r,a,i,o[s/3],u,1)}return a}function p(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;n>s;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;n>u;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function R(e,n,r,i,s,c,f,h,d,E){var m,p=t.angleBetween(t.subtract(n,e,C),t.subtract(r,e,x)),y=i===a.BEVELED?0:Math.ceil(p/o.toRadians(5));m=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,C),p/(y+1),X),H):u.fromQuaternion(l.fromAxisAngle(e,p/(y+1),X),H);var R,T;if(n=t.clone(n,V),y>0)for(var A=E?2:1,S=0;y>S;S++)n=u.multiplyByVector(m,n,n),R=t.subtract(n,e,C),R=t.normalize(R,R),s||(R=t.negate(R,R)),T=c.scaleToGeodeticSurface(n,x),f=_(T,R,h,f,c,d,1,A);else R=t.subtract(n,e,C),R=t.normalize(R,R),s||(R=t.negate(R,R)),T=c.scaleToGeodeticSurface(n,x),f=_(T,R,h,f,c,d,1,1),r=t.clone(r,V),R=t.subtract(r,e,C),R=t.normalize(R,R),s||(R=t.negate(R,R)),T=c.scaleToGeodeticSurface(r,x),f=_(T,R,h,f,c,d,1,1);return f}var T=[new t,new t],A=new t,S=new t,v=new t,N=new t,M=new t,O=new t,g=new t,I=new t,w=new t,C=new t,x=new t,P={},U=new r,D=new t(-1,0,0),L=new s,F=new s,B=new u,z=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;n>i;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 j=new t,Z=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,x=u?p(n,r):y(n,r),U=u?y(n,r):void 0,D=r.height/2,L=r.width/2,F=e.length,B=[],z=u?[]:void 0,b=A,G=S,q=v,W=N,X=M,V=O,H=g,Y=I,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=_(K,Y,U,z,s,Q+D,1,1)),k=t.clone(K,k),K=J,G=t.negate(b,G);for(var ee,te,ne=1;F-1>ne;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),j);t.subtract(b,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),Z);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,C))),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), +T[0]=t.clone(k,T[0]),T[1]=t.clone(V,T[1]),ee=d(T,Q+D,$+D,f),te=c.generateArc({positions:T,granularity:f,ellipsoid:s}),B=m(te,Y,x,B,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?R(X,V,H,E,se,s,B,x,$+D,u):(q=t.negate(q,q),B=_(K,q,x,B,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),T[0]=t.clone(k,T[0]),T[1]=t.clone(V,T[1]),ee=d(T,Q+D,$+D,f),te=c.generateArc({positions:T,granularity:f,ellipsoid:s}),B=m(te,Y,x,B,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?R(X,V,H,E,se,s,B,x,$+D,u):B=_(K,q,x,B,s,$+D,ue,re),k=t.clone(H,k)),G=t.negate(b,G)}else B=_(k,Y,x,B,s,Q+D,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+D,$+D,f),te=c.generateArc({positions:T,granularity:f,ellipsoid:s}),B=m(te,Y,x,B,s,ee,1),u&&(z=_(K,Y,U,z,s,$+D,1,1)),F=B.length;var ce=u?F+z.length:F,le=new Float64Array(ce);return le.set(B),u&&le.set(z,F),le},P}),define("Core/PolylineVolumeOutlineGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,_,m,p,y,R){"use strict";function T(e,n){var r=new h;r.position=new f({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:e});var i,o,u=n.length,s=r.position.values.length/3,c=e.length/3,E=c/u,_=d.createTypedArray(s,2*u*(E+1)),m=0;i=0;var p=i*u;for(o=0;u-1>o;o++)_[m++]=o+p,_[m++]=o+p+1;for(_[m++]=u-1+p,_[m++]=p,i=E-1,p=i*u,o=0;u-1>o;o++)_[m++]=o+p,_[m++]=o+p+1;for(_[m++]=u-1+p,_[m++]=p,i=0;E-1>i;i++){var R=u*i,T=R+u;for(o=0;u>o;o++)_[m++]=o+R,_[m++]=o+T}var A=new l({attributes:r,indices:d.createTypedArray(s,_),boundingSphere:t.fromVertices(e),primitiveType:y.LINES});return A}function A(e){e=o(e,o.EMPTY_OBJECT);var t=e.polylinePositions,a=e.shapePositions;this._positions=t,this._shape=a,this._ellipsoid=c.clone(o(e.ellipsoid,c.WGS84)),this._cornerType=o(e.cornerType,i.ROUNDED),this._granularity=o(e.granularity,E.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var u=1+t.length*r.packedLength;u+=1+a.length*n.packedLength,this.packedLength=u+c.packedLength+2}A.pack=function(e,t,a){a=o(a,0);var i,u=e._positions,s=u.length;for(t[a++]=s,i=0;s>i;++i,a+=r.packedLength)r.pack(u[i],t,a);var l=e._shape;for(s=l.length,t[a++]=s,i=0;s>i;++i,a+=n.packedLength)n.pack(l[i],t,a);c.pack(e._ellipsoid,t,a),a+=c.packedLength,t[a++]=e._cornerType,t[a]=e._granularity};var S=c.clone(c.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,a){t=o(t,0);var i,s=e[t++],l=new Array(s);for(i=0;s>i;++i,t+=r.packedLength)l[i]=r.unpack(e,t);s=e[t++];var f=new Array(s);for(i=0;s>i;++i,t+=n.packedLength)f[i]=n.unpack(e,t);var h=c.unpack(e,t,S);t+=c.packedLength;var d=e[t++],E=e[t];return u(a)?(a._positions=l,a._shape=f,a._ellipsoid=c.clone(h,a._ellipsoid),a._cornerType=d,a._granularity=E,a):(v.polylinePositions=l,v.shapePositions=f,v.cornerType=d,v.granularity=E,new A(v))};var N=new e;return A.createGeometry=function(t){var n=t._positions,r=m.removeDuplicates(n),a=t._shape;if(a=p.removeDuplicatesFromShape(a),!(r.length<2||a.length<3)){_.computeWindingOrder2D(a)===R.CLOCKWISE&&a.reverse();var i=e.fromPoints(a,N),o=p.computePositions(r,a,i,t,!1);return T(o,a)}},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/Workers/createRectangleGeometry.js b/Workers/createRectangleGeometry.js index 3c37402..dc4acfc 100644 --- a/Workers/createRectangleGeometry.js +++ b/Workers/createRectangleGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,9 +222,10 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};r.EPSILON1=.1,r.EPSILON2=.01,r.EPSILON3=.001,r.EPSILON4=1e-4,r.EPSILON5=1e-5,r.EPSILON6=1e-6,r.EPSILON7=1e-7,r.EPSILON8=1e-8,r.EPSILON9=1e-9,r.EPSILON10=1e-10,r.EPSILON11=1e-11,r.EPSILON12=1e-12,r.EPSILON13=1e-13,r.EPSILON14=1e-14,r.EPSILON15=1e-15,r.EPSILON16=1e-16,r.EPSILON17=1e-17,r.EPSILON18=1e-18,r.EPSILON19=1e-19,r.EPSILON20=1e-20,r.GRAVITATIONALPARAMETER=3986004418e5,r.SOLAR_RADIUS=6955e5,r.LUNAR_RADIUS=1737400,r.SIXTY_FOUR_KILOBYTES=65536,r.sign=function(e){return e>0?1:0>e?-1:0},r.signNotZero=function(e){return 0>e?-1:1},r.toSNorm=function(e){return Math.round(255*(.5*r.clamp(e,-1,1)+.5))},r.fromSNorm=function(e){return 2*(r.clamp(e,0,255)/255)-1},r.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},r.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},r.lerp=function(e,t,r){return(1-r)*e+r*t},r.PI=Math.PI,r.ONE_OVER_PI=1/Math.PI,r.PI_OVER_TWO=.5*Math.PI,r.PI_OVER_THREE=Math.PI/3,r.PI_OVER_FOUR=Math.PI/4,r.PI_OVER_SIX=Math.PI/6,r.THREE_PI_OVER_TWO=.5*3*Math.PI,r.TWO_PI=2*Math.PI,r.ONE_OVER_TWO_PI=1/(2*Math.PI),r.RADIANS_PER_DEGREE=Math.PI/180,r.DEGREES_PER_RADIAN=180/Math.PI,r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600,r.toRadians=function(e){return e*r.RADIANS_PER_DEGREE},r.toDegrees=function(e){return e*r.DEGREES_PER_RADIAN},r.convertLongitudeRange=function(e){var t=r.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},r.negativePiToPi=function(e){for(var t=r.EPSILON10,n=r.PI,a=r.TWO_PI;-(n+t)>e;)e+=a;if(-n>e)return-n;for(;e>n+t;)e-=a;return e>n?n:e},r.zeroToTwoPi=function(e){var t=e%r.TWO_PI;return 0>t?(t+r.TWO_PI)%r.TWO_PI:t},r.equalsEpsilon=function(e,r,n){return n=t(n,0),Math.abs(e-r)<=n};var n=[1];r.factorial=function(e){var t=n.length;if(e>=t)for(var r=n[t-1],a=t;e>=a;a++)n.push(r*a);return n[e]},r.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},r.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},r.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},r.clamp=function(e,t,r){return t>e?t:e>r?r:e};var a=new e;return r.setRandomNumberSeed=function(t){a=new e(t)},r.nextRandomNumber=function(){return a.random()},r.acosClamped=function(e){return Math.acos(r.clamp(e,-1,1))},r.asinClamped=function(e){return Math.asin(r.clamp(e,-1,1))},r}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i=function(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)};i.fromSpherical=function(r,n){t(n)||(n=new i);var a=r.clock,o=r.cone,u=e(r.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,r,n,a){return t(a)?(a.x=e,a.y=r,a.z=n,a):new i(e,r,n)},i.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z},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},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 o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(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},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.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 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){i.normalize(e,s),i.normalize(t,c);var r=i.dot(s,c),n=i.magnitude(i.cross(s,c,s));return Math.atan2(n,r)};var l=new i;i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);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,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z},i.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n},i.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},i.fromDegrees=function(e,t,r,n,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,r,n,o)};var f=new i,d=new i,h=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(r,n,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:h,c=Math.cos(n);f.x=c*Math.cos(r),f.y=c*Math.sin(r),f.z=Math.sin(n),f=i.normalize(f,f),i.multiplyComponents(s,f,d);var l=Math.sqrt(i.dot(f,d));return d=i.divideByScalar(d,l,d),f=i.multiplyByScalar(f,a,f),t(u)||(u=new i),i.add(d,f,u)},i.fromDegreesArray=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o++)n[o]=a.toRadians(e[o]);return i.fromRadiansArray(n,t,r)},i.fromRadiansArray=function(e,r,n){var a=e.length;t(n)?n.length=a/2:n=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];n[o/2]=i.fromRadians(u,s,0,r,n[o/2])}return n},i.fromDegreesArrayHeights=function(e,t,r){for(var n=new Array(e.length),o=0;o<e.length;o+=3)n[o]=a.toRadians(e[o]),n[o+1]=a.toRadians(e[o+1]),n[o+2]=e[o+2];return i.fromRadiansArrayHeights(n,t,r)},i.fromRadiansArrayHeights=function(e,r,n){var a=e.length;t(n)?n.length=a/3:n=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];n[o/3]=i.fromRadians(u,s,c,r,n[o/3])}return n},i.ZERO=n(new i(0,0,0)),i.UNIT_X=n(new i(1,0,0)),i.UNIT_Y=n(new i(0,1,0)),i.UNIT_Z=n(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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i=function(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)};return i.fromRadians=function(r,n,a,o){return a=e(a,0),t(o)?(o.longitude=r,o.latitude=n,o.height=a,o):new i(r,n,a)},i.fromDegrees=function(e,t,r,n){return e=a.toRadians(e),t=a.toRadians(t),i.fromRadians(e,t,r,n)},i.clone=function(e,r){return t(e)?t(r)?(r.longitude=e.longitude,r.latitude=e.latitude,r.height=e.height,r):new i(e.longitude,e.latitude,e.height):void 0},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.longitude===r.longitude&&e.latitude===r.latitude&&e.height===r.height},i.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.longitude-r.longitude)<=n&&Math.abs(e.latitude-r.latitude)<=n&&Math.abs(e.height-r.height)<=n},i.ZERO=n(new i(0,0,0)),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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},i}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(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}var c=function(e,t,r){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,s(this,e,t,r)};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(t,r){if(!n(t))return void 0;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 c(a.x,a.y,a.z)},c.fromCartesian3=function(e,t){return n(t)||(t=new c),n(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=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.prototype.geocentricSurfaceNormal=e.normalize,c.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)},c.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var l=new e,f=new e;c.prototype.cartographicToCartesian=function(t,r){var a=l,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)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;r>a;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,h=new e,m=new e;c.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,h);if(!n(i))return void 0;var o=this.geodeticSurfaceNormal(i,d),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)},c.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;r>a;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t};var y=new e,p=new e;return c.prototype.scaleToGeodeticSurface=function(t,r){var a=t.x,i=t.y,o=t.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,d=a*a*c*c,h=i*i*l*l,m=o*o*f*f,v=d+h+m,g=Math.sqrt(1/v),w=e.multiplyByScalar(t,g,y);if(v<this._centerToleranceSquared)return isFinite(g)?e.clone(w,r):void 0;var x=this._oneOverRadiiSquared,E=x.x,S=x.y,O=x.z,M=p;M.x=2*w.x*E,M.y=2*w.y*S,M.z=2*w.z*O;var T,b,_,A,N,I,P,R,z,C,D,L=(1-g)*e.magnitude(t)/(.5*e.magnitude(M)),U=0;do{L-=U,_=1/(1+L*E),A=1/(1+L*S),N=1/(1+L*O),I=_*_,P=A*A,R=N*N,z=I*_,C=P*A,D=R*N,T=d*I+h*P+m*R-1,b=d*z*E+h*C*S+m*D*O;var q=-2*b;U=T/q}while(Math.abs(T)>u.EPSILON12);return n(r)?(r.x=a*_,r.y=i*A,r.z=o*N,r):new e(a*_,i*A,o*N)},c.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)},c.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},c.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},c.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o){"use strict";var u=function(e,r,n,a){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(a,0)};u.fromDegrees=function(e,n,a,i,s){return e=o.toRadians(t(e,0)),n=o.toRadians(t(n,0)),a=o.toRadians(t(a,0)),i=o.toRadians(t(i,0)),r(s)?(s.west=e,s.south=n,s.east=a,s.north=i,s):new u(e,n,a,i)},u.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=e.length;c>s;s++){var l=e[s];n=Math.min(n,l.longitude),a=Math.max(a,l.longitude),i=Math.min(i,l.latitude),o=Math.max(o,l.latitude)}return r(t)?(t.west=n,t.south=i,t.east=a,t.north=o,t):new u(n,i,a,o)},u.packedLength=4,u.pack=function(e,r,n){n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north},u.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new u),a.west=e[n++],a.south=e[n++],a.east=e[n++],a.north=e[n],a},u.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},u.validate=function(){},u.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},u.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},u.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},u.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},u.center=function(t,n){var a=t.east,i=t.west,u=.5*(i+a);return i>a&&(u=o.negativePiToPi(u+o.PI)),r(n)?(n.longitude=u,n.latitude=.5*(t.south+t.north),n.height=0,n):new e(u,.5*(t.south+t.north))},u.intersectWith=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),s=Math.min(e.north,t.north);return r(n)?(n.west=a,n.south=i,n.east=o,n.north=s,n):new u(a,i,o,s)},u.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},u.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var s=new e;return u.subsample=function(e,n,i,u){n=t(n,a.WGS84),i=t(i,0),r(u)||(u=[]);var c=0,l=e.north,f=e.south,d=e.east,h=e.west,m=s;m.height=i,m.longitude=h,m.latitude=l,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.latitude=f,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:f>0?f:0;for(var y=1;8>y;++y){var p=-Math.PI+y*o.PI_OVER_TWO;p>h&&d>p&&(m.longitude=p,u[c]=n.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=h,u[c]=n.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=n.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=i(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";var u=function(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";var t=function(t,r){this.start=e(t,0),this.stop=e(r,0)};return t}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";var a=function(t,r,n,a){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(a,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){return t(e)?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):void 0},a.packedLength=4,a.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w},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.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 i=new a;a.distance=function(e,t){return a.subtract(e,t,i),a.magnitude(i)},a.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.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.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 o=new a;a.lerp=function(e,t,r,n){return a.multiplyByScalar(t,r,o),n=a.multiplyByScalar(e,1-r,n),a.add(o,n,n)};var u=new a;return a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,u);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.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n&&Math.abs(e.z-r.z)<=n&&Math.abs(e.w-r.w)<=n},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){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function u(e){for(var t=0,r=0;3>r;++r){var n=e[c.getElementIndex(h[r],d[r])];t+=2*n*n}return Math.sqrt(t)}function s(e,t){for(var r=i.EPSILON15,n=0,a=1,o=0;3>o;++o){var u=Math.abs(e[c.getElementIndex(h[o],d[o])]);u>n&&(a=o,n=u)}var s=1,l=0,f=d[a],m=h[a];if(Math.abs(e[c.getElementIndex(m,f)])>r){var y,p=e[c.getElementIndex(m,m)],v=e[c.getElementIndex(f,f)],g=e[c.getElementIndex(m,f)],w=(p-v)/2/g;y=0>w?-1/(-w+Math.sqrt(1+w*w)):1/(w+Math.sqrt(1+w*w)),s=1/Math.sqrt(1+y*y),l=y*s}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(f,f)]=t[c.getElementIndex(m,m)]=s,t[c.getElementIndex(m,f)]=l,t[c.getElementIndex(f,m)]=-l,t}var c=function(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)};c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,n,a){return n=t(n,0),r(a)||(a=new c),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},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,s=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,m=n-u-f+h,y=2*(a-d),p=2*(i+l),v=2*(a+d),g=-n+u-f+h,w=2*(s-o),x=2*(i-l),E=2*(s+o),S=-n-u+f+h;return r(t)?(t[0]=m,t[1]=v,t[2]=x,t[3]=y,t[4]=g,t[5]=E,t[6]=p,t[7]=w,t[8]=S,t):new c(m,y,p,v,g,w,x,E,S)},c.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new c(e.x,0,0,0,e.y,0,0,0,e.z)},c.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new c(e,0,0,0,e,0,0,0,e)},c.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.fromRotationX=function(e,t){var n=Math.cos(e),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 c(1,0,0,0,n,-a,0,a,n)},c.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 c(n,0,a,0,1,0,-a,0,n)},c.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 c(n,-a,0,a,n,0,0,0,1)},c.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},c.getElementIndex=function(e,t){return 3*e+t},c.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},c.setColumn=function(e,t,r,n){n=c.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},c.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},c.setRow=function(e,t,r,n){return n=c.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var l=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),r};var f=new e;c.getMaximumScale=function(t){return c.getScale(t,f),e.maximumComponent(f)},c.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],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},c.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},c.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},c.multiplyByVector=function(e,t,r){var n=t.x,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},c.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},c.transpose=function(e,t){var r=e[0],n=e[3],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],h=[2,2,1],m=new c,y=new c;return c.computeEigenDecomposition=function(e,t){var n=i.EPSILON20,a=10,l=0,f=0;r(t)||(t={});for(var d=t.unitary=c.clone(c.IDENTITY,t.unitary),h=t.diagonal=c.clone(e,t.diagonal),p=n*o(h);a>f&&u(h)>p;)s(h,m),c.transpose(m,y),c.multiply(h,m,h),c.multiply(y,h,h),c.multiply(d,m,d),++l>2&&(++f,l=0);return t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},c.determinant=function(e){var t=e[0],r=e[3],n=e[6],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)},c.inverse=function(e,t){var r=e[0],a=e[1],o=e[2],u=e[3],s=e[4],l=e[5],f=e[6],d=e[7],h=e[8],m=c.determinant(e);if(Math.abs(m)<=i.EPSILON15)throw new n("matrix is not invertible");t[0]=s*h-d*l,t[1]=d*o-a*h,t[2]=a*l-s*o,t[3]=f*l-u*h,t[4]=r*h-f*o,t[5]=u*o-r*l,t[6]=u*d-f*s,t[7]=f*a-r*d,t[8]=r*s-u*a;var y=1/m;return c.multiplyByScalar(t,y,t)},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},c.IDENTITY=a(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s){"use strict";var c=function(e,t,n,a,i,o,u,s,c,l,f,d,h,m,y,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(m,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(y,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(d,0),this[15]=r(p,0)};c.packedLength=16,c.pack=function(e,t,n){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]},c.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new c),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},c.clone=function(e,t){return n(e)?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 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]):void 0},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,r,a){n(a)||(a=new c);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,l=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,m=t.y*t.z,y=t.y*t.w,p=t.z*t.z,v=t.z*t.w,g=t.w*t.w,w=s-h-p+g,x=2*(l-v),E=2*(f+y),S=2*(l+v),O=-s+h-p+g,M=2*(m-d),T=2*(f-y),b=2*(m+d),_=-s-h+p+g; -return a[0]=w*i,a[1]=S*i,a[2]=T*i,a[3]=0,a[4]=x*o,a[5]=O*o,a[6]=b*o,a[7]=0,a[8]=E*u,a[9]=M*u,a[10]=_*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.IDENTITY,e,t)},c.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 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 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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,f=new e,d=new e;c.fromCamera=function(t,r){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,d),d);var u=f.x,s=f.y,h=f.z,m=l.x,y=l.y,p=l.z,v=d.x,g=d.y,w=d.z,x=a.x,E=a.y,S=a.z,O=u*-x+s*-E+h*-S,M=v*-x+g*-E+w*-S,T=m*x+y*E+p*S;return n(r)?(r[0]=u,r[1]=v,r[2]=-m,r[3]=0,r[4]=s,r[5]=g,r[6]=-y,r[7]=0,r[8]=h,r[9]=w,r[10]=-p,r[11]=0,r[12]=O,r[13]=M,r[14]=T,r[15]=1,r):new c(u,s,h,O,v,g,w,M,-m,-y,-p,T,0,0,0,1)},c.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},c.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},c.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},c.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},c.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,m=f,y=i+c,p=o+l,v=t+f,g=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]=m,a[11]=0,a[12]=y,a[13]=p,a[14]=v,a[15]=g,a},c.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]]},c.getElementIndex=function(e,t){return 4*e+t},c.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},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.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},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 h=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],h)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],h)),r};var m=new e;c.getMaximumScale=function(t){return c.getScale(t,m),e.maximumComponent(m)},c.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],m=e[11],y=e[12],p=e[13],v=e[14],g=e[15],w=t[0],x=t[1],E=t[2],S=t[3],O=t[4],M=t[5],T=t[6],b=t[7],_=t[8],A=t[9],N=t[10],I=t[11],P=t[12],R=t[13],z=t[14],C=t[15],D=n*w+u*x+f*E+y*S,L=a*w+s*x+d*E+p*S,U=i*w+c*x+h*E+v*S,q=o*w+l*x+m*E+g*S,F=n*O+u*M+f*T+y*b,B=a*O+s*M+d*T+p*b,W=i*O+c*M+h*T+v*b,G=o*O+l*M+m*T+g*b,V=n*_+u*A+f*N+y*I,Y=a*_+s*A+d*N+p*I,j=i*_+c*A+h*N+v*I,k=o*_+l*A+m*N+g*I,H=n*P+u*R+f*z+y*C,X=a*P+s*R+d*z+p*C,Z=i*P+c*R+h*z+v*C,J=o*P+l*R+m*z+g*C;return r[0]=D,r[1]=L,r[2]=U,r[3]=q,r[4]=F,r[5]=B,r[6]=W,r[7]=G,r[8]=V,r[9]=Y,r[10]=j,r[11]=k,r[12]=H,r[13]=X,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],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],m=e[14],y=t[0],p=t[1],v=t[2],g=t[4],w=t[5],x=t[6],E=t[8],S=t[9],O=t[10],M=t[12],T=t[13],b=t[14],_=n*y+o*p+c*v,A=a*y+u*p+l*v,N=i*y+s*p+f*v,I=n*g+o*w+c*x,P=a*g+u*w+l*x,R=i*g+s*w+f*x,z=n*E+o*S+c*O,C=a*E+u*S+l*O,D=i*E+s*S+f*O,L=n*M+o*T+c*b+d,U=a*M+u*T+l*b+h,q=i*M+s*T+f*b+m;return r[0]=_,r[1]=A,r[2]=N,r[3]=0,r[4]=I,r[5]=P,r[6]=R,r[7]=0,r[8]=z,r[9]=C,r[10]=D,r[11]=0,r[12]=L,r[13]=U,r[14]=q,r[15]=1,r},c.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;c.multiplyByUniformScale=function(e,t,r){return y.x=t,y.y=t,y.z=t,c.multiplyByScale(e,y,r)},c.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?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]=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)},c.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},c.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},c.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},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],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},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||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]&&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]},c.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},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 p=new u,v=new u,g=new t,w=new t(0,0,0,1);return c.inverse=function(e,r){if(u.equalsEpsilon(c.getRotation(e,p),v,o.EPSILON7)&&t.equals(c.getRow(e,3,g),w))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],l=e[12],f=e[1],d=e[5],h=e[9],m=e[13],y=e[2],x=e[6],E=e[10],S=e[14],O=e[3],M=e[7],T=e[11],b=e[15],_=E*b,A=S*T,N=x*b,I=S*M,P=x*T,R=E*M,z=y*b,C=S*O,D=y*T,L=E*O,U=y*M,q=x*O,F=_*d+I*h+P*m-(A*d+N*h+R*m),B=A*f+z*h+L*m-(_*f+C*h+D*m),W=N*f+C*d+U*m-(I*f+z*d+q*m),G=R*f+D*d+q*h-(P*f+L*d+U*h),V=A*a+N*i+R*l-(_*a+I*i+P*l),Y=_*n+C*i+D*l-(A*n+z*i+L*l),j=I*n+z*a+q*l-(N*n+C*a+U*l),k=P*n+L*a+U*i-(R*n+D*a+q*i);_=i*m,A=l*h,N=a*m,I=l*d,P=a*h,R=i*d,z=n*m,C=l*f,D=n*h,L=i*f,U=n*d,q=a*f;var H=_*M+I*T+P*b-(A*M+N*T+R*b),X=A*O+z*T+L*b-(_*O+C*T+D*b),Z=N*O+C*M+U*b-(I*O+z*M+q*b),J=R*O+D*M+q*T-(P*O+L*M+U*T),K=N*E+R*S+A*x-(P*S+_*x+I*E),Q=D*S+_*y+C*E-(z*E+L*S+A*y),$=z*x+q*S+I*y-(U*S+N*y+C*x),et=U*E+P*y+L*x-(D*x+q*E+R*y),tt=n*F+a*B+i*W+l*G;if(Math.abs(tt)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return tt=1/tt,r[0]=F*tt,r[1]=B*tt,r[2]=W*tt,r[3]=G*tt,r[4]=V*tt,r[5]=Y*tt,r[6]=j*tt,r[7]=k*tt,r[8]=H*tt,r[9]=X*tt,r[10]=Z*tt,r[11]=J*tt,r[12]=K*tt,r[13]=Q*tt,r[14]=$*tt,r[15]=et*tt,r},c.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],m=-r*f-n*d-a*h,y=-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]=m,t[13]=y,t[14]=p,t[15]=1,t},c.IDENTITY=i(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[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/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l){"use strict";var f=function(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)},d=new e,h=new e,m=new e,y=new e,p=new e,v=new e,g=new e,w=new e,x=new e,E=new e,S=new e,O=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],g),i=e.clone(a,d),o=e.clone(a,h),u=e.clone(a,m),s=e.clone(a,y),c=e.clone(a,p),l=e.clone(a,v),M=t.length,T=1;M>T;T++){e.clone(t[T],a);var b=a.x,_=a.y,A=a.z;b<i.x&&e.clone(a,i),b>s.x&&e.clone(a,s),_<o.y&&e.clone(a,o),_>c.y&&e.clone(a,c),A<u.z&&e.clone(a,u),A>l.z&&e.clone(a,l)}var N=e.magnitudeSquared(e.subtract(s,i,w)),I=e.magnitudeSquared(e.subtract(c,o,w)),P=e.magnitudeSquared(e.subtract(l,u,w)),R=i,z=s,C=N;I>C&&(C=I,R=o,z=c),P>C&&(C=P,R=u,z=l);var D=x;D.x=.5*(R.x+z.x),D.y=.5*(R.y+z.y),D.z=.5*(R.z+z.z);var L=e.magnitudeSquared(e.subtract(z,D,w)),U=Math.sqrt(L),q=E;q.x=i.x,q.y=o.y,q.z=u.z;var F=S;F.x=s.x,F.y=c.y,F.z=l.z;var B=e.multiplyByScalar(e.add(q,F,w),.5,O),W=0;for(T=0;M>T;T++){e.clone(t[T],a);var G=e.magnitude(e.subtract(a,B,w));G>W&&(W=G);var V=e.magnitudeSquared(e.subtract(a,D,w));if(V>L){var Y=Math.sqrt(V);U=.5*(U+Y),L=U*U;var j=Y-U;D.x=(U*D.x+j*a.x)/Y,D.y=(U*D.y+j*a.y)/Y,D.z=(U*D.z+j*a.z)/Y}}return W>U?(e.clone(D,r.center),r.radius=U):(e.clone(B,r.center),r.radius=W),r};var M=new o,T=new e,b=new e,_=new t,A=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,M),l.southwest(t,_),_.height=i,l.northeast(t,A),A.height=o;var s=a.project(_,T),c=a.project(A,b),d=c.x-s.x,h=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(d*d+h*h+m*m);var y=u.center;return y.x=s.x+.5*d,y.y=s.y+.5*h,y.z=s.z+.5*m,u};var N=[];f.fromRectangle3D=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0);var u;return n(e)&&(u=l.subsample(e,t,a,N)),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=g;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,h),l=e.clone(u,m),M=e.clone(u,y),T=e.clone(u,p),b=e.clone(u,v),_=t.length,A=0;_>A;A+=i){var N=t[A]+a.x,I=t[A+1]+a.y,P=t[A+2]+a.z;u.x=N,u.y=I,u.z=P,N<s.x&&e.clone(u,s),N>M.x&&e.clone(u,M),I<c.y&&e.clone(u,c),I>T.y&&e.clone(u,T),P<l.z&&e.clone(u,l),P>b.z&&e.clone(u,b)}var R=e.magnitudeSquared(e.subtract(M,s,w)),z=e.magnitudeSquared(e.subtract(T,c,w)),C=e.magnitudeSquared(e.subtract(b,l,w)),D=s,L=M,U=R;z>U&&(U=z,D=c,L=T),C>U&&(U=C,D=l,L=b);var q=x;q.x=.5*(D.x+L.x),q.y=.5*(D.y+L.y),q.z=.5*(D.z+L.z);var F=e.magnitudeSquared(e.subtract(L,q,w)),B=Math.sqrt(F),W=E;W.x=s.x,W.y=c.y,W.z=l.z;var G=S;G.x=M.x,G.y=T.y,G.z=b.z;var V=e.multiplyByScalar(e.add(W,G,w),.5,O),Y=0;for(A=0;_>A;A+=i){u.x=t[A]+a.x,u.y=t[A+1]+a.y,u.z=t[A+2]+a.z;var j=e.magnitude(e.subtract(u,V,w));j>Y&&(Y=j);var k=e.magnitudeSquared(e.subtract(u,q,w));if(k>F){var H=Math.sqrt(k);B=.5*(B+H),F=B*B;var X=H-B;q.x=(B*q.x+X*u.x)/H,q.y=(B*q.y+X*u.y)/H,q.z=(B*q.z+X*u.z)/H}}return Y>B?(e.clone(q,o.center),o.radius=B):(e.clone(V,o.center),o.radius=Y),o},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},f.clone=function(t,r){return n(t)?n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius):void 0},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var a=e.center;t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius},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 I=new e,P=new e;f.union=function(t,r,a){n(a)||(a=new f);var i=t.center,o=r.center;e.add(i,o,P);var u=e.multiplyByScalar(P,.5,P),s=e.magnitude(e.subtract(i,u,I))+t.radius,c=e.magnitude(e.subtract(o,u,I))+r.radius;return a.radius=Math.max(s,c),e.clone(u,a.center),a};var R=new e;f.expand=function(t,r,n){n=f.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,R));return a>n.radius&&(n.radius=a),n},f.intersect=function(t,r){var n=t.center,a=t.radius,i=e.dot(r,n)+r.w;return-a>i?u.OUTSIDE:a>i?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=c.getMaximumScale(t)*e.radius,r};var z=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,z);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var C=new e;f.computePlaneDistances=function(t,r,a,i){n(i)||(i=new s);var o=e.subtract(t.center,r,C),u=e.multiplyByScalar(a,e.dot(a,o),C),c=e.magnitude(u);return i.start=c-t.radius,i.stop=c+t.radius,i};for(var D=new e,L=new e,U=new e,q=new e,F=new e,B=new t,W=new Array(8),G=0;8>G;++G)W[G]=new e;var V=new o;return f.projectTo2D=function(t,n,a){n=r(n,V);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,D),c=e.cross(e.UNIT_Z,s,L);e.normalize(c,c);var l=e.cross(s,c,U);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var d=e.negate(l,F),h=e.negate(c,q),m=W,y=m[0];e.add(s,l,y),e.add(y,c,y),y=m[1],e.add(s,l,y),e.add(y,h,y),y=m[2],e.add(s,d,y),e.add(y,h,y),y=m[3],e.add(s,d,y),e.add(y,c,y),e.negate(s,s),y=m[4],e.add(s,l,y),e.add(y,c,y),y=m[5],e.add(s,l,y),e.add(y,h,y),y=m[6],e.add(s,d,y),e.add(y,h,y),y=m[7],e.add(s,d,y),e.add(y,c,y);for(var p=m.length,v=0;p>v;++v){var g=m[v];e.add(o,g,g);var w=i.cartesianToCartographic(g,B);n.project(w,g)}a=f.fromPoints(m,a),o=a.center;var x=o.x,E=o.y,S=o.z;return o.x=S,o.y=x,o.z=E,a},f.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersect=function(e){return f.intersect(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";var i=function(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){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n]=t.y},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.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.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.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.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.x-r.x)<=n&&Math.abs(e.y-r.y)<=n},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){return i.equalsEpsilon(this,e,t)},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(){return a.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?n.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(n.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e){a.supportsFullscreen()&&e[n.requestFullscreen]()},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;n>r;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(m)){m=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(m=!0,y=n(e[1]))}return m}function i(){return a()&&y}function o(){if(!t(p)&&(p=!1,!a()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(p=!0,v=n(e[1]))}return p}function u(){return o()&&v}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(g=!0,w=n(e[1]),w.isNightly=!!e[2])}return g}function c(){return s()&&w}function l(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=n(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=n(e[1])))}return x}function f(){return l()&&E}function d(){if(!t(S)){S=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(S=!0,O=n(e[1]))}return S}function h(){return d()&&O}var m,y,p,v,g,w,x,E,S,O,M={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:d,firefoxVersion:h,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};return M.supportsFullscreen=function(){return r.supportsFullscreen()},M.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},M.supportsWebWorkers=function(){return"undefined"!=typeof Worker},M}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,r,n,a){"use strict";if(!n.supportsTypedArrays())return{};var i={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},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 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.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.FLOAT:return new Float32Array(t);case i.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},i.createArrayBufferView=function(t,n,a,o){switch(a=e(a,0),o=e(o,(n.byteLength-a)/i.getSizeInBytes(t)),t){case i.BYTE:return new Int8Array(n,a,o);case i.UNSIGNED_BYTE:return new Uint8Array(n,a,o);case i.SHORT:return new Int16Array(n,a,o);case i.UNSIGNED_SHORT:return new Uint16Array(n,a,o);case i.FLOAT:return new Float32Array(n,a,o);case i.DOUBLE:return new Float64Array(n,a,o);default:throw new r("componentDatatype is not a valid value.")}},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"],function(e){"use strict";var t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===t.POINTS||e===t.LINES||e===t.LINE_LOOP||e===t.LINE_STRIP||e===t.TRIANGLES||e===t.TRIANGLE_STRIP||e===t.TRIANGLE_FAN}};return e(t)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,a){"use strict";var i=function(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)};return i.computeNumberOfVertices=function(e){var n=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(n!==o&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=o}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(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";var a=function(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,{})};return a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,a){"use strict";var i={};i.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=t.x,n=t.y;t.x=(1-Math.abs(n))*a.signNotZero(r),t.y=(1-Math.abs(r))*a.signNotZero(n)}return t.x=a.toSNorm(t.x),t.y=a.toSNorm(t.y),t},i.octDecode=function(e,r,n){if(n.x=a.fromSNorm(e),n.y=a.fromSNorm(r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var i=n.x;n.x=(1-Math.abs(n.y))*a.signNotZero(i),n.y=(1-Math.abs(i))*a.signNotZero(n.y)}return t.normalize(n,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 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=1===e.x?4095:0|4096*e.x,r=1===e.y?4095:0|4096*e.y;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096;return t.x=Math.floor(r)/4096,t.y=r-Math.floor(r),t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=new t,a=new t,i=new t,o=function(o,u,s,c,l){r(l)||(l=new t);var f,d,h,m,y,p,v,g;r(u.z)?(f=t.subtract(s,u,n),d=t.subtract(c,u,a),h=t.subtract(o,u,i),m=t.dot(f,f),y=t.dot(f,d),p=t.dot(f,h),v=t.dot(d,d),g=t.dot(d,h)):(f=e.subtract(s,u,n),d=e.subtract(c,u,a),h=e.subtract(o,u,i),m=e.dot(f,f),y=e.dot(f,d),p=e.dot(f,h),v=e.dot(d,d),g=e.dot(d,h));var w=1/(m*v-y*y);return l.y=(v*p-y*g)*w,l.z=(m*g-y*p)*w,l.x=1-l.y-l.z,l};return o}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)};r.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var n={high:0,low:0};r.fromCartesian=function(e,a){t(a)||(a=new r);var i=a.high,o=a.low;return r.encode(e.x,n),i.x=n.high,o.x=n.low,r.encode(e.y,n),i.y=n.high,o.y=n.low,r.encode(e.z,n),i.z=n.high,o.z=n.low,a};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"],function(e,t,r,n){"use strict";var a={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,a){return e>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(a)}),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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,0>i?[i,0]:[0,i];var c=n*n,l=4*e*a,f=r(c,-l,t.EPSILON14);if(0>f)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,m=o*s-d,y=o*c-u*s,p=u*c-h,v=4*m*p-y*y;if(0>v){var g,w,x;d*f>=l*h?(g=o,w=m,x=-2*u*m+o*y):(g=c,w=p,x=-c*y+2*s*p);var E=0>x?-1:1,S=-E*Math.abs(g)*Math.sqrt(-v); -i=-x+S;var O=i/2,M=0>O?-Math.pow(-O,1/3):Math.pow(O,1/3),T=i===S?-M:-w/M;return a=0>=w?M+T:-x/(M*M+T*T+w),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var b=m,_=-2*u*m+o*y,A=p,N=-c*y+2*s*p,I=Math.sqrt(v),P=Math.sqrt(3)/2,R=Math.abs(Math.atan2(o*I,-_)/3);a=2*Math.sqrt(-b);var z=Math.cos(R);i=a*z;var C=a*(-z/2-P*Math.sin(R)),D=i+C>2*u?i-u:C-u,L=o,U=D/L;R=Math.abs(Math.atan2(c*I,-N)/3),a=2*Math.sqrt(-A),z=Math.cos(R),i=a*z,C=a*(-z/2-P*Math.sin(R));var q=-c,F=2*s>i+C?i+s:C+s,B=q/F,W=L*F,G=-D*F-L*q,V=D*q,Y=(s*G-u*V)/(-u*G+s*W);return Y>=U?B>=U?B>=Y?[U,Y,B]:[U,B,Y]:[B,U,Y]:B>=U?[Y,U,B]:B>=Y?[Y,B,U]:[B,Y,U]}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=0>u?-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,0>u?[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 m=n.computeRealRoots(1,s,l);if(2===m.length){var y,p=m[0],v=m[1];if(p>=0&&v>=0){var g=Math.sqrt(p),w=Math.sqrt(v);return[d-w,d-g,d+g,d+w]}if(p>=0&&0>v)return y=Math.sqrt(p),[d-y,d+y];if(0>p&&v>=0)return y=Math.sqrt(v),[d-y,d+y]}return[]}if(h>0){var x=Math.sqrt(h),E=(s+h-c/x)/2,S=(s+h+c/x)/2,O=n.computeRealRoots(1,x,E),M=n.computeRealRoots(1,-x,S);return 0!==O.length?(O[0]+=d,O[1]+=d,0!==M.length?(M[0]+=d,M[1]+=d,O[1]<=M[0]?[O[0],O[1],M[0],M[1]]:M[1]<=O[0]?[M[0],M[1],O[0],O[1]]:O[0]>=M[0]&&O[1]<=M[1]?[M[0],O[0],O[1],M[1]]:M[0]>=O[0]&&M[1]<=O[1]?[O[0],M[0],M[1],O[1]]:O[0]>M[0]&&O[0]<M[1]?[M[0],O[0],M[1],O[1]]:[O[0],M[0],O[1],M[1]]):O):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 m,y,p=h[0],v=a-p,g=v*v,w=t/2,x=v/2,E=g-4*o,S=g+4*Math.abs(o),O=c-4*p,M=c+4*Math.abs(p);if(0>p||O*S>E*M){var T=Math.sqrt(O);m=T/2,y=0===T?0:(t*x-i)/T}else{var b=Math.sqrt(E);m=0===b?0:(t*x-i)/b,y=b/2}var _,A;0===w&&0===m?(_=0,A=0):r.sign(w)===r.sign(m)?(_=w+m,A=p/_):(A=w-m,_=p/A);var N,I;0===x&&0===y?(N=0,I=0):r.sign(x)===r.sign(y)?(N=x+y,I=o/N):(I=x-y,N=o/I);var P=n.computeRealRoots(1,_,N),R=n.computeRealRoots(1,A,I);if(0!==P.length)return 0!==R.length?P[1]<=R[0]?[P[0],P[1],R[0],R[1]]:R[1]<=P[0]?[R[0],R[1],P[0],P[1]]:P[0]>=R[0]&&P[1]<=R[1]?[R[0],P[0],P[1],R[1]]:R[0]>=P[0]&&R[1]<=P[1]?[P[0],R[0],R[1],P[1]]:P[0]>R[0]&&P[0]<R[1]?[R[0],P[0],R[1],P[1]]:[P[0],R[0],P[1],R[1]]:P;if(0!==R.length)return R}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,m=h*a,y=u*c*f-4*s*d-4*e*l*f+18*e*t*r*d-27*i*f*f+256*o*m+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 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,d=s/t,h=0>c?1:0;switch(h+=0>l?h+1:h,h+=0>f?h+1:h,h+=0>d?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 void 0}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=function(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n};return n.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},n}),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(t,n,a,o,u){u=r(u,!1);var s,c,l,f,d,h=t.origin,m=t.direction,y=e.subtract(a,n,p),E=e.subtract(o,n,v),S=e.cross(m,E,g),O=e.dot(y,S);if(u){if(O<i.EPSILON6)return void 0;if(s=e.subtract(h,n,w),l=e.dot(s,S),0>l||l>O)return void 0;if(c=e.cross(s,y,x),f=e.dot(m,c),0>f||l+f>O)return void 0;d=e.dot(E,c)/O}else{if(Math.abs(O)<i.EPSILON6)return void 0;var M=1/O;if(s=e.subtract(h,n,w),l=e.dot(s,S)*M,0>l||l>1)return void 0;if(c=e.cross(s,y,x),f=e.dot(m,c)*M,0>f||l+f>1)return void 0;d=e.dot(E,c)*M}return d}function f(e,t,r,n){var a=t*t-4*e*r;if(0>a)return void 0;if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);return 0===c?void 0:(n.root0=n.root1=c,n)}function d(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,g),l=e.dot(o,o),d=2*e.dot(o,c),h=e.magnitudeSquared(c)-s,m=f(l,d,h,S);return n(m)?(a.start=m.root0,a.stop=m.root1,a):void 0}function h(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 m(t,r,n,a,c){var l,f=a*a,d=c*c,m=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*d,y=c*(a*h(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+r.y),p=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*d+a*r.x+n,v=d*h(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),g=c*(a*h(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+r.z),w=[];if(0===g&&0===v){if(l=u.computeRealRoots(m,y,p),0===l.length)return w;var x=l[0],E=Math.sqrt(Math.max(1-x*x,0));if(w.push(new e(a,c*x,c*-E)),w.push(new e(a,c*x,c*E)),2===l.length){var S=l[1],O=Math.sqrt(Math.max(1-S*S,0));w.push(new e(a,c*S,c*-O)),w.push(new e(a,c*S,c*O))}return w}var M=g*g,T=v*v,b=m*m,_=g*v,A=b+T,N=2*(y*m+_),I=2*p*m+y*y-T+M,P=2*(p*y-_),R=p*p-M;if(0===A&&0===N&&0===I&&0===P)return w;l=s.computeRealRoots(A,N,I,P,R);var z=l.length;if(0===z)return w;for(var C=0;z>C;++C){var D,L=l[C],U=L*L,q=Math.max(1-U,0),F=Math.sqrt(q);D=i.sign(m)===i.sign(p)?h(m*U+p,y*L,i.EPSILON12):i.sign(p)===i.sign(y*L)?h(m*U,y*L+p,i.EPSILON12):h(m*U+y*L,p,i.EPSILON12);var B=h(v*L,g,i.EPSILON15),W=D*B;0>W?w.push(new e(a,c*L,c*F)):W>0?w.push(new e(a,c*L,c*-F)):0!==F?(w.push(new e(a,c*L,c*-F)),w.push(new e(a,c*L,c*F)),++C):w.push(new e(a,c*L,c*F))}return w}var y={};y.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)return void 0;var l=(-r.distance-e.dot(s,o))/c;return 0>l?void 0:(a=e.multiplyByScalar(u,l,a),e.add(o,a,a))};var p=new e,v=new e,g=new e,w=new e,x=new e;y.rayTriangle=function(t,r,a,i,o,u){var s=l(t,r,a,i,o);return!n(s)||0>s?void 0:(n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u))};var E=new c;y.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=E;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var f=l(c,a,i,o,u);return!n(f)||0>f||f>e.distance(t,r)?void 0:(n(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var S={root0:0,root1:0};y.raySphere=function(e,t,r){return r=d(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var O=new c;y.lineSegmentSphere=function(t,r,a,i){var o=O;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=d(o,a,i),!n(i)||i.stop<0||i.start>s?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i)};var M=new e,T=new e;y.rayEllipsoid=function(t,r){var n,a,i,o,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,M),l=e.multiplyComponents(s,t.direction,T),f=e.magnitudeSquared(c),d=e.dot(c,l);if(f>1){if(d>=0)return void 0;var h=d*d;if(n=f-1,a=e.magnitudeSquared(l),i=a*n,i>h)return void 0;if(h>i){o=d*d-i,u=-d+Math.sqrt(o);var m=u/a,y=n/u;return y>m?{start:m,stop:y}:{start:y,stop:m}}var p=Math.sqrt(n/a);return{start:p,stop:p}}return 1>f?(n=f-1,a=e.magnitudeSquared(l),i=a*n,o=d*d-i,u=-d+Math.sqrt(o),{start:0,stop:u/a}):0>d?(a=e.magnitudeSquared(l),{start:0,stop:-d/a}):void 0};var b=new e,_=new e,A=new e,N=new e,I=new e,P=new o,R=new o,z=new o,C=new o,D=new o,L=new o,U=new o,q=new e,F=new e,B=new t;y.grazingAltitudeLocation=function(t,r){var a=t.origin,u=t.direction,s=r.geodeticSurfaceNormal(a);if(e.dot(u,s)>=0)return a;var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u),f=e.normalize(l,b),d=e.mostOrthogonalAxis(l,N),h=e.normalize(e.cross(d,f,_),_),y=e.normalize(e.cross(f,h,A),A),p=P;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]=y.x,p[7]=y.y,p[8]=y.z;var v=o.transpose(p,R),g=o.fromScale(r.radii,z),w=o.fromScale(r.oneOverRadii,C),x=D;x[0]=0,x[1]=-u.z,x[2]=u.y,x[3]=u.z,x[4]=0,x[5]=-u.x,x[6]=-u.y,x[7]=u.x,x[8]=0;var E,S,O=o.multiply(o.multiply(v,w,L),x,L),M=o.multiply(o.multiply(O,g,U),p,U),T=o.multiplyByVector(O,a,I),W=m(M,e.negate(T,b),0,0,1),G=W.length;if(G>0){for(var V=e.clone(e.ZERO,F),Y=Number.NEGATIVE_INFINITY,j=0;G>j;++j){E=o.multiplyByVector(g,o.multiplyByVector(p,W[j],q),q);var k=e.normalize(e.subtract(E,a,N),N),H=e.dot(k,u);H>Y&&(Y=H,V=e.clone(E,V))}var X=r.cartesianToCartographic(V,B);return Y=i.clamp(Y,0,1),S=e.magnitude(e.subtract(V,a,N))*Math.sqrt(1-Y*Y),S=c?-S:S,X.height=S,r.cartographicToCartesian(X)}return void 0};var W=new e;return y.lineSegmentPlane=function(t,r,a,o){n(o)||(o=new e);var u=e.subtract(r,t,W),s=a.normal,c=e.dot(s,u);if(Math.abs(c)<i.EPSILON6)return void 0;var l=e.dot(s,t),f=-(a.distance+l)/c;return 0>f||f>1?void 0:(e.multiplyByScalar(u,f,o),e.add(t,o,o),o)},y.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 y.lineSegmentPlane(t,r,a,f),y.lineSegmentPlane(t,n,a,d),{positions:[t,r,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return y.lineSegmentPlane(r,n,a,f),y.lineSegmentPlane(r,t,a,d),{positions:[t,r,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return y.lineSegmentPlane(n,t,a,f),y.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 y.lineSegmentPlane(r,t,a,f),y.lineSegmentPlane(n,t,a,d),{positions:[t,r,n,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return y.lineSegmentPlane(n,r,a,f),y.lineSegmentPlane(t,r,a,d),{positions:[t,r,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return y.lineSegmentPlane(t,n,a,f),y.lineSegmentPlane(r,n,a,d),{positions:[t,r,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},y}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(t,r){this.normal=e.clone(t),this.distance=r};return r.fromPointNormal=function(n,a,i){var o=-e.dot(a,n);return t(i)?(e.clone(a,i.normal),i.distance=o,i):new r(a,o)},r.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},r}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};return r.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];o>u;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;a+1>l;l++)c[l]=0;for(var f=i+1,d=0;o>d;++d)f-c[n[d]]>i&&(c[n[d]]=f,++f);return(f-i+1)/(o/3)},r.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(;n>i;){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||-1===l)&&(l=s,c=d)),++f}return-1===c?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(;h>f;)d>l&&(l=d),++f,d=o[f];if(-1===l)return 0;++l}for(var m=[],y=0;l>y;y++)m[y]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var p=0;h>f;)m[o[f]].vertexTriangles.push(p),++m[o[f]].numLiveTriangles,m[o[f+1]].vertexTriangles.push(p),++m[o[f+1]].numLiveTriangles,m[o[f+2]].vertexTriangles.push(p),++m[o[f+2]].numLiveTriangles,++p,f+=3;var v=0,g=s+1;i=1;var w,x,E=[],S=[],O=0,M=[],T=c/3,b=[];for(y=0;T>y;y++)b[y]=!1;for(var _,A;-1!==v;){E=[],x=m[v],A=x.vertexTriangles.length;for(var N=0;A>N;++N)if(p=x.vertexTriangles[N],!b[p]){b[p]=!0,f=p+p+p;for(var I=0;3>I;++I)_=o[f],E.push(_),S.push(_),M[O]=_,++O,w=m[_],--w.numLiveTriangles,g-w.timeStamp>s&&(w.timeStamp=g,++g),++f}v=a(o,s,E,m,g,S,l)}return M},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,r,n,a,i,o,u,s,c,l,f,d,h,m,y,p,v,g,w,x,E,S,O,M){"use strict";function T(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function b(e){for(var t=e.length,r=6*(t/3),n=p.createTypedArray(t,r),a=0,i=0;t>i;i+=3,a+=6)T(n,a,e[i],e[i+1],e[i+2]);return n}function _(e){var t=e.length;if(t>=3){var r=6*(t-2),n=p.createTypedArray(t,r);T(n,0,e[0],e[1],e[2]);for(var a=6,i=3;t>i;++i,a+=6)T(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function A(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;t>o;++o,i+=6)T(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function N(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 I(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;n>i;i+=3)a.unpack(r,i,Q),E.multiplyByPoint(e,Q,Q),a.pack(Q,r,i)}function R(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;n>i;i+=3)a.unpack(r,i,Q),x.multiplyByVector(e,Q,Q),Q=a.normalize(Q,Q),a.pack(Q,r,i)}function z(e){var t,r=e.length,n={},a=e[0].geometry.attributes;for(t in a)if(a.hasOwnProperty(t)&&c(a[t])&&c(a[t].values)){for(var i=a[t],o=i.values.length,s=!0,l=1;r>l;++l){var f=e[l].geometry.attributes[t];if(!c(f)||i.componentDatatype!==f.componentDatatype||i.componentsPerAttribute!==f.componentsPerAttribute||i.normalize!==f.normalize){s=!1;break}o+=f.values.length}s&&(n[t]=new m({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:u.createTypedArray(i.componentDatatype,o)}))}return n}function C(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function D(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;t>a;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=O.TRIANGLES,e}function L(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;t-1>a;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,t>a+2&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=O.TRIANGLES,e}function U(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function q(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;t>a;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=O.LINES,e}function F(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;t>a;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=O.LINES,e}function B(e){switch(e.primitiveType){case O.TRIANGLE_FAN:return D(e);case O.TRIANGLE_STRIP:return L(e);case O.TRIANGLES:return C(e);case O.LINE_STRIP:return q(e);case O.LINE_LOOP:return F(e);case O.LINES:return U(e)}return e}function W(e,t){Math.abs(e.y)<w.EPSILON11&&(e.y=t?-w.EPSILON11:w.EPSILON11)}function G(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,ht),e.y/(e.y-t.y),ht),r),a.clone(r,n),W(r,!0),W(n,!1)}function V(e,t,r){if(e.x>=0||t.x>=0||r.x>=0)return void 0;var n=e.y<0,a=t.y<0,i=r.y<0;W(e,n),W(t,a),W(r,i);var o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=gt.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(G(e,t,mt,pt),G(e,r,yt,vt),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(G(t,r,mt,pt),G(t,e,yt,vt),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(G(r,e,mt,pt),G(r,t,yt,vt),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||(G(r,e,mt,pt),G(r,t,yt,vt),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(G(t,r,mt,pt),G(t,e,yt,vt),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(G(e,t,mt,pt),G(e,r,yt,vt),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=gt.positions;return s[0]=e,s[1]=t,s[2]=r,gt.length=3,(1===o||2===o)&&(s[3]=mt,s[4]=yt,s[5]=pt,s[6]=vt,gt.length=7),gt}function Y(e,r,i,o,u,s,l,f){if(c(u)||c(s)||c(l)||c(f)){var d,h,m,y,p,v,g,w,x,E,S,O,M=o.positions,T=M[0],b=M[1],_=M[2],A=wt,N=xt,I=Et,P=St,R=Ot,z=Mt;c(u)&&(d=a.fromArray(u,3*e),h=a.fromArray(u,3*r),m=a.fromArray(u,3*i)),c(s)&&(y=a.fromArray(s,3*e),p=a.fromArray(s,3*r),v=a.fromArray(s,3*i)),c(l)&&(g=a.fromArray(l,3*e),w=a.fromArray(l,3*r),x=a.fromArray(l,3*i)),c(f)&&(E=n.fromArray(f,2*e),S=n.fromArray(f,2*r),O=n.fromArray(f,2*i));for(var C=3;C<M.length;++C){var D=M[C],L=t(D,T,b,_);if(c(u)){A=a.multiplyByScalar(d,L.x,A),N=a.multiplyByScalar(h,L.y,N),I=a.multiplyByScalar(m,L.z,I);var U=a.add(A,N,Tt);a.add(U,I,U),a.normalize(U,U),u.push(U.x,U.y,U.z)}if(c(s)){A=a.multiplyByScalar(y,L.x,A),N=a.multiplyByScalar(p,L.y,N),I=a.multiplyByScalar(v,L.z,I);var q=a.add(A,N,Tt);a.add(q,I,q),a.normalize(q,q),s.push(q.x,q.y,q.z)}if(c(l)){A=a.multiplyByScalar(g,L.x,A),N=a.multiplyByScalar(w,L.y,N),I=a.multiplyByScalar(x,L.z,I);var F=a.add(A,N,Tt);a.add(F,I,F),a.normalize(F,F),l.push(F.x,F.y,F.z)}if(c(f)){P=n.multiplyByScalar(E,L.x,P),R=n.multiplyByScalar(S,L.y,R),z=n.multiplyByScalar(O,L.z,z);var B=n.add(P,R,P);n.add(B,z,B),f.push(B.x,B.y)}}}}function j(e){for(var t=e.attributes,r=t.position.values,n=c(t.normal)?t.normal.values:void 0,i=c(t.binormal)?t.binormal.values:void 0,o=c(t.tangent)?t.tangent.values:void 0,s=c(t.st)?t.st.values:void 0,l=e.indices,f=Array.prototype.slice.call(r,0),d=c(n)?Array.prototype.slice.call(n,0):void 0,m=c(i)?Array.prototype.slice.call(i,0):void 0,y=c(o)?Array.prototype.slice.call(o,0):void 0,v=c(s)?Array.prototype.slice.call(s,0):void 0,g=[],w=l.length,x=0;w>x;x+=3){var E=l[x],S=l[x+1],O=l[x+2],M=a.fromArray(r,3*E),T=a.fromArray(r,3*S),b=a.fromArray(r,3*O),_=V(M,T,b);if(c(_))if(f[3*E+1]=_.positions[0].y,f[3*S+1]=_.positions[1].y,f[3*O+1]=_.positions[2].y,_.length>3){for(var A=f.length/3,N=0;N<_.indices.length;++N){var I=_.indices[N];3>I?g.push(l[x+I]):g.push(I-3+A)}for(var P=3;P<_.positions.length;++P){var R=_.positions[P];f.push(R.x,R.y,R.z)}Y(E,S,O,_,d,m,y,v)}else g.push(E,S,O);else g.push(E,S,O)}e.attributes.position.values=new Float64Array(f),c(d)&&(t.normal.values=u.createTypedArray(t.normal.componentDatatype,d)),c(m)&&(t.binormal.values=u.createTypedArray(t.binormal.componentDatatype,m)),c(y)&&(t.tangent.values=u.createTypedArray(t.tangent.componentDatatype,y)),c(v)&&(t.st.values=u.createTypedArray(t.st.componentDatatype,v));var z=h.computeNumberOfVertices(e);e.indices=p.createTypedArray(z,g)}function k(e){for(var t=e.attributes,r=t.position.values,n=e.indices,i=Array.prototype.slice.call(r,0),o=[],u=n.length,s=0;u>s;s+=2){var l=n[s],f=n[s+1],d=a.fromArray(r,3*l),m=a.fromArray(r,3*f);if(Math.abs(d.y)<w.EPSILON6&&(d.y=d.y<0?-w.EPSILON6:w.EPSILON6,i[3*l+1]=d.y),Math.abs(m.y)<w.EPSILON6&&(m.y=m.y<0?-w.EPSILON6:w.EPSILON6,i[3*f+1]=m.y),o.push(l),d.x<0||m.x<0){var y=g.lineSegmentPlane(d,m,bt);if(c(y)){var v=a.multiplyByScalar(a.UNIT_Y,5*w.EPSILON9,_t);d.y<0&&a.negate(v,v);var x=i.length/3;o.push(x,x+1);var E=a.add(y,v,At);i.push(E.x,E.y,E.z),a.negate(v,v),a.add(y,v,E),i.push(E.x,E.y,E.z)}}o.push(f)}e.attributes.position.values=new Float64Array(i);var S=h.computeNumberOfVertices(e);e.indices=p.createTypedArray(S,o)}function H(e){var t=e.attributes,r=t.position.values,o=c(t.st)?t.st.values:void 0,s=c(t.prevPosition)?t.prevPosition.values:void 0,l=c(t.nextPosition)?t.nextPosition.values:void 0,f=c(t.expandAndWidth)?t.expandAndWidth.values:void 0,d=c(t.color)?t.color.values:void 0;e.indices;for(var m=Array.prototype.slice.call(r,0),y=c(o)?Array.prototype.slice.call(o,0):void 0,v=c(s)?Array.prototype.slice.call(s,0):void 0,x=c(l)?Array.prototype.slice.call(l,0):void 0,E=c(f)?Array.prototype.slice.call(f,0):void 0,S=c(d)?Array.prototype.slice.call(d,0):void 0,O=[],M=m.length/3,T=0;M>T;T+=4){var b=T,_=T+1,A=T+2,N=a.fromArray(m,3*b,Pt),I=a.fromArray(m,3*_,Rt),P=a.fromArray(m,3*A,zt),R=a.equals(N,I);Math.abs(N.y)<w.EPSILON6&&(N.y=P.y<0?-w.EPSILON6:w.EPSILON6,m[3*b+1]=N.y),Math.abs(P.y)<w.EPSILON6&&(P.y=N.y<0?-w.EPSILON6:w.EPSILON6,m[3*A+1]=P.y),m[3*_+1]=I.y=R?N.y:P.y;var z=!1;if(N.x<0||P.x<0){var C=g.lineSegmentPlane(N,P,bt,Rt);if(c(C)){var D=a.multiplyByScalar(a.UNIT_Y,5*w.EPSILON9,Ct);N.y<0&&a.negate(D,D);var L=a.add(C,D,Dt);m.push(L.x,L.y,L.z),m.push(L.x,L.y,L.z),a.negate(D,D),a.add(C,D,L),m.push(L.x,L.y,L.z),m.push(L.x,L.y,L.z),v.push(N.x,N.y,N.z,N.x,N.y,N.z),v.push(N.x,N.y,N.z,N.x,N.y,N.z),x.push(P.x,P.y,P.z,P.x,P.y,P.z),x.push(P.x,P.y,P.z,P.x,P.y,P.z);var U=n.fromArray(E,2*b),q=Math.abs(U.y);E.push(-1,-q,1,-q),E.push(-1,q,1,q);var F=a.magnitudeSquared(a.subtract(C,N,Ct));if(F/=a.magnitudeSquared(a.subtract(P,N,Ct)),c(S)){var B=i.fromArray(S,4*b,Lt),W=i.fromArray(S,4*A,Lt),G=w.lerp(B.x,W.x,F),V=w.lerp(B.y,W.y,F),Y=w.lerp(B.z,W.z,F),j=w.lerp(B.w,W.w,F);S.push(G,V,Y,j),S.push(G,V,Y,j),S.push(G,V,Y,j),S.push(G,V,Y,j)}if(c(y)){var k=n.fromArray(y,2*b,Nt),H=n.fromArray(y,2*(T+3),It),X=w.lerp(k.x,H.x,F);y.push(X,k.y),y.push(X,H.y),y.push(X,k.y),y.push(X,H.y)}z=!0}}if(z){var Z=m.length/3-4;O.push(T,Z,T+1),O.push(T+1,Z,Z+1),O.push(Z+2,T+2,Z+3),O.push(Z+3,T+2,T+3)}else O.push(T,T+2,T+1),O.push(T+1,T+2,T+3)}t.position.values=new Float64Array(m),t.prevPosition.values=u.createTypedArray(t.prevPosition.componentDatatype,v),t.nextPosition.values=u.createTypedArray(t.nextPosition.componentDatatype,x),t.expandAndWidth.values=u.createTypedArray(t.expandAndWidth.componentDatatype,E),c(y)&&(t.st.values=u.createTypedArray(t.st.componentDatatype,y)),c(S)&&(t.color.values=u.createTypedArray(t.color.componentDatatype,S));var J=h.computeNumberOfVertices(e);e.indices=p.createTypedArray(J,O)}var X={};X.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case O.TRIANGLES:e.indices=b(t);break;case O.TRIANGLE_STRIP:e.indices=_(t);break;case O.TRIANGLE_FAN:e.indices=A(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=O.LINES}return e},X.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;o>d;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 y,p=e.boundingSphere;return c(p)&&(y=new r(p.center,p.radius+n)),new h({attributes:{position:new m({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:O.LINES,boundingSphere:y})},X.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;o>t;++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},X.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;t>a;a++)n[a]=-1;for(var i,o=r,s=o.length,l=p.createTypedArray(t,s),f=0,d=0,m=0;s>f;)i=n[o[f]],-1!==i?l[d]=i:(i=o[f],n[i]=m,l[d]=m,++m),++f,++d;e.indices=l;var y=e.attributes;for(var v in y)if(y.hasOwnProperty(v)&&c(y[v])&&c(y[v].values)){for(var g=y[v],w=g.values,x=0,E=g.componentsPerAttribute,S=u.createTypedArray(g.componentDatatype,m*E);t>x;){var O=n[x];if(-1!==O)for(a=0;E>a;a++)S[E*O+a]=w[E*x+a];++x}g.values=S}}return e},X.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===O.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;n>i;i++)r[i]>a&&(a=r[i]);e.indices=M.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},X.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>w.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=N(e.attributes),s=e.indices,l=s.length;e.primitiveType===O.TRIANGLES?n=3:e.primitiveType===O.LINES?n=2:e.primitiveType===O.POINTS&&(n=1);for(var f=0;l>f;f+=n){for(var d=0;n>d;++d){var m=s[f+d],y=a[m];c(y)||(y=o++,a[m]=y,I(u,e.attributes,m)),i.push(y)}o+n>w.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere})),a=[],i=[],o=0,u=N(e.attributes))}0!==i.length&&t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere}))}else t.push(e);return t};var Z=new a,J=new o;X.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new d;for(var s=i.ellipsoid,f=o.values,h=new Float64Array(f.length),y=0,p=0;p<f.length;p+=3){var v=a.fromArray(f,p,Z),g=s.cartesianToCartographic(v,J);if(!c(g))throw new l("Could not project point ("+v.x+", "+v.y+", "+v.z+") to 2D.");var w=i.project(g,Z);h[y++]=w.x,h[y++]=w.y,h[y++]=w.z}return e.attributes[r]=o,e.attributes[n]=new m({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:h}),delete e.attributes[t],e};var K={high:0,low:0};X.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;o>l;++l)f.encode(i[l],K),s[l]=K.high,c[l]=K.low;var d=a.componentsPerAttribute;return e.attributes[r]=new m({componentDatatype:u.FLOAT,componentsPerAttribute:d,values:s}),e.attributes[n]=new m({componentDatatype:u.FLOAT,componentsPerAttribute:d,values:c}),delete e.attributes[t],e};var Q=new a,$=new E,et=new x;X.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(E.equals(t,E.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))&&(E.inverse(t,$),E.transpose($,$),E.getRotation($,et),R(et,n.normal),R(et,n.binormal),R(et,n.tangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=E.clone(E.IDENTITY),e};var tt=new a;X.combine=function(e){var t,n,i,o,u=e.length;e[0].modelMatrix;var s,l,f,d=c(e[0].geometry.indices),m=e[0].geometry.primitiveType,y=z(e);for(t in y)if(y.hasOwnProperty(t))for(s=y[t].values,o=0,n=0;u>n;++n)for(l=e[n].geometry.attributes[t].values,f=l.length,i=0;f>i;++i)s[o++]=l[i];var v;if(d){var g=0;for(n=0;u>n;++n)g+=e[n].geometry.indices.length;var w=h.computeNumberOfVertices(new h({attributes:y,primitiveType:O.POINTS})),x=p.createTypedArray(w,g),E=0,S=0;for(n=0;u>n;++n){var M=e[n].geometry.indices,T=M.length;for(o=0;T>o;++o)x[E++]=S+M[o];S+=h.computeNumberOfVertices(e[n].geometry)}v=x}var b,_=new a,A=0;for(n=0;u>n;++n){if(b=e[n].geometry.boundingSphere,!c(b)){_=void 0;break}a.add(b.center,_,_)}if(c(_))for(a.divideByScalar(_,u,_),n=0;u>n;++n){b=e[n].geometry.boundingSphere;var N=a.magnitude(a.subtract(b.center,_,tt))+b.radius;N>A&&(A=N)}return new h({attributes:y,indices:v,primitiveType:m,boundingSphere:c(_)?new r(_,A):void 0})};var rt=new a,nt=new a,at=new a,it=new a;X.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;i>f;f++)s[f]={indexOffset:0,count:0,currentCount:0};var d=0;for(f=0;o>f;f+=3){var h=t[f],y=t[f+1],p=t[f+2],v=3*h,g=3*y,w=3*p;nt.x=n[v],nt.y=n[v+1],nt.z=n[v+2],at.x=n[g],at.y=n[g+1],at.z=n[g+2],it.x=n[w],it.y=n[w+1],it.z=n[w+2],s[h].count++,s[y].count++,s[p].count++,a.subtract(at,nt,at),a.subtract(it,nt,it),c[d]=a.cross(at,it,new a),d++}var x=0;for(f=0;i>f;f++)s[f].indexOffset+=x,x+=s[f].count;d=0;var E;for(f=0;o>f;f+=3){E=s[t[f]];var S=E.indexOffset+E.currentCount;l[S]=d,E.currentCount++,E=s[t[f+1]],S=E.indexOffset+E.currentCount,l[S]=d,E.currentCount++,E=s[t[f+2]],S=E.indexOffset+E.currentCount,l[S]=d,E.currentCount++,d++}var O=new Float32Array(3*i);for(f=0;i>f;f++){var M=3*f;if(E=s[f],E.count>0){for(a.clone(a.ZERO,rt),d=0;d<E.count;d++)a.add(rt,c[l[E.indexOffset+d]],rt);a.normalize(rt,rt),O[M]=rt.x,O[M+1]=rt.y,O[M+2]=rt.z}else O[M]=0,O[M+1]=0,O[M+2]=1}return e.attributes.normal=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:O}),e};var ot=new a,ut=new a,st=new a;X.computeBinormalAndTangent=function(e){e.attributes;for(var t=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;s>l;l+=3){var y=t[l],p=t[l+1],v=t[l+2];f=3*y,d=3*p,h=3*v;var g=2*y,w=2*p,x=2*v,E=r[f],S=r[f+1],O=r[f+2],M=i[g],T=i[g+1],b=i[w+1]-T,_=i[x+1]-T,A=1/((i[w]-M)*_-(i[x]-M)*b),N=(_*(r[d]-E)-b*(r[h]-E))*A,I=(_*(r[d+1]-S)-b*(r[h+1]-S))*A,P=(_*(r[d+2]-O)-b*(r[h+2]-O))*A;c[f]+=N,c[f+1]+=I,c[f+2]+=P,c[d]+=N,c[d+1]+=I,c[d+2]+=P,c[h]+=N,c[h+1]+=I,c[h+2]+=P}var R=new Float32Array(3*o),z=new Float32Array(3*o);for(l=0;o>l;l++){f=3*l,d=f+1,h=f+2;var C=a.fromArray(n,f,ot),D=a.fromArray(c,f,st),L=a.dot(C,D);a.multiplyByScalar(C,L,ut),a.normalize(a.subtract(D,ut,D),D),z[f]=D.x,z[d]=D.y,z[h]=D.z,a.normalize(a.cross(C,D,D),D),R[f]=D.x,R[d]=D.y,R[h]=D.z}return e.attributes.tangent=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:z}),e.attributes.binormal=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:R}),e};var ct=new n,lt=new a,ft=new a,dt=new a;X.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 y=c(o)?o.length:s.length,p=c(o)?3:2,v=y/p,g=v,w=c(s)&&c(o)?2:1;w+=c(l)||c(f)?1:0,g*=w;for(var x=new Float32Array(g),E=0,S=0;v>S;++S){c(s)&&(n.fromArray(s,2*S,ct),x[E++]=e.compressTextureCoordinates(ct));var O=3*S;c(o)&&c(l)&&c(f)?(a.fromArray(o,O,lt),a.fromArray(l,O,ft),a.fromArray(f,O,dt),e.octPack(lt,ft,dt,ct),x[E++]=ct.x,x[E++]=ct.y):(c(o)&&(a.fromArray(o,O,lt),x[E++]=e.octEncodeFloat(lt)),c(l)&&(a.fromArray(l,O,lt),x[E++]=e.octEncodeFloat(lt)),c(f)&&(a.fromArray(f,O,lt),x[E++]=e.octEncodeFloat(lt)))}return t.attributes.compressedAttributes=new m({componentDatatype:u.FLOAT,componentsPerAttribute:w,values:x}),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 ht=new a,mt=new a,yt=new a,pt=new a,vt=new a,gt={positions:new Array(7),indices:new Array(9)},wt=new a,xt=new a,Et=new a,St=new n,Ot=new n,Mt=new n,Tt=new a,bt=S.fromPointNormal(a.ZERO,a.UNIT_Y),_t=new a,At=new a,Nt=new n,It=new n,Pt=new a,Rt=new a,zt=new a,Ct=new a,Dt=new a,Lt=new i;return new i,X.wrapLongitude=function(e){var t=e.boundingSphere;if(c(t)){var n=t.center.x-t.radius;if(n>0||r.intersect(t,i.UNIT_Y)!==v.INTERSECTING)return e -}if(e.geometryType!==y.NONE)switch(e.geometryType){case y.POLYLINES:H(e);break;case y.TRIANGLES:j(e);break;case y.LINES:k(e)}else B(e),e.primitiveType===O.TRIANGLES?j(e):e.primitiveType===O.LINES&&k(e);return e},X}),define("Core/Matrix2",["./Cartesian2","./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n,a){"use strict";var i=function(e,r,n,a){this[0]=t(e,0),this[1]=t(n,0),this[2]=t(r,0),this[3]=t(a,0)};i.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new i(e[0],e[2],e[1],e[3]):void 0},i.fromArray=function(e,n,a){return n=t(n,0),r(a)||(a=new i),a[0]=e[n],a[1]=e[n+1],a[2]=e[n+2],a[3]=e[n+3],a},i.fromColumnMajorArray=function(e,t){return i.clone(e,t)},i.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 i(e[0],e[1],e[2],e[3])},i.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new i(e.x,0,0,e.y)},i.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new i(e,0,0,e)},i.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 i(n,-a,a,n)},i.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]]},i.getElementIndex=function(e,t){return 2*e+t},i.getColumn=function(e,t,r){var n=2*t,a=e[n],i=e[n+1];return r.x=a,r.y=i,r},i.setColumn=function(e,t,r,n){n=i.clone(e,n);var a=2*t;return n[a]=r.x,n[a+1]=r.y,n},i.getRow=function(e,t,r){var n=e[t],a=e[t+2];return r.x=n,r.y=a,r},i.setRow=function(e,t,r,n){return n=i.clone(e,n),n[t]=r.x,n[t+2]=r.y,n};var o=new e;i.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],o)),r.y=e.magnitude(e.fromElements(t[2],t[3],o)),r};var u=new e;return i.getMaximumScale=function(t){return i.getScale(t,u),e.maximumComponent(u)},i.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},i.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},i.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},i.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},i.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},i.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},i.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},i.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},i.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]},i.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},i.IDENTITY=a(new i(1,0,0,1)),i.COLUMN0ROW0=0,i.COLUMN0ROW1=1,i.COLUMN1ROW0=2,i.COLUMN1ROW1=3,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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n"+"("+this[1]+", "+this[3]+")"},i}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,r,n,a){"use strict";var i=function(n,a,i){this.minimum=e.clone(t(n,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),r(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,n){if(r(n)||(n=new i),!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 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;f>d;d++){var h=t[d],m=h.x,y=h.y,p=h.z;a=Math.min(m,a),s=Math.max(m,s),o=Math.min(y,o),c=Math.max(y,c),u=Math.min(p,u),l=Math.max(p,l)}var v=n.minimum;v.x=a,v.y=o,v.z=u;var g=n.maximum;g.x=s,g.y=c,g.z=l;var w=e.add(v,g,n.center);return e.multiplyByScalar(w,.5,w),n},i.clone=function(t,n){return r(t)?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 i(t.minimum,t.maximum):void 0},i.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 i.intersect=function(t,r){o=e.subtract(t.maximum,t.minimum,o);var n=e.multiplyByScalar(o,.5,o),i=n.x*Math.abs(r.x)+n.y*Math.abs(r.y)+n.z*Math.abs(r.z),u=e.dot(t.center,r)+r.w;return u-i>0?a.INSIDE:0>u+i?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersect=function(e){return i.intersect(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),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(n){return i(n)}});return r}function i(e){var r=new n(function(r,n){try{return n?t(n(e)):i(e)}catch(a){return i(a)}});return r}function o(){function e(e,t,r){return d(e,t,r)}function r(e){return m(e)}function a(e){return m(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,m;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(t){n.progress(t)}}: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 y(f,e),e},m=function(e){return e=t(e),d=e.then,m=t,h=v,y(l,e),f=l=E,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){y(e)}function s(e){m(e)}var c,l,f,d,h,m,y,p,g,w;if(g=t.length>>>0,c=Math.max(0,Math.min(r,g)),f=[],l=g-c+1,d=[],h=o(),c)for(p=h.progress,y=function(e){d.push(e),--l||(m=y=v,h.reject(d))},m=function(e){f.push(e),--c||(m=y=v,h.resolve(f))},w=0;g>w;++w)w in t&&e(t[w],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,g).then(t,r,n)}function f(){return d(arguments,g)}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;a>s;s++)s in t?u(t[s],s):--i;else c.resolve(n);return c.promise})}function h(t,r){var n=x.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)})})},w.apply(t,n)})}function m(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 y(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 v(){}function g(e){return e}var w,x,E;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=m,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(E,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(E,t)})})}},x=[].slice,w=[].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(;a>i;++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(){"use strict";var e=function(e,t,r){for(var n,a,i=0,o=e.length-1;o>=i;)if(n=~~((i+o)/2),a=r(e[n],t),0>a)i=n+1;else{if(!(a>0))return n;o=n-1}return~(o+1)};return e}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";var e=function(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,m,y,p,v;if("%%"==e)return"%";for(var g=!1,w="",x=!1,E=!1,S=" ",O=s.length,M=0;s&&O>M;M++)switch(s.charAt(M)){case" ":w=" ";break;case"+":w="+";break;case"-":g=!0;break;case"'":S=s.charAt(M+1);break;case"0":x=!0;break;case"#":E=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(c=-c,g=!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,v=n?t[n.slice(0,-1)]:t[r++],d){case"s":return u(String(v),g,c,f,x,S);case"c":return u(String.fromCharCode(+v),g,c,f,x);case"b":return o(v,2,E,g,c,f,x);case"o":return o(v,8,E,g,c,f,x);case"x":return o(v,16,E,g,c,f,x);case"X":return o(v,16,E,g,c,f,x).toUpperCase();case"u":return o(v,10,E,g,c,f,x);case"i":case"d":return h=+v||0,h=Math.round(h-h%1),m=0>h?"-":w,v=m+a(String(Math.abs(h)),f,"0",!1),i(v,m,g,c,x);case"e":case"E":case"f":case"F":case"g":case"G":return h=+v,m=0>h?"-":w,y=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],v=m+Math.abs(h)[y](f),i(v,m,g,c,x)[p]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";var e=function(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(){"use strict";function e(e){return 0===e%4&&0!==e%100||0===e%400}return e}),define("Core/LeapSecond",[],function(){"use strict";var e=function(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 N.compare(e.julianDate,t.julianDate)}function f(e){g.julianDate=e;var r=N.leapSeconds,n=t(r,g,l);0>n&&(n=~n),n>=r.length&&(n=r.length-1);var a=r[n].offset;if(n>0){var i=N.secondsDifference(r[n].julianDate,e);i>a&&(n--,a=r[n].offset)}N.addSeconds(e,a,e)}function d(e,r){g.julianDate=e;var n=N.leapSeconds,a=t(n,g,l);if(0>a&&(a=~a),0===a)return N.addSeconds(e,-n[0].offset,r);if(a>=n.length)return N.addSeconds(e,-n[a-1].offset,r);var i=N.secondsDifference(n[a].julianDate,e);return 0===i?N.addSeconds(e,-n[a].offset,r):1>=i?void 0:N.addSeconds(e,-n[--a].offset,r)}function h(e,t,r){var n=0|t/s.SECONDS_PER_DAY;return e+=n,t-=s.SECONDS_PER_DAY*n,0>t&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function m(e,t,r,n,a,i,o){var u=0|(t-14)/12,c=e+4800+u,l=(0|1461*c/4)+(0|367*(t-2-12*u)/12)-(0|3*((c+100)/100)/4)+r-32075;n-=12,0>n&&(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]}var y=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,g=new u,w=/^(\d{4})$/,x=/^(\d{4})-(\d{2})$/,E=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,O=/^(\d{4})-?(\d{2})-?(\d{2})$/,M=/([Z+\-])?(\d{2})?:?(\d{2})?$/,T=/^(\d{2})(\.\d+)?/.source+M.source,b=/^(\d{2}):?(\d{2})(\.\d+)?/.source+M.source,_=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+M.source,A="Invalid ISO 8601 date.",N=function(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)};N.fromDate=function(e,t){var r=m(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 N(r[0],r[1],c.UTC)},N.fromIso8601=function(e,t){e=e.replace(",",".");var r,i,u,s=e.split("T"),l=1,d=1,y=0,g=0,M=0,I=0,P=s[0],R=s[1];if(!n(P))throw new a(A);var z;if(s=P.match(O),null!==s){if(z=P.split("-").length-1,z>0&&2!==z)throw new a(A);r=+s[1],l=+s[2],d=+s[3]}else if(s=P.match(x),null!==s)r=+s[1],l=+s[2];else if(s=P.match(w),null!==s)r=+s[1];else{var C;if(s=P.match(E),null!==s){if(r=+s[1],C=+s[2],u=o(r),1>C||u&&C>366||!u&&C>365)throw new a(A)}else{if(s=P.match(S),null===s)throw new a(A);r=+s[1];var D=+s[2],L=+s[3]||0;if(z=P.split("-").length-1,z>0&&(!n(s[3])&&1!==z||n(s[3])&&2!==z))throw new a(A);var U=new Date(Date.UTC(r,0,4));C=7*D+L-U.getUTCDay()-3}i=new Date(Date.UTC(r,0,1)),i.setUTCDate(C),l=i.getUTCMonth()+1,d=i.getUTCDate()}if(u=o(r),1>l||l>12||1>d||(2!==l||!u)&&d>p[l-1]||u&&2===l&&d>v)throw new a(A);var q;if(n(R)){if(s=R.match(_),null!==s){if(z=R.split(":").length-1,z>0&&2!==z&&3!==z)throw new a(A);y=+s[1],g=+s[2],M=+s[3],I=1e3*+(s[4]||0),q=5}else if(s=R.match(b),null!==s){if(z=R.split(":").length-1,z>0&&1!==z)throw new a(A);y=+s[1],g=+s[2],M=60*+(s[3]||0),q=4}else{if(s=R.match(T),null===s)throw new a(A);y=+s[1],g=60*+(s[2]||0),q=3}if(g>=60||M>=61||y>24||24===y&&(g>0||M>0||I>0))throw new a(A);var F=s[q],B=+s[q+1],W=+(s[q+2]||0);switch(F){case"+":y-=B,g-=W;break;case"-":y+=B,g+=W;break;case"Z":break;default:g+=new Date(Date.UTC(r,l-1,d,y,g)).getTimezoneOffset()}}else g+=new Date(Date.UTC(r,l-1,d)).getTimezoneOffset();var G=60===M;for(G&&M--;g>=60;)g-=60,y++;for(;y>=24;)y-=24,d++;for(i=u&&2===l?v:p[l-1];d>i;)d-=i,l++,l>12&&(l-=12,r++),i=u&&2===l?v:p[l-1];for(;0>g;)g+=60,y--;for(;0>y;)y+=24,d--;for(;1>d;)l--,1>l&&(l+=12,r--),i=u&&2===l?v:p[l-1],d+=i;var V=m(r,l,d,y,g,M,I);return n(t)?(h(V[0],V[1],t),f(t)):t=new N(V[0],V[1],c.UTC),G&&N.addSeconds(t,1,t),t},N.now=function(e){return N.fromDate(new Date,e)};var I=new N(0,0,c.TAI);return N.toGregorianDate=function(e,t){var r=!1,a=d(e,I);n(a)||(N.addSeconds(e,-1,I),a=d(I,I),r=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=0|o+68569,l=0|4*c/146097;c=0|c-(0|(146097*l+3)/4);var f=0|4e3*(c+1)/1461001;c=0|c-(0|1461*f/4)+31;var h=0|80*c/2447,m=0|c-(0|2447*h/80);c=0|h/11;var y=0|h+2-12*c,p=0|100*(l-49)+f+c,v=0|u/s.SECONDS_PER_HOUR,g=u-v*s.SECONDS_PER_HOUR,w=0|g/s.SECONDS_PER_MINUTE;g-=w*s.SECONDS_PER_MINUTE;var x=0|g,E=(g-x)/s.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),r&&(x+=1),n(t)?(t.year=p,t.month=y,t.day=m,t.hour=v,t.minute=w,t.second=x,t.millisecond=E,t.isLeapSecond=r,t):new i(p,y,m,v,w,x,E,r)},N.toDate=function(e){var t=N.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))},N.toIso8601=function(t,r){var a,i=N.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))},N.clone=function(e,t){return n(e)?n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new N(e.dayNumber,e.secondsOfDay,c.TAI):void 0},N.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},N.equals=function(e,t){return e===t||n(e)&&n(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},N.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(N.secondsDifference(e,t))<=r},N.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},N.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},N.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,n=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+n},N.computeTaiMinusUtc=function(e){g.julianDate=e;var r=N.leapSeconds,n=t(r,g,l);return 0>n&&(n=~n,--n,0>n&&(n=0)),r[n].offset},N.addSeconds=function(e,t,r){return h(e.dayNumber,e.secondsOfDay+t,r)},N.addMinutes=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,n,r)},N.addHours=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,n,r)},N.addDays=function(e,t,r){var n=e.dayNumber+t;return h(n,e.secondsOfDay,r)},N.lessThan=function(e,t){return N.compare(e,t)<0},N.lessThanOrEquals=function(e,t){return N.compare(e,t)<=0},N.greaterThan=function(e,t){return N.compare(e,t)>0},N.greaterThanOrEquals=function(e,t){return N.compare(e,t)>=0},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){return N.equalsEpsilon(this,e,t)},N.prototype.toString=function(){return N.toIso8601(this)},N.leapSeconds=[new u(new N(2441317,43210,c.TAI),10),new u(new N(2441499,43211,c.TAI),11),new u(new N(2441683,43212,c.TAI),12),new u(new N(2442048,43213,c.TAI),13),new u(new N(2442413,43214,c.TAI),14),new u(new N(2442778,43215,c.TAI),15),new u(new N(2443144,43216,c.TAI),16),new u(new N(2443509,43217,c.TAI),17),new u(new N(2443874,43218,c.TAI),18),new u(new N(2444239,43219,c.TAI),19),new u(new N(2444786,43220,c.TAI),20),new u(new N(2445151,43221,c.TAI),21),new u(new N(2445516,43222,c.TAI),22),new u(new N(2446247,43223,c.TAI),23),new u(new N(2447161,43224,c.TAI),24),new u(new N(2447892,43225,c.TAI),25),new u(new N(2448257,43226,c.TAI),26),new u(new N(2448804,43227,c.TAI),27),new u(new N(2449169,43228,c.TAI),28),new u(new N(2449534,43229,c.TAI),29),new u(new N(2450083,43230,c.TAI),30),new u(new N(2450630,43231,c.TAI),31),new u(new N(2451179,43232,c.TAI),32),new u(new N(2453736,43233,c.TAI),33),new u(new N(2454832,43234,c.TAI),34),new u(new N(2456109,43235,c.TAI),35)],N}),define("Core/clone",["./defaultValue"],function(e){"use strict";var t=function(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";var e=function(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";var r=function(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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,r,n,a,i){"use strict";function o(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function u(e,t){for(var r=o(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 s(e,r){r=t(r,"");var a=e[1],i=!!e[2],s=e[3];switch(r){case"":case"text":return o(i,s);case"arraybuffer":return u(i,s);case"blob":var c=u(i,s);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(o(i,s),a);case"json":return JSON.parse(o(i,s));default:throw new n("Unhandled responseType: "+r)}}var c=function(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,a=t(r.method,"GET"),i=r.data,o=r.headers,u=r.overrideMimeType,s=r.withCredentials;return e(r.url,function(t){var r=e.defer();return c.load(t,n,a,i,o,r,u,s),r.promise})},l=/^data:(.*?)(;base64)?,(.*)$/;return c.load=function(e,t,n,o,u,c,f,d){var h=l.exec(e);if(null!==h)return c.resolve(s(h,t)),void 0;var m=new XMLHttpRequest;if(r(f)&&r(m.overrideMimeType)&&m.overrideMimeType(f),m.open(n,e,!0),r(u))for(var y in u)u.hasOwnProperty(y)&&m.setRequestHeader(y,u[y]);r(t)&&(m.responseType=t),r(d)&&(m.withCredentials=d),m.onload=function(){200===m.status?r(m.response)?c.resolve(m.response):r(m.responseXML)&&m.responseXML.hasChildNodes()?c.resolve(m.responseXML):r(m.responseText)?c.resolve(m.responseText):c.reject(new i("unknown XMLHttpRequest response type.")):c.reject(new a(m.status,m.response,m.getAllResponseHeaders()))},m.onerror=function(){c.reject(new a)},m.send(o)},c.defaultLoad=c.load,c}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";var r=function(r,n){return e({url:r,headers:t(n)?n.headers:void 0,overrideMimeType:t(n)?n.overrideMimeType:void 0,withCredentials:t(n)?n.withCredentials:void 0})};return r}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";var a={Accept:"application/json,*/*;q=0.01"},i=function(r,i){return t(i)||(i={}),t(i.headers)?t(i.headers.Accept)||(i.headers=e(i.headers),i.headers.Accept=a.Accept):i.headers=a,n(r,i).then(function(e){return JSON.parse(e)})};return i}),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(e,t){return o.compare(e.julianDate,t)}function h(e,r){if(!n(r.columnNames))return e._dataError="Error in loaded EOP data: The columnNames property is required.",void 0;if(!n(r.samples))return e._dataError="Error in loaded EOP data: The samples property is required.",void 0;var a=r.columnNames.indexOf("modifiedJulianDateUtc"),i=r.columnNames.indexOf("xPoleWanderRadians"),s=r.columnNames.indexOf("yPoleWanderRadians"),c=r.columnNames.indexOf("ut1MinusUtcSeconds"),h=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),m=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),y=r.columnNames.indexOf("taiMinusUtcSeconds");if(0>a||0>i||0>s||0>c||0>h||0>m||0>y)return e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns",void 0;var p=e._samples=r.samples,v=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=m,e._taiMinusUtcSecondsColumn=y,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var g,w=e._addNewLeapSeconds,x=0,E=p.length;E>x;x+=e._columnCount){var S=p[x+a],O=p[x+y],M=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,T=new o(M,O,f.TAI);if(v.push(T),w){if(O!==g&&n(g)){var b=o.leapSeconds,_=t(b,T,d);if(0>_){var A=new u(T,O);b.splice(~_,0,A)}}g=O}}}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 y(e,t,r){return t+e*(r-t)}function p(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,p=r[d+e._ut1MinusUtcSecondsColumn],v=r[h+e._ut1MinusUtcSecondsColumn],g=v-p;if(g>.5||-.5>g){var w=r[d+e._taiMinusUtcSecondsColumn],x=r[h+e._taiMinusUtcSecondsColumn];w!==x&&(l.equals(n)?p=v:v-=x-w)}return u.xPoleWander=y(f,r[d+e._xPoleWanderRadiansColumn],r[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=y(f,r[d+e._yPoleWanderRadiansColumn],r[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=y(f,r[d+e._xCelestialPoleOffsetRadiansColumn],r[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=y(f,r[d+e._yCelestialPoleOffsetRadiansColumn],r[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=y(f,p,v),u}var v=function(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))h(this,t.data);else if(n(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){h(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else h(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})};return v.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}}),v.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},v.prototype.compute=function(e,r){if(!n(this._samples)){if(n(this._dataError))throw new c(this._dataError);return void 0}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),m=!n(d),y=m||o.greaterThanOrEquals(d,e);if(h&&y)return s=u,!m&&d.equals(e)&&++s,l=s+1,p(this,i,this._samples,e,s,l,r),r}var v=t(i,e,o.compare,this._dateColumn);return v>=0?(v<i.length-1&&i[v+1].equals(e)&&++v,s=v,l=v):(l=~v,s=l-1,0>s&&(s=0)),this._lastIndex=s,p(this,i,this._samples,e,s,l,r),r},v}),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()):(r.path=t.authority&&""==t.path?"/"+this.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];for(n&&t.shift(),""==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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","require"],function(e,t,r,n){"use strict";function a(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;r>t;++t){var n=e[t].getAttribute("src"),a=f.exec(n);if(null!==a)return a[1]}return void 0}function i(){if(t(s))return s;var n;if(n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:a(),!t(n))throw new r("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return s=new e(n).resolve(new e(document.location.href))}function o(e){return n.toUrl("../"+e)}function u(t){return new e(t).resolve(i()).toString()}var s,c,l,f=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i,d=function(e){t(c)||(c=t(n.toUrl)?o:u),t(l)||(l=document.createElement("a"));var r=c(e);return l.href=r,l.href=l.href,l.href};return d._cesiumScriptRegex=f,d}),define("Core/Iau2006XysSample",[],function(){"use strict";var e=function(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,t,r){var n=f;return n.dayNumber=t,n.secondsOfDay=r,i.daysDifference(n,e._sampleZeroDateTT)}function c(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=3*a*r._samplesPerXysFile,u=0,s=n.length;s>u;++u)t[o+u]=n[u];i.resolve()}),i.promise}var l=function(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;t>=s;++s){n[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;t>=c;++c)c!==s&&(n[s]*=s-c);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)},f=new i(0,0,u.TAI);return l.prototype.preload=function(t,r,n,a){var i=s(this,t,r),o=s(this,n,a),u=0|i/this._stepSizeDays-this._interpolationOrder/2;0>u&&(u=0);var l=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var f=0|u/this._samplesPerXysFile,d=0|l/this._samplesPerXysFile,h=[],m=f;d>=m;++m)h.push(c(this,m));return e.all(h)},l.prototype.computeXysRadians=function(e,t,r){var i=s(this,e,t);if(0>i)return void 0;var o=0|i/this._stepSizeDays;if(o>=this._totalSamples)return void 0;var u=this._interpolationOrder,l=o-(0|u/2);0>l&&(l=0);var f=l+u;f>=this._totalSamples&&(f=this._totalSamples-1,l=f-u,0>l&&(l=0));var d=!1,h=this._samples;if(n(h[3*l])||(c(this,0|l/this._samplesPerXysFile),d=!0),n(h[3*f])||(c(this,0|f/this._samplesPerXysFile),d=!0),d)return void 0;n(r)?(r.x=0,r.y=0,r.s=0):r=new a(0,0,0);var m,y,p=i-l*this._stepSizeDays,v=this._work,g=this._denominators,w=this._coef,x=this._xTable;for(m=0;u>=m;++m)v[m]=p-x[m];for(m=0;u>=m;++m){for(w[m]=1,y=0;u>=y;++y)y!==m&&(w[m]*=v[y]);w[m]*=g[m];var E=3*(l+m);r.x+=w[m]*h[E++],r.y+=w[m]*h[E++],r.s+=w[m]*h[E]}return r},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./TimeConstants"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,m,y,p){"use strict";var v={},g=new r,w=new r,x=new r;v.eastNorthUpToFixedFrame=function(e,t,n){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return i(n)?(n[0]=0,n[1]=1,n[2]=0,n[3]=0,n[4]=-o,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=o,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new y(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=g,s=w,l=x;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),i(n)?(n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=l.x,n[5]=l.y,n[6]=l.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 y(s.x,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var E=new r,S=new r,O=new r;v.northEastDownToFixedFrame=function(e,t,n){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return i(n)?(n[0]=-o,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]=-o,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new y(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=E,s=S,l=O;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),i(n)?(n[0]=l.x,n[1]=l.y,n[2]=l.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 y(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},v.northUpEastToFixedFrame=function(e,t,n){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return i(n)?(n[0]=-o,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=o,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 y(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=g,s=w,l=x;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,l),i(n)?(n[0]=l.x,n[1]=l.y,n[2]=l.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 y(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 M=24110.54841,T=8640184.812866,b=.093104,_=-62e-7,A=1.1772758384668e-19,N=72921158553e-15,I=h.TWO_PI/86400,P=new d;v.computeTemeToPseudoFixedMatrix=function(e,t){P=d.addSeconds(e,-d.computeTaiMinusUtc(e),P);var r,n=P.dayNumber,a=P.secondsOfDay,o=n-2451545;r=a>=43200?(o+.5)/p.DAYS_PER_JULIAN_CENTURY:(o-.5)/p.DAYS_PER_JULIAN_CENTURY;var u=M+r*(T+r*(b+r*_)),s=u*I%h.TWO_PI,c=N+A*(n-2451545.5),l=(a+.5*p.SECONDS_PER_DAY)%p.SECONDS_PER_DAY,f=s+c*l,y=Math.cos(f),v=Math.sin(f);return i(t)?(t[0]=y,t[1]=-v,t[2]=0,t[3]=v,t[4]=y,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(y,v,0,-v,y,0,0,0,1)},v.iau2006XysData=new l,v.earthOrientationParameters=u.NONE;var R=32.184,z=2451545;v.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+R,a=t.stop.dayNumber,i=t.stop.secondsOfDay+R,o=v.iau2006XysData.preload(r,n,a,i),u=v.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},v.computeIcrfToFixedMatrix=function(e,t){i(t)||(t=new m);var r=v.computeFixedToIcrfMatrix(e,t);return i(r)?m.transpose(r,t):void 0};var C=new f(0,0,0),D=new s(0,0,0,0,0,0),L=new m,U=new m;v.computeFixedToIcrfMatrix=function(e,t){i(t)||(t=new m);var r=v.earthOrientationParameters.compute(e,D);if(!i(r))return void 0;var n=e.dayNumber,a=e.secondsOfDay+R,o=v.iau2006XysData.computeXysRadians(n,a,C);if(!i(o))return void 0;var u=o.x+r.xPoleOffset,s=o.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=L;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(-o.s,U),y=m.multiply(l,f,L),g=e.dayNumber,w=e.secondsOfDay-d.computeTaiMinusUtc(e)+r.ut1MinusUtc,x=g-2451545,E=w/p.SECONDS_PER_DAY,S=.779057273264+E+.00273781191135448*(x+E);S=S%1*h.TWO_PI;var O=m.fromRotationZ(S,U),M=m.multiply(y,O,L),T=Math.cos(r.xPoleWander),b=Math.cos(r.yPoleWander),_=Math.sin(r.xPoleWander),A=Math.sin(r.yPoleWander),N=n-z+a/p.SECONDS_PER_DAY;N/=36525;var I=-47e-6*N*h.RADIANS_PER_DEGREE/3600,P=Math.cos(I),q=Math.sin(I),F=U;return F[0]=T*P,F[1]=T*q,F[2]=_,F[3]=-b*q+A*_*P,F[4]=b*P+A*_*q,F[5]=-A*T,F[6]=-A*q-b*_*P,F[7]=A*P-b*_*q,F[8]=b*T,m.multiply(M,F,t)};var q=new n;return 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,o){i(o)||(o=new t);var u=q;return y.multiplyByVector(e,n.fromElements(a.x,a.y,a.z,1,u),u),n.multiplyByScalar(u,1/u.w,u),y.multiplyByVector(r,u,u),t.fromCartesian4(u,o)},v}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h){"use strict";var m=new n,y=function(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var n=h.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=r.fromCartesian4(l.getColumn(n,0,m)),this._yAxis=r.fromCartesian4(l.getColumn(n,1,m));var i=r.fromCartesian4(l.getColumn(n,2,m));this._plane=f.fromPointNormal(e,i)};o(y.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}}});var p=new e;y.fromPoints=function(t,r){var n=e.fromPoints(t,p);return new y(n.center,r)};var v=new d,g=new r;y.prototype.projectPointOntoPlane=function(e,n){var a=v;a.origin=e,r.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,g);if(i(o)||(r.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,g)),i(o)){var u=r.subtract(o,this._origin,o),s=r.dot(this._xAxis,u),l=r.dot(this._yAxis,u);return i(n)?(n.x=s,n.y=l,n):new t(s,l)}return void 0},y.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var r=0,n=e.length,a=0;n>a;a++){var o=this.projectPointOntoPlane(e[a],t[r]);i(o)&&(t[r]=o,r++)}return t.length=r,t};var w=new r;return y.prototype.projectPointsOntoEllipsoid=function(e,t){var n=e.length;i(t)?t.length=n:t=new Array(n);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=w,l=0;n>l;++l){var f=e[l];r.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new r);var d=r.add(o,c,t[l]);r.multiplyByScalar(s,f.y,c),r.add(d,c,d),a.scaleToGeocentricSurface(d,d)}return t},y}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";var r=new t,n=function(t,n,a,i){return e(t,n,a,i,r),r.x>0&&r.y>0&&r.z>0};return n}),define("Core/Queue",[],function(){"use strict";var e=function(){this._array=[],this._offset=0,this.length=0};return e.prototype.enqueue=function(e){this._array.push(e),this.length++},e.prototype.dequeue=function(){if(0===this.length)return void 0;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},e.prototype.contains=function(e){return-1!==this._array.indexOf(e)},e.prototype.clear=function(){this._array.length=this._offset=this.length=0},e.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},e}),define("Core/WindingOrder",["./freezeObject"],function(e){"use strict";var t={CLOCKWISE:2304,COUNTER_CLOCKWISE:2305,validate:function(e){return e===t.CLOCKWISE||e===t.COUNTER_CLOCKWISE}};return e(t)}),define("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,m){"use strict";function y(t,r,n){var a=e.subtract(r,t,q),i=e.subtract(n,r,F);return a.x*i.y-a.y*i.x>=0}function p(e){for(var t=e[0].x,r=0,n=0;n<e.length;n++)e[n].x>t&&(t=e[n].x,r=n);return r}function v(e){for(var t=e[0][0].x,r=0,n=0;n<e.length;n++){var a=e[n][p(e[n])].x;a>t&&(t=a,r=n)}return r}function g(e){for(var t=[],r=0;r<e.length;r++){var n=e[(r-1+e.length)%e.length],a=e[r],i=e[(r+1)%e.length];y(n,a,i)||t.push(a)}return t}function w(t,r){for(var n=0;n<t.length;n++)if(e.equals(r,t[n]))return n;return-1}function x(r,a,i){i=n(i,[]);var o=Number.MAX_VALUE,u=p(a),s=new e(a[u].x,r.y);i.push(u),i.push((u+1)%a.length);for(var c=a[0].x,l=c,f=1;f<a.length;++f)a[f].x<c?c=a[f].x:a[f].x>l&&(l=a[f].x);l+=l-c;var d=new t(l,r.y,0);for(f=0;f<a.length;f++){var h=a[f],m=a[(f+1)%a.length];if((h.x>=r.x||m.x>=r.x)&&(h.y>=r.y&&m.y<=r.y||h.y<=r.y&&m.y>=r.y)){var y=(m.y-h.y)*(d.x-r.x)-(m.x-h.x)*(d.y-r.y);if(0!==y){y=1/y;var v=((m.x-h.x)*(r.y-h.y)-(m.y-h.y)*(r.x-h.x))*y,g=((d.x-r.x)*(r.y-h.y)-(d.y-r.y)*(r.x-h.x))*y;if(v>=0&&1>=v&&g>=0&&1>=g){var w=new e(r.x+v*(d.x-r.x),r.y+v*(d.y-r.y)),x=e.subtract(w,r,B);y=e.magnitudeSquared(x),o>y&&(s=w,o=y,i[0]=f,i[1]=(f+1)%a.length)}}}}return s}function E(t,r){var n=v(r),a=r[n],i=p(a),o=a[i],u=[],s=x(o,t,u),c=w(t,s);if(-1!==c)return c;var d=e.magnitudeSquared(e.subtract(t[u[0]],o,W)),h=e.magnitudeSquared(e.subtract(t[u[1]],o,W)),m=h>d?t[u[0]]:t[u[1]],y=g(t),E=y.indexOf(m);-1!==E&&y.splice(E,1);for(var S=[],O=0;O<y.length;O++){var M=y[O];f(M,o,s,m)&&S.push(M)}var T=Number.MAX_VALUE;if(S.length>0){var b=e.fromElements(1,0,W);for(O=0;O<S.length;O++){var _=e.subtract(S[O],o,G),A=e.magnitude(b)*e.magnitudeSquared(_);if(0!==A){var N=Math.abs(l.acosClamped(e.dot(b,_)/A));T>N&&(T=N,m=S[O])}}}return t.indexOf(m)}function S(e,r,n){for(var a=ut.computeWindingOrder2D(e),i=0;i<r.length;i++){var o=r[i];t.equals(o[0],o[o.length-1])||o.push(o[0]);var s=ut.computeWindingOrder2D(o);s===a&&o.reverse()}var c=u.fromPoints(e,n),l=c.projectPointsOntoPlane(e),f=[];for(i=0;i<r.length;i++)f.push(c.projectPointsOntoPlane(r[i]));var d=E(l,f),h=v(f),m=p(f[h]),y=r[h],g=[];for(i=0;i<e.length;i++)g.push(e[i]);var w,x=[];if(0!==m)for(w=0;w<=y.length;w++){var S=(w+m)%y.length;0!==S&&x.push(y[S])}else for(w=0;w<y.length;w++)x.push(y[(w+m)%y.length]);var O=g.lastIndexOf(e[d]);x.push(e[O]);var M=g.slice(0,O+1),T=g.slice(O+1);return g=M.concat(x,T),r.splice(h,1),g}function O(e){var t="0."+Math.sin(V).toString().substr(5);V+=.2;var r=Math.floor(t*e);return r===e&&r--,r}function M(t,r,n){return T(t,r,n)&&T(r,t,n)&&!C(n[t].position,n[r].position,n)&&!e.equals(n[t].position,n[r].position)}function T(t,r,n){A(t,n);var a=n[t],i=n[r],o=_(t,n,Y),u=_(t,n,j),s=e.subtract(n[o].position,a.position,k),c=e.subtract(n[u].position,a.position,H),l=e.subtract(i.position,a.position,X);return N(s,l)?b(s,l):N(c,l)?b(c,l):I(s,c)?z(s,c,l)?!0:!1:P(s,c)?R(s,c,l)?!1:!0:void 0}function b(t,r){return e.magnitude(r)<e.magnitude(t)}function _(e,t,r){var n=e+r;return 0>n&&(n=t.length-1),n===t.length&&(n=0),A(n,t),n}function A(t,r){var n=t-1,a=t+1;0>n&&(n=r.length-1),a===r.length&&(a=0);var o=e.subtract(r[n].position,r[t].position,Z),u=e.subtract(r[a].position,r[t].position,J);if(N(o,u)){var s=new i("Superfluous vertex found.");throw s.vertexIndex=t,s}}function N(e,r){return 0===t.cross(e,r,K).z}function I(e,r){return t.cross(e,r,Q).z<0}function P(e,r){return t.cross(e,r,$).z>0}function R(e,r,n){return t.cross(e,n,et).z>0&&t.cross(n,r,et).z>0}function z(e,r,n){return t.cross(e,n,tt).z<0&&t.cross(n,r,tt).z<0}function C(t,r,n){for(var a=0;a<n.length;a++){var i,o=n[a].position;if(i=a<n.length-1?n[a+1].position:n[0].position,!(e.equals(t,o)||e.equals(r,i)||e.equals(t,i)||e.equals(r,o))){var u=(r.y-t.y)/(r.x-t.x),s=(i.y-o.y)/(i.x-o.x);if(!(u===s||isNaN(u)&&isNaN(s))){var c;c=isNaN(u)?t.x:isNaN(s)?o.x:(t.y-o.y-u*t.x+s*o.x)/(s-u);var l=u*c+t.y-u*t.x,f=e.fromElements(c,l,rt);if(!(e.equals(f,t)||e.equals(f,r)||e.equals(f,o)||e.equals(f,i))){var d=L(c,t.x,r.x)&&L(l,t.y,r.y)&&L(c,o.x,i.x)&&L(l,o.y,i.y);if(d)return!0}}}}return!1}function D(t){var r=t[0].position,n=t[1].position,a=t[2].position,i=e.subtract(n,r,nt),o=e.subtract(a,r,at);return N(i,o)}function L(e,t,r){return(e>t||e>r)&&(t>e||r>e)||t===r&&t===e}function U(e){var t=e.length;if(3===t)return D(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new i("Invalid polygon: must have at least three vertices.");for(var r=!1,n=0;!r;){var a=10*e.length;if(n>a)return[];n++;for(var o=O(e.length),u=o+1;Math.abs(o-u)<2||Math.abs(o-u)>e.length-2;)u=O(e.length);if(o>u){var s=o;o=u,u=s}try{if(M(o,u,e)){var c=e.splice(o,u-o+1,e[o],e[u]);return U(e).concat(U(c))}}catch(l){if(l.hasOwnProperty("vertexIndex"))return e.splice(l.vertexIndex,1),U(e);throw l}}}var q=new e,F=new e,B=new e,W=new e(1,0),G=new e,V=0,Y=-1,j=1,k=new t,H=new t,X=new t,Z=new t,J=new t,K=new t,Q=new t,$=new t,et=new t,tt=new t,rt=new e,nt=new t,at=new t,it=new t,ot=new t,ut={};return ut.removeDuplicates=function(e){for(var r=e.length,n=[],a=r-1,i=0;r>i;a=i++){var o=e[a],u=e[i];t.equals(o,u)||n.push(u)}return n},ut.computeArea2D=function(e){for(var t=e.length,r=0,n=t-1,a=0;t>a;n=a++){var i=e[n],o=e[a];r+=i.x*o.y-o.x*i.y}return.5*r},ut.computeWindingOrder2D=function(e){var t=ut.computeArea2D(e);return t>0?m.COUNTER_CLOCKWISE:m.CLOCKWISE},ut.triangulate=function(e){for(var t=e.length,r=[],n=0;t>n;++n)r[n]={position:e[n],index:n};return U(r)},ut.resetSeed=function(e){V=n(e,0)},ut.computeSubdivision=function(e,a,i){i=n(i,l.RADIANS_PER_DEGREE);for(var o=new h,u=a.length,f=0;u>f;f+=3)o.enqueue({i0:a[f],i1:a[f+1],i2:a[f+2]});for(var m,y=e.slice(0),p=[],v={};o.length>0;){var g,w,x=o.dequeue(),E=y[x.i0],S=y[x.i1],O=y[x.i2],M=t.angleBetween(E,S),T=t.angleBetween(S,O),b=t.angleBetween(O,E),_=Math.max(M,Math.max(T,b));_>i?M===_?(g=Math.min(x.i0,x.i1).toString()+" "+Math.max(x.i0,x.i1).toString(),m=v[g],m||(w=t.add(E,S,new t),t.multiplyByScalar(w,.5,w),y.push(w),m=y.length-1,v[g]=m),o.enqueue({i0:x.i0,i1:m,i2:x.i2}),o.enqueue({i0:m,i1:x.i1,i2:x.i2})):T===_?(g=Math.min(x.i1,x.i2).toString()+" "+Math.max(x.i1,x.i2).toString(),m=v[g],m||(w=t.add(S,O,new t),t.multiplyByScalar(w,.5,w),y.push(w),m=y.length-1,v[g]=m),o.enqueue({i0:x.i1,i1:m,i2:x.i0}),o.enqueue({i0:m,i1:x.i2,i2:x.i0})):b===_&&(g=Math.min(x.i2,x.i0).toString()+" "+Math.max(x.i2,x.i0).toString(),m=v[g],m||(w=t.add(O,E,new t),t.multiplyByScalar(w,.5,w),y.push(w),m=y.length-1,v[g]=m),o.enqueue({i0:x.i2,i1:m,i2:x.i1}),o.enqueue({i0:m,i1:x.i0,i2:x.i1})):(p.push(x.i0),p.push(x.i1),p.push(x.i2))}var A=y.length,N=new Array(3*A),I=0;for(m=0;A>m;m++){var P=y[m];N[I++]=P.x,N[I++]=P.y,N[I++]=P.z}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:N})},indices:p,primitiveType:d.TRIANGLES})},ut.scaleToGeodeticHeight=function(e,r,i,u){i=n(i,o.WGS84);var s=it,c=ot;if(r=n(r,0),u=n(u,!0),a(e)&&a(e.attributes)&&a(e.attributes.position))for(var l=e.attributes.position.values,f=l.length,d=0;f>d;d+=3)t.fromArray(l,d,c),u&&(c=i.scaleToGeodeticSurface(c,c)),s=i.geodeticSurfaceNormal(c,s),t.multiplyByScalar(s,r,s),t.add(c,s,c),l[d]=c.x,l[d+1]=c.y,l[d+2]=c.z;return e},ut.eliminateHoles=function(e,r,a){a=n(a,o.WGS84);for(var i=[],u=0;u<r.length;u++){for(var s=[],c=0;c<r[u].length;c++)s.push(t.clone(r[u][c]));i.push(s)}for(var l=e;i.length>0;)l=S(l,i,a);return l},ut}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,n,a,i,o,u){"use strict";var s=function(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)},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],m=e[u.COLUMN2ROW2],y=d+h+m;if(y>0)n=Math.sqrt(y+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,v=0;h>d&&(v=1),m>d&&m>h&&(v=2);var g=p[v],w=p[g];n=Math.sqrt(e[u.getElementIndex(v,v)]-e[u.getElementIndex(g,g)]-e[u.getElementIndex(w,w)]+1);var x=f;x[v]=.5*n,n=.5/n,c=(e[u.getElementIndex(w,g)]-e[u.getElementIndex(g,w)])*n,x[g]=(e[u.getElementIndex(g,v)]+e[u.getElementIndex(v,g)])*n,x[w]=(e[u.getElementIndex(w,v)]+e[u.getElementIndex(v,w)])*n,a=-x[0],i=-x[1],o=-x[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 e,h=new e,m=new s,y=new s,p=new s;s.packedLength=4,s.pack=function(e,r,n){n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w},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,p),s.conjugate(p,p);for(var a=0,i=r-t+1;i>a;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,d);var u=s.computeAngle(m);n[o]=d.x*u,n[o+1]=d.y*u,n[o+2]=d.z*u}},s.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new s),e.fromArray(t,0,h);var u=e.magnitude(h);return s.unpack(n,4*i,y),0===u?s.clone(s.IDENTITY,m):s.fromAxisAngle(h,u,m),s.multiply(m,y,o)},s.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w):void 0},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,m=o*l-n*u-a*s-i*c;return r.x=f,r.y=d,r.z=h,r.w=m,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 v=new s;s.lerp=function(e,t,r,n){return v=s.multiplyByScalar(t,r,v),n=s.multiplyByScalar(e,1-r,n),s.add(v,n,n)};var g=new s,w=new s,x=new s;s.slerp=function(e,t,r,n){var a=s.dot(e,t),i=t;if(0>a&&(a=-a,i=g=s.negate(t,g)),1-a<o.EPSILON6)return s.lerp(e,i,r,n);var u=Math.acos(a);return w=s.multiplyByScalar(e,Math.sin((1-r)*u),w),x=s.multiplyByScalar(i,Math.sin(r*u),x),n=s.add(w,x,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 E=new e,S=new e,O=new s,M=new s;s.computeInnerQuadrangle=function(t,r,n,a){var i=s.conjugate(r,O);s.multiply(i,n,M);var o=s.log(M,E);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,O),s.multiply(r,O,a)},s.squad=function(e,t,r,n,a,i){var o=s.slerp(e,t,a,O),u=s.slerp(r,n,a,M);return s.slerp(o,u,2*a*(1-a),i)};for(var T=new s,b=1.9011074535173003,_=a.supportsTypedArrays()?new Float32Array(8):[],A=a.supportsTypedArrays()?new Float32Array(8):[],N=a.supportsTypedArrays()?new Float32Array(8):[],I=a.supportsTypedArrays()?new Float32Array(8):[],P=0;7>P;++P){var R=P+1,z=2*R+1;_[P]=1/(R*z),A[P]=R/z}return _[7]=b/136,A[7]=8*b/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)N[f]=(_[f]*c-A[f])*o,I[f]=(_[f]*l-A[f])*o;var d=a*r*(1+N[0]*(1+N[1]*(1+N[2]*(1+N[3]*(1+N[4]*(1+N[5]*(1+N[6]*(1+N[7])))))))),h=u*(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=s.multiplyByScalar(e,h,T);return s.multiplyByScalar(t,d,n),s.add(m,n,n)},s.fastSquad=function(e,t,r,n,a,i){var o=s.fastSlerp(e,t,a,O),u=s.fastSlerp(r,n,a,M);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";var s=Math.cos,c=Math.sin,l=Math.sqrt,f={};f.computePosition=function(e,t,n,a,i){var u=e.ellipsoid.radiiSquared,f=e.nwCorner,d=e.rectangle,h=f.latitude-e.granYCos*t+n*e.granXSin,m=s(h),y=c(h),p=u.z*y,v=f.longitude+t*e.granYSin+n*e.granXCos,g=m*s(v),w=m*c(v),x=u.x*g,E=u.y*w,S=l(x*g+E*w+p*y);a.x=x/S,a.y=E/S,a.z=p/S,r(e.vertexFormat)&&e.vertexFormat.st&&(i.x=(v-d.west)*e.lonScalar-.5,i.y=(h-d.south)*e.latScalar-.5,o.multiplyByVector(e.textureMatrix,i,i),i.x+=.5,i.y+=.5)};var d=new o,h=new e,m=new t,y=new e,p=new a;return f.computeOptions=function(t,a,s){var c,l,f,v,g,w=t._granularity,x=t._ellipsoid,E=t._surfaceHeight,S=t._rotation,O=t._extrudedHeight,M=a.east,T=a.west,b=a.north,_=a.south,A=b-_;T>M?(g=i.TWO_PI-T+M,c=Math.ceil(g/w)+1,l=Math.ceil(A/w)+1,f=g/(c-1),v=A/(l-1)):(g=M-T,c=Math.ceil(g/w)+1,l=Math.ceil(A/w)+1,f=g/(c-1),v=A/(l-1)),s=u.northwest(a,s);var N=u.center(a,m),I=v,P=f,R=0,z=0;if(r(S)){var C=Math.cos(S);I*=C,P*=C;var D=Math.sin(S);R=v*D,z=f*D,h=p.project(s,h),y=p.project(N,y),h=e.subtract(h,y,h);var L=o.fromRotation(S,d);h=o.multiplyByVector(L,h,h),h=e.add(h,y,h),s=p.unproject(h,s);var U=s.latitude,q=U+(c-1)*z,F=U-I*(l-1),B=U-I*(l-1)+(c-1)*z;b=Math.max(U,q,F,B),_=Math.min(U,q,F,B);var W=s.longitude,G=W+(c-1)*P,V=W+(l-1)*R,Y=W+(l-1)*R+(c-1)*P;if(M=Math.max(W,G,V,Y),T=Math.min(W,G,V,Y),b<-i.PI_OVER_TWO||b>i.PI_OVER_TWO||_<-i.PI_OVER_TWO||_>i.PI_OVER_TWO)throw new n("Rotated extent is invalid.");a.north=b,a.south=_,a.east=M,a.west=T}return{granYCos:I,granYSin:R,granXCos:P,granXSin:z,ellipsoid:x,width:c,height:l,surfaceHeight:E,extrudedHeight:O,nwCorner:s,rectangle:a}},f}),define("Core/VertexFormat",["./defaultValue","./freezeObject"],function(e,t){"use strict";var r=function(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 r.POSITION_ONLY=t(new r({position:!0})),r.POSITION_AND_NORMAL=t(new r({position:!0,normal:!0})),r.POSITION_NORMAL_AND_ST=t(new r({position:!0,normal:!0,st:!0})),r.POSITION_AND_ST=t(new r({position:!0,st:!0})),r.POSITION_AND_COLOR=t(new r({position:!0,color:!0})),r.ALL=t(new r({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),r.DEFAULT=r.POSITION_NORMAL_AND_ST,r}),define("Core/RectangleGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./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,f,d,h,m,y,p,v,g,w,x,E,S,O){"use strict";function M(e,t){var r=new c({attributes:new f,primitiveType:w.TRIANGLES});return r.attributes.position=new l({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(r.attributes.normal=new l({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(r.attributes.tangent=new l({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.binormal&&(r.attributes.binormal=new l({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.binormals})),r}function T(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=C,f=z,d=R,h=0;i>h;h+=3){var m=r.fromArray(e,h,P),y=c+1,p=c+2;(t.normal||t.tangent||t.binormal)&&(d=n.geodeticSurfaceNormal(m,d),(t.tangent||t.binormal)&&(r.cross(r.UNIT_Z,d,f),v.multiplyByVector(a,f,f),r.normalize(f,f),t.binormal&&r.normalize(r.cross(d,f,l),l)),t.normal&&(o[c]=d.x,o[y]=d.y,o[p]=d.z),t.tangent&&(u[c]=f.x,u[y]=f.y,u[p]=f.z),t.binormal&&(s[c]=l.x,s[y]=l.y,s[p]=l.z)),c+=3}return M(t,{positions:e,normals:o,tangents:u,binormals:s})}function b(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,f=!0,d=C,h=z,m=R,p=0;a>p;p+=6){var v=r.fromArray(e,p,P);if(t.normal||t.tangent||t.binormal){var g=r.fromArray(e,p+6,F);if(f){var w=r.fromArray(e,p+3,B);r.subtract(g,v,g),r.subtract(w,v,w),m=r.normalize(r.cross(w,g,m),m),f=!1}r.equalsEpsilon(g,v,y.EPSILON10)&&(f=!0),(t.tangent||t.binormal)&&(d=n.geodeticSurfaceNormal(v,d),t.tangent&&(h=r.normalize(r.cross(d,m,h),h))),t.normal&&(i[s++]=m.x,i[s++]=m.y,i[s++]=m.z,i[s++]=m.x,i[s++]=m.y,i[s++]=m.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++]=d.x,u[l++]=d.y,u[l++]=d.z,u[l++]=d.x,u[l++]=d.y,u[l++]=d.z)}}return M(t,{positions:e,normals:i,tangents:o,binormals:u})}function _(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,f=0,d=P,h=L,y=Number.MAX_VALUE,p=Number.MAX_VALUE,v=Number.MIN_VALUE,g=Number.MIN_VALUE,w=0;i>w;++w)for(var x=0;o>x;++x)S.computePosition(e,w,x,d,h),u[c++]=d.x,u[c++]=d.y,u[c++]=d.z,t.st&&(s[f++]=h.x,s[f++]=h.y,y=Math.min(y,h.x),p=Math.min(p,h.y),v=Math.max(v,h.x),g=Math.max(g,h.y));if(t.st&&(0>y||0>p||v>1||g>1))for(var E=0;E<s.length;E+=2)s[E]=(s[E]-y)/(v-y),s[E+1]=(s[E+1]-p)/(g-p);for(var O=T(u,t,r,e.tangentRotationMatrix),M=6*(o-1)*(i-1),b=m.createTypedArray(n,M),_=0,A=0,N=0;i-1>N;++N){for(var I=0;o-1>I;++I){var R=_,z=R+o,C=z+1,D=R+1;b[A++]=R,b[A++]=z,b[A++]=D,b[A++]=D,b[A++]=z,b[A++]=C,++_}++_}return O.indices=b,t.st&&(O.attributes.st=new l({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:s})),O}function A(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 N(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 I(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,f=e.width,p=e.ellipsoid,v=_(e);if(y.equalsEpsilon(u,s,.1))return v;v=g.scaleToGeodeticHeight(v,s,p,!1);var w=new Float64Array(v.attributes.position.values),x=w.length,E=2*x,S=new Float64Array(E);S.set(w),v=g.scaleToGeodeticHeight(v,u,p);var O=v.attributes.position.values;S.set(O,x),v.attributes.position.values=S;var M,T=n.normal?new Float32Array(E):void 0,I=n.tangent?new Float32Array(E):void 0,P=n.binormal?new Float32Array(E):void 0,R=n.st?new Float32Array(2*(E/3)):void 0;if(n.normal){var z=v.attributes.normal.values;for(T.set(z),t=0;x>t;t++)z[t]=-z[t];T.set(z,x),v.attributes.normal.values=T}if(n.tangent){var C=v.attributes.tangent.values;for(I.set(C),t=0;x>t;t++)C[t]=-C[t];I.set(C,x),v.attributes.tangent.values=I}if(n.binormal){var D=v.attributes.binormal.values;P.set(D),P.set(D,x),v.attributes.binormal.values=P}n.st&&(M=v.attributes.st.values,R.set(M),R.set(M,2*(x/3)),v.attributes.st.values=R);var L=v.indices,U=L.length,q=x/3,W=m.createTypedArray(E/3,2*U);for(W.set(L),t=0;U>t;t+=3)W[t+U]=L[t+2]+q,W[t+1+U]=L[t+1]+q,W[t+2+U]=L[t]+q;v.indices=W;var G=2*f+2*c-4,V=2*(G+4),Y=new Float64Array(3*V),j=n.st?new Float32Array(2*V):void 0,k=0,H=0,X=f*c;for(t=0;X>t;t+=f)Y=A(Y,k,3*t,w,O),k+=6,n.st&&(j=N(j,H,2*t,M),H+=4);for(t=X-f;X>t;t++)Y=A(Y,k,3*t,w,O),k+=6,n.st&&(j=N(j,H,2*t,M),H+=4);for(t=X-1;t>0;t-=f)Y=A(Y,k,3*t,w,O),k+=6,n.st&&(j=N(j,H,2*t,M),H+=4);for(t=f-1;t>=0;t--)Y=A(Y,k,3*t,w,O),k+=6,n.st&&(j=N(j,H,2*t,M),H+=4);var Z=b(Y,n,p);n.st&&(Z.attributes.st=new l({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:j}));var J,K,Q,$,et=m.createTypedArray(V,6*G);x=Y.length/3;var tt=0;for(t=0;x-1>t;t+=2){J=t,$=J+2;var rt=r.fromArray(Y,3*J,F),nt=r.fromArray(Y,3*$,B);r.equalsEpsilon(rt,nt,y.EPSILON10)||(K=J+1,Q=K+2,et[tt++]=J,et[tt++]=K,et[tt++]=$,et[tt++]=$,et[tt++]=K,et[tt++]=Q)}return Z.indices=et,Z=h.combine([new d({geometry:v}),new d({geometry:Z})])}var P=new r,R=new r,z=new r,C=new r,D=new E,L=new t,U=new e,q=new e,F=new r,B=new r,W=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.rectangle,r=i(e.granularity,y.RADIANS_PER_DEGREE),n=i(e.ellipsoid,s.WGS84),a=i(e.height,0),o=e.rotation,u=e.stRotation,c=i(e.vertexFormat,O.DEFAULT);this._rectangle=t,this._granularity=r,this._ellipsoid=n,this._surfaceHeight=a,this._rotation=o,this._stRotation=u,this._vertexFormat=c,this._extrudedHeight=e.extrudedHeight,this._closeTop=e.closeTop,this._closeBottom=e.closeBottom,this._workerName="createRectangleGeometry"},G=new p,V=new v,Y=new n,j=new x,k=new n;return W.createGeometry=function(t){var n=E.clone(t._rectangle,D),a=t._ellipsoid,i=t._surfaceHeight,u=t._extrudedHeight,s=t._stRotation,l=t._vertexFormat,d=S.computeOptions(t,n,Y),h=G,m=V;if(o(s)){p.fromRotation(-s,h);var y=E.center(n,k),w=a.cartographicToCartesian(y,F);r.normalize(w,w),x.fromAxisAngle(w,-s,j),v.fromQuaternion(j,m)}else p.clone(p.IDENTITY,h),v.clone(v.IDENTITY,m);d.lonScalar=1/(n.east-n.west),d.latScalar=1/(n.north-n.south),d.vertexFormat=l,d.textureMatrix=h,d.tangentRotationMatrix=m,d.size=d.width*d.height;var O,M;if(n=t._rectangle,o(u)){O=I(d);var T=e.fromRectangle3D(n,a,i,q),b=e.fromRectangle3D(n,a,u,U);M=e.union(T,b)}else O=_(d),O=g.scaleToGeodeticHeight(O,i,a,!1),M=e.fromRectangle3D(n,a,i);return l.position||delete O.attributes.position,new c({attributes:new f(O.attributes),indices:O.indices,primitiveType:O.primitiveType,boundingSphere:M}) -},W}),define("Workers/createRectangleGeometry",["../Core/Ellipsoid","../Core/Rectangle","../Core/RectangleGeometry"],function(e,t,r){"use strict";function n(n){return n._ellipsoid=e.clone(n._ellipsoid),n._rectangle=t.clone(n._rectangle),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}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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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:0>e?-1:0},a.signNotZero=function(e){return 0>e?-1:1},a.toSNorm=function(e){return Math.round(255*(.5*a.clamp(e,-1,1)+.5))},a.fromSNorm=function(e){return a.clamp(e,0,255)/255*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.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 a>=i||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;e>=r;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}i.fromSpherical=function(n,r){t(r)||(r=new i);var a=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(o),r},i.fromElements=function(e,n,r,a){return t(a)?(a.x=e,a.y=n,a.z=r,a):new i(e,n,r)},i.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 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},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},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 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){i.normalize(e,s),i.normalize(t,c);var n=i.dot(s,c),r=i.magnitude(i.cross(s,c,s));return Math.atan2(r,n)};var l=new i;i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):n.y<=n.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,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},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},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)},i.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},i.fromDegrees=function(e,t,n,r,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,n,r,o)};var f=new i,d=new i,h=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(n,r,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:h,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=i.normalize(f,f),i.multiplyComponents(s,f,d);var l=Math.sqrt(i.dot(f,d));return d=i.divideByScalar(d,l,d),f=i.multiplyByScalar(f,a,f),t(u)||(u=new i),i.add(d,f,u)},i.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=a.toRadians(e[o]);return i.fromRadiansArray(r,t,n)},i.fromRadiansArray=function(e,n,r){var a=e.length;t(r)?r.length=a/2:r=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=i.fromRadians(u,s,0,n,r[o/2])}return r},i.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=a.toRadians(e[o]),r[o+1]=a.toRadians(e[o+1]),r[o+2]=e[o+2];return i.fromRadiansArrayHeights(r,t,n)},i.fromRadiansArrayHeights=function(e,n,r){var a=e.length;t(r)?r.length=a/3:r=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=i.fromRadians(u,s,c,n,r[o/3])}return r},i.ZERO=r(new i(0,0,0)),i.UNIT_X=r(new i(1,0,0)),i.UNIT_Y=r(new i(0,1,0)),i.UNIT_Z=r(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,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},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,p=l*l*h*h,y=f*f*E*E,_=d*d*m*m,v=p+y+_,T=Math.sqrt(1/v),R=e.multiplyByScalar(n,T,i);if(s>v)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 O,I,M,w,x,C,P,D,L,U,b,F=(1-T)*e.magnitude(n)/(.5*e.magnitude(N)),z=0;do{F-=z,M=1/(1+F*A),w=1/(1+F*S),x=1/(1+F*g),C=M*M,P=w*w,D=x*x,L=C*M,U=P*w,b=D*x,O=p*C+y*P+_*D-1,I=p*L*A+y*U*S+_*b*g;var B=-2*I;z=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(t,m,s);_=e.normalize(_,_);var v=e.subtract(t,y,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){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){a=n(a,0),e.pack(t._radii,r,a)},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;n>a;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;n>a;++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}),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){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},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 n>t&&(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;d>f;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.clone=function(e,t){return n(e)?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):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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;i>a&&(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;i>a&&o>0?a+=u.TWO_PI:c>o&&a>0&&(o+=u.TWO_PI),i>a&&0>c?c+=u.TWO_PI:c>o&&0>i&&(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)&&l>=f)){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.union=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.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,a=e.west,i=e.east;return a>i&&(i+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(i>n||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++,0>f?m.latitude=f:d>0?m.latitude=d:m.latitude=0;for(var p=1;8>p;++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/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","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(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 u(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;3>n;++n){var r=e[o.getElementIndex(h[n],d[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=i.EPSILON15,r=0,a=1,u=0;3>u;++u){var s=Math.abs(e[o.getElementIndex(h[u],d[u])]);s>r&&(a=u,r=s)}var c=1,l=0,f=d[a],E=h[a];if(Math.abs(e[o.getElementIndex(E,f)])>n){var m,p=e[o.getElementIndex(E,E)],y=e[o.getElementIndex(f,f)],_=e[o.getElementIndex(E,f)],v=(p-y)/2/_;m=0>v?-1/(-v+Math.sqrt(1+v*v)):1/(v+Math.sqrt(1+v*v)),c=1/Math.sqrt(1+m*m),l=m*c}return t=o.clone(o.IDENTITY,t),t[o.getElementIndex(f,f)]=t[o.getElementIndex(E,E)]=c,t[o.getElementIndex(E,f)]=l,t[o.getElementIndex(f,E)]=-l,t}o.packedLength=9,o.pack=function(e,n,r){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]},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},o.clone=function(e,t){return n(e)?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 o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},o.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,u=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,v=2*(c-u),T=2*(i-l),R=2*(c+u),A=-r-s+f+h;return n(t)?(t[0]=E,t[1]=y,t[2]=T,t[3]=m,t[4]=_,t[5]=R,t[6]=p,t[7]=v,t[8]=A,t):new o(E,m,p,y,_,v,T,R,A)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,r,-a,0,a,r)},o.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 o(r,0,a,0,1,0,-a,0,r)},o.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 o(r,-a,0,a,r,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},o.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},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;o.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 f=new e;o.getMaximumScale=function(t){return o.getScale(t,f),e.maximumComponent(f)},o.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},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[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},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[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},o.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},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[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},o.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},o.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},o.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],h=[2,2,1],E=new o,m=new o;return o.computeEigenDecomposition=function(e,t){var r=i.EPSILON20,a=10,l=0,f=0;n(t)||(t={});for(var d=t.unitary=o.clone(o.IDENTITY,t.unitary),h=t.diagonal=o.clone(e,t.diagonal),p=r*u(h);a>f&&s(h)>p;)c(h,E),o.transpose(E,m),o.multiply(h,E,h),o.multiply(m,h,h),o.multiply(d,E,d),++l>2&&(++f,l=0);return 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[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},o.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)},o.inverse=function(e,t){var n=e[0],a=e[1],u=e[2],s=e[3],c=e[4],l=e[5],f=e[6],d=e[7],h=e[8],E=o.determinant(e);if(Math.abs(E)<=i.EPSILON15)throw new r("matrix is not invertible");t[0]=c*h-d*l,t[1]=d*u-a*h,t[2]=a*l-c*u,t[3]=f*l-s*h,t[4]=n*h-f*u,t[5]=s*u-n*l,t[6]=s*d-f*c,t[7]=f*a-n*d,t[8]=n*c-s*a;var m=1/E;return o.multiplyByScalar(t,m,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=a(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=a(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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.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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(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)}c.packedLength=16,c.pack=function(e,t,r){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]},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),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},c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[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]):void 0},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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new c);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,l=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,v=s-h-p+_,T=2*(l-y),R=2*(f+m),A=2*(l+y),S=-s+h-p+_,g=2*(E-d),N=2*(f-m),O=2*(E+d),I=-s-h+p+_;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]=O*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},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.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 l=new e,f=new e,d=new e;c.fromCamera=function(t,n){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,d),d);var u=f.x,s=f.y,h=f.z,E=l.x,m=l.y,p=l.z,y=d.x,_=d.y,v=d.z,T=a.x,R=a.y,A=a.z,S=u*-T+s*-R+h*-A,g=y*-T+_*-R+v*-A,N=E*T+m*R+p*A;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]=h,n[9]=v,n[10]=-p,n[11]=0,n[12]=S,n[13]=g,n[14]=N,n[15]=1,n):new c(u,s,h,S,y,_,v,g,-E,-m,-p,N,0,0,0,1)},c.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},c.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},c.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},c.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},c.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},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,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},c.setColumn=function(e,t,n,r){r=c.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},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],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},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 h=new e;c.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[4],t[5],t[6],h)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],h)),n};var E=new e;c.getMaximumScale=function(t){return c.getScale(t,E),e.maximumComponent(E)},c.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],v=t[0],T=t[1],R=t[2],A=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],L=t[15],U=r*v+u*T+f*R+m*A,b=a*v+s*T+d*R+p*A,F=i*v+c*T+h*R+y*A,z=o*v+l*T+E*R+_*A,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*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 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]=X,n[10]=H,n[11]=Y,n[12]=k,n[13]=j,n[14]=Z,n[15]=K,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],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],v=t[5],T=t[6],R=t[8],A=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*v+c*T,C=a*_+u*v+l*T,P=i*_+s*v+f*T,D=r*R+o*A+c*S,L=a*R+u*A+l*S,U=i*R+s*A+f*S,b=r*g+o*N+c*O+d,F=a*g+u*N+l*O+h,z=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]=L,n[10]=U,n[11]=0,n[12]=b,n[13]=F,n[14]=z,n[15]=1,n},c.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],v=t[7],T=t[8],R=r*d+o*h+c*E,A=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*v+c*T,M=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]=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},c.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;c.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,c.multiplyByScale(e,m,n)},c.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?c.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)},c.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},c.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},c.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},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],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},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 p=new u,y=new u,_=new t,v=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,p),y,o.EPSILON7)&&t.equals(c.getRow(e,3,_),v))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],l=e[12],f=e[1],d=e[5],h=e[9],E=e[13],m=e[2],T=e[6],R=e[10],A=e[14],S=e[3],g=e[7],N=e[11],O=e[15],I=R*O,M=A*N,w=T*O,x=A*g,C=T*N,P=R*g,D=m*O,L=A*S,U=m*N,b=R*S,F=m*g,z=T*S,B=I*d+x*h+C*E-(M*d+w*h+P*E),G=M*f+D*h+b*E-(I*f+L*h+U*E),q=w*f+L*d+F*E-(x*f+D*d+z*E),W=P*f+U*d+z*h-(C*f+b*d+F*h),V=M*a+w*i+P*l-(I*a+x*i+C*l),X=I*r+L*i+U*l-(M*r+D*i+b*l),H=x*r+D*a+z*l-(w*r+L*a+F*l),Y=C*r+b*a+F*i-(P*r+U*a+z*i);I=i*E,M=l*h,w=a*E,x=l*d,C=a*h,P=i*d,D=r*E,L=l*f,U=r*h,b=i*f,F=r*d,z=a*f;var k=I*g+x*N+C*O-(M*g+w*N+P*O),j=M*S+D*N+b*O-(I*S+L*N+U*O),Z=w*S+L*g+F*O-(x*S+D*g+z*O),K=P*S+U*g+z*N-(C*S+b*g+F*N),J=w*R+P*A+M*T-(C*A+I*T+x*R),Q=U*A+I*m+L*R-(D*R+b*A+M*m),$=D*T+z*A+x*m-(F*A+w*m+L*T),ee=F*R+C*m+b*T-(U*T+z*R+P*m),te=r*B+a*G+i*q+l*W;if(Math.abs(te)<o.EPSILON20)throw new s("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]=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},c.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},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,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/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/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f,d){"use strict";function h(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var E=new e,m=new e,p=new e,y=new e,_=new e,v=new e,T=new e,R=new e,A=new e,S=new e,g=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,E),o=e.clone(a,m),u=e.clone(a,p),s=e.clone(a,y),c=e.clone(a,_),l=e.clone(a,v),f=t.length,d=1;f>d;d++){e.clone(t[d],a);var O=a.x,I=a.y,M=a.z;O<i.x&&e.clone(a,i),O>s.x&&e.clone(a,s),I<o.y&&e.clone(a,o),I>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=A;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=S;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,R),.5,N),q=0;for(d=0;f>d;d++){e.clone(t[d],a);var W=e.magnitude(e.subtract(a,G,R));W>q&&(q=W);var V=e.magnitudeSquared(e.subtract(a,U,R));if(V>b){var X=Math.sqrt(V);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 q>F?(e.clone(U,n.center),n.radius=F):(e.clone(G,n.center),n.radius=q),n};var O=new o,I=new e,M=new e,w=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,O),d.southwest(t,w),w.height=i,d.northeast(t,x),x.height=o;var s=a.project(w,I),c=a.project(x,M),l=c.x-s.x,f=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+f*f+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*f,m.z=s.z+.5*E,u};var C=[];h.fromRectangle3D=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0);var u;return r(e)&&(u=d.subsample(e,t,a,C)),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,E),c=e.clone(u,m),l=e.clone(u,p),f=e.clone(u,y),d=e.clone(u,_),O=e.clone(u,v),I=t.length,M=0;I>M;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>d.y&&e.clone(u,d),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(d,c,R)),L=e.magnitudeSquared(e.subtract(O,l,R)),U=s,b=f,F=P;D>F&&(F=D,U=c,b=d),L>F&&(F=L,U=l,b=O);var z=A;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=S;q.x=s.x,q.y=c.y,q.z=l.z;var W=g;W.x=f.x,W.y=d.y,W.z=O.z;var V=e.multiplyByScalar(e.add(q,W,R),.5,N),X=0;for(M=0;I>M;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,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 X>G?(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=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,m),s=e.clone(i,p),c=e.clone(i,y),l=e.clone(i,_),f=e.clone(i,v),d=t.length,O=0;d>O;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,L=c,U=x;C>U&&(U=C,D=u,L=l),P>U&&(U=P,D=s,L=f);var b=A;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=S;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,R),.5,N),W=0;for(O=0;d>O;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,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 W>z?(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 P=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;a>o;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;a>o;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return n.radius=s,n};var D=new e,L=new e,U=new e;h.fromOrientedBoundingBox=function(t,n){r(n)||(n=new h);var a=t.halfAxes,i=c.getColumn(a,0,D),o=c.getColumn(a,1,L),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){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius):void 0},h.packedLength=4,h.pack=function(e,t,r){r=n(r,0);var a=e.center;t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius},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 b=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,b),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-a>o?u.OUTSIDE:a>o?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 G=new e;h.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,G),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,W=new e,V=new e,X=new e,H=new e,Y=new t,k=new Array(8),j=0;8>j;++j)k[j]=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,q),c=e.cross(e.UNIT_Z,s,W);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,H),d=e.negate(c,X),E=k,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,y=0;p>y;++y){var _=E[y];e.add(o,_,_);var v=i.cartesianToCartographic(_,Y);r.project(v,_)}a=h.fromPoints(E,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/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){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},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.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.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("Renderer/WebGLConstants",["../Core/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/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(){return a.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?r.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(r.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",e(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;r>n;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(v)){v=!1;var e=/ Chrome\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(v=!0,T=r(e[1]))}return v}function i(){return a()&&T}function o(){if(!t(R)&&(R=!1,!a()&&/ Safari\/[\.0-9]+/.test(_.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(R=!0,A=r(e[1]))}return R}function u(){return o()&&A}function s(){if(!t(S)){S=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(_.userAgent);null!==e&&(S=!0,g=r(e[1]),g.isNightly=!!e[2])}return S}function c(){return s()&&g}function l(){if(!t(N)){N=!1;var e;"Microsoft Internet Explorer"===_.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(_.userAgent),null!==e&&(N=!0,O=r(e[1]))):"Netscape"===_.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(_.userAgent),null!==e&&(N=!0,O=r(e[1])))}return N}function f(){return l()&&O}function d(){if(!t(I)){I=!1;var e=/Firefox\/([\.0-9]+)/.exec(_.userAgent);null!==e&&(I=!0,M=r(e[1]))}return I}function h(){return t(w)||(w=/Windows/i.test(_.appVersion)),w}function E(){return d()&&M}function m(){return t(x)||(x="undefined"!=typeof PointerEvent&&(!t(_.pointerEnabled)||_.pointerEnabled)),x}function p(){if(!t(P)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;P=t(n)&&""!==n,P&&(C=n)}return P}function y(){return p()?C:void 0}var _;_="undefined"!=typeof navigator?navigator:{};var v,T,R,A,S,g,N,O,I,M,w,x,C,P,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:d,firefoxVersion:E,isWindows:h,hardwareConcurrency:e(_.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:p,imageRenderingValue:y};return D.supportsFullscreen=function(){return n.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,a,i){"use strict";if(!a.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return n(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,n,a,i){switch(a=t(a,0),i=t(i,(n.byteLength-a)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,a,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,a,i);case o.SHORT:return new Int16Array(n,a,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,a,i);case o.FLOAT:return new Float32Array(n,a,i);case o.DOUBLE:return new Float64Array(n,a,i);default:throw new r("componentDatatype is not a valid value.")}},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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(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=void 0}return i.computeNumberOfVertices=function(e){var r=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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/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.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=t.x,r=t.y;t.x=(1-Math.abs(r))*a.signNotZero(n),t.y=(1-Math.abs(n))*a.signNotZero(r)}return t.x=a.toSNorm(t.x),t.y=a.toSNorm(t.y),t},i.octDecode=function(e,n,r){if(r.x=a.fromSNorm(e),r.y=a.fromSNorm(n),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){var i=r.x;r.x=(1-Math.abs(r.y))*a.signNotZero(i),r.y=(1-Math.abs(i))*a.signNotZero(r.y)}return t.normalize(r,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 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=1===e.x?4095:4096*e.x|0,n=1===e.y?4095:4096*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096;return t.x=Math.floor(n)/4096,t.y=n-Math.floor(n),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,d,h,E,m,p,y,_;n(a.z)?(f=t.subtract(s,a,i),d=t.subtract(c,a,o),h=t.subtract(r,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(r,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 v=1/(E*y-m*m);return l.y=(y*p-m*_)*v,l.z=(E*_-m*p)*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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,r){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,r):new Uint16Array(t,n,r)},r(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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,0>i?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(0>f)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(0>y){var _,v,T;d*f>=l*h?(_=o,v=E,T=-2*u*E+o*m):(_=c,v=p,T=-c*m+2*s*p);var R=0>T?-1:1,A=-R*Math.abs(_)*Math.sqrt(-y);i=-T+A;var S=i/2,g=0>S?-Math.pow(-S,1/3):Math.pow(S,1/3),N=i===A?-g:-v/g;return a=0>=v?g+N:-T/(g*g+N*N+v),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 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=2*s>i+L?i+s:L+s,G=z/B,q=b*B,W=-U*B-b*z,V=U*z,X=(s*W-u*V)/(-u*W+s*q);return X>=F?G>=F?G>=X?[F,X,G]:[F,G,X]:[G,F,X]:G>=F?[X,F,G]:G>=X?[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=0>u?-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,0>u?[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),v=Math.sqrt(y);return[d-v,d-_,d+_,d+v]}if(p>=0&&0>y)return m=Math.sqrt(p),[d-m,d+m];if(0>p&&y>=0)return m=Math.sqrt(y),[d-m,d+m]}return[]}if(h>0){var T=Math.sqrt(h),R=(s+h-c/T)/2,A=(s+h+c/T)/2,S=r.computeRealRoots(1,T,R),g=r.computeRealRoots(1,-T,A);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,v=t/2,T=y/2,R=_-4*o,A=_+4*Math.abs(o),S=c-4*p,g=c+4*Math.abs(p);if(0>p||S*A>R*g){var N=Math.sqrt(S);E=N/2,m=0===N?0:(t*T-i)/N}else{var O=Math.sqrt(R);E=0===O?0:(t*T-i)/O,m=O/2}var I,M;0===v&&0===E?(I=0,M=0):n.sign(v)===n.sign(E)?(I=v+E,M=p/I):(M=v-E,I=p/M);var w,x;0===T&&0===m?(w=0,x=0):n.sign(T)===n.sign(m)?(w=T+m,x=o/w):(x=T-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=0>c?1:0;switch(h+=0>l?h+1:h,h+=0>f?h+1:h,h+=0>d?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(t,r,a,o,u){u=n(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,m=e.subtract(a,r,p),R=e.subtract(o,r,y),A=e.cross(E,R,_),S=e.dot(m,A);if(u){if(S<i.EPSILON6)return;if(s=e.subtract(h,r,v),l=e.dot(s,A),0>l||l>S)return;if(c=e.cross(s,m,T),f=e.dot(E,c),0>f||l+f>S)return;d=e.dot(R,c)/S}else{if(Math.abs(S)<i.EPSILON6)return;var g=1/S;if(s=e.subtract(h,r,v),l=e.dot(s,A)*g,0>l||l>1)return;if(c=e.cross(s,m,T),f=e.dot(E,c)*g,0>f||l+f>1)return;d=e.dot(R,c)*g}return d}function f(e,t,n,r){var a=t*t-4*e*n;if(!(0>a)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(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={});var i=t.origin,o=t.direction,u=n.center,s=n.radius*n.radius,c=e.subtract(i,u,_),l=e.dot(o,o),d=2*e.dot(o,c),h=e.magnitudeSquared(c)-s,E=f(l,d,h,A);return r(E)?(a.start=E.root0,a.stop=E.root1,a):void 0}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 E(t,n,r,a,c){var l,f=a*a,d=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*d,m=c*(a*h(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),p=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),v=[];if(0===_&&0===y){if(l=u.computeRealRoots(E,m,p),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=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 v;l=s.computeRealRoots(M,w,x,C,P);var D=l.length;if(0===D)return v;for(var L=0;D>L;++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)?h(E*F+p,m*b,i.EPSILON12):i.sign(p)===i.sign(m*b)?h(E*F,m*b+p,i.EPSILON12):h(E*F+m*b,p,i.EPSILON12);var G=h(y*b,_,i.EPSILON15),q=U*G;0>q?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)),++L):v.push(new e(a,c*b,c*B))}return v}var m={};m.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(!(0>l))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var p=new e,y=new e,_=new e,v=new e,T=new e;m.rayTriangle=function(t,n,a,i,o,u){var s=l(t,n,a,i,o);if(r(s)&&!(0>s))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;m.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 f=l(c,a,i,o,u);return!r(f)||0>f||f>e.distance(t,n)?void 0:(r(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var A={root0:0,root1:0};m.raySphere=function(e,t,n){return n=d(e,t,n),!r(n)||n.stop<0?void 0:(n.start=Math.max(n.start,0),n)};var S=new c;m.lineSegmentSphere=function(t,n,a,i){var o=S,u=e.subtract(n,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=d(o,a,i),!r(i)||i.stop<0||i.start>s?void 0:(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,i,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,g),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(r=f-1,a=e.magnitudeSquared(l),i=a*r,i>h)return;if(h>i){o=d*d-i,u=-d+Math.sqrt(o);var E=u/a,m=r/u;return m>E?{start:E,stop:m}:{start:m,stop:E}}var p=Math.sqrt(r/a);return{start:p,stop:p}}return 1>f?(r=f-1,a=e.magnitudeSquared(l),i=a*r,o=d*d-i,u=-d+Math.sqrt(o),{start:0,stop:u/a}):0>d?(a=e.magnitudeSquared(l),{start:0,stop:-d/a}):void 0};var O=new e,I=new e,M=new e,w=new e,x=new e,C=new o,P=new o,D=new o,L=new o,U=new o,b=new o,F=new o,z=new e,B=new e,G=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction,s=n.geodeticSurfaceNormal(a,O);if(e.dot(u,s)>=0)return a;var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u,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=o.transpose(p,P),_=o.fromScale(n.radii,D),v=o.fromScale(n.oneOverRadii,L),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(y,v,b),T,b),g=o.multiply(o.multiply(S,_,F),p,F),N=o.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;W>H;++H){R=o.multiplyByVector(_,o.multiplyByVector(p,q[H],z),z);var Y=e.normalize(e.subtract(R,a,w),w),k=e.dot(Y,u);k>X&&(X=k,V=e.clone(R,V))}var j=n.cartesianToCartographic(V,G);return X=i.clamp(X,0,1),A=e.magnitude(e.subtract(V,a,w))*Math.sqrt(1-X*X),A=c?-A:A,j.height=A,n.cartographicToCartesian(j,new e)}};var q=new e;return m.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(!(0>f||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},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/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];o>u;)s>a&&(a=s),++u,s=r[u]}for(var c=[],l=0;a+1>l;l++)c[l]=0;for(var f=i+1,d=0;o>d;++d)f-c[r[d]]>i&&(c[r[d]]=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(;r>i;){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 d=n[f];a[d].numLiveTriangles&&(s=0,i-a[d].timeStamp+2*a[d].numLiveTriangles<=t&&(s=i-a[d].timeStamp),(s>l||-1===l)&&(l=s,c=d)),++f}return-1===c?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,d=o[f],h=c;if(t(u))l=u+1;else{for(;h>f;)d>l&&(l=d),++f,d=o[f];if(-1===l)return 0;++l}for(var E=[],m=0;l>m;m++)E[m]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var p=0;h>f;)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 v,T,R=[],A=[],S=0,g=[],N=c/3,O=[];for(m=0;N>m;m++)O[m]=!1;for(var I,M;-1!==y;){R=[],T=E[y],M=T.vertexTriangles.length;for(var w=0;M>w;++w)if(p=T.vertexTriangles[w],!O[p]){O[p]=!0,f=p+p+p;for(var x=0;3>x;++x)I=o[f],R.push(I),A.push(I),g[S]=I,++S,v=E[I],--v.numLiveTriangles,_-v.timeStamp>s&&(v.timeStamp=_,++_),++f}y=a(o,s,R,E,_,A,l)}return g},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,v,T,R,A,S,g,N){"use strict";function O(e,t,n,r,a){e[t++]=n,e[t++]=r,e[t++]=r,e[t++]=a,e[t++]=a,e[t]=n}function I(e){for(var t=e.length,n=t/3*6,r=y.createTypedArray(t,n),a=0,i=0;t>i;i+=3,a+=6)O(r,a,e[i],e[i+1],e[i+2]);return r}function M(e){var t=e.length;if(t>=3){var n=6*(t-2),r=y.createTypedArray(t,n);O(r,0,e[0],e[1],e[2]);for(var a=6,i=3;t>i;++i,a+=6)O(r,a,e[i-1],e[i],e[i-2]);return r}return new Uint16Array}function w(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;t>o;++o,i+=6)O(r,i,a,e[o],e[o+1]);return r}return new Uint16Array}function x(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;r>i;i+=3)a.unpack(n,i,ie),A.multiplyByPoint(e,ie,ie),a.pack(ie,n,i)}function D(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;r>i;i+=3)a.unpack(n,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,n,i)}function L(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;r>f;++f){var d=e[f][t].attributes[n];if(!c(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){l=!1;break}s+=d.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 U(e,t){var r,i,o,u,s,l,f,d=e.length,E=(e[0].modelMatrix,c(e[0][t].indices)),m=e[0][t].primitiveType,p=L(e,t);for(r in p)if(p.hasOwnProperty(r))for(s=p[r].values,u=0,i=0;d>i;++i)for(l=e[i][t].attributes[r].values,f=l.length,o=0;f>o;++o)s[u++]=l[o];var _;if(E){var v=0;for(i=0;d>i;++i)v+=e[i][t].indices.length;var T=h.computeNumberOfVertices(new h({attributes:p,primitiveType:g.POINTS})),R=y.createTypedArray(T,v),A=0,S=0;for(i=0;d>i;++i){var N=e[i][t].indices,O=N.length;for(u=0;O>u;++u)R[A++]=S+N[u];S+=h.computeNumberOfVertices(e[i][t])}_=R}var I,M=new a,w=0;for(i=0;d>i;++i){if(I=e[i][t].boundingSphere,!c(I)){M=void 0;break}a.add(I.center,M,M)}if(c(M))for(a.divideByScalar(M,d,M),i=0;d>i;++i){I=e[i][t].boundingSphere;var x=a.magnitude(a.subtract(I.center,M,se))+I.radius;x>w&&(w=x)}return new h({attributes:p,indices:_,primitiveType:m,boundingSphere:c(M)?new n(M,w):void 0})}function b(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),n=y.createTypedArray(t,t),r=0;t>r;++r)n[r]=r;return e.indices=n,e}function F(e){var t=h.computeNumberOfVertices(e),n=y.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;for(var r=3,a=3;t>a;++a)n[r++]=a-1,n[r++]=0,n[r++]=a;return e.indices=n,e.primitiveType=g.TRIANGLES,e}function z(e){var t=h.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;t-1>a;a+=2)n[r++]=a,n[r++]=a-1,n[r++]=a+1,t>a+2&&(n[r++]=a,n[r++]=a+1,n[r++]=a+2);return e.indices=n,e.primitiveType=g.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),n=y.createTypedArray(t,t),r=0;t>r;++r)n[r]=r;return e.indices=n,e}function G(e){var t=h.computeNumberOfVertices(e),n=y.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;for(var r=2,a=2;t>a;++a)n[r++]=a-1,n[r++]=a;return e.indices=n,e.primitiveType=g.LINES,e}function q(e){var t=h.computeNumberOfVertices(e),n=y.createTypedArray(t,2*t);n[0]=0,n[1]=1;for(var r=2,a=2;t>a;++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 W(e){switch(e.primitiveType){case g.TRIANGLE_FAN:return F(e);case g.TRIANGLE_STRIP:return z(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 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=0>r;V(e,u),V(t,u),V(n,u)}function H(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),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=Ne.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,r?(H(e,t,Re,Se),H(e,n,Ae,ge),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(H(t,n,Re,Se),H(t,e,Ae,ge),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(H(n,e,Re,Se),H(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||(H(n,e,Re,Se),H(n,t,Ae,ge),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(H(t,n,Re,Se),H(t,e,Ae,ge),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(H(e,t,Re,Se),H(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 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=h.computeNumberOfVertices(e);return e.indices=y.createTypedArray(o,e.indices),t&&(e.boundingSphere=n.fromVertices(r.position.values)),e}}function j(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 h({attributes:n,indices:[],primitiveType:e.primitiveType})}function Z(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,d,h,E){if(c(s)||c(l)||c(f)||c(d)){var m=a.fromArray(u,3*e,Oe),p=a.fromArray(u,3*n,Ie),y=a.fromArray(u,3*i,Me),_=t(o,m,p,y,we);if(c(s)){var v=a.fromArray(s,3*e,Oe),T=a.fromArray(s,3*n,Ie),R=a.fromArray(s,3*i,Me);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,h.normal.values,3*E)}if(c(l)){var S=a.fromArray(l,3*e,Oe),g=a.fromArray(l,3*n,Ie),N=a.fromArray(l,3*i,Me);a.multiplyByScalar(S,_.x,S),a.multiplyByScalar(g,_.y,g),a.multiplyByScalar(N,_.z,N);var O=a.add(S,g,S);a.add(O,N,O),a.normalize(O,O),a.pack(O,h.binormal.values,3*E)}if(c(f)){var I=a.fromArray(f,3*e,Oe),M=a.fromArray(f,3*n,Ie),w=a.fromArray(f,3*i,Me);a.multiplyByScalar(I,_.x,I),a.multiplyByScalar(M,_.y,M),a.multiplyByScalar(w,_.z,w);var x=a.add(I,M,I);a.add(x,w,x),a.normalize(x,x),a.pack(x,h.tangent.values,3*E)}if(c(d)){var C=r.fromArray(d,2*e,xe),P=r.fromArray(d,2*n,Ce),D=r.fromArray(d,2*i,Pe);r.multiplyByScalar(C,_.x,C),r.multiplyByScalar(P,_.y,P),r.multiplyByScalar(D,_.z,D);var L=r.add(C,P,C);r.add(L,D,L),r.pack(L,h.st.values,2*E)}}}function J(e,t,n,r,a,i){var o=e.position.values.length/3;if(-1!==a){var u=r[a],s=n[u];return-1===s?(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,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=j(u),y=j(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=m.length;for(o=0;T>o;o+=3){var R=m[o],A=m[o+1],S=m[o+2],g=a.fromArray(l,3*R),N=a.fromArray(l,3*A),O=a.fromArray(l,3*S),I=Y(g,N,O);if(c(I)&&I.positions.length>3)for(var M=I.positions,w=I.indices,x=w.length,C=0;x>C;++C){var P=w[C],D=M[P];D.y<0?(t=y.attributes,n=y.indices,r=_):(t=p.attributes,n=p.indices,r=v),i=J(t,n,r,m,3>P?o+P:-1,D),K(R,A,S,D,l,f,d,h,E,t,i)}else c(I)&&(g=I.positions[0],N=I.positions[1],O=I.positions[2]),g.y<0?(t=y.attributes,n=y.indices,r=_):(t=p.attributes,n=p.indices,r=v),i=J(t,n,r,m,o,g),K(R,A,S,g,l,f,d,h,E,t,i),i=J(t,n,r,m,o+1,N),K(R,A,S,N,l,f,d,h,E,t,i),i=J(t,n,r,m,o+2,O),K(R,A,S,O,l,f,d,h,E,t,i)}Z(e,y,p)}function $(e){var t,n=e.geometry,r=n.attributes,i=r.position.values,o=n.indices,u=j(n),s=j(n),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;l>t;t+=2){var h=o[t],E=o[t+1],m=a.fromArray(i,3*h,Oe),p=a.fromArray(i,3*E,Ie);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,_=u.indices,R=d,A=s.attributes,S=s.indices,g=f,N=v.lineSegmentPlane(m,p,De,Me);if(c(N)){var O=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Le);m.y<0&&(a.negate(O,O),y=s.attributes,_=s.indices,R=f,A=u.attributes,S=u.indices,g=d);var I=a.add(N,O,Ue);J(y,_,R,o,t,m),J(y,_,R,o,-1,I),a.negate(O,O),a.add(N,O,I),J(A,S,g,o,-1,I),J(A,S,g,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),J(M,w,x,o,t,m),J(M,w,x,o,t+1,p)}}Z(e,s,u)}function ee(e){var t,n,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),_=l.length/3;for(t=0;_>t;t+=4){var R=t,A=t+1,S=t+2,g=t+3,N=a.fromArray(l,3*R,ze),O=a.fromArray(l,3*A,Be),I=a.fromArray(l,3*S,Ge),M=a.fromArray(l,3*g,qe);Math.abs(N.y)<T.EPSILON6&&(N.y=T.EPSILON6*(I.y<0?-1:1),O.y=N.y),Math.abs(I.y)<T.EPSILON6&&(I.y=T.EPSILON6*(N.y<0?-1:1),M.y=I.y);var w=p.attributes,x=p.indices,C=y.attributes,P=y.indices,D=v.lineSegmentPlane(N,I,De,We);if(c(D)){var L=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Ve);N.y<0&&(a.negate(L,L),w=y.attributes,x=y.indices,C=p.attributes,P=p.indices);var U=a.add(D,L,Xe);for(w.position.values.push(N.x,N.y,N.z,O.x,O.y,O.z),w.position.values.push(U.x,U.y,U.z),w.position.values.push(U.x,U.y,U.z),a.negate(L,L),a.add(D,L,U),C.position.values.push(U.x,U.y,U.z),C.position.values.push(U.x,U.y,U.z),C.position.values.push(I.x,I.y,I.z,M.x,M.y,M.z),n=3*R;3*R+6>n;++n)w.prevPosition.values.push(f[n]);for(w.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),C.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),n=3*S;3*S+6>n;++n)C.prevPosition.values.push(f[n]);for(n=3*R;3*R+6>n;++n)w.nextPosition.values.push(d[n]);for(w.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),C.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),n=3*S;3*S+6>n;++n)C.nextPosition.values.push(d[n]);var b=r.fromArray(h,2*R,be),F=Math.abs(b.y);w.expandAndWidth.values.push(-1,F,1,F),w.expandAndWidth.values.push(-1,-F,1,-F),C.expandAndWidth.values.push(-1,F,1,F),C.expandAndWidth.values.push(-1,-F,1,-F);var z=a.magnitudeSquared(a.subtract(D,N,qe));if(z/=a.magnitudeSquared(a.subtract(I,N,qe)),c(m)){var B=i.fromArray(m,4*R,He),G=i.fromArray(m,4*S,He),q=T.lerp(B.x,G.x,z),W=T.lerp(B.y,G.y,z),V=T.lerp(B.z,G.z,z),X=T.lerp(B.w,G.w,z);for(n=4*R;4*R+8>n;++n)w.color.values.push(m[n]);for(w.color.values.push(q,W,V,X),w.color.values.push(q,W,V,X),C.color.values.push(q,W,V,X),C.color.values.push(q,W,V,X),n=4*S;4*S+8>n;++n)C.color.values.push(m[n])}if(c(E)){var H=r.fromArray(E,2*R,be),Y=r.fromArray(E,2*(t+3),Fe),k=T.lerp(H.x,Y.x,z);for(n=2*R;2*R+4>n;++n)w.st.values.push(E[n]);for(w.st.values.push(k,H.y),w.st.values.push(k,Y.y),C.st.values.push(k,H.y),C.st.values.push(k,Y.y),n=2*S;2*S+4>n;++n)C.st.values.push(E[n])}o=w.position.values.length/3-4,x.push(o,o+2,o+1),x.push(o+1,o+2,o+3),o=C.position.values.length/3-4,P.push(o,o+2,o+1),P.push(o+1,o+2,o+3)}else{var K,J;for(N.y<0?(K=y.attributes,J=y.indices):(K=p.attributes,J=p.indices),K.position.values.push(N.x,N.y,N.z),K.position.values.push(O.x,O.y,O.z),K.position.values.push(I.x,I.y,I.z),K.position.values.push(M.x,M.y,M.z),n=3*t;3*t+12>n;++n)K.prevPosition.values.push(f[n]),K.nextPosition.values.push(d[n]);for(n=2*t;2*t+8>n;++n)K.expandAndWidth.values.push(h[n]),c(E)&&K.st.values.push(E[n]);if(c(m))for(n=4*t;4*t+16>n;++n)K.color.values.push(m[n]);o=K.position.values.length/3-4,J.push(o,o+2,o+1),J.push(o+1,o+2,o+3)}}Z(e,y,p)}var te={};te.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=M(t);break;case g.TRIANGLE_FAN:e.indices=w(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=g.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,d=0;o>d;d+=3)l[f++]=a[d],l[f++]=a[d+1],l[f++]=a[d+2],l[f++]=a[d]+i[d]*r,l[f++]=a[d+1]+i[d+1]*r,l[f++]=a[d+2]+i[d+2]*r;var m,p=e.boundingSphere;return c(p)&&(m=new n(p.center,p.radius+r)),new h({attributes:{position:new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:g.LINES,boundingSphere:m})},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;o>t;++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=h.computeNumberOfVertices(e),n=e.indices;if(c(n)){for(var r=new Int32Array(t),a=0;t>a;a++)r[a]=-1;for(var i,o=n,s=o.length,l=y.createTypedArray(t,s),f=0,d=0,E=0;s>f;)i=r[o[f]],-1!==i?l[d]=i:(i=o[f],r[i]=E,l[d]=E,++E),++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],v=_.values,T=0,R=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,E*R);t>T;){var S=r[T];if(-1!==S)for(a=0;R>a;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===g.TRIANGLES&&c(n)){for(var r=n.length,a=0,i=0;r>i;i++)n[i]>a&&(a=n[i]);e.indices=N.tipsify({indices:n,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],n=h.computeNumberOfVertices(e);if(c(e.indices)&&n>=T.SIXTY_FOUR_KILOBYTES){var r,a=[],i=[],o=0,u=x(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;l>f;f+=r){for(var d=0;r>d;++d){var E=s[f+d],m=a[E];c(m)||(m=o++,a[E]=m,C(u,e.attributes,E)),i.push(m)}o+r>=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=x(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 ne=new a,re=new o;te.projectTo2D=function(e,t,n,r,i){var o=e.attributes[t];i=c(i)?i:new d;for(var s=i.ellipsoid,f=o.values,h=new Float64Array(f.length),m=0,p=0;p<f.length;p+=3){var y=a.fromArray(f,p,ne),_=s.cartesianToCartographic(y,re);if(!c(_))throw new l("Could not project point ("+y.x+", "+y.y+", "+y.z+") to 2D.");var v=i.project(_,ne);h[m++]=v.x,h[m++]=v.y,h[m++]=v.z}return e.attributes[n]=o,e.attributes[r]=new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:h}),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;o>l;++l)f.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var d=a.componentsPerAttribute;return e.attributes[n]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:d,values:s}),e.attributes[r]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:d,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 r=e.geometry.attributes;P(t,r.position),P(t,r.prevPosition),P(t,r.nextPosition),(c(r.normal)||c(r.binormal)||c(r.tangent))&&(A.inverse(t,oe),A.transpose(oe,oe),A.getRotation(oe,ue),D(ue,r.normal),D(ue,r.binormal),D(ue,r.tangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=n.transform(a,t,a)),e.modelMatrix=A.clone(A.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],n=[],r=e.length,a=0;r>a;++a){var i=e[a];c(i.geometry)?t.push(i):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,de=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;i>f;f++)s[f]={indexOffset:0,count:0,currentCount:0};var d=0;for(f=0;o>f;f+=3){var h=t[f],m=t[f+1],p=t[f+2],y=3*h,_=3*m,v=3*p;le.x=r[y],le.y=r[y+1],le.z=r[y+2],fe.x=r[_],fe.y=r[_+1],fe.z=r[_+2],de.x=r[v],de.y=r[v+1],de.z=r[v+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 T=0;for(f=0;i>f;f++)s[f].indexOffset+=T,T+=s[f].count;d=0;var R;for(f=0;o>f;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;i>f;f++){var g=3*f;if(R=s[f],R.count>0){for(a.clone(a.ZERO,ce),d=0;d<R.count;d++)a.add(ce,c[l[R.indexOffset+d]],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 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),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,d,h;for(l=0;s>l;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,v=2*p,T=2*y,R=n[f],A=n[f+1],S=n[f+2],g=i[_],N=i[_+1],O=i[v+1]-N,I=i[T+1]-N,M=1/((i[v]-g)*I-(i[T]-g)*O),w=(I*(n[d]-R)-O*(n[h]-R))*M,x=(I*(n[d+1]-A)-O*(n[h+1]-A))*M,C=(I*(n[d+2]-S)-O*(n[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;o>l;l++){f=3*l,d=f+1,h=f+2;var L=a.fromArray(r,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 r,ye=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,d=t.attributes.tangent,h=t.attributes.binormal;c(n)&&(o=n.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,v=c(s)&&c(o)?2:1;v+=c(l)||c(f)?1:0,_*=v;for(var T=new Float32Array(_),R=0,A=0;y>A;++A){c(s)&&(r.fromArray(s,2*A,pe),T[R++]=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,ve),e.octPack(ye,_e,ve,pe),T[R++]=pe.x,T[R++]=pe.y):(c(o)&&(a.fromArray(o,S,ye),T[R++]=e.octEncodeFloat(ye)),c(l)&&(a.fromArray(l,S,ye),T[R++]=e.octEncodeFloat(ye)),c(f)&&(a.fromArray(f,S,ye),T[R++]=e.octEncodeFloat(ye)))}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 a,Re=new a,Ae=new a,Se=new a,ge=new a,Ne={positions:new Array(7),indices:new Array(9)},Oe=new a,Ie=new a,Me=new a,we=new a,xe=new r,Ce=new r,Pe=new r,De=S.fromPointNormal(a.ZERO,a.UNIT_Y),Le=new a,Ue=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 a,He=new i;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,S.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:$(e)}else W(t),t.primitiveType===g.TRIANGLES?Q(e):t.primitiveType===g.LINES&&$(e);return e},te}),define("Core/Matrix2",["./Cartesian2","./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r,a){"use strict";function i(e,n,r,a){this[0]=t(e,0),this[1]=t(r,0),this[2]=t(n,0),this[3]=t(a,0)}i.packedLength=4,i.pack=function(e,n,r){r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3]},i.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new i),a[0]=e[r++],a[1]=e[r++],a[2]=e[r++],a[3]=e[r++],a},i.clone=function(e,t){return n(e)?n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new i(e[0],e[2],e[1],e[3]):void 0},i.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new i),a[0]=e[r],a[1]=e[r+1],a[2]=e[r+2],a[3]=e[r+3],a},i.fromColumnMajorArray=function(e,t){return i.clone(e,t)},i.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 i(e[0],e[1],e[2],e[3])},i.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new i(e.x,0,0,e.y)},i.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new i(e,0,0,e)},i.fromRotation=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=-a,t[3]=r,t):new i(r,-a,a,r)},i.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]]},i.getElementIndex=function(e,t){return 2*e+t},i.getColumn=function(e,t,n){var r=2*t,a=e[r],i=e[r+1];return n.x=a,n.y=i,n},i.setColumn=function(e,t,n,r){r=i.clone(e,r);var a=2*t;return r[a]=n.x,r[a+1]=n.y,r},i.getRow=function(e,t,n){var r=e[t],a=e[t+2];return n.x=r,n.y=a,n},i.setRow=function(e,t,n,r){return r=i.clone(e,r),r[t]=n.x,r[t+2]=n.y,r};var o=new e;i.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],o)),n.y=e.magnitude(e.fromElements(t[2],t[3],o)),n};var u=new e;return i.getMaximumScale=function(t){return i.getScale(t,u),e.maximumComponent(u)},i.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},i.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},i.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},i.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},i.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},i.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},i.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},i.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},i.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},i.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]},i.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]},i.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},i.IDENTITY=a(new i(1,0,0,1)),i.ZERO=a(new i(0,0,0,0)),i.COLUMN0ROW0=0,i.COLUMN0ROW1=1,i.COLUMN1ROW0=2,i.COLUMN1ROW1=3,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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},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;f>d;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 v=e.add(y,_,r.center);return e.multiplyByScalar(v,.5,v),r},i.clone=function(t,r){return n(t)?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):void 0},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:0>s+u?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(r){return i(r)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(a){return i(a)}});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(t){r.progress(t)}}: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=R,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,_,v;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))},v=0;_>v;++v)v in t&&e(t[v],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;a>s;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function h(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 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 v,T,R;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(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(;a>i;++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;o>=i;)if(r=~~((i+o)/2),a=n(e[r],t),0>a)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,v="",T=!1,R=!1,A=" ",S=s.length,g=0;s&&S>g;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,0>c&&(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,T,A);case"c":return u(String.fromCharCode(+y),_,c,f,T);case"b":return o(y,2,R,_,c,f,T);case"o":return o(y,8,R,_,c,f,T);case"x":return o(y,16,R,_,c,f,T);case"X":return o(y,16,R,_,c,f,T).toUpperCase();case"u":return o(y,10,R,_,c,f,T);case"i":case"d":return h=+y||0,h=Math.round(h-h%1),E=0>h?"-":v,y=E+a(String(Math.abs(h)),f,"0",!1),i(y,E,_,c,T);case"e":case"E":case"f":case"F":case"g":case"G":return h=+y,E=0>h?"-":v,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,T)[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){v.julianDate=e;var n=m.leapSeconds,r=t(n,v,l);0>r&&(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){v.julianDate=e;var r=m.leapSeconds,a=t(r,v,l);if(0>a&&(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):1>=i?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,0>t&&(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,0>r&&(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,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})?$/,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,w="Invalid ISO 8601 date.";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,i,u,s=e.split("T"),l=1,d=1,p=0,v=0,N=0,x=0,C=s[0],P=s[1];if(!r(C))throw new a(w);var D;if(s=C.match(g),null!==s){if(D=C.split("-").length-1,D>0&&2!==D)throw new a(w);n=+s[1],l=+s[2],d=+s[3]}else if(s=C.match(R),null!==s)n=+s[1],l=+s[2];else if(s=C.match(T),null!==s)n=+s[1];else{var L;if(s=C.match(A),null!==s){if(n=+s[1],L=+s[2],u=o(n),1>L||u&&L>366||!u&&L>365)throw new a(w)}else{if(s=C.match(S),null===s)throw new a(w);n=+s[1];var U=+s[2],b=+s[3]||0;if(D=C.split("-").length-1,D>0&&(!r(s[3])&&1!==D||r(s[3])&&2!==D))throw new a(w);var F=new Date(Date.UTC(n,0,4));L=7*U+b-F.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(L),l=i.getUTCMonth()+1,d=i.getUTCDate()}if(u=o(n),1>l||l>12||1>d||(2!==l||!u)&&d>y[l-1]||u&&2===l&&d>_)throw new a(w);var z;if(r(P)){if(s=P.match(M),null!==s){if(D=P.split(":").length-1,D>0&&2!==D&&3!==D)throw new a(w);p=+s[1],v=+s[2],N=+s[3],x=1e3*+(s[4]||0),z=5}else if(s=P.match(I),null!==s){if(D=P.split(":").length-1,D>2)throw new a(w);p=+s[1],v=+s[2],N=60*+(s[3]||0),z=4}else{if(s=P.match(O),null===s)throw new a(w);p=+s[1],v=60*+(s[2]||0),z=3}if(v>=60||N>=61||p>24||24===p&&(v>0||N>0||x>0))throw new a(w);var B=s[z],G=+s[z+1],q=+(s[z+2]||0);switch(B){case"+":p-=G,v-=q;break;case"-":p+=G,v+=q;break;case"Z":break;default:v+=new Date(Date.UTC(n,l-1,d,p,v)).getTimezoneOffset()}}else v+=new Date(n,l-1,d).getTimezoneOffset();var W=60===N;for(W&&N--;v>=60;)v-=60,p++;for(;p>=24;)p-=24,d++;for(i=u&&2===l?_:y[l-1];d>i;)d-=i,l++,l>12&&(l-=12,n++),i=u&&2===l?_:y[l-1];for(;0>v;)v+=60,p--;for(;0>p;)p+=24,d--;for(;1>d;)l--,1>l&&(l+=12,n--),i=u&&2===l?_:y[l-1],d+=i;var V=E(n,l,d,p,v,N,x);return r(t)?(h(V[0],V[1],t),f(t)):t=new m(V[0],V[1],c.UTC),W&&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,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=y,t.month=p,t.day=E,t.hour=_,t.minute=T,t.second=R,t.millisecond=A,t.isLeapSecond=n,t):new i(y,p,E,_,T,R,A,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){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI):void 0},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){v.julianDate=e;var n=m.leapSeconds,r=t(n,v,l);return 0>r&&(r=~r,--r,0>r&&(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)],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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,n,r,a,i){"use strict";function o(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,u=n.headers,s=n.overrideMimeType,c=n.withCredentials;return e(n.url,function(t){var n=e.defer();return o.load(t,r,a,i,u,n,s,c),n.promise})}function u(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function s(e,t){for(var n=u(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 c(e,n){n=t(n,"");var a=e[1],i=!!e[2],o=e[3];switch(n){case"":case"text":return u(i,o);case"arraybuffer":return s(i,o);case"blob":var c=s(i,o);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(u(i,o),a);case"json":return JSON.parse(u(i,o));default:throw new r("Unhandled responseType: "+n)}}var l=/^data:(.*?)(;base64)?,(.*)$/;return o.load=function(e,t,r,o,u,s,f,d){var h=l.exec(e);if(null!==h)return void s.resolve(c(h,t));var E=new XMLHttpRequest;if(n(f)&&n(E.overrideMimeType)&&E.overrideMimeType(f),E.open(r,e,!0),n(u))for(var m in u)u.hasOwnProperty(m)&&E.setRequestHeader(m,u[m]);n(t)&&(E.responseType=t),n(d)&&(E.withCredentials=d),E.onload=function(){E.status>=200&&E.status<300?n(E.response)?s.resolve(E.response):n(E.responseXML)&&E.responseXML.hasChildNodes()?s.resolve(E.responseXML):n(E.responseText)?s.resolve(E.responseText):s.reject(new i("unknown XMLHttpRequest response type.")):s.reject(new a(E.status,E.response,E.getAllResponseHeaders()))},E.onerror=function(e){s.reject(new a)},E.send(o)},o.defaultLoad=o.load,o}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";function n(n,r){return e({url:n,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return n}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)||(a={}),t(a.headers)?t(a.headers.Accept)||(a.headers=e(a.headers),a.headers.Accept=i.Accept):a.headers=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(0>a||0>i||0>s||0>c||0>d||0>E||0>m)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 _,v=e._addNewLeapSeconds,T=0,R=p.length;R>T;T+=e._columnCount){var A=p[T+a],S=p[T+m],g=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(g,S,f.TAI);if(y.push(N),v){if(S!==_&&r(_)){var O=o.leapSeconds,I=t(O,N,h);if(0>I){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 v=n[d+e._taiMinusUtcSecondsColumn],T=n[h+e._taiMinusUtcSecondsColumn];v!==T&&(l.equals(r)?E=y:y-=T-v)}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,0>s&&(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("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/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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","require"],function(e,t,n,r,a){"use strict";function i(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),a=h.exec(r);if(null!==a)return a[1]}}function o(){if(t(l))return l;var a;if(a="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:i(),!t(a))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new e(r(a))}function u(e){return a.toUrl("../"+e)}function s(t){return new e(t).resolve(o()).toString()}function c(e){t(f)||(f=t(a.toUrl)?u:s),t(d)||(d=document.createElement("a"));var n=f(e);return d.href=n,d.href=d.href,d.href}var l,f,d,h=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=h,c.setBaseUrl=function(t){l=new e(t).resolve(new e(document.location.href))},c}),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;t>=s;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;t>=c;++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;s>u;++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;0>u&&(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;d>=E;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(0>i)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);0>s&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,0>s&&(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,v=this._coef,T=this._xTable;for(E=0;u>=E;++E)y[E]=p-T[E];for(E=0;u>=E;++E){for(v[E]=1,m=0;u>=m;++m)m!==E&&(v[E]*=y[m]);v[E]*=_[E];var R=3*(s+E);n.x+=v[E]*h[R++],n.y+=v[E]*h[R++],n.s+=v[E]*h[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,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],v=p[_];r=Math.sqrt(e[u.getElementIndex(y,y)]-e[u.getElementIndex(_,_)]-e[u.getElementIndex(v,v)]+1);var T=f;T[y]=.5*r,r=.5/r,c=(e[u.getElementIndex(v,_)]-e[u.getElementIndex(_,v)])*r,T[_]=(e[u.getElementIndex(_,y)]+e[u.getElementIndex(y,_)])*r,T[v]=(e[u.getElementIndex(v,y)]+e[u.getElementIndex(y,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 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){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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;i>a;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){return n(e)?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):void 0},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 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(0>a&&(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 O=new s,I=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;7>P;++P){var D=P+1,L=2*D+1;M[P]=1/(D*L),w[P]=D/L}return M[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)x[f]=(M[f]*c-w[f])*o,C[f]=(M[f]*l-w[f])*o;var d=a*n*(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,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,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","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./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){"use strict";var _={},v=new n,T=new n,R=new n;_.eastNorthUpToFixedFrame=function(e,t,r){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return i(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x, +r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=v,s=T,l=R;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.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 m(s.x,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var A=new n,S=new n,g=new n;_.northEastDownToFixedFrame=function(e,t,r){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return i(r)?(r[0]=-o,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]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=A,s=S,l=g;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.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 m(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},_.northUpEastToFixedFrame=function(e,t,r){if(h.equalsEpsilon(e.x,0,h.EPSILON14)&&h.equalsEpsilon(e.y,0,h.EPSILON14)){var o=h.sign(e.z);return i(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=o,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(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=v,s=T,l=R;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(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 m(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 N=new p,O=new n(1,1,1),I=new m;_.headingPitchRollToFixedFrame=function(e,t,r,a,i,o){var u=p.fromHeadingPitchRoll(t,r,a,N),s=m.fromTranslationQuaternionRotationScale(n.ZERO,u,O,I);return o=_.eastNorthUpToFixedFrame(e,i,o),m.multiply(o,s,o)};var M=new m,w=new E;_.headingPitchRollQuaternion=function(e,t,n,r,a,i){var o=_.headingPitchRollToFixedFrame(e,t,n,r,a,M),u=m.getRotation(o,w);return p.fromRotationMatrix(u,i)};var x=24110.54841,C=8640184.812866,P=.093104,D=-62e-7,L=1.1772758384668e-19,U=72921158553e-15,b=h.TWO_PI/86400,F=new d;_.computeTemeToPseudoFixedMatrix=function(e,t){F=d.addSeconds(e,-d.computeTaiMinusUtc(e),F);var n,r=F.dayNumber,a=F.secondsOfDay,o=r-2451545;n=a>=43200?(o+.5)/y.DAYS_PER_JULIAN_CENTURY:(o-.5)/y.DAYS_PER_JULIAN_CENTURY;var u=x+n*(C+n*(P+n*D)),s=u*b%h.TWO_PI,c=U+L*(r-2451545.5),l=(a+.5*y.SECONDS_PER_DAY)%y.SECONDS_PER_DAY,f=s+c*l,m=Math.cos(f),p=Math.sin(f);return i(t)?(t[0]=m,t[1]=-p,t[2]=0,t[3]=p,t[4]=m,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(m,p,0,-p,m,0,0,0,1)},_.iau2006XysData=new l,_.earthOrientationParameters=u.NONE;var z=32.184,B=2451545;_.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+z,a=t.stop.dayNumber,i=t.stop.secondsOfDay+z,o=_.iau2006XysData.preload(n,r,a,i),u=_.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},_.computeIcrfToFixedMatrix=function(e,t){i(t)||(t=new E);var n=_.computeFixedToIcrfMatrix(e,t);if(i(n))return E.transpose(n,t)};var G=new f(0,0,0),q=new s(0,0,0,0,0,0),W=new E,V=new E;_.computeFixedToIcrfMatrix=function(e,t){i(t)||(t=new E);var n=_.earthOrientationParameters.compute(e,q);if(i(n)){var r=e.dayNumber,a=e.secondsOfDay+z,o=_.iau2006XysData.computeXysRadians(r,a,G);if(i(o)){var u=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=W;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=E.fromRotationZ(-o.s,V),m=E.multiply(l,f,W),p=e.dayNumber,v=e.secondsOfDay-d.computeTaiMinusUtc(e)+n.ut1MinusUtc,T=p-2451545,R=v/y.SECONDS_PER_DAY,A=.779057273264+R+.00273781191135448*(T+R);A=A%1*h.TWO_PI;var S=E.fromRotationZ(A,V),g=E.multiply(m,S,W),N=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),I=Math.sin(n.xPoleWander),M=Math.sin(n.yPoleWander),w=r-B+a/y.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*h.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),D=V;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,E.multiply(g,D,t)}}};var X=new r;_.pointToWindowCoordinates=function(e,t,n,r){return r=_.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},_.pointToGLWindowCoordinates=function(e,n,a,o){i(o)||(o=new t);var u=X;return m.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,u),u),r.multiplyByScalar(u,1/u.w,u),m.multiplyByVector(n,u,u),t.fromCartesian4(u,o)};var H=new n,Y=new n,k=new n;return _.rotationMatrixFromPositionVelocity=function(e,t,r,o){var u=a(r,c.WGS84).geodeticSurfaceNormal(e,H),s=n.cross(t,u,Y);n.equalsEpsilon(s,n.ZERO,h.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var l=n.cross(s,t,k);return n.cross(t,l,s),n.negate(s,s),i(o)||(o=new E),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=s.x,o[4]=s.y,o[5]=s.z,o[6]=l.x,o[7]=l.y,o[8]=l.z,o},_}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix3","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E){"use strict";function m(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(f.getColumn(r,0,p)),this._yAxis=n.fromCartesian4(f.getColumn(r,1,p));var i=n.fromCartesian4(f.getColumn(r,2,p));this._plane=d.fromPointNormal(e,i)}var p=new r;o(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 y=new e;m.fromPoints=function(t,n){var r=e.fromPoints(t,y);return new m(r.center,n)};var _=new h,v=new n;m.prototype.projectPointOntoPlane=function(e,r){var a=_;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,v);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,v)),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)}},m.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;r>a;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},m.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,v);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,v));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},m.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;n>r;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return m.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;r>l;++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},m}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";function n(t,n,a,i){return e(t,n,a,i,r),r.x>0&&r.y>0&&r.z>0}var r=new t;return n}),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,v=1+m-3*p/4+5*y/4-175*_/64,T=1-m+15*p/8-35*y/8,R=1-3*m+35*p/4,A=1-5*m,S=v*l-T*Math.sin(2*l)*m/2-R*Math.sin(4*l)*p/16-A*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=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,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),v=Math.sin(p),T=Math.cos(y),R=Math.sin(y),A=_*T,S=_*R,g=v*R,N=v*T,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(T*T*w*w+x*x),c=g+A*M,s=Math.atan2(f,c);var C;0===f?(C=0,d=1):(C=A*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,L=P*(256+P*(P*(74-47*P)-128))/1024,U=h*h,b=L*f*(h+L*(c*(2*U-1)-L*h*(4*f*f-3)*(4*U-3)/6)/4),F=n*D*(s-b),z=Math.atan2(T*w,S-N*M),B=Math.atan2(_*w,S*M-N);e._distance=F,e._startHeading=z,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,v=a.u4Over16,T=2*m*p*o/3+i*(1-y+7*v/4-15*_/4+579*p/64-(v-15*_/4+187*p/16)*o-(5*_/4-115*p/16)*u-29*p*s/16)+(y/2-v+71*_/32-85*p/16)*c+(5*v/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,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),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,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)},h}),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 d(e,t,n){var r=g;r.length=e;var a;if(t===n){for(a=0;e>a;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;e>a;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 v=a.cartographicToCartesian(h,I);e.pack(v,u,_),_+=3;for(var T=1;f>T;T++){var R=x.interpolateUsingSurfaceDistance(T*y,O);R.height=p[T],v=a.cartographicToCartesian(R,I),e.pack(v,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;n>a;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,m).height}return r};var p=new l,y=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,O=new t,I=new e,M=new e,w=new e,x=new o;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,v),E=l.multiplyByPointAsVector(s,e.UNIT_X,T),m=f.fromPointNormal(c,E,R),g=1;i.push(e.clone(t[0]));for(var N=i[0],O=t.length,I=1;O>I;++I){var M=t[I];if(f.getPointDistance(m,N)<0||f.getPointDistance(m,M)<0){var w=u.lineSegmentPlane(N,M,h,A);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}};var C=c.EPSILON10;return E.removeDuplicates=function(t){var n=t.length;if(2>n)return t;var r,a,i;for(r=1;n>r&&(a=t[r-1],i=t[r],!e.equalsEpsilon(a,i,C));++r);if(r===n)return t;for(var o=t.slice(0,r);n>r;++r)i=t[r],e.equalsEpsilon(a,i,C)||(o.push(e.clone(i)),a=i);return 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);if(1>o)return[];if(1===o){var f=u.scaleToGeodeticSurface(a[0],M);if(0!==l){var d=u.geodeticSurfaceNormal(f,I);e.multiplyByScalar(d,l,d),e.add(f,d,f)}return[f.x,f.y,f.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,_=0;for(y=0;o-1>y;y++)_+=E.numberOfPoints(a[y],a[y+1],m);var v=3*(_+1),T=new Array(v),R=0,A=s(l);for(y=0;o-1>y;y++){var S=a[y],O=a[y+1],w=A?l[y]:l,x=A?l[y+1]:l;R=h(S,O,m,u,w,x,T,R)}g.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,N);P.height=A?l[o-1]:l;var D=u.cartographicToCartesian(P,I);return e.pack(D,T,v-3),T},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;r>i;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/Queue",["../Core/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(){return 0!==this._length?this._array[this._offset]:void 0},t.prototype.contains=function(e){return-1!==this._array.indexOf(e)},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/WindingOrder",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"use strict";var n={CLOCKWISE:e.CW,COUNTER_CLOCKWISE:e.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return t(n)}),define("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PolylinePipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m){"use strict";function p(t,n,r){var a=e.subtract(n,t,b),i=e.subtract(r,n,F);return a.x*i.y-a.y*i.x>=0}function y(e){for(var t=e[0].x,n=0,r=0;r<e.length;r++)e[r].x>t&&(t=e[r].x,n=r);return n}function _(e){for(var t=e[0][0].x,n=0,r=0;r<e.length;r++){var a=e[r][y(e[r])].x;a>t&&(t=a,n=r)}return n}function v(e){for(var t=[],n=0;n<e.length;n++){var r=e[(n-1+e.length)%e.length],a=e[n],i=e[(n+1)%e.length];p(r,a,i)||t.push(a)}return t}function T(t,n){for(var r=0;r<t.length;r++)if(e.equals(n,t[r]))return r;return-1}function R(n,a,i){i=r(i,[]);var o=Number.MAX_VALUE,u=y(a),s=new e(a[u].x,n.y);i.push(u),i.push((u+1)%a.length);for(var c=a[0].x,l=c,f=1;f<a.length;++f)a[f].x<c?c=a[f].x:a[f].x>l&&(l=a[f].x);l+=l-c;var d=new t(l,n.y,0);for(f=0;f<a.length;f++){var h=a[f],E=a[(f+1)%a.length];if((h.x>=n.x||E.x>=n.x)&&(h.y>=n.y&&E.y<=n.y||h.y<=n.y&&E.y>=n.y)){var m=(E.y-h.y)*(d.x-n.x)-(E.x-h.x)*(d.y-n.y);if(0!==m){m=1/m;var p=((E.x-h.x)*(n.y-h.y)-(E.y-h.y)*(n.x-h.x))*m,_=((d.x-n.x)*(n.y-h.y)-(d.y-n.y)*(n.x-h.x))*m;if(p>=0&&1>=p&&_>=0&&1>=_){var v=new e(n.x+p*(d.x-n.x),n.y+p*(d.y-n.y)),T=e.subtract(v,n,z);m=e.magnitudeSquared(T),o>m&&(s=v,o=m,i[0]=f,i[1]=(f+1)%a.length)}}}}return s}function A(t,n){var r=_(n),a=n[r],i=y(a),o=a[i],u=[],s=R(o,t,u),c=T(t,s);if(-1!==c)return c;var d=e.magnitudeSquared(e.subtract(t[u[0]],o,B)),h=e.magnitudeSquared(e.subtract(t[u[1]],o,B)),E=h>d?t[u[0]]:t[u[1]],m=v(t),p=m.indexOf(E);-1!==p&&m.splice(p,1);for(var A=[],S=0;S<m.length;S++){var g=m[S];f(g,o,s,E)&&A.push(g)}var N=Number.MAX_VALUE;if(A.length>0){var O=e.fromElements(1,0,B);for(S=0;S<A.length;S++){var I=e.subtract(A[S],o,G),M=e.magnitude(O)*e.magnitudeSquared(I);if(0!==M){var w=Math.abs(l.acosClamped(e.dot(O,I)/M));N>w&&(N=w,E=A[S])}}}return t.indexOf(E)}function S(e,n,r){for(var a=ee.computeWindingOrder2D(e),i=0;i<n.length;i++){var o=n[i];t.equals(o[0],o[o.length-1])||o.push(o[0]);var s=ee.computeWindingOrder2D(o);s===a&&o.reverse()}var c=u.fromPoints(e,r),l=c.projectPointsOntoPlane(e),f=[];for(i=0;i<n.length;i++)f.push(c.projectPointsOntoPlane(n[i]));var d=A(l,f),h=_(f),E=y(f[h]),m=n[h],p=[];for(i=0;i<e.length;i++)p.push(e[i]);var v,T=[];if(0!==E)for(v=0;v<=m.length;v++){var R=(v+E)%m.length;0!==R&&T.push(m[R])}else for(v=0;v<m.length;v++)T.push(m[(v+E)%m.length]);var S=p.lastIndexOf(e[d]);T.push(e[S]);var g=p.slice(0,S+1),N=p.slice(S+1);return p=g.concat(T,N),n.splice(h,1),p}function g(e){var t=l.nextRandomNumber(),n=Math.floor(t*e);return n===e&&n--,n}function N(e,t,n,r){var a=r[e].position,i=r[t].position,o=r[n].position,u=o.x,s=o.y,c=a.x-u,l=a.y-s,f=i.x-u,d=i.y-s;return c*d-l*f}function O(e,t){return e.x*t.y-e.y*t.x}function I(e,t){var n=t.length,r=l.mod(e-1,n),a=l.mod(e+1,n);return 0===N(r,a,e,t)?!1:!0}function M(t,n){return e.magnitudeSquared(n)<e.magnitudeSquared(t)}function w(t,n,r){if(!I(t,r))return t;var a=r[t].position,i=r[n].position,o=r.length,u=l.mod(t-1,o);if(!I(u,r))return u;var s=l.mod(t+1,o);if(!I(s,r))return s;var c=e.subtract(r[u].position,a,V),f=e.subtract(r[s].position,a,X),d=e.subtract(i,a,H),h=O(c,d),E=O(f,d);if(0===h)return M(c,d)?q:W;if(0===E)return M(f,d)?q:W;var m=O(c,f);return 0>m?0>h&&E>0?q:W:m>0?h>0&&0>E?W:q:void 0}function x(e,t,n){return(e>t||e>n)&&(t>e||n>e)||t===n&&t===e}function C(t,n,r,a){var i=e.subtract(r,t,k),o=n.x*a.y-n.y*a.x,u=o*o,s=e.magnitudeSquared(n),c=e.magnitudeSquared(a);if(u>Y*s*c){var l=(i.x*a.y-i.y*a.x)/o;return e.add(t,e.multiplyByScalar(n,l,k),k)}}function P(t,n,r){for(var i=e.subtract(n,t,j),o=r.length,u=0;o>u;u++){var s=r[u].position,c=r[l.mod(u+1,o)].position;if(!(e.equals(t,s)||e.equals(n,c)||e.equals(t,c)||e.equals(n,s))){var f=e.subtract(c,s,Z),d=C(t,i,s,f);if(a(d)&&!(e.equals(d,t)||e.equals(d,n)||e.equals(d,s)||e.equals(d,c))){var h=d.x,E=d.y,m=x(h,t.x,n.x)&&x(E,t.y,n.y)&&x(h,s.x,c.x)&&x(E,s.y,c.y);if(m)return!0}}}return!1}function D(t,n,r){var a=w(t,n,r);if(a>=0)return a;var i=w(n,t,r);return i>=0?i:a!==q||i!==q||P(r[t].position,r[n].position,r)||e.equals(r[t].position,r[n].position)?J:K}function L(e){return 0===N(1,2,0,e)}function U(e){var t=e.length;if(3===t)return L(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new i("Invalid polygon: must have at least three vertices.");for(var n,r,a=0,o=10*e.length,u=J;K>u&&a++<o;){for(n=g(e.length),r=n+1;Math.abs(n-r)<2||Math.abs(n-r)>e.length-2;)r=g(e.length);if(n>r){var s=n;n=r,r=s}u=D(n,r,e)}if(u===K){var c=e.splice(n,r-n+1,e[n],e[r]);return U(e).concat(U(c))}return u>=0?(e.splice(u,1),U(e)):[]}var b=new e,F=new e,z=new e,B=new e(1,0),G=new e,q=-1,W=-2,V=new t,X=new t,H=new t,Y=l.EPSILON14,k=new e,j=new e,Z=new e,K=-1,J=-2,Q=new t,$=new t,ee={};ee.removeDuplicates=function(e){var n=d.removeDuplicates(e);return t.equals(n[0],n[n.length-1])?n.slice(1):n},ee.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;t>a;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},ee.computeWindingOrder2D=function(e){var t=ee.computeArea2D(e);return t>0?m.COUNTER_CLOCKWISE:m.CLOCKWISE},ee.triangulate=function(e){for(var t=e.length,n=[],r=0;t>r;++r)n[r]={position:e[r],index:r};return U(n)};var te=new t,ne=new t,re=new t,ae=new t,ie=new t,oe=new t,ue=new t;return ee.computeSubdivision=function(e,i,o,u){u=r(u,l.RADIANS_PER_DEGREE);var f,d=o.slice(0),E=i.length,m=new Array(3*E),p=0;for(f=0;E>f;f++){var y=i[f];m[p++]=y.x,m[p++]=y.y,m[p++]=y.z}for(var _=[],v={},T=e.maximumRadius,R=l.chordLength(u,T),A=R*R;d.length>0;){var S,g,N=d.pop(),O=d.pop(),I=d.pop(),M=t.fromArray(m,3*I,te),w=t.fromArray(m,3*O,ne),x=t.fromArray(m,3*N,re),C=t.multiplyByScalar(t.normalize(M,ae),T,ae),P=t.multiplyByScalar(t.normalize(w,ie),T,ie),D=t.multiplyByScalar(t.normalize(x,oe),T,oe),L=t.magnitudeSquared(t.subtract(C,P,ue)),U=t.magnitudeSquared(t.subtract(P,D,ue)),b=t.magnitudeSquared(t.subtract(D,C,ue)),F=Math.max(L,U,b);F>A?L===F?(S=Math.min(I,O)+" "+Math.max(I,O),f=v[S],a(f)||(g=t.add(M,w,ue),t.multiplyByScalar(g,.5,g),m.push(g.x,g.y,g.z),f=m.length/3-1,v[S]=f),d.push(I,f,N),d.push(f,O,N)):U===F?(S=Math.min(O,N)+" "+Math.max(O,N),f=v[S],a(f)||(g=t.add(w,x,ue),t.multiplyByScalar(g,.5,g),m.push(g.x,g.y,g.z),f=m.length/3-1,v[S]=f),d.push(O,f,I),d.push(f,N,I)):b===F&&(S=Math.min(N,I)+" "+Math.max(N,I),f=v[S],a(f)||(g=t.add(x,M,ue),t.multiplyByScalar(g,.5,g),m.push(g.x,g.y,g.z),f=m.length/3-1,v[S]=f),d.push(N,f,O),d.push(f,I,O)):(_.push(I),_.push(O),_.push(N))}return new s({attributes:{position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:m})},indices:_,primitiveType:h.TRIANGLES})},ee.scaleToGeodeticHeight=function(e,n,i,u){i=r(i,o.WGS84);var s=Q,c=$;if(n=r(n,0),u=r(u,!0),a(e)&&a(e.attributes)&&a(e.attributes.position))for(var l=e.attributes.position.values,f=l.length,d=0;f>d;d+=3)t.fromArray(l,d,c),u&&(c=i.scaleToGeodeticSurface(c,c)),0!==n&&(s=i.geodeticSurfaceNormal(c,s),t.multiplyByScalar(s,n,s),t.add(c,s,c)),l[d]=c.x,l[d+1]=c.y,l[d+2]=c.z;return e},ee.eliminateHoles=function(e,n,a){a=r(a,o.WGS84);for(var i=[],u=0;u<n.length;u++){for(var s=[],c=0;c<n[u].length;c++)s.push(t.clone(n[u][c]));i.push(s)}for(var l=e;i.length>0;)l=S(l,i,a);return l},ee}),define("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,n,r,a,i,o,u){"use strict";var s=Math.cos,c=Math.sin,l=Math.sqrt,f={};f.computePosition=function(e,t,r,a,i){var u=e.ellipsoid.radiiSquared,f=e.nwCorner,d=e.rectangle,h=f.latitude-e.granYCos*t+r*e.granXSin,E=s(h),m=c(h),p=u.z*m,y=f.longitude+t*e.granYSin+r*e.granXCos,_=E*s(y),v=E*c(y),T=u.x*_,R=u.y*v,A=l(T*_+R*v+p*m);a.x=T/A,a.y=R/A,a.z=p/A,n(e.vertexFormat)&&e.vertexFormat.st&&(i.x=(y-d.west)*e.lonScalar-.5,i.y=(h-d.south)*e.latScalar-.5,o.multiplyByVector(e.textureMatrix,i,i),i.x+=.5,i.y+=.5)};var d=new o,h=new e,E=new t,m=new e,p=new a;return f.computeOptions=function(t,a,s){var c,l,f,y,_,v=t._granularity,T=t._ellipsoid,R=t._surfaceHeight,A=t._rotation,S=t._extrudedHeight,g=a.east,N=a.west,O=a.north,I=a.south,M=O-I;N>g?(_=i.TWO_PI-N+g,c=Math.ceil(_/v)+1,l=Math.ceil(M/v)+1,f=_/(c-1),y=M/(l-1)):(_=g-N,c=Math.ceil(_/v)+1,l=Math.ceil(M/v)+1,f=_/(c-1),y=M/(l-1)),s=u.northwest(a,s);var w=u.center(a,E),x=y,C=f,P=0,D=0;if(n(A)){var L=Math.cos(A);x*=L,C*=L;var U=Math.sin(A);P=y*U,D=f*U,h=p.project(s,h),m=p.project(w,m),h=e.subtract(h,m,h);var b=o.fromRotation(A,d);h=o.multiplyByVector(b,h,h),h=e.add(h,m,h),s=p.unproject(h,s);var F=s.latitude,z=F+(c-1)*D,B=F-x*(l-1),G=F-x*(l-1)+(c-1)*D;O=Math.max(F,z,B,G),I=Math.min(F,z,B,G);var q=s.longitude,W=q+(c-1)*C,V=q+(l-1)*P,X=q+(l-1)*P+(c-1)*C;if(g=Math.max(q,W,V,X),N=Math.min(q,W,V,X),O<-i.PI_OVER_TWO||O>i.PI_OVER_TWO||I<-i.PI_OVER_TWO||I>i.PI_OVER_TWO)throw new r("Rotated rectangle is invalid. It crosses over either the north or south pole.");a.north=O,a.south=I,a.east=g,a.west=N}return{granYCos:x,granYSin:P,granXCos:C,granXSin:D,ellipsoid:T,width:c,height:l,surfaceHeight:R,extrudedHeight:S,nwCorner:s,rectangle:a}},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.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){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},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){return t(e)?(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):void 0},a}),define("Core/RectangleGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./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,f,d,h,E,m,p,y,_,v,T,R,A,S){"use strict";function g(e,t){var n=new c({attributes:new f,primitiveType:v.TRIANGLES});return n.attributes.position=new l({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new l({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new l({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.binormal&&(n.attributes.binormal=new l({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.binormals})),n}function N(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.binormal?new Float32Array(i):void 0,c=0,l=U,f=L,d=D,h=0;i>h;h+=3){var E=n.fromArray(e,h,P),m=c+1,p=c+2;(t.normal||t.tangent||t.binormal)&&(d=r.geodeticSurfaceNormal(E,d),(t.tangent||t.binormal)&&(n.cross(n.UNIT_Z,d,f),y.multiplyByVector(a,f,f),n.normalize(f,f),t.binormal&&n.normalize(n.cross(d,f,l),l)),t.normal&&(o[c]=d.x,o[m]=d.y,o[p]=d.z),t.tangent&&(u[c]=f.x,u[m]=f.y,u[p]=f.z),t.binormal&&(s[c]=l.x,s[m]=l.y,s[p]=l.z)),c+=3}return g(t,{positions:e,normals:o,tangents:u,binormals:s})}function O(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.binormal?new Float32Array(a):void 0,s=0,c=0,l=0,f=!0,d=U,h=L,E=D,p=0;a>p;p+=6){var y=n.fromArray(e,p,P);if(t.normal||t.tangent||t.binormal){var _=n.fromArray(e,(p+6)%a,G);if(f){var v=n.fromArray(e,(p+3)%a,q);n.subtract(_,y,_),n.subtract(v,y,v),E=n.normalize(n.cross(v,_,E),E),f=!1}n.equalsEpsilon(_,y,m.EPSILON10)&&(f=!0),(t.tangent||t.binormal)&&(d=r.geodeticSurfaceNormal(y,d),t.tangent&&(h=n.normalize(n.cross(d,E,h),h))),t.normal&&(i[s++]=E.x,i[s++]=E.y,i[s++]=E.z,i[s++]=E.x,i[s++]=E.y,i[s++]=E.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++]=d.x,u[l++]=d.y,u[l++]=d.z,u[l++]=d.x,u[l++]=d.y,u[l++]=d.z)}}return g(t,{positions:e,normals:i,tangents:o,binormals:u})}function I(e){for(var t=e.vertexFormat,n=e.ellipsoid,r=e.size,i=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,f=0,d=P,h=F,m=Number.MAX_VALUE,p=Number.MAX_VALUE,y=Number.MIN_VALUE,_=Number.MIN_VALUE,v=0;i>v;++v)for(var T=0;o>T;++T)A.computePosition(e,v,T,d,h),u[c++]=d.x,u[c++]=d.y,u[c++]=d.z,t.st&&(s[f++]=h.x,s[f++]=h.y,m=Math.min(m,h.x),p=Math.min(p,h.y),y=Math.max(y,h.x),_=Math.max(_,h.y));if(t.st&&(0>m||0>p||y>1||_>1))for(var R=0;R<s.length;R+=2)s[R]=(s[R]-m)/(y-m),s[R+1]=(s[R+1]-p)/(_-p);for(var S=N(u,t,n,e.tangentRotationMatrix),g=6*(o-1)*(i-1),O=E.createTypedArray(r,g),I=0,M=0,w=0;i-1>w;++w){for(var x=0;o-1>x;++x){var C=I,D=C+o,L=D+1,U=C+1;O[M++]=C,O[M++]=D,O[M++]=U,O[M++]=U,O[M++]=D,O[M++]=L,++I}++I}return S.indices=O,t.st&&(S.attributes.st=new l({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:s})),S}function M(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 w(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 x(e){var t,r=e.vertexFormat,i=e.surfaceHeight,o=e.extrudedHeight,u=Math.min(o,i),s=Math.max(o,i),c=e.height,f=e.width,p=e.ellipsoid,y=I(e);if(m.equalsEpsilon(u,s,m.EPSILON10))return y;y=_.scaleToGeodeticHeight(y,s,p,!1);var v=new Float64Array(y.attributes.position.values),T=v.length,R=2*T,A=new Float64Array(R);A.set(v),y=_.scaleToGeodeticHeight(y,u,p);var S=y.attributes.position.values;A.set(S,T),y.attributes.position.values=A;var g,N=r.normal?new Float32Array(R):void 0,x=r.tangent?new Float32Array(R):void 0,C=r.binormal?new Float32Array(R):void 0,P=r.st?new Float32Array(R/3*2):void 0;if(r.normal){var D=y.attributes.normal.values;for(N.set(D),t=0;T>t;t++)D[t]=-D[t];N.set(D,T),y.attributes.normal.values=N}if(r.tangent){var L=y.attributes.tangent.values;for(x.set(L),t=0;T>t;t++)L[t]=-L[t];x.set(L,T),y.attributes.tangent.values=x}if(r.binormal){var U=y.attributes.binormal.values;C.set(U),C.set(U,T),y.attributes.binormal.values=C}r.st&&(g=y.attributes.st.values,P.set(g),P.set(g,T/3*2),y.attributes.st.values=P);var b=y.indices,F=b.length,z=T/3,B=E.createTypedArray(R/3,2*F);for(B.set(b),t=0;F>t;t+=3)B[t+F]=b[t+2]+z,B[t+1+F]=b[t+1]+z,B[t+2+F]=b[t]+z;y.indices=B;var W=2*f+2*c-4,V=2*(W+4),X=new Float64Array(3*V),H=r.st?new Float32Array(2*V):void 0,Y=0,k=0,j=f*c;for(t=0;j>t;t+=f)X=M(X,Y,3*t,v,S),Y+=6,r.st&&(H=w(H,k,2*t,g),k+=4);for(t=j-f;j>t;t++)X=M(X,Y,3*t,v,S),Y+=6,r.st&&(H=w(H,k,2*t,g),k+=4);for(t=j-1;t>0;t-=f)X=M(X,Y,3*t,v,S),Y+=6,r.st&&(H=w(H,k,2*t,g),k+=4);for(t=f-1;t>=0;t--)X=M(X,Y,3*t,v,S),Y+=6,r.st&&(H=w(H,k,2*t,g),k+=4);var Z=O(X,r,p);r.st&&(Z.attributes.st=new l({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:H}));var K,J,Q,$,ee=E.createTypedArray(V,6*W);T=X.length/3;var te=0;for(t=0;T-1>t;t+=2){K=t,$=(K+2)%T;var ne=n.fromArray(X,3*K,G),re=n.fromArray(X,3*$,q);n.equalsEpsilon(ne,re,m.EPSILON10)||(J=(K+1)%T,Q=(J+2)%T,ee[te++]=K,ee[te++]=J,ee[te++]=$,ee[te++]=$,ee[te++]=J,ee[te++]=Q)}return Z.indices=ee,Z=h.combineInstances([new d({geometry:y}),new d({geometry:Z})]),Z[0]}function C(e){e=i(e,i.EMPTY_OBJECT);var t=e.rectangle,n=i(e.granularity,m.RADIANS_PER_DEGREE),r=i(e.ellipsoid,s.WGS84),a=i(e.height,0),u=i(e.rotation,0),c=i(e.stRotation,0),l=i(e.vertexFormat,S.DEFAULT),f=e.extrudedHeight,d=o(f),h=i(e.closeTop,!0),E=i(e.closeBottom,!0);this._rectangle=t,this._granularity=n,this._ellipsoid=s.clone(r), +this._surfaceHeight=a,this._rotation=u,this._stRotation=c,this._vertexFormat=S.clone(l),this._extrudedHeight=i(f,0),this._extrude=d,this._closeTop=h,this._closeBottom=E,this._workerName="createRectangleGeometry"}var P=new n,D=new n,L=new n,U=new n,b=new R,F=new t,z=new e,B=new e,G=new n,q=new n;C.packedLength=R.packedLength+s.packedLength+S.packedLength+8,C.pack=function(e,t,n){n=i(n,0),R.pack(e._rectangle,t,n),n+=R.packedLength,s.pack(e._ellipsoid,t,n),n+=s.packedLength,S.pack(e._vertexFormat,t,n),n+=S.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};var W=new R,V=s.clone(s.UNIT_SPHERE),X=new S,H={rectangle:W,ellipsoid:V,vertexFormat:X,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,closeTop:void 0,closeBottom:void 0};C.unpack=function(e,t,n){t=i(t,0);var r=R.unpack(e,t,W);t+=R.packedLength;var a=s.unpack(e,t,V);t+=s.packedLength;var u=S.unpack(e,t,X);t+=S.packedLength;var c=e[t++],l=e[t++],f=e[t++],d=e[t++],h=e[t++],E=1===e[t++],m=1===e[t++],p=1===e[t];return o(n)?(n._rectangle=R.clone(r,n._rectangle),n._ellipsoid=s.clone(a,n._ellipsoid),n._vertexFormat=S.clone(u,n._vertexFormat),n._granularity=c,n._surfaceHeight=l,n._rotation=f,n._stRotation=d,n._extrudedHeight=E?h:void 0,n._extrude=E,n._closeTop=m,n._closeBottom=p,n):(H.granularity=c,H.height=l,H.rotation=f,H.stRotation=d,H.extrudedHeight=E?h:void 0,H.closeTop=m,H.closeBottom=p,new C(H))};var Y=new p,k=new y,j=new r,Z=new T,K=new r;return C.createGeometry=function(t){var r=R.clone(t._rectangle,b),a=t._ellipsoid,i=t._surfaceHeight,u=t._extrude,s=t._extrudedHeight,l=t._stRotation,d=t._vertexFormat,h=A.computeOptions(t,r,j),E=Y,m=k;if(o(l)){p.fromRotation(-l,E);var v=R.center(r,K),S=a.cartographicToCartesian(v,G);n.normalize(S,S),T.fromAxisAngle(S,-l,Z),y.fromQuaternion(Z,m)}else p.clone(p.IDENTITY,E),y.clone(y.IDENTITY,m);h.lonScalar=1/r.width,h.latScalar=1/r.height,h.vertexFormat=d,h.textureMatrix=E,h.tangentRotationMatrix=m,h.size=h.width*h.height;var g,N;if(r=t._rectangle,u){g=x(h);var O=e.fromRectangle3D(r,a,i,B),M=e.fromRectangle3D(r,a,s,z);N=e.union(O,M)}else g=I(h),g=_.scaleToGeodeticHeight(g,i,a,!1),N=e.fromRectangle3D(r,a,i);return d.position||delete g.attributes.position,new c({attributes:new f(g.attributes),indices:g.indices,primitiveType:g.primitiveType,boundingSphere:N})},C.createShadowVolume=function(e,t,n){var r=e._granularity,a=e._ellipsoid,i=t(r,a),o=n(r,a);return new C({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})},C}),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/Workers/createRectangleOutlineGeometry.js b/Workers/createRectangleOutlineGeometry.js index 0102fab..06279f8 100644 --- a/Workers/createRectangleOutlineGeometry.js +++ b/Workers/createRectangleOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,7 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(n){t=n.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:0>e?-1:0},n.signNotZero=function(e){return 0>e?-1:1},n.toSNorm=function(e){return Math.round(255*(.5*n.clamp(e,-1,1)+.5))},n.fromSNorm=function(e){return 2*(n.clamp(e,0,255)/255)-1},n.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},n.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},n.lerp=function(e,t,n){return(1-n)*e+n*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=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){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,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},n.negativePiToPi=function(e){for(var t=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+t)>e;)e+=i;if(-r>e)return-r;for(;e>r+t;)e-=i;return e>r?r:e},n.zeroToTwoPi=function(e){var t=e%n.TWO_PI;return 0>t?(t+n.TWO_PI)%n.TWO_PI:t},n.equalsEpsilon=function(e,n,r){return r=t(r,0),Math.abs(e-n)<=r};var r=[1];n.factorial=function(e){var t=r.length;if(e>=t)for(var n=r[t-1],i=t;e>=i;i++)r.push(n*i);return r[e]},n.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(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,n){return t>e?t:e>n?n:e};var i=new e;return n.setRandomNumberSeed=function(t){i=new e(t)},n.nextRandomNumber=function(){return i.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}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";var a=function(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)};a.fromSpherical=function(n,r){t(r)||(r=new a);var i=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(e,n,r,i){return t(i)?(i.x=e,i.y=n,i.z=r,i):new a(e,n,r)},a.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new a(e.x,e.y,e.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(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},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var u=new a;a.lerp=function(e,t,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){a.normalize(e,s),a.normalize(t,c);var n=a.dot(s,c),r=a.magnitude(a.cross(s,c,s));return Math.atan2(r,n)};var l=new a;a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,l);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):n.y<=n.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,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},a.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r&&Math.abs(e.z-n.z)<=r},a.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},a.fromDegrees=function(e,t,n,r,o){var u=i.toRadians(e),s=i.toRadians(t);return a.fromRadians(u,s,n,r,o)};var f=new a,h=new a,d=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=e(i,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=a.normalize(f,f),a.multiplyComponents(s,f,h);var l=Math.sqrt(a.dot(f,h));return h=a.divideByScalar(h,l,h),f=a.multiplyByScalar(f,i,f),t(u)||(u=new a),a.add(h,f,u)},a.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=i.toRadians(e[o]);return a.fromRadiansArray(r,t,n)},a.fromRadiansArray=function(e,n,r){var i=e.length;t(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=a.fromRadians(u,s,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=i.toRadians(e[o]),r[o+1]=i.toRadians(e[o+1]),r[o+2]=e[o+2];return a.fromRadiansArrayHeights(r,t,n)},a.fromRadiansArrayHeights=function(e,n,r){var i=e.length;t(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=a.fromRadians(u,s,c,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";var a=function(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)};return a.fromRadians=function(n,r,i,o){return i=e(i,0),t(o)?(o.longitude=n,o.latitude=r,o.height=i,o):new a(n,r,i)},a.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),a.fromRadians(e,t,n,r)},a.clone=function(e,n){return t(e)?t(n)?(n.longitude=e.longitude,n.latitude=e.latitude,n.height=e.height,n):new a(e.longitude,e.latitude,e.height):void 0},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.longitude===n.longitude&&e.latitude===n.latitude&&e.height===n.height},a.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.longitude-n.longitude)<=r&&Math.abs(e.latitude-n.latitude)<=r&&Math.abs(e.height-n.height)<=r},a.ZERO=r(new a(0,0,0)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"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}var c=function(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,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))return void 0;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.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),c=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,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 l=new e,f=new e;c.prototype.cartographicToCartesian=function(t,n){var i=l,a=f;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;n>i;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var h=new e,d=new e,m=new e;c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,d);if(!r(a))return void 0;var o=this.geodeticSurfaceNormal(a,h),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)},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;n>i;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};var y=new e,p=new e;return c.prototype.scaleToGeodeticSurface=function(t,n){var i=t.x,a=t.y,o=t.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,h=i*i*c*c,d=a*a*l*l,m=o*o*f*f,v=h+d+m,g=Math.sqrt(1/v),w=e.multiplyByScalar(t,g,y);if(v<this._centerToleranceSquared)return isFinite(g)?e.clone(w,n):void 0;var x=this._oneOverRadiiSquared,E=x.x,S=x.y,M=x.z,O=p;O.x=2*w.x*E,O.y=2*w.y*S,O.z=2*w.z*M;var _,R,T,C,N,P,I,b,z,D,A,U=(1-g)*e.magnitude(t)/(.5*e.magnitude(O)),q=0;do{U-=q,T=1/(1+U*E),C=1/(1+U*S),N=1/(1+U*M),P=T*T,I=C*C,b=N*N,z=P*T,D=I*C,A=b*N,_=h*P+d*I+m*b-1,R=h*z*E+d*D*S+m*A*M;var L=-2*R;q=_/L}while(Math.abs(_)>u.EPSILON12);return r(n)?(n.x=i*T,n.y=a*C,n.z=o*N,n):new e(i*T,a*C,o*N)},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}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o){"use strict";var u=function(e,n,r,i){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(i,0)};u.fromDegrees=function(e,r,i,a,s){return e=o.toRadians(t(e,0)),r=o.toRadians(t(r,0)),i=o.toRadians(t(i,0)),a=o.toRadians(t(a,0)),n(s)?(s.west=e,s.south=r,s.east=i,s.north=a,s):new u(e,r,i,a)},u.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=e.length;c>s;s++){var l=e[s];r=Math.min(r,l.longitude),i=Math.max(i,l.longitude),a=Math.min(a,l.latitude),o=Math.max(o,l.latitude)}return n(t)?(t.west=r,t.south=a,t.east=i,t.north=o,t):new u(r,a,i,o)},u.packedLength=4,u.pack=function(e,n,r){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},u.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i.west=e[r++],i.south=e[r++],i.east=e[r++],i.north=e[r],i},u.clone=function(e,t){return n(e)?n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.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},u.validate=function(){},u.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)},u.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)},u.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)},u.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)},u.center=function(t,r){var i=t.east,a=t.west,u=.5*(a+i);return a>i&&(u=o.negativePiToPi(u+o.PI)),n(r)?(r.longitude=u,r.latitude=.5*(t.south+t.north),r.height=0,r):new e(u,.5*(t.south+t.north))},u.intersectWith=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),s=Math.min(e.north,t.north);return n(r)?(r.west=i,r.south=a,r.east=o,r.north=s,r):new u(i,a,o,s)},u.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},u.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var s=new e;return u.subsample=function(e,r,a,u){r=t(r,i.WGS84),a=t(a,0),n(u)||(u=[]);var c=0,l=e.north,f=e.south,h=e.east,d=e.west,m=s;m.height=a,m.longitude=d,m.latitude=l,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:f>0?f:0;for(var y=1;8>y;++y){var p=-Math.PI+y*o.PI_OVER_TWO;p>d&&h>p&&(m.longitude=p,u[c]=r.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";var u=function(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";var t=function(t,n){this.start=e(t,0),this.stop=e(n,0)};return t}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";var i=function(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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 a=new i;i.distance=function(e,t){return i.subtract(e,t,a),i.magnitude(a)},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.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 o=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,o),r=i.multiplyByScalar(e,1-n,r),i.add(o,r,r)};var u=new i;return i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,u);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.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r&&Math.abs(e.z-n.z)<=r&&Math.abs(e.w-n.w)<=r},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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function u(e){for(var t=0,n=0;3>n;++n){var r=e[c.getElementIndex(d[n],h[n])];t+=2*r*r}return Math.sqrt(t)}function s(e,t){for(var n=a.EPSILON15,r=0,i=1,o=0;3>o;++o){var u=Math.abs(e[c.getElementIndex(d[o],h[o])]);u>r&&(i=o,r=u)}var s=1,l=0,f=h[i],m=d[i];if(Math.abs(e[c.getElementIndex(m,f)])>n){var y,p=e[c.getElementIndex(m,m)],v=e[c.getElementIndex(f,f)],g=e[c.getElementIndex(m,f)],w=(p-v)/2/g;y=0>w?-1/(-w+Math.sqrt(1+w*w)):1/(w+Math.sqrt(1+w*w)),s=1/Math.sqrt(1+y*y),l=y*s}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(f,f)]=t[c.getElementIndex(m,m)]=s,t[c.getElementIndex(m,f)]=l,t[c.getElementIndex(f,m)]=-l,t}var c=function(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)};c.clone=function(e,t){return n(e)?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 c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,r,i){return r=t(r,0),n(i)||(i=new c),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},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var r=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,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,m=r-u-f+d,y=2*(i-h),p=2*(a+l),v=2*(i+h),g=-r+u-f+d,w=2*(s-o),x=2*(a-l),E=2*(s+o),S=-r-u+f+d;return n(t)?(t[0]=m,t[1]=v,t[2]=x,t[3]=y,t[4]=g,t[5]=E,t[6]=p,t[7]=w,t[8]=S,t):new c(m,y,p,v,g,w,x,E,S)},c.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 c(e.x,0,0,0,e.y,0,0,0,e.z)},c.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 c(e,0,0,0,e,0,0,0,e)},c.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 c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.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 c(1,0,0,0,r,-i,0,i,r)},c.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 c(r,0,i,0,1,0,-i,0,r)},c.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 c(r,-i,0,i,r,0,0,0,1)},c.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]]},c.getElementIndex=function(e,t){return 3*e+t},c.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},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},c.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},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,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[3],t[4],t[5],l)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),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]*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},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},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},c.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},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},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},c.transpose=function(e,t){var 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 h=[1,0,0],d=[2,2,1],m=new c,y=new c;return c.computeEigenDecomposition=function(e,t){var r=a.EPSILON20,i=10,l=0,f=0;n(t)||(t={});for(var h=t.unitary=c.clone(c.IDENTITY,t.unitary),d=t.diagonal=c.clone(e,t.diagonal),p=r*o(d);i>f&&u(d)>p;)s(d,m),c.transpose(m,y),c.multiply(d,m,d),c.multiply(y,d,d),c.multiply(h,m,h),++l>2&&(++f,l=0);return t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},c.determinant=function(e){var t=e[0],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)},c.inverse=function(e,t){var n=e[0],i=e[1],o=e[2],u=e[3],s=e[4],l=e[5],f=e[6],h=e[7],d=e[8],m=c.determinant(e);if(Math.abs(m)<=a.EPSILON15)throw new r("matrix is not invertible");t[0]=s*d-h*l,t[1]=h*o-i*d,t[2]=i*l-s*o,t[3]=f*l-u*d,t[4]=n*d-f*o,t[5]=u*o-n*l,t[6]=u*h-f*s,t[7]=f*i-n*h,t[8]=n*s-u*i;var y=1/m;return c.multiplyByScalar(t,y,t)},c.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]},c.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},c.IDENTITY=i(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(n){t=n.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s){"use strict";var c=function(e,t,r,i,a,o,u,s,c,l,f,h,d,m,y,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(m,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(y,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(p,0)};c.packedLength=16,c.pack=function(e,t,r){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]},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){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new 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]):void 0},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,l=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,m=t.y*t.z,y=t.y*t.w,p=t.z*t.z,v=t.z*t.w,g=t.w*t.w,w=s-d-p+g,x=2*(l-v),E=2*(f+y),S=2*(l+v),M=-s+d-p+g,O=2*(m-h),_=2*(f-y),R=2*(m+h),T=-s-d+p+g; -return i[0]=w*a,i[1]=S*a,i[2]=_*a,i[3]=0,i[4]=x*o,i[5]=M*o,i[6]=R*o,i[7]=0,i[8]=E*u,i[9]=O*u,i[10]=T*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.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 l=new e,f=new e,h=new e;c.fromCamera=function(t,n){var i=t.eye,a=t.target,o=t.up;e.normalize(e.subtract(a,i,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,m=l.x,y=l.y,p=l.z,v=h.x,g=h.y,w=h.z,x=i.x,E=i.y,S=i.z,M=u*-x+s*-E+d*-S,O=v*-x+g*-E+w*-S,_=m*x+y*E+p*S;return r(n)?(n[0]=u,n[1]=v,n[2]=-m,n[3]=0,n[4]=s,n[5]=g,n[6]=-y,n[7]=0,n[8]=d,n[9]=w,n[10]=-p,n[11]=0,n[12]=M,n[13]=O,n[14]=_,n[15]=1,n):new c(u,s,d,M,v,g,w,O,-m,-y,-p,_,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),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},c.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},c.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},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),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},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 c=.5*u,l=.5*s,f=.5*(r-t),h=c,d=l,m=f,y=a+c,p=o+l,v=t+f,g=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]=m,i[11]=0,i[12]=y,i[13]=p,i[14]=v,i[15]=g,i},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.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 d=new e;c.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;c.getMaximumScale=function(t){return c.getScale(t,m),e.maximumComponent(m)},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],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],m=e[11],y=e[12],p=e[13],v=e[14],g=e[15],w=t[0],x=t[1],E=t[2],S=t[3],M=t[4],O=t[5],_=t[6],R=t[7],T=t[8],C=t[9],N=t[10],P=t[11],I=t[12],b=t[13],z=t[14],D=t[15],A=r*w+u*x+f*E+y*S,U=i*w+s*x+h*E+p*S,q=a*w+c*x+d*E+v*S,L=o*w+l*x+m*E+g*S,W=r*M+u*O+f*_+y*R,B=i*M+s*O+h*_+p*R,F=a*M+c*O+d*_+v*R,G=o*M+l*O+m*_+g*R,Y=r*T+u*C+f*N+y*P,j=i*T+s*C+h*N+p*P,V=a*T+c*C+d*N+v*P,H=o*T+l*C+m*N+g*P,k=r*I+u*b+f*z+y*D,X=i*I+s*b+h*z+p*D,Z=a*I+c*b+d*z+v*D,J=o*I+l*b+m*z+g*D;return n[0]=A,n[1]=U,n[2]=q,n[3]=L,n[4]=W,n[5]=B,n[6]=F,n[7]=G,n[8]=Y,n[9]=j,n[10]=V,n[11]=H,n[12]=k,n[13]=X,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],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],m=e[14],y=t[0],p=t[1],v=t[2],g=t[4],w=t[5],x=t[6],E=t[8],S=t[9],M=t[10],O=t[12],_=t[13],R=t[14],T=r*y+o*p+c*v,C=i*y+u*p+l*v,N=a*y+s*p+f*v,P=r*g+o*w+c*x,I=i*g+u*w+l*x,b=a*g+s*w+f*x,z=r*E+o*S+c*M,D=i*E+u*S+l*M,A=a*E+s*S+f*M,U=r*O+o*_+c*R+h,q=i*O+u*_+l*R+d,L=a*O+s*_+f*R+m;return n[0]=T,n[1]=C,n[2]=N,n[3]=0,n[4]=P,n[5]=I,n[6]=b,n[7]=0,n[8]=z,n[9]=D,n[10]=A,n[11]=0,n[12]=U,n[13]=q,n[14]=L,n[15]=1,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 y=new e;c.multiplyByUniformScale=function(e,t,n){return y.x=t,y.y=t,y.z=t,c.multiplyByScale(e,y,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,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},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[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]},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 p=new u,v=new u,g=new t,w=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,p),v,o.EPSILON7)&&t.equals(c.getRow(e,3,g),w))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],l=e[12],f=e[1],h=e[5],d=e[9],m=e[13],y=e[2],x=e[6],E=e[10],S=e[14],M=e[3],O=e[7],_=e[11],R=e[15],T=E*R,C=S*_,N=x*R,P=S*O,I=x*_,b=E*O,z=y*R,D=S*M,A=y*_,U=E*M,q=y*O,L=x*M,W=T*h+P*d+I*m-(C*h+N*d+b*m),B=C*f+z*d+U*m-(T*f+D*d+A*m),F=N*f+D*h+q*m-(P*f+z*h+L*m),G=b*f+A*h+L*d-(I*f+U*h+q*d),Y=C*i+N*a+b*l-(T*i+P*a+I*l),j=T*r+D*a+A*l-(C*r+z*a+U*l),V=P*r+z*i+L*l-(N*r+D*i+q*l),H=I*r+U*i+q*a-(b*r+A*i+L*a);T=a*m,C=l*d,N=i*m,P=l*h,I=i*d,b=a*h,z=r*m,D=l*f,A=r*d,U=a*f,q=r*h,L=i*f;var k=T*O+P*_+I*R-(C*O+N*_+b*R),X=C*M+z*_+U*R-(T*M+D*_+A*R),Z=N*M+D*O+q*R-(P*M+z*O+L*R),J=b*M+A*O+L*_-(I*M+U*O+q*_),K=N*E+b*S+C*x-(I*S+T*x+P*E),$=A*S+T*y+D*E-(z*E+U*S+C*y),Q=z*x+L*S+P*y-(q*S+N*y+D*x),et=q*E+I*y+U*x-(A*x+L*E+b*y),tt=r*W+i*B+a*F+l*G;if(Math.abs(tt)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return tt=1/tt,n[0]=W*tt,n[1]=B*tt,n[2]=F*tt,n[3]=G*tt,n[4]=Y*tt,n[5]=j*tt,n[6]=V*tt,n[7]=H*tt,n[8]=k*tt,n[9]=X*tt,n[10]=Z*tt,n[11]=J*tt,n[12]=K*tt,n[13]=$*tt,n[14]=Q*tt,n[15]=et*tt,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],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],m=-n*f-r*h-i*d,y=-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]=m,t[13]=y,t[14]=p,t[15]=1,t},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[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/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,c,l){"use strict";var f=function(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)},h=new e,d=new e,m=new e,y=new e,p=new e,v=new e,g=new e,w=new e,x=new e,E=new e,S=new e,M=new e;f.fromPoints=function(t,n){if(r(n)||(n=new f),!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],g),a=e.clone(i,h),o=e.clone(i,d),u=e.clone(i,m),s=e.clone(i,y),c=e.clone(i,p),l=e.clone(i,v),O=t.length,_=1;O>_;_++){e.clone(t[_],i);var R=i.x,T=i.y,C=i.z;R<a.x&&e.clone(i,a),R>s.x&&e.clone(i,s),T<o.y&&e.clone(i,o),T>c.y&&e.clone(i,c),C<u.z&&e.clone(i,u),C>l.z&&e.clone(i,l)}var N=e.magnitudeSquared(e.subtract(s,a,w)),P=e.magnitudeSquared(e.subtract(c,o,w)),I=e.magnitudeSquared(e.subtract(l,u,w)),b=a,z=s,D=N;P>D&&(D=P,b=o,z=c),I>D&&(D=I,b=u,z=l);var A=x;A.x=.5*(b.x+z.x),A.y=.5*(b.y+z.y),A.z=.5*(b.z+z.z);var U=e.magnitudeSquared(e.subtract(z,A,w)),q=Math.sqrt(U),L=E;L.x=a.x,L.y=o.y,L.z=u.z;var W=S;W.x=s.x,W.y=c.y,W.z=l.z;var B=e.multiplyByScalar(e.add(L,W,w),.5,M),F=0;for(_=0;O>_;_++){e.clone(t[_],i);var G=e.magnitude(e.subtract(i,B,w));G>F&&(F=G);var Y=e.magnitudeSquared(e.subtract(i,A,w));if(Y>U){var j=Math.sqrt(Y);q=.5*(q+j),U=q*q;var V=j-q;A.x=(q*A.x+V*i.x)/j,A.y=(q*A.y+V*i.y)/j,A.z=(q*A.z+V*i.z)/j}}return F>q?(e.clone(A,n.center),n.radius=q):(e.clone(B,n.center),n.radius=F),n};var O=new o,_=new e,R=new e,T=new t,C=new t;f.fromRectangle2D=function(e,t,n){return f.fromRectangleWithHeights2D(e,t,0,0,n)},f.fromRectangleWithHeights2D=function(t,i,a,o,u){if(r(u)||(u=new f),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=n(i,O),l.southwest(t,T),T.height=a,l.northeast(t,C),C.height=o;var s=i.project(T,_),c=i.project(C,R),h=c.x-s.x,d=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(h*h+d*d+m*m);var y=u.center;return y.x=s.x+.5*h,y.y=s.y+.5*d,y.z=s.z+.5*m,u};var N=[];f.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,N)),f.fromPoints(u,o)},f.fromVertices=function(t,i,a,o){if(r(o)||(o=new f),!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=g;u.x=t[0]+i.x,u.y=t[1]+i.y,u.z=t[2]+i.z;for(var s=e.clone(u,h),c=e.clone(u,d),l=e.clone(u,m),O=e.clone(u,y),_=e.clone(u,p),R=e.clone(u,v),T=t.length,C=0;T>C;C+=a){var N=t[C]+i.x,P=t[C+1]+i.y,I=t[C+2]+i.z;u.x=N,u.y=P,u.z=I,N<s.x&&e.clone(u,s),N>O.x&&e.clone(u,O),P<c.y&&e.clone(u,c),P>_.y&&e.clone(u,_),I<l.z&&e.clone(u,l),I>R.z&&e.clone(u,R)}var b=e.magnitudeSquared(e.subtract(O,s,w)),z=e.magnitudeSquared(e.subtract(_,c,w)),D=e.magnitudeSquared(e.subtract(R,l,w)),A=s,U=O,q=b;z>q&&(q=z,A=c,U=_),D>q&&(q=D,A=l,U=R);var L=x;L.x=.5*(A.x+U.x),L.y=.5*(A.y+U.y),L.z=.5*(A.z+U.z);var W=e.magnitudeSquared(e.subtract(U,L,w)),B=Math.sqrt(W),F=E;F.x=s.x,F.y=c.y,F.z=l.z;var G=S;G.x=O.x,G.y=_.y,G.z=R.z;var Y=e.multiplyByScalar(e.add(F,G,w),.5,M),j=0;for(C=0;T>C;C+=a){u.x=t[C]+i.x,u.y=t[C+1]+i.y,u.z=t[C+2]+i.z;var V=e.magnitude(e.subtract(u,Y,w));V>j&&(j=V);var H=e.magnitudeSquared(e.subtract(u,L,w));if(H>W){var k=Math.sqrt(H);B=.5*(B+k),W=B*B;var X=k-B;L.x=(B*L.x+X*u.x)/k,L.y=(B*L.y+X*u.y)/k,L.z=(B*L.z+X*u.z)/k}}return j>B?(e.clone(L,o.center),o.radius=B):(e.clone(Y,o.center),o.radius=j),o},f.fromCornerPoints=function(t,n,i){r(i)||(i=new f);var a=i.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,n),i},f.fromEllipsoid=function(t,n){return r(n)||(n=new f),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n},f.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new f(t.center,t.radius):void 0},f.packedLength=4,f.pack=function(e,t,r){r=n(r,0);var i=e.center;t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius},f.unpack=function(e,t,i){t=n(t,0),r(i)||(i=new f);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,I=new e;f.union=function(t,n,i){r(i)||(i=new f);var a=t.center,o=n.center;e.add(a,o,I);var u=e.multiplyByScalar(I,.5,I),s=e.magnitude(e.subtract(a,u,P))+t.radius,c=e.magnitude(e.subtract(o,u,P))+n.radius;return i.radius=Math.max(s,c),e.clone(u,i.center),i};var b=new e;f.expand=function(t,n,r){r=f.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,b));return i>r.radius&&(r.radius=i),r},f.intersect=function(t,n){var r=t.center,i=t.radius,a=e.dot(n,r)+n.w;return-i>a?u.OUTSIDE:i>a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;f.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},f.transformWithoutScale=function(e,t,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var D=new e;f.computePlaneDistances=function(t,n,i,a){r(a)||(a=new s);var o=e.subtract(t.center,n,D),u=e.multiplyByScalar(i,e.dot(i,o),D),c=e.magnitude(u);return a.start=c-t.radius,a.stop=c+t.radius,a};for(var A=new e,U=new e,q=new e,L=new e,W=new e,B=new t,F=new Array(8),G=0;8>G;++G)F[G]=new e;var Y=new o;return f.projectTo2D=function(t,r,i){r=n(r,Y);var a=r.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,A),c=e.cross(e.UNIT_Z,s,U);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 h=e.negate(l,W),d=e.negate(c,L),m=F,y=m[0];e.add(s,l,y),e.add(y,c,y),y=m[1],e.add(s,l,y),e.add(y,d,y),y=m[2],e.add(s,h,y),e.add(y,d,y),y=m[3],e.add(s,h,y),e.add(y,c,y),e.negate(s,s),y=m[4],e.add(s,l,y),e.add(y,c,y),y=m[5],e.add(s,l,y),e.add(y,d,y),y=m[6],e.add(s,h,y),e.add(y,d,y),y=m[7],e.add(s,h,y),e.add(y,c,y);for(var p=m.length,v=0;p>v;++v){var g=m[v];e.add(o,g,g);var w=a.cartesianToCartographic(g,B);r.project(w,g)}i=f.fromPoints(m,i),o=i.center;var x=o.x,E=o.y,S=o.z;return o.x=S,o.y=x,o.z=E,i},f.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},f.prototype.intersect=function(e){return f.intersect(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var 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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++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",e(document[i])?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",e(document[i])&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",e(document[i])?r.fullscreenElement=i:(i=s+"FullScreenElement",e(document[i])&&(r.fullscreenElement=i)),i=s+"fullscreenchange",e(document["on"+i])&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",e(document["on"+i])&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e){i.supportsFullscreen()&&e[r.requestFullscreen]()},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;r>n;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(m)){m=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(m=!0,y=r(e[1]))}return m}function a(){return i()&&y}function o(){if(!t(p)&&(p=!1,!i()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(p=!0,v=r(e[1]))}return p}function u(){return o()&&v}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(g=!0,w=r(e[1]),w.isNightly=!!e[2])}return g}function c(){return s()&&w}function l(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=r(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=r(e[1])))}return x}function f(){return l()&&E}function h(){if(!t(S)){S=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function d(){return h()&&M}var m,y,p,v,g,w,x,E,S,M,O={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:d,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};return O.supportsFullscreen=function(){return n.supportsFullscreen()},O.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},O.supportsWebWorkers=function(){return"undefined"!=typeof Worker},O}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,i){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return t(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(t,r,i,o){switch(i=e(i,0),o=e(o,(r.byteLength-i)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(r,i,o);case a.UNSIGNED_BYTE:return new Uint8Array(r,i,o);case a.SHORT:return new Int16Array(r,i,o);case a.UNSIGNED_SHORT:return new Uint16Array(r,i,o);case a.FLOAT:return new Float32Array(r,i,o);case a.DOUBLE:return new Float64Array(r,i,o);default:throw new n("componentDatatype is not a valid value.")}},i(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"],function(e){"use strict";var t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===t.POINTS||e===t.LINES||e===t.LINE_LOOP||e===t.LINE_STRIP||e===t.TRIANGLES||e===t.TRIANGLE_STRIP||e===t.TRIANGLE_FAN}};return e(t)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";var a=function(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)};return a.computeNumberOfVertices=function(e){var r=-1;for(var i in e.attributes)if(e.attributes.hasOwnProperty(i)&&t(e.attributes[i])&&t(e.attributes[i].values)){var a=e.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(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"],function(e,t,n,r){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,i){return e>r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(i)}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";var a=function(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){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new a(e.x,e.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},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.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.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.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.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r},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){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,i){"use strict";var a=function(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;f>h;h++){var d=t[h],m=d.x,y=d.y,p=d.z;i=Math.min(m,i),s=Math.max(m,s),o=Math.min(y,o),c=Math.max(y,c),u=Math.min(p,u),l=Math.max(p,l)}var v=r.minimum;v.x=i,v.y=o,v.z=u;var g=r.maximum;g.x=s,g.y=c,g.z=l;var w=e.add(v,g,r.center);return e.multiplyByScalar(w,.5,w),r},a.clone=function(t,r){return n(t)?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):void 0},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.intersect=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),a=r.x*Math.abs(n.x)+r.y*Math.abs(n.y)+r.z*Math.abs(n.z),u=e.dot(t.center,n)+n.w;return u-a>0?i.INSIDE:0>u+a?i.OUTSIDE:i.INTERSECTING},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.intersect=function(e){return a.intersect(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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(a=-i/e,0>a)return[];var s=Math.sqrt(a);return[-s,s]}if(0===i)return a=-r/e,0>a?[a,0]:[0,a];var c=r*r,l=4*e*i,f=n(c,-l,t.EPSILON14);if(0>f)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,m=o*s-h,y=o*c-u*s,p=u*c-d,v=4*m*p-y*y;if(0>v){var g,w,x;h*f>=l*d?(g=o,w=m,x=-2*u*m+o*y):(g=c,w=p,x=-c*y+2*s*p);var E=0>x?-1:1,S=-E*Math.abs(g)*Math.sqrt(-v);a=-x+S;var M=a/2,O=0>M?-Math.pow(-M,1/3):Math.pow(M,1/3),_=a===S?-O:-w/O;return i=0>=w?O+_:-x/(O*O+_*_+w),h*f>=l*d?[(i-u)/o]:[-c/(i+s)]}var R=m,T=-2*u*m+o*y,C=p,N=-c*y+2*s*p,P=Math.sqrt(v),I=Math.sqrt(3)/2,b=Math.abs(Math.atan2(o*P,-T)/3);i=2*Math.sqrt(-R);var z=Math.cos(b);a=i*z;var D=i*(-z/2-I*Math.sin(b)),A=a+D>2*u?a-u:D-u,U=o,q=A/U;b=Math.abs(Math.atan2(c*P,-N)/3),i=2*Math.sqrt(-C),z=Math.cos(b),a=i*z,D=i*(-z/2-I*Math.sin(b));var L=-c,W=2*s>a+D?a+s:D+s,B=L/W,F=U*W,G=-A*W-U*L,Y=A*L,j=(s*G-u*Y)/(-u*G+s*F);return j>=q?B>=q?B>=j?[q,j,B]:[q,B,j]:[B,q,j]:B>=q?[j,q,B]:B>=j?[j,B,q]:[B,j,q]}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=0>u?-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,0>u?[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 m=r.computeRealRoots(1,s,l);if(2===m.length){var y,p=m[0],v=m[1];if(p>=0&&v>=0){var g=Math.sqrt(p),w=Math.sqrt(v);return[h-w,h-g,h+g,h+w]}if(p>=0&&0>v)return y=Math.sqrt(p),[h-y,h+y];if(0>p&&v>=0)return y=Math.sqrt(v),[h-y,h+y]}return[]}if(d>0){var x=Math.sqrt(d),E=(s+d-c/x)/2,S=(s+d+c/x)/2,M=r.computeRealRoots(1,x,E),O=r.computeRealRoots(1,-x,S);return 0!==M.length?(M[0]+=h,M[1]+=h,0!==O.length?(O[0]+=h,O[1]+=h,M[1]<=O[0]?[M[0],M[1],O[0],O[1]]:O[1]<=M[0]?[O[0],O[1],M[0],M[1]]:M[0]>=O[0]&&M[1]<=O[1]?[O[0],M[0],M[1],O[1]]:O[0]>=M[0]&&O[1]<=M[1]?[M[0],O[0],O[1],M[1]]:M[0]>O[0]&&M[0]<O[1]?[O[0],M[0],O[1],M[1]]:[M[0],O[0],M[1],O[1]]):M):0!==O.length?(O[0]+=h,O[1]+=h,O):[]}}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 m,y,p=d[0],v=i-p,g=v*v,w=t/2,x=v/2,E=g-4*o,S=g+4*Math.abs(o),M=c-4*p,O=c+4*Math.abs(p);if(0>p||M*S>E*O){var _=Math.sqrt(M);m=_/2,y=0===_?0:(t*x-a)/_}else{var R=Math.sqrt(E);m=0===R?0:(t*x-a)/R,y=R/2}var T,C;0===w&&0===m?(T=0,C=0):n.sign(w)===n.sign(m)?(T=w+m,C=p/T):(C=w-m,T=p/C);var N,P;0===x&&0===y?(N=0,P=0):n.sign(x)===n.sign(y)?(N=x+y,P=o/N):(P=x-y,N=o/P);var I=r.computeRealRoots(1,T,N),b=r.computeRealRoots(1,C,P);if(0!==I.length)return 0!==b.length?I[1]<=b[0]?[I[0],I[1],b[0],b[1]]:b[1]<=I[0]?[b[0],b[1],I[0],I[1]]:I[0]>=b[0]&&I[1]<=b[1]?[b[0],I[0],I[1],b[1]]:b[0]>=I[0]&&b[1]<=I[1]?[I[0],b[0],b[1],I[1]]:I[0]>b[0]&&I[0]<b[1]?[b[0],I[0],b[1],I[1]]:[I[0],b[0],I[1],b[1]]:I;if(0!==b.length)return b}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,m=d*i,y=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*a*f*f+256*o*m+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=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>f?d+1:d,d+=0>h?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 void 0}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r=function(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 r.getPoint=function(t,r,i){return n(i)||(i=new e),i=e.multiplyByScalar(t.direction,r,i),e.add(t.origin,i,i)},r}),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(t,r,i,o,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,m=t.direction,y=e.subtract(i,r,p),E=e.subtract(o,r,v),S=e.cross(m,E,g),M=e.dot(y,S);if(u){if(M<a.EPSILON6)return void 0;if(s=e.subtract(d,r,w),l=e.dot(s,S),0>l||l>M)return void 0;if(c=e.cross(s,y,x),f=e.dot(m,c),0>f||l+f>M)return void 0;h=e.dot(E,c)/M}else{if(Math.abs(M)<a.EPSILON6)return void 0;var O=1/M;if(s=e.subtract(d,r,w),l=e.dot(s,S)*O,0>l||l>1)return void 0;if(c=e.cross(s,y,x),f=e.dot(m,c)*O,0>f||l+f>1)return void 0;h=e.dot(E,c)*O}return h}function f(e,t,n,r){var i=t*t-4*e*n;if(0>i)return void 0;if(i>0){var a=1/(2*e),o=Math.sqrt(i),u=(-t+o)*a,s=(-t-o)*a;return s>u?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);return 0===c?void 0:(r.root0=r.root1=c,r)}function h(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,g),l=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,m=f(l,h,d,S);return r(m)?(i.start=m.root0,i.stop=m.root1,i):void 0}function d(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 m(t,n,r,i,c){var l,f=i*i,h=c*c,m=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,y=c*(i*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],a.EPSILON15)+n.y),p=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*h+i*n.x+r,v=h*d(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],a.EPSILON15),g=c*(i*d(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),w=[];if(0===g&&0===v){if(l=u.computeRealRoots(m,y,p),0===l.length)return w;var x=l[0],E=Math.sqrt(Math.max(1-x*x,0));if(w.push(new e(i,c*x,c*-E)),w.push(new e(i,c*x,c*E)),2===l.length){var S=l[1],M=Math.sqrt(Math.max(1-S*S,0));w.push(new e(i,c*S,c*-M)),w.push(new e(i,c*S,c*M))}return w}var O=g*g,_=v*v,R=m*m,T=g*v,C=R+_,N=2*(y*m+T),P=2*p*m+y*y-_+O,I=2*(p*y-T),b=p*p-O;if(0===C&&0===N&&0===P&&0===I)return w;l=s.computeRealRoots(C,N,P,I,b);var z=l.length;if(0===z)return w;for(var D=0;z>D;++D){var A,U=l[D],q=U*U,L=Math.max(1-q,0),W=Math.sqrt(L);A=a.sign(m)===a.sign(p)?d(m*q+p,y*U,a.EPSILON12):a.sign(p)===a.sign(y*U)?d(m*q,y*U+p,a.EPSILON12):d(m*q+y*U,p,a.EPSILON12);var B=d(v*U,g,a.EPSILON15),F=A*B;0>F?w.push(new e(i,c*U,c*W)):F>0?w.push(new e(i,c*U,c*-W)):0!==W?(w.push(new e(i,c*U,c*-W)),w.push(new e(i,c*U,c*W)),++D):w.push(new e(i,c*U,c*W))}return w}var y={};y.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)return void 0;var l=(-n.distance-e.dot(s,o))/c;return 0>l?void 0:(i=e.multiplyByScalar(u,l,i),e.add(o,i,i))};var p=new e,v=new e,g=new e,w=new e,x=new e;y.rayTriangle=function(t,n,i,a,o,u){var s=l(t,n,i,a,o);return!r(s)||0>s?void 0:(r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u))};var E=new c;y.lineSegmentTriangle=function(t,n,i,a,o,u,s){var c=E;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var f=l(c,i,a,o,u);return!r(f)||0>f||f>e.distance(t,n)?void 0:(r(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var S={root0:0,root1:0};y.raySphere=function(e,t,n){return n=h(e,t,n),!r(n)||n.stop<0?void 0:(n.start=Math.max(n.start,0),n)};var M=new c;y.lineSegmentSphere=function(t,n,i,a){var o=M;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),a=h(o,i,a),!r(a)||a.stop<0||a.start>s?void 0:(a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a)};var O=new e,_=new e;y.rayEllipsoid=function(t,n){var r,i,a,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,O),l=e.multiplyComponents(s,t.direction,_),f=e.magnitudeSquared(c),h=e.dot(c,l);if(f>1){if(h>=0)return void 0;var d=h*h;if(r=f-1,i=e.magnitudeSquared(l),a=i*r,a>d)return void 0;if(d>a){o=h*h-a,u=-h+Math.sqrt(o);var m=u/i,y=r/u;return y>m?{start:m,stop:y}:{start:y,stop:m}}var p=Math.sqrt(r/i);return{start:p,stop:p}}return 1>f?(r=f-1,i=e.magnitudeSquared(l),a=i*r,o=h*h-a,u=-h+Math.sqrt(o),{start:0,stop:u/i}):0>h?(i=e.magnitudeSquared(l),{start:0,stop:-h/i}):void 0};var R=new e,T=new e,C=new e,N=new e,P=new e,I=new o,b=new o,z=new o,D=new o,A=new o,U=new o,q=new o,L=new e,W=new e,B=new t;y.grazingAltitudeLocation=function(t,n){var i=t.origin,u=t.direction,s=n.geodeticSurfaceNormal(i);if(e.dot(u,s)>=0)return i;var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u),f=e.normalize(l,R),h=e.mostOrthogonalAxis(l,N),d=e.normalize(e.cross(h,f,T),T),y=e.normalize(e.cross(f,d,C),C),p=I;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]=y.x,p[7]=y.y,p[8]=y.z;var v=o.transpose(p,b),g=o.fromScale(n.radii,z),w=o.fromScale(n.oneOverRadii,D),x=A;x[0]=0,x[1]=-u.z,x[2]=u.y,x[3]=u.z,x[4]=0,x[5]=-u.x,x[6]=-u.y,x[7]=u.x,x[8]=0;var E,S,M=o.multiply(o.multiply(v,w,U),x,U),O=o.multiply(o.multiply(M,g,q),p,q),_=o.multiplyByVector(M,i,P),F=m(O,e.negate(_,R),0,0,1),G=F.length;if(G>0){for(var Y=e.clone(e.ZERO,W),j=Number.NEGATIVE_INFINITY,V=0;G>V;++V){E=o.multiplyByVector(g,o.multiplyByVector(p,F[V],L),L);var H=e.normalize(e.subtract(E,i,N),N),k=e.dot(H,u);k>j&&(j=k,Y=e.clone(E,Y))}var X=n.cartesianToCartographic(Y,B);return j=a.clamp(j,0,1),S=e.magnitude(e.subtract(Y,i,N))*Math.sqrt(1-j*j),S=c?-S:S,X.height=S,n.cartographicToCartesian(X)}return void 0};var F=new e;return y.lineSegmentPlane=function(t,n,i,o){r(o)||(o=new e);var u=e.subtract(n,t,F),s=i.normal,c=e.dot(s,u);if(Math.abs(c)<a.EPSILON6)return void 0;var l=e.dot(s,t),f=-(i.distance+l)/c;return 0>f||f>1?void 0:(e.multiplyByScalar(u,f,o),e.add(t,o,o),o)},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]}}return void 0},y}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var n=function(t,n){this.normal=e.clone(t),this.distance=n};return n.fromPointNormal=function(r,i,a){var o=-e.dot(i,r);return t(a)?(e.clone(i,a.normal),a.distance=o,a):new n(i,o)},n.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},n}),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(r){return a(r)}});return n}function a(e){var n=new r(function(n,r){try{return r?t(r(e)):a(e)}catch(i){return a(i)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return m(e)}function i(e){return m(a(e))}function u(e){return d(e)}var s,c,l,f,h,d,m;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(t){r.progress(t)}}: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},m=function(e){return e=t(e),h=e.then,m=t,d=v,y(l,e),f=l=E,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){y(e)}function s(e){m(e)}var c,l,f,h,d,m,y,p,g,w;if(g=t.length>>>0,c=Math.max(0,Math.min(n,g)),f=[],l=g-c+1,h=[],d=o(),c)for(p=d.progress,y=function(e){h.push(e),--l||(m=y=v,d.reject(h))},m=function(e){f.push(e),--c||(m=y=v,d.resolve(f))},w=0;g>w;++w)w in t&&e(t[w],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,g).then(t,n,r)}function f(){return h(arguments,g)}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;i>s;s++)s in t?u(t[s],s):--a;else c.resolve(r);return c.promise})}function d(t,n){var r=x.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)})})},w.apply(t,r)})}function m(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 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 v(){}function g(e){return e}var w,x,E;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=m,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(E,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(E,t)})})}},x=[].slice,w=[].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(;i>a;++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(){"use strict";var e=function(e,t,n){for(var r,i,a=0,o=e.length-1;o>=a;)if(r=~~((a+o)/2),i=n(e[r],t),0>i)a=r+1;else{if(!(i>0))return r;o=r-1}return~(o+1)};return e}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";var e=function(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,m,y,p,v;if("%%"==e)return"%";for(var g=!1,w="",x=!1,E=!1,S=" ",M=s.length,O=0;s&&M>O;O++)switch(s.charAt(O)){case" ":w=" ";break;case"+":w="+";break;case"-":g=!0;break;case"'":S=s.charAt(O+1);break;case"0":x=!0;break;case"#":E=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(c=-c,g=!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,v=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(v),g,c,f,x,S);case"c":return u(String.fromCharCode(+v),g,c,f,x);case"b":return o(v,2,E,g,c,f,x);case"o":return o(v,8,E,g,c,f,x);case"x":return o(v,16,E,g,c,f,x);case"X":return o(v,16,E,g,c,f,x).toUpperCase();case"u":return o(v,10,E,g,c,f,x);case"i":case"d":return d=+v||0,d=Math.round(d-d%1),m=0>d?"-":w,v=m+i(String(Math.abs(d)),f,"0",!1),a(v,m,g,c,x);case"e":case"E":case"f":case"F":case"g":case"G":return d=+v,m=0>d?"-":w,y=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],v=m+Math.abs(d)[y](f),a(v,m,g,c,x)[p]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";var e=function(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(){"use strict";function e(e){return 0===e%4&&0!==e%100||0===e%400}return e}),define("Core/LeapSecond",[],function(){"use strict";var e=function(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 N.compare(e.julianDate,t.julianDate)}function f(e){g.julianDate=e;var n=N.leapSeconds,r=t(n,g,l);0>r&&(r=~r),r>=n.length&&(r=n.length-1);var i=n[r].offset;if(r>0){var a=N.secondsDifference(n[r].julianDate,e);a>i&&(r--,i=n[r].offset)}N.addSeconds(e,i,e)}function h(e,n){g.julianDate=e;var r=N.leapSeconds,i=t(r,g,l);if(0>i&&(i=~i),0===i)return N.addSeconds(e,-r[0].offset,n);if(i>=r.length)return N.addSeconds(e,-r[i-1].offset,n);var a=N.secondsDifference(r[i].julianDate,e);return 0===a?N.addSeconds(e,-r[i].offset,n):1>=a?void 0:N.addSeconds(e,-r[--i].offset,n)}function d(e,t,n){var r=0|t/s.SECONDS_PER_DAY;return e+=r,t-=s.SECONDS_PER_DAY*r,0>t&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function m(e,t,n,r,i,a,o){var u=0|(t-14)/12,c=e+4800+u,l=(0|1461*c/4)+(0|367*(t-2-12*u)/12)-(0|3*((c+100)/100)/4)+n-32075;r-=12,0>r&&(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]}var y=new a,p=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,g=new u,w=/^(\d{4})$/,x=/^(\d{4})-(\d{2})$/,E=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,M=/^(\d{4})-?(\d{2})-?(\d{2})$/,O=/([Z+\-])?(\d{2})?:?(\d{2})?$/,_=/^(\d{2})(\.\d+)?/.source+O.source,R=/^(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,T=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,C="Invalid ISO 8601 date.",N=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 i=0|e;t+=(e-i)*s.SECONDS_PER_DAY,d(i,t,this),r===c.UTC&&f(this)};N.fromDate=function(e,t){var n=m(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(n[0],n[1],c.UTC)},N.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,u,s=e.split("T"),l=1,h=1,y=0,g=0,O=0,P=0,I=s[0],b=s[1];if(!r(I))throw new i(C);var z;if(s=I.match(M),null!==s){if(z=I.split("-").length-1,z>0&&2!==z)throw new i(C);n=+s[1],l=+s[2],h=+s[3]}else if(s=I.match(x),null!==s)n=+s[1],l=+s[2];else if(s=I.match(w),null!==s)n=+s[1];else{var D;if(s=I.match(E),null!==s){if(n=+s[1],D=+s[2],u=o(n),1>D||u&&D>366||!u&&D>365)throw new i(C)}else{if(s=I.match(S),null===s)throw new i(C);n=+s[1];var A=+s[2],U=+s[3]||0;if(z=I.split("-").length-1,z>0&&(!r(s[3])&&1!==z||r(s[3])&&2!==z))throw new i(C);var q=new Date(Date.UTC(n,0,4));D=7*A+U-q.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(D),l=a.getUTCMonth()+1,h=a.getUTCDate()}if(u=o(n),1>l||l>12||1>h||(2!==l||!u)&&h>p[l-1]||u&&2===l&&h>v)throw new i(C);var L;if(r(b)){if(s=b.match(T),null!==s){if(z=b.split(":").length-1,z>0&&2!==z&&3!==z)throw new i(C);y=+s[1],g=+s[2],O=+s[3],P=1e3*+(s[4]||0),L=5}else if(s=b.match(R),null!==s){if(z=b.split(":").length-1,z>0&&1!==z)throw new i(C);y=+s[1],g=+s[2],O=60*+(s[3]||0),L=4}else{if(s=b.match(_),null===s)throw new i(C);y=+s[1],g=60*+(s[2]||0),L=3}if(g>=60||O>=61||y>24||24===y&&(g>0||O>0||P>0))throw new i(C);var W=s[L],B=+s[L+1],F=+(s[L+2]||0);switch(W){case"+":y-=B,g-=F;break;case"-":y+=B,g+=F;break;case"Z":break;default:g+=new Date(Date.UTC(n,l-1,h,y,g)).getTimezoneOffset()}}else g+=new Date(Date.UTC(n,l-1,h)).getTimezoneOffset();var G=60===O;for(G&&O--;g>=60;)g-=60,y++;for(;y>=24;)y-=24,h++;for(a=u&&2===l?v:p[l-1];h>a;)h-=a,l++,l>12&&(l-=12,n++),a=u&&2===l?v:p[l-1];for(;0>g;)g+=60,y--;for(;0>y;)y+=24,h--;for(;1>h;)l--,1>l&&(l+=12,n--),a=u&&2===l?v:p[l-1],h+=a;var Y=m(n,l,h,y,g,O,P);return r(t)?(d(Y[0],Y[1],t),f(t)):t=new N(Y[0],Y[1],c.UTC),G&&N.addSeconds(t,1,t),t},N.now=function(e){return N.fromDate(new Date,e)};var P=new N(0,0,c.TAI);return N.toGregorianDate=function(e,t){var n=!1,i=h(e,P);r(i)||(N.addSeconds(e,-1,P),i=h(P,P),n=!0);var o=i.dayNumber,u=i.secondsOfDay;u>=43200&&(o+=1);var c=0|o+68569,l=0|4*c/146097;c=0|c-(0|(146097*l+3)/4);var f=0|4e3*(c+1)/1461001;c=0|c-(0|1461*f/4)+31;var d=0|80*c/2447,m=0|c-(0|2447*d/80);c=0|d/11;var y=0|d+2-12*c,p=0|100*(l-49)+f+c,v=0|u/s.SECONDS_PER_HOUR,g=u-v*s.SECONDS_PER_HOUR,w=0|g/s.SECONDS_PER_MINUTE;g-=w*s.SECONDS_PER_MINUTE;var x=0|g,E=(g-x)/s.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),n&&(x+=1),r(t)?(t.year=p,t.month=y,t.day=m,t.hour=v,t.minute=w,t.second=x,t.millisecond=E,t.isLeapSecond=n,t):new a(p,y,m,v,w,x,E,n)},N.toDate=function(e){var t=N.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))},N.toIso8601=function(t,n){var i,a=N.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))},N.clone=function(e,t){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new N(e.dayNumber,e.secondsOfDay,c.TAI):void 0},N.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},N.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},N.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(N.secondsDifference(e,t))<=n},N.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},N.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},N.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},N.computeTaiMinusUtc=function(e){g.julianDate=e;var n=N.leapSeconds,r=t(n,g,l);return 0>r&&(r=~r,--r,0>r&&(r=0)),n[r].offset},N.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},N.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},N.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},N.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},N.lessThan=function(e,t){return N.compare(e,t)<0},N.lessThanOrEquals=function(e,t){return N.compare(e,t)<=0},N.greaterThan=function(e,t){return N.compare(e,t)>0},N.greaterThanOrEquals=function(e,t){return N.compare(e,t)>=0},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){return N.equalsEpsilon(this,e,t)},N.prototype.toString=function(){return N.toIso8601(this)},N.leapSeconds=[new u(new N(2441317,43210,c.TAI),10),new u(new N(2441499,43211,c.TAI),11),new u(new N(2441683,43212,c.TAI),12),new u(new N(2442048,43213,c.TAI),13),new u(new N(2442413,43214,c.TAI),14),new u(new N(2442778,43215,c.TAI),15),new u(new N(2443144,43216,c.TAI),16),new u(new N(2443509,43217,c.TAI),17),new u(new N(2443874,43218,c.TAI),18),new u(new N(2444239,43219,c.TAI),19),new u(new N(2444786,43220,c.TAI),20),new u(new N(2445151,43221,c.TAI),21),new u(new N(2445516,43222,c.TAI),22),new u(new N(2446247,43223,c.TAI),23),new u(new N(2447161,43224,c.TAI),24),new u(new N(2447892,43225,c.TAI),25),new u(new N(2448257,43226,c.TAI),26),new u(new N(2448804,43227,c.TAI),27),new u(new N(2449169,43228,c.TAI),28),new u(new N(2449534,43229,c.TAI),29),new u(new N(2450083,43230,c.TAI),30),new u(new N(2450630,43231,c.TAI),31),new u(new N(2451179,43232,c.TAI),32),new u(new N(2453736,43233,c.TAI),33),new u(new N(2454832,43234,c.TAI),34),new u(new N(2456109,43235,c.TAI),35)],N}),define("Core/clone",["./defaultValue"],function(e){"use strict";var t=function(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";var e=function(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";var n=function(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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,n,r,i,a){"use strict";function o(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function u(e,t){for(var n=o(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 s(e,n){n=t(n,"");var i=e[1],a=!!e[2],s=e[3];switch(n){case"":case"text":return o(a,s);case"arraybuffer":return u(a,s);case"blob":var c=u(a,s);return new Blob([c],{type:i});case"document":var l=new DOMParser;return l.parseFromString(o(a,s),i);case"json":return JSON.parse(o(a,s));default:throw new r("Unhandled responseType: "+n)}}var c=function(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,i=t(n.method,"GET"),a=n.data,o=n.headers,u=n.overrideMimeType,s=n.withCredentials;return e(n.url,function(t){var n=e.defer();return c.load(t,r,i,a,o,n,u,s),n.promise})},l=/^data:(.*?)(;base64)?,(.*)$/;return c.load=function(e,t,r,o,u,c,f,h){var d=l.exec(e);if(null!==d)return c.resolve(s(d,t)),void 0;var m=new XMLHttpRequest;if(n(f)&&n(m.overrideMimeType)&&m.overrideMimeType(f),m.open(r,e,!0),n(u))for(var y in u)u.hasOwnProperty(y)&&m.setRequestHeader(y,u[y]);n(t)&&(m.responseType=t),n(h)&&(m.withCredentials=h),m.onload=function(){200===m.status?n(m.response)?c.resolve(m.response):n(m.responseXML)&&m.responseXML.hasChildNodes()?c.resolve(m.responseXML):n(m.responseText)?c.resolve(m.responseText):c.reject(new a("unknown XMLHttpRequest response type.")):c.reject(new i(m.status,m.response,m.getAllResponseHeaders()))},m.onerror=function(){c.reject(new i)},m.send(o)},c.defaultLoad=c.load,c}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";var n=function(n,r){return e({url:n,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})};return n}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";var i={Accept:"application/json,*/*;q=0.01"},a=function(n,a){return t(a)||(a={}),t(a.headers)?t(a.headers.Accept)||(a.headers=e(a.headers),a.headers.Accept=i.Accept):a.headers=i,r(n,a).then(function(e){return JSON.parse(e)})};return a}),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(e,t){return o.compare(e.julianDate,t)}function d(e,n){if(!r(n.columnNames))return e._dataError="Error in loaded EOP data: The columnNames property is required.",void 0;if(!r(n.samples))return e._dataError="Error in loaded EOP data: The samples property is required.",void 0;var i=n.columnNames.indexOf("modifiedJulianDateUtc"),a=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),d=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),y=n.columnNames.indexOf("taiMinusUtcSeconds");if(0>i||0>a||0>s||0>c||0>d||0>m||0>y)return e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns",void 0;var p=e._samples=n.samples,v=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=a,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=m,e._taiMinusUtcSecondsColumn=y,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var g,w=e._addNewLeapSeconds,x=0,E=p.length;E>x;x+=e._columnCount){var S=p[x+i],M=p[x+y],O=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,_=new o(O,M,f.TAI);if(v.push(_),w){if(M!==g&&r(g)){var R=o.leapSeconds,T=t(R,_,h);if(0>T){var C=new u(_,M);R.splice(~T,0,C)}}g=M}}}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 y(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,d=a*s,p=n[h+e._ut1MinusUtcSecondsColumn],v=n[d+e._ut1MinusUtcSecondsColumn],g=v-p;if(g>.5||-.5>g){var w=n[h+e._taiMinusUtcSecondsColumn],x=n[d+e._taiMinusUtcSecondsColumn];w!==x&&(l.equals(r)?p=v:v-=x-w)}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,v),u}var v=function(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:[]})};return v.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}}),v.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},v.prototype.compute=function(e,n){if(!r(this._samples)){if(r(this._dataError))throw new c(this._dataError);return void 0}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),m=!r(h),y=m||o.greaterThanOrEquals(h,e);if(d&&y)return s=u,!m&&h.equals(e)&&++s,l=s+1,p(this,a,this._samples,e,s,l,n),n}var v=t(a,e,o.compare,this._dateColumn); -return v>=0?(v<a.length-1&&a[v+1].equals(e)&&++v,s=v,l=v):(l=~v,s=l-1,0>s&&(s=0)),this._lastIndex=s,p(this,a,this._samples,e,s,l,n),n},v}),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()):(n.path=t.authority&&""==t.path?"/"+this.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];for(r&&t.shift(),""==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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","require"],function(e,t,n,r){"use strict";function i(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),i=f.exec(r);if(null!==i)return i[1]}return void 0}function a(){if(t(s))return s;var r;if(r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:i(),!t(r))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return s=new e(r).resolve(new e(document.location.href))}function o(e){return r.toUrl("../"+e)}function u(t){return new e(t).resolve(a()).toString()}var s,c,l,f=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i,h=function(e){t(c)||(c=t(r.toUrl)?o:u),t(l)||(l=document.createElement("a"));var n=c(e);return l.href=n,l.href=l.href,l.href};return h._cesiumScriptRegex=f,h}),define("Core/Iau2006XysSample",[],function(){"use strict";var e=function(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,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,a.daysDifference(r,e._sampleZeroDateTT)}function c(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=3*i*n._samplesPerXysFile,u=0,s=r.length;s>u;++u)t[o+u]=r[u];a.resolve()}),a.promise}var l=function(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;t>=s;++s){r[s]=o,i[s]=s*this._stepSizeDays;for(var c=0;t>=c;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)},f=new a(0,0,u.TAI);return l.prototype.preload=function(t,n,r,i){var a=s(this,t,n),o=s(this,r,i),u=0|a/this._stepSizeDays-this._interpolationOrder/2;0>u&&(u=0);var l=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var f=0|u/this._samplesPerXysFile,h=0|l/this._samplesPerXysFile,d=[],m=f;h>=m;++m)d.push(c(this,m));return e.all(d)},l.prototype.computeXysRadians=function(e,t,n){var a=s(this,e,t);if(0>a)return void 0;var o=0|a/this._stepSizeDays;if(o>=this._totalSamples)return void 0;var u=this._interpolationOrder,l=o-(0|u/2);0>l&&(l=0);var f=l+u;f>=this._totalSamples&&(f=this._totalSamples-1,l=f-u,0>l&&(l=0));var h=!1,d=this._samples;if(r(d[3*l])||(c(this,0|l/this._samplesPerXysFile),h=!0),r(d[3*f])||(c(this,0|f/this._samplesPerXysFile),h=!0),h)return void 0;r(n)?(n.x=0,n.y=0,n.s=0):n=new i(0,0,0);var m,y,p=a-l*this._stepSizeDays,v=this._work,g=this._denominators,w=this._coef,x=this._xTable;for(m=0;u>=m;++m)v[m]=p-x[m];for(m=0;u>=m;++m){for(w[m]=1,y=0;u>=y;++y)y!==m&&(w[m]*=v[y]);w[m]*=g[m];var E=3*(l+m);n.x+=w[m]*d[E++],n.y+=w[m]*d[E++],n.s+=w[m]*d[E]}return n},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./TimeConstants"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d,m,y,p){"use strict";var v={},g=new n,w=new n,x=new n;v.eastNorthUpToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return a(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=g,s=w,l=x;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),a(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.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,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var E=new n,S=new n,M=new n;v.northEastDownToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return a(r)?(r[0]=-o,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]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=E,s=S,l=M;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),a(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.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(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},v.northUpEastToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return a(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=o,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(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=g,s=w,l=x;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),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 y(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 O=24110.54841,_=8640184.812866,R=.093104,T=-62e-7,C=1.1772758384668e-19,N=72921158553e-15,P=d.TWO_PI/86400,I=new h;v.computeTemeToPseudoFixedMatrix=function(e,t){I=h.addSeconds(e,-h.computeTaiMinusUtc(e),I);var n,r=I.dayNumber,i=I.secondsOfDay,o=r-2451545;n=i>=43200?(o+.5)/p.DAYS_PER_JULIAN_CENTURY:(o-.5)/p.DAYS_PER_JULIAN_CENTURY;var u=O+n*(_+n*(R+n*T)),s=u*P%d.TWO_PI,c=N+C*(r-2451545.5),l=(i+.5*p.SECONDS_PER_DAY)%p.SECONDS_PER_DAY,f=s+c*l,y=Math.cos(f),v=Math.sin(f);return a(t)?(t[0]=y,t[1]=-v,t[2]=0,t[3]=v,t[4]=y,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(y,v,0,-v,y,0,0,0,1)},v.iau2006XysData=new l,v.earthOrientationParameters=u.NONE;var b=32.184,z=2451545;v.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+b,i=t.stop.dayNumber,a=t.stop.secondsOfDay+b,o=v.iau2006XysData.preload(n,r,i,a),u=v.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},v.computeIcrfToFixedMatrix=function(e,t){a(t)||(t=new m);var n=v.computeFixedToIcrfMatrix(e,t);return a(n)?m.transpose(n,t):void 0};var D=new f(0,0,0),A=new s(0,0,0,0,0,0),U=new m,q=new m;v.computeFixedToIcrfMatrix=function(e,t){a(t)||(t=new m);var n=v.earthOrientationParameters.compute(e,A);if(!a(n))return void 0;var r=e.dayNumber,i=e.secondsOfDay+b,o=v.iau2006XysData.computeXysRadians(r,i,D);if(!a(o))return void 0;var u=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=U;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(-o.s,q),y=m.multiply(l,f,U),g=e.dayNumber,w=e.secondsOfDay-h.computeTaiMinusUtc(e)+n.ut1MinusUtc,x=g-2451545,E=w/p.SECONDS_PER_DAY,S=.779057273264+E+.00273781191135448*(x+E);S=S%1*d.TWO_PI;var M=m.fromRotationZ(S,q),O=m.multiply(y,M,U),_=Math.cos(n.xPoleWander),R=Math.cos(n.yPoleWander),T=Math.sin(n.xPoleWander),C=Math.sin(n.yPoleWander),N=r-z+i/p.SECONDS_PER_DAY;N/=36525;var P=-47e-6*N*d.RADIANS_PER_DEGREE/3600,I=Math.cos(P),L=Math.sin(P),W=q;return W[0]=_*I,W[1]=_*L,W[2]=T,W[3]=-R*L+C*T*I,W[4]=R*I+C*T*L,W[5]=-C*_,W[6]=-C*L-R*T*I,W[7]=C*I-R*T*L,W[8]=R*_,m.multiply(O,W,t)};var L=new r;return v.pointToWindowCoordinates=function(e,t,n,r){return r=v.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},v.pointToGLWindowCoordinates=function(e,n,i,o){a(o)||(o=new t);var u=L;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,o)},v}),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";var m=new r,y=function(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)};o(y.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}}});var p=new e;y.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new y(r.center,n)};var v=new h,g=new n;y.prototype.projectPointOntoPlane=function(e,r){var i=v;i.origin=e,n.normalize(e,i.direction);var o=c.rayPlane(i,this._plane,g);if(a(o)||(n.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,g)),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)}return void 0},y.prototype.projectPointsOntoPlane=function(e,t){a(t)||(t=[]);for(var n=0,r=e.length,i=0;r>i;i++){var o=this.projectPointOntoPlane(e[i],t[n]);a(o)&&(t[n]=o,n++)}return t.length=n,t};var w=new n;return y.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=w,l=0;r>l;++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},y}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";var r=new t,i=new t,a=new t,o=function(o,u,s,c,l){n(l)||(l=new t);var f,h,d,m,y,p,v,g;n(u.z)?(f=t.subtract(s,u,r),h=t.subtract(c,u,i),d=t.subtract(o,u,a),m=t.dot(f,f),y=t.dot(f,h),p=t.dot(f,d),v=t.dot(h,h),g=t.dot(h,d)):(f=e.subtract(s,u,r),h=e.subtract(c,u,i),d=e.subtract(o,u,a),m=e.dot(f,f),y=e.dot(f,h),p=e.dot(f,d),v=e.dot(h,h),g=e.dot(h,d));var w=1/(m*v-y*y);return l.y=(v*p-y*g)*w,l.z=(m*g-y*p)*w,l.x=1-l.y-l.z,l};return o}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";var n=new t,r=function(t,r,i,a){return e(t,r,i,a,n),n.x>0&&n.y>0&&n.z>0};return r}),define("Core/Queue",[],function(){"use strict";var e=function(){this._array=[],this._offset=0,this.length=0};return e.prototype.enqueue=function(e){this._array.push(e),this.length++},e.prototype.dequeue=function(){if(0===this.length)return void 0;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},e.prototype.contains=function(e){return-1!==this._array.indexOf(e)},e.prototype.clear=function(){this._array.length=this._offset=this.length=0},e.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},e}),define("Core/WindingOrder",["./freezeObject"],function(e){"use strict";var t={CLOCKWISE:2304,COUNTER_CLOCKWISE:2305,validate:function(e){return e===t.CLOCKWISE||e===t.COUNTER_CLOCKWISE}};return e(t)}),define("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d,m){"use strict";function y(t,n,r){var i=e.subtract(n,t,L),a=e.subtract(r,n,W);return i.x*a.y-i.y*a.x>=0}function p(e){for(var t=e[0].x,n=0,r=0;r<e.length;r++)e[r].x>t&&(t=e[r].x,n=r);return n}function v(e){for(var t=e[0][0].x,n=0,r=0;r<e.length;r++){var i=e[r][p(e[r])].x;i>t&&(t=i,n=r)}return n}function g(e){for(var t=[],n=0;n<e.length;n++){var r=e[(n-1+e.length)%e.length],i=e[n],a=e[(n+1)%e.length];y(r,i,a)||t.push(i)}return t}function w(t,n){for(var r=0;r<t.length;r++)if(e.equals(n,t[r]))return r;return-1}function x(n,i,a){a=r(a,[]);var o=Number.MAX_VALUE,u=p(i),s=new e(i[u].x,n.y);a.push(u),a.push((u+1)%i.length);for(var c=i[0].x,l=c,f=1;f<i.length;++f)i[f].x<c?c=i[f].x:i[f].x>l&&(l=i[f].x);l+=l-c;var h=new t(l,n.y,0);for(f=0;f<i.length;f++){var d=i[f],m=i[(f+1)%i.length];if((d.x>=n.x||m.x>=n.x)&&(d.y>=n.y&&m.y<=n.y||d.y<=n.y&&m.y>=n.y)){var y=(m.y-d.y)*(h.x-n.x)-(m.x-d.x)*(h.y-n.y);if(0!==y){y=1/y;var v=((m.x-d.x)*(n.y-d.y)-(m.y-d.y)*(n.x-d.x))*y,g=((h.x-n.x)*(n.y-d.y)-(h.y-n.y)*(n.x-d.x))*y;if(v>=0&&1>=v&&g>=0&&1>=g){var w=new e(n.x+v*(h.x-n.x),n.y+v*(h.y-n.y)),x=e.subtract(w,n,B);y=e.magnitudeSquared(x),o>y&&(s=w,o=y,a[0]=f,a[1]=(f+1)%i.length)}}}}return s}function E(t,n){var r=v(n),i=n[r],a=p(i),o=i[a],u=[],s=x(o,t,u),c=w(t,s);if(-1!==c)return c;var h=e.magnitudeSquared(e.subtract(t[u[0]],o,F)),d=e.magnitudeSquared(e.subtract(t[u[1]],o,F)),m=d>h?t[u[0]]:t[u[1]],y=g(t),E=y.indexOf(m);-1!==E&&y.splice(E,1);for(var S=[],M=0;M<y.length;M++){var O=y[M];f(O,o,s,m)&&S.push(O)}var _=Number.MAX_VALUE;if(S.length>0){var R=e.fromElements(1,0,F);for(M=0;M<S.length;M++){var T=e.subtract(S[M],o,G),C=e.magnitude(R)*e.magnitudeSquared(T);if(0!==C){var N=Math.abs(l.acosClamped(e.dot(R,T)/C));_>N&&(_=N,m=S[M])}}}return t.indexOf(m)}function S(e,n,r){for(var i=ut.computeWindingOrder2D(e),a=0;a<n.length;a++){var o=n[a];t.equals(o[0],o[o.length-1])||o.push(o[0]);var s=ut.computeWindingOrder2D(o);s===i&&o.reverse()}var c=u.fromPoints(e,r),l=c.projectPointsOntoPlane(e),f=[];for(a=0;a<n.length;a++)f.push(c.projectPointsOntoPlane(n[a]));var h=E(l,f),d=v(f),m=p(f[d]),y=n[d],g=[];for(a=0;a<e.length;a++)g.push(e[a]);var w,x=[];if(0!==m)for(w=0;w<=y.length;w++){var S=(w+m)%y.length;0!==S&&x.push(y[S])}else for(w=0;w<y.length;w++)x.push(y[(w+m)%y.length]);var M=g.lastIndexOf(e[h]);x.push(e[M]);var O=g.slice(0,M+1),_=g.slice(M+1);return g=O.concat(x,_),n.splice(d,1),g}function M(e){var t="0."+Math.sin(Y).toString().substr(5);Y+=.2;var n=Math.floor(t*e);return n===e&&n--,n}function O(t,n,r){return _(t,n,r)&&_(n,t,r)&&!D(r[t].position,r[n].position,r)&&!e.equals(r[t].position,r[n].position)}function _(t,n,r){C(t,r);var i=r[t],a=r[n],o=T(t,r,j),u=T(t,r,V),s=e.subtract(r[o].position,i.position,H),c=e.subtract(r[u].position,i.position,k),l=e.subtract(a.position,i.position,X);return N(s,l)?R(s,l):N(c,l)?R(c,l):P(s,c)?z(s,c,l)?!0:!1:I(s,c)?b(s,c,l)?!1:!0:void 0}function R(t,n){return e.magnitude(n)<e.magnitude(t)}function T(e,t,n){var r=e+n;return 0>r&&(r=t.length-1),r===t.length&&(r=0),C(r,t),r}function C(t,n){var r=t-1,i=t+1;0>r&&(r=n.length-1),i===n.length&&(i=0);var o=e.subtract(n[r].position,n[t].position,Z),u=e.subtract(n[i].position,n[t].position,J);if(N(o,u)){var s=new a("Superfluous vertex found.");throw s.vertexIndex=t,s}}function N(e,n){return 0===t.cross(e,n,K).z}function P(e,n){return t.cross(e,n,$).z<0}function I(e,n){return t.cross(e,n,Q).z>0}function b(e,n,r){return t.cross(e,r,et).z>0&&t.cross(r,n,et).z>0}function z(e,n,r){return t.cross(e,r,tt).z<0&&t.cross(r,n,tt).z<0}function D(t,n,r){for(var i=0;i<r.length;i++){var a,o=r[i].position;if(a=i<r.length-1?r[i+1].position:r[0].position,!(e.equals(t,o)||e.equals(n,a)||e.equals(t,a)||e.equals(n,o))){var u=(n.y-t.y)/(n.x-t.x),s=(a.y-o.y)/(a.x-o.x);if(!(u===s||isNaN(u)&&isNaN(s))){var c;c=isNaN(u)?t.x:isNaN(s)?o.x:(t.y-o.y-u*t.x+s*o.x)/(s-u);var l=u*c+t.y-u*t.x,f=e.fromElements(c,l,nt);if(!(e.equals(f,t)||e.equals(f,n)||e.equals(f,o)||e.equals(f,a))){var h=U(c,t.x,n.x)&&U(l,t.y,n.y)&&U(c,o.x,a.x)&&U(l,o.y,a.y);if(h)return!0}}}}return!1}function A(t){var n=t[0].position,r=t[1].position,i=t[2].position,a=e.subtract(r,n,rt),o=e.subtract(i,n,it);return N(a,o)}function U(e,t,n){return(e>t||e>n)&&(t>e||n>e)||t===n&&t===e}function q(e){var t=e.length;if(3===t)return A(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new a("Invalid polygon: must have at least three vertices.");for(var n=!1,r=0;!n;){var i=10*e.length;if(r>i)return[];r++;for(var o=M(e.length),u=o+1;Math.abs(o-u)<2||Math.abs(o-u)>e.length-2;)u=M(e.length);if(o>u){var s=o;o=u,u=s}try{if(O(o,u,e)){var c=e.splice(o,u-o+1,e[o],e[u]);return q(e).concat(q(c))}}catch(l){if(l.hasOwnProperty("vertexIndex"))return e.splice(l.vertexIndex,1),q(e);throw l}}}var L=new e,W=new e,B=new e,F=new e(1,0),G=new e,Y=0,j=-1,V=1,H=new t,k=new t,X=new t,Z=new t,J=new t,K=new t,$=new t,Q=new t,et=new t,tt=new t,nt=new e,rt=new t,it=new t,at=new t,ot=new t,ut={};return ut.removeDuplicates=function(e){for(var n=e.length,r=[],i=n-1,a=0;n>a;i=a++){var o=e[i],u=e[a];t.equals(o,u)||r.push(u)}return r},ut.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,i=0;t>i;r=i++){var a=e[r],o=e[i];n+=a.x*o.y-o.x*a.y}return.5*n},ut.computeWindingOrder2D=function(e){var t=ut.computeArea2D(e);return t>0?m.COUNTER_CLOCKWISE:m.CLOCKWISE},ut.triangulate=function(e){for(var t=e.length,n=[],r=0;t>r;++r)n[r]={position:e[r],index:r};return q(n)},ut.resetSeed=function(e){Y=r(e,0)},ut.computeSubdivision=function(e,i,a){a=r(a,l.RADIANS_PER_DEGREE);for(var o=new d,u=i.length,f=0;u>f;f+=3)o.enqueue({i0:i[f],i1:i[f+1],i2:i[f+2]});for(var m,y=e.slice(0),p=[],v={};o.length>0;){var g,w,x=o.dequeue(),E=y[x.i0],S=y[x.i1],M=y[x.i2],O=t.angleBetween(E,S),_=t.angleBetween(S,M),R=t.angleBetween(M,E),T=Math.max(O,Math.max(_,R));T>a?O===T?(g=Math.min(x.i0,x.i1).toString()+" "+Math.max(x.i0,x.i1).toString(),m=v[g],m||(w=t.add(E,S,new t),t.multiplyByScalar(w,.5,w),y.push(w),m=y.length-1,v[g]=m),o.enqueue({i0:x.i0,i1:m,i2:x.i2}),o.enqueue({i0:m,i1:x.i1,i2:x.i2})):_===T?(g=Math.min(x.i1,x.i2).toString()+" "+Math.max(x.i1,x.i2).toString(),m=v[g],m||(w=t.add(S,M,new t),t.multiplyByScalar(w,.5,w),y.push(w),m=y.length-1,v[g]=m),o.enqueue({i0:x.i1,i1:m,i2:x.i0}),o.enqueue({i0:m,i1:x.i2,i2:x.i0})):R===T&&(g=Math.min(x.i2,x.i0).toString()+" "+Math.max(x.i2,x.i0).toString(),m=v[g],m||(w=t.add(M,E,new t),t.multiplyByScalar(w,.5,w),y.push(w),m=y.length-1,v[g]=m),o.enqueue({i0:x.i2,i1:m,i2:x.i1}),o.enqueue({i0:m,i1:x.i0,i2:x.i1})):(p.push(x.i0),p.push(x.i1),p.push(x.i2))}var C=y.length,N=new Array(3*C),P=0;for(m=0;C>m;m++){var I=y[m];N[P++]=I.x,N[P++]=I.y,N[P++]=I.z}return new s({attributes:{position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:N})},indices:p,primitiveType:h.TRIANGLES})},ut.scaleToGeodeticHeight=function(e,n,a,u){a=r(a,o.WGS84);var s=at,c=ot;if(n=r(n,0),u=r(u,!0),i(e)&&i(e.attributes)&&i(e.attributes.position))for(var l=e.attributes.position.values,f=l.length,h=0;f>h;h+=3)t.fromArray(l,h,c),u&&(c=a.scaleToGeodeticSurface(c,c)),s=a.geodeticSurfaceNormal(c,s),t.multiplyByScalar(s,n,s),t.add(c,s,c),l[h]=c.x,l[h+1]=c.y,l[h+2]=c.z;return e},ut.eliminateHoles=function(e,n,i){i=r(i,o.WGS84);for(var a=[],u=0;u<n.length;u++){for(var s=[],c=0;c<n[u].length;c++)s.push(t.clone(n[u][c]));a.push(s)}for(var l=e;a.length>0;)l=S(l,a,i);return l},ut}),define("Core/Matrix2",["./Cartesian2","./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r,i){"use strict";var a=function(e,n,r,i){this[0]=t(e,0),this[1]=t(r,0),this[2]=t(n,0),this[3]=t(i,0)};a.clone=function(e,t){return n(e)?n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new a(e[0],e[2],e[1],e[3]):void 0},a.fromArray=function(e,r,i){return r=t(r,0),n(i)||(i=new a),i[0]=e[r],i[1]=e[r+1],i[2]=e[r+2],i[3]=e[r+3],i},a.fromColumnMajorArray=function(e,t){return a.clone(e,t)},a.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 a(e[0],e[1],e[2],e[3])},a.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new a(e.x,0,0,e.y)},a.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new a(e,0,0,e)},a.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 a(r,-i,i,r)},a.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]]},a.getElementIndex=function(e,t){return 2*e+t},a.getColumn=function(e,t,n){var r=2*t,i=e[r],a=e[r+1];return n.x=i,n.y=a,n},a.setColumn=function(e,t,n,r){r=a.clone(e,r);var i=2*t;return r[i]=n.x,r[i+1]=n.y,r},a.getRow=function(e,t,n){var r=e[t],i=e[t+2];return n.x=r,n.y=i,n},a.setRow=function(e,t,n,r){return r=a.clone(e,r),r[t]=n.x,r[t+2]=n.y,r};var o=new e;a.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],o)),n.y=e.magnitude(e.fromElements(t[2],t[3],o)),n};var u=new e;return a.getMaximumScale=function(t){return a.getScale(t,u),e.maximumComponent(u)},a.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},a.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},a.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},a.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},a.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},a.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},a.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},a.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},a.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]},a.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},a.IDENTITY=i(new a(1,0,0,1)),a.COLUMN0ROW0=0,a.COLUMN0ROW1=1,a.COLUMN1ROW0=2,a.COLUMN1ROW1=3,a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n"+"("+this[1]+", "+this[3]+")"},a}),define("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,n,r,i,a,o,u){"use strict";var s=Math.cos,c=Math.sin,l=Math.sqrt,f={};f.computePosition=function(e,t,r,i,a){var u=e.ellipsoid.radiiSquared,f=e.nwCorner,h=e.rectangle,d=f.latitude-e.granYCos*t+r*e.granXSin,m=s(d),y=c(d),p=u.z*y,v=f.longitude+t*e.granYSin+r*e.granXCos,g=m*s(v),w=m*c(v),x=u.x*g,E=u.y*w,S=l(x*g+E*w+p*y);i.x=x/S,i.y=E/S,i.z=p/S,n(e.vertexFormat)&&e.vertexFormat.st&&(a.x=(v-h.west)*e.lonScalar-.5,a.y=(d-h.south)*e.latScalar-.5,o.multiplyByVector(e.textureMatrix,a,a),a.x+=.5,a.y+=.5)};var h=new o,d=new e,m=new t,y=new e,p=new i;return f.computeOptions=function(t,i,s){var c,l,f,v,g,w=t._granularity,x=t._ellipsoid,E=t._surfaceHeight,S=t._rotation,M=t._extrudedHeight,O=i.east,_=i.west,R=i.north,T=i.south,C=R-T;_>O?(g=a.TWO_PI-_+O,c=Math.ceil(g/w)+1,l=Math.ceil(C/w)+1,f=g/(c-1),v=C/(l-1)):(g=O-_,c=Math.ceil(g/w)+1,l=Math.ceil(C/w)+1,f=g/(c-1),v=C/(l-1)),s=u.northwest(i,s);var N=u.center(i,m),P=v,I=f,b=0,z=0;if(n(S)){var D=Math.cos(S);P*=D,I*=D;var A=Math.sin(S);b=v*A,z=f*A,d=p.project(s,d),y=p.project(N,y),d=e.subtract(d,y,d);var U=o.fromRotation(S,h);d=o.multiplyByVector(U,d,d),d=e.add(d,y,d),s=p.unproject(d,s);var q=s.latitude,L=q+(c-1)*z,W=q-P*(l-1),B=q-P*(l-1)+(c-1)*z;R=Math.max(q,L,W,B),T=Math.min(q,L,W,B);var F=s.longitude,G=F+(c-1)*I,Y=F+(l-1)*b,j=F+(l-1)*b+(c-1)*I;if(O=Math.max(F,G,Y,j),_=Math.min(F,G,Y,j),R<-a.PI_OVER_TWO||R>a.PI_OVER_TWO||T<-a.PI_OVER_TWO||T>a.PI_OVER_TWO)throw new r("Rotated extent is invalid.");i.north=R,i.south=T,i.east=O,i.west=_}return{granYCos:P,granYSin:b,granXCos:I,granXSin:z,ellipsoid:x,width:c,height:l,surfaceHeight:E,extrudedHeight:M,nwCorner:s,rectangle:i}},f}),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,l,f,h,d,m,y,p){"use strict";function v(e){var t,n=e.size,i=e.height,a=e.width,o=new Float64Array(3*n),u=0,h=0,d=E;for(t=0;a>t;t++)p.computePosition(e,h,t,d),o[u++]=d.x,o[u++]=d.y,o[u++]=d.z;for(t=a-1,h=1;i>h;h++)p.computePosition(e,h,t,d),o[u++]=d.x,o[u++]=d.y,o[u++]=d.z;for(h=i-1,t=a-2;t>=0;t--)p.computePosition(e,h,t,d),o[u++]=d.x,o[u++]=d.y,o[u++]=d.z;for(t=0,h=i-2;h>0;h--)p.computePosition(e,h,t,d),o[u++]=d.x,o[u++]=d.y,o[u++]=d.z;for(var y=2*(o.length/3),v=f.createTypedArray(o.length/3,y),g=0,w=0;w<o.length/3-1;w++)v[g++]=w,v[g++]=w+1;v[g++]=o.length/3-1,v[g++]=0;var x=new s({attributes:new l,primitiveType:m.LINES});return x.attributes.position=new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:o}),x.indices=v,x}function g(e){var t=e.surfaceHeight,n=e.extrudedHeight,r=e.ellipsoid,i=Math.min(n,t),a=Math.max(n,t),o=v(e);if(h.equalsEpsilon(i,a,.1))return o;var u=e.height,s=e.width;o=d.scaleToGeodeticHeight(o,a,r,!1);var c=o.attributes.position.values,l=c.length,m=new Float64Array(2*l);m.set(c),o=d.scaleToGeodeticHeight(o,i,r);var y=o.attributes.position.values;m.set(y,l),o.attributes.position.values=m;var p=2*(m.length/3)+8,g=f.createTypedArray(m.length/3,p);l=m.length/6;for(var w=0,x=0;l-1>x;x++)g[w++]=x,g[w++]=x+1,g[w++]=x+l,g[w++]=x+l+1;return g[w++]=l-1,g[w++]=0,g[w++]=l+l-1,g[w++]=l,g[w++]=0,g[w++]=l,g[w++]=s-1,g[w++]=l+s-1,g[w++]=s+u-2,g[w++]=s+u-2+l,g[w++]=2*s+u-3,g[w++]=2*s+u-3+l,o.indices=g,o}var w=new e,x=new e,E=new t,S=new y,M=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.rectangle,n=i(e.granularity,h.RADIANS_PER_DEGREE),r=i(e.ellipsoid,u.WGS84),a=i(e.height,0),o=e.rotation;this._rectangle=t,this._granularity=n,this._ellipsoid=r,this._surfaceHeight=a,this._rotation=o,this._extrudedHeight=e.extrudedHeight,this._workerName="createRectangleOutlineGeometry"},O=new n;return M.createGeometry=function(t){var n=y.clone(t._rectangle,S),r=t._ellipsoid,i=t._surfaceHeight,o=t._extrudedHeight,u=p.computeOptions(t,n,O);u.size=2*u.width+2*u.height-4;var c,l;if(n=t._rectangle,a(o)){c=g(u);var f=e.fromRectangle3D(n,r,i,x),h=e.fromRectangle3D(n,r,o,w);l=e.union(f,h)}else c=v(u),c=d.scaleToGeodeticHeight(c,i,r,!1),l=e.fromRectangle3D(n,r,i);return new s({attributes:c.attributes,indices:c.indices,primitiveType:m.LINES,boundingSphere:l})},M}),define("Workers/createRectangleOutlineGeometry",["../Core/Ellipsoid","../Core/Rectangle","../Core/RectangleOutlineGeometry"],function(e,t,n){"use strict";function r(r){return r._ellipsoid=e.clone(r._ellipsoid),r._rectangle=t.clone(r._rectangle),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}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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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:0>e?-1:0},a.signNotZero=function(e){return 0>e?-1:1},a.toSNorm=function(e){return Math.round(255*(.5*a.clamp(e,-1,1)+.5))},a.fromSNorm=function(e){return a.clamp(e,0,255)/255*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.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 a>=i||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;e>=r;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}i.fromSpherical=function(n,r){t(r)||(r=new i);var a=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(o),r},i.fromElements=function(e,n,r,a){return t(a)?(a.x=e,a.y=n,a.z=r,a):new i(e,n,r)},i.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 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},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},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 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){i.normalize(e,s),i.normalize(t,c);var n=i.dot(s,c),r=i.magnitude(i.cross(s,c,s));return Math.atan2(r,n)};var l=new i;i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):n.y<=n.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,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},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},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)},i.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},i.fromDegrees=function(e,t,n,r,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,n,r,o)};var f=new i,h=new i,d=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(n,r,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=i.normalize(f,f),i.multiplyComponents(s,f,h);var l=Math.sqrt(i.dot(f,h));return h=i.divideByScalar(h,l,h),f=i.multiplyByScalar(f,a,f),t(u)||(u=new i),i.add(h,f,u)},i.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=a.toRadians(e[o]);return i.fromRadiansArray(r,t,n)},i.fromRadiansArray=function(e,n,r){var a=e.length;t(r)?r.length=a/2:r=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=i.fromRadians(u,s,0,n,r[o/2])}return r},i.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=a.toRadians(e[o]),r[o+1]=a.toRadians(e[o+1]),r[o+2]=e[o+2];return i.fromRadiansArrayHeights(r,t,n)},i.fromRadiansArrayHeights=function(e,n,r){var a=e.length;t(r)?r.length=a/3:r=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=i.fromRadians(u,s,c,n,r[o/3])}return r},i.ZERO=r(new i(0,0,0)),i.UNIT_X=r(new i(1,0,0)),i.UNIT_Y=r(new i(0,1,0)),i.UNIT_Z=r(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,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},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,_=a.z,m=l*l*d*d,p=f*f*E*E,y=h*h*_*_,R=m+p+y,T=Math.sqrt(1/R),S=e.multiplyByScalar(n,T,i);if(s>R)return isFinite(T)?e.clone(S,c):void 0;var A=u.x,v=u.y,N=u.z,M=o;M.x=S.x*A*2,M.y=S.y*v*2,M.z=S.z*N*2;var O,g,I,w,C,x,P,U,D,L,F,B=(1-T)*e.magnitude(n)/(.5*e.magnitude(M)),z=0;do{B-=z,I=1/(1+B*A),w=1/(1+B*v),C=1/(1+B*N),x=I*I,P=w*w,U=C*C,D=x*I,L=P*w,F=U*C,O=m*x+p*P+y*U-1,g=m*D*A+p*L*v+y*F*N;var b=-2*g;z=O/b}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=l*I,c.y=f*w,c.z=h*C,c):new e(l*I,f*w,h*C)}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,m=n(r)?r._centerToleranceSquared:d,p=o(t,E,_,m,c);if(n(p)){var y=e.multiplyComponents(t,_,s);y=e.normalize(y,y);var R=e.subtract(t,p,l),T=Math.atan2(y.y,y.x),S=Math.asin(y.z),A=i.sign(e.dot(R,t))*e.magnitude(R);return n(a)?(a.longitude=T,a.latitude=S,a.height=A,a):new u(T,S,A)}},u.clone=function(e,t){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){a=n(a,0),e.pack(t._radii,r,a)},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;n>a;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;n>a;++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}),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){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},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 n>t&&(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;h>f;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.clone=function(e,t){return n(e)?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):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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;i>a&&(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;i>a&&o>0?a+=u.TWO_PI:c>o&&a>0&&(o+=u.TWO_PI),i>a&&0>c?c+=u.TWO_PI:c>o&&0>i&&(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)&&l>=f)){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.union=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.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,a=e.west,i=e.east;return a>i&&(i+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(i>n||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,_=c;_.height=a,_.longitude=E,_.latitude=f,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.latitude=h,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.longitude=E,o[l]=r.cartographicToCartesian(_,o[l]),l++,0>f?_.latitude=f:h>0?_.latitude=h:_.latitude=0;for(var m=1;8>m;++m)_.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,_)&&(o[l]=r.cartographicToCartesian(_,o[l]),l++);return 0===_.latitude&&(_.longitude=E,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=r.cartographicToCartesian(_,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,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","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(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 u(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;3>n;++n){var r=e[o.getElementIndex(d[n],h[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=i.EPSILON15,r=0,a=1,u=0;3>u;++u){var s=Math.abs(e[o.getElementIndex(d[u],h[u])]);s>r&&(a=u,r=s)}var c=1,l=0,f=h[a],E=d[a];if(Math.abs(e[o.getElementIndex(E,f)])>n){var _,m=e[o.getElementIndex(E,E)],p=e[o.getElementIndex(f,f)],y=e[o.getElementIndex(E,f)],R=(m-p)/2/y;_=0>R?-1/(-R+Math.sqrt(1+R*R)):1/(R+Math.sqrt(1+R*R)),c=1/Math.sqrt(1+_*_),l=_*c}return t=o.clone(o.IDENTITY,t),t[o.getElementIndex(f,f)]=t[o.getElementIndex(E,E)]=c,t[o.getElementIndex(E,f)]=l,t[o.getElementIndex(f,E)]=-l,t}o.packedLength=9,o.pack=function(e,n,r){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]},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},o.clone=function(e,t){return n(e)?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 o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},o.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,u=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,_=2*(a-h),m=2*(i+l),p=2*(a+h),y=-r+s-f+d,R=2*(c-u),T=2*(i-l),S=2*(c+u),A=-r-s+f+d;return n(t)?(t[0]=E,t[1]=p,t[2]=T,t[3]=_,t[4]=y,t[5]=S,t[6]=m,t[7]=R,t[8]=A,t):new o(E,_,m,p,y,R,T,S,A)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,r,-a,0,a,r)},o.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 o(r,0,a,0,1,0,-a,0,r)},o.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 o(r,-a,0,a,r,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},o.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},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;o.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 f=new e;o.getMaximumScale=function(t){return o.getScale(t,f),e.maximumComponent(f)},o.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},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[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},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[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},o.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},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[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},o.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},o.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},o.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],d=[2,2,1],E=new o,_=new o;return o.computeEigenDecomposition=function(e,t){var r=i.EPSILON20,a=10,l=0,f=0;n(t)||(t={});for(var h=t.unitary=o.clone(o.IDENTITY,t.unitary),d=t.diagonal=o.clone(e,t.diagonal),m=r*u(d);a>f&&s(d)>m;)c(d,E),o.transpose(E,_),o.multiply(d,E,d),o.multiply(_,d,d),o.multiply(h,E,h),++l>2&&(++f,l=0);return 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[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},o.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)},o.inverse=function(e,t){var n=e[0],a=e[1],u=e[2],s=e[3],c=e[4],l=e[5],f=e[6],h=e[7],d=e[8],E=o.determinant(e);if(Math.abs(E)<=i.EPSILON15)throw new r("matrix is not invertible");t[0]=c*d-h*l,t[1]=h*u-a*d,t[2]=a*l-c*u,t[3]=f*l-s*d,t[4]=n*d-f*u,t[5]=s*u-n*l,t[6]=s*h-f*c,t[7]=f*a-n*h,t[8]=n*c-s*a;var _=1/E;return o.multiplyByScalar(t,_,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=a(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=a(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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.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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a,i,o,u,s,c,l,f,h,d,E,_,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(_,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(m,0)}c.packedLength=16,c.pack=function(e,t,r){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]},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),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},c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[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]):void 0},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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new c);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,l=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,_=t.y*t.w,m=t.z*t.z,p=t.z*t.w,y=t.w*t.w,R=s-d-m+y,T=2*(l-p),S=2*(f+_),A=2*(l+p),v=-s+d-m+y,N=2*(E-h),M=2*(f-_),O=2*(E+h),g=-s-d+m+y;return a[0]=R*i,a[1]=A*i,a[2]=M*i,a[3]=0,a[4]=T*o,a[5]=v*o,a[6]=O*o,a[7]=0,a[8]=S*u,a[9]=N*u,a[10]=g*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.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 l=new e,f=new e,h=new e;c.fromCamera=function(t,n){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,E=l.x,_=l.y,m=l.z,p=h.x,y=h.y,R=h.z,T=a.x,S=a.y,A=a.z,v=u*-T+s*-S+d*-A,N=p*-T+y*-S+R*-A,M=E*T+_*S+m*A;return r(n)?(n[0]=u,n[1]=p,n[2]=-E,n[3]=0,n[4]=s,n[5]=y,n[6]=-_,n[7]=0,n[8]=d,n[9]=R,n[10]=-m,n[11]=0,n[12]=v,n[13]=N,n[14]=M,n[15]=1,n):new c(u,s,d,v,p,y,R,N,-E,-_,-m,M,0,0,0,1)},c.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},c.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},c.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},c.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},c.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,_=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]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=_,a[13]=m,a[14]=p,a[15]=y,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,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},c.setColumn=function(e,t,n,r){r=c.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},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],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},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 d=new e;c.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 E=new e;c.getMaximumScale=function(t){return c.getScale(t,E),e.maximumComponent(E)},c.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],m=e[13],p=e[14],y=e[15],R=t[0],T=t[1],S=t[2],A=t[3],v=t[4],N=t[5],M=t[6],O=t[7],g=t[8],I=t[9],w=t[10],C=t[11],x=t[12],P=t[13],U=t[14],D=t[15],L=r*R+u*T+f*S+_*A,F=a*R+s*T+h*S+m*A,B=i*R+c*T+d*S+p*A,z=o*R+l*T+E*S+y*A,b=r*v+u*N+f*M+_*O,q=a*v+s*N+h*M+m*O,G=i*v+c*N+d*M+p*O,W=o*v+l*N+E*M+y*O,X=r*g+u*I+f*w+_*C,H=a*g+s*I+h*w+m*C,V=i*g+c*I+d*w+p*C,Y=o*g+l*I+E*w+y*C,k=r*x+u*P+f*U+_*D,j=a*x+s*P+h*U+m*D,Z=i*x+c*P+d*U+p*D,K=o*x+l*P+E*U+y*D;return n[0]=L,n[1]=F,n[2]=B,n[3]=z,n[4]=b,n[5]=q,n[6]=G,n[7]=W,n[8]=X,n[9]=H,n[10]=V,n[11]=Y,n[12]=k,n[13]=j,n[14]=Z,n[15]=K,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],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],m=t[1],p=t[2],y=t[4],R=t[5],T=t[6],S=t[8],A=t[9],v=t[10],N=t[12],M=t[13],O=t[14],g=r*_+o*m+c*p,I=a*_+u*m+l*p,w=i*_+s*m+f*p,C=r*y+o*R+c*T,x=a*y+u*R+l*T,P=i*y+s*R+f*T,U=r*S+o*A+c*v,D=a*S+u*A+l*v,L=i*S+s*A+f*v,F=r*N+o*M+c*O+h,B=a*N+u*M+l*O+d,z=i*N+s*M+f*O+E;return n[0]=g,n[1]=I,n[2]=w,n[3]=0,n[4]=C,n[5]=x,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=B,n[14]=z,n[15]=1,n},c.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],m=t[4],p=t[5],y=t[6],R=t[7],T=t[8],S=r*h+o*d+c*E,A=a*h+u*d+l*E,v=i*h+s*d+f*E,N=r*_+o*m+c*p,M=a*_+u*m+l*p,O=i*_+s*m+f*p,g=r*y+o*R+c*T,I=a*y+u*R+l*T,w=i*y+s*R+f*T;return n[0]=S,n[1]=A,n[2]=v,n[3]=0,n[4]=N,n[5]=M,n[6]=O,n[7]=0,n[8]=g,n[9]=I,n[10]=w,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,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;c.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,c.multiplyByScale(e,_,n)},c.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?c.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)},c.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},c.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},c.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},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],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},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 m=new u,p=new u,y=new t,R=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,m),p,o.EPSILON7)&&t.equals(c.getRow(e,3,y),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],l=e[12],f=e[1],h=e[5],d=e[9],E=e[13],_=e[2],T=e[6],S=e[10],A=e[14],v=e[3],N=e[7],M=e[11],O=e[15],g=S*O,I=A*M,w=T*O,C=A*N,x=T*M,P=S*N,U=_*O,D=A*v,L=_*M,F=S*v,B=_*N,z=T*v,b=g*h+C*d+x*E-(I*h+w*d+P*E),q=I*f+U*d+F*E-(g*f+D*d+L*E),G=w*f+D*h+B*E-(C*f+U*h+z*E),W=P*f+L*h+z*d-(x*f+F*h+B*d),X=I*a+w*i+P*l-(g*a+C*i+x*l),H=g*r+D*i+L*l-(I*r+U*i+F*l),V=C*r+U*a+z*l-(w*r+D*a+B*l),Y=x*r+F*a+B*i-(P*r+L*a+z*i);g=i*E,I=l*d,w=a*E,C=l*h,x=a*d,P=i*h,U=r*E,D=l*f,L=r*d,F=i*f,B=r*h,z=a*f;var k=g*N+C*M+x*O-(I*N+w*M+P*O),j=I*v+U*M+F*O-(g*v+D*M+L*O),Z=w*v+D*N+B*O-(C*v+U*N+z*O),K=P*v+L*N+z*M-(x*v+F*N+B*M),J=w*S+P*A+I*T-(x*A+g*T+C*S),Q=L*A+g*_+D*S-(U*S+F*A+I*_),$=U*T+z*A+C*_-(B*A+w*_+D*T),ee=B*S+x*_+F*T-(L*T+z*S+P*_),te=r*b+a*q+i*G+l*W;if(Math.abs(te)<o.EPSILON20)throw new s("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]=H*te,n[6]=V*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},c.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,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]=_,t[14]=m,t[15]=1,t},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,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/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/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";function d(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var E=new e,_=new e,m=new e,p=new e,y=new e,R=new e,T=new e,S=new e,A=new e,v=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,E),o=e.clone(a,_),u=e.clone(a,m),s=e.clone(a,p),c=e.clone(a,y),l=e.clone(a,R),f=t.length,h=1;f>h;h++){e.clone(t[h],a);var O=a.x,g=a.y,I=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),I<u.z&&e.clone(a,u),I>l.z&&e.clone(a,l)}var w=e.magnitudeSquared(e.subtract(s,i,S)),C=e.magnitudeSquared(e.subtract(c,o,S)),x=e.magnitudeSquared(e.subtract(l,u,S)),P=i,U=s,D=w;C>D&&(D=C,P=o,U=c),x>D&&(D=x,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,S)),B=Math.sqrt(F),z=v;z.x=i.x,z.y=o.y,z.z=u.z;var b=N;b.x=s.x,b.y=c.y,b.z=l.z;var q=e.multiplyByScalar(e.add(z,b,S),.5,M),G=0;for(h=0;f>h;h++){e.clone(t[h],a);var W=e.magnitude(e.subtract(a,q,S));W>G&&(G=W);var X=e.magnitudeSquared(e.subtract(a,L,S));if(X>F){var H=Math.sqrt(X);B=.5*(B+H),F=B*B;var V=H-B;L.x=(B*L.x+V*a.x)/H,L.y=(B*L.y+V*a.y)/H,L.z=(B*L.z+V*a.z)/H}}return G>B?(e.clone(L,n.center),n.radius=B):(e.clone(q,n.center),n.radius=G),n};var O=new o,g=new e,I=new e,w=new t,C=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,O),h.southwest(t,w),w.height=i,h.northeast(t,C),C.height=o;var s=a.project(w,g),c=a.project(C,I),l=c.x-s.x,f=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+f*f+E*E);var _=u.center;return _.x=s.x+.5*l,_.y=s.y+.5*f,_.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0);var u;return r(e)&&(u=h.subsample(e,t,a,x)),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,E),c=e.clone(u,_),l=e.clone(u,m),f=e.clone(u,p),h=e.clone(u,y),O=e.clone(u,R),g=t.length,I=0;g>I;I+=i){var w=t[I]+a.x,C=t[I+1]+a.y,x=t[I+2]+a.z;u.x=w,u.y=C,u.z=x,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),C<c.y&&e.clone(u,c),C>h.y&&e.clone(u,h),x<l.z&&e.clone(u,l),x>O.z&&e.clone(u,O)}var P=e.magnitudeSquared(e.subtract(f,s,S)),U=e.magnitudeSquared(e.subtract(h,c,S)),D=e.magnitudeSquared(e.subtract(O,l,S)),L=s,F=f,B=P;U>B&&(B=U,L=c,F=h),D>B&&(B=D,L=l,F=O);var z=A;z.x=.5*(L.x+F.x),z.y=.5*(L.y+F.y),z.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,z,S)),q=Math.sqrt(b),G=v;G.x=s.x,G.y=c.y,G.z=l.z;var W=N;W.x=f.x,W.y=h.y,W.z=O.z;var X=e.multiplyByScalar(e.add(G,W,S),.5,M),H=0;for(I=0;g>I;I+=i){u.x=t[I]+a.x,u.y=t[I+1]+a.y,u.z=t[I+2]+a.z;var V=e.magnitude(e.subtract(u,X,S));V>H&&(H=V);var Y=e.magnitudeSquared(e.subtract(u,z,S));if(Y>b){var k=Math.sqrt(Y);q=.5*(q+k),b=q*q;var j=k-q;z.x=(q*z.x+j*u.x)/k,z.y=(q*z.y+j*u.y)/k,z.z=(q*z.z+j*u.z)/k}}return H>q?(e.clone(z,o.center),o.radius=q):(e.clone(X,o.center),o.radius=H),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,E),u=e.clone(i,_),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,y),f=e.clone(i,R),h=t.length,O=0;h>O;O+=3){var g=t[O]+n[O],I=t[O+1]+n[O+1],w=t[O+2]+n[O+2];i.x=g,i.y=I,i.z=w,g<o.x&&e.clone(i,o),g>c.x&&e.clone(i,c),I<u.y&&e.clone(i,u),I>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var C=e.magnitudeSquared(e.subtract(c,o,S)),x=e.magnitudeSquared(e.subtract(l,u,S)),P=e.magnitudeSquared(e.subtract(f,s,S)),U=o,D=c,L=C;x>L&&(L=x,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 B=e.magnitudeSquared(e.subtract(D,F,S)),z=Math.sqrt(B),b=v;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,S),.5,M),W=0;for(O=0;h>O;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,S));X>W&&(W=X);var H=e.magnitudeSquared(e.subtract(i,F,S));if(H>B){var V=Math.sqrt(H);z=.5*(z+V),B=z*z;var Y=V-z;F.x=(z*F.x+Y*i.x)/V,F.y=(z*F.y+Y*i.y)/V,F.z=(z*F.z+Y*i.z)/V}}return W>z?(e.clone(F,a.center),a.radius=z):(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 P=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;a>o;o++)i.push(t[o].center);n=d.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;a>o;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return n.radius=s,n};var U=new e,D=new e,L=new e;d.fromOrientedBoundingBox=function(t,n){r(n)||(n=new d);var a=t.halfAxes,i=c.getColumn(a,0,U),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 n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},d.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new d(t.center,t.radius):void 0},d.packedLength=4,d.pack=function(e,t,r){r=n(r,0);var a=e.center;t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius},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 F=new e,B=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,F),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,B);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-a>o?u.OUTSIDE:a>o?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 q=new e;d.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,q),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,W=new e,X=new e,H=new e,V=new e,Y=new t,k=new Array(8),j=0;8>j;++j)k[j]=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,W);e.normalize(c,c);var l=e.cross(s,c,X);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,H),E=k,_=E[0];e.add(s,l,_),e.add(_,c,_),_=E[1],e.add(s,l,_),e.add(_,h,_),_=E[2],e.add(s,f,_),e.add(_,h,_),_=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(_,h,_),_=E[6],e.add(s,f,_),e.add(_,h,_),_=E[7],e.add(s,f,_),e.add(_,c,_);for(var m=E.length,p=0;m>p;++p){var y=E[p];e.add(o,y,y);var R=i.cartesianToCartographic(y,Y);r.project(R,y)}a=d.fromPoints(E,a),o=a.center;var T=o.x,S=o.y,A=o.z;return o.x=A,o.y=T,o.z=S,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("Renderer/WebGLConstants",["../Core/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/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(){return a.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?r.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(r.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",e(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;r>n;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(R)){R=!1;var e=/ Chrome\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(R=!0,T=r(e[1]))}return R}function i(){return a()&&T}function o(){if(!t(S)&&(S=!1,!a()&&/ Safari\/[\.0-9]+/.test(y.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(S=!0,A=r(e[1]))}return S}function u(){return o()&&A}function s(){if(!t(v)){v=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(y.userAgent);null!==e&&(v=!0,N=r(e[1]),N.isNightly=!!e[2])}return v}function c(){return s()&&N}function l(){if(!t(M)){M=!1;var e;"Microsoft Internet Explorer"===y.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(y.userAgent),null!==e&&(M=!0,O=r(e[1]))):"Netscape"===y.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(y.userAgent),null!==e&&(M=!0,O=r(e[1])))}return M}function f(){return l()&&O}function h(){if(!t(g)){g=!1;var e=/Firefox\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(g=!0,I=r(e[1]))}return g}function d(){return t(w)||(w=/Windows/i.test(y.appVersion)),w}function E(){return h()&&I}function _(){return t(C)||(C="undefined"!=typeof PointerEvent&&(!t(y.pointerEnabled)||y.pointerEnabled)),C}function m(){if(!t(P)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;P=t(n)&&""!==n,P&&(x=n)}return P}function p(){return m()?x:void 0}var y;y="undefined"!=typeof navigator?navigator:{};var R,T,S,A,v,N,M,O,g,I,w,C,x,P,U={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:E,isWindows:d,hardwareConcurrency:e(y.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:m,imageRenderingValue:p};return U.supportsFullscreen=function(){return n.supportsFullscreen()},U.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},U.supportsWebWorkers=function(){return"undefined"!=typeof Worker},U}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,a,i){"use strict";if(!a.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return n(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,n,a,i){switch(a=t(a,0),i=t(i,(n.byteLength-a)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,a,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,a,i);case o.SHORT:return new Int16Array(n,a,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,a,i);case o.FLOAT:return new Float32Array(n,a,i);case o.DOUBLE:return new Float64Array(n,a,i);default:throw new r("componentDatatype is not a valid value.")}},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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(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=void 0}return i.computeNumberOfVertices=function(e){var r=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,r){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,r):new Uint16Array(t,n,r)},r(i)}),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){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},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.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.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;f>h;h++){var d=t[h],E=d.x,_=d.y,m=d.z;a=Math.min(E,a),s=Math.max(E,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 R=e.add(p,y,r.center);return e.multiplyByScalar(R,.5,R),r},i.clone=function(t,r){return n(t)?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):void 0},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:0>s+u?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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,0>i?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(0>f)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,m=u*c-d,p=4*E*m-_*_;if(0>p){var y,R,T;h*f>=l*d?(y=o,R=E,T=-2*u*E+o*_):(y=c,R=m,T=-c*_+2*s*m);var S=0>T?-1:1,A=-S*Math.abs(y)*Math.sqrt(-p);i=-T+A;var v=i/2,N=0>v?-Math.pow(-v,1/3):Math.pow(v,1/3),M=i===A?-N:-R/N;return a=0>=R?N+M:-T/(N*N+M*M+R),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var O=E,g=-2*u*E+o*_,I=m,w=-c*_+2*s*m,C=Math.sqrt(p),x=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*C,-g)/3);a=2*Math.sqrt(-O);var U=Math.cos(P);i=a*U;var D=a*(-U/2-x*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,B=L/F;P=Math.abs(Math.atan2(c*C,-w)/3),a=2*Math.sqrt(-I),U=Math.cos(P),i=a*U,D=a*(-U/2-x*Math.sin(P));var z=-c,b=2*s>i+D?i+s:D+s,q=z/b,G=F*b,W=-L*b-F*z,X=L*z,H=(s*W-u*X)/(-u*W+s*G);return H>=B?q>=B?q>=H?[B,H,q]:[B,q,H]:[q,B,H]:q>=B?[H,B,q]:q>=H?[H,q,B]:[q,H,B]}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=0>u?-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,0>u?[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=E[0],p=E[1];if(m>=0&&p>=0){var y=Math.sqrt(m),R=Math.sqrt(p);return[h-R,h-y,h+y,h+R]}if(m>=0&&0>p)return _=Math.sqrt(m),[h-_,h+_];if(0>m&&p>=0)return _=Math.sqrt(p),[h-_,h+_]}return[]}if(d>0){var T=Math.sqrt(d),S=(s+d-c/T)/2,A=(s+d+c/T)/2,v=r.computeRealRoots(1,T,S),N=r.computeRealRoots(1,-T,A);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,_,m=d[0],p=a-m,y=p*p,R=t/2,T=p/2,S=y-4*o,A=y+4*Math.abs(o),v=c-4*m,N=c+4*Math.abs(m);if(0>m||v*A>S*N){var M=Math.sqrt(v);E=M/2,_=0===M?0:(t*T-i)/M}else{var O=Math.sqrt(S);E=0===O?0:(t*T-i)/O,_=O/2}var g,I;0===R&&0===E?(g=0,I=0):n.sign(R)===n.sign(E)?(g=R+E,I=m/g):(I=R-E,g=m/I);var w,C;0===T&&0===_?(w=0,C=0):n.sign(T)===n.sign(_)?(w=T+_,C=o/w):(C=T-_,w=o/C);var x=r.computeRealRoots(1,g,w),P=r.computeRealRoots(1,I,C);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,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=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>f?d+1:d,d+=0>h?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(t,r,a,o,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,_=e.subtract(a,r,m),S=e.subtract(o,r,p),A=e.cross(E,S,y),v=e.dot(_,A);if(u){if(v<i.EPSILON6)return;if(s=e.subtract(d,r,R),l=e.dot(s,A),0>l||l>v)return;if(c=e.cross(s,_,T),f=e.dot(E,c),0>f||l+f>v)return;h=e.dot(S,c)/v}else{if(Math.abs(v)<i.EPSILON6)return;var N=1/v;if(s=e.subtract(d,r,R),l=e.dot(s,A)*N,0>l||l>1)return;if(c=e.cross(s,_,T),f=e.dot(E,c)*N,0>f||l+f>1)return;h=e.dot(S,c)*N}return h}function f(e,t,n,r){var a=t*t-4*e*n;if(!(0>a)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(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={});var i=t.origin,o=t.direction,u=n.center,s=n.radius*n.radius,c=e.subtract(i,u,y),l=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,E=f(l,h,d,A);return r(E)?(a.start=E.root0,a.stop=E.root1,a):void 0}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 E(t,n,r,a,c){var l,f=a*a,h=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,_=c*(a*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),m=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),R=[];if(0===y&&0===p){if(l=u.computeRealRoots(E,_,m),0===l.length)return R;var T=l[0],S=Math.sqrt(Math.max(1-T*T,0));if(R.push(new e(a,c*T,c*-S)),R.push(new e(a,c*T,c*S)),2===l.length){var A=l[1],v=Math.sqrt(Math.max(1-A*A,0));R.push(new e(a,c*A,c*-v)),R.push(new e(a,c*A,c*v))}return R}var N=y*y,M=p*p,O=E*E,g=y*p,I=O+M,w=2*(_*E+g),C=2*m*E+_*_-M+N,x=2*(m*_-g),P=m*m-N;if(0===I&&0===w&&0===C&&0===x)return R;l=s.computeRealRoots(I,w,C,x,P);var U=l.length;if(0===U)return R;for(var D=0;U>D;++D){var L,F=l[D],B=F*F,z=Math.max(1-B,0),b=Math.sqrt(z);L=i.sign(E)===i.sign(m)?d(E*B+m,_*F,i.EPSILON12):i.sign(m)===i.sign(_*F)?d(E*B,_*F+m,i.EPSILON12):d(E*B+_*F,m,i.EPSILON12);var q=d(p*F,y,i.EPSILON15),G=L*q;0>G?R.push(new e(a,c*F,c*b)):G>0?R.push(new e(a,c*F,c*-b)):0!==b?(R.push(new e(a,c*F,c*-b)),R.push(new e(a,c*F,c*b)),++D):R.push(new e(a,c*F,c*b))}return R}var _={};_.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(!(0>l))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var m=new e,p=new e,y=new e,R=new e,T=new e;_.rayTriangle=function(t,n,a,i,o,u){var s=l(t,n,a,i,o);if(r(s)&&!(0>s))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var S=new c;_.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=S;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var f=l(c,a,i,o,u);return!r(f)||0>f||f>e.distance(t,n)?void 0:(r(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var A={root0:0,root1:0};_.raySphere=function(e,t,n){return n=h(e,t,n),!r(n)||n.stop<0?void 0:(n.start=Math.max(n.start,0),n)};var v=new c;_.lineSegmentSphere=function(t,n,a,i){var o=v,u=e.subtract(n,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=h(o,a,i),!r(i)||i.stop<0||i.start>s?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i)};var N=new e,M=new 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),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,i>d)return;if(d>i){o=h*h-i,u=-h+Math.sqrt(o);var E=u/a,_=r/u;return _>E?{start:E,stop:_}:{start:_,stop:E}}var m=Math.sqrt(r/a);return{start:m,stop:m}}return 1>f?(r=f-1,a=e.magnitudeSquared(l),i=a*r,o=h*h-i,u=-h+Math.sqrt(o),{start:0,stop:u/a}):0>h?(a=e.magnitudeSquared(l),{start:0,stop:-h/a}):void 0};var O=new e,g=new e,I=new e,w=new e,C=new e,x=new o,P=new o,U=new o,D=new o,L=new o,F=new o,B=new o,z=new e,b=new e,q=new t;_.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction,s=n.geodeticSurfaceNormal(a,O);if(e.dot(u,s)>=0)return a;var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u,O),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(h,f,g),g),_=e.normalize(e.cross(f,d,I),I),m=x;m[0]=f.x,m[1]=f.y,m[2]=f.z,m[3]=d.x,m[4]=d.y,m[5]=d.z,m[6]=_.x,m[7]=_.y,m[8]=_.z;var p=o.transpose(m,P),y=o.fromScale(n.radii,U),R=o.fromScale(n.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 S,A,v=o.multiply(o.multiply(p,R,F),T,F),N=o.multiply(o.multiply(v,y,B),m,B),M=o.multiplyByVector(v,a,C),G=E(N,e.negate(M,O),0,0,1),W=G.length;if(W>0){for(var X=e.clone(e.ZERO,b),H=Number.NEGATIVE_INFINITY,V=0;W>V;++V){S=o.multiplyByVector(y,o.multiplyByVector(m,G[V],z),z);var Y=e.normalize(e.subtract(S,a,w),w),k=e.dot(Y,u);k>H&&(H=k,X=e.clone(S,X))}var j=n.cartesianToCartographic(X,q);return H=i.clamp(H,0,1),A=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-H*H),A=c?-A:A,j.height=A,n.cartographicToCartesian(j,new e)}};var G=new e;return _.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(!(0>f||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},_.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]}}},_}),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(r){return i(r)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(a){return i(a)}});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(t){r.progress(t)}}: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=p,_(l,e),f=l=S,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){E(e)}var c,l,f,h,d,E,_,m,y,R; +if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],d=o(),c)for(m=d.progress,_=function(e){h.push(e),--l||(E=_=p,d.reject(h))},E=function(e){f.push(e),--c||(E=_=p,d.resolve(f))},R=0;y>R;++R)R in t&&e(t[R],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,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;a>s;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)})})},R.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 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 R,T,S;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(S,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(S,t)})})}},T=[].slice,R=[].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(;a>i;++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;o>=i;)if(r=~~((i+o)/2),a=n(e[r],t),0>a)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,R="",T=!1,S=!1,A=" ",v=s.length,N=0;s&&v>N;N++)switch(s.charAt(N)){case" ":R=" ";break;case"+":R="+";break;case"-":y=!0;break;case"'":A=s.charAt(N+1);break;case"0":T=!0;break;case"#":S=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(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,T,A);case"c":return u(String.fromCharCode(+p),y,c,f,T);case"b":return o(p,2,S,y,c,f,T);case"o":return o(p,8,S,y,c,f,T);case"x":return o(p,16,S,y,c,f,T);case"X":return o(p,16,S,y,c,f,T).toUpperCase();case"u":return o(p,10,S,y,c,f,T);case"i":case"d":return d=+p||0,d=Math.round(d-d%1),E=0>d?"-":R,p=E+a(String(Math.abs(d)),f,"0",!1),i(p,E,y,c,T);case"e":case"E":case"f":case"F":case"g":case"G":return d=+p,E=0>d?"-":R,_=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],p=E+Math.abs(d)[_](f),i(p,E,y,c,T)[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){R.julianDate=e;var n=_.leapSeconds,r=t(n,R,l);0>r&&(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){R.julianDate=e;var r=_.leapSeconds,a=t(r,R,l);if(0>a&&(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):1>=i?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,0>t&&(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,0>r&&(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 m=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,R=new u,T=/^(\d{4})$/,S=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,v=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\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,I=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+M.source,w="Invalid ISO 8601 date.";_.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,i,u,s=e.split("T"),l=1,h=1,m=0,R=0,M=0,C=0,x=s[0],P=s[1];if(!r(x))throw new a(w);var U;if(s=x.match(N),null!==s){if(U=x.split("-").length-1,U>0&&2!==U)throw new a(w);n=+s[1],l=+s[2],h=+s[3]}else if(s=x.match(S),null!==s)n=+s[1],l=+s[2];else if(s=x.match(T),null!==s)n=+s[1];else{var D;if(s=x.match(A),null!==s){if(n=+s[1],D=+s[2],u=o(n),1>D||u&&D>366||!u&&D>365)throw new a(w)}else{if(s=x.match(v),null===s)throw new a(w);n=+s[1];var L=+s[2],F=+s[3]||0;if(U=x.split("-").length-1,U>0&&(!r(s[3])&&1!==U||r(s[3])&&2!==U))throw new a(w);var B=new Date(Date.UTC(n,0,4));D=7*L+F-B.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(D),l=i.getUTCMonth()+1,h=i.getUTCDate()}if(u=o(n),1>l||l>12||1>h||(2!==l||!u)&&h>p[l-1]||u&&2===l&&h>y)throw new a(w);var z;if(r(P)){if(s=P.match(I),null!==s){if(U=P.split(":").length-1,U>0&&2!==U&&3!==U)throw new a(w);m=+s[1],R=+s[2],M=+s[3],C=1e3*+(s[4]||0),z=5}else if(s=P.match(g),null!==s){if(U=P.split(":").length-1,U>2)throw new a(w);m=+s[1],R=+s[2],M=60*+(s[3]||0),z=4}else{if(s=P.match(O),null===s)throw new a(w);m=+s[1],R=60*+(s[2]||0),z=3}if(R>=60||M>=61||m>24||24===m&&(R>0||M>0||C>0))throw new a(w);var b=s[z],q=+s[z+1],G=+(s[z+2]||0);switch(b){case"+":m-=q,R-=G;break;case"-":m+=q,R+=G;break;case"Z":break;default:R+=new Date(Date.UTC(n,l-1,h,m,R)).getTimezoneOffset()}}else R+=new Date(n,l-1,h).getTimezoneOffset();var W=60===M;for(W&&M--;R>=60;)R-=60,m++;for(;m>=24;)m-=24,h++;for(i=u&&2===l?y:p[l-1];h>i;)h-=i,l++,l>12&&(l-=12,n++),i=u&&2===l?y:p[l-1];for(;0>R;)R+=60,m--;for(;0>m;)m+=24,h--;for(;1>h;)l--,1>l&&(l+=12,n--),i=u&&2===l?y:p[l-1],h+=i;var X=E(n,l,h,m,R,M,C);return r(t)?(d(X[0],X[1],t),f(t)):t=new _(X[0],X[1],c.UTC),W&&_.addSeconds(t,1,t),t},_.now=function(e){return _.fromDate(new Date,e)};var C=new _(0,0,c.TAI);return _.toGregorianDate=function(e,t){var n=!1,a=h(e,C);r(a)||(_.addSeconds(e,-1,C),a=h(C,C),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,p=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,R=u-y*s.SECONDS_PER_HOUR,T=R/s.SECONDS_PER_MINUTE|0;R-=T*s.SECONDS_PER_MINUTE;var S=0|R,A=(R-S)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(S+=1),r(t)?(t.year=p,t.month=m,t.day=E,t.hour=y,t.minute=T,t.second=S,t.millisecond=A,t.isLeapSecond=n,t):new i(p,m,E,y,T,S,A,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){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new _(e.dayNumber,e.secondsOfDay,c.TAI):void 0},_.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){R.julianDate=e;var n=_.leapSeconds,r=t(n,R,l);return 0>r&&(r=~r,--r,0>r&&(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)],_}),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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,n,r,a,i){"use strict";function o(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,u=n.headers,s=n.overrideMimeType,c=n.withCredentials;return e(n.url,function(t){var n=e.defer();return o.load(t,r,a,i,u,n,s,c),n.promise})}function u(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function s(e,t){for(var n=u(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 c(e,n){n=t(n,"");var a=e[1],i=!!e[2],o=e[3];switch(n){case"":case"text":return u(i,o);case"arraybuffer":return s(i,o);case"blob":var c=s(i,o);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(u(i,o),a);case"json":return JSON.parse(u(i,o));default:throw new r("Unhandled responseType: "+n)}}var l=/^data:(.*?)(;base64)?,(.*)$/;return o.load=function(e,t,r,o,u,s,f,h){var d=l.exec(e);if(null!==d)return void s.resolve(c(d,t));var E=new XMLHttpRequest;if(n(f)&&n(E.overrideMimeType)&&E.overrideMimeType(f),E.open(r,e,!0),n(u))for(var _ in u)u.hasOwnProperty(_)&&E.setRequestHeader(_,u[_]);n(t)&&(E.responseType=t),n(h)&&(E.withCredentials=h),E.onload=function(){E.status>=200&&E.status<300?n(E.response)?s.resolve(E.response):n(E.responseXML)&&E.responseXML.hasChildNodes()?s.resolve(E.responseXML):n(E.responseText)?s.resolve(E.responseText):s.reject(new i("unknown XMLHttpRequest response type.")):s.reject(new a(E.status,E.response,E.getAllResponseHeaders()))},E.onerror=function(e){s.reject(new a)},E.send(o)},o.defaultLoad=o.load,o}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";function n(n,r){return e({url:n,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return n}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)||(a={}),t(a.headers)?t(a.headers.Accept)||(a.headers=e(a.headers),a.headers.Accept=i.Accept):a.headers=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(0>a||0>i||0>s||0>c||0>h||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 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=E,e._taiMinusUtcSecondsColumn=_,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,R=e._addNewLeapSeconds,T=0,S=m.length;S>T;T+=e._columnCount){var A=m[T+a],v=m[T+_],N=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,M=new o(N,v,f.TAI);if(p.push(M),R){if(v!==y&&r(y)){var O=o.leapSeconds,g=t(O,M,d);if(0>g){var I=new u(M,v);O.splice(~g,0,I)}}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,d=i*s,E=n[h+e._ut1MinusUtcSecondsColumn],p=n[d+e._ut1MinusUtcSecondsColumn],y=p-E;if(y>.5||-.5>y){var R=n[h+e._taiMinusUtcSecondsColumn],T=n[d+e._taiMinusUtcSecondsColumn];R!==T&&(l.equals(r)?E=p:p-=T-R)}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,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],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,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,0>s&&(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("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/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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","require"],function(e,t,n,r,a){"use strict";function i(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),a=d.exec(r);if(null!==a)return a[1]}}function o(){if(t(l))return l;var a;if(a="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:i(),!t(a))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new e(r(a))}function u(e){return a.toUrl("../"+e)}function s(t){return new e(t).resolve(o()).toString()}function c(e){t(f)||(f=t(a.toUrl)?u:s),t(h)||(h=document.createElement("a"));var n=f(e);return h.href=n,h.href=h.href,h.href}var l,f,h,d=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=d,c.setBaseUrl=function(t){l=new e(t).resolve(new e(document.location.href))},c}),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;t>=s;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;t>=c;++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;s>u;++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;0>u&&(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;h>=E;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(0>i)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);0>s&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,0>s&&(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=i-s*this._stepSizeDays,p=this._work,y=this._denominators,R=this._coef,T=this._xTable;for(E=0;u>=E;++E)p[E]=m-T[E];for(E=0;u>=E;++E){for(R[E]=1,_=0;u>=_;++_)_!==E&&(R[E]*=p[_]);R[E]*=y[E];var S=3*(s+E);n.x+=R[E]*d[S++],n.y+=R[E]*d[S++],n.s+=R[E]*d[S]}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],_=h+d+E;if(_>0)r=Math.sqrt(_+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,p=0;d>h&&(p=1),E>h&&E>d&&(p=2);var y=m[p],R=m[y];r=Math.sqrt(e[u.getElementIndex(p,p)]-e[u.getElementIndex(y,y)]-e[u.getElementIndex(R,R)]+1);var T=f;T[p]=.5*r,r=.5/r,c=(e[u.getElementIndex(R,y)]-e[u.getElementIndex(y,R)])*r,T[y]=(e[u.getElementIndex(y,p)]+e[u.getElementIndex(p,y)])*r,T[R]=(e[u.getElementIndex(R,p)]+e[u.getElementIndex(p,R)])*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,E=new e,_=new s,m=new s,p=new s;s.packedLength=4,s.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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;i>a;a++){var o=3*a;s.unpack(e,4*(t+a),_),s.multiply(_,p,_),_.w<0&&s.negate(_,_),s.computeAxis(_,d);var u=s.computeAngle(_);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,_):s.fromAxisAngle(E,u,_),s.multiply(_,m,o)},s.clone=function(e,t){return n(e)?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):void 0},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 R=new s,T=new s,S=new s;s.slerp=function(e,t,n,r){var a=s.dot(e,t),i=t;if(0>a&&(a=-a,i=R=s.negate(t,R)),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),S=s.multiplyByScalar(i,Math.sin(n*u),S),r=s.add(T,S,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,v=new e,N=new s,M=new s;s.computeInnerQuadrangle=function(t,n,r,a){var i=s.conjugate(n,N);s.multiply(i,r,M);var o=s.log(M,A);s.multiply(i,t,M);var u=s.log(M,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,M);return s.slerp(o,u,2*a*(1-a),i)};for(var O=new s,g=1.9011074535173003,I=a.supportsTypedArrays()?new Float32Array(8):[],w=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],x=a.supportsTypedArrays()?new Float32Array(8):[],P=0;7>P;++P){var U=P+1,D=2*U+1;I[P]=1/(U*D),w[P]=U/D}return I[7]=g/136,w[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)C[f]=(I[f]*c-w[f])*o,x[f]=(I[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+x[0]*(1+x[1]*(1+x[2]*(1+x[3]*(1+x[4]*(1+x[5]*(1+x[6]*(1+x[7])))))))),E=s.multiplyByScalar(e,d,O);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,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","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./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){"use strict";var y={},R=new n,T=new n,S=new n;y.eastNorthUpToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=R,s=T,l=S;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.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,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var A=new n,v=new n,N=new n;y.northEastDownToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=-o,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]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=A,s=v,l=N;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.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 _(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},y.northUpEastToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=o,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 _(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=R,s=T,l=S;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(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 _(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 M=new m,O=new n(1,1,1),g=new _;y.headingPitchRollToFixedFrame=function(e,t,r,a,i,o){var u=m.fromHeadingPitchRoll(t,r,a,M),s=_.fromTranslationQuaternionRotationScale(n.ZERO,u,O,g);return o=y.eastNorthUpToFixedFrame(e,i,o),_.multiply(o,s,o)};var I=new _,w=new E;y.headingPitchRollQuaternion=function(e,t,n,r,a,i){var o=y.headingPitchRollToFixedFrame(e,t,n,r,a,I),u=_.getRotation(o,w);return m.fromRotationMatrix(u,i)};var C=24110.54841,x=8640184.812866,P=.093104,U=-62e-7,D=1.1772758384668e-19,L=72921158553e-15,F=d.TWO_PI/86400,B=new h;y.computeTemeToPseudoFixedMatrix=function(e,t){B=h.addSeconds(e,-h.computeTaiMinusUtc(e),B);var n,r=B.dayNumber,a=B.secondsOfDay,o=r-2451545;n=a>=43200?(o+.5)/p.DAYS_PER_JULIAN_CENTURY:(o-.5)/p.DAYS_PER_JULIAN_CENTURY;var u=C+n*(x+n*(P+n*U)),s=u*F%d.TWO_PI,c=L+D*(r-2451545.5),l=(a+.5*p.SECONDS_PER_DAY)%p.SECONDS_PER_DAY,f=s+c*l,_=Math.cos(f),m=Math.sin(f);return i(t)?(t[0]=_,t[1]=-m,t[2]=0,t[3]=m,t[4]=_,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(_,m,0,-m,_,0,0,0,1)},y.iau2006XysData=new l,y.earthOrientationParameters=u.NONE;var z=32.184,b=2451545;y.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+z,a=t.stop.dayNumber,i=t.stop.secondsOfDay+z,o=y.iau2006XysData.preload(n,r,a,i),u=y.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},y.computeIcrfToFixedMatrix=function(e,t){i(t)||(t=new E);var n=y.computeFixedToIcrfMatrix(e,t);if(i(n))return E.transpose(n,t)};var q=new f(0,0,0),G=new s(0,0,0,0,0,0),W=new E,X=new E;y.computeFixedToIcrfMatrix=function(e,t){i(t)||(t=new E);var n=y.earthOrientationParameters.compute(e,G);if(i(n)){var r=e.dayNumber,a=e.secondsOfDay+z,o=y.iau2006XysData.computeXysRadians(r,a,q);if(i(o)){var u=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=W;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=E.fromRotationZ(-o.s,X),_=E.multiply(l,f,W),m=e.dayNumber,R=e.secondsOfDay-h.computeTaiMinusUtc(e)+n.ut1MinusUtc,T=m-2451545,S=R/p.SECONDS_PER_DAY,A=.779057273264+S+.00273781191135448*(T+S);A=A%1*d.TWO_PI;var v=E.fromRotationZ(A,X),N=E.multiply(_,v,W),M=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),g=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),w=r-b+a/p.SECONDS_PER_DAY;w/=36525;var C=-47e-6*w*d.RADIANS_PER_DEGREE/3600,x=Math.cos(C),P=Math.sin(C),U=X;return U[0]=M*x,U[1]=M*P,U[2]=g,U[3]=-O*P+I*g*x,U[4]=O*x+I*g*P,U[5]=-I*M,U[6]=-I*P-O*g*x,U[7]=I*x-O*g*P,U[8]=O*M,E.multiply(N,U,t)}}};var H=new r;y.pointToWindowCoordinates=function(e,t,n,r){return r=y.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},y.pointToGLWindowCoordinates=function(e,n,a,o){i(o)||(o=new t);var u=H;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,o)};var V=new n,Y=new n,k=new n;return y.rotationMatrixFromPositionVelocity=function(e,t,r,o){var u=a(r,c.WGS84).geodeticSurfaceNormal(e,V),s=n.cross(t,u,Y);n.equalsEpsilon(s,n.ZERO,d.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var l=n.cross(s,t,k);return n.cross(t,l,s),n.negate(s,s),i(o)||(o=new E),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=s.x,o[4]=s.y,o[5]=s.z,o[6]=l.x,o[7]=l.y,o[8]=l.z,o},y}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix3","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E){"use strict";function _(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(f.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(f.getColumn(r,1,m));var i=n.fromCartesian4(f.getColumn(r,2,m));this._plane=h.fromPointNormal(e,i)}var m=new r;o(_.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;_.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new _(r.center,n)};var y=new d,R=new n;_.prototype.projectPointOntoPlane=function(e,r){var a=y;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,R);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,R)),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)}},_.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;r>a;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},_.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,R);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,R));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},_.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;n>r;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return _.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;r>l;++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},_}),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,E,_,m,p,y;n(a.z)?(f=t.subtract(s,a,i),h=t.subtract(c,a,o),d=t.subtract(r,a,u),E=t.dot(f,f),_=t.dot(f,h),m=t.dot(f,d),p=t.dot(h,h),y=t.dot(h,d)):(f=e.subtract(s,a,i),h=e.subtract(c,a,o),d=e.subtract(r,a,u),E=e.dot(f,f),_=e.dot(f,h),m=e.dot(f,d),p=e.dot(h,h),y=e.dot(h,d));var R=1/(E*p-_*_);return l.y=(p*m-_*y)*R,l.z=(E*y-_*m)*R,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";function n(t,n,a,i){return e(t,n,a,i,r),r.x>0&&r.y>0&&r.z>0}var r=new t;return n}),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,m=_*_,p=m*_,y=m*m,R=1+_-3*m/4+5*p/4-175*y/64,T=1-_+15*m/8-35*p/8,S=1-3*_+35*m/4,A=1-5*_,v=R*l-T*Math.sin(2*l)*_/2-S*Math.sin(4*l)*m/16-A*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=d,N.cosineAlpha=E,N.u2Over4=_,N.u4Over16=m,N.u6Over64=p,N.u8Over256=y,N.a0=R,N.a1=T,N.a2=S,N.a3=A,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,m=Math.atan((1-E)*Math.tan(a)),p=Math.atan((1-E)*Math.tan(o)),y=Math.cos(m),R=Math.sin(m),T=Math.cos(p),S=Math.sin(p),A=y*T,v=y*S,N=R*S,M=R*T,O=_,g=u.TWO_PI,I=Math.cos(O),w=Math.sin(O);do{I=Math.cos(O),w=Math.sin(O);var C=v-M*I;f=Math.sqrt(T*T*w*w+C*C),c=N+A*I,s=Math.atan2(f,c);var x;0===f?(x=0,h=1):(x=A*w/f,h=1-x*x),g=O,d=c-2*N/h,isNaN(d)&&(d=0),O=_+l(E,x,h,s,f,c,d)}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=d*d,F=D*f*(d+D*(c*(2*L-1)-D*d*(4*f*f-3)*(4*L-3)/6)/4),B=n*U*(s-F),z=Math.atan2(T*w,v-M*I),b=Math.atan2(y*w,v*I-M);e._distance=B,e._startHeading=z,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,m=a.u8Over256,p=a.u2Over4,y=a.u6Over64,R=a.u4Over16,T=2*_*m*o/3+i*(1-p+7*R/4-15*y/4+579*m/64-(R-15*y/4+187*m/16)*o-(5*y/4-115*m/16)*u-29*m*s/16)+(p/2-R+71*y/32-85*m/16)*c+(5*R/16-5*y/4+383*m/96)*f-E*((y-11*m/2)*c+5*m*f/2)+(29*y/96-29*m/16)*h+539*m*d/1536,S=Math.asin(Math.sin(T)*a.cosineAlpha),A=Math.atan(a.a/a.b*Math.tan(S));T-=a.sigma;var v=Math.cos(2*a.sigma+T),N=Math.sin(T),M=Math.cos(T),O=a.cosineU*M,g=a.sineU*N,I=Math.atan2(N*a.sineHeading,O-g*a.cosineHeading),w=I-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,T,N,M,v);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/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;e>a;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;e>a;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,w),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,M),_=a.cartesianToCartographic(l,O),m=h(f,i,o);C.setEndPoints(d,_);var p=C.surfaceDistance/f,y=s;d.height=i;var R=a.cartographicToCartesian(d,g);e.pack(R,u,y),y+=3;for(var T=1;f>T;T++){var S=C.interpolateUsingSurfaceDistance(T*p,O);S.height=m[T],R=a.cartographicToCartesian(S,g),e.pack(R,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 _=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;n>a;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,_).height}return r};var m=new l,p=new e,y=new e,R=new f(e.ZERO,0),T=new e,S=new f(e.ZERO,0),A=new e,v=new e,N=[],M=new t,O=new t,g=new e,I=new e,w=new e,C=new o;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,p),h=l.multiplyByPointAsVector(s,e.UNIT_Y,y),d=f.fromPointNormal(c,h,R),E=l.multiplyByPointAsVector(s,e.UNIT_X,T),_=f.fromPointNormal(c,E,S),N=1;i.push(e.clone(t[0]));for(var M=i[0],O=t.length,g=1;O>g;++g){var I=t[g];if(f.getPointDistance(_,M)<0||f.getPointDistance(_,I)<0){var w=u.lineSegmentPlane(M,I,d,A);if(r(w)){var C=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(d,M)<0&&e.negate(C,C),i.push(e.add(w,C,new e)),o.push(N+1),e.negate(C,C),i.push(e.add(w,C,new e)),N=1}}i.push(e.clone(t[g])),N++,M=I}o.push(N)}return{positions:i,lengths:o}};var x=c.EPSILON10;return E.removeDuplicates=function(t){var n=t.length;if(2>n)return t;var r,a,i;for(r=1;n>r&&(a=t[r-1],i=t[r],!e.equalsEpsilon(a,i,x));++r);if(r===n)return t;for(var o=t.slice(0,r);n>r;++r)i=t[r],e.equalsEpsilon(a,i,x)||(o.push(e.clone(i)),a=i);return 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);if(1>o)return[];if(1===o){var f=u.scaleToGeodeticSurface(a[0],I);if(0!==l){var h=u.geodeticSurfaceNormal(f,g);e.multiplyByScalar(h,l,h),e.add(f,h,f)}return[f.x,f.y,f.z]}var _=t.minDistance;if(!r(_)){var m=n(t.granularity,c.RADIANS_PER_DEGREE);_=c.chordLength(m,u.maximumRadius)}var p,y=0;for(p=0;o-1>p;p++)y+=E.numberOfPoints(a[p],a[p+1],_);var R=3*(y+1),T=new Array(R),S=0,A=s(l);for(p=0;o-1>p;p++){var v=a[p],O=a[p+1],w=A?l[p]:l,C=A?l[p+1]:l;S=d(v,O,_,u,w,C,T,S)}N.length=0;var x=a[o-1],P=u.cartesianToCartographic(x,M);P.height=A?l[o-1]:l;var U=u.cartographicToCartesian(P,g);return e.pack(U,T,R-3),T},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;r>i;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/Queue",["../Core/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(){return 0!==this._length?this._array[this._offset]:void 0},t.prototype.contains=function(e){return-1!==this._array.indexOf(e)},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/WindingOrder",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"use strict";var n={CLOCKWISE:e.CW,COUNTER_CLOCKWISE:e.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return t(n)}),define("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PolylinePipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,_){"use strict";function m(t,n,r){var a=e.subtract(n,t,F),i=e.subtract(r,n,B);return a.x*i.y-a.y*i.x>=0}function p(e){for(var t=e[0].x,n=0,r=0;r<e.length;r++)e[r].x>t&&(t=e[r].x,n=r);return n}function y(e){for(var t=e[0][0].x,n=0,r=0;r<e.length;r++){var a=e[r][p(e[r])].x;a>t&&(t=a,n=r)}return n}function R(e){for(var t=[],n=0;n<e.length;n++){var r=e[(n-1+e.length)%e.length],a=e[n],i=e[(n+1)%e.length];m(r,a,i)||t.push(a)}return t}function T(t,n){for(var r=0;r<t.length;r++)if(e.equals(n,t[r]))return r;return-1}function S(n,a,i){i=r(i,[]);var o=Number.MAX_VALUE,u=p(a),s=new e(a[u].x,n.y);i.push(u),i.push((u+1)%a.length);for(var c=a[0].x,l=c,f=1;f<a.length;++f)a[f].x<c?c=a[f].x:a[f].x>l&&(l=a[f].x);l+=l-c;var h=new t(l,n.y,0);for(f=0;f<a.length;f++){var d=a[f],E=a[(f+1)%a.length];if((d.x>=n.x||E.x>=n.x)&&(d.y>=n.y&&E.y<=n.y||d.y<=n.y&&E.y>=n.y)){var _=(E.y-d.y)*(h.x-n.x)-(E.x-d.x)*(h.y-n.y);if(0!==_){_=1/_;var m=((E.x-d.x)*(n.y-d.y)-(E.y-d.y)*(n.x-d.x))*_,y=((h.x-n.x)*(n.y-d.y)-(h.y-n.y)*(n.x-d.x))*_;if(m>=0&&1>=m&&y>=0&&1>=y){var R=new e(n.x+m*(h.x-n.x),n.y+m*(h.y-n.y)),T=e.subtract(R,n,z);_=e.magnitudeSquared(T),o>_&&(s=R,o=_,i[0]=f,i[1]=(f+1)%a.length)}}}}return s}function A(t,n){var r=y(n),a=n[r],i=p(a),o=a[i],u=[],s=S(o,t,u),c=T(t,s);if(-1!==c)return c;var h=e.magnitudeSquared(e.subtract(t[u[0]],o,b)),d=e.magnitudeSquared(e.subtract(t[u[1]],o,b)),E=d>h?t[u[0]]:t[u[1]],_=R(t),m=_.indexOf(E);-1!==m&&_.splice(m,1);for(var A=[],v=0;v<_.length;v++){var N=_[v];f(N,o,s,E)&&A.push(N)}var M=Number.MAX_VALUE;if(A.length>0){var O=e.fromElements(1,0,b);for(v=0;v<A.length;v++){var g=e.subtract(A[v],o,q),I=e.magnitude(O)*e.magnitudeSquared(g);if(0!==I){var w=Math.abs(l.acosClamped(e.dot(O,g)/I));M>w&&(M=w,E=A[v])}}}return t.indexOf(E)}function v(e,n,r){for(var a=ee.computeWindingOrder2D(e),i=0;i<n.length;i++){var o=n[i];t.equals(o[0],o[o.length-1])||o.push(o[0]);var s=ee.computeWindingOrder2D(o);s===a&&o.reverse()}var c=u.fromPoints(e,r),l=c.projectPointsOntoPlane(e),f=[];for(i=0;i<n.length;i++)f.push(c.projectPointsOntoPlane(n[i]));var h=A(l,f),d=y(f),E=p(f[d]),_=n[d],m=[];for(i=0;i<e.length;i++)m.push(e[i]);var R,T=[];if(0!==E)for(R=0;R<=_.length;R++){var S=(R+E)%_.length;0!==S&&T.push(_[S])}else for(R=0;R<_.length;R++)T.push(_[(R+E)%_.length]);var v=m.lastIndexOf(e[h]);T.push(e[v]);var N=m.slice(0,v+1),M=m.slice(v+1);return m=N.concat(T,M),n.splice(d,1),m}function N(e){var t=l.nextRandomNumber(),n=Math.floor(t*e);return n===e&&n--,n}function M(e,t,n,r){var a=r[e].position,i=r[t].position,o=r[n].position,u=o.x,s=o.y,c=a.x-u,l=a.y-s,f=i.x-u,h=i.y-s;return c*h-l*f}function O(e,t){return e.x*t.y-e.y*t.x}function g(e,t){var n=t.length,r=l.mod(e-1,n),a=l.mod(e+1,n);return 0===M(r,a,e,t)?!1:!0}function I(t,n){return e.magnitudeSquared(n)<e.magnitudeSquared(t)}function w(t,n,r){if(!g(t,r))return t;var a=r[t].position,i=r[n].position,o=r.length,u=l.mod(t-1,o);if(!g(u,r))return u;var s=l.mod(t+1,o);if(!g(s,r))return s;var c=e.subtract(r[u].position,a,X),f=e.subtract(r[s].position,a,H),h=e.subtract(i,a,V),d=O(c,h),E=O(f,h);if(0===d)return I(c,h)?G:W;if(0===E)return I(f,h)?G:W;var _=O(c,f);return 0>_?0>d&&E>0?G:W:_>0?d>0&&0>E?W:G:void 0}function C(e,t,n){return(e>t||e>n)&&(t>e||n>e)||t===n&&t===e}function x(t,n,r,a){var i=e.subtract(r,t,k),o=n.x*a.y-n.y*a.x,u=o*o,s=e.magnitudeSquared(n),c=e.magnitudeSquared(a);if(u>Y*s*c){var l=(i.x*a.y-i.y*a.x)/o;return e.add(t,e.multiplyByScalar(n,l,k),k)}}function P(t,n,r){for(var i=e.subtract(n,t,j),o=r.length,u=0;o>u;u++){var s=r[u].position,c=r[l.mod(u+1,o)].position;if(!(e.equals(t,s)||e.equals(n,c)||e.equals(t,c)||e.equals(n,s))){var f=e.subtract(c,s,Z),h=x(t,i,s,f);if(a(h)&&!(e.equals(h,t)||e.equals(h,n)||e.equals(h,s)||e.equals(h,c))){var d=h.x,E=h.y,_=C(d,t.x,n.x)&&C(E,t.y,n.y)&&C(d,s.x,c.x)&&C(E,s.y,c.y);if(_)return!0}}}return!1}function U(t,n,r){var a=w(t,n,r);if(a>=0)return a;var i=w(n,t,r);return i>=0?i:a!==G||i!==G||P(r[t].position,r[n].position,r)||e.equals(r[t].position,r[n].position)?J:K}function D(e){return 0===M(1,2,0,e)}function L(e){var t=e.length;if(3===t)return D(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new i("Invalid polygon: must have at least three vertices.");for(var n,r,a=0,o=10*e.length,u=J;K>u&&a++<o;){for(n=N(e.length),r=n+1;Math.abs(n-r)<2||Math.abs(n-r)>e.length-2;)r=N(e.length);if(n>r){var s=n;n=r,r=s}u=U(n,r,e)}if(u===K){var c=e.splice(n,r-n+1,e[n],e[r]);return L(e).concat(L(c))}return u>=0?(e.splice(u,1),L(e)):[]}var F=new e,B=new e,z=new e,b=new e(1,0),q=new e,G=-1,W=-2,X=new t,H=new t,V=new t,Y=l.EPSILON14,k=new e,j=new e,Z=new e,K=-1,J=-2,Q=new t,$=new t,ee={};ee.removeDuplicates=function(e){var n=h.removeDuplicates(e);return t.equals(n[0],n[n.length-1])?n.slice(1):n},ee.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;t>a;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},ee.computeWindingOrder2D=function(e){var t=ee.computeArea2D(e);return t>0?_.COUNTER_CLOCKWISE:_.CLOCKWISE},ee.triangulate=function(e){for(var t=e.length,n=[],r=0;t>r;++r)n[r]={position:e[r],index:r};return L(n)};var te=new t,ne=new t,re=new t,ae=new t,ie=new t,oe=new t,ue=new t;return ee.computeSubdivision=function(e,i,o,u){u=r(u,l.RADIANS_PER_DEGREE);var f,h=o.slice(0),E=i.length,_=new Array(3*E),m=0;for(f=0;E>f;f++){var p=i[f];_[m++]=p.x,_[m++]=p.y,_[m++]=p.z}for(var y=[],R={},T=e.maximumRadius,S=l.chordLength(u,T),A=S*S;h.length>0;){var v,N,M=h.pop(),O=h.pop(),g=h.pop(),I=t.fromArray(_,3*g,te),w=t.fromArray(_,3*O,ne),C=t.fromArray(_,3*M,re),x=t.multiplyByScalar(t.normalize(I,ae),T,ae),P=t.multiplyByScalar(t.normalize(w,ie),T,ie),U=t.multiplyByScalar(t.normalize(C,oe),T,oe),D=t.magnitudeSquared(t.subtract(x,P,ue)),L=t.magnitudeSquared(t.subtract(P,U,ue)),F=t.magnitudeSquared(t.subtract(U,x,ue)),B=Math.max(D,L,F);B>A?D===B?(v=Math.min(g,O)+" "+Math.max(g,O),f=R[v],a(f)||(N=t.add(I,w,ue),t.multiplyByScalar(N,.5,N),_.push(N.x,N.y,N.z),f=_.length/3-1,R[v]=f),h.push(g,f,M),h.push(f,O,M)):L===B?(v=Math.min(O,M)+" "+Math.max(O,M),f=R[v],a(f)||(N=t.add(w,C,ue),t.multiplyByScalar(N,.5,N),_.push(N.x,N.y,N.z),f=_.length/3-1,R[v]=f),h.push(O,f,g),h.push(f,M,g)):F===B&&(v=Math.min(M,g)+" "+Math.max(M,g),f=R[v],a(f)||(N=t.add(C,I,ue),t.multiplyByScalar(N,.5,N),_.push(N.x,N.y,N.z),f=_.length/3-1,R[v]=f),h.push(M,f,O),h.push(f,g,O)):(y.push(g),y.push(O),y.push(M))}return new s({attributes:{position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:_})},indices:y,primitiveType:d.TRIANGLES})},ee.scaleToGeodeticHeight=function(e,n,i,u){i=r(i,o.WGS84);var s=Q,c=$;if(n=r(n,0),u=r(u,!0),a(e)&&a(e.attributes)&&a(e.attributes.position))for(var l=e.attributes.position.values,f=l.length,h=0;f>h;h+=3)t.fromArray(l,h,c),u&&(c=i.scaleToGeodeticSurface(c,c)),0!==n&&(s=i.geodeticSurfaceNormal(c,s),t.multiplyByScalar(s,n,s),t.add(c,s,c)),l[h]=c.x,l[h+1]=c.y,l[h+2]=c.z;return e},ee.eliminateHoles=function(e,n,a){a=r(a,o.WGS84);for(var i=[],u=0;u<n.length;u++){for(var s=[],c=0;c<n[u].length;c++)s.push(t.clone(n[u][c]));i.push(s)}for(var l=e;i.length>0;)l=v(l,i,a);return l},ee}),define("Core/Matrix2",["./Cartesian2","./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r,a){"use strict";function i(e,n,r,a){this[0]=t(e,0),this[1]=t(r,0),this[2]=t(n,0),this[3]=t(a,0)}i.packedLength=4,i.pack=function(e,n,r){r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3]},i.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new i),a[0]=e[r++],a[1]=e[r++],a[2]=e[r++],a[3]=e[r++],a},i.clone=function(e,t){return n(e)?n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new i(e[0],e[2],e[1],e[3]):void 0},i.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new i),a[0]=e[r],a[1]=e[r+1],a[2]=e[r+2],a[3]=e[r+3],a},i.fromColumnMajorArray=function(e,t){return i.clone(e,t)},i.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 i(e[0],e[1],e[2],e[3])},i.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new i(e.x,0,0,e.y)},i.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new i(e,0,0,e)},i.fromRotation=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=-a,t[3]=r,t):new i(r,-a,a,r)},i.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]]},i.getElementIndex=function(e,t){return 2*e+t},i.getColumn=function(e,t,n){var r=2*t,a=e[r],i=e[r+1];return n.x=a,n.y=i,n},i.setColumn=function(e,t,n,r){r=i.clone(e,r);var a=2*t;return r[a]=n.x,r[a+1]=n.y,r},i.getRow=function(e,t,n){var r=e[t],a=e[t+2];return n.x=r,n.y=a,n},i.setRow=function(e,t,n,r){return r=i.clone(e,r),r[t]=n.x,r[t+2]=n.y,r};var o=new e;i.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],o)),n.y=e.magnitude(e.fromElements(t[2],t[3],o)),n};var u=new e;return i.getMaximumScale=function(t){return i.getScale(t,u),e.maximumComponent(u)},i.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},i.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},i.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},i.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},i.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},i.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},i.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},i.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},i.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},i.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]},i.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]},i.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},i.IDENTITY=a(new i(1,0,0,1)),i.ZERO=a(new i(0,0,0,0)),i.COLUMN0ROW0=0,i.COLUMN0ROW1=1,i.COLUMN1ROW0=2,i.COLUMN1ROW1=3,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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},i}),define("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,n,r,a,i,o,u){"use strict";var s=Math.cos,c=Math.sin,l=Math.sqrt,f={};f.computePosition=function(e,t,r,a,i){var u=e.ellipsoid.radiiSquared,f=e.nwCorner,h=e.rectangle,d=f.latitude-e.granYCos*t+r*e.granXSin,E=s(d),_=c(d),m=u.z*_,p=f.longitude+t*e.granYSin+r*e.granXCos,y=E*s(p),R=E*c(p),T=u.x*y,S=u.y*R,A=l(T*y+S*R+m*_);a.x=T/A,a.y=S/A,a.z=m/A,n(e.vertexFormat)&&e.vertexFormat.st&&(i.x=(p-h.west)*e.lonScalar-.5,i.y=(d-h.south)*e.latScalar-.5,o.multiplyByVector(e.textureMatrix,i,i),i.x+=.5,i.y+=.5)};var h=new o,d=new e,E=new t,_=new e,m=new a;return f.computeOptions=function(t,a,s){var c,l,f,p,y,R=t._granularity,T=t._ellipsoid,S=t._surfaceHeight,A=t._rotation,v=t._extrudedHeight,N=a.east,M=a.west,O=a.north,g=a.south,I=O-g;M>N?(y=i.TWO_PI-M+N,c=Math.ceil(y/R)+1,l=Math.ceil(I/R)+1,f=y/(c-1),p=I/(l-1)):(y=N-M,c=Math.ceil(y/R)+1,l=Math.ceil(I/R)+1,f=y/(c-1),p=I/(l-1)),s=u.northwest(a,s);var w=u.center(a,E),C=p,x=f,P=0,U=0;if(n(A)){var D=Math.cos(A);C*=D,x*=D;var L=Math.sin(A);P=p*L,U=f*L,d=m.project(s,d),_=m.project(w,_),d=e.subtract(d,_,d);var F=o.fromRotation(A,h);d=o.multiplyByVector(F,d,d),d=e.add(d,_,d),s=m.unproject(d,s);var B=s.latitude,z=B+(c-1)*U,b=B-C*(l-1),q=B-C*(l-1)+(c-1)*U;O=Math.max(B,z,b,q),g=Math.min(B,z,b,q);var G=s.longitude,W=G+(c-1)*x,X=G+(l-1)*P,H=G+(l-1)*P+(c-1)*x;if(N=Math.max(G,W,X,H),M=Math.min(G,W,X,H),O<-i.PI_OVER_TWO||O>i.PI_OVER_TWO||g<-i.PI_OVER_TWO||g>i.PI_OVER_TWO)throw new r("Rotated rectangle is invalid. It crosses over either the north or south pole.");a.north=O,a.south=g,a.east=N,a.west=M}return{granYCos:C,granYSin:P,granXCos:x,granXSin:U,ellipsoid:T,width:c,height:l,surfaceHeight:S,extrudedHeight:v,nwCorner:s,rectangle:a}},f}),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,a,i,o,u,s,c,l,f,h,d,E,_,m){"use strict";function p(e){var t,n=e.size,a=e.height,i=e.width,o=new Float64Array(3*n),u=0,h=0,d=A;for(t=0;i>t;t++)m.computePosition(e,h,t,d),o[u++]=d.x,o[u++]=d.y,o[u++]=d.z;for(t=i-1,h=1;a>h;h++)m.computePosition(e,h,t,d),o[u++]=d.x,o[u++]=d.y,o[u++]=d.z;for(h=a-1,t=i-2;t>=0;t--)m.computePosition(e,h,t,d),o[u++]=d.x,o[u++]=d.y,o[u++]=d.z;for(t=0,h=a-2;h>0;h--)m.computePosition(e,h,t,d),o[u++]=d.x,o[u++]=d.y,o[u++]=d.z;for(var _=o.length/3*2,p=f.createTypedArray(o.length/3,_),y=0,R=0;R<o.length/3-1;R++)p[y++]=R, +p[y++]=R+1;p[y++]=o.length/3-1,p[y++]=0;var T=new s({attributes:new l,primitiveType:E.LINES});return T.attributes.position=new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:o}),T.indices=p,T}function y(e){var t=e.surfaceHeight,n=e.extrudedHeight,r=e.ellipsoid,a=Math.min(n,t),i=Math.max(n,t),o=p(e);if(h.equalsEpsilon(a,i,h.EPSILON10))return o;var u=e.height,s=e.width;o=d.scaleToGeodeticHeight(o,i,r,!1);var c=o.attributes.position.values,l=c.length,E=new Float64Array(2*l);E.set(c),o=d.scaleToGeodeticHeight(o,a,r);var _=o.attributes.position.values;E.set(_,l),o.attributes.position.values=E;var m=E.length/3*2+8,y=f.createTypedArray(E.length/3,m);l=E.length/6;for(var R=0,T=0;l-1>T;T++)y[R++]=T,y[R++]=T+1,y[R++]=T+l,y[R++]=T+l+1;return y[R++]=l-1,y[R++]=0,y[R++]=l+l-1,y[R++]=l,y[R++]=0,y[R++]=l,y[R++]=s-1,y[R++]=l+s-1,y[R++]=s+u-2,y[R++]=s+u-2+l,y[R++]=2*s+u-3,y[R++]=2*s+u-3+l,o.indices=y,o}function R(e){e=a(e,a.EMPTY_OBJECT);var t=e.rectangle,n=a(e.granularity,h.RADIANS_PER_DEGREE),r=a(e.ellipsoid,u.WGS84),i=a(e.height,0),o=a(e.rotation,0),s=e.extrudedHeight;this._rectangle=t,this._granularity=n,this._ellipsoid=r,this._surfaceHeight=i,this._rotation=o,this._extrudedHeight=s,this._workerName="createRectangleOutlineGeometry"}var T=new e,S=new e,A=new t,v=new _;R.packedLength=_.packedLength+u.packedLength+5,R.pack=function(e,t,n){n=a(n,0),_.pack(e._rectangle,t,n),n+=_.packedLength,u.pack(e._ellipsoid,t,n),n+=u.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=i(e._extrudedHeight)?1:0,t[n]=a(e._extrudedHeight,0)};var N=new _,M=u.clone(u.UNIT_SPHERE),O={rectangle:N,ellipsoid:M,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0};R.unpack=function(e,t,n){t=a(t,0);var r=_.unpack(e,t,N);t+=_.packedLength;var o=u.unpack(e,t,M);t+=u.packedLength;var s=e[t++],c=e[t++],l=e[t++],f=e[t++],h=e[t];return i(n)?(n._rectangle=_.clone(r,n._rectangle),n._ellipsoid=u.clone(o,n._ellipsoid),n._surfaceHeight=c,n._rotation=l,n._extrudedHeight=f?h:void 0,n):(O.granularity=s,O.height=c,O.rotation=l,O.extrudedHeight=f?h:void 0,new R(O))};var g=new n;return R.createGeometry=function(t){var n=_.clone(t._rectangle,v),r=t._ellipsoid,a=t._surfaceHeight,o=t._extrudedHeight,u=m.computeOptions(t,n,g);u.size=2*u.width+2*u.height-4;var c,l;if(n=t._rectangle,i(o)){c=y(u);var f=e.fromRectangle3D(n,r,a,S),h=e.fromRectangle3D(n,r,o,T);l=e.union(f,h)}else c=p(u),c=d.scaleToGeodeticHeight(c,a,r,!1),l=e.fromRectangle3D(n,r,a);return new s({attributes:c.attributes,indices:c.indices,primitiveType:E.LINES,boundingSphere:l})},R}),define("Workers/createRectangleOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/Rectangle","../Core/RectangleOutlineGeometry"],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/Workers/createSimplePolylineGeometry.js b/Workers/createSimplePolylineGeometry.js index 0c48718..5a7daaf 100644 --- a/Workers/createSimplePolylineGeometry.js +++ b/Workers/createSimplePolylineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +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";var t=function(t){return void 0!==t};return t}),define("Core/freezeObject",["./defined"],function(t){"use strict";var r=Object.freeze;return t(r)||(r=function(t){return t}),r}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";var r=function(t,r){return void 0!==t?t:r};return r.EMPTY_OBJECT=t({}),r}),define("Core/DeveloperError",["./defined"],function(t){"use strict";var r=function(t){this.name="DeveloperError",this.message=t;var r;try{throw new Error}catch(e){r=e.stack}this.stack=r};return r.prototype.toString=function(){var r=this.name+": "+this.message;return t(this.stack)&&(r+="\n"+this.stack.toString()),r},r.throwInstantiationError=function(){throw new r("This function defines an interface and should not be called directly.")},r}),define("ThirdParty/mersenne-twister",[],function(){var 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,r=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var e;for(this.mti==this.N+1&&this.init_genrand(5489),e=0;e<this.N-this.M;e++)t=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+this.M]^t>>>1^r[1&t];for(;e<this.N-1;e++)t=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+(this.M-this.N)]^t>>>1^r[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^r[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=2636928640&t<<7,t^=4022730752&t<<15,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,r){"use strict";var e={};e.EPSILON1=.1,e.EPSILON2=.01,e.EPSILON3=.001,e.EPSILON4=1e-4,e.EPSILON5=1e-5,e.EPSILON6=1e-6,e.EPSILON7=1e-7,e.EPSILON8=1e-8,e.EPSILON9=1e-9,e.EPSILON10=1e-10,e.EPSILON11=1e-11,e.EPSILON12=1e-12,e.EPSILON13=1e-13,e.EPSILON14=1e-14,e.EPSILON15=1e-15,e.EPSILON16=1e-16,e.EPSILON17=1e-17,e.EPSILON18=1e-18,e.EPSILON19=1e-19,e.EPSILON20=1e-20,e.GRAVITATIONALPARAMETER=3986004418e5,e.SOLAR_RADIUS=6955e5,e.LUNAR_RADIUS=1737400,e.SIXTY_FOUR_KILOBYTES=65536,e.sign=function(t){return t>0?1:0>t?-1:0},e.signNotZero=function(t){return 0>t?-1:1},e.toSNorm=function(t){return Math.round(255*(.5*e.clamp(t,-1,1)+.5))},e.fromSNorm=function(t){return 2*(e.clamp(t,0,255)/255)-1},e.sinh=function(t){var r=Math.pow(Math.E,t),e=Math.pow(Math.E,-1*t);return.5*(r-e)},e.cosh=function(t){var r=Math.pow(Math.E,t),e=Math.pow(Math.E,-1*t);return.5*(r+e)},e.lerp=function(t,r,e){return(1-e)*t+e*r},e.PI=Math.PI,e.ONE_OVER_PI=1/Math.PI,e.PI_OVER_TWO=.5*Math.PI,e.PI_OVER_THREE=Math.PI/3,e.PI_OVER_FOUR=Math.PI/4,e.PI_OVER_SIX=Math.PI/6,e.THREE_PI_OVER_TWO=.5*3*Math.PI,e.TWO_PI=2*Math.PI,e.ONE_OVER_TWO_PI=1/(2*Math.PI),e.RADIANS_PER_DEGREE=Math.PI/180,e.DEGREES_PER_RADIAN=180/Math.PI,e.RADIANS_PER_ARCSECOND=e.RADIANS_PER_DEGREE/3600,e.toRadians=function(t){return t*e.RADIANS_PER_DEGREE},e.toDegrees=function(t){return t*e.DEGREES_PER_RADIAN},e.convertLongitudeRange=function(t){var r=e.TWO_PI,n=t-Math.floor(t/r)*r;return n<-Math.PI?n+r:n>=Math.PI?n-r:n},e.negativePiToPi=function(t){for(var r=e.EPSILON10,n=e.PI,o=e.TWO_PI;-(n+r)>t;)t+=o;if(-n>t)return-n;for(;t>n+r;)t-=o;return t>n?n:t},e.zeroToTwoPi=function(t){var r=t%e.TWO_PI;return 0>r?(r+e.TWO_PI)%e.TWO_PI:r},e.equalsEpsilon=function(t,e,n){return n=r(n,0),Math.abs(t-e)<=n};var n=[1];e.factorial=function(t){var r=n.length;if(t>=r)for(var e=n[r-1],o=r;t>=o;o++)n.push(e*o);return n[t]},e.incrementWrap=function(t,e,n){return n=r(n,0),++t,t>e&&(t=n),t},e.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},e.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},e.clamp=function(t,r,e){return r>t?r:t>e?e:t};var o=new t;return e.setRandomNumberSeed=function(r){o=new t(r)},e.nextRandomNumber=function(){return o.random()},e.acosClamped=function(t){return Math.acos(e.clamp(t,-1,1))},e.asinClamped=function(t){return Math.asin(e.clamp(t,-1,1))},e}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,r,e,n,o){"use strict";var i=function(r,e,n){this.x=t(r,0),this.y=t(e,0),this.z=t(n,0)};i.fromSpherical=function(e,n){r(n)||(n=new i);var o=e.clock,a=e.cone,s=t(e.magnitude,1),u=s*Math.sin(a);return n.x=u*Math.cos(o),n.y=u*Math.sin(o),n.z=s*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){return r(t)?r(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new i(t.x,t.y,t.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(r,e,n){n=t(n,0),e[n++]=r.x,e[n++]=r.y,e[n]=r.z},i.unpack=function(e,n,o){return n=t(n,0),r(o)||(o=new i),o.x=e[n++],o.y=e[n++],o.z=e[n],o},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,r,e){return e.x=Math.min(t.x,r.x),e.y=Math.min(t.y,r.y),e.z=Math.min(t.z,r.z),e},i.maximumByComponent=function(t,r,e){return e.x=Math.max(t.x,r.x),e.y=Math.max(t.y,r.y),e.z=Math.max(t.z,r.z),e},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 a=new i;i.distance=function(t,r){return i.subtract(t,r,a),i.magnitude(a)},i.normalize=function(t,r){var e=i.magnitude(t);return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r},i.dot=function(t,r){return t.x*r.x+t.y*r.y+t.z*r.z},i.multiplyComponents=function(t,r,e){return e.x=t.x*r.x,e.y=t.y*r.y,e.z=t.z*r.z,e},i.add=function(t,r,e){return e.x=t.x+r.x,e.y=t.y+r.y,e.z=t.z+r.z,e},i.subtract=function(t,r,e){return e.x=t.x-r.x,e.y=t.y-r.y,e.z=t.z-r.z,e},i.multiplyByScalar=function(t,r,e){return e.x=t.x*r,e.y=t.y*r,e.z=t.z*r,e},i.divideByScalar=function(t,r,e){return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e},i.negate=function(t,r){return r.x=-t.x,r.y=-t.y,r.z=-t.z,r},i.abs=function(t,r){return r.x=Math.abs(t.x),r.y=Math.abs(t.y),r.z=Math.abs(t.z),r};var s=new i;i.lerp=function(t,r,e,n){return i.multiplyByScalar(r,e,s),n=i.multiplyByScalar(t,1-e,n),i.add(s,n,n)};var u=new i,l=new i;i.angleBetween=function(t,r){i.normalize(t,u),i.normalize(r,l);var e=i.dot(u,l),n=i.magnitude(i.cross(u,l,u));return Math.atan2(n,e)};var c=new i;i.mostOrthogonalAxis=function(t,r){var e=i.normalize(t,c);return i.abs(e,e),r=e.x<=e.y?e.x<=e.z?i.clone(i.UNIT_X,r):i.clone(i.UNIT_Z,r):e.y<=e.z?i.clone(i.UNIT_Y,r):i.clone(i.UNIT_Z,r)},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.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.x-e.x)<=n&&Math.abs(t.y-e.y)<=n&&Math.abs(t.z-e.z)<=n},i.cross=function(t,r,e){var n=t.x,o=t.y,i=t.z,a=r.x,s=r.y,u=r.z,l=o*u-i*s,c=i*a-n*u,f=n*s-o*a;return e.x=l,e.y=c,e.z=f,e},i.fromDegrees=function(t,r,e,n,a){var s=o.toRadians(t),u=o.toRadians(r);return i.fromRadians(s,u,e,n,a)};var f=new i,h=new i,d=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(e,n,o,a,s){o=t(o,0);var u=r(a)?a.radiiSquared:d,l=Math.cos(n);f.x=l*Math.cos(e),f.y=l*Math.sin(e),f.z=Math.sin(n),f=i.normalize(f,f),i.multiplyComponents(u,f,h);var c=Math.sqrt(i.dot(f,h));return h=i.divideByScalar(h,c,h),f=i.multiplyByScalar(f,o,f),r(s)||(s=new i),i.add(h,f,s)},i.fromDegreesArray=function(t,r,e){for(var n=new Array(t.length),a=0;a<t.length;a++)n[a]=o.toRadians(t[a]);return i.fromRadiansArray(n,r,e)},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;o>a;a+=2){var s=t[a],u=t[a+1];n[a/2]=i.fromRadians(s,u,0,e,n[a/2])}return n},i.fromDegreesArrayHeights=function(t,r,e){for(var n=new Array(t.length),a=0;a<t.length;a+=3)n[a]=o.toRadians(t[a]),n[a+1]=o.toRadians(t[a+1]),n[a+2]=t[a+2];return i.fromRadiansArrayHeights(n,r,e)},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;o>a;a+=3){var s=t[a],u=t[a+1],l=t[a+2];n[a/3]=i.fromRadians(s,u,l,e,n[a/3])}return n},i.ZERO=n(new i(0,0,0)),i.UNIT_X=n(new i(1,0,0)),i.UNIT_Y=n(new i(0,1,0)),i.UNIT_Z=n(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,r){return i.equalsEpsilon(this,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,r,e,n,o){"use strict";var i=function(r,e,n){this.longitude=t(r,0),this.latitude=t(e,0),this.height=t(n,0)};return i.fromRadians=function(e,n,o,a){return o=t(o,0),r(a)?(a.longitude=e,a.latitude=n,a.height=o,a):new i(e,n,o)},i.fromDegrees=function(t,r,e,n){return t=o.toRadians(t),r=o.toRadians(r),i.fromRadians(t,r,e,n)},i.clone=function(t,e){return r(t)?r(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new i(t.longitude,t.latitude,t.height):void 0},i.equals=function(t,e){return t===e||r(t)&&r(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},i.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},i.ZERO=n(new i(0,0,0)),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,r){return i.equalsEpsilon(this,t,r)},i.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},i}),define("Core/defineProperties",["./defined"],function(t){"use strict";var r=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),e=Object.defineProperties;return r&&t(e)||(e=function(t){return t}),e}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,r,e,n,o,i,a,s){"use strict";function u(r,n,o,i){n=e(n,0),o=e(o,0),i=e(i,0),r._radii=new t(n,o,i),r._radiiSquared=new t(n*n,o*o,i*i),r._radiiToTheFourth=new t(n*n*n*n,o*o*o*o,i*i*i*i),r._oneOverRadii=new t(0===n?0:1/n,0===o?0:1/o,0===i?0:1/i),r._oneOverRadiiSquared=new t(0===n?0:1/(n*n),0===o?0:1/(o*o),0===i?0:1/(i*i)),r._minimumRadius=Math.min(n,o,i),r._maximumRadius=Math.max(n,o,i),r._centerToleranceSquared=s.EPSILON1}var l=function(t,r,e){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,u(this,t,r,e)};o(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(r,e){if(!n(r))return void 0;var o=r._radii;return n(e)?(t.clone(o,e._radii),t.clone(r._radiiSquared,e._radiiSquared),t.clone(r._radiiToTheFourth,e._radiiToTheFourth),t.clone(r._oneOverRadii,e._oneOverRadii),t.clone(r._oneOverRadiiSquared,e._oneOverRadiiSquared),e._minimumRadius=r._minimumRadius,e._maximumRadius=r._maximumRadius,e._centerToleranceSquared=r._centerToleranceSquared,e):new l(o.x,o.y,o.z)},l.fromCartesian3=function(t,r){return n(r)||(r=new l),n(t)?(u(r,t.x,t.y,t.z),r):r},l.WGS84=a(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=a(new l(1,1,1)),l.MOON=a(new l(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),l.prototype.clone=function(t){return l.clone(this,t)},l.prototype.geocentricSurfaceNormal=t.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(r,e){var o=r.longitude,i=r.latitude,a=Math.cos(i),s=a*Math.cos(o),u=a*Math.sin(o),l=Math.sin(i);return n(e)||(e=new t),e.x=s,e.y=u,e.z=l,t.normalize(e,e)},l.prototype.geodeticSurfaceNormal=function(r,e){return n(e)||(e=new t),e=t.multiplyComponents(r,this._oneOverRadiiSquared,e),t.normalize(e,e)};var c=new t,f=new t;l.prototype.cartographicToCartesian=function(r,e){var o=c,i=f;this.geodeticSurfaceNormalCartographic(r,o),t.multiplyComponents(this._radiiSquared,o,i);var a=Math.sqrt(t.dot(o,i));return t.divideByScalar(i,a,i),t.multiplyByScalar(o,r.height,o),n(e)||(e=new t),t.add(i,o,e)},l.prototype.cartographicArrayToCartesianArray=function(t,r){var e=t.length;n(r)?r.length=e:r=new Array(e);for(var o=0;e>o;o++)r[o]=this.cartographicToCartesian(t[o],r[o]);return r};var h=new t,d=new t,m=new t;l.prototype.cartesianToCartographic=function(e,o){var i=this.scaleToGeodeticSurface(e,d);if(!n(i))return void 0;var a=this.geodeticSurfaceNormal(i,h),u=t.subtract(e,i,m),l=Math.atan2(a.y,a.x),c=Math.asin(a.z),f=s.sign(t.dot(u,e))*t.magnitude(u);return n(o)?(o.longitude=l,o.latitude=c,o.height=f,o):new r(l,c,f)},l.prototype.cartesianArrayToCartographicArray=function(t,r){var e=t.length;n(r)?r.length=e:r=new Array(e);for(var o=0;e>o;++o)r[o]=this.cartesianToCartographic(t[o],r[o]);return r};var p=new t,g=new t;return l.prototype.scaleToGeodeticSurface=function(r,e){var o=r.x,i=r.y,a=r.z,u=this._oneOverRadii,l=u.x,c=u.y,f=u.z,h=o*o*l*l,d=i*i*c*c,m=a*a*f*f,y=h+d+m,E=Math.sqrt(1/y),v=t.multiplyByScalar(r,E,p);if(y<this._centerToleranceSquared)return isFinite(E)?t.clone(v,e):void 0;var C=this._oneOverRadiiSquared,S=C.x,w=C.y,M=C.z,R=g;R.x=2*v.x*S,R.y=2*v.y*w,R.z=2*v.z*M;var A,O,T,I,N,x,b,F,L,_,z,D=(1-E)*t.magnitude(r)/(.5*t.magnitude(R)),P=0;do{D-=P,T=1/(1+D*S),I=1/(1+D*w),N=1/(1+D*M),x=T*T,b=I*I,F=N*N,L=x*T,_=b*I,z=F*N,A=h*x+d*b+m*F-1,O=h*L*S+d*_*w+m*z*M;var B=-2*O;P=A/B}while(Math.abs(A)>s.EPSILON12);return n(e)?(e.x=o*T,e.y=i*I,e.z=a*N,e):new t(o*T,i*I,a*N)},l.prototype.scaleToGeocentricSurface=function(r,e){n(e)||(e=new t);var o=r.x,i=r.y,a=r.z,s=this._oneOverRadiiSquared,u=1/Math.sqrt(o*o*s.x+i*i*s.y+a*a*s.z);return t.multiplyByScalar(r,u,e)},l.prototype.transformPositionToScaledSpace=function(r,e){return n(e)||(e=new t),t.multiplyComponents(r,this._oneOverRadii,e)},l.prototype.transformPositionFromScaledSpace=function(r,e){return n(e)||(e=new t),t.multiplyComponents(r,this._radii,e)},l.prototype.equals=function(r){return this===r||n(r)&&t.equals(this._radii,r._radii)},l.prototype.toString=function(){return this._radii.toString()},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,r,e,n,o,i,a){"use strict";var s=function(t){this._ellipsoid=e(t,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return o(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.prototype.project=function(r,e){var o=this._semimajorAxis,i=r.longitude*o,a=r.latitude*o,s=r.height;return n(e)?(e.x=i,e.y=a,e.z=s,e):new t(i,a,s)},s.prototype.unproject=function(t,e){var o=this._oneOverSemimajorAxis,i=t.x*o,a=t.y*o,s=t.z;return n(e)?(e.longitude=i,e.latitude=a,e.height=s,e):new r(i,a,s)},s}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var r={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(r)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";var r=function(r,e){this.start=t(r,0),this.stop=t(e,0)};return r}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,r,e,n){"use strict";var o=function(r,e,n,o){this.x=t(r,0),this.y=t(e,0),this.z=t(n,0),this.w=t(o,0)};o.fromElements=function(t,e,n,i,a){return r(a)?(a.x=t,a.y=e,a.z=n,a.w=i,a):new o(t,e,n,i)},o.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 o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){return r(t)?r(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):void 0},o.packedLength=4,o.pack=function(r,e,n){n=t(n,0),e[n++]=r.x,e[n++]=r.y,e[n++]=r.z,e[n]=r.w},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.w=e[n],i},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,r,e){return e.x=Math.min(t.x,r.x),e.y=Math.min(t.y,r.y),e.z=Math.min(t.z,r.z),e.w=Math.min(t.w,r.w),e},o.maximumByComponent=function(t,r,e){return e.x=Math.max(t.x,r.x),e.y=Math.max(t.y,r.y),e.z=Math.max(t.z,r.z),e.w=Math.max(t.w,r.w),e},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,r){return o.subtract(t,r,i),o.magnitude(i)},o.normalize=function(t,r){var e=o.magnitude(t);return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r.w=t.w/e,r},o.dot=function(t,r){return t.x*r.x+t.y*r.y+t.z*r.z+t.w*r.w},o.multiplyComponents=function(t,r,e){return e.x=t.x*r.x,e.y=t.y*r.y,e.z=t.z*r.z,e.w=t.w*r.w,e},o.add=function(t,r,e){return e.x=t.x+r.x,e.y=t.y+r.y,e.z=t.z+r.z,e.w=t.w+r.w,e},o.subtract=function(t,r,e){return e.x=t.x-r.x,e.y=t.y-r.y,e.z=t.z-r.z,e.w=t.w-r.w,e},o.multiplyByScalar=function(t,r,e){return e.x=t.x*r,e.y=t.y*r,e.z=t.z*r,e.w=t.w*r,e},o.divideByScalar=function(t,r,e){return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e.w=t.w/r,e},o.negate=function(t,r){return r.x=-t.x,r.y=-t.y,r.z=-t.z,r.w=-t.w,r},o.abs=function(t,r){return r.x=Math.abs(t.x),r.y=Math.abs(t.y),r.z=Math.abs(t.z),r.w=Math.abs(t.w),r};var a=new o;o.lerp=function(t,r,e,n){return o.multiplyByScalar(r,e,a),n=o.multiplyByScalar(t,1-e,n),o.add(a,n,n)};var s=new o;return o.mostOrthogonalAxis=function(t,r){var e=o.normalize(t,s);return o.abs(e,e),r=e.x<=e.y?e.x<=e.z?e.x<=e.w?o.clone(o.UNIT_X,r):o.clone(o.UNIT_W,r):e.z<=e.w?o.clone(o.UNIT_Z,r):o.clone(o.UNIT_W,r):e.y<=e.z?e.y<=e.w?o.clone(o.UNIT_Y,r):o.clone(o.UNIT_W,r):e.z<=e.w?o.clone(o.UNIT_Z,r):o.clone(o.UNIT_W,r)},o.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},o.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.x-e.x)<=n&&Math.abs(t.y-e.y)<=n&&Math.abs(t.z-e.z)<=n&&Math.abs(t.w-e.w)<=n},o.ZERO=n(new o(0,0,0,0)),o.UNIT_X=n(new o(1,0,0,0)),o.UNIT_Y=n(new o(0,1,0,0)),o.UNIT_Z=n(new o(0,0,1,0)),o.UNIT_W=n(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,r){return o.equalsEpsilon(this,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,r,e,n,o,i){"use strict";function a(t){for(var r=0,e=0;9>e;++e){var n=t[e];r+=n*n}return Math.sqrt(r)}function s(t){for(var r=0,e=0;3>e;++e){var n=t[l.getElementIndex(d[e],h[e])];r+=2*n*n}return Math.sqrt(r)}function u(t,r){for(var e=i.EPSILON15,n=0,o=1,a=0;3>a;++a){var s=Math.abs(t[l.getElementIndex(d[a],h[a])]);s>n&&(o=a,n=s)}var u=1,c=0,f=h[o],m=d[o];if(Math.abs(t[l.getElementIndex(m,f)])>e){var p,g=t[l.getElementIndex(m,m)],y=t[l.getElementIndex(f,f)],E=t[l.getElementIndex(m,f)],v=(g-y)/2/E;p=0>v?-1/(-v+Math.sqrt(1+v*v)):1/(v+Math.sqrt(1+v*v)),u=1/Math.sqrt(1+p*p),c=p*u}return r=l.clone(l.IDENTITY,r),r[l.getElementIndex(f,f)]=r[l.getElementIndex(m,m)]=u,r[l.getElementIndex(m,f)]=c,r[l.getElementIndex(f,m)]=-c,r}var l=function(t,e,n,o,i,a,s,u,l){this[0]=r(t,0),this[1]=r(o,0),this[2]=r(s,0),this[3]=r(e,0),this[4]=r(i,0),this[5]=r(u,0),this[6]=r(n,0),this[7]=r(a,0),this[8]=r(l,0)};l.clone=function(t,r){return e(t)?e(r)?(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):new l(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},l.fromArray=function(t,n,o){return n=r(n,0),e(o)||(o=new l),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},l.fromColumnMajorArray=function(t,r){return l.clone(t,r)},l.fromRowMajorArray=function(t,r){return e(r)?(r[0]=t[0],r[1]=t[3],r[2]=t[6],r[3]=t[1],r[4]=t[4],r[5]=t[7],r[6]=t[2],r[7]=t[5],r[8]=t[8],r):new l(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},l.fromQuaternion=function(t,r){var n=t.x*t.x,o=t.x*t.y,i=t.x*t.z,a=t.x*t.w,s=t.y*t.y,u=t.y*t.z,c=t.y*t.w,f=t.z*t.z,h=t.z*t.w,d=t.w*t.w,m=n-s-f+d,p=2*(o-h),g=2*(i+c),y=2*(o+h),E=-n+s-f+d,v=2*(u-a),C=2*(i-c),S=2*(u+a),w=-n-s+f+d;return e(r)?(r[0]=m,r[1]=y,r[2]=C,r[3]=p,r[4]=E,r[5]=S,r[6]=g,r[7]=v,r[8]=w,r):new l(m,p,g,y,E,v,C,S,w)},l.fromScale=function(t,r){return e(r)?(r[0]=t.x,r[1]=0,r[2]=0,r[3]=0,r[4]=t.y,r[5]=0,r[6]=0,r[7]=0,r[8]=t.z,r):new l(t.x,0,0,0,t.y,0,0,0,t.z)},l.fromUniformScale=function(t,r){return e(r)?(r[0]=t,r[1]=0,r[2]=0,r[3]=0,r[4]=t,r[5]=0,r[6]=0,r[7]=0,r[8]=t,r):new l(t,0,0,0,t,0,0,0,t)},l.fromCrossProduct=function(t,r){return e(r)?(r[0]=0,r[1]=t.z,r[2]=-t.y,r[3]=-t.z,r[4]=0,r[5]=t.x,r[6]=t.y,r[7]=-t.x,r[8]=0,r):new l(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},l.fromRotationX=function(t,r){var n=Math.cos(t),o=Math.sin(t);return e(r)?(r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=n,r[5]=o,r[6]=0,r[7]=-o,r[8]=n,r):new l(1,0,0,0,n,-o,0,o,n)},l.fromRotationY=function(t,r){var n=Math.cos(t),o=Math.sin(t);return e(r)?(r[0]=n,r[1]=0,r[2]=-o,r[3]=0,r[4]=1,r[5]=0,r[6]=o,r[7]=0,r[8]=n,r):new l(n,0,o,0,1,0,-o,0,n)},l.fromRotationZ=function(t,r){var n=Math.cos(t),o=Math.sin(t);return e(r)?(r[0]=n,r[1]=o,r[2]=0,r[3]=-o,r[4]=n,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r):new l(n,-o,0,o,n,0,0,0,1)},l.toArray=function(t,r){return e(r)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},l.getElementIndex=function(t,r){return 3*t+r},l.getColumn=function(t,r,e){var n=3*r,o=t[n],i=t[n+1],a=t[n+2];return e.x=o,e.y=i,e.z=a,e},l.setColumn=function(t,r,e,n){n=l.clone(t,n);var o=3*r;return n[o]=e.x,n[o+1]=e.y,n[o+2]=e.z,n},l.getRow=function(t,r,e){var n=t[r],o=t[r+3],i=t[r+6];return e.x=n,e.y=o,e.z=i,e},l.setRow=function(t,r,e,n){return n=l.clone(t,n),n[r]=e.x,n[r+3]=e.y,n[r+6]=e.z,n};var c=new t;l.getScale=function(r,e){return e.x=t.magnitude(t.fromElements(r[0],r[1],r[2],c)),e.y=t.magnitude(t.fromElements(r[3],r[4],r[5],c)),e.z=t.magnitude(t.fromElements(r[6],r[7],r[8],c)),e};var f=new t;l.getMaximumScale=function(r){return l.getScale(r,f),t.maximumComponent(f)},l.multiply=function(t,r,e){var n=t[0]*r[0]+t[3]*r[1]+t[6]*r[2],o=t[1]*r[0]+t[4]*r[1]+t[7]*r[2],i=t[2]*r[0]+t[5]*r[1]+t[8]*r[2],a=t[0]*r[3]+t[3]*r[4]+t[6]*r[5],s=t[1]*r[3]+t[4]*r[4]+t[7]*r[5],u=t[2]*r[3]+t[5]*r[4]+t[8]*r[5],l=t[0]*r[6]+t[3]*r[7]+t[6]*r[8],c=t[1]*r[6]+t[4]*r[7]+t[7]*r[8],f=t[2]*r[6]+t[5]*r[7]+t[8]*r[8];return e[0]=n,e[1]=o,e[2]=i,e[3]=a,e[4]=s,e[5]=u,e[6]=l,e[7]=c,e[8]=f,e},l.add=function(t,r,e){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},l.subtract=function(t,r,e){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e},l.multiplyByVector=function(t,r,e){var n=r.x,o=r.y,i=r.z,a=t[0]*n+t[3]*o+t[6]*i,s=t[1]*n+t[4]*o+t[7]*i,u=t[2]*n+t[5]*o+t[8]*i;return e.x=a,e.y=s,e.z=u,e},l.multiplyByScalar=function(t,r,e){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e},l.negate=function(t,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},l.transpose=function(t,r){var e=t[0],n=t[3],o=t[6],i=t[1],a=t[4],s=t[7],u=t[2],l=t[5],c=t[8];return r[0]=e,r[1]=n,r[2]=o,r[3]=i,r[4]=a,r[5]=s,r[6]=u,r[7]=l,r[8]=c,r};var h=[1,0,0],d=[2,2,1],m=new l,p=new l;return l.computeEigenDecomposition=function(t,r){var n=i.EPSILON20,o=10,c=0,f=0;e(r)||(r={});for(var h=r.unitary=l.clone(l.IDENTITY,r.unitary),d=r.diagonal=l.clone(t,r.diagonal),g=n*a(d);o>f&&s(d)>g;)u(d,m),l.transpose(m,p),l.multiply(d,m,d),l.multiply(p,d,d),l.multiply(h,m,h),++c>2&&(++f,c=0);return r},l.abs=function(t,r){return r[0]=Math.abs(t[0]),r[1]=Math.abs(t[1]),r[2]=Math.abs(t[2]),r[3]=Math.abs(t[3]),r[4]=Math.abs(t[4]),r[5]=Math.abs(t[5]),r[6]=Math.abs(t[6]),r[7]=Math.abs(t[7]),r[8]=Math.abs(t[8]),r},l.determinant=function(t){var r=t[0],e=t[3],n=t[6],o=t[1],i=t[4],a=t[7],s=t[2],u=t[5],l=t[8];return r*(i*l-u*a)+o*(u*n-e*l)+s*(e*a-i*n)},l.inverse=function(t,r){var e=t[0],o=t[1],a=t[2],s=t[3],u=t[4],c=t[5],f=t[6],h=t[7],d=t[8],m=l.determinant(t);if(Math.abs(m)<=i.EPSILON15)throw new n("matrix is not invertible");r[0]=u*d-h*c,r[1]=h*a-o*d,r[2]=o*c-u*a,r[3]=f*c-s*d,r[4]=e*d-f*a,r[5]=s*a-e*c,r[6]=s*h-f*u,r[7]=f*o-e*h,r[8]=e*u-s*o;var p=1/m;return l.multiplyByScalar(r,p,r)},l.equals=function(t,r){return t===r||e(t)&&e(r)&&t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]&&t[3]===r[3]&&t[4]===r[4]&&t[5]===r[5]&&t[6]===r[6]&&t[7]===r[7]&&t[8]===r[8]},l.equalsEpsilon=function(t,r,n){return t===r||e(t)&&e(r)&&Math.abs(t[0]-r[0])<=n&&Math.abs(t[1]-r[1])<=n&&Math.abs(t[2]-r[2])<=n&&Math.abs(t[3]-r[3])<=n&&Math.abs(t[4]-r[4])<=n&&Math.abs(t[5]-r[5])<=n&&Math.abs(t[6]-r[6])<=n&&Math.abs(t[7]-r[7])<=n&&Math.abs(t[8]-r[8])<=n},l.IDENTITY=o(new l(1,0,0,0,1,0,0,0,1)),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,l.prototype.clone=function(t){return l.clone(this,t)},l.prototype.equals=function(t){return l.equals(this,t)},l.prototype.equalsEpsilon=function(t,r){return l.equalsEpsilon(this,t,r)},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}),define("Core/RuntimeError",["./defined"],function(t){"use strict";var r=function(t){this.name="RuntimeError",this.message=t;var r;try{throw new Error}catch(e){r=e.stack}this.stack=r};return r.prototype.toString=function(){var r=this.name+": "+this.message;return t(this.stack)&&(r+="\n"+this.stack.toString()),r},r}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,r,e,n,o,i,a,s,u){"use strict";var l=function(t,r,n,o,i,a,s,u,l,c,f,h,d,m,p,g){this[0]=e(t,0),this[1]=e(i,0),this[2]=e(l,0),this[3]=e(d,0),this[4]=e(r,0),this[5]=e(a,0),this[6]=e(c,0),this[7]=e(m,0),this[8]=e(n,0),this[9]=e(s,0),this[10]=e(f,0),this[11]=e(p,0),this[12]=e(o,0),this[13]=e(u,0),this[14]=e(h,0),this[15]=e(g,0)};l.packedLength=16,l.pack=function(t,r,n){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[n++]=t[9],r[n++]=t[10],r[n++]=t[11],r[n++]=t[12],r[n++]=t[13],r[n++]=t[14],r[n]=t[15]},l.unpack=function(t,r,o){return r=e(r,0),n(o)||(o=new l),o[0]=t[r++],o[1]=t[r++],o[2]=t[r++],o[3]=t[r++],o[4]=t[r++],o[5]=t[r++],o[6]=t[r++],o[7]=t[r++],o[8]=t[r++],o[9]=t[r++],o[10]=t[r++],o[11]=t[r++],o[12]=t[r++],o[13]=t[r++],o[14]=t[r++],o[15]=t[r],o},l.clone=function(t,r){return n(t)?n(r)?(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]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r):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]):void 0},l.fromArray=l.unpack,l.fromColumnMajorArray=function(t,r){return l.clone(t,r)},l.fromRowMajorArray=function(t,r){return n(r)?(r[0]=t[0],r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=t[1],r[5]=t[5],r[6]=t[9],r[7]=t[13],r[8]=t[2],r[9]=t[6],r[10]=t[10],r[11]=t[14],r[12]=t[3],r[13]=t[7],r[14]=t[11],r[15]=t[15],r):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(r,o,i){return o=e(o,t.ZERO),n(i)?(i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=0,i[4]=r[3],i[5]=r[4],i[6]=r[5],i[7]=0,i[8]=r[6],i[9]=r[7],i[10]=r[8],i[11]=0,i[12]=o.x,i[13]=o.y,i[14]=o.z,i[15]=1,i):new l(r[0],r[3],r[6],o.x,r[1],r[4],r[7],o.y,r[2],r[5],r[8],o.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(t,r,e,o){n(o)||(o=new l);var i=e.x,a=e.y,s=e.z,u=r.x*r.x,c=r.x*r.y,f=r.x*r.z,h=r.x*r.w,d=r.y*r.y,m=r.y*r.z,p=r.y*r.w,g=r.z*r.z,y=r.z*r.w,E=r.w*r.w,v=u-d-g+E,C=2*(c-y),S=2*(f+p),w=2*(c+y),M=-u+d-g+E,R=2*(m-h),A=2*(f-p),O=2*(m+h),T=-u-d+g+E;return o[0]=v*i,o[1]=w*i,o[2]=A*i,o[3]=0,o[4]=C*a,o[5]=M*a,o[6]=O*a,o[7]=0,o[8]=S*s,o[9]=R*s,o[10]=T*s,o[11]=0,o[12]=t.x,o[13]=t.y,o[14]=t.z,o[15]=1,o},l.fromTranslation=function(t,r){return l.fromRotationTranslation(s.IDENTITY,t,r)},l.fromScale=function(t,r){return n(r)?(r[0]=t.x,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t.y,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=t.z,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r):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,r){return n(r)?(r[0]=t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=t,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r):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,h=new t;l.fromCamera=function(r,e){var o=r.eye,i=r.target,a=r.up;t.normalize(t.subtract(i,o,c),c),t.normalize(t.cross(c,a,f),f),t.normalize(t.cross(f,c,h),h);var s=f.x,u=f.y,d=f.z,m=c.x,p=c.y,g=c.z,y=h.x,E=h.y,v=h.z,C=o.x,S=o.y,w=o.z,M=s*-C+u*-S+d*-w,R=y*-C+E*-S+v*-w,A=m*C+p*S+g*w;return n(e)?(e[0]=s,e[1]=y,e[2]=-m,e[3]=0,e[4]=u,e[5]=E,e[6]=-p,e[7]=0,e[8]=d,e[9]=v,e[10]=-g,e[11]=0,e[12]=M,e[13]=R,e[14]=A,e[15]=1,e):new l(s,u,d,M,y,E,v,R,-m,-p,-g,A,0,0,0,1)},l.computePerspectiveFieldOfView=function(t,r,e,n,o){var i=Math.tan(.5*t),a=1/i,s=a/r,u=(n+e)/(e-n),l=2*n*e/(e-n);return o[0]=s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=u,o[11]=-1,o[12]=0,o[13]=0,o[14]=l,o[15]=0,o},l.computeOrthographicOffCenter=function(t,r,e,n,o,i,a){var s=1/(r-t),u=1/(n-e),l=1/(i-o),c=-(r+t)*s,f=-(n+e)*u,h=-(i+o)*l;return s*=2,u*=2,l*=-2,a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=l,a[11]=0,a[12]=c,a[13]=f,a[14]=h,a[15]=1,a},l.computePerspectiveOffCenter=function(t,r,e,n,o,i,a){var s=2*o/(r-t),u=2*o/(n-e),l=(r+t)/(r-t),c=(n+e)/(n-e),f=-(i+o)/(i-o),h=-1,d=-2*i*o/(i-o);return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=l,a[9]=c,a[10]=f,a[11]=h,a[12]=0,a[13]=0,a[14]=d,a[15]=0,a},l.computeInfinitePerspectiveOffCenter=function(t,r,e,n,o,i){var a=2*o/(r-t),s=2*o/(n-e),u=(r+t)/(r-t),l=(n+e)/(n-e),c=-1,f=-1,h=-2*o;return i[0]=a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=u,i[9]=l,i[10]=c,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},l.computeViewportTransformation=function(t,r,n,o){t=e(t,e.EMPTY_OBJECT);var i=e(t.x,0),a=e(t.y,0),s=e(t.width,0),u=e(t.height,0);r=e(r,0),n=e(n,1);var l=.5*s,c=.5*u,f=.5*(n-r),h=l,d=c,m=f,p=i+l,g=a+c,y=r+f,E=1;return o[0]=h,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=d,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=m,o[11]=0,o[12]=p,o[13]=g,o[14]=y,o[15]=E,o},l.toArray=function(t,r){return n(r)?(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]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r):[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,r){return 4*t+r},l.getColumn=function(t,r,e){var n=4*r,o=t[n],i=t[n+1],a=t[n+2],s=t[n+3];return e.x=o,e.y=i,e.z=a,e.w=s,e},l.setColumn=function(t,r,e,n){n=l.clone(t,n);var o=4*r;return n[o]=e.x,n[o+1]=e.y,n[o+2]=e.z,n[o+3]=e.w,n},l.getRow=function(t,r,e){var n=t[r],o=t[r+4],i=t[r+8],a=t[r+12];return e.x=n,e.y=o,e.z=i,e.w=a,e},l.setRow=function(t,r,e,n){return n=l.clone(t,n),n[r]=e.x,n[r+4]=e.y,n[r+8]=e.z,n[r+12]=e.w,n -};var d=new t;l.getScale=function(r,e){return e.x=t.magnitude(t.fromElements(r[0],r[1],r[2],d)),e.y=t.magnitude(t.fromElements(r[4],r[5],r[6],d)),e.z=t.magnitude(t.fromElements(r[8],r[9],r[10],d)),e};var m=new t;l.getMaximumScale=function(r){return l.getScale(r,m),t.maximumComponent(m)},l.multiply=function(t,r,e){var n=t[0],o=t[1],i=t[2],a=t[3],s=t[4],u=t[5],l=t[6],c=t[7],f=t[8],h=t[9],d=t[10],m=t[11],p=t[12],g=t[13],y=t[14],E=t[15],v=r[0],C=r[1],S=r[2],w=r[3],M=r[4],R=r[5],A=r[6],O=r[7],T=r[8],I=r[9],N=r[10],x=r[11],b=r[12],F=r[13],L=r[14],_=r[15],z=n*v+s*C+f*S+p*w,D=o*v+u*C+h*S+g*w,P=i*v+l*C+d*S+y*w,B=a*v+c*C+m*S+E*w,U=n*M+s*R+f*A+p*O,q=o*M+u*R+h*A+g*O,G=i*M+l*R+d*A+y*O,W=a*M+c*R+m*A+E*O,Y=n*T+s*I+f*N+p*x,H=o*T+u*I+h*N+g*x,V=i*T+l*I+d*N+y*x,K=a*T+c*I+m*N+E*x,k=n*b+s*F+f*L+p*_,j=o*b+u*F+h*L+g*_,Z=i*b+l*F+d*L+y*_,Q=a*b+c*F+m*L+E*_;return e[0]=z,e[1]=D,e[2]=P,e[3]=B,e[4]=U,e[5]=q,e[6]=G,e[7]=W,e[8]=Y,e[9]=H,e[10]=V,e[11]=K,e[12]=k,e[13]=j,e[14]=Z,e[15]=Q,e},l.add=function(t,r,e){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e},l.subtract=function(t,r,e){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e},l.multiplyTransformation=function(t,r,e){var n=t[0],o=t[1],i=t[2],a=t[4],s=t[5],u=t[6],l=t[8],c=t[9],f=t[10],h=t[12],d=t[13],m=t[14],p=r[0],g=r[1],y=r[2],E=r[4],v=r[5],C=r[6],S=r[8],w=r[9],M=r[10],R=r[12],A=r[13],O=r[14],T=n*p+a*g+l*y,I=o*p+s*g+c*y,N=i*p+u*g+f*y,x=n*E+a*v+l*C,b=o*E+s*v+c*C,F=i*E+u*v+f*C,L=n*S+a*w+l*M,_=o*S+s*w+c*M,z=i*S+u*w+f*M,D=n*R+a*A+l*O+h,P=o*R+s*A+c*O+d,B=i*R+u*A+f*O+m;return e[0]=T,e[1]=I,e[2]=N,e[3]=0,e[4]=x,e[5]=b,e[6]=F,e[7]=0,e[8]=L,e[9]=_,e[10]=z,e[11]=0,e[12]=D,e[13]=P,e[14]=B,e[15]=1,e},l.multiplyByTranslation=function(t,r,e){var n=r.x,o=r.y,i=r.z,a=n*t[0]+o*t[4]+i*t[8]+t[12],s=n*t[1]+o*t[5]+i*t[9]+t[13],u=n*t[2]+o*t[6]+i*t[10]+t[14];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]=a,e[13]=s,e[14]=u,e[15]=t[15],e};var p=new t;l.multiplyByUniformScale=function(t,r,e){return p.x=r,p.y=r,p.z=r,l.multiplyByScale(t,p,e)},l.multiplyByScale=function(t,r,e){var n=r.x,o=r.y,i=r.z;return 1===n&&1===o&&1===i?l.clone(t,e):(e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=0,e[4]=o*t[4],e[5]=o*t[5],e[6]=o*t[6],e[7]=0,e[8]=i*t[8],e[9]=i*t[9],e[10]=i*t[10],e[11]=0,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=1,e)},l.multiplyByVector=function(t,r,e){var n=r.x,o=r.y,i=r.z,a=r.w,s=t[0]*n+t[4]*o+t[8]*i+t[12]*a,u=t[1]*n+t[5]*o+t[9]*i+t[13]*a,l=t[2]*n+t[6]*o+t[10]*i+t[14]*a,c=t[3]*n+t[7]*o+t[11]*i+t[15]*a;return e.x=s,e.y=u,e.z=l,e.w=c,e},l.multiplyByPointAsVector=function(t,r,e){var n=r.x,o=r.y,i=r.z,a=t[0]*n+t[4]*o+t[8]*i,s=t[1]*n+t[5]*o+t[9]*i,u=t[2]*n+t[6]*o+t[10]*i;return e.x=a,e.y=s,e.z=u,e},l.multiplyByPoint=function(t,r,e){var n=r.x,o=r.y,i=r.z,a=t[0]*n+t[4]*o+t[8]*i+t[12],s=t[1]*n+t[5]*o+t[9]*i+t[13],u=t[2]*n+t[6]*o+t[10]*i+t[14];return e.x=a,e.y=s,e.z=u,e},l.multiplyByScalar=function(t,r,e){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e},l.negate=function(t,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]=-t[12],r[13]=-t[13],r[14]=-t[14],r[15]=-t[15],r},l.transpose=function(t,r){var e=t[1],n=t[2],o=t[3],i=t[6],a=t[7],s=t[11];return r[0]=t[0],r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=e,r[5]=t[5],r[6]=t[9],r[7]=t[13],r[8]=n,r[9]=i,r[10]=t[10],r[11]=t[14],r[12]=o,r[13]=a,r[14]=s,r[15]=t[15],r},l.abs=function(t,r){return r[0]=Math.abs(t[0]),r[1]=Math.abs(t[1]),r[2]=Math.abs(t[2]),r[3]=Math.abs(t[3]),r[4]=Math.abs(t[4]),r[5]=Math.abs(t[5]),r[6]=Math.abs(t[6]),r[7]=Math.abs(t[7]),r[8]=Math.abs(t[8]),r[9]=Math.abs(t[9]),r[10]=Math.abs(t[10]),r[11]=Math.abs(t[11]),r[12]=Math.abs(t[12]),r[13]=Math.abs(t[13]),r[14]=Math.abs(t[14]),r[15]=Math.abs(t[15]),r},l.equals=function(t,r){return t===r||n(t)&&n(r)&&t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]&&t[3]===r[3]&&t[4]===r[4]&&t[5]===r[5]&&t[6]===r[6]&&t[7]===r[7]&&t[8]===r[8]&&t[9]===r[9]&&t[10]===r[10]&&t[11]===r[11]&&t[12]===r[12]&&t[13]===r[13]&&t[14]===r[14]&&t[15]===r[15]},l.equalsEpsilon=function(t,r,e){return t===r||n(t)&&n(r)&&Math.abs(t[0]-r[0])<=e&&Math.abs(t[1]-r[1])<=e&&Math.abs(t[2]-r[2])<=e&&Math.abs(t[3]-r[3])<=e&&Math.abs(t[4]-r[4])<=e&&Math.abs(t[5]-r[5])<=e&&Math.abs(t[6]-r[6])<=e&&Math.abs(t[7]-r[7])<=e&&Math.abs(t[8]-r[8])<=e&&Math.abs(t[9]-r[9])<=e&&Math.abs(t[10]-r[10])<=e&&Math.abs(t[11]-r[11])<=e&&Math.abs(t[12]-r[12])<=e&&Math.abs(t[13]-r[13])<=e&&Math.abs(t[14]-r[14])<=e&&Math.abs(t[15]-r[15])<=e},l.getTranslation=function(t,r){return r.x=t[12],r.y=t[13],r.z=t[14],r},l.getRotation=function(t,r){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[4],r[4]=t[5],r[5]=t[6],r[6]=t[8],r[7]=t[9],r[8]=t[10],r};var g=new s,y=new s,E=new r,v=new r(0,0,0,1);return l.inverse=function(t,e){if(s.equalsEpsilon(l.getRotation(t,g),y,a.EPSILON7)&&r.equals(l.getRow(t,3,E),v))return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=0,e[11]=0,e[12]=-t[12],e[13]=-t[13],e[14]=-t[14],e[15]=1,e;var n=t[0],o=t[4],i=t[8],c=t[12],f=t[1],h=t[5],d=t[9],m=t[13],p=t[2],C=t[6],S=t[10],w=t[14],M=t[3],R=t[7],A=t[11],O=t[15],T=S*O,I=w*A,N=C*O,x=w*R,b=C*A,F=S*R,L=p*O,_=w*M,z=p*A,D=S*M,P=p*R,B=C*M,U=T*h+x*d+b*m-(I*h+N*d+F*m),q=I*f+L*d+D*m-(T*f+_*d+z*m),G=N*f+_*h+P*m-(x*f+L*h+B*m),W=F*f+z*h+B*d-(b*f+D*h+P*d),Y=I*o+N*i+F*c-(T*o+x*i+b*c),H=T*n+_*i+z*c-(I*n+L*i+D*c),V=x*n+L*o+B*c-(N*n+_*o+P*c),K=b*n+D*o+P*i-(F*n+z*o+B*i);T=i*m,I=c*d,N=o*m,x=c*h,b=o*d,F=i*h,L=n*m,_=c*f,z=n*d,D=i*f,P=n*h,B=o*f;var k=T*R+x*A+b*O-(I*R+N*A+F*O),j=I*M+L*A+D*O-(T*M+_*A+z*O),Z=N*M+_*R+P*O-(x*M+L*R+B*O),Q=F*M+z*R+B*A-(b*M+D*R+P*A),X=N*S+F*w+I*C-(b*w+T*C+x*S),J=z*w+T*p+_*S-(L*S+D*w+I*p),$=L*C+B*w+x*p-(P*w+N*p+_*C),tr=P*S+b*p+D*C-(z*C+B*S+F*p),rr=n*U+o*q+i*G+c*W;if(Math.abs(rr)<a.EPSILON20)throw new u("matrix is not invertible because its determinate is zero.");return rr=1/rr,e[0]=U*rr,e[1]=q*rr,e[2]=G*rr,e[3]=W*rr,e[4]=Y*rr,e[5]=H*rr,e[6]=V*rr,e[7]=K*rr,e[8]=k*rr,e[9]=j*rr,e[10]=Z*rr,e[11]=Q*rr,e[12]=X*rr,e[13]=J*rr,e[14]=$*rr,e[15]=tr*rr,e},l.inverseTransformation=function(t,r){var e=t[0],n=t[1],o=t[2],i=t[4],a=t[5],s=t[6],u=t[8],l=t[9],c=t[10],f=t[12],h=t[13],d=t[14],m=-e*f-n*h-o*d,p=-i*f-a*h-s*d,g=-u*f-l*h-c*d;return r[0]=e,r[1]=i,r[2]=u,r[3]=0,r[4]=n,r[5]=a,r[6]=l,r[7]=0,r[8]=o,r[9]=s,r[10]=c,r[11]=0,r[12]=m,r[13]=p,r[14]=g,r[15]=1,r},l.IDENTITY=i(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,l.prototype.clone=function(t){return l.clone(this,t)},l.prototype.equals=function(t){return l.equals(this,t)},l.prototype.equalsEpsilon=function(t,r){return l.equalsEpsilon(this,t,r)},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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,r,e,n,o,i,a){"use strict";var s=function(t,e,n,o){this.west=r(t,0),this.south=r(e,0),this.east=r(n,0),this.north=r(o,0)};s.fromDegrees=function(t,n,o,i,u){return t=a.toRadians(r(t,0)),n=a.toRadians(r(n,0)),o=a.toRadians(r(o,0)),i=a.toRadians(r(i,0)),e(u)?(u.west=t,u.south=n,u.east=o,u.north=i,u):new s(t,n,o,i)},s.fromCartographicArray=function(t,r){for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,a=-Number.MAX_VALUE,u=0,l=t.length;l>u;u++){var c=t[u];n=Math.min(n,c.longitude),o=Math.max(o,c.longitude),i=Math.min(i,c.latitude),a=Math.max(a,c.latitude)}return e(r)?(r.west=n,r.south=i,r.east=o,r.north=a,r):new s(n,i,o,a)},s.packedLength=4,s.pack=function(t,e,n){n=r(n,0),e[n++]=t.west,e[n++]=t.south,e[n++]=t.east,e[n]=t.north},s.unpack=function(t,n,o){return n=r(n,0),e(o)||(o=new s),o.west=t[n++],o.south=t[n++],o.east=t[n++],o.north=t[n],o},s.clone=function(t,r){return e(t)?e(r)?(r.west=t.west,r.south=t.south,r.east=t.east,r.north=t.north,r):new s(t.west,t.south,t.east,t.north):void 0},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equals=function(t,r){return t===r||e(t)&&e(r)&&t.west===r.west&&t.south===r.south&&t.east===r.east&&t.north===r.north},s.prototype.equalsEpsilon=function(t,r){return e(t)&&Math.abs(this.west-t.west)<=r&&Math.abs(this.south-t.south)<=r&&Math.abs(this.east-t.east)<=r&&Math.abs(this.north-t.north)<=r},s.validate=function(){},s.southwest=function(r,n){return e(n)?(n.longitude=r.west,n.latitude=r.south,n.height=0,n):new t(r.west,r.south)},s.northwest=function(r,n){return e(n)?(n.longitude=r.west,n.latitude=r.north,n.height=0,n):new t(r.west,r.north)},s.northeast=function(r,n){return e(n)?(n.longitude=r.east,n.latitude=r.north,n.height=0,n):new t(r.east,r.north)},s.southeast=function(r,n){return e(n)?(n.longitude=r.east,n.latitude=r.south,n.height=0,n):new t(r.east,r.south)},s.center=function(r,n){var o=r.east,i=r.west,s=.5*(i+o);return i>o&&(s=a.negativePiToPi(s+a.PI)),e(n)?(n.longitude=s,n.latitude=.5*(r.south+r.north),n.height=0,n):new t(s,.5*(r.south+r.north))},s.intersectWith=function(t,r,n){var o=Math.max(t.west,r.west),i=Math.max(t.south,r.south),a=Math.min(t.east,r.east),u=Math.min(t.north,r.north);return e(n)?(n.west=o,n.south=i,n.east=a,n.north=u,n):new s(o,i,a,u)},s.contains=function(t,r){return r.longitude>=t.west&&r.longitude<=t.east&&r.latitude>=t.south&&r.latitude<=t.north},s.isEmpty=function(t){return t.west>=t.east||t.south>=t.north};var u=new t;return s.subsample=function(t,n,i,s){n=r(n,o.WGS84),i=r(i,0),e(s)||(s=[]);var l=0,c=t.north,f=t.south,h=t.east,d=t.west,m=u;m.height=i,m.longitude=d,m.latitude=c,s[l]=n.cartographicToCartesian(m,s[l]),l++,m.longitude=h,s[l]=n.cartographicToCartesian(m,s[l]),l++,m.latitude=f,s[l]=n.cartographicToCartesian(m,s[l]),l++,m.longitude=d,s[l]=n.cartographicToCartesian(m,s[l]),l++,m.latitude=0>c?c:f>0?f:0;for(var p=1;8>p;++p){var g=-Math.PI+p*a.PI_OVER_TWO;g>d&&h>g&&(m.longitude=g,s[l]=n.cartographicToCartesian(m,s[l]),l++)}return 0===m.latitude&&(m.longitude=d,s[l]=n.cartographicToCartesian(m,s[l]),l++,m.longitude=h,s[l]=n.cartographicToCartesian(m,s[l]),l++),s.length=l,s},s.MAX_VALUE=i(new s(-Math.PI,-a.PI_OVER_TWO,Math.PI,a.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(t,r,e,n,o,i,a,s,u,l,c){"use strict";var f=function(r,n){this.center=t.clone(e(r,t.ZERO)),this.radius=e(n,0)},h=new t,d=new t,m=new t,p=new t,g=new t,y=new t,E=new t,v=new t,C=new t,S=new t,w=new t,M=new t;f.fromPoints=function(r,e){if(n(e)||(e=new f),!n(r)||0===r.length)return e.center=t.clone(t.ZERO,e.center),e.radius=0,e;for(var o=t.clone(r[0],E),i=t.clone(o,h),a=t.clone(o,d),s=t.clone(o,m),u=t.clone(o,p),l=t.clone(o,g),c=t.clone(o,y),R=r.length,A=1;R>A;A++){t.clone(r[A],o);var O=o.x,T=o.y,I=o.z;O<i.x&&t.clone(o,i),O>u.x&&t.clone(o,u),T<a.y&&t.clone(o,a),T>l.y&&t.clone(o,l),I<s.z&&t.clone(o,s),I>c.z&&t.clone(o,c)}var N=t.magnitudeSquared(t.subtract(u,i,v)),x=t.magnitudeSquared(t.subtract(l,a,v)),b=t.magnitudeSquared(t.subtract(c,s,v)),F=i,L=u,_=N;x>_&&(_=x,F=a,L=l),b>_&&(_=b,F=s,L=c);var z=C;z.x=.5*(F.x+L.x),z.y=.5*(F.y+L.y),z.z=.5*(F.z+L.z);var D=t.magnitudeSquared(t.subtract(L,z,v)),P=Math.sqrt(D),B=S;B.x=i.x,B.y=a.y,B.z=s.z;var U=w;U.x=u.x,U.y=l.y,U.z=c.z;var q=t.multiplyByScalar(t.add(B,U,v),.5,M),G=0;for(A=0;R>A;A++){t.clone(r[A],o);var W=t.magnitude(t.subtract(o,q,v));W>G&&(G=W);var Y=t.magnitudeSquared(t.subtract(o,z,v));if(Y>D){var H=Math.sqrt(Y);P=.5*(P+H),D=P*P;var V=H-P;z.x=(P*z.x+V*o.x)/H,z.y=(P*z.y+V*o.y)/H,z.z=(P*z.z+V*o.z)/H}}return G>P?(t.clone(z,e.center),e.radius=P):(t.clone(q,e.center),e.radius=G),e};var R=new a,A=new t,O=new t,T=new r,I=new r;f.fromRectangle2D=function(t,r,e){return f.fromRectangleWithHeights2D(t,r,0,0,e)},f.fromRectangleWithHeights2D=function(r,o,i,a,s){if(n(s)||(s=new f),!n(r))return s.center=t.clone(t.ZERO,s.center),s.radius=0,s;o=e(o,R),c.southwest(r,T),T.height=i,c.northeast(r,I),I.height=a;var u=o.project(T,A),l=o.project(I,O),h=l.x-u.x,d=l.y-u.y,m=l.z-u.z;s.radius=.5*Math.sqrt(h*h+d*d+m*m);var p=s.center;return p.x=u.x+.5*h,p.y=u.y+.5*d,p.z=u.z+.5*m,s};var N=[];f.fromRectangle3D=function(t,r,o,a){r=e(r,i.WGS84),o=e(o,0);var s;return n(t)&&(s=c.subsample(t,r,o,N)),f.fromPoints(s,a)},f.fromVertices=function(r,o,i,a){if(n(a)||(a=new f),!n(r)||0===r.length)return a.center=t.clone(t.ZERO,a.center),a.radius=0,a;o=e(o,t.ZERO),i=e(i,3);var s=E;s.x=r[0]+o.x,s.y=r[1]+o.y,s.z=r[2]+o.z;for(var u=t.clone(s,h),l=t.clone(s,d),c=t.clone(s,m),R=t.clone(s,p),A=t.clone(s,g),O=t.clone(s,y),T=r.length,I=0;T>I;I+=i){var N=r[I]+o.x,x=r[I+1]+o.y,b=r[I+2]+o.z;s.x=N,s.y=x,s.z=b,N<u.x&&t.clone(s,u),N>R.x&&t.clone(s,R),x<l.y&&t.clone(s,l),x>A.y&&t.clone(s,A),b<c.z&&t.clone(s,c),b>O.z&&t.clone(s,O)}var F=t.magnitudeSquared(t.subtract(R,u,v)),L=t.magnitudeSquared(t.subtract(A,l,v)),_=t.magnitudeSquared(t.subtract(O,c,v)),z=u,D=R,P=F;L>P&&(P=L,z=l,D=A),_>P&&(P=_,z=c,D=O);var B=C;B.x=.5*(z.x+D.x),B.y=.5*(z.y+D.y),B.z=.5*(z.z+D.z);var U=t.magnitudeSquared(t.subtract(D,B,v)),q=Math.sqrt(U),G=S;G.x=u.x,G.y=l.y,G.z=c.z;var W=w;W.x=R.x,W.y=A.y,W.z=O.z;var Y=t.multiplyByScalar(t.add(G,W,v),.5,M),H=0;for(I=0;T>I;I+=i){s.x=r[I]+o.x,s.y=r[I+1]+o.y,s.z=r[I+2]+o.z;var V=t.magnitude(t.subtract(s,Y,v));V>H&&(H=V);var K=t.magnitudeSquared(t.subtract(s,B,v));if(K>U){var k=Math.sqrt(K);q=.5*(q+k),U=q*q;var j=k-q;B.x=(q*B.x+j*s.x)/k,B.y=(q*B.y+j*s.y)/k,B.z=(q*B.z+j*s.z)/k}}return H>q?(t.clone(B,a.center),a.radius=q):(t.clone(Y,a.center),a.radius=H),a},f.fromCornerPoints=function(r,e,o){n(o)||(o=new f);var i=o.center;return t.add(r,e,i),t.multiplyByScalar(i,.5,i),o.radius=t.distance(i,e),o},f.fromEllipsoid=function(r,e){return n(e)||(e=new f),t.clone(t.ZERO,e.center),e.radius=r.maximumRadius,e},f.clone=function(r,e){return n(r)?n(e)?(e.center=t.clone(r.center,e.center),e.radius=r.radius,e):new f(r.center,r.radius):void 0},f.packedLength=4,f.pack=function(t,r,n){n=e(n,0);var o=t.center;r[n++]=o.x,r[n++]=o.y,r[n++]=o.z,r[n]=t.radius},f.unpack=function(t,r,o){r=e(r,0),n(o)||(o=new f);var i=o.center;return i.x=t[r++],i.y=t[r++],i.z=t[r++],o.radius=t[r],o};var x=new t,b=new t;f.union=function(r,e,o){n(o)||(o=new f);var i=r.center,a=e.center;t.add(i,a,b);var s=t.multiplyByScalar(b,.5,b),u=t.magnitude(t.subtract(i,s,x))+r.radius,l=t.magnitude(t.subtract(a,s,x))+e.radius;return o.radius=Math.max(u,l),t.clone(s,o.center),o};var F=new t;f.expand=function(r,e,n){n=f.clone(r,n);var o=t.magnitude(t.subtract(e,n.center,F));return o>n.radius&&(n.radius=o),n},f.intersect=function(r,e){var n=r.center,o=r.radius,i=t.dot(e,n)+e.w;return-o>i?s.OUTSIDE:o>i?s.INTERSECTING:s.INSIDE},f.transform=function(t,r,e){return n(e)||(e=new f),e.center=l.multiplyByPoint(r,t.center,e.center),e.radius=l.getMaximumScale(r)*t.radius,e};var L=new t;f.distanceSquaredTo=function(r,e){var n=t.subtract(r.center,e,L);return t.magnitudeSquared(n)-r.radius*r.radius},f.transformWithoutScale=function(t,r,e){return n(e)||(e=new f),e.center=l.multiplyByPoint(r,t.center,e.center),e.radius=t.radius,e};var _=new t;f.computePlaneDistances=function(r,e,o,i){n(i)||(i=new u);var a=t.subtract(r.center,e,_),s=t.multiplyByScalar(o,t.dot(o,a),_),l=t.magnitude(s);return i.start=l-r.radius,i.stop=l+r.radius,i};for(var z=new t,D=new t,P=new t,B=new t,U=new t,q=new r,G=new Array(8),W=0;8>W;++W)G[W]=new t;var Y=new a;return f.projectTo2D=function(r,n,o){n=e(n,Y);var i=n.ellipsoid,a=r.center,s=r.radius,u=i.geodeticSurfaceNormal(a,z),l=t.cross(t.UNIT_Z,u,D);t.normalize(l,l);var c=t.cross(u,l,P);t.normalize(c,c),t.multiplyByScalar(u,s,u),t.multiplyByScalar(c,s,c),t.multiplyByScalar(l,s,l);var h=t.negate(c,U),d=t.negate(l,B),m=G,p=m[0];t.add(u,c,p),t.add(p,l,p),p=m[1],t.add(u,c,p),t.add(p,d,p),p=m[2],t.add(u,h,p),t.add(p,d,p),p=m[3],t.add(u,h,p),t.add(p,l,p),t.negate(u,u),p=m[4],t.add(u,c,p),t.add(p,l,p),p=m[5],t.add(u,c,p),t.add(p,d,p),p=m[6],t.add(u,h,p),t.add(p,d,p),p=m[7],t.add(u,h,p),t.add(p,l,p);for(var g=m.length,y=0;g>y;++y){var E=m[y];t.add(a,E,E);var v=i.cartesianToCartographic(E,q);n.project(v,E)}o=f.fromPoints(m,o),a=o.center;var C=a.x,S=a.y,w=a.z;return a.x=w,a.y=C,a.z=S,o},f.equals=function(r,e){return r===e||n(r)&&n(e)&&t.equals(r.center,e.center)&&r.radius===e.radius},f.prototype.intersect=function(t){return f.intersect(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,r){"use strict";var e,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},o={};return r(o,{element:{get:function(){return o.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return o.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return o.supportsFullscreen()?null!==o.element:void 0}}}),o.supportsFullscreen=function(){if(t(e))return e;e=!1;var r=document.body;if("function"==typeof r.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",e=!0;for(var o,i=["webkit","moz","o","ms","khtml"],a=0,s=i.length;s>a;++a){var u=i[a];o=u+"RequestFullscreen","function"==typeof r[o]?(n.requestFullscreen=o,e=!0):(o=u+"RequestFullScreen","function"==typeof r[o]&&(n.requestFullscreen=o,e=!0)),o=u+"ExitFullscreen","function"==typeof document[o]?n.exitFullscreen=o:(o=u+"CancelFullScreen","function"==typeof document[o]&&(n.exitFullscreen=o)),o=u+"FullscreenEnabled",t(document[o])?n.fullscreenEnabled=o:(o=u+"FullScreenEnabled",t(document[o])&&(n.fullscreenEnabled=o)),o=u+"FullscreenElement",t(document[o])?n.fullscreenElement=o:(o=u+"FullScreenElement",t(document[o])&&(n.fullscreenElement=o)),o=u+"fullscreenchange",t(document["on"+o])&&("ms"===u&&(o="MSFullscreenChange"),n.fullscreenchange=o),o=u+"fullscreenerror",t(document["on"+o])&&("ms"===u&&(o="MSFullscreenError"),n.fullscreenerror=o)}return e},o.requestFullscreen=function(t){o.supportsFullscreen()&&t[n.requestFullscreen]()},o.exitFullscreen=function(){o.supportsFullscreen()&&document[n.exitFullscreen]()},o}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,r,e){"use strict";function n(t){for(var r=t.split("."),e=0,n=r.length;n>e;++e)r[e]=parseInt(r[e],10);return r}function o(){if(!r(m)){m=!1;var t=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(m=!0,p=n(t[1]))}return m}function i(){return o()&&p}function a(){if(!r(g)&&(g=!1,!o()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(g=!0,y=n(t[1]))}return g}function s(){return a()&&y}function u(){if(!r(E)){E=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==t&&(E=!0,v=n(t[1]),v.isNightly=!!t[2])}return E}function l(){return u()&&v}function c(){if(!r(C)){C=!1;var t;"Microsoft Internet Explorer"===navigator.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(C=!0,S=n(t[1]))):"Netscape"===navigator.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(C=!0,S=n(t[1])))}return C}function f(){return c()&&S}function h(){if(!r(w)){w=!1;var t=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(w=!0,M=n(t[1]))}return w}function d(){return h()&&M}var m,p,g,y,E,v,C,S,w,M,R={isChrome:o,chromeVersion:i,isSafari:a,safariVersion:s,isWebkit:u,webkitVersion:l,isInternetExplorer:c,internetExplorerVersion:f,isFirefox:h,firefoxVersion:d,hardwareConcurrency:t(navigator.hardwareConcurrency,3)};return R.supportsFullscreen=function(){return e.supportsFullscreen()},R.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},R.supportsWebWorkers=function(){return"undefined"!=typeof Worker},R}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(t,r,e,n,o,i){"use strict";function a(t,r,e){return 0>e&&(e+=1),e>1&&(e-=1),1>6*e?t+6*(r-t)*e:1>2*e?r:2>3*e?t+6*(r-t)*(2/3-e):t}var s=function(r,e,n,o){this.red=t(r,1),this.green=t(e,1),this.blue=t(n,1),this.alpha=t(o,1)};s.fromCartesian4=function(t,e){return r(e)?(e.red=t.x,e.green=t.y,e.blue=t.z,e.alpha=t.w,e):new s(t.x,t.y,t.z,t.w)},s.fromBytes=function(r,e,n,o){return r=s.byteToFloat(t(r,255)),e=s.byteToFloat(t(e,255)),n=s.byteToFloat(t(n,255)),o=s.byteToFloat(t(o,255)),new s(r,e,n,o)};var u,l,c;n.supportsTypedArrays()&&(u=new ArrayBuffer(4),l=new Uint32Array(u),c=new Uint8Array(u)),s.fromRgba=function(t){return l[0]=t,s.fromBytes(c[0],c[1],c[2],c[3])},s.fromHsl=function(r,e,n,o){r=t(r,0)%1,e=t(e,0),n=t(n,0),o=t(o,1);var i=n,u=n,l=n;if(0!==e){var c;c=.5>n?n*(1+e):n+e-n*e;var f=2*n-c;i=a(f,c,r+1/3),u=a(f,c,r),l=a(f,c,r-1/3)}return new s(i,u,l,o)},s.fromRandom=function(e,n){e=t(e,t.EMPTY_OBJECT);var o=e.red;if(!r(o)){var a=t(e.minimumRed,0),u=t(e.maximumRed,1);o=a+i.nextRandomNumber()*(u-a)}var l=e.green;if(!r(l)){var c=t(e.minimumGreen,0),f=t(e.maximumGreen,1);l=c+i.nextRandomNumber()*(f-c)}var h=e.blue;if(!r(h)){var d=t(e.minimumBlue,0),m=t(e.maximumBlue,1);h=d+i.nextRandomNumber()*(m-d)}var p=e.alpha;if(!r(p)){var g=t(e.minimumAlpha,0),y=t(e.maximumAlpha,1);p=g+i.nextRandomNumber()*(y-g)}return r(n)?(n.red=o,n.green=l,n.blue=h,n.alpha=p,n):new s(o,l,h,p)};var f=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,h=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,d=/^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(e){var n=s[e.toUpperCase()];if(r(n))return s.clone(n);var o=f.exec(e);return null!==o?new s(parseInt(o[1],16)/15,parseInt(o[2],16)/15,parseInt(o[3],16)/15):(o=h.exec(e),null!==o?new s(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255):(o=d.exec(e),null!==o?new s(parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),parseFloat(t(o[4],"1.0"))):(o=m.exec(e),null!==o?s.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(t(o[4],"1.0"))):void 0)))},s.packedLength=4,s.pack=function(r,e,n){n=t(n,0),e[n++]=r.red,e[n++]=r.green,e[n++]=r.blue,e[n]=r.alpha},s.unpack=function(e,n,o){return n=t(n,0),r(o)||(o=new s),o.red=e[n++],o.green=e[n++],o.blue=e[n++],o.alpha=e[n],o},s.byteToFloat=function(t){return t/255},s.floatToByte=function(t){return 1===t?255:0|256*t},s.clone=function(t,e){return r(t)?r(e)?(e.red=t.red,e.green=t.green,e.blue=t.blue,e.alpha=t.alpha,e):new s(t.red,t.green,t.blue,t.alpha):void 0},s.equals=function(t,e){return t===e||r(t)&&r(e)&&t.red===e.red&&t.green===e.green&&t.blue===e.blue&&t.alpha===e.alpha},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.prototype.equalsEpsilon=function(t,e){return this===t||r(t)&&Math.abs(this.red-t.red)<=e&&Math.abs(this.green-t.green)<=e&&Math.abs(this.blue-t.blue)<=e&&Math.abs(this.alpha-t.alpha)<=e},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var t=s.floatToByte(this.red),r=s.floatToByte(this.green),e=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+t+","+r+","+e+")":"rgba("+t+","+r+","+e+","+this.alpha+")"},s.prototype.toBytes=function(t){var e=s.floatToByte(this.red),n=s.floatToByte(this.green),o=s.floatToByte(this.blue),i=s.floatToByte(this.alpha);return r(t)?(t[0]=e,t[1]=n,t[2]=o,t[3]=i,t):[e,n,o,i]},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),l[0]},s.prototype.brighten=function(t,r){return t=1-t,r.red=1-(1-this.red)*t,r.green=1-(1-this.green)*t,r.blue=1-(1-this.blue)*t,r.alpha=this.alpha,r},s.prototype.darken=function(t,r){return t=1-t,r.red=this.red*t,r.green=this.green*t,r.blue=this.blue*t,r.alpha=this.alpha,r},s.ALICEBLUE=o(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=o(s.fromCssColorString("#FAEBD7")),s.AQUA=o(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=o(s.fromCssColorString("#7FFFD4")),s.AZURE=o(s.fromCssColorString("#F0FFFF")),s.BEIGE=o(s.fromCssColorString("#F5F5DC")),s.BISQUE=o(s.fromCssColorString("#FFE4C4")),s.BLACK=o(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=o(s.fromCssColorString("#FFEBCD")),s.BLUE=o(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=o(s.fromCssColorString("#8A2BE2")),s.BROWN=o(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=o(s.fromCssColorString("#DEB887")),s.CADETBLUE=o(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=o(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=o(s.fromCssColorString("#D2691E")),s.CORAL=o(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=o(s.fromCssColorString("#6495ED")),s.CORNSILK=o(s.fromCssColorString("#FFF8DC")),s.CRIMSON=o(s.fromCssColorString("#DC143C")),s.CYAN=o(s.fromCssColorString("#00FFFF")),s.DARKBLUE=o(s.fromCssColorString("#00008B")),s.DARKCYAN=o(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=o(s.fromCssColorString("#B8860B")),s.DARKGRAY=o(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=o(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=o(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=o(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=o(s.fromCssColorString("#556B2F")),s.DARKORANGE=o(s.fromCssColorString("#FF8C00")),s.DARKORCHID=o(s.fromCssColorString("#9932CC")),s.DARKRED=o(s.fromCssColorString("#8B0000")),s.DARKSALMON=o(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=o(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=o(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=o(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=o(s.fromCssColorString("#00CED1")),s.DARKVIOLET=o(s.fromCssColorString("#9400D3")),s.DEEPPINK=o(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=o(s.fromCssColorString("#00BFFF")),s.DIMGRAY=o(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=o(s.fromCssColorString("#1E90FF")),s.FIREBRICK=o(s.fromCssColorString("#B22222")),s.FLORALWHITE=o(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=o(s.fromCssColorString("#228B22")),s.FUSCHIA=o(s.fromCssColorString("#FF00FF")),s.GAINSBORO=o(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=o(s.fromCssColorString("#F8F8FF")),s.GOLD=o(s.fromCssColorString("#FFD700")),s.GOLDENROD=o(s.fromCssColorString("#DAA520")),s.GRAY=o(s.fromCssColorString("#808080")),s.GREEN=o(s.fromCssColorString("#008000")),s.GREENYELLOW=o(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=o(s.fromCssColorString("#F0FFF0")),s.HOTPINK=o(s.fromCssColorString("#FF69B4")),s.INDIANRED=o(s.fromCssColorString("#CD5C5C")),s.INDIGO=o(s.fromCssColorString("#4B0082")),s.IVORY=o(s.fromCssColorString("#FFFFF0")),s.KHAKI=o(s.fromCssColorString("#F0E68C")),s.LAVENDER=o(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=o(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=o(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=o(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=o(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=o(s.fromCssColorString("#F08080")),s.LIGHTCYAN=o(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=o(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=o(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=o(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=o(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=o(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=o(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=o(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=o(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=o(s.fromCssColorString("#FFFFE0")),s.LIME=o(s.fromCssColorString("#00FF00")),s.LIMEGREEN=o(s.fromCssColorString("#32CD32")),s.LINEN=o(s.fromCssColorString("#FAF0E6")),s.MAGENTA=o(s.fromCssColorString("#FF00FF")),s.MAROON=o(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=o(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=o(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=o(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=o(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=o(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=o(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=o(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=o(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=o(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=o(s.fromCssColorString("#191970")),s.MINTCREAM=o(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=o(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=o(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=o(s.fromCssColorString("#FFDEAD")),s.NAVY=o(s.fromCssColorString("#000080")),s.OLDLACE=o(s.fromCssColorString("#FDF5E6")),s.OLIVE=o(s.fromCssColorString("#808000")),s.OLIVEDRAB=o(s.fromCssColorString("#6B8E23")),s.ORANGE=o(s.fromCssColorString("#FFA500")),s.ORANGERED=o(s.fromCssColorString("#FF4500")),s.ORCHID=o(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=o(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=o(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=o(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=o(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=o(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=o(s.fromCssColorString("#FFDAB9")),s.PERU=o(s.fromCssColorString("#CD853F")),s.PINK=o(s.fromCssColorString("#FFC0CB")),s.PLUM=o(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=o(s.fromCssColorString("#B0E0E6")),s.PURPLE=o(s.fromCssColorString("#800080")),s.RED=o(s.fromCssColorString("#FF0000")),s.ROSYBROWN=o(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=o(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=o(s.fromCssColorString("#8B4513")),s.SALMON=o(s.fromCssColorString("#FA8072")),s.SANDYBROWN=o(s.fromCssColorString("#F4A460")),s.SEAGREEN=o(s.fromCssColorString("#2E8B57")),s.SEASHELL=o(s.fromCssColorString("#FFF5EE")),s.SIENNA=o(s.fromCssColorString("#A0522D")),s.SILVER=o(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=o(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=o(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=o(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=o(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=o(s.fromCssColorString("#00FF7F")),s.STEELBLUE=o(s.fromCssColorString("#4682B4")),s.TAN=o(s.fromCssColorString("#D2B48C")),s.TEAL=o(s.fromCssColorString("#008080")),s.THISTLE=o(s.fromCssColorString("#D8BFD8")),s.TOMATO=o(s.fromCssColorString("#FF6347")),s.TURQUOISE=o(s.fromCssColorString("#40E0D0")),s.VIOLET=o(s.fromCssColorString("#EE82EE")),s.WHEAT=o(s.fromCssColorString("#F5DEB3")),s.WHITE=o(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=o(s.fromCssColorString("#F5F5F5")),s.YELLOW=o(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=o(s.fromCssColorString("#9ACD32")),s -}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,r,e,n,o){"use strict";if(!n.supportsTypedArrays())return{};var i={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new e("componentDatatype is not a valid value.")}},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 Float32Array?i.FLOAT:t instanceof Float64Array?i.DOUBLE:void 0},i.validate=function(t){return r(t)&&(t===i.BYTE||t===i.UNSIGNED_BYTE||t===i.SHORT||t===i.UNSIGNED_SHORT||t===i.FLOAT||t===i.DOUBLE)},i.createTypedArray=function(t,r){switch(t){case i.BYTE:return new Int8Array(r);case i.UNSIGNED_BYTE:return new Uint8Array(r);case i.SHORT:return new Int16Array(r);case i.UNSIGNED_SHORT:return new Uint16Array(r);case i.FLOAT:return new Float32Array(r);case i.DOUBLE:return new Float64Array(r);default:throw new e("componentDatatype is not a valid value.")}},i.createArrayBufferView=function(r,n,o,a){switch(o=t(o,0),a=t(a,(n.byteLength-o)/i.getSizeInBytes(r)),r){case i.BYTE:return new Int8Array(n,o,a);case i.UNSIGNED_BYTE:return new Uint8Array(n,o,a);case i.SHORT:return new Int16Array(n,o,a);case i.UNSIGNED_SHORT:return new Uint16Array(n,o,a);case i.FLOAT:return new Float32Array(n,o,a);case i.DOUBLE:return new Float64Array(n,o,a);default:throw new e("componentDatatype is not a valid value.")}},o(i)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var r={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(r)}),define("Core/PrimitiveType",["./freezeObject"],function(t){"use strict";var r={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,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,r,e,n,o){"use strict";var i=function(r){r=t(r,t.EMPTY_OBJECT),this.attributes=r.attributes,this.indices=r.indices,this.primitiveType=t(r.primitiveType,o.TRIANGLES),this.boundingSphere=r.boundingSphere,this.geometryType=t(r.geometryType,n.NONE)};return i.computeNumberOfVertices=function(t){var n=-1;for(var o in t.attributes)if(t.attributes.hasOwnProperty(o)&&r(t.attributes[o])&&r(t.attributes[o].values)){var i=t.attributes[o],a=i.values.length/i.componentsPerAttribute;if(n!==a&&-1!==n)throw new e("All attribute lists must have the same number of attributes.");n=a}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t){"use strict";var r=function(r){r=t(r,t.EMPTY_OBJECT),this.componentDatatype=r.componentDatatype,this.componentsPerAttribute=r.componentsPerAttribute,this.normalize=t(r.normalize,!1),this.values=r.values};return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";var r=function(r){r=t(r,t.EMPTY_OBJECT),this.position=r.position,this.normal=r.normal,this.st=r.st,this.binormal=r.binormal,this.tangent=r.tangent,this.color=r.color};return r}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math"],function(t,r,e,n){"use strict";var o={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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(r){return t(r)&&(r===o.UNSIGNED_BYTE||r===o.UNSIGNED_SHORT||r===o.UNSIGNED_INT)},o.createTypedArray=function(t,r){return t>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(r):new Uint16Array(r)},o.createTypedArrayFromArrayBuffer=function(t,r,e,o){return t>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(r,e,o):new Uint16Array(r,e,o)},e(o)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(t,r,e,n,o,i,a,s){"use strict";function u(t){var r=t._uSquared,e=t._ellipsoid.maximumRadius,n=t._ellipsoid.minimumRadius,o=(e-n)/e,i=Math.cos(t._startHeading),a=Math.sin(t._startHeading),s=(1-o)*Math.tan(t._start.latitude),u=1/Math.sqrt(1+s*s),l=u*s,c=Math.atan2(s,i),f=u*a,h=f*f,d=1-h,m=Math.sqrt(d),p=r/4,g=p*p,y=g*p,E=g*g,v=1+p-3*g/4+5*y/4-175*E/64,C=1-p+15*g/8-35*y/8,S=1-3*p+35*g/4,w=1-5*p,M=v*c-C*Math.sin(2*c)*p/2-S*Math.sin(4*c)*g/16-w*Math.sin(6*c)*y/48-5*Math.sin(8*c)*E/512,R=t._constants;R.a=e,R.b=n,R.f=o,R.cosineHeading=i,R.sineHeading=a,R.tanU=s,R.cosineU=u,R.sineU=l,R.sigma=c,R.sineAlpha=f,R.sineSquaredAlpha=h,R.cosineSquaredAlpha=d,R.cosineAlpha=m,R.u2Over4=p,R.u4Over16=g,R.u6Over64=y,R.u8Over256=E,R.a0=v,R.a1=C,R.a2=S,R.a3=w,R.distanceRatio=M}function l(t,r){return t*r*(4+t*(4-3*r))/16}function c(t,r,e,n,o,i,a){var s=l(t,e);return(1-s)*t*r*(n+s*o*(a+s*i*(2*a*a-1)))}function f(t,r,e,n,o,i,a){var u,l,f,h,d,m=(r-e)/r,p=i-n,g=Math.atan((1-m)*Math.tan(o)),y=Math.atan((1-m)*Math.tan(a)),E=Math.cos(g),v=Math.sin(g),C=Math.cos(y),S=Math.sin(y),w=E*C,M=E*S,R=v*S,A=v*C,O=p,T=s.TWO_PI,I=Math.cos(O),N=Math.sin(O);do{I=Math.cos(O),N=Math.sin(O);var x=M-A*I;f=Math.sqrt(C*C*N*N+x*x),l=R+w*I,u=Math.atan2(f,l);var b;0===f?(b=0,h=1):(b=w*N/f,h=1-b*b),T=O,d=l-2*R/h,isNaN(d)&&(d=0),O=p+c(m,b,h,u,f,l,d)}while(Math.abs(O-T)>s.EPSILON12);var F=h*(r*r-e*e)/(e*e),L=1+F*(4096+F*(F*(320-175*F)-768))/16384,_=F*(256+F*(F*(74-47*F)-128))/1024,z=d*d,D=_*f*(d+_*(l*(2*z-1)-_*d*(4*f*f-3)*(4*z-3)/6)/4),P=e*L*(u-D),B=Math.atan2(C*N,M-A*I),U=Math.atan2(E*N,M*I-A);t._distance=P,t._startHeading=B,t._endHeading=U,t._uSquared=F}function h(e,n,o,i){t.normalize(i.cartographicToCartesian(n,m),d),t.normalize(i.cartographicToCartesian(o,m),m),f(e,i.maximumRadius,i.minimumRadius,n.longitude,n.latitude,o.longitude,o.latitude),n.height=0,o.height=0,e._start=r.clone(n,e._start),e._end=r.clone(o,e._end),u(e)}var d=new t,m=new t,p=function(t,o,i){var s=e(i,a.WGS84);this._ellipsoid=s,this._start=new r,this._end=new r,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,n(t)&&n(o)&&h(this,t,o,s)};return o(p.prototype,{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(t,r){h(this,t,r,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(t,r){return this.interpolateUsingSurfaceDistance(this._distance*t,r)},p.prototype.interpolateUsingSurfaceDistance=function(t,e){var o=this._constants,i=o.distanceRatio+t/o.b,a=Math.cos(2*i),s=Math.cos(4*i),u=Math.cos(6*i),l=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),m=i*i,p=i*m,g=o.u8Over256,y=o.u2Over4,E=o.u6Over64,v=o.u4Over16,C=2*p*g*a/3+i*(1-y+7*v/4-15*E/4+579*g/64-(v-15*E/4+187*g/16)*a-(5*E/4-115*g/16)*s-29*g*u/16)+(y/2-v+71*E/32-85*g/16)*l+(5*v/16-5*E/4+383*g/96)*f-m*((E-11*g/2)*l+5*g*f/2)+(29*E/96-29*g/16)*h+539*g*d/1536,S=Math.asin(Math.sin(C)*o.cosineAlpha),w=Math.atan(o.a/o.b*Math.tan(S));C-=o.sigma;var M=Math.cos(2*o.sigma+C),R=Math.sin(C),A=Math.cos(C),O=o.cosineU*A,T=o.sineU*R,I=Math.atan2(R*o.sineHeading,O-T*o.cosineHeading),N=I-c(o.f,o.sineAlpha,o.cosineSquaredAlpha,C,R,A,M);return n(e)?(e.longitude=this._start.longitude+N,e.latitude=w,e.height=0,e):new r(this._start.longitude+N,w,0)},p}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(t,r){"use strict";function e(t,e,n){var o=t+e;return r.sign(t)!==r.sign(e)&&Math.abs(o/Math.max(Math.abs(t),Math.abs(e)))<n?0:o}var n={};return n.computeDiscriminant=function(t,r,e){var n=r*r-4*t*e;return n},n.computeRealRoots=function(t,n,o){var i;if(0===t)return 0===n?[]:[-o/n];if(0===n){if(0===o)return[0,0];var a=Math.abs(o),s=Math.abs(t);if(s>a&&a/s<r.EPSILON14)return[0,0];if(a>s&&s/a<r.EPSILON14)return[];if(i=-o/t,0>i)return[];var u=Math.sqrt(i);return[-u,u]}if(0===o)return i=-n/t,0>i?[i,0]:[0,i];var l=n*n,c=4*t*o,f=e(l,-c,r.EPSILON14);if(0>f)return[];var h=-.5*e(n,r.sign(n)*Math.sqrt(f),r.EPSILON14);return n>0?[h/t,o/h]:[o/h,h/t]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(t,r){"use strict";function e(t,r,e,n){var o,i,a=t,s=r/3,u=e/3,l=n,c=a*u,f=s*l,h=s*s,d=u*u,m=a*u-h,p=a*l-s*u,g=s*l-d,y=4*m*g-p*p;if(0>y){var E,v,C;h*f>=c*d?(E=a,v=m,C=-2*s*m+a*p):(E=l,v=g,C=-l*p+2*u*g);var S=0>C?-1:1,w=-S*Math.abs(E)*Math.sqrt(-y);i=-C+w;var M=i/2,R=0>M?-Math.pow(-M,1/3):Math.pow(M,1/3),A=i===w?-R:-v/R;return o=0>=v?R+A:-C/(R*R+A*A+v),h*f>=c*d?[(o-s)/a]:[-l/(o+u)]}var O=m,T=-2*s*m+a*p,I=g,N=-l*p+2*u*g,x=Math.sqrt(y),b=Math.sqrt(3)/2,F=Math.abs(Math.atan2(a*x,-T)/3);o=2*Math.sqrt(-O);var L=Math.cos(F);i=o*L;var _=o*(-L/2-b*Math.sin(F)),z=i+_>2*s?i-s:_-s,D=a,P=z/D;F=Math.abs(Math.atan2(l*x,-N)/3),o=2*Math.sqrt(-I),L=Math.cos(F),i=o*L,_=o*(-L/2-b*Math.sin(F));var B=-l,U=2*u>i+_?i+u:_+u,q=B/U,G=D*U,W=-z*U-D*B,Y=z*B,H=(u*W-s*Y)/(-s*W+u*G);return H>=P?q>=P?q>=H?[P,H,q]:[P,q,H]:[q,P,H]:q>=P?[H,P,q]:q>=H?[H,q,P]:[q,H,P]}var n={};return n.computeDiscriminant=function(t,r,e,n){var o=t*t,i=r*r,a=e*e,s=n*n,u=18*t*r*e*n+i*a-27*o*s-4*(t*a*e+i*r*n);return u},n.computeRealRoots=function(t,n,o,i){var a,s;if(0===t)return r.computeRealRoots(n,o,i);if(0===n){if(0===o){if(0===i)return[0,0,0];s=-i/t;var u=0>s?-Math.pow(-s,1/3):Math.pow(s,1/3);return[u,u,u]}return 0===i?(a=r.computeRealRoots(t,0,o),0===a.Length?[0]:[a[0],0,a[1]]):e(t,0,o,i)}return 0===o?0===i?(s=-n/t,0>s?[s,0,0]:[0,0,s]):e(t,n,0,i):0===i?(a=r.computeRealRoots(t,n,o),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]]):e(t,n,o,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(t,r,e,n){"use strict";function o(r,o,i,a){var s=r*r,u=o-3*s/8,l=i-o*r/2+s*r/8,c=a-i*r/4+o*s/16-3*s*s/256,f=t.computeRealRoots(1,2*u,u*u-4*c,-l*l);if(f.length>0){var h=-r/4,d=f[f.length-1];if(Math.abs(d)<e.EPSILON14){var m=n.computeRealRoots(1,u,c);if(2===m.length){var p,g=m[0],y=m[1];if(g>=0&&y>=0){var E=Math.sqrt(g),v=Math.sqrt(y);return[h-v,h-E,h+E,h+v]}if(g>=0&&0>y)return p=Math.sqrt(g),[h-p,h+p];if(0>g&&y>=0)return p=Math.sqrt(y),[h-p,h+p]}return[]}if(d>0){var C=Math.sqrt(d),S=(u+d-l/C)/2,w=(u+d+l/C)/2,M=n.computeRealRoots(1,C,S),R=n.computeRealRoots(1,-C,w);return 0!==M.length?(M[0]+=h,M[1]+=h,0!==R.length?(R[0]+=h,R[1]+=h,M[1]<=R[0]?[M[0],M[1],R[0],R[1]]:R[1]<=M[0]?[R[0],R[1],M[0],M[1]]:M[0]>=R[0]&&M[1]<=R[1]?[R[0],M[0],M[1],R[1]]:R[0]>=M[0]&&R[1]<=M[1]?[M[0],R[0],R[1],M[1]]:M[0]>R[0]&&M[0]<R[1]?[R[0],M[0],R[1],M[1]]:[M[0],R[0],M[1],R[1]]):M):0!==R.length?(R[0]+=h,R[1]+=h,R):[]}}return[]}function i(r,o,i,a){var s=i*i,u=o*o,l=r*r,c=-2*o,f=i*r+u-4*a,h=l*a-i*o*r+s,d=t.computeRealRoots(1,c,f,h);if(d.length>0){var m,p,g=d[0],y=o-g,E=y*y,v=r/2,C=y/2,S=E-4*a,w=E+4*Math.abs(a),M=l-4*g,R=l+4*Math.abs(g);if(0>g||M*w>S*R){var A=Math.sqrt(M);m=A/2,p=0===A?0:(r*C-i)/A}else{var O=Math.sqrt(S);m=0===O?0:(r*C-i)/O,p=O/2}var T,I;0===v&&0===m?(T=0,I=0):e.sign(v)===e.sign(m)?(T=v+m,I=g/T):(I=v-m,T=g/I);var N,x;0===C&&0===p?(N=0,x=0):e.sign(C)===e.sign(p)?(N=C+p,x=a/N):(x=C-p,N=a/x);var b=n.computeRealRoots(1,T,N),F=n.computeRealRoots(1,I,x);if(0!==b.length)return 0!==F.length?b[1]<=F[0]?[b[0],b[1],F[0],F[1]]:F[1]<=b[0]?[F[0],F[1],b[0],b[1]]:b[0]>=F[0]&&b[1]<=F[1]?[F[0],b[0],b[1],F[1]]:F[0]>=b[0]&&F[1]<=b[1]?[b[0],F[0],F[1],b[1]]:b[0]>F[0]&&b[0]<F[1]?[F[0],b[0],F[1],b[1]]:[b[0],F[0],b[1],F[1]]:b;if(0!==F.length)return F}return[]}var a={};return a.computeDiscriminant=function(t,r,e,n,o){var i=t*t,a=i*t,s=r*r,u=s*r,l=e*e,c=l*e,f=n*n,h=f*n,d=o*o,m=d*o,p=s*l*f-4*u*h-4*t*c*f+18*t*r*e*h-27*i*f*f+256*a*m+o*(18*u*e*n-4*s*c+16*t*l*l-80*t*r*l*n-6*t*s*f+144*i*e*f)+d*(144*t*s*e-27*s*s-128*i*l-192*i*r*n);return p},a.computeRealRoots=function(r,n,a,s,u){if(Math.abs(r)<e.EPSILON15)return t.computeRealRoots(n,a,s,u);var l=n/r,c=a/r,f=s/r,h=u/r,d=0>l?1:0;switch(d+=0>c?d+1:d,d+=0>f?d+1:d,d+=0>h?d+1:d){case 0:return o(l,c,f,h);case 1:return i(l,c,f,h);case 2:return i(l,c,f,h);case 3:return o(l,c,f,h);case 4:return o(l,c,f,h);case 5:return i(l,c,f,h);case 6:return o(l,c,f,h);case 7:return o(l,c,f,h);case 8:return i(l,c,f,h);case 9:return o(l,c,f,h);case 10:return o(l,c,f,h);case 11:return i(l,c,f,h);case 12:return o(l,c,f,h);case 13:return o(l,c,f,h);case 14:return o(l,c,f,h);case 15:return o(l,c,f,h);default:return void 0}},a}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(t,r,e){"use strict";var n=function(e,n){n=t.clone(r(n,t.ZERO)),t.equals(n,t.ZERO)||t.normalize(n,n),this.origin=t.clone(r(e,t.ZERO)),this.direction=n};return n.getPoint=function(r,n,o){return e(o)||(o=new t),o=t.multiplyByScalar(r.direction,n,o),t.add(r.origin,o,o)},n}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(t,r,e,n,o,i,a,s,u,l){"use strict";function c(r,n,o,a,s){s=e(s,!1);var u,l,c,f,h,d=r.origin,m=r.direction,p=t.subtract(o,n,g),S=t.subtract(a,n,y),w=t.cross(m,S,E),M=t.dot(p,w);if(s){if(M<i.EPSILON6)return void 0;if(u=t.subtract(d,n,v),c=t.dot(u,w),0>c||c>M)return void 0;if(l=t.cross(u,p,C),f=t.dot(m,l),0>f||c+f>M)return void 0;h=t.dot(S,l)/M}else{if(Math.abs(M)<i.EPSILON6)return void 0;var R=1/M;if(u=t.subtract(d,n,v),c=t.dot(u,w)*R,0>c||c>1)return void 0;if(l=t.cross(u,p,C),f=t.dot(m,l)*R,0>f||c+f>1)return void 0;h=t.dot(S,l)*R}return h}function f(t,r,e,n){var o=r*r-4*t*e;if(0>o)return void 0;if(o>0){var i=1/(2*t),a=Math.sqrt(o),s=(-r+a)*i,u=(-r-a)*i;return u>s?(n.root0=s,n.root1=u):(n.root0=u,n.root1=s),n}var l=-r/(2*t);return 0===l?void 0:(n.root0=n.root1=l,n)}function h(r,e,o){n(o)||(o={});var i=r.origin,a=r.direction,s=e.center,u=e.radius*e.radius,l=t.subtract(i,s,E),c=t.dot(a,a),h=2*t.dot(a,l),d=t.magnitudeSquared(l)-u,m=f(c,h,d,w);return n(m)?(o.start=m.root0,o.stop=m.root1,o):void 0}function d(t,r,e){var n=t+r;return i.sign(t)!==i.sign(r)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(r)))<e?0:n}function m(r,e,n,o,l){var c,f=o*o,h=l*l,m=(r[a.COLUMN1ROW1]-r[a.COLUMN2ROW2])*h,p=l*(o*d(r[a.COLUMN1ROW0],r[a.COLUMN0ROW1],i.EPSILON15)+e.y),g=r[a.COLUMN0ROW0]*f+r[a.COLUMN2ROW2]*h+o*e.x+n,y=h*d(r[a.COLUMN2ROW1],r[a.COLUMN1ROW2],i.EPSILON15),E=l*(o*d(r[a.COLUMN2ROW0],r[a.COLUMN0ROW2])+e.z),v=[];if(0===E&&0===y){if(c=s.computeRealRoots(m,p,g),0===c.length)return v;var C=c[0],S=Math.sqrt(Math.max(1-C*C,0));if(v.push(new t(o,l*C,l*-S)),v.push(new t(o,l*C,l*S)),2===c.length){var w=c[1],M=Math.sqrt(Math.max(1-w*w,0));v.push(new t(o,l*w,l*-M)),v.push(new t(o,l*w,l*M))}return v}var R=E*E,A=y*y,O=m*m,T=E*y,I=O+A,N=2*(p*m+T),x=2*g*m+p*p-A+R,b=2*(g*p-T),F=g*g-R;if(0===I&&0===N&&0===x&&0===b)return v;c=u.computeRealRoots(I,N,x,b,F);var L=c.length;if(0===L)return v;for(var _=0;L>_;++_){var z,D=c[_],P=D*D,B=Math.max(1-P,0),U=Math.sqrt(B);z=i.sign(m)===i.sign(g)?d(m*P+g,p*D,i.EPSILON12):i.sign(g)===i.sign(p*D)?d(m*P,p*D+g,i.EPSILON12):d(m*P+p*D,g,i.EPSILON12);var q=d(y*D,E,i.EPSILON15),G=z*q;0>G?v.push(new t(o,l*D,l*U)):G>0?v.push(new t(o,l*D,l*-U)):0!==U?(v.push(new t(o,l*D,l*-U)),v.push(new t(o,l*D,l*U)),++_):v.push(new t(o,l*D,l*U))}return v}var p={};p.rayPlane=function(r,e,o){n(o)||(o=new t);var a=r.origin,s=r.direction,u=e.normal,l=t.dot(u,s);if(Math.abs(l)<i.EPSILON15)return void 0;var c=(-e.distance-t.dot(u,a))/l;return 0>c?void 0:(o=t.multiplyByScalar(s,c,o),t.add(a,o,o))};var g=new t,y=new t,E=new t,v=new t,C=new t;p.rayTriangle=function(r,e,o,i,a,s){var u=c(r,e,o,i,a);return!n(u)||0>u?void 0:(n(s)||(s=new t),t.multiplyByScalar(r.direction,u,s),t.add(r.origin,s,s))};var S=new l;p.lineSegmentTriangle=function(r,e,o,i,a,s,u){var l=S;t.clone(r,l.origin),t.subtract(e,r,l.direction),t.normalize(l.direction,l.direction);var f=c(l,o,i,a,s);return!n(f)||0>f||f>t.distance(r,e)?void 0:(n(u)||(u=new t),t.multiplyByScalar(l.direction,f,u),t.add(l.origin,u,u))};var w={root0:0,root1:0};p.raySphere=function(t,r,e){return e=h(t,r,e),!n(e)||e.stop<0?void 0:(e.start=Math.max(e.start,0),e)};var M=new l;p.lineSegmentSphere=function(r,e,o,i){var a=M;t.clone(r,a.origin);var s=t.subtract(e,r,a.direction),u=t.magnitude(s);return t.normalize(s,s),i=h(a,o,i),!n(i)||i.stop<0||i.start>u?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,u),i)};var R=new t,A=new t;p.rayEllipsoid=function(r,e){var n,o,i,a,s,u=e.oneOverRadii,l=t.multiplyComponents(u,r.origin,R),c=t.multiplyComponents(u,r.direction,A),f=t.magnitudeSquared(l),h=t.dot(l,c);if(f>1){if(h>=0)return void 0;var d=h*h;if(n=f-1,o=t.magnitudeSquared(c),i=o*n,i>d)return void 0;if(d>i){a=h*h-i,s=-h+Math.sqrt(a);var m=s/o,p=n/s;return p>m?{start:m,stop:p}:{start:p,stop:m}}var g=Math.sqrt(n/o);return{start:g,stop:g}}return 1>f?(n=f-1,o=t.magnitudeSquared(c),i=o*n,a=h*h-i,s=-h+Math.sqrt(a),{start:0,stop:s/o}):0>h?(o=t.magnitudeSquared(c),{start:0,stop:-h/o}):void 0};var O=new t,T=new t,I=new t,N=new t,x=new t,b=new a,F=new a,L=new a,_=new a,z=new a,D=new a,P=new a,B=new t,U=new t,q=new r;p.grazingAltitudeLocation=function(r,e){var o=r.origin,s=r.direction,u=e.geodeticSurfaceNormal(o);if(t.dot(s,u)>=0)return o;var l=n(this.rayEllipsoid(r,e)),c=e.transformPositionToScaledSpace(s),f=t.normalize(c,O),h=t.mostOrthogonalAxis(c,N),d=t.normalize(t.cross(h,f,T),T),p=t.normalize(t.cross(f,d,I),I),g=b;g[0]=f.x,g[1]=f.y,g[2]=f.z,g[3]=d.x,g[4]=d.y,g[5]=d.z,g[6]=p.x,g[7]=p.y,g[8]=p.z;var y=a.transpose(g,F),E=a.fromScale(e.radii,L),v=a.fromScale(e.oneOverRadii,_),C=z;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 S,w,M=a.multiply(a.multiply(y,v,D),C,D),R=a.multiply(a.multiply(M,E,P),g,P),A=a.multiplyByVector(M,o,x),G=m(R,t.negate(A,O),0,0,1),W=G.length;if(W>0){for(var Y=t.clone(t.ZERO,U),H=Number.NEGATIVE_INFINITY,V=0;W>V;++V){S=a.multiplyByVector(E,a.multiplyByVector(g,G[V],B),B);var K=t.normalize(t.subtract(S,o,N),N),k=t.dot(K,s);k>H&&(H=k,Y=t.clone(S,Y))}var j=e.cartesianToCartographic(Y,q);return H=i.clamp(H,0,1),w=t.magnitude(t.subtract(Y,o,N))*Math.sqrt(1-H*H),w=l?-w:w,j.height=w,e.cartographicToCartesian(j)}return void 0};var G=new t;return p.lineSegmentPlane=function(r,e,o,a){n(a)||(a=new t);var s=t.subtract(e,r,G),u=o.normal,l=t.dot(u,s);if(Math.abs(l)<i.EPSILON6)return void 0;var c=t.dot(u,r),f=-(o.distance+c)/l;return 0>f||f>1?void 0:(t.multiplyByScalar(s,f,a),t.add(r,a,a),a)},p.trianglePlaneIntersection=function(r,e,n,o){var i=o.normal,a=o.distance,s=t.dot(i,r)+a<0,u=t.dot(i,e)+a<0,l=t.dot(i,n)+a<0,c=0;c+=s?1:0,c+=u?1:0,c+=l?1:0;var f,h;if((1===c||2===c)&&(f=new t,h=new t),1===c){if(s)return p.lineSegmentPlane(r,e,o,f),p.lineSegmentPlane(r,n,o,h),{positions:[r,e,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(u)return p.lineSegmentPlane(e,n,o,f),p.lineSegmentPlane(e,r,o,h),{positions:[r,e,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(l)return p.lineSegmentPlane(n,r,o,f),p.lineSegmentPlane(n,e,o,h),{positions:[r,e,n,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!s)return p.lineSegmentPlane(e,r,o,f),p.lineSegmentPlane(n,r,o,h),{positions:[r,e,n,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!u)return p.lineSegmentPlane(n,e,o,f),p.lineSegmentPlane(r,e,o,h),{positions:[r,e,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!l)return p.lineSegmentPlane(r,n,o,f),p.lineSegmentPlane(e,n,o,h),{positions:[r,e,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},p}),define("Core/isArray",["./defined"],function(t){"use strict";var r=Array.isArray;return t(r)||(r=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),r}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(t,r){"use strict";var e=function(r,e){this.normal=t.clone(r),this.distance=e};return e.fromPointNormal=function(n,o,i){var a=-t.dot(o,n);return r(i)?(t.clone(o,i.normal),i.distance=a,i):new e(o,a)},e.getPointDistance=function(r,e){return t.dot(r.normal,e)+r.distance},e}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(t,r,e,n,o,i,a,s,u,l,c,f){"use strict";function h(t,r,e){var n,o=new Array(t);if(r===e){for(n=0;t>n;n++)o[n]=r;return o}var i=e-r,a=i/t;for(n=1;t>n;n++){var s=r+n*a;o[n]=s}return o[0]=r,o}function d(r,e,n,o,i,a,s,u){var l=o.scaleToGeodeticSurface(r,T),c=o.scaleToGeodeticSurface(e,I),f=m.numberOfPoints(r,e,n),d=o.cartesianToCartographic(l,R),p=o.cartesianToCartographic(c,A),g=h(f,i,a);N.setEndPoints(d,p);var y=N.surfaceDistance/f,E=u;d.height=i;var v=o.cartographicToCartesian(d,O);t.pack(v,s,E),E+=3;for(var C=1;f>C;C++){var S=N.interpolateUsingSurfaceDistance(C*y,A);S.height=g[C],v=o.cartographicToCartesian(S,O),t.pack(v,s,E),E+=3}return E}var m={};m.numberOfPoints=function(r,e,n){var o=t.angleBetween(r,e);return Math.ceil(o/n)};var p=new r;m.extractHeights=function(t,r){for(var e=t.length,n=new Array(e),o=0;e>o;o++){var i=t[o];n[o]=r.cartesianToCartographic(i,p).height}return n};var g=new c,y=new t,E=new t,v=new f(t.ZERO,0),C=new t,S=new f(t.ZERO,0),w=new t,M=new t,R=new r,A=new r,O=new t,T=new t,I=new t,N=new a;return m.wrapLongitude=function(r,o){var i=[],a=[];if(n(r)&&r.length>0){o=e(o,c.IDENTITY);var u=c.inverseTransformation(o,g),l=c.multiplyByPoint(u,t.ZERO,y),h=c.multiplyByPointAsVector(u,t.UNIT_Y,E),d=f.fromPointNormal(l,h,v),m=c.multiplyByPointAsVector(u,t.UNIT_X,C),p=f.fromPointNormal(l,m,S),R=1;i.push(t.clone(r[0]));for(var A=i[0],O=r.length,T=1;O>T;++T){var I=r[T];if(f.getPointDistance(p,A)<0||f.getPointDistance(p,I)<0){var N=s.lineSegmentPlane(A,I,d,w);if(n(N)){var x=t.multiplyByScalar(h,5e-9,M);f.getPointDistance(d,A)<0&&t.negate(x,x),i.push(t.add(N,x,new t)),a.push(R+1),t.negate(x,x),i.push(t.add(N,x,new t)),R=1}}i.push(t.clone(r[T])),R++,A=I}a.push(R)}return{positions:i,lengths:a}},m.removeDuplicates=function(r){var e=r.length;if(2>e)return void 0;var n,o,i;for(n=1;e>n&&(o=r[n-1],i=r[n],!t.equals(o,i));++n);if(n===e)return void 0;var a=[];for(a.push(r[0]);e>n;++n)o=r[n-1],i=r[n],t.equals(o,i)||a.push(t.clone(i));return a},m.generateArc=function(r){n(r)||(r={});var o,a,s,c=r.positions,f=e(r.ellipsoid,i.WGS84),h=e(r.height,0),p=e(r.granularity,l.RADIANS_PER_DEGREE),g=c.length,y=0;for(o=0;g-1>o;o++)a=c[o],s=c[o+1],y+=m.numberOfPoints(a,s,p);y++;var E=3*y,v=new Array(E),C=0;for(o=0;g-1>o;o++){a=c[o],s=c[o+1];var S,w;u(h)?(S=h[o],w=h[o+1]):(S=h,w=h),C=d(a,s,p,f,S,w,v,C)}var M=c[g-1],A=f.cartesianToCartographic(M,R);A.height=u(h)?h[g-1]:h;var T=f.cartographicToCartesian(A,O);return t.pack(T,v,E-3),v},m.generateCartesianArc=function(r){for(var e=m.generateArc(r),n=e.length/3,o=new Array(n),i=0;n>i;i++)o[i]=t.unpack(e,3*i);return o},m}),define("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(t,r,e,n,o,i,a,s,u,l,c,f,h,d,m){"use strict";function p(t,r,n,o,i,a,s){var u,l=d.numberOfPoints(t,r,i),c=n.red,f=n.green,h=n.blue,m=n.alpha,p=o.red,g=o.green,y=o.blue,E=o.alpha;if(e.equals(n,o)){for(u=0;l>u;u++)a[s++]=e.floatToByte(c),a[s++]=e.floatToByte(f),a[s++]=e.floatToByte(h),a[s++]=e.floatToByte(m);return s}var v=(p-c)/l,C=(g-f)/l,S=(y-h)/l,w=(E-m)/l,M=s;for(u=0;l>u;u++)a[M++]=e.floatToByte(c+u*v),a[M++]=e.floatToByte(f+u*C),a[M++]=e.floatToByte(h+u*S),a[M++]=e.floatToByte(m+u*w);return M}var g=function(t){t=o(t,o.EMPTY_OBJECT);var r=t.positions,e=t.colors,n=o(t.colorsPerVertex,!1);this._positions=r,this._colors=e,this._perVertex=n,this._followSurface=o(t.followSurface,!0),this._granularity=o(t.granularity,h.RADIANS_PER_DEGREE),this._ellipsoid=o(t.ellipsoid,s.WGS84),this._workerName="createSimplePolylineGeometry"},y=new Array(2),E=new Array(2);return g.createGeometry=function(o){var a,s,h,g,v,C,S,w,M,R,A=o._positions,O=o._colors,T=o._perVertex,I=o._followSurface,N=o._granularity,x=o._ellipsoid,b=i(O)&&!T,F=A.length,L=0,_=0,z=0,D=0;if(I){var P=d.extractHeights(A,x);if(b){for(a=0;F-1>a;a++)v=A[a],C=A[a+1],_+=d.numberOfPoints(v,C,N),_++;for(s=new Float64Array(3*_),g=new Uint8Array(4*_),M=0,a=0;F-1>a;a++){y[0]=A[a],y[1]=A[a+1],E[0]=P[a],E[1]=P[a+1];var B=d.generateArc({positions:y,granularity:N,ellipsoid:x,height:E});if(i(O)){var U=B.length/3;for(R=O[a],z=0;U>z;z++)g[M++]=e.floatToByte(R.red),g[M++]=e.floatToByte(R.green),g[M++]=e.floatToByte(R.blue),g[M++]=e.floatToByte(R.alpha)}s.set(B,L),L+=B.length}}else if(s=new Float64Array(d.generateArc({positions:A,granularity:N,ellipsoid:x,height:P})),i(O)){for(g=new Uint8Array(4*(s.length/3)),a=0;F-1>a;a++)v=A[a],C=A[a+1],S=O[a],w=O[a+1],L=p(v,C,S,w,N,g,L);g[L++]=e.floatToByte(w.red),g[L++]=e.floatToByte(w.green),g[L++]=e.floatToByte(w.blue),g[L++]=e.floatToByte(w.alpha)}}else for(h=b?2*A.length-2:A.length,s=new Float64Array(3*h),g=i(O)?new Uint8Array(4*h):void 0,a=0;F>a;++a){var q=A[a];if(b&&a>0&&(r.pack(q,s,D),D+=3,R=O[a-1],g[z++]=e.floatToByte(R.red),g[z++]=e.floatToByte(R.green),g[z++]=e.floatToByte(R.blue),g[z++]=e.floatToByte(R.alpha)),b&&a===F-1)break;r.pack(q,s,D),D+=3,i(O)&&(R=O[a],g[z++]=e.floatToByte(R.red),g[z++]=e.floatToByte(R.green),g[z++]=e.floatToByte(R.blue),g[z++]=e.floatToByte(R.alpha))}var G=new c;G.position=new l({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:s}),i(O)&&(G.color=new l({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),h=s.length/3;var W=2*(h-1),Y=f.createTypedArray(h,W);for(D=0,a=0;h-1>a;a++)Y[D++]=a,Y[D++]=a+1;return new u({attributes:G,indices:Y,primitiveType:m.LINES,boundingSphere:t.fromPoints(A)})},g}),define("Workers/createSimplePolylineGeometry",["../Core/Ellipsoid","../Core/SimplePolylineGeometry"],function(t,r){"use strict";function e(e){return e._ellipsoid=t.clone(e._ellipsoid),r.createGeometry(e)}return e})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==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(r){e=r.stack}this.stack=e}return 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("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:0>t?-1:0},o.signNotZero=function(t){return 0>t?-1:1},o.toSNorm=function(t){return Math.round(255*(.5*o.clamp(t,-1,1)+.5))},o.fromSNorm=function(t){return o.clamp(t,0,255)/255*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.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 o>=a||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;t>=n;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 e>t?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,o){"use strict";function a(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}a.fromSpherical=function(r,n){e(n)||(n=new a);var o=r.clock,i=r.cone,s=t(r.magnitude,1),u=s*Math.sin(i);return n.x=u*Math.cos(o),n.y=u*Math.sin(o),n.z=s*Math.cos(i),n},a.fromElements=function(t,r,n,o){return e(o)?(o.x=t,o.y=r,o.z=n,o):new a(t,r,n)},a.clone=function(t,r){return e(t)?e(r)?(r.x=t.x,r.y=t.y,r.z=t.z,r):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,r,n){n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,r){return r.x=t.x*e,r.y=t.y*e,r.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};var s=new a;a.lerp=function(t,e,r,n){return a.multiplyByScalar(e,r,s),n=a.multiplyByScalar(t,1-r,n),a.add(s,n,n)};var u=new a,E=new a;a.angleBetween=function(t,e){a.normalize(t,u),a.normalize(e,E);var r=a.dot(u,E),n=a.magnitude(a.cross(u,E,u));return Math.atan2(n,r)};var l=new a;a.mostOrthogonalAxis=function(t,e){var r=a.normalize(t,l);return a.abs(r,r),e=r.x<=r.y?r.x<=r.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):r.y<=r.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsArray=function(t,e,r){return t.x===e[r]&&t.y===e[r+1]&&t.z===e[r+2]},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)},a.cross=function(t,e,r){var n=t.x,o=t.y,a=t.z,i=e.x,s=e.y,u=e.z,E=o*u-a*s,l=a*i-n*u,c=n*s-o*i;return r.x=E,r.y=l,r.z=c,r},a.fromDegrees=function(t,e,r,n,i){var s=o.toRadians(t),u=o.toRadians(e);return a.fromRadians(s,u,r,n,i)};var c=new a,f=new a,R=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(r,n,o,i,s){o=t(o,0);var u=e(i)?i.radiiSquared:R,E=Math.cos(n);c.x=E*Math.cos(r),c.y=E*Math.sin(r),c.z=Math.sin(n),c=a.normalize(c,c),a.multiplyComponents(u,c,f);var l=Math.sqrt(a.dot(c,f));return f=a.divideByScalar(f,l,f),c=a.multiplyByScalar(c,o,c),e(s)||(s=new a),a.add(f,c,s)},a.fromDegreesArray=function(t,e,r){for(var n=new Array(t.length),i=0;i<t.length;i++)n[i]=o.toRadians(t[i]);return a.fromRadiansArray(n,e,r)},a.fromRadiansArray=function(t,r,n){var o=t.length;e(n)?n.length=o/2:n=new Array(o/2);for(var i=0;o>i;i+=2){var s=t[i],u=t[i+1];n[i/2]=a.fromRadians(s,u,0,r,n[i/2])}return n},a.fromDegreesArrayHeights=function(t,e,r){for(var n=new Array(t.length),i=0;i<t.length;i+=3)n[i]=o.toRadians(t[i]),n[i+1]=o.toRadians(t[i+1]),n[i+2]=t[i+2];return a.fromRadiansArrayHeights(n,e,r)},a.fromRadiansArrayHeights=function(t,r,n){var o=t.length;e(n)?n.length=o/3:n=new Array(o/3);for(var i=0;o>i;i+=3){var s=t[i],u=t[i+1],E=t[i+2];n[i/3]=a.fromRadians(s,u,E,r,n[i/3])}return n},a.ZERO=n(new a(0,0,0)),a.UNIT_X=n(new a(1,0,0)),a.UNIT_Y=n(new a(0,1,0)),a.UNIT_Z=n(new a(0,0,1)),a.prototype.clone=function(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+")"},a}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,r,n){"use strict";function o(r,o,s,u,E){var l=r.x,c=r.y,f=r.z,R=o.x,_=o.y,T=o.z,h=l*l*R*R,A=c*c*_*_,d=f*f*T*T,S=h+A+d,m=Math.sqrt(1/S),C=t.multiplyByScalar(r,m,a);if(u>S)return isFinite(m)?t.clone(C,E):void 0;var N=s.x,I=s.y,M=s.z,O=i;O.x=C.x*N*2,O.y=C.y*I*2,O.z=C.z*M*2;var p,g,y,F,L,v,U,D,P,B,w,x=(1-m)*t.magnitude(r)/(.5*t.magnitude(O)),G=0;do{x-=G,y=1/(1+x*N),F=1/(1+x*I),L=1/(1+x*M),v=y*y,U=F*F,D=L*L,P=v*y,B=U*F,w=D*L,p=h*v+A*U+d*D-1,g=h*P*N+A*B*I+d*w*M;var b=-2*g;G=p/b}while(Math.abs(p)>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 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 s(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)}s.fromRadians=function(t,n,o,a){return o=e(o,0),r(a)?(a.longitude=t,a.latitude=n,a.height=o,a):new s(t,n,o)},s.fromDegrees=function(t,e,r,n){return t=a.toRadians(t),e=a.toRadians(e),s.fromRadians(t,e,r,n)};var u=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),R=a.EPSILON1;return s.fromCartesian=function(e,n,o){var _=r(n)?n.oneOverRadii:c,T=r(n)?n.oneOverRadiiSquared:f,h=r(n)?n._centerToleranceSquared:R,A=i(e,_,T,h,E);if(r(A)){var d=t.multiplyComponents(e,T,u);d=t.normalize(d,d);var S=t.subtract(e,A,l),m=Math.atan2(d.y,d.x),C=Math.asin(d.z),N=a.sign(t.dot(S,e))*t.magnitude(S);return r(o)?(o.longitude=m,o.latitude=C,o.height=N,o):new s(m,C,N)}},s.clone=function(t,e){return r(t)?r(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new s(t.longitude,t.latitude,t.height):void 0},s.equals=function(t,e){return t===e||r(t)&&r(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},s.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},s.ZERO=o(new s(0,0,0)),s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.prototype.equalsEpsilon=function(t,e){return s.equalsEpsilon(this,t,e)},s.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},s}),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,s,u){"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=s.EPSILON1}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,E(this,t,e,r)}o(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 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 l(o.x,o.y,o.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(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),l.prototype.clone=function(t){return l.clone(this,t)},l.packedLength=t.packedLength,l.pack=function(e,n,o){o=r(o,0),t.pack(e._radii,n,o)},l.unpack=function(e,n,o){n=r(n,0);var a=t.unpack(e,n);return l.fromCartesian3(a,o)},l.prototype.geocentricSurfaceNormal=t.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(e,r){var o=e.longitude,a=e.latitude,i=Math.cos(a),s=i*Math.cos(o),u=i*Math.sin(o),E=Math.sin(a);return n(r)||(r=new t),r.x=s,r.y=u,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 o=c,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)},l.prototype.cartographicArrayToCartesianArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var o=0;r>o;o++)e[o]=this.cartographicToCartesian(t[o],e[o]);return e};var R=new t,_=new t,T=new t;return l.prototype.cartesianToCartographic=function(r,o){var a=this.scaleToGeodeticSurface(r,_);if(n(a)){var i=this.geodeticSurfaceNormal(a,R),u=t.subtract(r,a,T),E=Math.atan2(i.y,i.x),l=Math.asin(i.z),c=s.sign(t.dot(u,r))*t.magnitude(u);return n(o)?(o.longitude=E,o.latitude=l,o.height=c,o):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 o=0;r>o;++o)e[o]=this.cartesianToCartographic(t[o],e[o]);return e},l.prototype.scaleToGeodeticSurface=function(t,e){return u(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},l.prototype.scaleToGeocentricSurface=function(e,r){n(r)||(r=new t);var o=e.x,a=e.y,i=e.z,s=this._oneOverRadiiSquared,u=1/Math.sqrt(o*o*s.x+a*a*s.y+i*i*s.z);return t.multiplyByScalar(e,u,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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,r,n,o,a,i){"use strict";function s(t){this._ellipsoid=r(t,i.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return o(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.prototype.project=function(e,r){var o=this._semimajorAxis,a=e.longitude*o,i=e.latitude*o,s=e.height;return n(r)?(r.x=a,r.y=i,r.z=s,r):new t(a,i,s)},s.prototype.unproject=function(t,r){var o=this._oneOverSemimajorAxis,a=t.x*o,i=t.y*o,s=t.z;return n(r)?(r.longitude=a,r.latitude=i,r.height=s,r):new e(a,i,s)},s}),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","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,o,a){"use strict";function i(t,r,n,o,a,i,s,u,E){this[0]=e(t,0),this[1]=e(o,0),this[2]=e(s,0),this[3]=e(r,0),this[4]=e(a,0),this[5]=e(u,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;9>r;++r){var n=t[r];e+=n*n}return Math.sqrt(e)}function u(t){for(var e=0,r=0;3>r;++r){var n=t[i.getElementIndex(R[r],f[r])];e+=2*n*n}return Math.sqrt(e)}function E(t,e){for(var r=a.EPSILON15,n=0,o=1,s=0;3>s;++s){var u=Math.abs(t[i.getElementIndex(R[s],f[s])]);u>n&&(o=s,n=u)}var E=1,l=0,c=f[o],_=R[o];if(Math.abs(t[i.getElementIndex(_,c)])>r){var T,h=t[i.getElementIndex(_,_)],A=t[i.getElementIndex(c,c)],d=t[i.getElementIndex(_,c)],S=(h-A)/2/d;T=0>S?-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=i.clone(i.IDENTITY,e),e[i.getElementIndex(c,c)]=e[i.getElementIndex(_,_)]=E,e[i.getElementIndex(_,c)]=l,e[i.getElementIndex(c,_)]=-l,e}i.packedLength=9,i.pack=function(t,r,n){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]},i.unpack=function(t,n,o){return n=e(n,0),r(o)||(o=new i),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},i.clone=function(t,e){return r(t)?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 i(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},i.fromArray=function(t,n,o){return n=e(n,0),r(o)||(o=new i),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},i.fromColumnMajorArray=function(t,e){return i.clone(t,e)},i.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 i(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},i.fromQuaternion=function(t,e){var n=t.x*t.x,o=t.x*t.y,a=t.x*t.z,s=t.x*t.w,u=t.y*t.y,E=t.y*t.z,l=t.y*t.w,c=t.z*t.z,f=t.z*t.w,R=t.w*t.w,_=n-u-c+R,T=2*(o-f),h=2*(a+l),A=2*(o+f),d=-n+u-c+R,S=2*(E-s),m=2*(a-l),C=2*(E+s),N=-n-u+c+R;return r(e)?(e[0]=_,e[1]=A,e[2]=m,e[3]=T,e[4]=d,e[5]=C,e[6]=h,e[7]=S,e[8]=N,e):new i(_,T,h,A,d,S,m,C,N)},i.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 i(t.x,0,0,0,t.y,0,0,0,t.z)},i.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 i(t,0,0,0,t,0,0,0,t)},i.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 i(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},i.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 i(1,0,0,0,n,-o,0,o,n)},i.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 i(n,0,o,0,1,0,-o,0,n)},i.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 i(n,-o,0,o,n,0,0,0,1)},i.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]]},i.getElementIndex=function(t,e){return 3*t+e},i.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},i.setColumn=function(t,e,r,n){n=i.clone(t,n);var o=3*e;return n[o]=r.x,n[o+1]=r.y,n[o+2]=r.z,n},i.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},i.setRow=function(t,e,r,n){return n=i.clone(t,n),n[e]=r.x,n[e+3]=r.y,n[e+6]=r.z,n};var l=new t;i.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 c=new t;i.getMaximumScale=function(e){return i.getScale(e,c),t.maximumComponent(c)},i.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],s=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],u=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]=o,r[2]=a,r[3]=i,r[4]=s,r[5]=u,r[6]=E,r[7]=l,r[8]=c,r},i.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},i.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},i.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,s=t[1]*n+t[4]*o+t[7]*a,u=t[2]*n+t[5]*o+t[8]*a;return r.x=i,r.y=s,r.z=u,r},i.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},i.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},i.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},i.transpose=function(t,e){var r=t[0],n=t[3],o=t[6],a=t[1],i=t[4],s=t[7],u=t[2],E=t[5],l=t[8];return e[0]=r,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=s,e[6]=u,e[7]=E,e[8]=l,e};var f=[1,0,0],R=[2,2,1],_=new i,T=new i;return i.computeEigenDecomposition=function(t,e){var n=a.EPSILON20,o=10,l=0,c=0;r(e)||(e={});for(var f=e.unitary=i.clone(i.IDENTITY,e.unitary),R=e.diagonal=i.clone(t,e.diagonal),h=n*s(R);o>c&&u(R)>h;)E(R,_),i.transpose(_,T),i.multiply(R,_,R),i.multiply(T,R,R),i.multiply(f,_,f),++l>2&&(++c,l=0);return e},i.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},i.determinant=function(t){var e=t[0],r=t[3],n=t[6],o=t[1],a=t[4],i=t[7],s=t[2],u=t[5],E=t[8];return e*(a*E-u*i)+o*(u*n-r*E)+s*(r*i-a*n)},i.inverse=function(t,e){var r=t[0],o=t[1],s=t[2],u=t[3],E=t[4],l=t[5],c=t[6],f=t[7],R=t[8],_=i.determinant(t);if(Math.abs(_)<=a.EPSILON15)throw new n("matrix is not invertible");e[0]=E*R-f*l,e[1]=f*s-o*R,e[2]=o*l-E*s,e[3]=c*l-u*R,e[4]=r*R-c*s,e[5]=u*s-r*l,e[6]=u*f-c*E,e[7]=c*o-r*f,e[8]=r*E-u*o;var T=1/_;return i.multiplyByScalar(e,T,e)},i.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]},i.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},i.IDENTITY=o(new i(1,0,0,0,1,0,0,0,1)),i.ZERO=o(new i(0,0,0,0,0,0,0,0,0)),i.COLUMN0ROW0=0,i.COLUMN0ROW1=1,i.COLUMN0ROW2=2,i.COLUMN1ROW0=3,i.COLUMN1ROW1=4,i.COLUMN1ROW2=5,i.COLUMN2ROW0=6,i.COLUMN2ROW1=7,i.COLUMN2ROW2=8,i.prototype.clone=function(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.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]},i.prototype.equalsEpsilon=function(t,e){return i.equalsEpsilon(this,t,e)},i.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},i}),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){return e(t)?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):void 0},a.packedLength=4,a.pack=function(e,r,n){n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w},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.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.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 s=new a;a.lerp=function(t,e,r,n){return a.multiplyByScalar(e,r,s),n=a.multiplyByScalar(t,1-r,n),a.add(s,n,n)};var u=new a;return a.mostOrthogonalAxis=function(t,e){var r=a.normalize(t,u);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(r){e=r.stack}this.stack=e}return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,r,n,o,a,i,s,u){"use strict";function E(t,e,n,o,a,i,s,u,E,l,c,f,R,_,T,h){this[0]=r(t,0),this[1]=r(a,0),this[2]=r(E,0),this[3]=r(R,0),this[4]=r(e,0),this[5]=r(i,0),this[6]=r(l,0),this[7]=r(_,0),this[8]=r(n,0),this[9]=r(s,0),this[10]=r(c,0),this[11]=r(T,0),this[12]=r(o,0),this[13]=r(u,0),this[14]=r(f,0),this[15]=r(h,0)}E.packedLength=16,E.pack=function(t,e,n){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,o){return e=r(e,0),n(o)||(o=new E),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},E.clone=function(t,e){return n(t)?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 E(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]):void 0},E.fromArray=E.unpack,E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.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 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])},E.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 E(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)},E.fromTranslationQuaternionRotationScale=function(t,e,r,o){n(o)||(o=new E);var a=r.x,i=r.y,s=r.z,u=e.x*e.x,l=e.x*e.y,c=e.x*e.z,f=e.x*e.w,R=e.y*e.y,_=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=u-R-h+d,m=2*(l-A),C=2*(c+T),N=2*(l+A),I=-u+R-h+d,M=2*(_-f),O=2*(c-T),p=2*(_+f),g=-u-R+h+d;return o[0]=S*a,o[1]=N*a,o[2]=O*a,o[3]=0,o[4]=m*i,o[5]=I*i,o[6]=p*i,o[7]=0,o[8]=C*s,o[9]=M*s,o[10]=g*s,o[11]=0,o[12]=t.x,o[13]=t.y,o[14]=t.z,o[15]=1,o},E.fromTranslationRotationScale=function(t,e){return E.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},E.fromTranslation=function(t,e){return E.fromRotationTranslation(s.IDENTITY,t,e)},E.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 E(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},E.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 E(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var l=new t,c=new t,f=new t;E.fromCamera=function(e,r){var o=e.eye,a=e.target,i=e.up;t.normalize(t.subtract(a,o,l),l),t.normalize(t.cross(l,i,c),c),t.normalize(t.cross(c,l,f),f);var s=c.x,u=c.y,R=c.z,_=l.x,T=l.y,h=l.z,A=f.x,d=f.y,S=f.z,m=o.x,C=o.y,N=o.z,I=s*-m+u*-C+R*-N,M=A*-m+d*-C+S*-N,O=_*m+T*C+h*N; +return n(r)?(r[0]=s,r[1]=A,r[2]=-_,r[3]=0,r[4]=u,r[5]=d,r[6]=-T,r[7]=0,r[8]=R,r[9]=S,r[10]=-h,r[11]=0,r[12]=I,r[13]=M,r[14]=O,r[15]=1,r):new E(s,u,R,I,A,d,S,M,-_,-T,-h,O,0,0,0,1)},E.computePerspectiveFieldOfView=function(t,e,r,n,o){var a=Math.tan(.5*t),i=1/a,s=i/e,u=(n+r)/(r-n),E=2*n*r/(r-n);return o[0]=s,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]=u,o[11]=-1,o[12]=0,o[13]=0,o[14]=E,o[15]=0,o},E.computeOrthographicOffCenter=function(t,e,r,n,o,a,i){var s=1/(e-t),u=1/(n-r),E=1/(a-o),l=-(e+t)*s,c=-(n+r)*u,f=-(a+o)*E;return s*=2,u*=2,E*=-2,i[0]=s,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,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},E.computePerspectiveOffCenter=function(t,e,r,n,o,a,i){var s=2*o/(e-t),u=2*o/(n-r),E=(e+t)/(e-t),l=(n+r)/(n-r),c=-(a+o)/(a-o),f=-1,R=-2*a*o/(a-o);return i[0]=s,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]=l,i[10]=c,i[11]=f,i[12]=0,i[13]=0,i[14]=R,i[15]=0,i},E.computeInfinitePerspectiveOffCenter=function(t,e,r,n,o,a){var i=2*o/(e-t),s=2*o/(n-r),u=(e+t)/(e-t),E=(n+r)/(n-r),l=-1,c=-1,f=-2*o;return a[0]=i,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=s,a[6]=0,a[7]=0,a[8]=u,a[9]=E,a[10]=l,a[11]=c,a[12]=0,a[13]=0,a[14]=f,a[15]=0,a},E.computeViewportTransformation=function(t,e,n,o){t=r(t,r.EMPTY_OBJECT);var a=r(t.x,0),i=r(t.y,0),s=r(t.width,0),u=r(t.height,0);e=r(e,0),n=r(n,1);var E=.5*s,l=.5*u,c=.5*(n-e),f=E,R=l,_=c,T=a+E,h=i+l,A=e+c,d=1;return o[0]=f,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=R,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=_,o[11]=0,o[12]=T,o[13]=h,o[14]=A,o[15]=d,o},E.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]]},E.getElementIndex=function(t,e){return 4*t+e},E.getColumn=function(t,e,r){var n=4*e,o=t[n],a=t[n+1],i=t[n+2],s=t[n+3];return r.x=o,r.y=a,r.z=i,r.w=s,r},E.setColumn=function(t,e,r,n){n=E.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},E.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},E.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},E.setRow=function(t,e,r,n){return n=E.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;E.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 _=new t;E.getMaximumScale=function(e){return E.getScale(e,_),t.maximumComponent(_)},E.multiply=function(t,e,r){var n=t[0],o=t[1],a=t[2],i=t[3],s=t[4],u=t[5],E=t[6],l=t[7],c=t[8],f=t[9],R=t[10],_=t[11],T=t[12],h=t[13],A=t[14],d=t[15],S=e[0],m=e[1],C=e[2],N=e[3],I=e[4],M=e[5],O=e[6],p=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+s*m+c*C+T*N,w=o*S+u*m+f*C+h*N,x=a*S+E*m+R*C+A*N,G=i*S+l*m+_*C+d*N,b=n*I+s*M+c*O+T*p,z=o*I+u*M+f*O+h*p,H=a*I+E*M+R*O+A*p,V=i*I+l*M+_*O+d*p,q=n*g+s*y+c*F+T*L,X=o*g+u*y+f*F+h*L,W=a*g+E*y+R*F+A*L,Y=i*g+l*y+_*F+d*L,K=n*v+s*U+c*D+T*P,k=o*v+u*U+f*D+h*P,Z=a*v+E*U+R*D+A*P,j=i*v+l*U+_*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},E.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},E.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},E.multiplyTransformation=function(t,e,r){var n=t[0],o=t[1],a=t[2],i=t[4],s=t[5],u=t[6],E=t[8],l=t[9],c=t[10],f=t[12],R=t[13],_=t[14],T=e[0],h=e[1],A=e[2],d=e[4],S=e[5],m=e[6],C=e[8],N=e[9],I=e[10],M=e[12],O=e[13],p=e[14],g=n*T+i*h+E*A,y=o*T+s*h+l*A,F=a*T+u*h+c*A,L=n*d+i*S+E*m,v=o*d+s*S+l*m,U=a*d+u*S+c*m,D=n*C+i*N+E*I,P=o*C+s*N+l*I,B=a*C+u*N+c*I,w=n*M+i*O+E*p+f,x=o*M+s*O+l*p+R,G=a*M+u*O+c*p+_;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},E.multiplyByMatrix3=function(t,e,r){var n=t[0],o=t[1],a=t[2],i=t[4],s=t[5],u=t[6],E=t[8],l=t[9],c=t[10],f=e[0],R=e[1],_=e[2],T=e[3],h=e[4],A=e[5],d=e[6],S=e[7],m=e[8],C=n*f+i*R+E*_,N=o*f+s*R+l*_,I=a*f+u*R+c*_,M=n*T+i*h+E*A,O=o*T+s*h+l*A,p=a*T+u*h+c*A,g=n*d+i*S+E*m,y=o*d+s*S+l*m,F=a*d+u*S+c*m;return r[0]=C,r[1]=N,r[2]=I,r[3]=0,r[4]=M,r[5]=O,r[6]=p,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},E.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],s=n*t[1]+o*t[5]+a*t[9]+t[13],u=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]=s,r[14]=u,r[15]=t[15],r};var T=new t;E.multiplyByUniformScale=function(t,e,r){return T.x=e,T.y=e,T.z=e,E.multiplyByScale(t,T,r)},E.multiplyByScale=function(t,e,r){var n=e.x,o=e.y,a=e.z;return 1===n&&1===o&&1===a?E.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)},E.multiplyByVector=function(t,e,r){var n=e.x,o=e.y,a=e.z,i=e.w,s=t[0]*n+t[4]*o+t[8]*a+t[12]*i,u=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,l=t[3]*n+t[7]*o+t[11]*a+t[15]*i;return r.x=s,r.y=u,r.z=E,r.w=l,r},E.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,s=t[1]*n+t[5]*o+t[9]*a,u=t[2]*n+t[6]*o+t[10]*a;return r.x=i,r.y=s,r.z=u,r},E.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],s=t[1]*n+t[5]*o+t[9]*a+t[13],u=t[2]*n+t[6]*o+t[10]*a+t[14];return r.x=i,r.y=s,r.z=u,r},E.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},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[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},E.transpose=function(t,e){var r=t[1],n=t[2],o=t[3],a=t[6],i=t[7],s=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]=s,e[15]=t[15],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[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},E.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]},E.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},E.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},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 h=new s,A=new s,d=new e,S=new e(0,0,0,1);return E.inverse=function(t,r){if(s.equalsEpsilon(E.getRotation(t,h),A,i.EPSILON7)&&e.equals(E.getRow(t,3,d),S))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],l=t[12],c=t[1],f=t[5],R=t[9],_=t[13],T=t[2],m=t[6],C=t[10],N=t[14],I=t[3],M=t[7],O=t[11],p=t[15],g=C*p,y=N*O,F=m*p,L=N*M,v=m*O,U=C*M,D=T*p,P=N*I,B=T*O,w=C*I,x=T*M,G=m*I,b=g*f+L*R+v*_-(y*f+F*R+U*_),z=y*c+D*R+w*_-(g*c+P*R+B*_),H=F*c+P*f+x*_-(L*c+D*f+G*_),V=U*c+B*f+G*R-(v*c+w*f+x*R),q=y*o+F*a+U*l-(g*o+L*a+v*l),X=g*n+P*a+B*l-(y*n+D*a+w*l),W=L*n+D*o+G*l-(F*n+P*o+x*l),Y=v*n+w*o+x*a-(U*n+B*o+G*a);g=a*_,y=l*R,F=o*_,L=l*f,v=o*R,U=a*f,D=n*_,P=l*c,B=n*R,w=a*c,x=n*f,G=o*c;var K=g*M+L*O+v*p-(y*M+F*O+U*p),k=y*I+D*O+w*p-(g*I+P*O+B*p),Z=F*I+P*M+x*p-(L*I+D*M+G*p),j=U*I+B*M+G*O-(v*I+w*M+x*O),Q=F*C+U*N+y*m-(v*N+g*m+L*C),J=B*N+g*T+P*C-(D*C+w*N+y*T),$=D*m+G*N+L*T-(x*N+F*T+P*m),tt=x*C+v*T+w*m-(B*m+G*C+U*T),et=n*b+o*z+a*H+l*V;if(Math.abs(et)<i.EPSILON20)throw new u("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},E.inverseTransformation=function(t,e){var r=t[0],n=t[1],o=t[2],a=t[4],i=t[5],s=t[6],u=t[8],E=t[9],l=t[10],c=t[12],f=t[13],R=t[14],_=-r*c-n*f-o*R,T=-a*c-i*f-s*R,h=-u*c-E*f-l*R;return e[0]=r,e[1]=a,e[2]=u,e[3]=0,e[4]=n,e[5]=i,e[6]=E,e[7]=0,e[8]=o,e[9]=s,e[10]=l,e[11]=0,e[12]=_,e[13]=T,e[14]=h,e[15]=1,e},E.IDENTITY=a(new E(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),E.ZERO=a(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,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,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]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},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/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),s=r.w;return e(n)?(t.clone(i,n.normal),n.distance=s,n):new o(i,s)},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/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,r,n,o,a,i,s){"use strict";function u(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(u.prototype,{width:{get:function(){return u.computeWidth(this)}},height:{get:function(){return u.computeHeight(this)}}}),u.packedLength=4,u.pack=function(t,r,n){n=e(n,0),r[n++]=t.west,r[n++]=t.south,r[n++]=t.east,r[n]=t.north},u.unpack=function(t,n,o){return n=e(n,0),r(o)||(o=new u),o.west=t[n++],o.south=t[n++],o.east=t[n++],o.north=t[n],o},u.computeWidth=function(t){var e=t.east,r=t.west;return r>e&&(e+=s.TWO_PI),e-r},u.computeHeight=function(t){return t.north-t.south},u.fromDegrees=function(t,n,o,a,i){return t=s.toRadians(e(t,0)),n=s.toRadians(e(n,0)),o=s.toRadians(e(o,0)),a=s.toRadians(e(a,0)),r(i)?(i.west=t,i.south=n,i.east=o,i.north=a,i):new u(t,n,o,a)},u.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,l=-Number.MAX_VALUE,c=0,f=t.length;f>c;c++){var R=t[c];n=Math.min(n,R.longitude),o=Math.max(o,R.longitude),E=Math.min(E,R.latitude),l=Math.max(l,R.latitude);var _=R.longitude>=0?R.longitude:R.longitude+s.TWO_PI;a=Math.min(a,_),i=Math.max(i,_)}return o-n>i-a&&(n=a,o=i,o>s.PI&&(o-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(e)?(e.west=n,e.south=E,e.east=o,e.north=l,e):new u(n,E,o,l)},u.clone=function(t,e){return r(t)?r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new u(t.west,t.south,t.east,t.north):void 0},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.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},u.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},u.validate=function(t){},u.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)},u.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)},u.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)},u.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)},u.center=function(e,n){var o=e.east,a=e.west;a>o&&(o+=s.TWO_PI);var i=s.negativePiToPi(.5*(a+o)),u=.5*(e.south+e.north);return r(n)?(n.longitude=i,n.latitude=u,n.height=0,n):new t(i,u)},u.intersection=function(t,e,n){var o=t.east,a=t.west,i=e.east,E=e.west;a>o&&i>0?o+=s.TWO_PI:E>i&&o>0&&(i+=s.TWO_PI),a>o&&0>E?E+=s.TWO_PI:E>i&&0>a&&(a+=s.TWO_PI);var l=s.negativePiToPi(Math.max(a,E)),c=s.negativePiToPi(Math.min(o,i));if(!((t.west<t.east||e.west<e.east)&&l>=c)){var f=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(f>=R))return r(n)?(n.west=l,n.south=f,n.east=c,n.north=R,n):new u(l,f,c,R)}},u.union=function(t,e,n){return r(n)||(n=new u),n.west=Math.min(t.west,e.west),n.south=Math.min(t.south,e.south),n.east=Math.max(t.east,e.east),n.north=Math.max(t.north,e.north),n},u.expand=function(t,e,n){return r(n)||(n=new u),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},u.contains=function(t,e){var r=e.longitude,n=e.latitude,o=t.west,a=t.east;return o>a&&(a+=s.TWO_PI,0>r&&(r+=s.TWO_PI)),(r>o||s.equalsEpsilon(r,o,s.EPSILON14))&&(a>r||s.equalsEpsilon(r,a,s.EPSILON14))&&n>=t.south&&n<=t.north};var E=new t;return u.subsample=function(t,n,o,i){n=e(n,a.WGS84),o=e(o,0),r(i)||(i=[]);var l=0,c=t.north,f=t.south,R=t.east,_=t.west,T=E;T.height=o,T.longitude=_,T.latitude=c,i[l]=n.cartographicToCartesian(T,i[l]),l++,T.longitude=R,i[l]=n.cartographicToCartesian(T,i[l]),l++,T.latitude=f,i[l]=n.cartographicToCartesian(T,i[l]),l++,T.longitude=_,i[l]=n.cartographicToCartesian(T,i[l]),l++,0>c?T.latitude=c:f>0?T.latitude=f:T.latitude=0;for(var h=1;8>h;++h)T.longitude=-Math.PI+h*s.PI_OVER_TWO,u.contains(t,T)&&(i[l]=n.cartographicToCartesian(T,i[l]),l++);return 0===T.latitude&&(T.longitude=_,i[l]=n.cartographicToCartesian(T,i[l]),l++,T.longitude=R,i[l]=n.cartographicToCartesian(T,i[l]),l++),i.length=l,i},u.MAX_VALUE=i(new u(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Plane","./Rectangle"],function(t,e,r,n,o,a,i,s,u,E,l,c,f){"use strict";function R(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var _=new t,T=new t,h=new t,A=new t,d=new t,S=new t,m=new t,C=new t,N=new t,I=new t,M=new t,O=new t;R.fromPoints=function(e,r){if(n(r)||(r=new R),!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],m),a=t.clone(o,_),i=t.clone(o,T),s=t.clone(o,h),u=t.clone(o,A),E=t.clone(o,d),l=t.clone(o,S),c=e.length,f=1;c>f;f++){t.clone(e[f],o);var p=o.x,g=o.y,y=o.z;p<a.x&&t.clone(o,a),p>u.x&&t.clone(o,u),g<i.y&&t.clone(o,i),g>E.y&&t.clone(o,E),y<s.z&&t.clone(o,s),y>l.z&&t.clone(o,l)}var F=t.magnitudeSquared(t.subtract(u,a,C)),L=t.magnitudeSquared(t.subtract(E,i,C)),v=t.magnitudeSquared(t.subtract(l,s,C)),U=a,D=u,P=F;L>P&&(P=L,U=i,D=E),v>P&&(P=v,U=s,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,C)),x=Math.sqrt(w),G=I;G.x=a.x,G.y=i.y,G.z=s.z;var b=M;b.x=u.x,b.y=E.y,b.z=l.z;var z=t.multiplyByScalar(t.add(G,b,C),.5,O),H=0;for(f=0;c>f;f++){t.clone(e[f],o);var V=t.magnitude(t.subtract(o,z,C));V>H&&(H=V);var q=t.magnitudeSquared(t.subtract(o,B,C));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*o.x)/X,B.y=(x*B.y+W*o.y)/X,B.z=(x*B.z+W*o.z)/X}}return H>x?(t.clone(B,r.center),r.radius=x):(t.clone(z,r.center),r.radius=H),r};var p=new i,g=new t,y=new t,F=new e,L=new e;R.fromRectangle2D=function(t,e,r){return R.fromRectangleWithHeights2D(t,e,0,0,r)},R.fromRectangleWithHeights2D=function(e,o,a,i,s){if(n(s)||(s=new R),!n(e))return s.center=t.clone(t.ZERO,s.center),s.radius=0,s;o=r(o,p),f.southwest(e,F),F.height=a,f.northeast(e,L),L.height=i;var u=o.project(F,g),E=o.project(L,y),l=E.x-u.x,c=E.y-u.y,_=E.z-u.z;s.radius=.5*Math.sqrt(l*l+c*c+_*_);var T=s.center;return T.x=u.x+.5*l,T.y=u.y+.5*c,T.z=u.z+.5*_,s};var v=[];R.fromRectangle3D=function(t,e,o,i){e=r(e,a.WGS84),o=r(o,0);var s;return n(t)&&(s=f.subsample(t,e,o,v)),R.fromPoints(s,i)},R.fromVertices=function(e,o,a,i){if(n(i)||(i=new R),!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 s=m;s.x=e[0]+o.x,s.y=e[1]+o.y,s.z=e[2]+o.z;for(var u=t.clone(s,_),E=t.clone(s,T),l=t.clone(s,h),c=t.clone(s,A),f=t.clone(s,d),p=t.clone(s,S),g=e.length,y=0;g>y;y+=a){var F=e[y]+o.x,L=e[y+1]+o.y,v=e[y+2]+o.z;s.x=F,s.y=L,s.z=v,F<u.x&&t.clone(s,u),F>c.x&&t.clone(s,c),L<E.y&&t.clone(s,E),L>f.y&&t.clone(s,f),v<l.z&&t.clone(s,l),v>p.z&&t.clone(s,p)}var U=t.magnitudeSquared(t.subtract(c,u,C)),D=t.magnitudeSquared(t.subtract(f,E,C)),P=t.magnitudeSquared(t.subtract(p,l,C)),B=u,w=c,x=U;D>x&&(x=D,B=E,w=f),P>x&&(x=P,B=l,w=p);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,C)),z=Math.sqrt(b),H=I;H.x=u.x,H.y=E.y,H.z=l.z;var V=M;V.x=c.x,V.y=f.y,V.z=p.z;var q=t.multiplyByScalar(t.add(H,V,C),.5,O),X=0;for(y=0;g>y;y+=a){s.x=e[y]+o.x,s.y=e[y+1]+o.y,s.z=e[y+2]+o.z;var W=t.magnitude(t.subtract(s,q,C));W>X&&(X=W);var Y=t.magnitudeSquared(t.subtract(s,G,C));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*s.x)/K,G.y=(z*G.y+k*s.y)/K,G.z=(z*G.z+k*s.z)/K}}return X>z?(t.clone(G,i.center),i.radius=z):(t.clone(q,i.center),i.radius=X),i},R.fromEncodedCartesianVertices=function(e,r,o){if(n(o)||(o=new R),!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=m;a.x=e[0]+r[0],a.y=e[1]+r[1],a.z=e[2]+r[2];for(var i=t.clone(a,_),s=t.clone(a,T),u=t.clone(a,h),E=t.clone(a,A),l=t.clone(a,d),c=t.clone(a,S),f=e.length,p=0;f>p;p+=3){var g=e[p]+r[p],y=e[p+1]+r[p+1],F=e[p+2]+r[p+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<s.y&&t.clone(a,s),y>l.y&&t.clone(a,l),F<u.z&&t.clone(a,u),F>c.z&&t.clone(a,c)}var L=t.magnitudeSquared(t.subtract(E,i,C)),v=t.magnitudeSquared(t.subtract(l,s,C)),U=t.magnitudeSquared(t.subtract(c,u,C)),D=i,P=E,B=L;v>B&&(B=v,D=s,P=l),U>B&&(B=U,D=u,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,C)),G=Math.sqrt(x),b=I;b.x=i.x,b.y=s.y,b.z=u.z;var z=M;z.x=E.x,z.y=l.y,z.z=c.z;var H=t.multiplyByScalar(t.add(b,z,C),.5,O),V=0;for(p=0;f>p;p+=3){a.x=e[p]+r[p],a.y=e[p+1]+r[p+1],a.z=e[p+2]+r[p+2];var q=t.magnitude(t.subtract(a,H,C));q>V&&(V=q);var X=t.magnitudeSquared(t.subtract(a,w,C));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*a.x)/W,w.y=(G*w.y+Y*a.y)/W,w.z=(G*w.z+Y*a.z)/W}}return V>G?(t.clone(w,o.center),o.radius=G):(t.clone(H,o.center),o.radius=V),o},R.fromCornerPoints=function(e,r,o){n(o)||(o=new R);var a=o.center;return t.add(e,r,a),t.multiplyByScalar(a,.5,a),o.radius=t.distance(a,r),o},R.fromEllipsoid=function(e,r){return n(r)||(r=new R),t.clone(t.ZERO,r.center),r.radius=e.maximumRadius,r};var U=new t;R.fromBoundingSpheres=function(e,r){if(n(r)||(r=new R),!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 R.clone(e[0],r);if(2===o)return R.union(e[0],e[1],r);for(var a=[],i=0;o>i;i++)a.push(e[i].center);r=R.fromPoints(a,r);var s=r.center,u=r.radius;for(i=0;o>i;i++){var E=e[i];u=Math.max(u,t.distance(s,E.center,U)+E.radius)}return r.radius=u,r};var D=new t,P=new t,B=new t;R.fromOrientedBoundingBox=function(e,r){n(r)||(r=new R);var o=e.halfAxes,a=E.getColumn(o,0,D),i=E.getColumn(o,1,P),s=E.getColumn(o,2,B),u=t.magnitude(a),l=t.magnitude(i),c=t.magnitude(s);return r.center=t.clone(e.center,r.center),r.radius=Math.max(u,l,c),r},R.clone=function(e,r){return n(e)?n(r)?(r.center=t.clone(e.center,r.center),r.radius=e.radius,r):new R(e.center,e.radius):void 0},R.packedLength=4,R.pack=function(t,e,n){n=r(n,0);var o=t.center;e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n]=t.radius},R.unpack=function(t,e,o){e=r(e,0),n(o)||(o=new R);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,x=new t;R.union=function(e,r,o){n(o)||(o=new R);var a=e.center,i=e.radius,s=r.center,u=r.radius,E=t.subtract(s,a,w),l=t.magnitude(E);if(i>=l+u)return e.clone(o),o;if(u>=l+i)return r.clone(o),o;var c=.5*(i+l+u),f=t.multiplyByScalar(E,(-i+c)/l,x);return t.add(f,a,f),t.clone(f,o.center),o.radius=c,o};var G=new t;R.expand=function(e,r,n){n=R.clone(e,n);var o=t.magnitude(t.subtract(r,n.center,G));return o>n.radius&&(n.radius=o),n},R.intersectPlane=function(e,r){var n=e.center,o=e.radius,a=r.normal,i=t.dot(a,n)+r.distance;return-o>i?s.OUTSIDE:o>i?s.INTERSECTING:s.INSIDE},R.transform=function(t,e,r){return n(r)||(r=new R),r.center=l.multiplyByPoint(e,t.center,r.center),r.radius=l.getMaximumScale(e)*t.radius,r};var b=new t;R.distanceSquaredTo=function(e,r){var n=t.subtract(e.center,r,b);return t.magnitudeSquared(n)-e.radius*e.radius},R.transformWithoutScale=function(t,e,r){return n(r)||(r=new R),r.center=l.multiplyByPoint(e,t.center,r.center),r.radius=t.radius,r};var z=new t;R.computePlaneDistances=function(e,r,o,a){n(a)||(a=new u);var i=t.subtract(e.center,r,z),s=t.dot(o,i);return a.start=s-e.radius,a.stop=s+e.radius,a};for(var H=new t,V=new t,q=new t,X=new t,W=new t,Y=new e,K=new Array(8),k=0;8>k;++k)K[k]=new t;var Z=new i;return R.projectTo2D=function(e,n,o){n=r(n,Z);var a=n.ellipsoid,i=e.center,s=e.radius,u=a.geodeticSurfaceNormal(i,H),E=t.cross(t.UNIT_Z,u,V);t.normalize(E,E);var l=t.cross(u,E,q);t.normalize(l,l),t.multiplyByScalar(u,s,u),t.multiplyByScalar(l,s,l),t.multiplyByScalar(E,s,E);var c=t.negate(l,W),f=t.negate(E,X),_=K,T=_[0];t.add(u,l,T),t.add(T,E,T),T=_[1],t.add(u,l,T),t.add(T,f,T),T=_[2],t.add(u,c,T),t.add(T,f,T),T=_[3],t.add(u,c,T),t.add(T,E,T),t.negate(u,u),T=_[4],t.add(u,l,T),t.add(T,E,T),T=_[5],t.add(u,l,T),t.add(T,f,T),T=_[6],t.add(u,c,T),t.add(T,f,T),T=_[7],t.add(u,c,T),t.add(T,E,T);for(var h=_.length,A=0;h>A;++A){var d=_[A];t.add(i,d,d);var S=a.cartesianToCartographic(d,Y);n.project(S,d)}o=R.fromPoints(_,o),i=o.center;var m=i.x,C=i.y,N=i.z;return i.x=N,i.y=m,i.z=C,o},R.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},R.equals=function(e,r){return e===r||n(e)&&n(r)&&t.equals(e.center,r.center)&&e.radius===r.radius},R.prototype.intersectPlane=function(t){return R.intersectPlane(this,t)},R.prototype.distanceSquaredTo=function(t){return R.distanceSquaredTo(this,t)},R.prototype.computePlaneDistances=function(t,e,r){return R.computePlaneDistances(this,t,e,r)},R.prototype.isOccluded=function(t){return R.isOccluded(this,t)},R.prototype.equals=function(t){return R.equals(this,t)},R.prototype.clone=function(t){return R.clone(this,t)},R}),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(){return o.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return o.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return o.supportsFullscreen()?null!==o.element:void 0}}}),o.supportsFullscreen=function(){if(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,s=a.length;s>i;++i){var u=a[i];o=u+"RequestFullscreen","function"==typeof e[o]?(n.requestFullscreen=o,r=!0):(o=u+"RequestFullScreen","function"==typeof e[o]&&(n.requestFullscreen=o,r=!0)),o=u+"ExitFullscreen","function"==typeof document[o]?n.exitFullscreen=o:(o=u+"CancelFullScreen","function"==typeof document[o]&&(n.exitFullscreen=o)),o=u+"FullscreenEnabled",t(document[o])?n.fullscreenEnabled=o:(o=u+"FullScreenEnabled",t(document[o])&&(n.fullscreenEnabled=o)),o=u+"FullscreenElement",t(document[o])?n.fullscreenElement=o:(o=u+"FullScreenElement",t(document[o])&&(n.fullscreenElement=o)),o=u+"fullscreenchange",t(document["on"+o])&&("ms"===u&&(o="MSFullscreenChange"),n.fullscreenchange=o),o=u+"fullscreenerror",t(document["on"+o])&&("ms"===u&&(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;n>r;++r)e[r]=parseInt(e[r],10);return e}function o(){if(!e(S)){S=!1;var t=/ Chrome\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(S=!0,m=n(t[1]))}return S}function a(){return o()&&m}function i(){if(!e(C)&&(C=!1,!o()&&/ Safari\/[\.0-9]+/.test(d.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(C=!0,N=n(t[1]))}return C}function s(){return i()&&N}function u(){if(!e(I)){I=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(d.userAgent);null!==t&&(I=!0,M=n(t[1]),M.isNightly=!!t[2])}return I}function E(){return u()&&M}function l(){if(!e(O)){O=!1;var t;"Microsoft Internet Explorer"===d.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(d.userAgent),null!==t&&(O=!0,p=n(t[1]))):"Netscape"===d.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(d.userAgent),null!==t&&(O=!0,p=n(t[1])))}return O}function c(){return l()&&p}function f(){if(!e(g)){g=!1;var t=/Firefox\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(g=!0,y=n(t[1]))}return g}function R(){return e(F)||(F=/Windows/i.test(d.appVersion)),F}function _(){return f()&&y}function T(){return e(L)||(L="undefined"!=typeof PointerEvent&&(!e(d.pointerEnabled)||d.pointerEnabled)),L}function h(){if(!e(U)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=t.style.imageRendering;U=e(r)&&""!==r,U&&(v=r)}return U}function A(){return h()?v:void 0}var d;d="undefined"!=typeof navigator?navigator:{};var S,m,C,N,I,M,O,p,g,y,F,L,v,U,D={isChrome:o,chromeVersion:a,isSafari:i,safariVersion:s,isWebkit:u,webkitVersion:E,isInternetExplorer:l,internetExplorerVersion:c,isFirefox:f,firefoxVersion:_,isWindows:R,hardwareConcurrency:t(d.hardwareConcurrency,3),supportsPointerEvents:T,supportsImageRenderingPixelated:h,imageRenderingValue:A};return D.supportsFullscreen=function(){return r.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(t,e,r,n,o,a){"use strict";function i(t,e,r){return 0>r&&(r+=1),r>1&&(r-=1),1>6*r?t+6*(e-t)*r:1>2*r?e:2>3*r?t+(e-t)*(2/3-r)*6:t}function s(e,r,n,o){this.red=t(e,1),this.green=t(r,1),this.blue=t(n,1),this.alpha=t(o,1)}s.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 s(t.x,t.y,t.z,t.w)},s.fromBytes=function(r,n,o,a,i){return r=s.byteToFloat(t(r,255)),n=s.byteToFloat(t(n,255)),o=s.byteToFloat(t(o,255)),a=s.byteToFloat(t(a,255)),e(i)?(i.red=r,i.green=n,i.blue=o,i.alpha=a,i):new s(r,n,o,a)},s.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 s(t.red,t.green,t.blue,r)};var u,E,l;n.supportsTypedArrays()&&(u=new ArrayBuffer(4),E=new Uint32Array(u),l=new Uint8Array(u)),s.fromRgba=function(t){return E[0]=t,s.fromBytes(l[0],l[1],l[2],l[3])},s.fromHsl=function(e,r,n,o){e=t(e,0)%1,r=t(r,0),n=t(n,0),o=t(o,1);var a=n,u=n,E=n;if(0!==r){var l;l=.5>n?n*(1+r):n+r-n*r;var c=2*n-l;a=i(c,l,e+1/3),u=i(c,l,e),E=i(c,l,e-1/3)}return new s(a,u,E,o)},s.fromRandom=function(r,n){r=t(r,t.EMPTY_OBJECT);var o=r.red;if(!e(o)){var i=t(r.minimumRed,0),u=t(r.maximumRed,1);o=i+a.nextRandomNumber()*(u-i)}var E=r.green;if(!e(E)){var l=t(r.minimumGreen,0),c=t(r.maximumGreen,1);E=l+a.nextRandomNumber()*(c-l)}var f=r.blue;if(!e(f)){var R=t(r.minimumBlue,0),_=t(r.maximumBlue,1);f=R+a.nextRandomNumber()*(_-R)}var T=r.alpha;if(!e(T)){var h=t(r.minimumAlpha,0),A=t(r.maximumAlpha,1);T=h+a.nextRandomNumber()*(A-h)}return e(n)?(n.red=o,n.green=E,n.blue=f,n.alpha=T,n):new s(o,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,R=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,_=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(r){var n=s[r.toUpperCase()];if(e(n))return s.clone(n);var o=c.exec(r);return null!==o?new s(parseInt(o[1],16)/15,parseInt(o[2],16)/15,parseInt(o[3],16)/15):(o=f.exec(r),null!==o?new s(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255):(o=R.exec(r),null!==o?new s(parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),parseFloat(t(o[4],"1.0"))):(o=_.exec(r),null!==o?s.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(t(o[4],"1.0"))):void 0)))},s.packedLength=4,s.pack=function(e,r,n){n=t(n,0),r[n++]=e.red,r[n++]=e.green,r[n++]=e.blue,r[n]=e.alpha},s.unpack=function(r,n,o){return n=t(n,0),e(o)||(o=new s),o.red=r[n++],o.green=r[n++],o.blue=r[n++],o.alpha=r[n],o},s.byteToFloat=function(t){return t/255},s.floatToByte=function(t){return 1===t?255:256*t|0},s.clone=function(t,r){return e(t)?e(r)?(r.red=t.red,r.green=t.green,r.blue=t.blue,r.alpha=t.alpha,r):new s(t.red,t.green,t.blue,t.alpha):void 0; +},s.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},s.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]},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.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},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var t=s.floatToByte(this.red),e=s.floatToByte(this.green),r=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+t+","+e+","+r+")":"rgba("+t+","+e+","+r+","+this.alpha+")"},s.prototype.toBytes=function(t){var r=s.floatToByte(this.red),n=s.floatToByte(this.green),o=s.floatToByte(this.blue),a=s.floatToByte(this.alpha);return e(t)?(t[0]=r,t[1]=n,t[2]=o,t[3]=a,t):[r,n,o,a]},s.prototype.toRgba=function(){return l[0]=s.floatToByte(this.red),l[1]=s.floatToByte(this.green),l[2]=s.floatToByte(this.blue),l[3]=s.floatToByte(this.alpha),E[0]},s.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},s.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},s.prototype.withAlpha=function(t,e){return s.fromAlpha(this,t,e)},s.ALICEBLUE=o(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=o(s.fromCssColorString("#FAEBD7")),s.AQUA=o(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=o(s.fromCssColorString("#7FFFD4")),s.AZURE=o(s.fromCssColorString("#F0FFFF")),s.BEIGE=o(s.fromCssColorString("#F5F5DC")),s.BISQUE=o(s.fromCssColorString("#FFE4C4")),s.BLACK=o(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=o(s.fromCssColorString("#FFEBCD")),s.BLUE=o(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=o(s.fromCssColorString("#8A2BE2")),s.BROWN=o(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=o(s.fromCssColorString("#DEB887")),s.CADETBLUE=o(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=o(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=o(s.fromCssColorString("#D2691E")),s.CORAL=o(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=o(s.fromCssColorString("#6495ED")),s.CORNSILK=o(s.fromCssColorString("#FFF8DC")),s.CRIMSON=o(s.fromCssColorString("#DC143C")),s.CYAN=o(s.fromCssColorString("#00FFFF")),s.DARKBLUE=o(s.fromCssColorString("#00008B")),s.DARKCYAN=o(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=o(s.fromCssColorString("#B8860B")),s.DARKGRAY=o(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=o(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=o(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=o(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=o(s.fromCssColorString("#556B2F")),s.DARKORANGE=o(s.fromCssColorString("#FF8C00")),s.DARKORCHID=o(s.fromCssColorString("#9932CC")),s.DARKRED=o(s.fromCssColorString("#8B0000")),s.DARKSALMON=o(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=o(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=o(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=o(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=o(s.fromCssColorString("#00CED1")),s.DARKVIOLET=o(s.fromCssColorString("#9400D3")),s.DEEPPINK=o(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=o(s.fromCssColorString("#00BFFF")),s.DIMGRAY=o(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=o(s.fromCssColorString("#1E90FF")),s.FIREBRICK=o(s.fromCssColorString("#B22222")),s.FLORALWHITE=o(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=o(s.fromCssColorString("#228B22")),s.FUSCHIA=o(s.fromCssColorString("#FF00FF")),s.GAINSBORO=o(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=o(s.fromCssColorString("#F8F8FF")),s.GOLD=o(s.fromCssColorString("#FFD700")),s.GOLDENROD=o(s.fromCssColorString("#DAA520")),s.GRAY=o(s.fromCssColorString("#808080")),s.GREEN=o(s.fromCssColorString("#008000")),s.GREENYELLOW=o(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=o(s.fromCssColorString("#F0FFF0")),s.HOTPINK=o(s.fromCssColorString("#FF69B4")),s.INDIANRED=o(s.fromCssColorString("#CD5C5C")),s.INDIGO=o(s.fromCssColorString("#4B0082")),s.IVORY=o(s.fromCssColorString("#FFFFF0")),s.KHAKI=o(s.fromCssColorString("#F0E68C")),s.LAVENDER=o(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=o(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=o(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=o(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=o(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=o(s.fromCssColorString("#F08080")),s.LIGHTCYAN=o(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=o(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=o(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=o(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=o(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=o(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=o(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=o(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=o(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=o(s.fromCssColorString("#FFFFE0")),s.LIME=o(s.fromCssColorString("#00FF00")),s.LIMEGREEN=o(s.fromCssColorString("#32CD32")),s.LINEN=o(s.fromCssColorString("#FAF0E6")),s.MAGENTA=o(s.fromCssColorString("#FF00FF")),s.MAROON=o(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=o(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=o(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=o(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=o(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=o(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=o(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=o(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=o(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=o(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=o(s.fromCssColorString("#191970")),s.MINTCREAM=o(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=o(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=o(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=o(s.fromCssColorString("#FFDEAD")),s.NAVY=o(s.fromCssColorString("#000080")),s.OLDLACE=o(s.fromCssColorString("#FDF5E6")),s.OLIVE=o(s.fromCssColorString("#808000")),s.OLIVEDRAB=o(s.fromCssColorString("#6B8E23")),s.ORANGE=o(s.fromCssColorString("#FFA500")),s.ORANGERED=o(s.fromCssColorString("#FF4500")),s.ORCHID=o(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=o(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=o(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=o(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=o(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=o(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=o(s.fromCssColorString("#FFDAB9")),s.PERU=o(s.fromCssColorString("#CD853F")),s.PINK=o(s.fromCssColorString("#FFC0CB")),s.PLUM=o(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=o(s.fromCssColorString("#B0E0E6")),s.PURPLE=o(s.fromCssColorString("#800080")),s.RED=o(s.fromCssColorString("#FF0000")),s.ROSYBROWN=o(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=o(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=o(s.fromCssColorString("#8B4513")),s.SALMON=o(s.fromCssColorString("#FA8072")),s.SANDYBROWN=o(s.fromCssColorString("#F4A460")),s.SEAGREEN=o(s.fromCssColorString("#2E8B57")),s.SEASHELL=o(s.fromCssColorString("#FFF5EE")),s.SIENNA=o(s.fromCssColorString("#A0522D")),s.SILVER=o(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=o(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=o(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=o(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=o(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=o(s.fromCssColorString("#00FF7F")),s.STEELBLUE=o(s.fromCssColorString("#4682B4")),s.TAN=o(s.fromCssColorString("#D2B48C")),s.TEAL=o(s.fromCssColorString("#008080")),s.THISTLE=o(s.fromCssColorString("#D8BFD8")),s.TOMATO=o(s.fromCssColorString("#FF6347")),s.TURQUOISE=o(s.fromCssColorString("#40E0D0")),s.VIOLET=o(s.fromCssColorString("#EE82EE")),s.WHEAT=o(s.fromCssColorString("#F5DEB3")),s.WHITE=o(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=o(s.fromCssColorString("#F5F5F5")),s.YELLOW=o(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=o(s.fromCssColorString("#9ACD32")),s.TRANSPARENT=o(new s(0,0,0,0)),s}),define("Renderer/WebGLConstants",["../Core/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",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,e,r,n,o,a){"use strict";if(!o.supportsTypedArrays())return{};var i={BYTE:t.BYTE,UNSIGNED_BYTE:t.UNSIGNED_BYTE,SHORT:t.SHORT,UNSIGNED_SHORT:t.UNSIGNED_SHORT,FLOAT:t.FLOAT,DOUBLE:t.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},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 Float32Array?i.FLOAT:t instanceof Float64Array?i.DOUBLE:void 0},i.validate=function(t){return r(t)&&(t===i.BYTE||t===i.UNSIGNED_BYTE||t===i.SHORT||t===i.UNSIGNED_SHORT||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.FLOAT:return new Float32Array(e);case i.DOUBLE:return new Float64Array(e);default:throw new n("componentDatatype is not a valid value.")}},i.createArrayBufferView=function(t,r,o,a){switch(o=e(o,0),a=e(a,(r.byteLength-o)/i.getSizeInBytes(t)),t){case i.BYTE:return new Int8Array(r,o,a);case i.UNSIGNED_BYTE:return new Uint8Array(r,o,a);case i.SHORT:return new Int16Array(r,o,a);case i.UNSIGNED_SHORT:return new Uint16Array(r,o,a);case i.FLOAT:return new Float32Array(r,o,a);case i.DOUBLE:return new Float64Array(r,o,a);default:throw new n("componentDatatype is not a valid value.")}},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",["../Renderer/WebGLConstants","./freezeObject"],function(t,e){"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(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 e(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=void 0}return a.computeNumberOfVertices=function(t){var n=-1;for(var o in t.attributes)if(t.attributes.hasOwnProperty(o)&&e(t.attributes[o])&&e(t.attributes[o].values)){var a=t.attributes[o],i=a.values.length/a.componentsPerAttribute;if(n!==i&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=i}return n},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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,o){"use strict";var a={UNSIGNED_BYTE:t.UNSIGNED_BYTE,UNSIGNED_SHORT:t.UNSIGNED_SHORT,UNSIGNED_INT:t.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(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=o.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,r,n){return t>=o.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,r,n):new Uint16Array(e,r,n)},n(a)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(t,e,r,n,o,a,i,s){"use strict";function u(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),s=(1-o)*Math.tan(t._start.latitude),u=1/Math.sqrt(1+s*s),E=u*s,l=Math.atan2(s,a),c=u*i,f=c*c,R=1-f,_=Math.sqrt(R),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,C=1-3*T+35*h/4,N=1-5*T,I=S*l-m*Math.sin(2*l)*T/2-C*Math.sin(4*l)*h/16-N*Math.sin(6*l)*A/48-5*Math.sin(8*l)*d/512,M=t._constants;M.a=r,M.b=n,M.f=o,M.cosineHeading=a,M.sineHeading=i,M.tanU=s,M.cosineU=u,M.sineU=E,M.sigma=l,M.sineAlpha=c,M.sineSquaredAlpha=f,M.cosineSquaredAlpha=R,M.cosineAlpha=_,M.u2Over4=T,M.u4Over16=h,M.u6Over64=A,M.u8Over256=d,M.a0=S,M.a1=m,M.a2=C,M.a3=N,M.distanceRatio=I}function E(t,e){return t*e*(4+t*(4-3*e))/16}function l(t,e,r,n,o,a,i){var s=E(t,r);return(1-s)*t*e*(n+s*o*(i+s*a*(2*i*i-1)))}function c(t,e,r,n,o,a,i){var u,E,c,f,R,_=(e-r)/e,T=a-n,h=Math.atan((1-_)*Math.tan(o)),A=Math.atan((1-_)*Math.tan(i)),d=Math.cos(h),S=Math.sin(h),m=Math.cos(A),C=Math.sin(A),N=d*m,I=d*C,M=S*C,O=S*m,p=T,g=s.TWO_PI,y=Math.cos(p),F=Math.sin(p);do{y=Math.cos(p),F=Math.sin(p);var L=I-O*y;c=Math.sqrt(m*m*F*F+L*L),E=M+N*y,u=Math.atan2(c,E);var v;0===c?(v=0,f=1):(v=N*F/c,f=1-v*v),g=p,R=E-2*M/f,isNaN(R)&&(R=0),p=T+l(_,v,f,u,c,E,R)}while(Math.abs(p-g)>s.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=R*R,w=P*c*(R+P*(E*(2*B-1)-P*R*(4*c*c-3)*(4*B-3)/6)/4),x=r*D*(u-w),G=Math.atan2(m*F,I-O*y),b=Math.atan2(d*F,I*y-O);t._distance=x,t._startHeading=G,t._endHeading=b,t._uSquared=U}function f(r,n,o,a){t.normalize(a.cartographicToCartesian(n,T),_),t.normalize(a.cartographicToCartesian(o,T),T);c(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,u(r)}function R(t,o,a){var s=r(a,i.WGS84);this._ellipsoid=s,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,s)}var _=new t,T=new t;return o(R.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}}}),R.prototype.setEndPoints=function(t,e){f(this,t,e,this._ellipsoid)},R.prototype.interpolateUsingFraction=function(t,e){return this.interpolateUsingSurfaceDistance(this._distance*t,e)},R.prototype.interpolateUsingSurfaceDistance=function(t,r){var o=this._constants,a=o.distanceRatio+t/o.b,i=Math.cos(2*a),s=Math.cos(4*a),u=Math.cos(6*a),E=Math.sin(2*a),c=Math.sin(4*a),f=Math.sin(6*a),R=Math.sin(8*a),_=a*a,T=a*_,h=o.u8Over256,A=o.u2Over4,d=o.u6Over64,S=o.u4Over16,m=2*T*h*i/3+a*(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)*s-29*h*u/16)+(A/2-S+71*d/32-85*h/16)*E+(5*S/16-5*d/4+383*h/96)*c-_*((d-11*h/2)*E+5*h*c/2)+(29*d/96-29*h/16)*f+539*h*R/1536,C=Math.asin(Math.sin(m)*o.cosineAlpha),N=Math.atan(o.a/o.b*Math.tan(C));m-=o.sigma;var I=Math.cos(2*o.sigma+m),M=Math.sin(m),O=Math.cos(m),p=o.cosineU*O,g=o.sineU*M,y=Math.atan2(M*o.sineHeading,p-g*o.cosineHeading),F=y-l(o.f,o.sineAlpha,o.cosineSquaredAlpha,m,M,O,I);return n(r)?(r.longitude=this._start.longitude+F,r.latitude=N,r.height=0,r):new e(this._start.longitude+F,N,0)},R}),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),s=Math.abs(t);if(s>i&&i/s<e.EPSILON14)return[0,0];if(i>s&&s/i<e.EPSILON14)return[];if(a=-o/t,0>a)return[];var u=Math.sqrt(a);return[-u,u]}if(0===o)return a=-n/t,0>a?[a,0]:[0,a];var E=n*n,l=4*t*o,c=r(E,-l,e.EPSILON14);if(0>c)return[];var f=-.5*r(n,e.sign(n)*Math.sqrt(c),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,s=e/3,u=r/3,E=n,l=i*u,c=s*E,f=s*s,R=u*u,_=i*u-f,T=i*E-s*u,h=s*E-R,A=4*_*h-T*T;if(0>A){var d,S,m;f*c>=l*R?(d=i,S=_,m=-2*s*_+i*T):(d=E,S=h,m=-E*T+2*u*h);var C=0>m?-1:1,N=-C*Math.abs(d)*Math.sqrt(-A);a=-m+N;var I=a/2,M=0>I?-Math.pow(-I,1/3):Math.pow(I,1/3),O=a===N?-M:-S/M;return o=0>=S?M+O:-m/(M*M+O*O+S),f*c>=l*R?[(o-s)/i]:[-E/(o+u)]}var p=_,g=-2*s*_+i*T,y=h,F=-E*T+2*u*h,L=Math.sqrt(A),v=Math.sqrt(3)/2,U=Math.abs(Math.atan2(i*L,-g)/3);o=2*Math.sqrt(-p);var D=Math.cos(U);a=o*D;var P=o*(-D/2-v*Math.sin(U)),B=a+P>2*s?a-s:P-s,w=i,x=B/w;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 G=-E,b=2*u>a+P?a+u:P+u,z=G/b,H=w*b,V=-B*b-w*G,q=B*G,X=(u*V-s*q)/(-s*V+u*H);return X>=x?z>=x?z>=X?[x,X,z]:[x,z,X]:[z,x,X]:z>=x?[X,x,z]:z>=X?[X,z,x]:[z,X,x]}var n={};return n.computeDiscriminant=function(t,e,r,n){var o=t*t,a=e*e,i=r*r,s=n*n,u=18*t*e*r*n+a*i-27*o*s-4*(t*i*r+a*e*n);return u},n.computeRealRoots=function(t,n,o,a){var i,s;if(0===t)return e.computeRealRoots(n,o,a);if(0===n){if(0===o){if(0===a)return[0,0,0];s=-a/t;var u=0>s?-Math.pow(-s,1/3):Math.pow(s,1/3);return[u,u,u]}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?(s=-n/t,0>s?[s,0,0]:[0,0,s]):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 s=e*e,u=o-3*s/8,E=a-o*e/2+s*e/8,l=i-a*e/4+o*s/16-3*s*s/256,c=t.computeRealRoots(1,2*u,u*u-4*l,-E*E);if(c.length>0){var f=-e/4,R=c[c.length-1];if(Math.abs(R)<r.EPSILON14){var _=n.computeRealRoots(1,u,l);if(2===_.length){var T,h=_[0],A=_[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&&0>A)return T=Math.sqrt(h),[f-T,f+T];if(0>h&&A>=0)return T=Math.sqrt(A),[f-T,f+T]}return[]}if(R>0){var m=Math.sqrt(R),C=(u+R-E/m)/2,N=(u+R+E/m)/2,I=n.computeRealRoots(1,m,C),M=n.computeRealRoots(1,-m,N);return 0!==I.length?(I[0]+=f,I[1]+=f,0!==M.length?(M[0]+=f,M[1]+=f,I[1]<=M[0]?[I[0],I[1],M[0],M[1]]:M[1]<=I[0]?[M[0],M[1],I[0],I[1]]:I[0]>=M[0]&&I[1]<=M[1]?[M[0],I[0],I[1],M[1]]:M[0]>=I[0]&&M[1]<=I[1]?[I[0],M[0],M[1],I[1]]:I[0]>M[0]&&I[0]<M[1]?[M[0],I[0],M[1],I[1]]:[I[0],M[0],I[1],M[1]]):I):0!==M.length?(M[0]+=f,M[1]+=f,M):[]}}return[]}function a(e,o,a,i){var s=a*a,u=o*o,E=e*e,l=-2*o,c=a*e+u-4*i,f=E*i-a*o*e+s,R=t.computeRealRoots(1,l,c,f);if(R.length>0){var _,T,h=R[0],A=o-h,d=A*A,S=e/2,m=A/2,C=d-4*i,N=d+4*Math.abs(i),I=E-4*h,M=E+4*Math.abs(h);if(0>h||I*N>C*M){var O=Math.sqrt(I);_=O/2,T=0===O?0:(e*m-a)/O}else{var p=Math.sqrt(C);_=0===p?0:(e*m-a)/p,T=p/2}var g,y;0===S&&0===_?(g=0,y=0):r.sign(S)===r.sign(_)?(g=S+_,y=h/g):(y=S-_,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,o){var a=t*t,i=a*t,s=e*e,u=s*e,E=r*r,l=E*r,c=n*n,f=c*n,R=o*o,_=R*o,T=s*E*c-4*u*f-4*t*l*c+18*t*e*r*f-27*a*c*c+256*i*_+o*(18*u*r*n-4*s*l+16*t*E*E-80*t*e*E*n-6*t*s*c+144*a*r*c)+R*(144*t*s*r-27*s*s-128*a*E-192*a*e*n);return T},i.computeRealRoots=function(e,n,i,s,u){if(Math.abs(e)<r.EPSILON15)return t.computeRealRoots(n,i,s,u);var E=n/e,l=i/e,c=s/e,f=u/e,R=0>E?1:0;switch(R+=0>l?R+1:R,R+=0>c?R+1:R,R+=0>f?R+1:R){case 0:return o(E,l,c,f);case 1:return a(E,l,c,f);case 2:return a(E,l,c,f);case 3:return o(E,l,c,f);case 4:return o(E,l,c,f);case 5:return a(E,l,c,f);case 6:return o(E,l,c,f);case 7:return o(E,l,c,f);case 8:return a(E,l,c,f);case 9:return o(E,l,c,f);case 10:return o(E,l,c,f);case 11:return a(E,l,c,f);case 12:return o(E,l,c,f);case 13:return o(E,l,c,f);case 14:return o(E,l,c,f);case 15:return o(E,l,c,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,s,u,E){"use strict";function l(e,n,o,i,s){s=r(s,!1);var u,E,l,c,f,R=e.origin,_=e.direction,T=t.subtract(o,n,h),C=t.subtract(i,n,A),N=t.cross(_,C,d),I=t.dot(T,N);if(s){if(I<a.EPSILON6)return;if(u=t.subtract(R,n,S),l=t.dot(u,N),0>l||l>I)return;if(E=t.cross(u,T,m),c=t.dot(_,E),0>c||l+c>I)return;f=t.dot(C,E)/I}else{if(Math.abs(I)<a.EPSILON6)return;var M=1/I;if(u=t.subtract(R,n,S),l=t.dot(u,N)*M,0>l||l>1)return;if(E=t.cross(u,T,m),c=t.dot(_,E)*M,0>c||l+c>1)return;f=t.dot(C,E)*M}return f}function c(t,e,r,n){var o=e*e-4*t*r;if(!(0>o)){if(o>0){var a=1/(2*t),i=Math.sqrt(o),s=(-e+i)*a,u=(-e-i)*a;return u>s?(n.root0=s,n.root1=u):(n.root0=u,n.root1=s),n}var E=-e/(2*t);if(0!==E)return n.root0=n.root1=E,n}}function f(e,r,o){n(o)||(o={});var a=e.origin,i=e.direction,s=r.center,u=r.radius*r.radius,E=t.subtract(a,s,d),l=t.dot(i,i),f=2*t.dot(i,E),R=t.magnitudeSquared(E)-u,_=c(l,f,R,N);return n(_)?(o.start=_.root0,o.stop=_.root1,o):void 0}function R(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 l,c=o*o,f=E*E,_=(e[i.COLUMN1ROW1]-e[i.COLUMN2ROW2])*f,T=E*(o*R(e[i.COLUMN1ROW0],e[i.COLUMN0ROW1],a.EPSILON15)+r.y),h=e[i.COLUMN0ROW0]*c+e[i.COLUMN2ROW2]*f+o*r.x+n,A=f*R(e[i.COLUMN2ROW1],e[i.COLUMN1ROW2],a.EPSILON15),d=E*(o*R(e[i.COLUMN2ROW0],e[i.COLUMN0ROW2])+r.z),S=[];if(0===d&&0===A){if(l=s.computeRealRoots(_,T,h),0===l.length)return S;var m=l[0],C=Math.sqrt(Math.max(1-m*m,0));if(S.push(new t(o,E*m,E*-C)),S.push(new t(o,E*m,E*C)),2===l.length){var N=l[1],I=Math.sqrt(Math.max(1-N*N,0));S.push(new t(o,E*N,E*-I)),S.push(new t(o,E*N,E*I))}return S}var M=d*d,O=A*A,p=_*_,g=d*A,y=p+O,F=2*(T*_+g),L=2*h*_+T*T-O+M,v=2*(h*T-g),U=h*h-M;if(0===y&&0===F&&0===L&&0===v)return S;l=u.computeRealRoots(y,F,L,v,U);var D=l.length;if(0===D)return S;for(var P=0;D>P;++P){var B,w=l[P],x=w*w,G=Math.max(1-x,0),b=Math.sqrt(G);B=a.sign(_)===a.sign(h)?R(_*x+h,T*w,a.EPSILON12):a.sign(h)===a.sign(T*w)?R(_*x,T*w+h,a.EPSILON12):R(_*x+T*w,h,a.EPSILON12);var z=R(A*w,d,a.EPSILON15),H=B*z;0>H?S.push(new t(o,E*w,E*b)):H>0?S.push(new t(o,E*w,E*-b)):0!==b?(S.push(new t(o,E*w,E*-b)),S.push(new t(o,E*w,E*b)),++P):S.push(new t(o,E*w,E*b))}return S}var T={};T.rayPlane=function(e,r,o){n(o)||(o=new t);var i=e.origin,s=e.direction,u=r.normal,E=t.dot(u,s);if(!(Math.abs(E)<a.EPSILON15)){var l=(-r.distance-t.dot(u,i))/E;if(!(0>l))return o=t.multiplyByScalar(s,l,o),t.add(i,o,o)}};var h=new t,A=new t,d=new t,S=new t,m=new t;T.rayTriangle=function(e,r,o,a,i,s){var u=l(e,r,o,a,i);if(n(u)&&!(0>u))return n(s)||(s=new t),t.multiplyByScalar(e.direction,u,s),t.add(e.origin,s,s)};var C=new E;T.lineSegmentTriangle=function(e,r,o,a,i,s,u){var E=C;t.clone(e,E.origin),t.subtract(r,e,E.direction),t.normalize(E.direction,E.direction);var c=l(E,o,a,i,s);return!n(c)||0>c||c>t.distance(e,r)?void 0:(n(u)||(u=new t),t.multiplyByScalar(E.direction,c,u),t.add(E.origin,u,u))};var N={root0:0,root1:0};T.raySphere=function(t,e,r){return r=f(t,e,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var I=new E;T.lineSegmentSphere=function(e,r,o,a){var i=I,s=t.subtract(r,e,i.direction),u=t.magnitude(s);return t.normalize(s,s),a=f(i,o,a),!n(a)||a.stop<0||a.start>u?void 0:(a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,u),a)};var M=new t,O=new t;T.rayEllipsoid=function(e,r){var n,o,a,i,s,u=r.oneOverRadii,E=t.multiplyComponents(u,e.origin,M),l=t.multiplyComponents(u,e.direction,O),c=t.magnitudeSquared(E),f=t.dot(E,l);if(c>1){if(f>=0)return;var R=f*f;if(n=c-1,o=t.magnitudeSquared(l),a=o*n,a>R)return;if(R>a){i=f*f-a,s=-f+Math.sqrt(i);var _=s/o,T=n/s;return T>_?{start:_,stop:T}:{start:T,stop:_}}var h=Math.sqrt(n/o);return{start:h,stop:h}}return 1>c?(n=c-1,o=t.magnitudeSquared(l),a=o*n,i=f*f-a,s=-f+Math.sqrt(i),{start:0,stop:s/o}):0>f?(o=t.magnitudeSquared(l),{start:0,stop:-f/o}):void 0};var p=new t,g=new t,y=new t,F=new t,L=new t,v=new i,U=new i,D=new i,P=new i,B=new i,w=new i,x=new i,G=new t,b=new t,z=new e;T.grazingAltitudeLocation=function(e,r){var o=e.origin,s=e.direction,u=r.geodeticSurfaceNormal(o,p);if(t.dot(s,u)>=0)return o;var E=n(this.rayEllipsoid(e,r)),l=r.transformPositionToScaledSpace(s,p),c=t.normalize(l,l),f=t.mostOrthogonalAxis(l,F),R=t.normalize(t.cross(f,c,g),g),T=t.normalize(t.cross(c,R,y),y),h=v;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,U),d=i.fromScale(r.radii,D),S=i.fromScale(r.oneOverRadii,P),m=B;m[0]=0,m[1]=-s.z,m[2]=s.y,m[3]=s.z,m[4]=0,m[5]=-s.x,m[6]=-s.y,m[7]=s.x,m[8]=0;var C,N,I=i.multiply(i.multiply(A,S,w),m,w),M=i.multiply(i.multiply(I,d,x),h,x),O=i.multiplyByVector(I,o,L),H=_(M,t.negate(O,p),0,0,1),V=H.length;if(V>0){for(var q=t.clone(t.ZERO,b),X=Number.NEGATIVE_INFINITY,W=0;V>W;++W){C=i.multiplyByVector(d,i.multiplyByVector(h,H[W],G),G);var Y=t.normalize(t.subtract(C,o,F),F),K=t.dot(Y,s);K>X&&(X=K,q=t.clone(C,q))}var k=r.cartesianToCartographic(q,z);return X=a.clamp(X,0,1),N=t.magnitude(t.subtract(q,o,F))*Math.sqrt(1-X*X),N=E?-N:N,k.height=N,r.cartographicToCartesian(k,new t)}};var H=new t;return T.lineSegmentPlane=function(e,r,o,i){n(i)||(i=new t);var s=t.subtract(r,e,H),u=o.normal,E=t.dot(u,s);if(!(Math.abs(E)<a.EPSILON6)){var l=t.dot(u,e),c=-(o.distance+l)/E;if(!(0>c||c>1))return t.multiplyByScalar(s,c,i),t.add(e,i,i),i}},T.trianglePlaneIntersection=function(e,r,n,o){var a=o.normal,i=o.distance,s=t.dot(a,e)+i<0,u=t.dot(a,r)+i<0,E=t.dot(a,n)+i<0,l=0;l+=s?1:0,l+=u?1:0,l+=E?1:0;var c,f;if((1===l||2===l)&&(c=new t,f=new t),1===l){if(s)return T.lineSegmentPlane(e,r,o,c),T.lineSegmentPlane(e,n,o,f),{positions:[e,r,n,c,f],indices:[0,3,4,1,2,4,1,4,3]};if(u)return T.lineSegmentPlane(r,n,o,c),T.lineSegmentPlane(r,e,o,f),{positions:[e,r,n,c,f],indices:[1,3,4,2,0,4,2,4,3]};if(E)return T.lineSegmentPlane(n,e,o,c),T.lineSegmentPlane(n,r,o,f),{positions:[e,r,n,c,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!s)return T.lineSegmentPlane(r,e,o,c),T.lineSegmentPlane(n,e,o,f),{positions:[e,r,n,c,f],indices:[1,2,4,1,4,3,0,3,4]};if(!u)return T.lineSegmentPlane(n,r,o,c),T.lineSegmentPlane(e,r,o,f),{positions:[e,r,n,c,f],indices:[2,0,4,2,4,3,1,3,4]};if(!E)return T.lineSegmentPlane(e,n,o,c),T.lineSegmentPlane(r,n,o,f),{positions:[e,r,n,c,f],indices:[0,1,4,0,4,3,2,3,4]}}},T}),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/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(t,e,r,n,o,a,i,s,u,E,l,c){"use strict";function f(t,e,r){var n=M;n.length=t;var o;if(e===r){for(o=0;t>o;o++)n[o]=e;return n}var a=r-e,i=a/t;for(o=0;t>o;o++){var s=e+o*i;n[o]=s}return n}function R(e,r,n,o,a,i,s,u){var E=o.scaleToGeodeticSurface(e,y),l=o.scaleToGeodeticSurface(r,F),c=_.numberOfPoints(e,r,n),R=o.cartesianToCartographic(E,O),T=o.cartesianToCartographic(l,p),h=f(c,a,i);L.setEndPoints(R,T);var A=L.surfaceDistance/c,d=u;R.height=a;var S=o.cartographicToCartesian(R,g);t.pack(S,s,d),d+=3;for(var m=1;c>m;m++){var C=L.interpolateUsingSurfaceDistance(m*A,p);C.height=h[m],S=o.cartographicToCartesian(C,g),t.pack(S,s,d),d+=3}return d}var _={};_.numberOfPoints=function(e,r,n){var o=t.distance(e,r);return Math.ceil(o/n)};var T=new e;_.extractHeights=function(t,e){for(var r=t.length,n=new Array(r),o=0;r>o;o++){var a=t[o];n[o]=e.cartesianToCartographic(a,T).height}return n};var h=new l,A=new t,d=new t,S=new c(t.ZERO,0),m=new t,C=new c(t.ZERO,0),N=new t,I=new t,M=[],O=new e,p=new e,g=new t,y=new t,F=new t,L=new i;_.wrapLongitude=function(e,o){var a=[],i=[];if(n(e)&&e.length>0){o=r(o,l.IDENTITY);var u=l.inverseTransformation(o,h),E=l.multiplyByPoint(u,t.ZERO,A),f=l.multiplyByPointAsVector(u,t.UNIT_Y,d),R=c.fromPointNormal(E,f,S),_=l.multiplyByPointAsVector(u,t.UNIT_X,m),T=c.fromPointNormal(E,_,C),M=1;a.push(t.clone(e[0]));for(var O=a[0],p=e.length,g=1;p>g;++g){var y=e[g];if(c.getPointDistance(T,O)<0||c.getPointDistance(T,y)<0){var F=s.lineSegmentPlane(O,y,R,N);if(n(F)){var L=t.multiplyByScalar(f,5e-9,I);c.getPointDistance(R,O)<0&&t.negate(L,L),a.push(t.add(F,L,new t)),i.push(M+1),t.negate(L,L),a.push(t.add(F,L,new t)),M=1}}a.push(t.clone(e[g])),M++,O=y}i.push(M)}return{positions:a,lengths:i}};var v=E.EPSILON10;return _.removeDuplicates=function(e){var r=e.length;if(2>r)return e;var n,o,a;for(n=1;r>n&&(o=e[n-1],a=e[n],!t.equalsEpsilon(o,a,v));++n);if(n===r)return e;for(var i=e.slice(0,n);r>n;++n)a=e[n],t.equalsEpsilon(o,a,v)||(i.push(t.clone(a)),o=a);return i},_.generateArc=function(e){n(e)||(e={});var o=e.positions,i=o.length,s=r(e.ellipsoid,a.WGS84),l=r(e.height,0);if(1>i)return[];if(1===i){var c=s.scaleToGeodeticSurface(o[0],y);if(0!==l){var f=s.geodeticSurfaceNormal(c,g);t.multiplyByScalar(f,l,f),t.add(c,f,c)}return[c.x,c.y,c.z]}var T=e.minDistance;if(!n(T)){var h=r(e.granularity,E.RADIANS_PER_DEGREE);T=E.chordLength(h,s.maximumRadius)}var A,d=0;for(A=0;i-1>A;A++)d+=_.numberOfPoints(o[A],o[A+1],T);var S=3*(d+1),m=new Array(S),C=0,N=u(l);for(A=0;i-1>A;A++){var I=o[A],p=o[A+1],F=N?l[A]:l,L=N?l[A+1]:l;C=R(I,p,T,s,F,L,m,C)}M.length=0;var v=o[i-1],U=s.cartesianToCartographic(v,O);U.height=N?l[i-1]:l;var D=s.cartographicToCartesian(U,g);return t.pack(D,m,S-3),m},_.generateCartesianArc=function(e){for(var r=_.generateArc(e),n=r.length/3,o=new Array(n),a=0;n>a;a++)o[a]=t.unpack(r,3*a);return o},_}),define("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(t,e,r,n,o,a,i,s,u,E,l,c,f,R,_){"use strict";function T(t,e,n,o,a,i,s){var u,E=R.numberOfPoints(t,e,a),l=n.red,c=n.green,f=n.blue,_=n.alpha,T=o.red,h=o.green,A=o.blue,d=o.alpha;if(r.equals(n,o)){for(u=0;E>u;u++)i[s++]=r.floatToByte(l),i[s++]=r.floatToByte(c),i[s++]=r.floatToByte(f),i[s++]=r.floatToByte(_);return s}var S=(T-l)/E,m=(h-c)/E,C=(A-f)/E,N=(d-_)/E,I=s;for(u=0;E>u;u++)i[I++]=r.floatToByte(l+u*S),i[I++]=r.floatToByte(c+u*m),i[I++]=r.floatToByte(f+u*C),i[I++]=r.floatToByte(_+u*N);return I}function h(t){t=o(t,o.EMPTY_OBJECT);var n=t.positions,i=t.colors,u=o(t.colorsPerVertex,!1);this._positions=n,this._colors=i,this._colorsPerVertex=u,this._followSurface=o(t.followSurface,!0),this._granularity=o(t.granularity,f.RADIANS_PER_DEGREE),this._ellipsoid=o(t.ellipsoid,s.WGS84),this._workerName="createSimplePolylineGeometry";var E=1+n.length*e.packedLength;E+=a(i)?1+i.length*r.packedLength:1,this.packedLength=E+s.packedLength+3}h.pack=function(t,n,i){i=o(i,0);var u,E=t._positions,l=E.length;for(n[i++]=l,u=0;l>u;++u,i+=e.packedLength)e.pack(E[u],n,i);var c=t._colors;for(l=a(c)?c.length:0,n[i++]=l,u=0;l>u;++u,i+=r.packedLength)r.pack(c[u],n,i);s.pack(t._ellipsoid,n,i),i+=s.packedLength,n[i++]=t._colorsPerVertex?1:0,n[i++]=t._followSurface?1:0,n[i]=t._granularity},h.unpack=function(t,n,i){n=o(n,0);var u,E=t[n++],l=new Array(E);for(u=0;E>u;++u,n+=e.packedLength)l[u]=e.unpack(t,n);E=t[n++];var c=E>0?new Array(E):void 0;for(u=0;E>u;++u,n+=r.packedLength)c[u]=r.unpack(t,n);var f=s.unpack(t,n);n+=s.packedLength;var R=1===t[n++],_=1===t[n++],T=t[n];return a(i)?(i._positions=l,i._colors=c,i._ellipsoid=f,i._colorsPerVertex=R,i._followSurface=_,i._granularity=T,i):new h({positions:l,colors:c,ellipsoid:f,colorsPerVertex:R,followSurface:_,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(o){var i,s,h,m,C,N=o._positions,I=o._colors,M=o._colorsPerVertex,O=o._followSurface,p=o._granularity,g=o._ellipsoid,y=f.chordLength(p,g.maximumRadius),F=a(I)&&!M,L=N.length,v=0;if(O){var U=R.extractHeights(N,g),D=S;if(D.minDistance=y,D.ellipsoid=g,F){var P=0;for(i=0;L-1>i;i++)P+=R.numberOfPoints(N[i],N[i+1],y)+1;s=new Float64Array(3*P),m=new Uint8Array(4*P),D.positions=A,D.height=d;var B=0;for(i=0;L-1>i;++i){A[0]=N[i],A[1]=N[i+1],d[0]=U[i],d[1]=U[i+1];var w=R.generateArc(D);if(a(I)){var x=w.length/3;C=I[i];for(var G=0;x>G;++G)m[B++]=r.floatToByte(C.red),m[B++]=r.floatToByte(C.green),m[B++]=r.floatToByte(C.blue),m[B++]=r.floatToByte(C.alpha)}s.set(w,v),v+=w.length}}else if(D.positions=N,D.height=U,s=new Float64Array(R.generateArc(D)),a(I)){for(m=new Uint8Array(s.length/3*4),i=0;L-1>i;++i){var b=N[i],z=N[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,s=new Float64Array(3*h),m=a(I)?new Uint8Array(4*h):void 0;var X=0,W=0;for(i=0;L>i;++i){var Y=N[i];if(F&&i>0&&(e.pack(Y,s,X),X+=3,C=I[i-1],m[W++]=r.floatToByte(C.red),m[W++]=r.floatToByte(C.green),m[W++]=r.floatToByte(C.blue),m[W++]=r.floatToByte(C.alpha)),F&&i===L-1)break;e.pack(Y,s,X),X+=3,a(I)&&(C=I[i],m[W++]=r.floatToByte(C.red),m[W++]=r.floatToByte(C.green),m[W++]=r.floatToByte(C.blue),m[W++]=r.floatToByte(C.alpha))}}var K=new l;K.position=new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:s}),a(I)&&(K.color=new E({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:4,values:m,normalize:!0})),h=s.length/3;var k=2*(h-1),Z=c.createTypedArray(h,k),j=0;for(i=0;h-1>i;++i)Z[j++]=i,Z[j++]=i+1;return new u({attributes:K,indices:Z,primitiveType:_.LINES,boundingSphere:t.fromPoints(N)})},h}),define("Workers/createSimplePolylineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/SimplePolylineGeometry"],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 diff --git a/Workers/createSphereGeometry.js b/Workers/createSphereGeometry.js index 4558750..3fb6d83 100644 --- a/Workers/createSphereGeometry.js +++ b/Workers/createSphereGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,5 +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";var t=function(t){return void 0!==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";var e=function(t,e){return void 0!==t?t:e};return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";var e=function(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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("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^=2636928640&t<<7,t^=4022730752&t<<15,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){"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(t){return t>0?1:0>t?-1:0},n.signNotZero=function(t){return 0>t?-1:1},n.toSNorm=function(t){return Math.round(255*(.5*n.clamp(t,-1,1)+.5))},n.fromSNorm=function(t){return 2*(n.clamp(t,0,255)/255)-1},n.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},n.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},n.lerp=function(t,e,n){return(1-n)*t+n*e},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(t){return t*n.RADIANS_PER_DEGREE},n.toDegrees=function(t){return t*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(t){var e=n.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},n.negativePiToPi=function(t){for(var e=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+e)>t;)t+=i;if(-r>t)return-r;for(;t>r+e;)t-=i;return t>r?r:t},n.zeroToTwoPi=function(t){var e=t%n.TWO_PI;return 0>e?(e+n.TWO_PI)%n.TWO_PI:e},n.equalsEpsilon=function(t,n,r){return r=e(r,0),Math.abs(t-n)<=r};var r=[1];n.factorial=function(t){var e=r.length;if(t>=e)for(var n=r[e-1],i=e;t>=i;i++)r.push(n*i);return r[t]},n.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},n.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},n.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},n.clamp=function(t,e,n){return e>t?e:t>n?n:t};var i=new t;return n.setRandomNumberSeed=function(e){i=new t(e)},n.nextRandomNumber=function(){return i.random()},n.acosClamped=function(t){return Math.acos(n.clamp(t,-1,1))},n.asinClamped=function(t){return Math.asin(n.clamp(t,-1,1))},n}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)};a.fromSpherical=function(n,r){e(r)||(r=new a);var i=n.clock,o=n.cone,u=t(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(t,n,r,i){return e(i)?(i.x=t,i.y=n,i.z=r,i):new a(t,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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.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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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 s=new a,c=new a;a.angleBetween=function(t,e){a.normalize(t,s),a.normalize(e,c);var n=a.dot(s,c),r=a.magnitude(a.cross(s,c,s));return Math.atan2(r,n)};var l=new a;a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,l);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):n.y<=n.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r},a.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,s=e.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},a.fromDegrees=function(t,e,n,r,o){var u=i.toRadians(t),s=i.toRadians(e);return a.fromRadians(u,s,n,r,o)};var f=new a,h=new a,d=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=t(i,0);var s=e(o)?o.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=a.normalize(f,f),a.multiplyComponents(s,f,h);var l=Math.sqrt(a.dot(f,h));return h=a.divideByScalar(h,l,h),f=a.multiplyByScalar(f,i,f),e(u)||(u=new a),a.add(h,f,u)},a.fromDegreesArray=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=i.toRadians(t[o]);return a.fromRadiansArray(r,e,n)},a.fromRadiansArray=function(t,n,r){var i=t.length;e(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],s=t[o+1];r[o/2]=a.fromRadians(u,s,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o+=3)r[o]=i.toRadians(t[o]),r[o+1]=i.toRadians(t[o+1]),r[o+2]=t[o+2];return a.fromRadiansArrayHeights(r,e,n)},a.fromRadiansArrayHeights=function(t,n,r){var i=t.length;e(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],s=t[o+1],c=t[o+2];r[o/3]=a.fromRadians(u,s,c,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)};return a.fromRadians=function(n,r,i,o){return i=t(i,0),e(o)?(o.longitude=n,o.latitude=r,o.height=i,o):new a(n,r,i)},a.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),a.fromRadians(t,e,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new a(t.longitude,t.latitude,t.height):void 0},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.longitude-n.longitude)<=r&&Math.abs(t.latitude-n.latitude)<=r&&Math.abs(t.height-n.height)<=r},a.ZERO=r(new a(0,0,0)),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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),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"],function(t,e,n,r,i,a,o,u){"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}var c=function(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,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))return void 0;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.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),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=s,n.z=c,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 l=new t,f=new t;c.prototype.cartographicToCartesian=function(e,n){var i=l,a=f;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;n>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var h=new t,d=new t,m=new t;c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,d);if(!r(a))return void 0;var o=this.geodeticSurfaceNormal(a,h),s=t.subtract(n,a,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(t.dot(s,n))*t.magnitude(s);return r(i)?(i.longitude=c,i.latitude=l,i.height=f,i):new e(c,l,f)},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;n>i;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e};var y=new t,p=new t;return c.prototype.scaleToGeodeticSurface=function(e,n){var i=e.x,a=e.y,o=e.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,h=i*i*c*c,d=a*a*l*l,m=o*o*f*f,v=h+d+m,w=Math.sqrt(1/v),x=t.multiplyByScalar(e,w,y);if(v<this._centerToleranceSquared)return isFinite(w)?t.clone(x,n):void 0;var E=this._oneOverRadiiSquared,g=E.x,M=E.y,S=E.z,z=p;z.x=2*x.x*g,z.y=2*x.y*M,z.z=2*x.z*S;var O,T,N,_,I,R,b,A,P,C,L,U=(1-w)*t.magnitude(e)/(.5*t.magnitude(z)),q=0;do{U-=q,N=1/(1+U*g),_=1/(1+U*M),I=1/(1+U*S),R=N*N,b=_*_,A=I*I,P=R*N,C=b*_,L=A*I,O=h*R+d*b+m*A-1,T=h*P*g+d*C*M+m*L*S;var D=-2*T;q=O/D}while(Math.abs(O)>u.EPSILON12);return r(n)?(n.x=i*N,n.y=a*_,n.z=o*I,n):new t(i*N,a*_,o*I)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,s,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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";var u=function(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";var e=function(e,n){this.start=t(e,0),this.stop=t(n,0)};return e}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";var i=function(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)};i.fromElements=function(t,n,r,a,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=a,o):new i(t,n,r,a)},i.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 i(t.red,t.green,t.blue,t.alpha)},i.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new i(t.x,t.y,t.z,t.w):void 0},i.packedLength=4,i.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r++],a.w=n[r],a},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,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},i.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},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 a=new i;i.distance=function(t,e){return i.subtract(t,e,a),i.magnitude(a)},i.normalize=function(t,e){var n=i.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,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,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},i.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},i.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},i.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},i.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},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 o=new i;i.lerp=function(t,e,n,r){return i.multiplyByScalar(e,n,o),r=i.multiplyByScalar(t,1-n,r),i.add(o,r,r)};var u=new i;return i.mostOrthogonalAxis=function(t,e){var n=i.normalize(t,u);return i.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?i.clone(i.UNIT_X,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e):n.y<=n.z?n.y<=n.w?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e)},i.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},i.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r&&Math.abs(t.w-n.w)<=r},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(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e){return i.equalsEpsilon(this,t,e)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t){for(var e=0,n=0;9>n;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function u(t){for(var e=0,n=0;3>n;++n){var r=t[c.getElementIndex(d[n],h[n])];e+=2*r*r}return Math.sqrt(e)}function s(t,e){for(var n=a.EPSILON15,r=0,i=1,o=0;3>o;++o){var u=Math.abs(t[c.getElementIndex(d[o],h[o])]);u>r&&(i=o,r=u)}var s=1,l=0,f=h[i],m=d[i];if(Math.abs(t[c.getElementIndex(m,f)])>n){var y,p=t[c.getElementIndex(m,m)],v=t[c.getElementIndex(f,f)],w=t[c.getElementIndex(m,f)],x=(p-v)/2/w;y=0>x?-1/(-x+Math.sqrt(1+x*x)):1/(x+Math.sqrt(1+x*x)),s=1/Math.sqrt(1+y*y),l=y*s}return e=c.clone(c.IDENTITY,e),e[c.getElementIndex(f,f)]=e[c.getElementIndex(m,m)]=s,e[c.getElementIndex(m,f)]=l,e[c.getElementIndex(f,m)]=-l,e}var c=function(t,n,r,i,a,o,u,s,c){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(s,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(c,0)};c.clone=function(t,e){return n(t)?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 c(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},c.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new c),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},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[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 c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},c.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,u=t.y*t.y,s=t.y*t.z,l=t.y*t.w,f=t.z*t.z,h=t.z*t.w,d=t.w*t.w,m=r-u-f+d,y=2*(i-h),p=2*(a+l),v=2*(i+h),w=-r+u-f+d,x=2*(s-o),E=2*(a-l),g=2*(s+o),M=-r-u+f+d;return n(e)?(e[0]=m,e[1]=v,e[2]=E,e[3]=y,e[4]=w,e[5]=g,e[6]=p,e[7]=x,e[8]=M,e):new c(m,y,p,v,w,x,E,g,M)},c.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 c(t.x,0,0,0,t.y,0,0,0,t.z)},c.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 c(t,0,0,0,t,0,0,0,t)},c.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 c(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},c.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 c(1,0,0,0,r,-i,0,i,r)},c.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 c(r,0,i,0,1,0,-i,0,r)},c.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 c(r,-i,0,i,r,0,0,0,1)},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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},c.getElementIndex=function(t,e){return 3*t+e},c.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},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},c.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},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,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[3],e[4],e[5],l)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],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]*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],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],c=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],f=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]=s,n[6]=c,n[7]=l,n[8]=f,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},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},c.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,s=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=s,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},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},c.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],s=t[2],c=t[5],l=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=s,e[7]=c,e[8]=l,e};var h=[1,0,0],d=[2,2,1],m=new c,y=new c;return c.computeEigenDecomposition=function(t,e){var r=a.EPSILON20,i=10,l=0,f=0;n(e)||(e={});for(var h=e.unitary=c.clone(c.IDENTITY,e.unitary),d=e.diagonal=c.clone(t,e.diagonal),p=r*o(d);i>f&&u(d)>p;)s(d,m),c.transpose(m,y),c.multiply(d,m,d),c.multiply(y,d,d),c.multiply(h,m,h),++l>2&&(++f,l=0);return 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},c.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],s=t[5],c=t[8];return e*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},c.inverse=function(t,e){var n=t[0],i=t[1],o=t[2],u=t[3],s=t[4],l=t[5],f=t[6],h=t[7],d=t[8],m=c.determinant(t);if(Math.abs(m)<=a.EPSILON15)throw new r("matrix is not invertible");e[0]=s*d-h*l,e[1]=h*o-i*d,e[2]=i*l-s*o,e[3]=f*l-u*d,e[4]=n*d-f*o,e[5]=u*o-n*l,e[6]=u*h-f*s,e[7]=f*i-n*h,e[8]=n*s-u*i;var y=1/m;return c.multiplyByScalar(e,y,e)},c.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]},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},c.IDENTITY=i(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(t){"use strict";var e=function(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,s){"use strict";var c=function(t,e,r,i,a,o,u,s,c,l,f,h,d,m,y,p){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(e,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(m,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(y,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(p,0)};c.packedLength=16,c.pack=function(t,e,r){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]},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){return r(t)?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]):void 0},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,s=e.x*e.x,l=e.x*e.y,f=e.x*e.z,h=e.x*e.w,d=e.y*e.y,m=e.y*e.z,y=e.y*e.w,p=e.z*e.z,v=e.z*e.w,w=e.w*e.w,x=s-d-p+w,E=2*(l-v),g=2*(f+y),M=2*(l+v),S=-s+d-p+w,z=2*(m-h),O=2*(f-y),T=2*(m+h),N=-s-d+p+w;return i[0]=x*a,i[1]=M*a,i[2]=O*a,i[3]=0,i[4]=E*o,i[5]=S*o,i[6]=T*o,i[7]=0,i[8]=g*u,i[9]=z*u,i[10]=N*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},c.fromTranslation=function(t,e){return c.fromRotationTranslation(u.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 l=new t,f=new t,h=new t;c.fromCamera=function(e,n){var i=e.eye,a=e.target,o=e.up;t.normalize(t.subtract(a,i,l),l),t.normalize(t.cross(l,o,f),f),t.normalize(t.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,m=l.x,y=l.y,p=l.z,v=h.x,w=h.y,x=h.z,E=i.x,g=i.y,M=i.z,S=u*-E+s*-g+d*-M,z=v*-E+w*-g+x*-M,O=m*E+y*g+p*M;return r(n)?(n[0]=u,n[1]=v,n[2]=-m,n[3]=0,n[4]=s,n[5]=w,n[6]=-y,n[7]=0,n[8]=d,n[9]=x,n[10]=-p,n[11]=0,n[12]=S,n[13]=z,n[14]=O,n[15]=1,n):new c(u,s,d,S,v,w,x,z,-m,-y,-p,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,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},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),s=1/(r-n),c=1/(a-i),l=-(e+t)*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},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),s=2*i/(r-n),c=(e+t)/(e-t),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},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),s=(e+t)/(e-t),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},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),s=n(t.height,0);e=n(e,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-e),h=c,d=l,m=f,y=a+c,p=o+l,v=e+f,w=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]=m,i[11]=0,i[12]=y,i[13]=p,i[14]=v,i[15]=w,i},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.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 d=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],d)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],d)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],d)),n};var m=new t;c.getMaximumScale=function(e){return c.getScale(e,m),t.maximumComponent(m)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],s=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],m=t[11],y=t[12],p=t[13],v=t[14],w=t[15],x=e[0],E=e[1],g=e[2],M=e[3],S=e[4],z=e[5],O=e[6],T=e[7],N=e[8],_=e[9],I=e[10],R=e[11],b=e[12],A=e[13],P=e[14],C=e[15],L=r*x+u*E+f*g+y*M,U=i*x+s*E+h*g+p*M,q=a*x+c*E+d*g+v*M,D=o*x+l*E+m*g+w*M,B=r*S+u*z+f*O+y*T,F=i*S+s*z+h*O+p*T,G=a*S+c*z+d*O+v*T,W=o*S+l*z+m*O+w*T,V=r*N+u*_+f*I+y*R,Y=i*N+s*_+h*I+p*R,k=a*N+c*_+d*I+v*R,j=o*N+l*_+m*I+w*R,H=r*b+u*A+f*P+y*C,Z=i*b+s*A+h*P+p*C,X=a*b+c*A+d*P+v*C,K=o*b+l*A+m*P+w*C;return n[0]=L,n[1]=U,n[2]=q,n[3]=D,n[4]=B,n[5]=F,n[6]=G,n[7]=W,n[8]=V,n[9]=Y,n[10]=k,n[11]=j,n[12]=H,n[13]=Z,n[14]=X,n[15]=K,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],s=t[6],c=t[8],l=t[9],f=t[10],h=t[12],d=t[13],m=t[14],y=e[0],p=e[1],v=e[2],w=e[4],x=e[5],E=e[6],g=e[8],M=e[9],S=e[10],z=e[12],O=e[13],T=e[14],N=r*y+o*p+c*v,_=i*y+u*p+l*v,I=a*y+s*p+f*v,R=r*w+o*x+c*E,b=i*w+u*x+l*E,A=a*w+s*x+f*E,P=r*g+o*M+c*S,C=i*g+u*M+l*S,L=a*g+s*M+f*S,U=r*z+o*O+c*T+h,q=i*z+u*O+l*T+d,D=a*z+s*O+f*T+m;return n[0]=N,n[1]=_,n[2]=I,n[3]=0,n[4]=R,n[5]=b,n[6]=A,n[7]=0,n[8]=P,n[9]=C,n[10]=L,n[11]=0,n[12]=U,n[13]=q,n[14]=D,n[15]=1,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],s=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]=s,n[15]=t[15],n};var y=new t;c.multiplyByUniformScale=function(t,e,n){return y.x=e,y.y=e,y.z=e,c.multiplyByScale(t,y,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,s=t[1]*r+t[5]*i+t[9]*a+t[13]*o,c=t[2]*r+t[6]*i+t[10]*a+t[14]*o,l=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,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,s=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=s,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],s=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=s,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[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[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]},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 p=new u,v=new u,w=new e,x=new e(0,0,0,1);return c.inverse=function(t,n){if(u.equalsEpsilon(c.getRotation(t,p),v,o.EPSILON7)&&e.equals(c.getRow(t,3,w),x))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],l=t[12],f=t[1],h=t[5],d=t[9],m=t[13],y=t[2],E=t[6],g=t[10],M=t[14],S=t[3],z=t[7],O=t[11],T=t[15],N=g*T,_=M*O,I=E*T,R=M*z,b=E*O,A=g*z,P=y*T,C=M*S,L=y*O,U=g*S,q=y*z,D=E*S,B=N*h+R*d+b*m-(_*h+I*d+A*m),F=_*f+P*d+U*m-(N*f+C*d+L*m),G=I*f+C*h+q*m-(R*f+P*h+D*m),W=A*f+L*h+D*d-(b*f+U*h+q*d),V=_*i+I*a+A*l-(N*i+R*a+b*l),Y=N*r+C*a+L*l-(_*r+P*a+U*l),k=R*r+P*i+D*l-(I*r+C*i+q*l),j=b*r+U*i+q*a-(A*r+L*i+D*a);N=a*m,_=l*d,I=i*m,R=l*h,b=i*d,A=a*h,P=r*m,C=l*f,L=r*d,U=a*f,q=r*h,D=i*f;var H=N*z+R*O+b*T-(_*z+I*O+A*T),Z=_*S+P*O+U*T-(N*S+C*O+L*T),X=I*S+C*z+q*T-(R*S+P*z+D*T),K=A*S+L*z+D*O-(b*S+U*z+q*O),J=I*g+A*M+_*E-(b*M+N*E+R*g),Q=L*M+N*y+C*g-(P*g+U*M+_*y),$=P*E+D*M+R*y-(q*M+I*y+C*E),te=q*g+b*y+U*E-(L*E+D*g+A*y),ee=r*B+i*F+a*G+l*W;if(Math.abs(ee)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return ee=1/ee,n[0]=B*ee,n[1]=F*ee,n[2]=G*ee,n[3]=W*ee,n[4]=V*ee,n[5]=Y*ee,n[6]=k*ee,n[7]=j*ee,n[8]=H*ee,n[9]=Z*ee,n[10]=X*ee,n[11]=K*ee,n[12]=J*ee,n[13]=Q*ee,n[14]=$*ee,n[15]=te*ee,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],s=t[8],c=t[9],l=t[10],f=t[12],h=t[13],d=t[14],m=-n*f-r*h-i*d,y=-a*f-o*h-u*d,p=-s*f-c*h-l*d;return e[0]=n,e[1]=a,e[2]=s,e[3]=0,e[4]=r,e[5]=o,e[6]=c,e[7]=0,e[8]=i,e[9]=u,e[10]=l,e[11]=0,e[12]=m,e[13]=y,e[14]=p,e[15]=1,e},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";var u=function(t,n,r,i){this.west=e(t,0),this.south=e(n,0),this.east=e(r,0),this.north=e(i,0)};u.fromDegrees=function(t,r,i,a,s){return t=o.toRadians(e(t,0)),r=o.toRadians(e(r,0)),i=o.toRadians(e(i,0)),a=o.toRadians(e(a,0)),n(s)?(s.west=t,s.south=r,s.east=i,s.north=a,s):new u(t,r,i,a)},u.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=t.length;c>s;s++){var l=t[s];r=Math.min(r,l.longitude),i=Math.max(i,l.longitude),a=Math.min(a,l.latitude),o=Math.max(o,l.latitude)}return n(e)?(e.west=r,e.south=a,e.east=i,e.north=o,e):new u(r,a,i,o)},u.packedLength=4,u.pack=function(t,n,r){r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i.west=t[r++],i.south=t[r++],i.east=t[r++],i.north=t[r],i},u.clone=function(t,e){return n(t)?n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new u(t.west,t.south,t.east,t.north):void 0},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.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},u.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},u.validate=function(){},u.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)},u.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)},u.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)},u.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)},u.center=function(e,r){var i=e.east,a=e.west,u=.5*(a+i);return a>i&&(u=o.negativePiToPi(u+o.PI)),n(r)?(r.longitude=u,r.latitude=.5*(e.south+e.north),r.height=0,r):new t(u,.5*(e.south+e.north))},u.intersectWith=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),s=Math.min(t.north,e.north);return n(r)?(r.west=i,r.south=a,r.east=o,r.north=s,r):new u(i,a,o,s)},u.contains=function(t,e){return e.longitude>=t.west&&e.longitude<=t.east&&e.latitude>=t.south&&e.latitude<=t.north},u.isEmpty=function(t){return t.west>=t.east||t.south>=t.north};var s=new t;return u.subsample=function(t,r,a,u){r=e(r,i.WGS84),a=e(a,0),n(u)||(u=[]);var c=0,l=t.north,f=t.south,h=t.east,d=t.west,m=s;m.height=a,m.longitude=d,m.latitude=l,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:f>0?f:0;for(var y=1;8>y;++y){var p=-Math.PI+y*o.PI_OVER_TWO;p>d&&h>p&&(m.longitude=p,u[c]=r.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,s,c,l){"use strict";var f=function(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)},h=new t,d=new t,m=new t,y=new t,p=new t,v=new t,w=new t,x=new t,E=new t,g=new t,M=new t,S=new t;f.fromPoints=function(e,n){if(r(n)||(n=new f),!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],w),a=t.clone(i,h),o=t.clone(i,d),u=t.clone(i,m),s=t.clone(i,y),c=t.clone(i,p),l=t.clone(i,v),z=e.length,O=1;z>O;O++){t.clone(e[O],i);var T=i.x,N=i.y,_=i.z;T<a.x&&t.clone(i,a),T>s.x&&t.clone(i,s),N<o.y&&t.clone(i,o),N>c.y&&t.clone(i,c),_<u.z&&t.clone(i,u),_>l.z&&t.clone(i,l)}var I=t.magnitudeSquared(t.subtract(s,a,x)),R=t.magnitudeSquared(t.subtract(c,o,x)),b=t.magnitudeSquared(t.subtract(l,u,x)),A=a,P=s,C=I;R>C&&(C=R,A=o,P=c),b>C&&(C=b,A=u,P=l);var L=E;L.x=.5*(A.x+P.x),L.y=.5*(A.y+P.y),L.z=.5*(A.z+P.z);var U=t.magnitudeSquared(t.subtract(P,L,x)),q=Math.sqrt(U),D=g;D.x=a.x,D.y=o.y,D.z=u.z;var B=M;B.x=s.x,B.y=c.y,B.z=l.z;var F=t.multiplyByScalar(t.add(D,B,x),.5,S),G=0;for(O=0;z>O;O++){t.clone(e[O],i);var W=t.magnitude(t.subtract(i,F,x));W>G&&(G=W);var V=t.magnitudeSquared(t.subtract(i,L,x));if(V>U){var Y=Math.sqrt(V);q=.5*(q+Y),U=q*q;var k=Y-q;L.x=(q*L.x+k*i.x)/Y,L.y=(q*L.y+k*i.y)/Y,L.z=(q*L.z+k*i.z)/Y}}return G>q?(t.clone(L,n.center),n.radius=q):(t.clone(F,n.center),n.radius=G),n};var z=new o,O=new t,T=new t,N=new e,_=new e;f.fromRectangle2D=function(t,e,n){return f.fromRectangleWithHeights2D(t,e,0,0,n)},f.fromRectangleWithHeights2D=function(e,i,a,o,u){if(r(u)||(u=new f),!r(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;i=n(i,z),l.southwest(e,N),N.height=a,l.northeast(e,_),_.height=o;var s=i.project(N,O),c=i.project(_,T),h=c.x-s.x,d=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(h*h+d*d+m*m);var y=u.center;return y.x=s.x+.5*h,y.y=s.y+.5*d,y.z=s.z+.5*m,u};var I=[];f.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=l.subsample(t,e,i,I)),f.fromPoints(u,o)},f.fromVertices=function(e,i,a,o){if(r(o)||(o=new f),!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=w;u.x=e[0]+i.x,u.y=e[1]+i.y,u.z=e[2]+i.z;for(var s=t.clone(u,h),c=t.clone(u,d),l=t.clone(u,m),z=t.clone(u,y),O=t.clone(u,p),T=t.clone(u,v),N=e.length,_=0;N>_;_+=a){var I=e[_]+i.x,R=e[_+1]+i.y,b=e[_+2]+i.z;u.x=I,u.y=R,u.z=b,I<s.x&&t.clone(u,s),I>z.x&&t.clone(u,z),R<c.y&&t.clone(u,c),R>O.y&&t.clone(u,O),b<l.z&&t.clone(u,l),b>T.z&&t.clone(u,T)}var A=t.magnitudeSquared(t.subtract(z,s,x)),P=t.magnitudeSquared(t.subtract(O,c,x)),C=t.magnitudeSquared(t.subtract(T,l,x)),L=s,U=z,q=A;P>q&&(q=P,L=c,U=O),C>q&&(q=C,L=l,U=T);var D=E;D.x=.5*(L.x+U.x),D.y=.5*(L.y+U.y),D.z=.5*(L.z+U.z);var B=t.magnitudeSquared(t.subtract(U,D,x)),F=Math.sqrt(B),G=g;G.x=s.x,G.y=c.y,G.z=l.z;var W=M;W.x=z.x,W.y=O.y,W.z=T.z;var V=t.multiplyByScalar(t.add(G,W,x),.5,S),Y=0;for(_=0;N>_;_+=a){u.x=e[_]+i.x,u.y=e[_+1]+i.y,u.z=e[_+2]+i.z;var k=t.magnitude(t.subtract(u,V,x));k>Y&&(Y=k);var j=t.magnitudeSquared(t.subtract(u,D,x));if(j>B){var H=Math.sqrt(j);F=.5*(F+H),B=F*F;var Z=H-F;D.x=(F*D.x+Z*u.x)/H,D.y=(F*D.y+Z*u.y)/H,D.z=(F*D.z+Z*u.z)/H}}return Y>F?(t.clone(D,o.center),o.radius=F):(t.clone(V,o.center),o.radius=Y),o},f.fromCornerPoints=function(e,n,i){r(i)||(i=new f);var a=i.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),i.radius=t.distance(a,n),i},f.fromEllipsoid=function(e,n){return r(n)||(n=new f),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n},f.clone=function(e,n){return r(e)?r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new f(e.center,e.radius):void 0},f.packedLength=4,f.pack=function(t,e,r){r=n(r,0);var i=t.center;e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius},f.unpack=function(t,e,i){e=n(e,0),r(i)||(i=new f);var a=i.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],i.radius=t[e],i};var R=new t,b=new t;f.union=function(e,n,i){r(i)||(i=new f);var a=e.center,o=n.center;t.add(a,o,b);var u=t.multiplyByScalar(b,.5,b),s=t.magnitude(t.subtract(a,u,R))+e.radius,c=t.magnitude(t.subtract(o,u,R))+n.radius;return i.radius=Math.max(s,c),t.clone(u,i.center),i};var A=new t;f.expand=function(e,n,r){r=f.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,A));return i>r.radius&&(r.radius=i),r},f.intersect=function(e,n){var r=e.center,i=e.radius,a=t.dot(n,r)+n.w;return-i>a?u.OUTSIDE:i>a?u.INTERSECTING:u.INSIDE},f.transform=function(t,e,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var P=new t;f.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,P);return t.magnitudeSquared(r)-e.radius*e.radius},f.transformWithoutScale=function(t,e,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var C=new t;f.computePlaneDistances=function(e,n,i,a){r(a)||(a=new s);var o=t.subtract(e.center,n,C),u=t.multiplyByScalar(i,t.dot(i,o),C),c=t.magnitude(u);return a.start=c-e.radius,a.stop=c+e.radius,a};for(var L=new t,U=new t,q=new t,D=new t,B=new t,F=new e,G=new Array(8),W=0;8>W;++W)G[W]=new t;var V=new o;return f.projectTo2D=function(e,r,i){r=n(r,V);var a=r.ellipsoid,o=e.center,u=e.radius,s=a.geodeticSurfaceNormal(o,L),c=t.cross(t.UNIT_Z,s,U);t.normalize(c,c);var l=t.cross(s,c,q);t.normalize(l,l),t.multiplyByScalar(s,u,s),t.multiplyByScalar(l,u,l),t.multiplyByScalar(c,u,c);var h=t.negate(l,B),d=t.negate(c,D),m=G,y=m[0];t.add(s,l,y),t.add(y,c,y),y=m[1],t.add(s,l,y),t.add(y,d,y),y=m[2],t.add(s,h,y),t.add(y,d,y),y=m[3],t.add(s,h,y),t.add(y,c,y),t.negate(s,s),y=m[4],t.add(s,l,y),t.add(y,c,y),y=m[5],t.add(s,l,y),t.add(y,d,y),y=m[6],t.add(s,h,y),t.add(y,d,y),y=m[7],t.add(s,h,y),t.add(y,c,y);for(var p=m.length,v=0;p>v;++v){var w=m[v];t.add(o,w,w);var x=a.cartesianToCartographic(w,F);r.project(x,w)}i=f.fromPoints(m,i),o=i.center;var E=o.x,g=o.y,M=o.z;return o.x=M,o.y=E,o.z=g,i},f.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},f.prototype.intersect=function(t){return f.intersect(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/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(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){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n):new a(t.x,t.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r]=e.y},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.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.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.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 s=new a,c=new a;a.angleBetween=function(t,e){return a.normalize(t,s),a.normalize(e,c),i.acosClamped(a.dot(s,c))};var l=new a;return a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,l);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.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r},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){return a.equalsEpsilon(this,t,e)},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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof e[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",t(document[i])?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",t(document[i])&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",t(document[i])?r.fullscreenElement=i:(i=s+"FullScreenElement",t(document[i])&&(r.fullscreenElement=i)),i=s+"fullscreenchange",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t){i.supportsFullscreen()&&t[r.requestFullscreen]()},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;r>n;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(m)){m=!1;var t=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(m=!0,y=r(t[1]))}return m}function a(){return i()&&y}function o(){if(!e(p)&&(p=!1,!i()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(p=!0,v=r(t[1]))}return p}function u(){return o()&&v}function s(){if(!e(w)){w=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==t&&(w=!0,x=r(t[1]),x.isNightly=!!t[2])}return w}function c(){return s()&&x}function l(){if(!e(E)){E=!1;var t;"Microsoft Internet Explorer"===navigator.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(E=!0,g=r(t[1]))):"Netscape"===navigator.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(E=!0,g=r(t[1])))}return E}function f(){return l()&&g}function h(){if(!e(M)){M=!1;var t=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(M=!0,S=r(t[1]))}return M}function d(){return h()&&S}var m,y,p,v,w,x,E,g,M,S,z={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:d,hardwareConcurrency:t(navigator.hardwareConcurrency,3)};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,e,n,r,i){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(t){switch(t){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(t){return t instanceof Int8Array?a.BYTE:t instanceof Uint8Array?a.UNSIGNED_BYTE:t instanceof Int16Array?a.SHORT:t instanceof Uint16Array?a.UNSIGNED_SHORT:t instanceof Float32Array?a.FLOAT:t instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(t){return e(t)&&(t===a.BYTE||t===a.UNSIGNED_BYTE||t===a.SHORT||t===a.UNSIGNED_SHORT||t===a.FLOAT||t===a.DOUBLE)},a.createTypedArray=function(t,e){switch(t){case a.BYTE:return new Int8Array(e);case a.UNSIGNED_BYTE:return new Uint8Array(e);case a.SHORT:return new Int16Array(e);case a.UNSIGNED_SHORT:return new Uint16Array(e);case a.FLOAT:return new Float32Array(e);case a.DOUBLE:return new Float64Array(e);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(e,r,i,o){switch(i=t(i,0),o=t(o,(r.byteLength-i)/a.getSizeInBytes(e)),e){case a.BYTE:return new Int8Array(r,i,o);case a.UNSIGNED_BYTE:return new Uint8Array(r,i,o);case a.SHORT:return new Int16Array(r,i,o);case a.UNSIGNED_SHORT:return new Uint16Array(r,i,o);case a.FLOAT:return new Float32Array(r,i,o);case a.DOUBLE:return new Float64Array(r,i,o);default:throw new n("componentDatatype is not a valid value.")}},i(a)}),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"],function(t){"use strict";var e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(t){return t===e.POINTS||t===e.LINES||t===e.LINE_LOOP||t===e.LINE_STRIP||t===e.TRIANGLES||t===e.TRIANGLE_STRIP||t===e.TRIANGLE_FAN}};return t(e)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";var a=function(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)};return a.computeNumberOfVertices=function(t){var r=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&e(t.attributes[i])&&e(t.attributes[i].values)){var a=t.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t){"use strict";var e=function(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 e}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";var e=function(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"],function(t,e,n,r){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,i){return t>r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(i)}),define("Core/VertexFormat",["./defaultValue","./freezeObject"],function(t,e){"use strict";var n=function(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 n.POSITION_ONLY=e(new n({position:!0})),n.POSITION_AND_NORMAL=e(new n({position:!0,normal:!0})),n.POSITION_NORMAL_AND_ST=e(new n({position:!0,normal:!0,st:!0})),n.POSITION_AND_ST=e(new n({position:!0,st:!0})),n.POSITION_AND_COLOR=e(new n({position:!0,color:!0})),n.ALL=e(new n({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),n.DEFAULT=n.POSITION_NORMAL_AND_ST,n}),define("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(t,e,n,r,i,a,o,u,s,c,l,f,h,d){"use strict";var m=new n,y=new n,p=new n,v=new n,w=new n,x=new n(1,1,1),E=Math.cos,g=Math.sin,M=function(t){t=i(t,i.EMPTY_OBJECT);var e=i(t.radii,x),r=i(t.stackPartitions,64),a=i(t.slicePartitions,64),o=i(t.vertexFormat,d.DEFAULT);this._radii=n.clone(e),this._stackPartitions=r,this._slicePartitions=a,this._vertexFormat=o,this._workerName="createEllipsoidGeometry"};return M.createGeometry=function(i){var a,d,x=i._radii,M=o.fromCartesian3(x),S=i._vertexFormat,z=i._slicePartitions+1,O=i._stackPartitions+1,T=O*z,N=new Float64Array(3*T),_=6*(z-1)*(O-1),I=l.createTypedArray(T,_),R=S.normal?new Float32Array(3*T):void 0,b=S.tangent?new Float32Array(3*T):void 0,A=S.binormal?new Float32Array(3*T):void 0,P=S.st?new Float32Array(2*T):void 0,C=new Array(z),L=new Array(z),U=0;for(a=0;z>a;a++){var q=f.TWO_PI*a/(z-1);C[a]=E(q),L[a]=g(q),N[U++]=0,N[U++]=0,N[U++]=x.z}for(a=1;O-1>a;a++){var D=Math.PI*a/(O-1),B=g(D),F=x.x*B,G=x.y*B,W=x.z*E(D);for(d=0;z>d;d++)N[U++]=C[d]*F,N[U++]=L[d]*G,N[U++]=W}for(a=0;z>a;a++)N[U++]=0,N[U++]=0,N[U++]=-x.z;var V=new c;S.position&&(V.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:N}));var Y=0,k=0,j=0,H=0;if(S.st||S.normal||S.tangent||S.binormal){for(a=0;T>a;a++){var Z=n.fromArray(N,3*a,m),X=M.geodeticSurfaceNormal(Z,y);if(S.st){var K=e.negate(X,w);e.magnitude(K)<f.EPSILON6&&(U=3*(a+z*Math.floor(.5*O)),U>N.length&&(U=3*(a-z*Math.floor(.5*O))),n.fromArray(N,U,K),M.geodeticSurfaceNormal(K,K),e.negate(K,K)),P[Y++]=Math.atan2(K.y,K.x)/f.TWO_PI+.5,P[Y++]=Math.asin(X.z)/Math.PI+.5}if(S.normal&&(R[k++]=X.x,R[k++]=X.y,R[k++]=X.z),S.tangent||S.binormal){var J=p;if(z>a||a>T-z-1?(n.cross(n.UNIT_X,X,J),n.normalize(J,J)):(n.cross(n.UNIT_Z,X,J),n.normalize(J,J)),S.tangent&&(b[j++]=J.x,b[j++]=J.y,b[j++]=J.z),S.binormal){var Q=n.cross(X,J,v);n.normalize(Q,Q),A[H++]=Q.x,A[H++]=Q.y,A[H++]=Q.z}}}S.st&&(V.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:P})),S.normal&&(V.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R})),S.tangent&&(V.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:b})),S.binormal&&(V.binormal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:A}))}for(U=0,a=0;O>a;a++){var $=a*z,te=(a+1)*z;for(d=0;z-1>d;d++)I[U++]=te+d,I[U++]=te+d+1,I[U++]=$+d+1,I[U++]=te+d,I[U++]=$+d+1,I[U++]=$+d}return new u({attributes:V,indices:I,primitiveType:h.TRIANGLES,boundingSphere:t.fromEllipsoid(M)})},M}),define("Core/SphereGeometry",["./Cartesian3","./defaultValue","./EllipsoidGeometry"],function(t,e,n){"use strict";var r=function(r){var i=e(r.radius,1),a=new t(i,i,i),o={radii:a,stackPartitions:r.stackPartitions,slicePartitions:r.slicePartitions,vertexFormat:r.vertexFormat};this._ellipsoidGeometry=new n(o),this._workerName="createSphereGeometry"};return r.createGeometry=function(t){return n.createGeometry(t._ellipsoidGeometry)},r}),define("Workers/createSphereGeometry",["../Core/SphereGeometry"],function(t){"use strict";return t.createGeometry})}(); +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==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(n){e=n.stack}this.stack=e}return 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("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:0>t?-1:0},i.signNotZero=function(t){return 0>t?-1:1},i.toSNorm=function(t){return Math.round(255*(.5*i.clamp(t,-1,1)+.5))},i.fromSNorm=function(t){return i.clamp(t,0,255)/255*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.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 i>=a||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;t>=r;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 e>t?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";function a(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}a.fromSpherical=function(n,r){e(r)||(r=new a);var i=n.clock,o=n.cone,u=t(n.magnitude,1),E=u*Math.sin(o);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(t,n,r,i){return e(i)?(i.x=t,i.y=n,i.z=r,i):new a(t,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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){a.normalize(t,E),a.normalize(e,s);var n=a.dot(E,s),r=a.magnitude(a.cross(E,s,E));return Math.atan2(r,n)};var c=new a;a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,c);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):n.y<=n.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},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)},a.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},a.fromDegrees=function(t,e,n,r,o){var u=i.toRadians(t),E=i.toRadians(e);return a.fromRadians(u,E,n,r,o)};var _=new a,l=new a,R=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=t(i,0);var E=e(o)?o.radiiSquared:R,s=Math.cos(r);_.x=s*Math.cos(n),_.y=s*Math.sin(n),_.z=Math.sin(r),_=a.normalize(_,_),a.multiplyComponents(E,_,l);var c=Math.sqrt(a.dot(_,l));return l=a.divideByScalar(l,c,l),_=a.multiplyByScalar(_,i,_),e(u)||(u=new a),a.add(l,_,u)},a.fromDegreesArray=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=i.toRadians(t[o]);return a.fromRadiansArray(r,e,n)},a.fromRadiansArray=function(t,n,r){var i=t.length;e(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],E=t[o+1];r[o/2]=a.fromRadians(u,E,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o+=3)r[o]=i.toRadians(t[o]),r[o+1]=i.toRadians(t[o+1]),r[o+2]=t[o+2];return a.fromRadiansArrayHeights(r,e,n)},a.fromRadiansArrayHeights=function(t,n,r){var i=t.length;e(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],E=t[o+1],s=t[o+2];r[o/3]=a.fromRadians(u,E,s,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(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+")"},a}),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,R=i.x,T=i.y,A=i.z,f=c*c*R*R,d=_*_*T*T,N=l*l*A*A,h=f+d+N,I=Math.sqrt(1/h),S=t.multiplyByScalar(n,I,a);if(E>h)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,F,L,P,v,w,x,D,B,g=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{g-=z,U=1/(1+g*m),F=1/(1+g*M),L=1/(1+g*O),P=U*U,v=F*F,w=L*L,x=P*U,D=v*F,B=w*L,p=f*P+d*v+N*w-1,C=f*x*m+d*D*M+N*B*O;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*F,s.z=l*L,s):new t(c*U,_*F,l*L)}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),R=a.EPSILON1;return u.fromCartesian=function(e,r,i){var T=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:l,f=n(r)?r._centerToleranceSquared:R,d=o(e,T,A,f,s);if(n(d)){var N=t.multiplyComponents(e,A,E);N=t.normalize(N,N);var h=t.subtract(e,d,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),m=a.sign(t.dot(h,e))*t.magnitude(h);return n(i)?(i.longitude=I,i.latitude=S,i.height=m,i):new u(I,S,m)}},u.clone=function(t,e){return n(t)?n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height):void 0},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}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,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){i=n(i,0),t.pack(e._radii,r,i)},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;n>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var R=new t,T=new t,A=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,T);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;n>i;++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}),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","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(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 u(t){for(var e=0,n=0;9>n;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function E(t){for(var e=0,n=0;3>n;++n){var r=t[o.getElementIndex(R[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function s(t,e){for(var n=a.EPSILON15,r=0,i=1,u=0;3>u;++u){var E=Math.abs(t[o.getElementIndex(R[u],l[u])]);E>r&&(i=u,r=E)}var s=1,c=0,_=l[i],T=R[i];if(Math.abs(t[o.getElementIndex(T,_)])>n){var A,f=t[o.getElementIndex(T,T)],d=t[o.getElementIndex(_,_)],N=t[o.getElementIndex(T,_)],h=(f-d)/2/N;A=0>h?-1/(-h+Math.sqrt(1+h*h)):1/(h+Math.sqrt(1+h*h)),s=1/Math.sqrt(1+A*A),c=A*s}return e=o.clone(o.IDENTITY,e),e[o.getElementIndex(_,_)]=e[o.getElementIndex(T,T)]=s,e[o.getElementIndex(T,_)]=c,e[o.getElementIndex(_,T)]=-c,e}o.packedLength=9,o.pack=function(t,n,r){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]},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),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},o.clone=function(t,e){return n(t)?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 o(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},o.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new o),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},o.fromColumnMajorArray=function(t,e){return o.clone(t,e)},o.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 o(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},o.fromQuaternion=function(t,e){var r=t.x*t.x,i=t.x*t.y,a=t.x*t.z,u=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,R=t.w*t.w,T=r-E-_+R,A=2*(i-l),f=2*(a+c),d=2*(i+l),N=-r+E-_+R,h=2*(s-u),I=2*(a-c),S=2*(s+u),m=-r-E+_+R;return n(e)?(e[0]=T,e[1]=d,e[2]=I,e[3]=A,e[4]=N,e[5]=S,e[6]=f,e[7]=h,e[8]=m,e):new o(T,A,f,d,N,h,I,S,m)},o.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 o(t.x,0,0,0,t.y,0,0,0,t.z)},o.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 o(t,0,0,0,t,0,0,0,t)},o.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 o(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},o.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 o(1,0,0,0,r,-i,0,i,r)},o.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 o(r,0,i,0,1,0,-i,0,r)},o.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 o(r,-i,0,i,r,0,0,0,1)},o.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]]},o.getElementIndex=function(t,e){return 3*t+e},o.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},o.setColumn=function(t,e,n,r){r=o.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},o.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},o.setRow=function(t,e,n,r){return r=o.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var c=new t;o.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],c)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],c)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],c)),n};var _=new t;o.getMaximumScale=function(e){return o.getScale(e,_),t.maximumComponent(_)},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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],T=new o,A=new o;return o.computeEigenDecomposition=function(t,e){var r=a.EPSILON20,i=10,c=0,_=0;n(e)||(e={});for(var l=e.unitary=o.clone(o.IDENTITY,e.unitary),R=e.diagonal=o.clone(t,e.diagonal),f=r*u(R);i>_&&E(R)>f;)s(R,T),o.transpose(T,A),o.multiply(R,T,R),o.multiply(A,R,R),o.multiply(l,T,l),++c>2&&(++_,c=0);return e},o.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},o.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)},o.inverse=function(t,e){var n=t[0],i=t[1],u=t[2],E=t[3],s=t[4],c=t[5],_=t[6],l=t[7],R=t[8],T=o.determinant(t);if(Math.abs(T)<=a.EPSILON15)throw new r("matrix is not invertible");e[0]=s*R-l*c,e[1]=l*u-i*R,e[2]=i*c-s*u,e[3]=_*c-E*R,e[4]=n*R-_*u,e[5]=E*u-n*c,e[6]=E*l-_*s,e[7]=_*i-n*l,e[8]=n*s-E*i;var A=1/T;return o.multiplyByScalar(e,A,e)},o.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]},o.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},o.IDENTITY=i(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=i(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.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]},o.prototype.equalsEpsilon=function(t,e){return o.equalsEpsilon(this,t,e)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return e(t)?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):void 0},a.packedLength=4,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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.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.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(n){e=n.stack}this.stack=e}return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(t,e,r,i,a,o,u,E,s,c,_,l,R,T,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(T,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(l,0),this[15]=n(f,0)}s.packedLength=16,s.pack=function(t,e,r){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]},s.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new s),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},s.clone=function(t,e){return r(t)?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 s(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]):void 0},s.fromArray=s.unpack,s.fromColumnMajorArray=function(t,e){return s.clone(t,e)},s.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 s(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])},s.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 s(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)},s.fromTranslationQuaternionRotationScale=function(t,e,n,i){r(i)||(i=new s);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,c=e.x*e.y,_=e.x*e.z,l=e.x*e.w,R=e.y*e.y,T=e.y*e.z,A=e.y*e.w,f=e.z*e.z,d=e.z*e.w,N=e.w*e.w,h=E-R-f+N,I=2*(c-d),S=2*(_+A),m=2*(c+d),M=-E+R-f+N,O=2*(T-l),y=2*(_-A),p=2*(T+l),C=-E-R+f+N;return i[0]=h*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},s.fromTranslationRotationScale=function(t,e){return s.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},s.fromTranslation=function(t,e){return s.fromRotationTranslation(u.IDENTITY,t,e)},s.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 s(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},s.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 s(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var c=new t,_=new t,l=new t;s.fromCamera=function(e,n){var i=e.eye,a=e.target,o=e.up;t.normalize(t.subtract(a,i,c),c),t.normalize(t.cross(c,o,_),_),t.normalize(t.cross(_,c,l),l);var u=_.x,E=_.y,R=_.z,T=c.x,A=c.y,f=c.z,d=l.x,N=l.y,h=l.z,I=i.x,S=i.y,m=i.z,M=u*-I+E*-S+R*-m,O=d*-I+N*-S+h*-m,y=T*I+A*S+f*m; +return r(n)?(n[0]=u,n[1]=d,n[2]=-T,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=R,n[9]=h,n[10]=-f,n[11]=0,n[12]=M,n[13]=O,n[14]=y,n[15]=1,n):new s(u,E,R,M,d,N,h,O,-T,-A,-f,y,0,0,0,1)},s.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},s.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},s.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,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]=l,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},s.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},s.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,R=c,T=_,A=a+s,f=o+c,d=e+_,N=1;return i[0]=l,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]=T,i[11]=0,i[12]=A,i[13]=f,i[14]=d,i[15]=N,i},s.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]]},s.getElementIndex=function(t,e){return 4*t+e},s.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},s.setColumn=function(t,e,n,r){r=s.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},s.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},s.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},s.setRow=function(t,e,n,r){return r=s.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;s.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 T=new t;s.getMaximumScale=function(e){return s.getScale(e,T),t.maximumComponent(T)},s.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],R=t[10],T=t[11],A=t[12],f=t[13],d=t[14],N=t[15],h=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],F=e[10],L=e[11],P=e[12],v=e[13],w=e[14],x=e[15],D=r*h+u*I+_*S+A*m,B=i*h+E*I+l*S+f*m,g=a*h+s*I+R*S+d*m,z=o*h+c*I+T*S+N*m,G=r*M+u*O+_*y+A*p,b=i*M+E*O+l*y+f*p,X=a*M+s*O+R*y+d*p,V=o*M+c*O+T*y+N*p,q=r*C+u*U+_*F+A*L,H=i*C+E*U+l*F+f*L,W=a*C+s*U+R*F+d*L,Y=o*C+c*U+T*F+N*L,k=r*P+u*v+_*w+A*x,K=i*P+E*v+l*w+f*x,Z=a*P+s*v+R*w+d*x,j=o*P+c*v+T*w+N*x;return n[0]=D,n[1]=B,n[2]=g,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},s.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},s.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},s.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],R=t[13],T=t[14],A=e[0],f=e[1],d=e[2],N=e[4],h=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*A+o*f+s*d,U=i*A+u*f+c*d,F=a*A+E*f+_*d,L=r*N+o*h+s*I,P=i*N+u*h+c*I,v=a*N+E*h+_*I,w=r*S+o*m+s*M,x=i*S+u*m+c*M,D=a*S+E*m+_*M,B=r*O+o*y+s*p+l,g=i*O+u*y+c*p+R,z=a*O+E*y+_*p+T;return n[0]=C,n[1]=U,n[2]=F,n[3]=0,n[4]=L,n[5]=P,n[6]=v,n[7]=0,n[8]=w,n[9]=x,n[10]=D,n[11]=0,n[12]=B,n[13]=g,n[14]=z,n[15]=1,n},s.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],R=e[1],T=e[2],A=e[3],f=e[4],d=e[5],N=e[6],h=e[7],I=e[8],S=r*l+o*R+s*T,m=i*l+u*R+c*T,M=a*l+E*R+_*T,O=r*A+o*f+s*d,y=i*A+u*f+c*d,p=a*A+E*f+_*d,C=r*N+o*h+s*I,U=i*N+u*h+c*I,F=a*N+E*h+_*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]=F,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},s.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;s.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,s.multiplyByScale(t,A,n)},s.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?s.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)},s.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},s.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},s.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},s.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},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[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},s.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},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[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},s.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]},s.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},s.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},s.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 f=new u,d=new u,N=new e,h=new e(0,0,0,1);return s.inverse=function(t,n){if(u.equalsEpsilon(s.getRotation(t,f),d,o.EPSILON7)&&e.equals(s.getRow(t,3,N),h))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],c=t[12],_=t[1],l=t[5],R=t[9],T=t[13],A=t[2],I=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,F=I*p,L=m*O,P=I*y,v=S*O,w=A*p,x=m*M,D=A*y,B=S*M,g=A*O,z=I*M,G=C*l+L*R+P*T-(U*l+F*R+v*T),b=U*_+w*R+B*T-(C*_+x*R+D*T),X=F*_+x*l+g*T-(L*_+w*l+z*T),V=v*_+D*l+z*R-(P*_+B*l+g*R),q=U*i+F*a+v*c-(C*i+L*a+P*c),H=C*r+x*a+D*c-(U*r+w*a+B*c),W=L*r+w*i+z*c-(F*r+x*i+g*c),Y=P*r+B*i+g*a-(v*r+D*i+z*a);C=a*T,U=c*R,F=i*T,L=c*l,P=i*R,v=a*l,w=r*T,x=c*_,D=r*R,B=a*_,g=r*l,z=i*_;var k=C*O+L*y+P*p-(U*O+F*y+v*p),K=U*M+w*y+B*p-(C*M+x*y+D*p),Z=F*M+x*O+g*p-(L*M+w*O+z*p),j=v*M+D*O+z*y-(P*M+B*O+g*y),Q=F*S+v*m+U*I-(P*m+C*I+L*S),J=D*m+C*A+x*S-(w*S+B*m+U*A),$=w*I+z*m+L*A-(g*m+F*A+x*I),tt=g*S+P*A+B*I-(D*I+z*S+v*A),et=r*G+i*b+a*X+c*V;if(Math.abs(et)<o.EPSILON20)throw new E("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},s.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],R=t[14],T=-n*_-r*l-i*R,A=-a*_-o*l-u*R,f=-E*_-s*l-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]=T,e[13]=A,e[14]=f,e[15]=1,e},s.IDENTITY=a(new s(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),s.ZERO=a(new s(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN0ROW3=3,s.COLUMN1ROW0=4,s.COLUMN1ROW1=5,s.COLUMN1ROW2=6,s.COLUMN1ROW3=7,s.COLUMN2ROW0=8,s.COLUMN2ROW1=9,s.COLUMN2ROW2=10,s.COLUMN2ROW3=11,s.COLUMN3ROW0=12,s.COLUMN3ROW1=13,s.COLUMN3ROW2=14,s.COLUMN3ROW3=15,s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.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]},s.prototype.equalsEpsilon=function(t,e){return s.equalsEpsilon(this,t,e)},s.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},s}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function i(e,n){this.normal=t.clone(e),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-t.dot(r,n);return e(a)?(t.clone(r,a.normal),a.distance=o,a):new i(r,o)};var a=new t;return i.fromCartesian4=function(n,r){var o=t.fromCartesian4(n,a),u=n.w;return e(r)?(t.clone(o,r.normal),r.distance=u,r):new i(o,u)},i.getPointDistance=function(e,n){return t.dot(e.normal,n)+e.distance},i.ORIGIN_XY_PLANE=r(new i(t.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=r(new i(t.UNIT_X,0)),i.ORIGIN_ZX_PLANE=r(new i(t.UNIT_Y,0)),i}),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){r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north},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 n>e&&(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 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 T=R.longitude>=0?R.longitude:R.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(e)?(e.west=r,e.south=s,e.east=i,e.north=c,e):new E(r,s,i,c)},E.clone=function(t,e){return n(t)?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):void 0},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;a>i&&(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;a>i&&o>0?i+=u.TWO_PI:s>o&&i>0&&(o+=u.TWO_PI),a>i&&0>s?s+=u.TWO_PI:s>o&&0>a&&(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),R=Math.min(t.north,e.north);if(!(l>=R))return n(r)?(r.west=c,r.south=l,r.east=_,r.north=R,r):new E(c,l,_,R)}},E.union=function(t,e,r){return n(r)||(r=new E),r.west=Math.min(t.west,e.west),r.south=Math.min(t.south,e.south),r.east=Math.max(t.east,e.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 i>a&&(a+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(a>n||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,R=t.east,T=t.west,A=s;A.height=i,A.longitude=T,A.latitude=_,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.latitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=T,o[c]=r.cartographicToCartesian(A,o[c]),c++,0>_?A.latitude=_:l>0?A.latitude=l:A.latitude=0;for(var f=1;8>f;++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=T,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","./Plane","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_,l){"use strict";function R(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var T=new t,A=new t,f=new t,d=new t,N=new t,h=new t,I=new t,S=new t,m=new t,M=new t,O=new t,y=new t;R.fromPoints=function(e,n){if(r(n)||(n=new R),!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],I),a=t.clone(i,T),o=t.clone(i,A),u=t.clone(i,f),E=t.clone(i,d),s=t.clone(i,N),c=t.clone(i,h),_=e.length,l=1;_>l;l++){t.clone(e[l],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 F=t.magnitudeSquared(t.subtract(E,a,S)),L=t.magnitudeSquared(t.subtract(s,o,S)),P=t.magnitudeSquared(t.subtract(c,u,S)),v=a,w=E,x=F;L>x&&(x=L,v=o,w=s),P>x&&(x=P,v=u,w=c);var D=m;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,S)),g=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,S),.5,y),X=0;for(l=0;_>l;l++){t.clone(e[l],i);var V=t.magnitude(t.subtract(i,b,S));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(i,D,S));if(q>B){var H=Math.sqrt(q);g=.5*(g+H),B=g*g;var W=H-g;D.x=(g*D.x+W*i.x)/H,D.y=(g*D.y+W*i.y)/H,D.z=(g*D.z+W*i.z)/H}}return X>g?(t.clone(D,n.center),n.radius=g):(t.clone(b,n.center),n.radius=X),n};var p=new o,C=new t,U=new t,F=new e,L=new e;R.fromRectangle2D=function(t,e,n){return R.fromRectangleWithHeights2D(t,e,0,0,n)},R.fromRectangleWithHeights2D=function(e,i,a,o,u){if(r(u)||(u=new R),!r(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;i=n(i,p),l.southwest(e,F),F.height=a,l.northeast(e,L),L.height=o;var E=i.project(F,C),s=i.project(L,U),c=s.x-E.x,_=s.y-E.y,T=s.z-E.z;u.radius=.5*Math.sqrt(c*c+_*_+T*T);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*_,A.z=E.z+.5*T,u};var P=[];R.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=l.subsample(t,e,i,P)),R.fromPoints(u,o)},R.fromVertices=function(e,i,a,o){if(r(o)||(o=new R),!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=I;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,A),c=t.clone(u,f),_=t.clone(u,d),l=t.clone(u,N),p=t.clone(u,h),C=e.length,U=0;C>U;U+=a){var F=e[U]+i.x,L=e[U+1]+i.y,P=e[U+2]+i.z;u.x=F,u.y=L,u.z=P,F<E.x&&t.clone(u,E),F>_.x&&t.clone(u,_),L<s.y&&t.clone(u,s),L>l.y&&t.clone(u,l),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var v=t.magnitudeSquared(t.subtract(_,E,S)),w=t.magnitudeSquared(t.subtract(l,s,S)),x=t.magnitudeSquared(t.subtract(p,c,S)),D=E,B=_,g=v;w>g&&(g=w,D=s,B=l),x>g&&(g=x,D=c,B=p);var z=m;z.x=.5*(D.x+B.x),z.y=.5*(D.y+B.y),z.z=.5*(D.z+B.z);var G=t.magnitudeSquared(t.subtract(B,z,S)),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=l.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,S),.5,y),H=0;for(U=0;C>U;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,S));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,S));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 H>b?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},R.fromEncodedCartesianVertices=function(e,n,i){if(r(i)||(i=new R),!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=I;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,A),E=t.clone(a,f),s=t.clone(a,d),c=t.clone(a,N),_=t.clone(a,h),l=e.length,p=0;l>p;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],F=e[p+2]+n[p+2];a.x=C,a.y=U,a.z=F,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),F<E.z&&t.clone(a,E),F>_.z&&t.clone(a,_)}var L=t.magnitudeSquared(t.subtract(s,o,S)),P=t.magnitudeSquared(t.subtract(c,u,S)),v=t.magnitudeSquared(t.subtract(_,E,S)),w=o,x=s,D=L;P>D&&(D=P,w=u,x=c),v>D&&(D=v,w=E,x=_);var B=m;B.x=.5*(w.x+x.x),B.y=.5*(w.y+x.y),B.z=.5*(w.z+x.z);var g=t.magnitudeSquared(t.subtract(x,B,S)),z=Math.sqrt(g),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,S),.5,y),V=0;for(p=0;l>p;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,S));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(a,B,S));if(H>g){var W=Math.sqrt(H);z=.5*(z+W),g=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 V>z?(t.clone(B,i.center),i.radius=z):(t.clone(X,i.center),i.radius=V),i},R.fromCornerPoints=function(e,n,i){r(i)||(i=new R);var a=i.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),i.radius=t.distance(a,n),i},R.fromEllipsoid=function(e,n){return r(n)||(n=new R),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var v=new t;R.fromBoundingSpheres=function(e,n){if(r(n)||(n=new R),!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 R.clone(e[0],n);if(2===i)return R.union(e[0],e[1],n);for(var a=[],o=0;i>o;o++)a.push(e[o].center);n=R.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;i>o;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,v)+s.radius)}return n.radius=E,n};var w=new t,x=new t,D=new t;R.fromOrientedBoundingBox=function(e,n){r(n)||(n=new R);var i=e.halfAxes,a=s.getColumn(i,0,w),o=s.getColumn(i,1,x),u=s.getColumn(i,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},R.clone=function(e,n){return r(e)?r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new R(e.center,e.radius):void 0},R.packedLength=4,R.pack=function(t,e,r){r=n(r,0);var i=t.center;e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius},R.unpack=function(t,e,i){e=n(e,0),r(i)||(i=new R);var a=i.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],i.radius=t[e],i};var B=new t,g=new t;R.union=function(e,n,i){r(i)||(i=new R);var a=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,a,B),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,g);return t.add(l,a,l),t.clone(l,i.center),i.radius=_,i};var z=new t;R.expand=function(e,n,r){r=R.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,z));return i>r.radius&&(r.radius=i),r},R.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return-i>o?u.OUTSIDE:i>o?u.INTERSECTING:u.INSIDE},R.transform=function(t,e,n){return r(n)||(n=new R),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var G=new t;R.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,G);return t.magnitudeSquared(r)-e.radius*e.radius},R.transformWithoutScale=function(t,e,n){return r(n)||(n=new R),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var b=new t;R.computePlaneDistances=function(e,n,i,a){r(a)||(a=new E);var o=t.subtract(e.center,n,b),u=t.dot(i,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var X=new t,V=new t,q=new t,H=new t,W=new t,Y=new e,k=new Array(8),K=0;8>K;++K)k[K]=new t;var Z=new o;return R.projectTo2D=function(e,r,i){r=n(r,Z);var a=r.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,X),s=t.cross(t.UNIT_Z,E,V);t.normalize(s,s);var c=t.cross(E,s,q);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,W),l=t.negate(s,H),T=k,A=T[0];t.add(E,c,A),t.add(A,s,A),A=T[1],t.add(E,c,A),t.add(A,l,A),A=T[2],t.add(E,_,A),t.add(A,l,A),A=T[3],t.add(E,_,A),t.add(A,s,A),t.negate(E,E),A=T[4],t.add(E,c,A),t.add(A,s,A),A=T[5],t.add(E,c,A),t.add(A,l,A),A=T[6],t.add(E,_,A),t.add(A,l,A),A=T[7],t.add(E,_,A),t.add(A,s,A);for(var f=T.length,d=0;f>d;++d){var N=T[d];t.add(o,N,N);var h=a.cartesianToCartographic(N,Y);r.project(h,N)}i=R.fromPoints(T,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},R.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},R.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},R.prototype.intersectPlane=function(t){return R.intersectPlane(this,t)},R.prototype.distanceSquaredTo=function(t){return R.distanceSquaredTo(this,t)},R.prototype.computePlaneDistances=function(t,e,n){return R.computePlaneDistances(this,t,e,n)},R.prototype.isOccluded=function(t){return R.isOccluded(this,t)},R.prototype.equals=function(t){return R.equals(this,t)},R.prototype.clone=function(t){return R.clone(this,t)},R}),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){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n):new a(t.x,t.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r]=e.y},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.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.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("Renderer/WebGLConstants",["../Core/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/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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++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",t(document[i])?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",t(document[i])&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",t(document[i])?r.fullscreenElement=i:(i=E+"FullScreenElement",t(document[i])&&(r.fullscreenElement=i)),i=E+"fullscreenchange",t(document["on"+i])&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",t(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;r>n;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(h)){h=!1;var t=/ Chrome\/([\.0-9]+)/.exec(N.userAgent);null!==t&&(h=!0,I=r(t[1]))}return h}function a(){return i()&&I}function o(){if(!e(S)&&(S=!1,!i()&&/ Safari\/[\.0-9]+/.test(N.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(N.userAgent);null!==t&&(S=!0,m=r(t[1]))}return S}function u(){return o()&&m}function E(){if(!e(M)){M=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(N.userAgent);null!==t&&(M=!0,O=r(t[1]),O.isNightly=!!t[2])}return M}function s(){return E()&&O}function c(){if(!e(y)){y=!1;var t;"Microsoft Internet Explorer"===N.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(N.userAgent),null!==t&&(y=!0,p=r(t[1]))):"Netscape"===N.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(N.userAgent),null!==t&&(y=!0,p=r(t[1])))}return y}function _(){return c()&&p}function l(){if(!e(C)){C=!1;var t=/Firefox\/([\.0-9]+)/.exec(N.userAgent);null!==t&&(C=!0,U=r(t[1]))}return C}function R(){return e(F)||(F=/Windows/i.test(N.appVersion)),F}function T(){return l()&&U}function A(){return e(L)||(L="undefined"!=typeof PointerEvent&&(!e(N.pointerEnabled)||N.pointerEnabled)),L}function f(){if(!e(v)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;v=e(n)&&""!==n,v&&(P=n)}return v}function d(){return f()?P:void 0}var N;N="undefined"!=typeof navigator?navigator:{};var h,I,S,m,M,O,y,p,C,U,F,L,P,v,w={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isFirefox:l,firefoxVersion:T,isWindows:R,hardwareConcurrency:t(N.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:f,imageRenderingValue:d};return w.supportsFullscreen=function(){return n.supportsFullscreen()},w.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},w.supportsWebWorkers=function(){return"undefined"!=typeof Worker},w}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,e,n,r,i,a){"use strict";if(!i.supportsTypedArrays())return{};var o={BYTE:t.BYTE,UNSIGNED_BYTE:t.UNSIGNED_BYTE,SHORT:t.SHORT,UNSIGNED_SHORT:t.UNSIGNED_SHORT,FLOAT:t.FLOAT,DOUBLE:t.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},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 Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return n(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||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.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(t,n,i,a){switch(i=e(i,0),a=e(a,(n.byteLength-i)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,i,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,i,a);case o.SHORT:return new Int16Array(n,i,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,i,a);case o.FLOAT:return new Float32Array(n,i,a);case o.DOUBLE:return new Float64Array(n,i,a);default:throw new r("componentDatatype is not a valid value.")}},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",["../Renderer/WebGLConstants","./freezeObject"],function(t,e){"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(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 e(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=void 0}return a.computeNumberOfVertices=function(t){var r=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&e(t.attributes[i])&&e(t.attributes[i].values)){var a=t.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a={UNSIGNED_BYTE:t.UNSIGNED_BYTE,UNSIGNED_SHORT:t.UNSIGNED_SHORT,UNSIGNED_INT:t.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(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,n,r){return t>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,r):new Uint16Array(e,n,r)},r(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){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},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){return e(t)?(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):void 0},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,R,T){"use strict";function A(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,T.DEFAULT);this._radii=n.clone(e),this._stackPartitions=r,this._slicePartitions=a,this._vertexFormat=T.clone(o),this._workerName="createEllipsoidGeometry"}var f=new n,d=new n,N=new n,h=new n,I=new n,S=new n(1,1,1),m=Math.cos,M=Math.sin;A.packedLength=n.packedLength+T.packedLength+2,A.pack=function(t,e,r){r=i(r,0),n.pack(t._radii,e,r),r+=n.packedLength,T.pack(t._vertexFormat,e,r),r+=T.packedLength,e[r++]=t._stackPartitions,e[r]=t._slicePartitions};var O=new n,y=new T,p={radii:O,vertexFormat:y,stackPartitions:void 0,slicePartitions:void 0};return A.unpack=function(t,e,r){e=i(e,0);var o=n.unpack(t,e,O);e+=n.packedLength;var u=T.unpack(t,e,y);e+=T.packedLength;var E=t[e++],s=t[e];return a(r)?(r._radii=n.clone(o,r._radii),r._vertexFormat=T.clone(u,r._vertexFormat),r._stackPartitions=E,r._slicePartitions=s,r):(p.stackPartitions=E,p.slicePartitions=s,new A(p))},A.createGeometry=function(i){var a,o,T=i._radii,A=u.fromCartesian3(T),S=i._vertexFormat,O=i._slicePartitions+1,y=i._stackPartitions+1,p=y*O,C=new Float64Array(3*p),U=6*(O-1)*(y-1),F=_.createTypedArray(p,U),L=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(O),D=new Array(O),B=0;for(a=0;O>a;a++){var g=l.TWO_PI*a/(O-1);x[a]=m(g),D[a]=M(g),C[B++]=0,C[B++]=0,C[B++]=T.z}for(a=1;y-1>a;a++){var z=Math.PI*a/(y-1),G=M(z),b=T.x*G,X=T.y*G,V=T.z*m(z);for(o=0;O>o;o++)C[B++]=x[o]*b,C[B++]=D[o]*X,C[B++]=V}for(a=0;O>a;a++)C[B++]=0,C[B++]=0,C[B++]=-T.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(a=0;p>a;a++){var K=n.fromArray(C,3*a,f),Z=A.geodeticSurfaceNormal(K,d);if(S.st){var j=e.negate(Z,I);e.magnitude(j)<l.EPSILON6&&(B=3*(a+O*Math.floor(.5*y)),B>C.length&&(B=3*(a-O*Math.floor(.5*y))),n.fromArray(C,B,j),A.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&&(L[W++]=Z.x,L[W++]=Z.y,L[W++]=Z.z),S.tangent||S.binormal){var Q=N;if(O>a||a>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,h);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:L})),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(B=0,a=0;y>a;a++){var $=a*O,tt=(a+1)*O;for(o=0;O-1>o;o++)F[B++]=tt+o,F[B++]=tt+o+1,F[B++]=$+o+1,F[B++]=tt+o,F[B++]=$+o+1,F[B++]=$+o}return new E({attributes:q,indices:F,primitiveType:R.TRIANGLES,boundingSphere:t.fromEllipsoid(A)})},A}),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){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 diff --git a/Workers/createSphereOutlineGeometry.js b/Workers/createSphereOutlineGeometry.js index 05f1323..8b2b1a9 100644 --- a/Workers/createSphereOutlineGeometry.js +++ b/Workers/createSphereOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,5 +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";var t=function(t){return void 0!==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";var e=function(t,e){return void 0!==t?t:e};return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";var e=function(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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("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^=2636928640&t<<7,t^=4022730752&t<<15,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){"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(t){return t>0?1:0>t?-1:0},n.signNotZero=function(t){return 0>t?-1:1},n.toSNorm=function(t){return Math.round(255*(.5*n.clamp(t,-1,1)+.5))},n.fromSNorm=function(t){return 2*(n.clamp(t,0,255)/255)-1},n.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},n.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},n.lerp=function(t,e,n){return(1-n)*t+n*e},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(t){return t*n.RADIANS_PER_DEGREE},n.toDegrees=function(t){return t*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(t){var e=n.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},n.negativePiToPi=function(t){for(var e=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+e)>t;)t+=i;if(-r>t)return-r;for(;t>r+e;)t-=i;return t>r?r:t},n.zeroToTwoPi=function(t){var e=t%n.TWO_PI;return 0>e?(e+n.TWO_PI)%n.TWO_PI:e},n.equalsEpsilon=function(t,n,r){return r=e(r,0),Math.abs(t-n)<=r};var r=[1];n.factorial=function(t){var e=r.length;if(t>=e)for(var n=r[e-1],i=e;t>=i;i++)r.push(n*i);return r[t]},n.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},n.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},n.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},n.clamp=function(t,e,n){return e>t?e:t>n?n:t};var i=new t;return n.setRandomNumberSeed=function(e){i=new t(e)},n.nextRandomNumber=function(){return i.random()},n.acosClamped=function(t){return Math.acos(n.clamp(t,-1,1))},n.asinClamped=function(t){return Math.asin(n.clamp(t,-1,1))},n}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)};a.fromSpherical=function(n,r){e(r)||(r=new a);var i=n.clock,o=n.cone,u=t(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(t,n,r,i){return e(i)?(i.x=t,i.y=n,i.z=r,i):new a(t,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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.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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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 s=new a,c=new a;a.angleBetween=function(t,e){a.normalize(t,s),a.normalize(e,c);var n=a.dot(s,c),r=a.magnitude(a.cross(s,c,s));return Math.atan2(r,n)};var l=new a;a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,l);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):n.y<=n.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r},a.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,s=e.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},a.fromDegrees=function(t,e,n,r,o){var u=i.toRadians(t),s=i.toRadians(e);return a.fromRadians(u,s,n,r,o)};var f=new a,h=new a,d=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=t(i,0);var s=e(o)?o.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=a.normalize(f,f),a.multiplyComponents(s,f,h);var l=Math.sqrt(a.dot(f,h));return h=a.divideByScalar(h,l,h),f=a.multiplyByScalar(f,i,f),e(u)||(u=new a),a.add(h,f,u)},a.fromDegreesArray=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=i.toRadians(t[o]);return a.fromRadiansArray(r,e,n)},a.fromRadiansArray=function(t,n,r){var i=t.length;e(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],s=t[o+1];r[o/2]=a.fromRadians(u,s,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o+=3)r[o]=i.toRadians(t[o]),r[o+1]=i.toRadians(t[o+1]),r[o+2]=t[o+2];return a.fromRadiansArrayHeights(r,e,n)},a.fromRadiansArrayHeights=function(t,n,r){var i=t.length;e(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],s=t[o+1],c=t[o+2];r[o/3]=a.fromRadians(u,s,c,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)};return a.fromRadians=function(n,r,i,o){return i=t(i,0),e(o)?(o.longitude=n,o.latitude=r,o.height=i,o):new a(n,r,i)},a.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),a.fromRadians(t,e,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new a(t.longitude,t.latitude,t.height):void 0},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.longitude-n.longitude)<=r&&Math.abs(t.latitude-n.latitude)<=r&&Math.abs(t.height-n.height)<=r},a.ZERO=r(new a(0,0,0)),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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),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"],function(t,e,n,r,i,a,o,u){"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}var c=function(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,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))return void 0;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.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),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=s,n.z=c,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 l=new t,f=new t;c.prototype.cartographicToCartesian=function(e,n){var i=l,a=f;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;n>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var h=new t,d=new t,m=new t;c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,d);if(!r(a))return void 0;var o=this.geodeticSurfaceNormal(a,h),s=t.subtract(n,a,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(t.dot(s,n))*t.magnitude(s);return r(i)?(i.longitude=c,i.latitude=l,i.height=f,i):new e(c,l,f)},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;n>i;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e};var y=new t,p=new t;return c.prototype.scaleToGeodeticSurface=function(e,n){var i=e.x,a=e.y,o=e.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,h=i*i*c*c,d=a*a*l*l,m=o*o*f*f,v=h+d+m,E=Math.sqrt(1/v),w=t.multiplyByScalar(e,E,y);if(v<this._centerToleranceSquared)return isFinite(E)?t.clone(w,n):void 0;var g=this._oneOverRadiiSquared,x=g.x,M=g.y,S=g.z,z=p;z.x=2*w.x*x,z.y=2*w.y*M,z.z=2*w.z*S;var O,T,_,N,R,I,b,A,P,C,L,U=(1-E)*t.magnitude(e)/(.5*t.magnitude(z)),q=0;do{U-=q,_=1/(1+U*x),N=1/(1+U*M),R=1/(1+U*S),I=_*_,b=N*N,A=R*R,P=I*_,C=b*N,L=A*R,O=h*I+d*b+m*A-1,T=h*P*x+d*C*M+m*L*S;var D=-2*T;q=O/D}while(Math.abs(O)>u.EPSILON12);return r(n)?(n.x=i*_,n.y=a*N,n.z=o*R,n):new t(i*_,a*N,o*R)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,s,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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";var u=function(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";var e=function(e,n){this.start=t(e,0),this.stop=t(n,0)};return e}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";var i=function(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)};i.fromElements=function(t,n,r,a,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=a,o):new i(t,n,r,a)},i.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 i(t.red,t.green,t.blue,t.alpha)},i.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new i(t.x,t.y,t.z,t.w):void 0},i.packedLength=4,i.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r++],a.w=n[r],a},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,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},i.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},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 a=new i;i.distance=function(t,e){return i.subtract(t,e,a),i.magnitude(a)},i.normalize=function(t,e){var n=i.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,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,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},i.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},i.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},i.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},i.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},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 o=new i;i.lerp=function(t,e,n,r){return i.multiplyByScalar(e,n,o),r=i.multiplyByScalar(t,1-n,r),i.add(o,r,r)};var u=new i;return i.mostOrthogonalAxis=function(t,e){var n=i.normalize(t,u);return i.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?i.clone(i.UNIT_X,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e):n.y<=n.z?n.y<=n.w?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e)},i.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},i.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r&&Math.abs(t.w-n.w)<=r},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(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e){return i.equalsEpsilon(this,t,e)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t){for(var e=0,n=0;9>n;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function u(t){for(var e=0,n=0;3>n;++n){var r=t[c.getElementIndex(d[n],h[n])];e+=2*r*r}return Math.sqrt(e)}function s(t,e){for(var n=a.EPSILON15,r=0,i=1,o=0;3>o;++o){var u=Math.abs(t[c.getElementIndex(d[o],h[o])]);u>r&&(i=o,r=u)}var s=1,l=0,f=h[i],m=d[i];if(Math.abs(t[c.getElementIndex(m,f)])>n){var y,p=t[c.getElementIndex(m,m)],v=t[c.getElementIndex(f,f)],E=t[c.getElementIndex(m,f)],w=(p-v)/2/E;y=0>w?-1/(-w+Math.sqrt(1+w*w)):1/(w+Math.sqrt(1+w*w)),s=1/Math.sqrt(1+y*y),l=y*s}return e=c.clone(c.IDENTITY,e),e[c.getElementIndex(f,f)]=e[c.getElementIndex(m,m)]=s,e[c.getElementIndex(m,f)]=l,e[c.getElementIndex(f,m)]=-l,e}var c=function(t,n,r,i,a,o,u,s,c){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(s,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(c,0)};c.clone=function(t,e){return n(t)?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 c(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},c.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new c),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},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[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 c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},c.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,u=t.y*t.y,s=t.y*t.z,l=t.y*t.w,f=t.z*t.z,h=t.z*t.w,d=t.w*t.w,m=r-u-f+d,y=2*(i-h),p=2*(a+l),v=2*(i+h),E=-r+u-f+d,w=2*(s-o),g=2*(a-l),x=2*(s+o),M=-r-u+f+d;return n(e)?(e[0]=m,e[1]=v,e[2]=g,e[3]=y,e[4]=E,e[5]=x,e[6]=p,e[7]=w,e[8]=M,e):new c(m,y,p,v,E,w,g,x,M)},c.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 c(t.x,0,0,0,t.y,0,0,0,t.z)},c.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 c(t,0,0,0,t,0,0,0,t)},c.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 c(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},c.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 c(1,0,0,0,r,-i,0,i,r)},c.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 c(r,0,i,0,1,0,-i,0,r)},c.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 c(r,-i,0,i,r,0,0,0,1)},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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},c.getElementIndex=function(t,e){return 3*t+e},c.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},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},c.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},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,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[3],e[4],e[5],l)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],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]*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],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],c=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],f=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]=s,n[6]=c,n[7]=l,n[8]=f,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},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},c.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,s=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=s,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},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},c.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],s=t[2],c=t[5],l=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=s,e[7]=c,e[8]=l,e};var h=[1,0,0],d=[2,2,1],m=new c,y=new c;return c.computeEigenDecomposition=function(t,e){var r=a.EPSILON20,i=10,l=0,f=0;n(e)||(e={});for(var h=e.unitary=c.clone(c.IDENTITY,e.unitary),d=e.diagonal=c.clone(t,e.diagonal),p=r*o(d);i>f&&u(d)>p;)s(d,m),c.transpose(m,y),c.multiply(d,m,d),c.multiply(y,d,d),c.multiply(h,m,h),++l>2&&(++f,l=0);return 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},c.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],s=t[5],c=t[8];return e*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},c.inverse=function(t,e){var n=t[0],i=t[1],o=t[2],u=t[3],s=t[4],l=t[5],f=t[6],h=t[7],d=t[8],m=c.determinant(t);if(Math.abs(m)<=a.EPSILON15)throw new r("matrix is not invertible");e[0]=s*d-h*l,e[1]=h*o-i*d,e[2]=i*l-s*o,e[3]=f*l-u*d,e[4]=n*d-f*o,e[5]=u*o-n*l,e[6]=u*h-f*s,e[7]=f*i-n*h,e[8]=n*s-u*i;var y=1/m;return c.multiplyByScalar(e,y,e)},c.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]},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},c.IDENTITY=i(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(t){"use strict";var e=function(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,s){"use strict";var c=function(t,e,r,i,a,o,u,s,c,l,f,h,d,m,y,p){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(e,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(m,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(y,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(p,0)};c.packedLength=16,c.pack=function(t,e,r){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]},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){return r(t)?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]):void 0},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,s=e.x*e.x,l=e.x*e.y,f=e.x*e.z,h=e.x*e.w,d=e.y*e.y,m=e.y*e.z,y=e.y*e.w,p=e.z*e.z,v=e.z*e.w,E=e.w*e.w,w=s-d-p+E,g=2*(l-v),x=2*(f+y),M=2*(l+v),S=-s+d-p+E,z=2*(m-h),O=2*(f-y),T=2*(m+h),_=-s-d+p+E;return i[0]=w*a,i[1]=M*a,i[2]=O*a,i[3]=0,i[4]=g*o,i[5]=S*o,i[6]=T*o,i[7]=0,i[8]=x*u,i[9]=z*u,i[10]=_*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},c.fromTranslation=function(t,e){return c.fromRotationTranslation(u.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 l=new t,f=new t,h=new t;c.fromCamera=function(e,n){var i=e.eye,a=e.target,o=e.up;t.normalize(t.subtract(a,i,l),l),t.normalize(t.cross(l,o,f),f),t.normalize(t.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,m=l.x,y=l.y,p=l.z,v=h.x,E=h.y,w=h.z,g=i.x,x=i.y,M=i.z,S=u*-g+s*-x+d*-M,z=v*-g+E*-x+w*-M,O=m*g+y*x+p*M;return r(n)?(n[0]=u,n[1]=v,n[2]=-m,n[3]=0,n[4]=s,n[5]=E,n[6]=-y,n[7]=0,n[8]=d,n[9]=w,n[10]=-p,n[11]=0,n[12]=S,n[13]=z,n[14]=O,n[15]=1,n):new c(u,s,d,S,v,E,w,z,-m,-y,-p,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,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},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),s=1/(r-n),c=1/(a-i),l=-(e+t)*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},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),s=2*i/(r-n),c=(e+t)/(e-t),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},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),s=(e+t)/(e-t),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},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),s=n(t.height,0);e=n(e,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-e),h=c,d=l,m=f,y=a+c,p=o+l,v=e+f,E=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]=m,i[11]=0,i[12]=y,i[13]=p,i[14]=v,i[15]=E,i},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.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 d=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],d)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],d)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],d)),n};var m=new t;c.getMaximumScale=function(e){return c.getScale(e,m),t.maximumComponent(m)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],s=t[5],c=t[6],l=t[7],f=t[8],h=t[9],d=t[10],m=t[11],y=t[12],p=t[13],v=t[14],E=t[15],w=e[0],g=e[1],x=e[2],M=e[3],S=e[4],z=e[5],O=e[6],T=e[7],_=e[8],N=e[9],R=e[10],I=e[11],b=e[12],A=e[13],P=e[14],C=e[15],L=r*w+u*g+f*x+y*M,U=i*w+s*g+h*x+p*M,q=a*w+c*g+d*x+v*M,D=o*w+l*g+m*x+E*M,B=r*S+u*z+f*O+y*T,F=i*S+s*z+h*O+p*T,G=a*S+c*z+d*O+v*T,W=o*S+l*z+m*O+E*T,V=r*_+u*N+f*R+y*I,Y=i*_+s*N+h*R+p*I,k=a*_+c*N+d*R+v*I,j=o*_+l*N+m*R+E*I,H=r*b+u*A+f*P+y*C,Z=i*b+s*A+h*P+p*C,X=a*b+c*A+d*P+v*C,K=o*b+l*A+m*P+E*C;return n[0]=L,n[1]=U,n[2]=q,n[3]=D,n[4]=B,n[5]=F,n[6]=G,n[7]=W,n[8]=V,n[9]=Y,n[10]=k,n[11]=j,n[12]=H,n[13]=Z,n[14]=X,n[15]=K,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],s=t[6],c=t[8],l=t[9],f=t[10],h=t[12],d=t[13],m=t[14],y=e[0],p=e[1],v=e[2],E=e[4],w=e[5],g=e[6],x=e[8],M=e[9],S=e[10],z=e[12],O=e[13],T=e[14],_=r*y+o*p+c*v,N=i*y+u*p+l*v,R=a*y+s*p+f*v,I=r*E+o*w+c*g,b=i*E+u*w+l*g,A=a*E+s*w+f*g,P=r*x+o*M+c*S,C=i*x+u*M+l*S,L=a*x+s*M+f*S,U=r*z+o*O+c*T+h,q=i*z+u*O+l*T+d,D=a*z+s*O+f*T+m;return n[0]=_,n[1]=N,n[2]=R,n[3]=0,n[4]=I,n[5]=b,n[6]=A,n[7]=0,n[8]=P,n[9]=C,n[10]=L,n[11]=0,n[12]=U,n[13]=q,n[14]=D,n[15]=1,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],s=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]=s,n[15]=t[15],n};var y=new t;c.multiplyByUniformScale=function(t,e,n){return y.x=e,y.y=e,y.z=e,c.multiplyByScale(t,y,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,s=t[1]*r+t[5]*i+t[9]*a+t[13]*o,c=t[2]*r+t[6]*i+t[10]*a+t[14]*o,l=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,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,s=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=s,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],s=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=s,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[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[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]},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 p=new u,v=new u,E=new e,w=new e(0,0,0,1);return c.inverse=function(t,n){if(u.equalsEpsilon(c.getRotation(t,p),v,o.EPSILON7)&&e.equals(c.getRow(t,3,E),w))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],l=t[12],f=t[1],h=t[5],d=t[9],m=t[13],y=t[2],g=t[6],x=t[10],M=t[14],S=t[3],z=t[7],O=t[11],T=t[15],_=x*T,N=M*O,R=g*T,I=M*z,b=g*O,A=x*z,P=y*T,C=M*S,L=y*O,U=x*S,q=y*z,D=g*S,B=_*h+I*d+b*m-(N*h+R*d+A*m),F=N*f+P*d+U*m-(_*f+C*d+L*m),G=R*f+C*h+q*m-(I*f+P*h+D*m),W=A*f+L*h+D*d-(b*f+U*h+q*d),V=N*i+R*a+A*l-(_*i+I*a+b*l),Y=_*r+C*a+L*l-(N*r+P*a+U*l),k=I*r+P*i+D*l-(R*r+C*i+q*l),j=b*r+U*i+q*a-(A*r+L*i+D*a);_=a*m,N=l*d,R=i*m,I=l*h,b=i*d,A=a*h,P=r*m,C=l*f,L=r*d,U=a*f,q=r*h,D=i*f;var H=_*z+I*O+b*T-(N*z+R*O+A*T),Z=N*S+P*O+U*T-(_*S+C*O+L*T),X=R*S+C*z+q*T-(I*S+P*z+D*T),K=A*S+L*z+D*O-(b*S+U*z+q*O),J=R*x+A*M+N*g-(b*M+_*g+I*x),Q=L*M+_*y+C*x-(P*x+U*M+N*y),$=P*g+D*M+I*y-(q*M+R*y+C*g),te=q*x+b*y+U*g-(L*g+D*x+A*y),ee=r*B+i*F+a*G+l*W;if(Math.abs(ee)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return ee=1/ee,n[0]=B*ee,n[1]=F*ee,n[2]=G*ee,n[3]=W*ee,n[4]=V*ee,n[5]=Y*ee,n[6]=k*ee,n[7]=j*ee,n[8]=H*ee,n[9]=Z*ee,n[10]=X*ee,n[11]=K*ee,n[12]=J*ee,n[13]=Q*ee,n[14]=$*ee,n[15]=te*ee,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],s=t[8],c=t[9],l=t[10],f=t[12],h=t[13],d=t[14],m=-n*f-r*h-i*d,y=-a*f-o*h-u*d,p=-s*f-c*h-l*d;return e[0]=n,e[1]=a,e[2]=s,e[3]=0,e[4]=r,e[5]=o,e[6]=c,e[7]=0,e[8]=i,e[9]=u,e[10]=l,e[11]=0,e[12]=m,e[13]=y,e[14]=p,e[15]=1,e},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";var u=function(t,n,r,i){this.west=e(t,0),this.south=e(n,0),this.east=e(r,0),this.north=e(i,0)};u.fromDegrees=function(t,r,i,a,s){return t=o.toRadians(e(t,0)),r=o.toRadians(e(r,0)),i=o.toRadians(e(i,0)),a=o.toRadians(e(a,0)),n(s)?(s.west=t,s.south=r,s.east=i,s.north=a,s):new u(t,r,i,a)},u.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=t.length;c>s;s++){var l=t[s];r=Math.min(r,l.longitude),i=Math.max(i,l.longitude),a=Math.min(a,l.latitude),o=Math.max(o,l.latitude)}return n(e)?(e.west=r,e.south=a,e.east=i,e.north=o,e):new u(r,a,i,o)},u.packedLength=4,u.pack=function(t,n,r){r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i.west=t[r++],i.south=t[r++],i.east=t[r++],i.north=t[r],i},u.clone=function(t,e){return n(t)?n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new u(t.west,t.south,t.east,t.north):void 0},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.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},u.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},u.validate=function(){},u.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)},u.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)},u.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)},u.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)},u.center=function(e,r){var i=e.east,a=e.west,u=.5*(a+i);return a>i&&(u=o.negativePiToPi(u+o.PI)),n(r)?(r.longitude=u,r.latitude=.5*(e.south+e.north),r.height=0,r):new t(u,.5*(e.south+e.north))},u.intersectWith=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),s=Math.min(t.north,e.north);return n(r)?(r.west=i,r.south=a,r.east=o,r.north=s,r):new u(i,a,o,s)},u.contains=function(t,e){return e.longitude>=t.west&&e.longitude<=t.east&&e.latitude>=t.south&&e.latitude<=t.north},u.isEmpty=function(t){return t.west>=t.east||t.south>=t.north};var s=new t;return u.subsample=function(t,r,a,u){r=e(r,i.WGS84),a=e(a,0),n(u)||(u=[]);var c=0,l=t.north,f=t.south,h=t.east,d=t.west,m=s;m.height=a,m.longitude=d,m.latitude=l,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:f>0?f:0;for(var y=1;8>y;++y){var p=-Math.PI+y*o.PI_OVER_TWO;p>d&&h>p&&(m.longitude=p,u[c]=r.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,s,c,l){"use strict";var f=function(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)},h=new t,d=new t,m=new t,y=new t,p=new t,v=new t,E=new t,w=new t,g=new t,x=new t,M=new t,S=new t;f.fromPoints=function(e,n){if(r(n)||(n=new f),!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],E),a=t.clone(i,h),o=t.clone(i,d),u=t.clone(i,m),s=t.clone(i,y),c=t.clone(i,p),l=t.clone(i,v),z=e.length,O=1;z>O;O++){t.clone(e[O],i);var T=i.x,_=i.y,N=i.z;T<a.x&&t.clone(i,a),T>s.x&&t.clone(i,s),_<o.y&&t.clone(i,o),_>c.y&&t.clone(i,c),N<u.z&&t.clone(i,u),N>l.z&&t.clone(i,l)}var R=t.magnitudeSquared(t.subtract(s,a,w)),I=t.magnitudeSquared(t.subtract(c,o,w)),b=t.magnitudeSquared(t.subtract(l,u,w)),A=a,P=s,C=R;I>C&&(C=I,A=o,P=c),b>C&&(C=b,A=u,P=l);var L=g;L.x=.5*(A.x+P.x),L.y=.5*(A.y+P.y),L.z=.5*(A.z+P.z);var U=t.magnitudeSquared(t.subtract(P,L,w)),q=Math.sqrt(U),D=x;D.x=a.x,D.y=o.y,D.z=u.z;var B=M;B.x=s.x,B.y=c.y,B.z=l.z;var F=t.multiplyByScalar(t.add(D,B,w),.5,S),G=0;for(O=0;z>O;O++){t.clone(e[O],i);var W=t.magnitude(t.subtract(i,F,w));W>G&&(G=W);var V=t.magnitudeSquared(t.subtract(i,L,w));if(V>U){var Y=Math.sqrt(V);q=.5*(q+Y),U=q*q;var k=Y-q;L.x=(q*L.x+k*i.x)/Y,L.y=(q*L.y+k*i.y)/Y,L.z=(q*L.z+k*i.z)/Y}}return G>q?(t.clone(L,n.center),n.radius=q):(t.clone(F,n.center),n.radius=G),n};var z=new o,O=new t,T=new t,_=new e,N=new e;f.fromRectangle2D=function(t,e,n){return f.fromRectangleWithHeights2D(t,e,0,0,n)},f.fromRectangleWithHeights2D=function(e,i,a,o,u){if(r(u)||(u=new f),!r(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;i=n(i,z),l.southwest(e,_),_.height=a,l.northeast(e,N),N.height=o;var s=i.project(_,O),c=i.project(N,T),h=c.x-s.x,d=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(h*h+d*d+m*m);var y=u.center;return y.x=s.x+.5*h,y.y=s.y+.5*d,y.z=s.z+.5*m,u};var R=[];f.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=l.subsample(t,e,i,R)),f.fromPoints(u,o)},f.fromVertices=function(e,i,a,o){if(r(o)||(o=new f),!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=E;u.x=e[0]+i.x,u.y=e[1]+i.y,u.z=e[2]+i.z;for(var s=t.clone(u,h),c=t.clone(u,d),l=t.clone(u,m),z=t.clone(u,y),O=t.clone(u,p),T=t.clone(u,v),_=e.length,N=0;_>N;N+=a){var R=e[N]+i.x,I=e[N+1]+i.y,b=e[N+2]+i.z;u.x=R,u.y=I,u.z=b,R<s.x&&t.clone(u,s),R>z.x&&t.clone(u,z),I<c.y&&t.clone(u,c),I>O.y&&t.clone(u,O),b<l.z&&t.clone(u,l),b>T.z&&t.clone(u,T)}var A=t.magnitudeSquared(t.subtract(z,s,w)),P=t.magnitudeSquared(t.subtract(O,c,w)),C=t.magnitudeSquared(t.subtract(T,l,w)),L=s,U=z,q=A;P>q&&(q=P,L=c,U=O),C>q&&(q=C,L=l,U=T);var D=g;D.x=.5*(L.x+U.x),D.y=.5*(L.y+U.y),D.z=.5*(L.z+U.z);var B=t.magnitudeSquared(t.subtract(U,D,w)),F=Math.sqrt(B),G=x;G.x=s.x,G.y=c.y,G.z=l.z;var W=M;W.x=z.x,W.y=O.y,W.z=T.z;var V=t.multiplyByScalar(t.add(G,W,w),.5,S),Y=0;for(N=0;_>N;N+=a){u.x=e[N]+i.x,u.y=e[N+1]+i.y,u.z=e[N+2]+i.z;var k=t.magnitude(t.subtract(u,V,w));k>Y&&(Y=k);var j=t.magnitudeSquared(t.subtract(u,D,w));if(j>B){var H=Math.sqrt(j);F=.5*(F+H),B=F*F;var Z=H-F;D.x=(F*D.x+Z*u.x)/H,D.y=(F*D.y+Z*u.y)/H,D.z=(F*D.z+Z*u.z)/H}}return Y>F?(t.clone(D,o.center),o.radius=F):(t.clone(V,o.center),o.radius=Y),o},f.fromCornerPoints=function(e,n,i){r(i)||(i=new f);var a=i.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),i.radius=t.distance(a,n),i},f.fromEllipsoid=function(e,n){return r(n)||(n=new f),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n},f.clone=function(e,n){return r(e)?r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new f(e.center,e.radius):void 0},f.packedLength=4,f.pack=function(t,e,r){r=n(r,0);var i=t.center;e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius},f.unpack=function(t,e,i){e=n(e,0),r(i)||(i=new f);var a=i.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],i.radius=t[e],i};var I=new t,b=new t;f.union=function(e,n,i){r(i)||(i=new f);var a=e.center,o=n.center;t.add(a,o,b);var u=t.multiplyByScalar(b,.5,b),s=t.magnitude(t.subtract(a,u,I))+e.radius,c=t.magnitude(t.subtract(o,u,I))+n.radius;return i.radius=Math.max(s,c),t.clone(u,i.center),i};var A=new t;f.expand=function(e,n,r){r=f.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,A));return i>r.radius&&(r.radius=i),r},f.intersect=function(e,n){var r=e.center,i=e.radius,a=t.dot(n,r)+n.w;return-i>a?u.OUTSIDE:i>a?u.INTERSECTING:u.INSIDE},f.transform=function(t,e,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var P=new t;f.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,P);return t.magnitudeSquared(r)-e.radius*e.radius},f.transformWithoutScale=function(t,e,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var C=new t;f.computePlaneDistances=function(e,n,i,a){r(a)||(a=new s);var o=t.subtract(e.center,n,C),u=t.multiplyByScalar(i,t.dot(i,o),C),c=t.magnitude(u);return a.start=c-e.radius,a.stop=c+e.radius,a};for(var L=new t,U=new t,q=new t,D=new t,B=new t,F=new e,G=new Array(8),W=0;8>W;++W)G[W]=new t;var V=new o;return f.projectTo2D=function(e,r,i){r=n(r,V);var a=r.ellipsoid,o=e.center,u=e.radius,s=a.geodeticSurfaceNormal(o,L),c=t.cross(t.UNIT_Z,s,U);t.normalize(c,c);var l=t.cross(s,c,q);t.normalize(l,l),t.multiplyByScalar(s,u,s),t.multiplyByScalar(l,u,l),t.multiplyByScalar(c,u,c);var h=t.negate(l,B),d=t.negate(c,D),m=G,y=m[0];t.add(s,l,y),t.add(y,c,y),y=m[1],t.add(s,l,y),t.add(y,d,y),y=m[2],t.add(s,h,y),t.add(y,d,y),y=m[3],t.add(s,h,y),t.add(y,c,y),t.negate(s,s),y=m[4],t.add(s,l,y),t.add(y,c,y),y=m[5],t.add(s,l,y),t.add(y,d,y),y=m[6],t.add(s,h,y),t.add(y,d,y),y=m[7],t.add(s,h,y),t.add(y,c,y);for(var p=m.length,v=0;p>v;++v){var E=m[v];t.add(o,E,E);var w=a.cartesianToCartographic(E,F);r.project(w,E)}i=f.fromPoints(m,i),o=i.center;var g=o.x,x=o.y,M=o.z;return o.x=M,o.y=g,o.z=x,i},f.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},f.prototype.intersect=function(t){return f.intersect(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 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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof e[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",t(document[i])?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",t(document[i])&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",t(document[i])?r.fullscreenElement=i:(i=s+"FullScreenElement",t(document[i])&&(r.fullscreenElement=i)),i=s+"fullscreenchange",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",t(document["on"+i])&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t){i.supportsFullscreen()&&t[r.requestFullscreen]()},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;r>n;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(m)){m=!1;var t=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(m=!0,y=r(t[1]))}return m}function a(){return i()&&y}function o(){if(!e(p)&&(p=!1,!i()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(p=!0,v=r(t[1]))}return p}function u(){return o()&&v}function s(){if(!e(E)){E=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==t&&(E=!0,w=r(t[1]),w.isNightly=!!t[2])}return E}function c(){return s()&&w}function l(){if(!e(g)){g=!1;var t;"Microsoft Internet Explorer"===navigator.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(g=!0,x=r(t[1]))):"Netscape"===navigator.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==t&&(g=!0,x=r(t[1])))}return g}function f(){return l()&&x}function h(){if(!e(M)){M=!1;var t=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==t&&(M=!0,S=r(t[1]))}return M}function d(){return h()&&S}var m,y,p,v,E,w,g,x,M,S,z={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:d,hardwareConcurrency:t(navigator.hardwareConcurrency,3)};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(t,e,n,r,i){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(t){switch(t){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(t){return t instanceof Int8Array?a.BYTE:t instanceof Uint8Array?a.UNSIGNED_BYTE:t instanceof Int16Array?a.SHORT:t instanceof Uint16Array?a.UNSIGNED_SHORT:t instanceof Float32Array?a.FLOAT:t instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(t){return e(t)&&(t===a.BYTE||t===a.UNSIGNED_BYTE||t===a.SHORT||t===a.UNSIGNED_SHORT||t===a.FLOAT||t===a.DOUBLE)},a.createTypedArray=function(t,e){switch(t){case a.BYTE:return new Int8Array(e);case a.UNSIGNED_BYTE:return new Uint8Array(e);case a.SHORT:return new Int16Array(e);case a.UNSIGNED_SHORT:return new Uint16Array(e);case a.FLOAT:return new Float32Array(e);case a.DOUBLE:return new Float64Array(e);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(e,r,i,o){switch(i=t(i,0),o=t(o,(r.byteLength-i)/a.getSizeInBytes(e)),e){case a.BYTE:return new Int8Array(r,i,o);case a.UNSIGNED_BYTE:return new Uint8Array(r,i,o);case a.SHORT:return new Int16Array(r,i,o);case a.UNSIGNED_SHORT:return new Uint16Array(r,i,o);case a.FLOAT:return new Float32Array(r,i,o);case a.DOUBLE:return new Float64Array(r,i,o);default:throw new n("componentDatatype is not a valid value.")}},i(a)}),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"],function(t){"use strict";var e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(t){return t===e.POINTS||t===e.LINES||t===e.LINE_LOOP||t===e.LINE_STRIP||t===e.TRIANGLES||t===e.TRIANGLE_STRIP||t===e.TRIANGLE_FAN}};return t(e)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";var a=function(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)};return a.computeNumberOfVertices=function(t){var r=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&e(t.attributes[i])&&e(t.attributes[i].values)){var a=t.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t){"use strict";var e=function(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 e}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";var e=function(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"],function(t,e,n,r){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,i){return t>r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(i)}),define("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(t,e,n,r,i,a,o,u,s,c,l,f){"use strict";var h=new e(1,1,1),d=Math.cos,m=Math.sin,y=function(t){t=r(t,r.EMPTY_OBJECT);var n=r(t.radii,h),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"};return y.createGeometry=function(e){var r,i,h,y,p,v,E=e._radii,w=a.fromCartesian3(E),g=e._stackPartitions,x=e._slicePartitions,M=e._subdivisions,S=M*(g+x-1),z=S-x+2,O=new Float64Array(3*z),T=c.createTypedArray(z,2*S),_=0,N=new Array(M),R=new Array(M);for(r=0;M>r;r++)h=l.TWO_PI*r/M,N[r]=d(h),R[r]=m(h);for(r=1;g>r;r++)for(y=Math.PI*r/g,p=d(y),v=m(y),i=0;M>i;i++)O[_++]=E.x*N[i]*v,O[_++]=E.y*R[i]*v,O[_++]=E.z*p;for(N.length=x,R.length=x,r=0;x>r;r++)h=l.TWO_PI*r/x,N[r]=d(h),R[r]=m(h);for(O[_++]=0,O[_++]=0,O[_++]=E.z,r=1;M>r;r++)for(y=Math.PI*r/M,p=d(y),v=m(y),i=0;x>i;i++)O[_++]=E.x*N[i]*v,O[_++]=E.y*R[i]*v,O[_++]=E.z*p;for(O[_++]=0,O[_++]=0,O[_++]=-E.z,_=0,r=0;g-1>r;++r){var I=r*M;for(i=0;M-1>i;++i)T[_++]=I+i,T[_++]=I+i+1;T[_++]=I+M-1,T[_++]=I}var b=M*(g-1);for(i=1;x+1>i;++i)T[_++]=b,T[_++]=b+i;for(r=0;M-2>r;++r){var A=r*x+1+b,P=(r+1)*x+1+b;for(i=0;x-1>i;++i)T[_++]=P+i,T[_++]=A+i;T[_++]=P+x-1,T[_++]=A+x-1}var C=O.length/3-1;for(i=C-1;i>C-x-1;--i)T[_++]=C,T[_++]=i;var L=new s({position:new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:O})});return new o({attributes:L,indices:T,primitiveType:f.LINES,boundingSphere:t.fromEllipsoid(w)})},y}),define("Core/SphereOutlineGeometry",["./Cartesian3","./defaultValue","./EllipsoidOutlineGeometry"],function(t,e,n){"use strict";var r=function(r){var i=e(r.radius,1),a=new t(i,i,i),o={radii:a,stackPartitions:r.stackPartitions,slicePartitions:r.slicePartitions,subdivisions:r.subdivisions};this._ellipsoidGeometry=new n(o),this._workerName="createSphereOutlineGeometry"};return r.createGeometry=function(t){return n.createGeometry(t._ellipsoidGeometry)},r}),define("Workers/createSphereOutlineGeometry",["../Core/SphereOutlineGeometry"],function(t){"use strict";return t.createGeometry})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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:0>e?-1:0},i.signNotZero=function(e){return 0>e?-1:1},i.toSNorm=function(e){return Math.round(255*(.5*i.clamp(e,-1,1)+.5))},i.fromSNorm=function(e){return i.clamp(e,0,255)/255*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.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 i>=a||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;e>=r;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}a.fromSpherical=function(n,r){t(r)||(r=new a);var i=n.clock,o=n.cone,u=e(n.magnitude,1),E=u*Math.sin(o);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(e,n,r,i){return t(i)?(i.x=e,i.y=n,i.z=r,i):new a(e,n,r)},a.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new a(e.x,e.y,e.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 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},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var u=new a;a.lerp=function(e,t,n,r){return a.multiplyByScalar(t,n,u),r=a.multiplyByScalar(e,1-n,r),a.add(u,r,r)};var E=new a,s=new a;a.angleBetween=function(e,t){a.normalize(e,E),a.normalize(t,s);var n=a.dot(E,s),r=a.magnitude(a.cross(E,s,E));return Math.atan2(r,n)};var c=new a;a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,c);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):n.y<=n.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,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},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},a.equalsEpsilon=function(e,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)},a.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},a.fromDegrees=function(e,t,n,r,o){var u=i.toRadians(e),E=i.toRadians(t);return a.fromRadians(u,E,n,r,o)};var _=new a,R=new a,T=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=e(i,0);var E=t(o)?o.radiiSquared:T,s=Math.cos(r);_.x=s*Math.cos(n),_.y=s*Math.sin(n),_.z=Math.sin(r),_=a.normalize(_,_),a.multiplyComponents(E,_,R);var c=Math.sqrt(a.dot(_,R));return R=a.divideByScalar(R,c,R),_=a.multiplyByScalar(_,i,_),t(u)||(u=new a),a.add(R,_,u)},a.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=i.toRadians(e[o]);return a.fromRadiansArray(r,t,n)},a.fromRadiansArray=function(e,n,r){var i=e.length;t(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=e[o],E=e[o+1];r[o/2]=a.fromRadians(u,E,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=i.toRadians(e[o]),r[o+1]=i.toRadians(e[o+1]),r[o+2]=e[o+2];return a.fromRadiansArrayHeights(r,t,n)},a.fromRadiansArrayHeights=function(e,n,r){var i=e.length;t(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=e[o],E=e[o+1],s=e[o+2];r[o/3]=a.fromRadians(u,E,s,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),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,R=n.z,T=i.x,l=i.y,A=i.z,f=c*c*T*T,d=_*_*l*l,N=R*R*A*A,h=f+d+N,I=Math.sqrt(1/h),S=e.multiplyByScalar(n,I,a);if(E>h)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 C,p,U,L,F,P,v,D,B,w,g,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,v=L*L,D=F*F,B=P*U,w=v*L,g=D*F,C=f*P+d*v+N*D-1,p=f*B*M+d*w*O+N*g*m;var G=-2*p;z=C/G}while(Math.abs(C)>r.EPSILON12);return t(s)?(s.x=c*U,s.y=_*L,s.z=R*F,s):new e(c*U,_*L,R*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),R=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),T=a.EPSILON1;return u.fromCartesian=function(t,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:R,f=n(r)?r._centerToleranceSquared:T,d=o(t,l,A,f,s);if(n(d)){var N=e.multiplyComponents(t,A,E);N=e.normalize(N,N);var h=e.subtract(t,d,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=a.sign(e.dot(h,t))*e.magnitude(h);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(e,t){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){i=n(i,0),e.pack(t._radii,r,i)},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,R=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=R;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;n>i;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var T=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,T),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;n>i;++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}),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","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(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 u(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function E(e){for(var t=0,n=0;3>n;++n){var r=e[o.getElementIndex(T[n],R[n])];t+=2*r*r}return Math.sqrt(t)}function s(e,t){for(var n=a.EPSILON15,r=0,i=1,u=0;3>u;++u){var E=Math.abs(e[o.getElementIndex(T[u],R[u])]);E>r&&(i=u,r=E)}var s=1,c=0,_=R[i],l=T[i];if(Math.abs(e[o.getElementIndex(l,_)])>n){var A,f=e[o.getElementIndex(l,l)],d=e[o.getElementIndex(_,_)],N=e[o.getElementIndex(l,_)],h=(f-d)/2/N;A=0>h?-1/(-h+Math.sqrt(1+h*h)):1/(h+Math.sqrt(1+h*h)),s=1/Math.sqrt(1+A*A),c=A*s}return t=o.clone(o.IDENTITY,t),t[o.getElementIndex(_,_)]=t[o.getElementIndex(l,l)]=s,t[o.getElementIndex(l,_)]=c,t[o.getElementIndex(_,l)]=-c,t}o.packedLength=9,o.pack=function(e,n,r){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]},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[4]=e[r++],i[5]=e[r++],i[6]=e[r++],i[7]=e[r++],i[8]=e[r++],i},o.clone=function(e,t){return n(e)?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 o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},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[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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var r=e.x*e.x,i=e.x*e.y,a=e.x*e.z,u=e.x*e.w,E=e.y*e.y,s=e.y*e.z,c=e.y*e.w,_=e.z*e.z,R=e.z*e.w,T=e.w*e.w,l=r-E-_+T,A=2*(i-R),f=2*(a+c),d=2*(i+R),N=-r+E-_+T,h=2*(s-u),I=2*(a-c),S=2*(s+u),M=-r-E+_+T;return n(t)?(t[0]=l,t[1]=d,t[2]=I,t[3]=A,t[4]=N,t[5]=S,t[6]=f,t[7]=h,t[8]=M,t):new o(l,A,f,d,N,h,I,S,M)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,r,-i,0,i,r)},o.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 o(r,0,i,0,1,0,-i,0,r)},o.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 o(r,-i,0,i,r,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},o.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},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var c=new e;o.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],c)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],c)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],c)),n};var _=new e;o.getMaximumScale=function(t){return o.getScale(t,_),e.maximumComponent(_)},o.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},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[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},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[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},o.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},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[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},o.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},o.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},o.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],T=[2,2,1],l=new o,A=new o;return o.computeEigenDecomposition=function(e,t){var r=a.EPSILON20,i=10,c=0,_=0;n(t)||(t={});for(var R=t.unitary=o.clone(o.IDENTITY,t.unitary),T=t.diagonal=o.clone(e,t.diagonal),f=r*u(T);i>_&&E(T)>f;)s(T,l),o.transpose(l,A),o.multiply(T,l,T),o.multiply(A,T,T),o.multiply(R,l,R),++c>2&&(++_,c=0);return 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[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},o.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)},o.inverse=function(e,t){var n=e[0],i=e[1],u=e[2],E=e[3],s=e[4],c=e[5],_=e[6],R=e[7],T=e[8],l=o.determinant(e);if(Math.abs(l)<=a.EPSILON15)throw new r("matrix is not invertible");t[0]=s*T-R*c,t[1]=R*u-i*T,t[2]=i*c-s*u,t[3]=_*c-E*T,t[4]=n*T-_*u,t[5]=E*u-n*c,t[6]=E*R-_*s,t[7]=_*i-n*R,t[8]=n*s-E*i;var A=1/l;return o.multiplyByScalar(t,A,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=i(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=i(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},a.packedLength=4,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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.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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(e,t,r,i,a,o,u,E,s,c,_,R,T,l,A,f){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(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(R,0),this[15]=n(f,0)}s.packedLength=16,s.pack=function(e,t,r){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]},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[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},s.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new s(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]):void 0},s.fromArray=s.unpack,s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},s.fromRotationTranslation=function(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 s(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)},s.fromTranslationQuaternionRotationScale=function(e,t,n,i){r(i)||(i=new s);var a=n.x,o=n.y,u=n.z,E=t.x*t.x,c=t.x*t.y,_=t.x*t.z,R=t.x*t.w,T=t.y*t.y,l=t.y*t.z,A=t.y*t.w,f=t.z*t.z,d=t.z*t.w,N=t.w*t.w,h=E-T-f+N,I=2*(c-d),S=2*(_+A),M=2*(c+d),O=-E+T-f+N,m=2*(l-R),y=2*(_-A),C=2*(l+R),p=-E-T+f+N;return i[0]=h*a,i[1]=M*a,i[2]=y*a,i[3]=0,i[4]=I*o,i[5]=O*o,i[6]=C*o,i[7]=0,i[8]=S*u,i[9]=m*u,i[10]=p*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},s.fromTranslationRotationScale=function(e,t){return s.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},s.fromTranslation=function(e,t){return s.fromRotationTranslation(u.IDENTITY,e,t)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new s(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new s(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var c=new e,_=new e,R=new e;s.fromCamera=function(t,n){var i=t.eye,a=t.target,o=t.up;e.normalize(e.subtract(a,i,c),c),e.normalize(e.cross(c,o,_),_),e.normalize(e.cross(_,c,R),R);var u=_.x,E=_.y,T=_.z,l=c.x,A=c.y,f=c.z,d=R.x,N=R.y,h=R.z,I=i.x,S=i.y,M=i.z,O=u*-I+E*-S+T*-M,m=d*-I+N*-S+h*-M,y=l*I+A*S+f*M; +return r(n)?(n[0]=u,n[1]=d,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=T,n[9]=h,n[10]=-f,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new s(u,E,T,O,d,N,h,m,-l,-A,-f,y,0,0,0,1)},s.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},s.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,R=-(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]=R,o[15]=1,o},s.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),R=-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]=R,o[12]=0,o[13]=0,o[14]=T,o[15]=0,o},s.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,R=-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]=R,a[15]=0,a},s.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),R=s,T=c,l=_,A=a+s,f=o+c,d=t+_,N=1;return i[0]=R,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]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=d,i[15]=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[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},s.getElementIndex=function(e,t){return 4*e+t},s.getColumn=function(e,t,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},s.setColumn=function(e,t,n,r){r=s.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},s.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},s.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},s.setRow=function(e,t,n,r){return r=s.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;s.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 l=new e;s.getMaximumScale=function(t){return s.getScale(t,l),e.maximumComponent(l)},s.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],R=e[9],T=e[10],l=e[11],A=e[12],f=e[13],d=e[14],N=e[15],h=t[0],I=t[1],S=t[2],M=t[3],O=t[4],m=t[5],y=t[6],C=t[7],p=t[8],U=t[9],L=t[10],F=t[11],P=t[12],v=t[13],D=t[14],B=t[15],w=r*h+u*I+_*S+A*M,g=i*h+E*I+R*S+f*M,x=a*h+s*I+T*S+d*M,z=o*h+c*I+l*S+N*M,G=r*O+u*m+_*y+A*C,b=i*O+E*m+R*y+f*C,X=a*O+s*m+T*y+d*C,V=o*O+c*m+l*y+N*C,H=r*p+u*U+_*L+A*F,W=i*p+E*U+R*L+f*F,q=a*p+s*U+T*L+d*F,Y=o*p+c*U+l*L+N*F,K=r*P+u*v+_*D+A*B,k=i*P+E*v+R*D+f*B,Z=a*P+s*v+T*D+d*B,j=o*P+c*v+l*D+N*B;return n[0]=w,n[1]=g,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},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[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},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[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},s.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],R=e[12],T=e[13],l=e[14],A=t[0],f=t[1],d=t[2],N=t[4],h=t[5],I=t[6],S=t[8],M=t[9],O=t[10],m=t[12],y=t[13],C=t[14],p=r*A+o*f+s*d,U=i*A+u*f+c*d,L=a*A+E*f+_*d,F=r*N+o*h+s*I,P=i*N+u*h+c*I,v=a*N+E*h+_*I,D=r*S+o*M+s*O,B=i*S+u*M+c*O,w=a*S+E*M+_*O,g=r*m+o*y+s*C+R,x=i*m+u*y+c*C+T,z=a*m+E*y+_*C+l;return n[0]=p,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]=B,n[10]=w,n[11]=0,n[12]=g,n[13]=x,n[14]=z,n[15]=1,n},s.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],R=t[0],T=t[1],l=t[2],A=t[3],f=t[4],d=t[5],N=t[6],h=t[7],I=t[8],S=r*R+o*T+s*l,M=i*R+u*T+c*l,O=a*R+E*T+_*l,m=r*A+o*f+s*d,y=i*A+u*f+c*d,C=a*A+E*f+_*d,p=r*N+o*h+s*I,U=i*N+u*h+c*I,L=a*N+E*h+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=C,n[7]=0,n[8]=p,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},s.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;s.multiplyByUniformScale=function(e,t,n){return A.x=t,A.y=t,A.z=t,s.multiplyByScale(e,A,n)},s.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?s.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)},s.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},s.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},s.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},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[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},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},s.transpose=function(e,t){var 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},s.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e[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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},s.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},s.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var f=new u,d=new u,N=new t,h=new t(0,0,0,1);return s.inverse=function(e,n){if(u.equalsEpsilon(s.getRotation(e,f),d,o.EPSILON7)&&t.equals(s.getRow(e,3,N),h))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],c=e[12],_=e[1],R=e[5],T=e[9],l=e[13],A=e[2],I=e[6],S=e[10],M=e[14],O=e[3],m=e[7],y=e[11],C=e[15],p=S*C,U=M*y,L=I*C,F=M*m,P=I*y,v=S*m,D=A*C,B=M*O,w=A*y,g=S*O,x=A*m,z=I*O,G=p*R+F*T+P*l-(U*R+L*T+v*l),b=U*_+D*T+g*l-(p*_+B*T+w*l),X=L*_+B*R+x*l-(F*_+D*R+z*l),V=v*_+w*R+z*T-(P*_+g*R+x*T),H=U*i+L*a+v*c-(p*i+F*a+P*c),W=p*r+B*a+w*c-(U*r+D*a+g*c),q=F*r+D*i+z*c-(L*r+B*i+x*c),Y=P*r+g*i+x*a-(v*r+w*i+z*a);p=a*l,U=c*T,L=i*l,F=c*R,P=i*T,v=a*R,D=r*l,B=c*_,w=r*T,g=a*_,x=r*R,z=i*_;var K=p*m+F*y+P*C-(U*m+L*y+v*C),k=U*O+D*y+g*C-(p*O+B*y+w*C),Z=L*O+B*m+x*C-(F*O+D*m+z*C),j=v*O+w*m+z*y-(P*O+g*m+x*y),Q=L*S+v*M+U*I-(P*M+p*I+F*S),J=w*M+p*A+B*S-(D*S+g*M+U*A),$=D*I+z*M+F*A-(x*M+L*A+B*I),ee=x*S+P*A+g*I-(w*I+z*S+v*A),te=r*G+i*b+a*X+c*V;if(Math.abs(te)<o.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]=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},s.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],R=e[13],T=e[14],l=-n*_-r*R-i*T,A=-a*_-o*R-u*T,f=-E*_-s*R-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]=l,t[13]=A,t[14]=f,t[15]=1,t},s.IDENTITY=a(new s(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),s.ZERO=a(new s(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN0ROW3=3,s.COLUMN1ROW0=4,s.COLUMN1ROW1=5,s.COLUMN1ROW2=6,s.COLUMN1ROW3=7,s.COLUMN2ROW0=8,s.COLUMN2ROW1=9,s.COLUMN2ROW2=10,s.COLUMN2ROW3=11,s.COLUMN3ROW0=12,s.COLUMN3ROW1=13,s.COLUMN3ROW2=14,s.COLUMN3ROW3=15,s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.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]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},s}),define("Core/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}),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){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},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 n>t&&(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,R=e.length;R>_;_++){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 l=T.longitude>=0?T.longitude:T.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.clone=function(e,t){return n(e)?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):void 0},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;a>i&&(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;a>i&&o>0?i+=u.TWO_PI:s>o&&i>0&&(o+=u.TWO_PI),a>i&&0>s?s+=u.TWO_PI:s>o&&0>a&&(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 R=Math.max(e.south,t.south),T=Math.min(e.north,t.north);if(!(R>=T))return n(r)?(r.west=c,r.south=R,r.east=_,r.north=T,r):new E(c,R,_,T)}},E.union=function(e,t,r){return n(r)||(r=new E),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.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 i>a&&(a+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(a>n||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,R=e.south,T=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=T,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.latitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,0>_?A.latitude=_:R>0?A.latitude=R:A.latitude=0;for(var f=1;8>f;++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=T,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","./Plane","./Rectangle"],function(e,t,n,r,i,a,o,u,E,s,c,_,R){"use strict";function T(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var l=new e,A=new e,f=new e,d=new e,N=new e,h=new e,I=new e,S=new e,M=new e,O=new e,m=new e,y=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],I),a=e.clone(i,l),o=e.clone(i,A),u=e.clone(i,f),E=e.clone(i,d),s=e.clone(i,N),c=e.clone(i,h),_=t.length,R=1;_>R;R++){e.clone(t[R],i);var C=i.x,p=i.y,U=i.z;C<a.x&&e.clone(i,a),C>E.x&&e.clone(i,E),p<o.y&&e.clone(i,o),p>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,S)),F=e.magnitudeSquared(e.subtract(s,o,S)),P=e.magnitudeSquared(e.subtract(c,u,S)),v=a,D=E,B=L;F>B&&(B=F,v=o,D=s),P>B&&(B=P,v=u,D=c);var w=M;w.x=.5*(v.x+D.x),w.y=.5*(v.y+D.y),w.z=.5*(v.z+D.z);var g=e.magnitudeSquared(e.subtract(D,w,S)),x=Math.sqrt(g),z=O;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,S),.5,y),X=0;for(R=0;_>R;R++){e.clone(t[R],i);var V=e.magnitude(e.subtract(i,b,S));V>X&&(X=V);var H=e.magnitudeSquared(e.subtract(i,w,S));if(H>g){var W=Math.sqrt(H);x=.5*(x+W),g=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?(e.clone(w,n.center),n.radius=x):(e.clone(b,n.center),n.radius=X),n};var C=new o,p=new e,U=new e,L=new t,F=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,C),R.southwest(t,L),L.height=a,R.northeast(t,F),F.height=o;var E=i.project(L,p),s=i.project(F,U),c=s.x-E.x,_=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+_*_+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*_,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=R.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=I;u.x=t[0]+i.x,u.y=t[1]+i.y,u.z=t[2]+i.z;for(var E=e.clone(u,l),s=e.clone(u,A),c=e.clone(u,f),_=e.clone(u,d),R=e.clone(u,N),C=e.clone(u,h),p=t.length,U=0;p>U;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>R.y&&e.clone(u,R),P<c.z&&e.clone(u,c),P>C.z&&e.clone(u,C)}var v=e.magnitudeSquared(e.subtract(_,E,S)),D=e.magnitudeSquared(e.subtract(R,s,S)),B=e.magnitudeSquared(e.subtract(C,c,S)),w=E,g=_,x=v;D>x&&(x=D,w=s,g=R),B>x&&(x=B,w=c,g=C);var z=M;z.x=.5*(w.x+g.x),z.y=.5*(w.y+g.y),z.z=.5*(w.z+g.z);var G=e.magnitudeSquared(e.subtract(g,z,S)),b=Math.sqrt(G),X=O;X.x=E.x,X.y=s.y,X.z=c.z;var V=m;V.x=_.x,V.y=R.y,V.z=C.z;var H=e.multiplyByScalar(e.add(X,V,S),.5,y),W=0;for(U=0;p>U;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,S));q>W&&(W=q);var Y=e.magnitudeSquared(e.subtract(u,z,S));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 W>b?(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=I;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,l),u=e.clone(a,A),E=e.clone(a,f),s=e.clone(a,d),c=e.clone(a,N),_=e.clone(a,h),R=t.length,C=0;R>C;C+=3){var p=t[C]+n[C],U=t[C+1]+n[C+1],L=t[C+2]+n[C+2];a.x=p,a.y=U,a.z=L,p<o.x&&e.clone(a,o),p>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,S)),P=e.magnitudeSquared(e.subtract(c,u,S)),v=e.magnitudeSquared(e.subtract(_,E,S)),D=o,B=s,w=F;P>w&&(w=P,D=u,B=c),v>w&&(w=v,D=E,B=_);var g=M;g.x=.5*(D.x+B.x),g.y=.5*(D.y+B.y),g.z=.5*(D.z+B.z);var x=e.magnitudeSquared(e.subtract(B,g,S)),z=Math.sqrt(x),G=O;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,S),.5,y),V=0;for(C=0;R>C;C+=3){a.x=t[C]+n[C],a.y=t[C+1]+n[C+1],a.z=t[C+2]+n[C+2];var H=e.magnitude(e.subtract(a,X,S));H>V&&(V=H);var W=e.magnitudeSquared(e.subtract(a,g,S));if(W>x){var q=Math.sqrt(W);z=.5*(z+q),x=z*z;var Y=q-z;g.x=(z*g.x+Y*a.x)/q,g.y=(z*g.y+Y*a.y)/q,g.z=(z*g.z+Y*a.z)/q}}return V>z?(e.clone(g,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 v=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;i>o;o++)a.push(t[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;i>o;o++){var s=t[o];E=Math.max(E,e.distance(u,s.center,v)+s.radius)}return n.radius=E,n};var D=new e,B=new e,w=new e;T.fromOrientedBoundingBox=function(t,n){r(n)||(n=new T);var i=t.halfAxes,a=s.getColumn(i,0,D),o=s.getColumn(i,1,B),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){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new T(t.center,t.radius):void 0},T.packedLength=4,T.pack=function(e,t,r){r=n(r,0);var i=e.center;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 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,x=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,x);return e.add(R,a,R),e.clone(R,i.center),i.radius=_,i};var z=new e;T.expand=function(t,n,r){r=T.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,z));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-i>o?u.OUTSIDE:i>o?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 G=new e;T.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,G);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 b=new e;T.computePlaneDistances=function(t,n,i,a){r(a)||(a=new E);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 X=new e,V=new e,H=new e,W=new e,q=new e,Y=new t,K=new Array(8),k=0;8>k;++k)K[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,X),s=e.cross(e.UNIT_Z,E,V);e.normalize(s,s);var c=e.cross(E,s,H);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,W),l=K,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,d=0;f>d;++d){var N=l[d];e.add(o,N,N);var h=a.cartesianToCartographic(N,Y);r.project(h,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("Renderer/WebGLConstants",["../Core/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/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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++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",e(document[i])?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",e(document[i])&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",e(document[i])?r.fullscreenElement=i:(i=E+"FullScreenElement",e(document[i])&&(r.fullscreenElement=i)),i=E+"fullscreenchange",e(document["on"+i])&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",e(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;r>n;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(h)){h=!1;var e=/ Chrome\/([\.0-9]+)/.exec(N.userAgent);null!==e&&(h=!0,I=r(e[1]))}return h}function a(){return i()&&I}function o(){if(!t(S)&&(S=!1,!i()&&/ Safari\/[\.0-9]+/.test(N.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(N.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function u(){return o()&&M}function E(){if(!t(O)){O=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(N.userAgent);null!==e&&(O=!0,m=r(e[1]),m.isNightly=!!e[2])}return O}function s(){return E()&&m}function c(){if(!t(y)){y=!1;var e;"Microsoft Internet Explorer"===N.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(N.userAgent),null!==e&&(y=!0,C=r(e[1]))):"Netscape"===N.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(N.userAgent),null!==e&&(y=!0,C=r(e[1])))}return y}function _(){return c()&&C}function R(){if(!t(p)){p=!1;var e=/Firefox\/([\.0-9]+)/.exec(N.userAgent);null!==e&&(p=!0,U=r(e[1]))}return p}function T(){return t(L)||(L=/Windows/i.test(N.appVersion)),L}function l(){return R()&&U}function A(){return t(F)||(F="undefined"!=typeof PointerEvent&&(!t(N.pointerEnabled)||N.pointerEnabled)),F}function f(){if(!t(v)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;v=t(n)&&""!==n,v&&(P=n)}return v}function d(){return f()?P:void 0}var N;N="undefined"!=typeof navigator?navigator:{};var h,I,S,M,O,m,y,C,p,U,L,F,P,v,D={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isFirefox:R,firefoxVersion:l,isWindows:T,hardwareConcurrency:e(N.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:f,imageRenderingValue:d};return D.supportsFullscreen=function(){return n.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,i,a){"use strict";if(!i.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return n(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,n,i,a){switch(i=t(i,0),a=t(a,(n.byteLength-i)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,i,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,i,a);case o.SHORT:return new Int16Array(n,i,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,i,a);case o.FLOAT:return new Float32Array(n,i,a);case o.DOUBLE:return new Float64Array(n,i,a);default:throw new r("componentDatatype is not a valid value.")}},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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(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=void 0}return a.computeNumberOfVertices=function(e){var r=-1;for(var i in e.attributes)if(e.attributes.hasOwnProperty(i)&&t(e.attributes[i])&&t(e.attributes[i].values)){var a=e.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===a.UNSIGNED_BYTE||e===a.UNSIGNED_SHORT||e===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,r){return e>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,r):new Uint16Array(t,n,r)},r(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,_,R){"use strict";function T(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;T.packedLength=t.packedLength+3,T.pack=function(e,n,i){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};var d=new t,N={radii:d,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return T.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n,d);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 T(N))},T.createGeometry=function(t){var r,i,a,T,l,d,N=t._radii,h=o.fromCartesian3(N),I=t._stackPartitions,S=t._slicePartitions,M=t._subdivisions,O=M*(I+S-1),m=O-S+2,y=new Float64Array(3*m),C=c.createTypedArray(m,2*O),p=0,U=new Array(M),L=new Array(M);for(r=0;M>r;r++)a=_.TWO_PI*r/M,U[r]=A(a),L[r]=f(a);for(r=1;I>r;r++)for(T=Math.PI*r/I,l=A(T),d=f(T),i=0;M>i;i++)y[p++]=N.x*U[i]*d,y[p++]=N.y*L[i]*d,y[p++]=N.z*l;for(U.length=S,L.length=S,r=0;S>r;r++)a=_.TWO_PI*r/S,U[r]=A(a),L[r]=f(a);for(y[p++]=0,y[p++]=0,y[p++]=N.z,r=1;M>r;r++)for(T=Math.PI*r/M,l=A(T),d=f(T),i=0;S>i;i++)y[p++]=N.x*U[i]*d,y[p++]=N.y*L[i]*d,y[p++]=N.z*l;for(y[p++]=0,y[p++]=0,y[p++]=-N.z,p=0,r=0;I-1>r;++r){var F=r*M;for(i=0;M-1>i;++i)C[p++]=F+i,C[p++]=F+i+1;C[p++]=F+M-1,C[p++]=F}var P=M*(I-1);for(i=1;S+1>i;++i)C[p++]=P,C[p++]=P+i;for(r=0;M-2>r;++r){var v=r*S+1+P,D=(r+1)*S+1+P;for(i=0;S-1>i;++i)C[p++]=D+i,C[p++]=v+i;C[p++]=D+S-1,C[p++]=v+S-1}var B=y.length/3-1;for(i=B-1;i>B-S-1;--i)C[p++]=B,C[p++]=i;var w=new s({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:y})});return new u({attributes:w,indices:C,primitiveType:R.LINES,boundingSphere:e.fromEllipsoid(h)})},T}),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){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 diff --git a/Workers/createVerticesFromHeightmap.js b/Workers/createVerticesFromHeightmap.js index e648363..af4b472 100644 --- a/Workers/createVerticesFromHeightmap.js +++ b/Workers/createVerticesFromHeightmap.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,5 +55,175 @@ 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";var t=function(t){return void 0!==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";var e=function(t,e){return void 0!==t?t:e};return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";var e=function(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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("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^=2636928640&t<<7,t^=4022730752&t<<15,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){"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(t){return t>0?1:0>t?-1:0},n.signNotZero=function(t){return 0>t?-1:1},n.toSNorm=function(t){return Math.round(255*(.5*n.clamp(t,-1,1)+.5))},n.fromSNorm=function(t){return 2*(n.clamp(t,0,255)/255)-1},n.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},n.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},n.lerp=function(t,e,n){return(1-n)*t+n*e},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(t){return t*n.RADIANS_PER_DEGREE},n.toDegrees=function(t){return t*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(t){var e=n.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},n.negativePiToPi=function(t){for(var e=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+e)>t;)t+=i;if(-r>t)return-r;for(;t>r+e;)t-=i;return t>r?r:t},n.zeroToTwoPi=function(t){var e=t%n.TWO_PI;return 0>e?(e+n.TWO_PI)%n.TWO_PI:e},n.equalsEpsilon=function(t,n,r){return r=e(r,0),Math.abs(t-n)<=r};var r=[1];n.factorial=function(t){var e=r.length;if(t>=e)for(var n=r[e-1],i=e;t>=i;i++)r.push(n*i);return r[t]},n.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},n.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},n.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},n.clamp=function(t,e,n){return e>t?e:t>n?n:t};var i=new t;return n.setRandomNumberSeed=function(e){i=new t(e)},n.nextRandomNumber=function(){return i.random()},n.acosClamped=function(t){return Math.acos(n.clamp(t,-1,1))},n.asinClamped=function(t){return Math.asin(n.clamp(t,-1,1))},n}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)};a.fromSpherical=function(n,r){e(r)||(r=new a);var i=n.clock,o=n.cone,u=t(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(t,n,r,i){return e(i)?(i.x=t,i.y=n,i.z=r,i):new a(t,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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.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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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 s=new a,c=new a;a.angleBetween=function(t,e){a.normalize(t,s),a.normalize(e,c);var n=a.dot(s,c),r=a.magnitude(a.cross(s,c,s));return Math.atan2(r,n)};var h=new a;a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,h);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):n.y<=n.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r},a.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,s=e.z,c=i*s-a*u,h=a*o-r*s,l=r*u-i*o;return n.x=c,n.y=h,n.z=l,n},a.fromDegrees=function(t,e,n,r,o){var u=i.toRadians(t),s=i.toRadians(e);return a.fromRadians(u,s,n,r,o)};var l=new a,d=new a,f=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=t(i,0);var s=e(o)?o.radiiSquared:f,c=Math.cos(r);l.x=c*Math.cos(n),l.y=c*Math.sin(n),l.z=Math.sin(r),l=a.normalize(l,l),a.multiplyComponents(s,l,d);var h=Math.sqrt(a.dot(l,d));return d=a.divideByScalar(d,h,d),l=a.multiplyByScalar(l,i,l),e(u)||(u=new a),a.add(d,l,u)},a.fromDegreesArray=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=i.toRadians(t[o]);return a.fromRadiansArray(r,e,n)},a.fromRadiansArray=function(t,n,r){var i=t.length;e(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],s=t[o+1];r[o/2]=a.fromRadians(u,s,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o+=3)r[o]=i.toRadians(t[o]),r[o+1]=i.toRadians(t[o+1]),r[o+2]=t[o+2];return a.fromRadiansArrayHeights(r,e,n)},a.fromRadiansArrayHeights=function(t,n,r){var i=t.length;e(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],s=t[o+1],c=t[o+2];r[o/3]=a.fromRadians(u,s,c,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)};return a.fromRadians=function(n,r,i,o){return i=t(i,0),e(o)?(o.longitude=n,o.latitude=r,o.height=i,o):new a(n,r,i)},a.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),a.fromRadians(t,e,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new a(t.longitude,t.latitude,t.height):void 0},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.longitude-n.longitude)<=r&&Math.abs(t.latitude-n.latitude)<=r&&Math.abs(t.height-n.height)<=r},a.ZERO=r(new a(0,0,0)),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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),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"],function(t,e,n,r,i,a,o,u){"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}var c=function(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,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))return void 0;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.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),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=s,n.z=c,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 h=new t,l=new t;c.prototype.cartographicToCartesian=function(e,n){var i=h,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;n>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var d=new t,f=new t,m=new t;c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,f);if(!r(a))return void 0;var o=this.geodeticSurfaceNormal(a,d),s=t.subtract(n,a,m),c=Math.atan2(o.y,o.x),h=Math.asin(o.z),l=u.sign(t.dot(s,n))*t.magnitude(s);return r(i)?(i.longitude=c,i.latitude=h,i.height=l,i):new e(c,h,l)},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;n>i;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e};var y=new t,p=new t;return c.prototype.scaleToGeodeticSurface=function(e,n){var i=e.x,a=e.y,o=e.z,s=this._oneOverRadii,c=s.x,h=s.y,l=s.z,d=i*i*c*c,f=a*a*h*h,m=o*o*l*l,v=d+f+m,g=Math.sqrt(1/v),w=t.multiplyByScalar(e,g,y);if(v<this._centerToleranceSquared)return isFinite(g)?t.clone(w,n):void 0;var x=this._oneOverRadiiSquared,M=x.x,z=x.y,S=x.z,E=p;E.x=2*w.x*M,E.y=2*w.y*z,E.z=2*w.z*S;var R,O,_,T,b,I,C,P,N,q,A,U=(1-g)*t.magnitude(e)/(.5*t.magnitude(E)),L=0;do{U-=L,_=1/(1+U*M),T=1/(1+U*z),b=1/(1+U*S),I=_*_,C=T*T,P=b*b,N=I*_,q=C*T,A=P*b,R=d*I+f*C+m*P-1,O=d*N*M+f*q*z+m*A*S;var D=-2*O;L=R/D}while(Math.abs(R)>u.EPSILON12);return r(n)?(n.x=i*_,n.y=a*T,n.z=o*b,n):new t(i*_,a*T,o*b)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,s,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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";var u=function(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";var e=function(e,n){this.start=t(e,0),this.stop=t(n,0)};return e}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";var i=function(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)};i.fromElements=function(t,n,r,a,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=a,o):new i(t,n,r,a)},i.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 i(t.red,t.green,t.blue,t.alpha)},i.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new i(t.x,t.y,t.z,t.w):void 0},i.packedLength=4,i.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r++],a.w=n[r],a},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,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},i.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},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 a=new i;i.distance=function(t,e){return i.subtract(t,e,a),i.magnitude(a)},i.normalize=function(t,e){var n=i.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,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,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},i.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},i.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},i.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},i.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},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 o=new i;i.lerp=function(t,e,n,r){return i.multiplyByScalar(e,n,o),r=i.multiplyByScalar(t,1-n,r),i.add(o,r,r)};var u=new i;return i.mostOrthogonalAxis=function(t,e){var n=i.normalize(t,u);return i.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?i.clone(i.UNIT_X,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e):n.y<=n.z?n.y<=n.w?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e)},i.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},i.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r&&Math.abs(t.w-n.w)<=r},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(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e){return i.equalsEpsilon(this,t,e)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t){for(var e=0,n=0;9>n;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function u(t){for(var e=0,n=0;3>n;++n){var r=t[c.getElementIndex(f[n],d[n])];e+=2*r*r}return Math.sqrt(e)}function s(t,e){for(var n=a.EPSILON15,r=0,i=1,o=0;3>o;++o){var u=Math.abs(t[c.getElementIndex(f[o],d[o])]);u>r&&(i=o,r=u)}var s=1,h=0,l=d[i],m=f[i];if(Math.abs(t[c.getElementIndex(m,l)])>n){var y,p=t[c.getElementIndex(m,m)],v=t[c.getElementIndex(l,l)],g=t[c.getElementIndex(m,l)],w=(p-v)/2/g;y=0>w?-1/(-w+Math.sqrt(1+w*w)):1/(w+Math.sqrt(1+w*w)),s=1/Math.sqrt(1+y*y),h=y*s}return e=c.clone(c.IDENTITY,e),e[c.getElementIndex(l,l)]=e[c.getElementIndex(m,m)]=s,e[c.getElementIndex(m,l)]=h,e[c.getElementIndex(l,m)]=-h,e}var c=function(t,n,r,i,a,o,u,s,c){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(s,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(c,0)};c.clone=function(t,e){return n(t)?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 c(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},c.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new c),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},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[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 c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},c.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,u=t.y*t.y,s=t.y*t.z,h=t.y*t.w,l=t.z*t.z,d=t.z*t.w,f=t.w*t.w,m=r-u-l+f,y=2*(i-d),p=2*(a+h),v=2*(i+d),g=-r+u-l+f,w=2*(s-o),x=2*(a-h),M=2*(s+o),z=-r-u+l+f;return n(e)?(e[0]=m,e[1]=v,e[2]=x,e[3]=y,e[4]=g,e[5]=M,e[6]=p,e[7]=w,e[8]=z,e):new c(m,y,p,v,g,w,x,M,z)},c.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 c(t.x,0,0,0,t.y,0,0,0,t.z)},c.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 c(t,0,0,0,t,0,0,0,t)},c.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 c(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},c.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 c(1,0,0,0,r,-i,0,i,r)},c.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 c(r,0,i,0,1,0,-i,0,r)},c.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 c(r,-i,0,i,r,0,0,0,1)},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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},c.getElementIndex=function(t,e){return 3*t+e},c.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},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},c.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},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var h=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],h)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],h)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],h)),n};var l=new t;c.getMaximumScale=function(e){return c.getScale(e,l),t.maximumComponent(l)},c.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],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],c=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],h=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 n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=h,n[8]=l,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},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},c.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,s=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=s,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},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},c.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],s=t[2],c=t[5],h=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=s,e[7]=c,e[8]=h,e};var d=[1,0,0],f=[2,2,1],m=new c,y=new c;return c.computeEigenDecomposition=function(t,e){var r=a.EPSILON20,i=10,h=0,l=0;n(e)||(e={});for(var d=e.unitary=c.clone(c.IDENTITY,e.unitary),f=e.diagonal=c.clone(t,e.diagonal),p=r*o(f);i>l&&u(f)>p;)s(f,m),c.transpose(m,y),c.multiply(f,m,f),c.multiply(y,f,f),c.multiply(d,m,d),++h>2&&(++l,h=0);return 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},c.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],s=t[5],c=t[8];return e*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},c.inverse=function(t,e){var n=t[0],i=t[1],o=t[2],u=t[3],s=t[4],h=t[5],l=t[6],d=t[7],f=t[8],m=c.determinant(t);if(Math.abs(m)<=a.EPSILON15)throw new r("matrix is not invertible");e[0]=s*f-d*h,e[1]=d*o-i*f,e[2]=i*h-s*o,e[3]=l*h-u*f,e[4]=n*f-l*o,e[5]=u*o-n*h,e[6]=u*d-l*s,e[7]=l*i-n*d,e[8]=n*s-u*i;var y=1/m;return c.multiplyByScalar(e,y,e)},c.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]},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},c.IDENTITY=i(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(t){"use strict";var e=function(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,s){"use strict";var c=function(t,e,r,i,a,o,u,s,c,h,l,d,f,m,y,p){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(c,0),this[3]=n(f,0),this[4]=n(e,0),this[5]=n(o,0),this[6]=n(h,0),this[7]=n(m,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(l,0),this[11]=n(y,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(d,0),this[15]=n(p,0)};c.packedLength=16,c.pack=function(t,e,r){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]},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){return r(t)?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]):void 0},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,s=e.x*e.x,h=e.x*e.y,l=e.x*e.z,d=e.x*e.w,f=e.y*e.y,m=e.y*e.z,y=e.y*e.w,p=e.z*e.z,v=e.z*e.w,g=e.w*e.w,w=s-f-p+g,x=2*(h-v),M=2*(l+y),z=2*(h+v),S=-s+f-p+g,E=2*(m-d),R=2*(l-y),O=2*(m+d),_=-s-f+p+g;return i[0]=w*a,i[1]=z*a,i[2]=R*a,i[3]=0,i[4]=x*o,i[5]=S*o,i[6]=O*o,i[7]=0,i[8]=M*u,i[9]=E*u,i[10]=_*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},c.fromTranslation=function(t,e){return c.fromRotationTranslation(u.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 h=new t,l=new t,d=new t;c.fromCamera=function(e,n){var i=e.eye,a=e.target,o=e.up;t.normalize(t.subtract(a,i,h),h),t.normalize(t.cross(h,o,l),l),t.normalize(t.cross(l,h,d),d);var u=l.x,s=l.y,f=l.z,m=h.x,y=h.y,p=h.z,v=d.x,g=d.y,w=d.z,x=i.x,M=i.y,z=i.z,S=u*-x+s*-M+f*-z,E=v*-x+g*-M+w*-z,R=m*x+y*M+p*z;return r(n)?(n[0]=u,n[1]=v,n[2]=-m,n[3]=0,n[4]=s,n[5]=g,n[6]=-y,n[7]=0,n[8]=f,n[9]=w,n[10]=-p,n[11]=0,n[12]=S,n[13]=E,n[14]=R,n[15]=1,n):new c(u,s,f,S,v,g,w,E,-m,-y,-p,R,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,i){var a=Math.tan(.5*t),o=1/a,u=o/e,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},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),s=1/(r-n),c=1/(a-i),h=-(e+t)*u,l=-(r+n)*s,d=-(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]=h,o[13]=l,o[14]=d,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),s=2*i/(r-n),c=(e+t)/(e-t),h=(r+n)/(r-n),l=-(a+i)/(a-i),d=-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]=h,o[10]=l,o[11]=d,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),h=-1,l=-1,d=-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]=h,a[11]=l,a[12]=0,a[13]=0,a[14]=d,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),s=n(t.height,0);e=n(e,0),r=n(r,1);var c=.5*u,h=.5*s,l=.5*(r-e),d=c,f=h,m=l,y=a+c,p=o+h,v=e+l,g=1;return i[0]=d,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]=m,i[11]=0,i[12]=y,i[13]=p,i[14]=v,i[15]=g,i},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.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 f=new t;c.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 m=new t;c.getMaximumScale=function(e){return c.getScale(e,m),t.maximumComponent(m)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],s=t[5],c=t[6],h=t[7],l=t[8],d=t[9],f=t[10],m=t[11],y=t[12],p=t[13],v=t[14],g=t[15],w=e[0],x=e[1],M=e[2],z=e[3],S=e[4],E=e[5],R=e[6],O=e[7],_=e[8],T=e[9],b=e[10],I=e[11],C=e[12],P=e[13],N=e[14],q=e[15],A=r*w+u*x+l*M+y*z,U=i*w+s*x+d*M+p*z,L=a*w+c*x+f*M+v*z,D=o*w+h*x+m*M+g*z,W=r*S+u*E+l*R+y*O,B=i*S+s*E+d*R+p*O,V=a*S+c*E+f*R+v*O,k=o*S+h*E+m*R+g*O,j=r*_+u*T+l*b+y*I,H=i*_+s*T+d*b+p*I,F=a*_+c*T+f*b+v*I,Z=o*_+h*T+m*b+g*I,G=r*C+u*P+l*N+y*q,X=i*C+s*P+d*N+p*q,Y=a*C+c*P+f*N+v*q,K=o*C+h*P+m*N+g*q;return n[0]=A,n[1]=U,n[2]=L,n[3]=D,n[4]=W,n[5]=B,n[6]=V,n[7]=k,n[8]=j,n[9]=H,n[10]=F,n[11]=Z,n[12]=G,n[13]=X,n[14]=Y,n[15]=K,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],s=t[6],c=t[8],h=t[9],l=t[10],d=t[12],f=t[13],m=t[14],y=e[0],p=e[1],v=e[2],g=e[4],w=e[5],x=e[6],M=e[8],z=e[9],S=e[10],E=e[12],R=e[13],O=e[14],_=r*y+o*p+c*v,T=i*y+u*p+h*v,b=a*y+s*p+l*v,I=r*g+o*w+c*x,C=i*g+u*w+h*x,P=a*g+s*w+l*x,N=r*M+o*z+c*S,q=i*M+u*z+h*S,A=a*M+s*z+l*S,U=r*E+o*R+c*O+d,L=i*E+u*R+h*O+f,D=a*E+s*R+l*O+m;return n[0]=_,n[1]=T,n[2]=b,n[3]=0,n[4]=I,n[5]=C,n[6]=P,n[7]=0,n[8]=N,n[9]=q,n[10]=A,n[11]=0,n[12]=U,n[13]=L,n[14]=D,n[15]=1,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],s=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]=s,n[15]=t[15],n};var y=new t;c.multiplyByUniformScale=function(t,e,n){return y.x=e,y.y=e,y.z=e,c.multiplyByScale(t,y,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,s=t[1]*r+t[5]*i+t[9]*a+t[13]*o,c=t[2]*r+t[6]*i+t[10]*a+t[14]*o,h=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=s,n.z=c,n.w=h,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,s=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=s,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],s=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=s,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[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[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]},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 p=new u,v=new u,g=new e,w=new e(0,0,0,1);return c.inverse=function(t,n){if(u.equalsEpsilon(c.getRotation(t,p),v,o.EPSILON7)&&e.equals(c.getRow(t,3,g),w))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],h=t[12],l=t[1],d=t[5],f=t[9],m=t[13],y=t[2],x=t[6],M=t[10],z=t[14],S=t[3],E=t[7],R=t[11],O=t[15],_=M*O,T=z*R,b=x*O,I=z*E,C=x*R,P=M*E,N=y*O,q=z*S,A=y*R,U=M*S,L=y*E,D=x*S,W=_*d+I*f+C*m-(T*d+b*f+P*m),B=T*l+N*f+U*m-(_*l+q*f+A*m),V=b*l+q*d+L*m-(I*l+N*d+D*m),k=P*l+A*d+D*f-(C*l+U*d+L*f),j=T*i+b*a+P*h-(_*i+I*a+C*h),H=_*r+q*a+A*h-(T*r+N*a+U*h),F=I*r+N*i+D*h-(b*r+q*i+L*h),Z=C*r+U*i+L*a-(P*r+A*i+D*a);_=a*m,T=h*f,b=i*m,I=h*d,C=i*f,P=a*d,N=r*m,q=h*l,A=r*f,U=a*l,L=r*d,D=i*l;var G=_*E+I*R+C*O-(T*E+b*R+P*O),X=T*S+N*R+U*O-(_*S+q*R+A*O),Y=b*S+q*E+L*O-(I*S+N*E+D*O),K=P*S+A*E+D*R-(C*S+U*E+L*R),J=b*M+P*z+T*x-(C*z+_*x+I*M),Q=A*z+_*y+q*M-(N*M+U*z+T*y),$=N*x+D*z+I*y-(L*z+b*y+q*x),te=L*M+C*y+U*x-(A*x+D*M+P*y),ee=r*W+i*B+a*V+h*k;if(Math.abs(ee)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return ee=1/ee,n[0]=W*ee,n[1]=B*ee,n[2]=V*ee,n[3]=k*ee,n[4]=j*ee,n[5]=H*ee,n[6]=F*ee,n[7]=Z*ee,n[8]=G*ee,n[9]=X*ee,n[10]=Y*ee,n[11]=K*ee,n[12]=J*ee,n[13]=Q*ee,n[14]=$*ee,n[15]=te*ee,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],s=t[8],c=t[9],h=t[10],l=t[12],d=t[13],f=t[14],m=-n*l-r*d-i*f,y=-a*l-o*d-u*f,p=-s*l-c*d-h*f;return e[0]=n,e[1]=a,e[2]=s,e[3]=0,e[4]=r,e[5]=o,e[6]=c,e[7]=0,e[8]=i,e[9]=u,e[10]=h,e[11]=0,e[12]=m,e[13]=y,e[14]=p,e[15]=1,e},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";var u=function(t,n,r,i){this.west=e(t,0),this.south=e(n,0),this.east=e(r,0),this.north=e(i,0)};u.fromDegrees=function(t,r,i,a,s){return t=o.toRadians(e(t,0)),r=o.toRadians(e(r,0)),i=o.toRadians(e(i,0)),a=o.toRadians(e(a,0)),n(s)?(s.west=t,s.south=r,s.east=i,s.north=a,s):new u(t,r,i,a)},u.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=t.length;c>s;s++){var h=t[s];r=Math.min(r,h.longitude),i=Math.max(i,h.longitude),a=Math.min(a,h.latitude),o=Math.max(o,h.latitude)}return n(e)?(e.west=r,e.south=a,e.east=i,e.north=o,e):new u(r,a,i,o)},u.packedLength=4,u.pack=function(t,n,r){r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i.west=t[r++],i.south=t[r++],i.east=t[r++],i.north=t[r],i},u.clone=function(t,e){return n(t)?n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new u(t.west,t.south,t.east,t.north):void 0},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.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},u.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},u.validate=function(){},u.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)},u.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)},u.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)},u.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)},u.center=function(e,r){var i=e.east,a=e.west,u=.5*(a+i);return a>i&&(u=o.negativePiToPi(u+o.PI)),n(r)?(r.longitude=u,r.latitude=.5*(e.south+e.north),r.height=0,r):new t(u,.5*(e.south+e.north))},u.intersectWith=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),s=Math.min(t.north,e.north);return n(r)?(r.west=i,r.south=a,r.east=o,r.north=s,r):new u(i,a,o,s)},u.contains=function(t,e){return e.longitude>=t.west&&e.longitude<=t.east&&e.latitude>=t.south&&e.latitude<=t.north},u.isEmpty=function(t){return t.west>=t.east||t.south>=t.north};var s=new t;return u.subsample=function(t,r,a,u){r=e(r,i.WGS84),a=e(a,0),n(u)||(u=[]);var c=0,h=t.north,l=t.south,d=t.east,f=t.west,m=s;m.height=a,m.longitude=f,m.latitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=l,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=0>h?h:l>0?l:0;for(var y=1;8>y;++y){var p=-Math.PI+y*o.PI_OVER_TWO;p>f&&d>p&&(m.longitude=p,u[c]=r.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,s,c,h){"use strict";var l=function(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)},d=new t,f=new t,m=new t,y=new t,p=new t,v=new t,g=new t,w=new t,x=new t,M=new t,z=new t,S=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],g),a=t.clone(i,d),o=t.clone(i,f),u=t.clone(i,m),s=t.clone(i,y),c=t.clone(i,p),h=t.clone(i,v),E=e.length,R=1;E>R;R++){t.clone(e[R],i);var O=i.x,_=i.y,T=i.z;O<a.x&&t.clone(i,a),O>s.x&&t.clone(i,s),_<o.y&&t.clone(i,o),_>c.y&&t.clone(i,c),T<u.z&&t.clone(i,u),T>h.z&&t.clone(i,h)}var b=t.magnitudeSquared(t.subtract(s,a,w)),I=t.magnitudeSquared(t.subtract(c,o,w)),C=t.magnitudeSquared(t.subtract(h,u,w)),P=a,N=s,q=b;I>q&&(q=I,P=o,N=c),C>q&&(q=C,P=u,N=h);var A=x;A.x=.5*(P.x+N.x),A.y=.5*(P.y+N.y),A.z=.5*(P.z+N.z);var U=t.magnitudeSquared(t.subtract(N,A,w)),L=Math.sqrt(U),D=M;D.x=a.x,D.y=o.y,D.z=u.z;var W=z;W.x=s.x,W.y=c.y,W.z=h.z;var B=t.multiplyByScalar(t.add(D,W,w),.5,S),V=0;for(R=0;E>R;R++){t.clone(e[R],i);var k=t.magnitude(t.subtract(i,B,w));k>V&&(V=k);var j=t.magnitudeSquared(t.subtract(i,A,w));if(j>U){var H=Math.sqrt(j);L=.5*(L+H),U=L*L;var F=H-L;A.x=(L*A.x+F*i.x)/H,A.y=(L*A.y+F*i.y)/H,A.z=(L*A.z+F*i.z)/H}}return V>L?(t.clone(A,n.center),n.radius=L):(t.clone(B,n.center),n.radius=V),n};var E=new o,R=new t,O=new t,_=new e,T=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,E),h.southwest(e,_),_.height=a,h.northeast(e,T),T.height=o;var s=i.project(_,R),c=i.project(T,O),d=c.x-s.x,f=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(d*d+f*f+m*m);var y=u.center;return y.x=s.x+.5*d,y.y=s.y+.5*f,y.z=s.z+.5*m,u};var b=[];l.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=h.subsample(t,e,i,b)),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=g;u.x=e[0]+i.x,u.y=e[1]+i.y,u.z=e[2]+i.z;for(var s=t.clone(u,d),c=t.clone(u,f),h=t.clone(u,m),E=t.clone(u,y),R=t.clone(u,p),O=t.clone(u,v),_=e.length,T=0;_>T;T+=a){var b=e[T]+i.x,I=e[T+1]+i.y,C=e[T+2]+i.z;u.x=b,u.y=I,u.z=C,b<s.x&&t.clone(u,s),b>E.x&&t.clone(u,E),I<c.y&&t.clone(u,c),I>R.y&&t.clone(u,R),C<h.z&&t.clone(u,h),C>O.z&&t.clone(u,O)}var P=t.magnitudeSquared(t.subtract(E,s,w)),N=t.magnitudeSquared(t.subtract(R,c,w)),q=t.magnitudeSquared(t.subtract(O,h,w)),A=s,U=E,L=P;N>L&&(L=N,A=c,U=R),q>L&&(L=q,A=h,U=O);var D=x;D.x=.5*(A.x+U.x),D.y=.5*(A.y+U.y),D.z=.5*(A.z+U.z);var W=t.magnitudeSquared(t.subtract(U,D,w)),B=Math.sqrt(W),V=M;V.x=s.x,V.y=c.y,V.z=h.z;var k=z;k.x=E.x,k.y=R.y,k.z=O.z;var j=t.multiplyByScalar(t.add(V,k,w),.5,S),H=0;for(T=0;_>T;T+=a){u.x=e[T]+i.x,u.y=e[T+1]+i.y,u.z=e[T+2]+i.z;var F=t.magnitude(t.subtract(u,j,w));F>H&&(H=F);var Z=t.magnitudeSquared(t.subtract(u,D,w));if(Z>W){var G=Math.sqrt(Z);B=.5*(B+G),W=B*B;var X=G-B;D.x=(B*D.x+X*u.x)/G,D.y=(B*D.y+X*u.y)/G,D.z=(B*D.z+X*u.z)/G}}return H>B?(t.clone(D,o.center),o.radius=B):(t.clone(j,o.center),o.radius=H),o},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},l.clone=function(e,n){return r(e)?r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new l(e.center,e.radius):void 0},l.packedLength=4,l.pack=function(t,e,r){r=n(r,0);var i=t.center;e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius},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 I=new t,C=new t;l.union=function(e,n,i){r(i)||(i=new l);var a=e.center,o=n.center;t.add(a,o,C);var u=t.multiplyByScalar(C,.5,C),s=t.magnitude(t.subtract(a,u,I))+e.radius,c=t.magnitude(t.subtract(o,u,I))+n.radius;return i.radius=Math.max(s,c),t.clone(u,i.center),i};var P=new t;l.expand=function(e,n,r){r=l.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,P));return i>r.radius&&(r.radius=i),r},l.intersect=function(e,n){var r=e.center,i=e.radius,a=t.dot(n,r)+n.w;return-i>a?u.OUTSIDE:i>a?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 N=new t;l.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,N);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 q=new t;l.computePlaneDistances=function(e,n,i,a){r(a)||(a=new s);var o=t.subtract(e.center,n,q),u=t.multiplyByScalar(i,t.dot(i,o),q),c=t.magnitude(u);return a.start=c-e.radius,a.stop=c+e.radius,a};for(var A=new t,U=new t,L=new t,D=new t,W=new t,B=new e,V=new Array(8),k=0;8>k;++k)V[k]=new t;var j=new o;return l.projectTo2D=function(e,r,i){r=n(r,j);var a=r.ellipsoid,o=e.center,u=e.radius,s=a.geodeticSurfaceNormal(o,A),c=t.cross(t.UNIT_Z,s,U);t.normalize(c,c);var h=t.cross(s,c,L);t.normalize(h,h),t.multiplyByScalar(s,u,s),t.multiplyByScalar(h,u,h),t.multiplyByScalar(c,u,c);var d=t.negate(h,W),f=t.negate(c,D),m=V,y=m[0];t.add(s,h,y),t.add(y,c,y),y=m[1],t.add(s,h,y),t.add(y,f,y),y=m[2],t.add(s,d,y),t.add(y,f,y),y=m[3],t.add(s,d,y),t.add(y,c,y),t.negate(s,s),y=m[4],t.add(s,h,y),t.add(y,c,y),y=m[5],t.add(s,h,y),t.add(y,f,y),y=m[6],t.add(s,d,y),t.add(y,f,y),y=m[7],t.add(s,d,y),t.add(y,c,y);for(var p=m.length,v=0;p>v;++v){var g=m[v];t.add(o,g,g);var w=a.cartesianToCartographic(g,B);r.project(w,g)}i=l.fromPoints(m,i),o=i.center;var x=o.x,M=o.y,z=o.z;return o.x=z,o.y=x,o.z=M,i},l.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},l.prototype.intersect=function(t){return l.intersect(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/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r){var i=t.transformPositionToScaledSpace(n,m),a=e.magnitudeSquared(i),o=Math.sqrt(a),u=e.divideByScalar(i,o,y);a=Math.max(1,a),o=Math.max(1,o);var s=e.dot(u,r),c=e.magnitude(e.cross(u,r,u)),h=1/o,l=Math.sqrt(a-1)*h;return 1/(s*h-c*l)}function s(t,n,r){return 0>=n||n===1/0||n!==n?void 0:e.multiplyByScalar(t,n,r)}function c(t,n){return t.transformPositionToScaledSpace(n,p),e.normalize(p,p)}var h=function(t,n){this._ellipsoid=t,this._cameraPosition=new e,this._cameraPositionInScaledSpace=new e,this._distanceToLimbInScaledSpaceSquared=0,r(n)&&(this.cameraPosition=n)};i(h.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(t){var n=this._ellipsoid,r=n.transformPositionToScaledSpace(t,this._cameraPositionInScaledSpace),i=e.magnitudeSquared(r)-1;e.clone(t,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=i}}});var l=new e;h.prototype.isPointVisible=function(t){var e=this._ellipsoid,n=e.transformPositionToScaledSpace(t,l);return this.isScaledSpacePointVisible(n)},h.prototype.isScaledSpacePointVisible=function(t){var n=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,i=e.subtract(t,n,l),a=-e.dot(i,n),o=a>r&&a*a/e.magnitudeSquared(i)>r;return!o},h.prototype.computeHorizonCullingPoint=function(t,n,i){r(i)||(i=new e);for(var a=this._ellipsoid,o=c(a,t),h=0,l=0,d=n.length;d>l;++l){var f=n[l],m=u(a,f,o);h=Math.max(h,m)}return s(o,h,i)};var d=new e;h.prototype.computeHorizonCullingPointFromVertices=function(t,i,a,o,h){r(h)||(h=new e),o=n(o,e.ZERO);for(var l=this._ellipsoid,f=c(l,t),m=0,y=0,p=i.length;p>y;y+=a){d.x=i[y]+o.x,d.y=i[y+1]+o.y,d.z=i[y+2]+o.z;var v=u(l,d,f);m=Math.max(m,v)}return s(f,m,h)};var f=[];h.prototype.computeHorizonCullingPointFromRectangle=function(n,r,i){var a=o.subsample(n,r,0,f),u=t.fromPoints(a);return e.magnitude(u.center)<.1*r.minimumRadius?void 0:this.computeHorizonCullingPoint(u.center,a,i)};var m=new e,y=new e,p=new e;return h}),define("Core/HeightmapTessellator",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";var u={};return u.DEFAULT_STRUCTURE=a({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1}),u.computeVertices=function(r){var a,s,c,h,l=Math.cos,d=Math.sin,f=Math.sqrt,m=Math.atan,y=Math.exp,p=o.PI_OVER_TWO,v=o.toRadians,g=r.vertices,w=r.heightmap,x=r.width,M=r.height,z=r.skirtHeight,S=e(r.isGeographic,!0),E=e(r.ellipsoid,i.WGS84),R=1/E.maximumRadius,O=r.nativeRectangle,_=r.rectangle;n(_)?(a=_.west,s=_.south,c=_.east,h=_.north):S?(a=v(O.west),s=v(O.south),c=v(O.east),h=v(O.north)):(a=O.west*R,s=p-2*m(y(-O.south*R)),c=O.east*R,h=p-2*m(y(-O.north*R)));var T=e(r.relativeToCenter,t.ZERO),b=e(r.structure,u.DEFAULT_STRUCTURE),I=e(b.heightScale,u.DEFAULT_STRUCTURE.heightScale),C=e(b.heightOffset,u.DEFAULT_STRUCTURE.heightOffset),P=e(b.elementsPerHeight,u.DEFAULT_STRUCTURE.elementsPerHeight),N=e(b.stride,u.DEFAULT_STRUCTURE.stride),q=e(b.elementMultiplier,u.DEFAULT_STRUCTURE.elementMultiplier),A=e(b.isBigEndian,u.DEFAULT_STRUCTURE.isBigEndian),U=(O.east-O.west)/(x-1),L=(O.north-O.south)/(M-1),D=E.radiiSquared,W=D.x,B=D.y,V=D.z,k=0,j=65536,H=-65536,F=0,Z=M,G=0,X=x;z>0&&(--F,++Z,--G,++X);for(var Y=F;Z>Y;++Y){var K=Y;0>K&&(K=0),K>=M&&(K=M-1);var J=O.north-L*K;J=S?v(J):p-2*m(y(-J*R));for(var Q=l(J),$=d(J),te=V*$,ee=(J-s)/(h-s),ne=G;X>ne;++ne){var re=ne;0>re&&(re=0),re>=x&&(re=x-1);var ie=O.west+U*re;S?ie=v(ie):ie*=R;var ae,oe=K*x*N+re*N;if(1===P)ae=w[oe];else{ae=0;var ue;if(A)for(ue=0;P>ue;++ue)ae=ae*q+w[oe+ue];else for(ue=P-1;ue>=0;--ue)ae=ae*q+w[oe+ue]}ae=ae*I+C,H=Math.max(H,ae),j=Math.min(j,ae),(ne!==re||Y!==K)&&(ae-=z);var se=Q*l(ie),ce=Q*d(ie),he=W*se,le=B*ce,de=f(he*se+le*ce+te*$),fe=1/de,me=he*fe,ye=le*fe,pe=te*fe;g[k++]=me+se*ae-T.x,g[k++]=ye+ce*ae-T.y,g[k++]=pe+$*ae-T.z,g[k++]=ae;var ve=(ie-a)/(c-a);g[k++]=ve,g[k++]=ee}}return{maximumHeight:H,minimumHeight:j}},u}),define("Core/formatError",["./defined"],function(t){"use strict";var e=function(e){var n,r=e.name,i=e.message;n=t(r)&&t(i)?r+": "+i:e.toString();var a=e.stack;return t(a)&&(n+="\n"+a),n};return e}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(t,e,n){"use strict";var r=function(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(c){o.error=c instanceof Error?{name:c.name,message:c.message,stack:c.stack}:c}e(i)||(i=t(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(a.length=0);try{i(o,a)}catch(c){o.result=void 0,o.error="postMessage failed with error: "+n(c)+"\n with responseMessage: "+JSON.stringify(o),i(o)}}};return r}),define("Workers/createVerticesFromHeightmap",["../Core/BoundingSphere","../Core/Ellipsoid","../Core/EllipsoidalOccluder","../Core/HeightmapTessellator","../Core/Rectangle","./createTaskProcessorWorker"],function(t,e,n,r,i,a){"use strict";function o(a,o){var u=6,s=a.width,c=a.height;a.skirtHeight>0&&(s+=2,c+=2);var h=new Float32Array(s*c*u);o.push(h.buffer),a.ellipsoid=e.clone(a.ellipsoid),a.rectangle=i.clone(a.rectangle),a.vertices=h;var l=r.computeVertices(a),d=t.fromVertices(h,a.relativeToCenter,u),f=a.ellipsoid,m=new n(f),y=m.computeHorizonCullingPointFromVertices(a.relativeToCenter,h,u,a.relativeToCenter);return{vertices:h.buffer,numberOfAttributes:u,minimumHeight:l.minimumHeight,maximumHeight:l.maximumHeight,gridWidth:s,gridHeight:c,boundingSphere3D:d,occludeePointInScaledSpace:y}}return a(o)})}(); \ No newline at end of file +/** + @license + when.js - https://github.com/cujojs/when + + MIT License (c) copyright B Cavalier & J Hann + + * A lightweight CommonJS Promises/A and when() implementation + * when is part of the cujo.js family of libraries (http://cujojs.com/) + * + * Licensed under the MIT License at: + * http://www.opensource.org/licenses/mit-license.php + * + * @version 1.7.1 + */ + +/** +@license +sprintf.js from the php.js project - https://github.com/kvz/phpjs +Directly from https://github.com/kvz/phpjs/blob/master/functions/strings/sprintf.js + +php.js is copyright 2012 Kevin van Zonneveld. + +Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld +(http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White +(http://getsprink.com), Waldo Malqui Silva, Paulo Freitas, Jack, Jonas +Raoni Soares Silva (http://www.jsfromhell.com), Philip Peterson, Legaev +Andrey, Ates Goral (http://magnetiq.com), Alex, Ratheous, Martijn Wieringa, +Rafa? Kukawski (http://blog.kukawski.pl), lmeyrick +(https://sourceforge.net/projects/bcmath-js/), Nate, Philippe Baumann, +Enrique Gonzalez, Webtoolkit.info (http://www.webtoolkit.info/), Carlos R. +L. Rodrigues (http://www.jsfromhell.com), Ash Searle +(http://hexmen.com/blog/), Jani Hartikainen, travc, Ole Vrijenhoek, +Erkekjetter, Michael Grier, Rafa? Kukawski (http://kukawski.pl), Johnny +Mast (http://www.phpvrouwen.nl), T.Wild, d3x, +http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript, +Rafa? Kukawski (http://blog.kukawski.pl/), stag019, pilus, WebDevHobo +(http://webdevhobo.blogspot.com/), marrtins, GeekFG +(http://geekfg.blogspot.com), Andrea Giammarchi +(http://webreflection.blogspot.com), Arpad Ray (mailto:arpad@php.net), +gorthaur, Paul Smith, Tim de Koning (http://www.kingsquare.nl), Joris, Oleg +Eremeev, Steve Hilder, majak, gettimeofday, KELAN, Josh Fraser +(http://onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/), +Marc Palau, Martin +(http://www.erlenwiese.de/), Breaking Par Consulting Inc +(http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256CFB006C45F7), +Chris, Mirek Slugen, saulius, Alfonso Jimenez +(http://www.alfonsojimenez.com), Diplom@t (http://difane.com/), felix, +Mailfaker (http://www.weedem.fr/), Tyler Akins (http://rumkin.com), Caio +Ariede (http://caioariede.com), Robin, Kankrelune +(http://www.webfaktory.info/), Karol Kowalski, Imgen Tata +(http://www.myipdf.com/), mdsjack (http://www.mdsjack.bo.it), Dreamer, +Felix Geisendoerfer (http://www.debuggable.com/felix), Lars Fischer, AJ, +David, Aman Gupta, Michael White, Public Domain +(http://www.json.org/json2.js), Steven Levithan +(http://blog.stevenlevithan.com), Sakimori, Pellentesque Malesuada, +Thunder.m, Dj (http://phpjs.org/functions/htmlentities:425#comment_134018), +Steve Clay, David James, Francois, class_exists, nobbler, T. Wild, Itsacon +(http://www.itsacon.net/), date, Ole Vrijenhoek (http://www.nervous.nl/), +Fox, Raphael (Ao RUDLER), Marco, noname, Mateusz "loonquawl" Zalega, Frank +Forte, Arno, ger, mktime, john (http://www.jd-tech.net), Nick Kolosov +(http://sammy.ru), marc andreu, Scott Cariss, Douglas Crockford +(http://javascript.crockford.com), madipta, Slawomir Kaniecki, +ReverseSyntax, Nathan, Alex Wilson, kenneth, Bayron Guevara, Adam Wallner +(http://web2.bitbaro.hu/), paulo kuong, jmweb, Lincoln Ramsay, djmix, +Pyerre, Jon Hohle, Thiago Mata (http://thiagomata.blog.com), lmeyrick +(https://sourceforge.net/projects/bcmath-js/this.), Linuxworld, duncan, +Gilbert, Sanjoy Roy, Shingo, sankai, Oskar Larsson H?gfeldt +(http://oskar-lh.name/), Denny Wardhana, 0m3r, Everlasto, Subhasis Deb, +josh, jd, Pier Paolo Ramon (http://www.mastersoup.com/), P, merabi, Soren +Hansen, Eugene Bulkin (http://doubleaw.com/), Der Simon +(http://innerdom.sourceforge.net/), echo is bad, Ozh, XoraX +(http://www.xorax.info), EdorFaus, JB, J A R, Marc Jansen, Francesco, LH, +Stoyan Kyosev (http://www.svest.org/), nord_ua, omid +(http://phpjs.org/functions/380:380#comment_137122), Brad Touesnard, MeEtc +(http://yass.meetcweb.com), Peter-Paul Koch +(http://www.quirksmode.org/js/beat.html), Olivier Louvignes +(http://mg-crea.com/), T0bsn, Tim Wiel, Bryan Elliott, Jalal Berrami, +Martin, JT, David Randall, Thomas Beaucourt (http://www.webapp.fr), taith, +vlado houba, Pierre-Luc Paour, Kristof Coomans (SCK-CEN Belgian Nucleair +Research Centre), Martin Pool, Kirk Strobeck, Rick Waldron, Brant Messenger +(http://www.brantmessenger.com/), Devan Penner-Woelk, Saulo Vallory, Wagner +B. Soares, Artur Tchernychev, Valentina De Rosa, Jason Wong +(http://carrot.org/), Christoph, Daniel Esteban, strftime, Mick@el, rezna, +Simon Willison (http://simonwillison.net), Anton Ongson, Gabriel Paderni, +Marco van Oort, penutbutterjelly, Philipp Lenssen, Bjorn Roesbeke +(http://www.bjornroesbeke.be/), Bug?, Eric Nagel, Tomasz Wesolowski, +Evertjan Garretsen, Bobby Drake, Blues (http://tech.bluesmoon.info/), Luke +Godfrey, Pul, uestla, Alan C, Ulrich, Rafal Kukawski, Yves Sucaet, +sowberry, Norman "zEh" Fuchs, hitwork, Zahlii, johnrembo, Nick Callen, +Steven Levithan (stevenlevithan.com), ejsanders, Scott Baker, Brian Tafoya +(http://www.premasolutions.com/), Philippe Jausions +(http://pear.php.net/user/jausions), Aidan Lister +(http://aidanlister.com/), Rob, e-mike, HKM, ChaosNo1, metjay, strcasecmp, +strcmp, Taras Bogach, jpfle, Alexander Ermolaev +(http://snippets.dzone.com/user/AlexanderErmolaev), DxGx, kilops, Orlando, +dptr1988, Le Torbi, James (http://www.james-bell.co.uk/), Pedro Tainha +(http://www.pedrotainha.com), James, Arnout Kazemier +(http://www.3rd-Eden.com), Chris McMacken, gabriel paderni, Yannoo, +FGFEmperor, baris ozdil, Tod Gentille, Greg Frazier, jakes, 3D-GRAF, Allan +Jensen (http://www.winternet.no), Howard Yeend, Benjamin Lupton, davook, +daniel airton wermann (http://wermann.com.br), Atli T¨®r, Maximusya, Ryan +W Tenney (http://ryan.10e.us), Alexander M Beedie, fearphage +(http://http/my.opera.com/fearphage/), Nathan Sepulveda, Victor, Matteo, +Billy, stensi, Cord, Manish, T.J. Leahy, Riddler +(http://www.frontierwebdev.com/), Rafa? Kukawski, FremyCompany, Matt +Bradley, Tim de Koning, Luis Salazar (http://www.freaky-media.com/), Diogo +Resende, Rival, Andrej Pavlovic, Garagoth, Le Torbi +(http://www.letorbi.de/), Dino, Josep Sanz (http://www.ws3.es/), rem, +Russell Walker (http://www.nbill.co.uk/), Jamie Beck +(http://www.terabit.ca/), setcookie, Michael, YUI Library: +http://developer.yahoo.com/yui/docs/YAHOO.util.DateLocale.html, Blues at +http://hacks.bluesmoon.info/strftime/strftime.js, Ben +(http://benblume.co.uk/), DtTvB +(http://dt.in.th/2008-09-16.string-length-in-bytes.html), Andreas, William, +meo, incidence, Cagri Ekin, Amirouche, Amir Habibi +(http://www.residence-mixte.com/), Luke Smith (http://lucassmith.name), +Kheang Hok Chin (http://www.distantia.ca/), Jay Klehr, Lorenzo Pisani, +Tony, Yen-Wei Liu, Greenseed, mk.keck, Leslie Hoare, dude, booeyOH, Ben +Bryan + +Licensed under the MIT (MIT-LICENSE.txt) license. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL KEVIN VAN ZONNEVELD BE LIABLE FOR ANY CLAIM, DAMAGES +OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. +*/ + +/** + * @license + * + * Grauw URI utilities + * + * See: http://hg.grauw.nl/grauw-lib/file/tip/src/uri.js + * + * @author Laurens Holst (http://www.grauw.nl/) + * + * Copyright 2012 Laurens Holst + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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:0>e?-1:0},a.signNotZero=function(e){return 0>e?-1:1},a.toSNorm=function(e){return Math.round(255*(.5*a.clamp(e,-1,1)+.5))},a.fromSNorm=function(e){return a.clamp(e,0,255)/255*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.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 a>=i||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;e>=r;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}i.fromSpherical=function(n,r){t(r)||(r=new i);var a=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(o),r},i.fromElements=function(e,n,r,a){return t(a)?(a.x=e,a.y=n,a.z=r,a):new i(e,n,r)},i.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 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},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},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 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){i.normalize(e,s),i.normalize(t,c);var n=i.dot(s,c),r=i.magnitude(i.cross(s,c,s));return Math.atan2(r,n)};var l=new i;i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):n.y<=n.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,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},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},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)},i.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,d=r*u-a*o;return n.x=c,n.y=l,n.z=d,n},i.fromDegrees=function(e,t,n,r,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,n,r,o)};var d=new i,f=new i,E=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(n,r,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:E,c=Math.cos(r);d.x=c*Math.cos(n),d.y=c*Math.sin(n),d.z=Math.sin(r),d=i.normalize(d,d),i.multiplyComponents(s,d,f);var l=Math.sqrt(i.dot(d,f));return f=i.divideByScalar(f,l,f),d=i.multiplyByScalar(d,a,d),t(u)||(u=new i),i.add(f,d,u)},i.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=a.toRadians(e[o]);return i.fromRadiansArray(r,t,n)},i.fromRadiansArray=function(e,n,r){var a=e.length;t(r)?r.length=a/2:r=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=i.fromRadians(u,s,0,n,r[o/2])}return r},i.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=a.toRadians(e[o]),r[o+1]=a.toRadians(e[o+1]),r[o+2]=e[o+2];return i.fromRadiansArrayHeights(r,t,n)},i.fromRadiansArrayHeights=function(e,n,r){var a=e.length;t(r)?r.length=a/3:r=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=i.fromRadians(u,s,c,n,r[o/3])}return r},i.ZERO=r(new i(0,0,0)),i.UNIT_X=r(new i(1,0,0)),i.UNIT_Y=r(new i(0,1,0)),i.UNIT_Z=r(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,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},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,d=n.y,f=n.z,E=a.x,h=a.y,m=a.z,_=l*l*E*E,R=d*d*h*h,T=f*f*m*m,p=_+R+T,y=Math.sqrt(1/p),S=e.multiplyByScalar(n,y,i);if(s>p)return isFinite(y)?e.clone(S,c):void 0;var A=u.x,N=u.y,M=u.z,I=o;I.x=S.x*A*2,I.y=S.y*N*2,I.z=S.z*M*2;var O,v,g,w,x,C,P,U,D,F,L,B=(1-y)*e.magnitude(n)/(.5*e.magnitude(I)),z=0;do{B-=z,g=1/(1+B*A),w=1/(1+B*N),x=1/(1+B*M),C=g*g,P=w*w,U=x*x,D=C*g,F=P*w,L=U*x,O=_*C+R*P+T*U-1,v=_*D*A+R*F*N+T*L*M;var b=-2*v;z=O/b}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=l*g,c.y=d*w,c.z=f*x,c):new e(l*g,d*w,f*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,d=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),E=i.EPSILON1;return u.fromCartesian=function(t,r,a){var h=n(r)?r.oneOverRadii:d,m=n(r)?r.oneOverRadiiSquared:f,_=n(r)?r._centerToleranceSquared:E,R=o(t,h,m,_,c);if(n(R)){var T=e.multiplyComponents(t,m,s);T=e.normalize(T,T);var p=e.subtract(t,R,l),y=Math.atan2(T.y,T.x),S=Math.asin(T.z),A=i.sign(e.dot(p,t))*e.magnitude(p);return n(a)?(a.longitude=y,a.latitude=S,a.height=A,a):new u(y,S,A)}},u.clone=function(e,t){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){a=n(a,0),e.pack(t._radii,r,a)},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 d=new e,f=new e;l.prototype.cartographicToCartesian=function(t,n){var a=d,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;n>a;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var E=new e,h=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,h);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),d=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=d,a):new t(c,l,d)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;n>a;++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}),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,d=t.length,f=1;d>f;f++){var E=t[f],h=E.x,m=E.y,_=E.z;a=Math.min(h,a),s=Math.max(h,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(_,u),l=Math.max(_,l)}var R=r.minimum;R.x=a,R.y=o,R.z=u;var T=r.maximum;T.x=s,T.y=c,T.z=l;var p=e.add(R,T,r.center);return e.multiplyByScalar(p,.5,p),r},i.clone=function(t,r){return n(t)?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):void 0},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:0>s+u?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","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(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 u(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;3>n;++n){var r=e[o.getElementIndex(E[n],f[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=i.EPSILON15,r=0,a=1,u=0;3>u;++u){var s=Math.abs(e[o.getElementIndex(E[u],f[u])]);s>r&&(a=u,r=s)}var c=1,l=0,d=f[a],h=E[a];if(Math.abs(e[o.getElementIndex(h,d)])>n){var m,_=e[o.getElementIndex(h,h)],R=e[o.getElementIndex(d,d)],T=e[o.getElementIndex(h,d)],p=(_-R)/2/T;m=0>p?-1/(-p+Math.sqrt(1+p*p)):1/(p+Math.sqrt(1+p*p)),c=1/Math.sqrt(1+m*m),l=m*c}return t=o.clone(o.IDENTITY,t),t[o.getElementIndex(d,d)]=t[o.getElementIndex(h,h)]=c,t[o.getElementIndex(h,d)]=l,t[o.getElementIndex(d,h)]=-l,t}o.packedLength=9,o.pack=function(e,n,r){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]},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},o.clone=function(e,t){return n(e)?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 o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},o.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,u=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,d=e.z*e.z,f=e.z*e.w,E=e.w*e.w,h=r-s-d+E,m=2*(a-f),_=2*(i+l),R=2*(a+f),T=-r+s-d+E,p=2*(c-u),y=2*(i-l),S=2*(c+u),A=-r-s+d+E;return n(t)?(t[0]=h,t[1]=R,t[2]=y,t[3]=m,t[4]=T,t[5]=S,t[6]=_,t[7]=p,t[8]=A,t):new o(h,m,_,R,T,p,y,S,A)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,r,-a,0,a,r)},o.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 o(r,0,a,0,1,0,-a,0,r)},o.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 o(r,-a,0,a,r,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},o.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},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;o.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 d=new e;o.getMaximumScale=function(t){return o.getScale(t,d),e.maximumComponent(d)},o.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],d=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]=d,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[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},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[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},o.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},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[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},o.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},o.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},o.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 f=[1,0,0],E=[2,2,1],h=new o,m=new o;return o.computeEigenDecomposition=function(e,t){var r=i.EPSILON20,a=10,l=0,d=0;n(t)||(t={});for(var f=t.unitary=o.clone(o.IDENTITY,t.unitary),E=t.diagonal=o.clone(e,t.diagonal),_=r*u(E);a>d&&s(E)>_;)c(E,h),o.transpose(h,m),o.multiply(E,h,E),o.multiply(m,E,E),o.multiply(f,h,f),++l>2&&(++d,l=0);return 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[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},o.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)},o.inverse=function(e,t){var n=e[0],a=e[1],u=e[2],s=e[3],c=e[4],l=e[5],d=e[6],f=e[7],E=e[8],h=o.determinant(e);if(Math.abs(h)<=i.EPSILON15)throw new r("matrix is not invertible");t[0]=c*E-f*l,t[1]=f*u-a*E,t[2]=a*l-c*u,t[3]=d*l-s*E,t[4]=n*E-d*u,t[5]=s*u-n*l,t[6]=s*f-d*c,t[7]=d*a-n*f,t[8]=n*c-s*a;var m=1/h;return o.multiplyByScalar(t,m,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=a(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=a(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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.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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a,i,o,u,s,c,l,d,f,E,h,m,_){this[0]=n(e,0),this[1]=n(i,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(h,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(d,0),this[11]=n(m,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(_,0)}c.packedLength=16,c.pack=function(e,t,r){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]},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),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},c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[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]):void 0},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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new c);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,l=t.x*t.y,d=t.x*t.z,f=t.x*t.w,E=t.y*t.y,h=t.y*t.z,m=t.y*t.w,_=t.z*t.z,R=t.z*t.w,T=t.w*t.w,p=s-E-_+T,y=2*(l-R),S=2*(d+m),A=2*(l+R),N=-s+E-_+T,M=2*(h-f),I=2*(d-m),O=2*(h+f),v=-s-E+_+T;return a[0]=p*i,a[1]=A*i,a[2]=I*i,a[3]=0,a[4]=y*o,a[5]=N*o,a[6]=O*o,a[7]=0,a[8]=S*u,a[9]=M*u,a[10]=v*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.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 l=new e,d=new e,f=new e;c.fromCamera=function(t,n){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,d),d),e.normalize(e.cross(d,l,f),f);var u=d.x,s=d.y,E=d.z,h=l.x,m=l.y,_=l.z,R=f.x,T=f.y,p=f.z,y=a.x,S=a.y,A=a.z,N=u*-y+s*-S+E*-A,M=R*-y+T*-S+p*-A,I=h*y+m*S+_*A;return r(n)?(n[0]=u,n[1]=R,n[2]=-h,n[3]=0,n[4]=s,n[5]=T,n[6]=-m,n[7]=0,n[8]=E,n[9]=p,n[10]=-_,n[11]=0,n[12]=N,n[13]=M,n[14]=I,n[15]=1,n):new c(u,s,E,N,R,T,p,M,-h,-m,-_,I,0,0,0,1)},c.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},c.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,d=-(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]=d,o[14]=f,o[15]=1,o},c.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),d=-(i+a)/(i-a),f=-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]=d,o[11]=f,o[12]=0,o[13]=0,o[14]=E,o[15]=0,o},c.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,d=-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]=d,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},c.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,d=.5*(r-t),f=c,E=l,h=d,m=i+c,_=o+l,R=t+d,T=1;return a[0]=f,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]=h,a[11]=0,a[12]=m,a[13]=_,a[14]=R,a[15]=T,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,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},c.setColumn=function(e,t,n,r){r=c.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},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],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},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 E=new e;c.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 h=new e;c.getMaximumScale=function(t){return c.getScale(t,h),e.maximumComponent(h)},c.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],d=e[8],f=e[9],E=e[10],h=e[11],m=e[12],_=e[13],R=e[14],T=e[15],p=t[0],y=t[1],S=t[2],A=t[3],N=t[4],M=t[5],I=t[6],O=t[7],v=t[8],g=t[9],w=t[10],x=t[11],C=t[12],P=t[13],U=t[14],D=t[15],F=r*p+u*y+d*S+m*A,L=a*p+s*y+f*S+_*A,B=i*p+c*y+E*S+R*A,z=o*p+l*y+h*S+T*A,b=r*N+u*M+d*I+m*O,q=a*N+s*M+f*I+_*O,G=i*N+c*M+E*I+R*O,W=o*N+l*M+h*I+T*O,X=r*v+u*g+d*w+m*x,H=a*v+s*g+f*w+_*x,V=i*v+c*g+E*w+R*x,Y=o*v+l*g+h*w+T*x,Z=r*C+u*P+d*U+m*D,k=a*C+s*P+f*U+_*D,j=i*C+c*P+E*U+R*D,K=o*C+l*P+h*U+T*D;return n[0]=F,n[1]=L,n[2]=B,n[3]=z,n[4]=b,n[5]=q,n[6]=G,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},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],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],d=e[10],f=e[12],E=e[13],h=e[14],m=t[0],_=t[1],R=t[2],T=t[4],p=t[5],y=t[6],S=t[8],A=t[9],N=t[10],M=t[12],I=t[13],O=t[14],v=r*m+o*_+c*R,g=a*m+u*_+l*R,w=i*m+s*_+d*R,x=r*T+o*p+c*y,C=a*T+u*p+l*y,P=i*T+s*p+d*y,U=r*S+o*A+c*N,D=a*S+u*A+l*N,F=i*S+s*A+d*N,L=r*M+o*I+c*O+f,B=a*M+u*I+l*O+E,z=i*M+s*I+d*O+h;return n[0]=v,n[1]=g,n[2]=w,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=F,n[11]=0,n[12]=L,n[13]=B,n[14]=z,n[15]=1,n},c.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],d=e[10],f=t[0],E=t[1],h=t[2],m=t[3],_=t[4],R=t[5],T=t[6],p=t[7],y=t[8],S=r*f+o*E+c*h,A=a*f+u*E+l*h,N=i*f+s*E+d*h,M=r*m+o*_+c*R,I=a*m+u*_+l*R,O=i*m+s*_+d*R,v=r*T+o*p+c*y,g=a*T+u*p+l*y,w=i*T+s*p+d*y;return n[0]=S,n[1]=A,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]=w,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,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;c.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,c.multiplyByScale(e,m,n)},c.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?c.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)},c.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},c.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},c.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},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],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},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 _=new u,R=new u,T=new t,p=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,_),R,o.EPSILON7)&&t.equals(c.getRow(e,3,T),p))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],l=e[12],d=e[1],f=e[5],E=e[9],h=e[13],m=e[2],y=e[6],S=e[10],A=e[14],N=e[3],M=e[7],I=e[11],O=e[15],v=S*O,g=A*I,w=y*O,x=A*M,C=y*I,P=S*M,U=m*O,D=A*N,F=m*I,L=S*N,B=m*M,z=y*N,b=v*f+x*E+C*h-(g*f+w*E+P*h),q=g*d+U*E+L*h-(v*d+D*E+F*h),G=w*d+D*f+B*h-(x*d+U*f+z*h),W=P*d+F*f+z*E-(C*d+L*f+B*E),X=g*a+w*i+P*l-(v*a+x*i+C*l),H=v*r+D*i+F*l-(g*r+U*i+L*l),V=x*r+U*a+z*l-(w*r+D*a+B*l),Y=C*r+L*a+B*i-(P*r+F*a+z*i);v=i*h,g=l*E,w=a*h,x=l*f,C=a*E,P=i*f,U=r*h,D=l*d,F=r*E,L=i*d,B=r*f,z=a*d;var Z=v*M+x*I+C*O-(g*M+w*I+P*O),k=g*N+U*I+L*O-(v*N+D*I+F*O),j=w*N+D*M+B*O-(x*N+U*M+z*O),K=P*N+F*M+z*I-(C*N+L*M+B*I),J=w*S+P*A+g*y-(C*A+v*y+x*S),Q=F*A+v*m+D*S-(U*S+L*A+g*m),$=U*y+z*A+x*m-(B*A+w*m+D*y),ee=B*S+C*m+L*y-(F*y+z*S+P*m),te=r*b+a*q+i*G+l*W;if(Math.abs(te)<o.EPSILON20)throw new s("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]=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},c.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],d=e[12],f=e[13],E=e[14],h=-n*d-r*f-a*E,m=-i*d-o*f-u*E,_=-s*d-c*f-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]=h,t[13]=m,t[14]=_,t[15]=1,t},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,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/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/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){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},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 n>t&&(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,d=0,f=e.length;f>d;d++){var E=e[d];r=Math.min(r,E.longitude),a=Math.max(a,E.longitude),c=Math.min(c,E.latitude),l=Math.max(l,E.latitude);var h=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;i=Math.min(i,h),o=Math.max(o,h)}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.clone=function(e,t){return n(e)?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):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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;i>a&&(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;i>a&&o>0?a+=u.TWO_PI:c>o&&a>0&&(o+=u.TWO_PI),i>a&&0>c?c+=u.TWO_PI:c>o&&0>i&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),d=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&l>=d)){var f=Math.max(e.south,t.south),E=Math.min(e.north,t.north);if(!(f>=E))return n(r)?(r.west=l,r.south=f,r.east=d,r.north=E,r):new s(l,f,d,E)}},s.union=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.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,a=e.west,i=e.east;return a>i&&(i+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(i>n||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,d=e.north,f=e.south,E=e.east,h=e.west,m=c;m.height=a,m.longitude=h,m.latitude=d,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.latitude=f,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=r.cartographicToCartesian(m,o[l]),l++,0>d?m.latitude=d:f>0?m.latitude=f: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=h,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","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,d,f){"use strict";function E(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,m=new e,_=new e,R=new e,T=new e,p=new e,y=new e,S=new e,A=new e,N=new e,M=new e,I=new e;E.fromPoints=function(t,n){if(r(n)||(n=new E),!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],y),i=e.clone(a,h),o=e.clone(a,m),u=e.clone(a,_),s=e.clone(a,R),c=e.clone(a,T),l=e.clone(a,p),d=t.length,f=1;d>f;f++){e.clone(t[f],a);var O=a.x,v=a.y,g=a.z;O<i.x&&e.clone(a,i),O>s.x&&e.clone(a,s),v<o.y&&e.clone(a,o),v>c.y&&e.clone(a,c),g<u.z&&e.clone(a,u),g>l.z&&e.clone(a,l)}var w=e.magnitudeSquared(e.subtract(s,i,S)),x=e.magnitudeSquared(e.subtract(c,o,S)),C=e.magnitudeSquared(e.subtract(l,u,S)),P=i,U=s,D=w;x>D&&(D=x,P=o,U=c),C>D&&(D=C,P=u,U=l);var F=A;F.x=.5*(P.x+U.x),F.y=.5*(P.y+U.y),F.z=.5*(P.z+U.z);var L=e.magnitudeSquared(e.subtract(U,F,S)),B=Math.sqrt(L),z=N;z.x=i.x,z.y=o.y,z.z=u.z;var b=M;b.x=s.x,b.y=c.y,b.z=l.z;var q=e.multiplyByScalar(e.add(z,b,S),.5,I),G=0;for(f=0;d>f;f++){e.clone(t[f],a);var W=e.magnitude(e.subtract(a,q,S));W>G&&(G=W);var X=e.magnitudeSquared(e.subtract(a,F,S));if(X>L){var H=Math.sqrt(X);B=.5*(B+H),L=B*B;var V=H-B;F.x=(B*F.x+V*a.x)/H,F.y=(B*F.y+V*a.y)/H,F.z=(B*F.z+V*a.z)/H}}return G>B?(e.clone(F,n.center),n.radius=B):(e.clone(q,n.center),n.radius=G),n};var O=new o,v=new e,g=new e,w=new t,x=new t;E.fromRectangle2D=function(e,t,n){return E.fromRectangleWithHeights2D(e,t,0,0,n)},E.fromRectangleWithHeights2D=function(t,a,i,o,u){if(r(u)||(u=new E),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=n(a,O),f.southwest(t,w),w.height=i,f.northeast(t,x),x.height=o;var s=a.project(w,v),c=a.project(x,g),l=c.x-s.x,d=c.y-s.y,h=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+h*h);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*d,m.z=s.z+.5*h,u};var C=[];E.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,C)),E.fromPoints(u,o)},E.fromVertices=function(t,a,i,o){if(r(o)||(o=new E),!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=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,m),l=e.clone(u,_),d=e.clone(u,R),f=e.clone(u,T),O=e.clone(u,p),v=t.length,g=0;v>g;g+=i){var w=t[g]+a.x,x=t[g+1]+a.y,C=t[g+2]+a.z;u.x=w,u.y=x,u.z=C,w<s.x&&e.clone(u,s),w>d.x&&e.clone(u,d),x<c.y&&e.clone(u,c),x>f.y&&e.clone(u,f),C<l.z&&e.clone(u,l),C>O.z&&e.clone(u,O)}var P=e.magnitudeSquared(e.subtract(d,s,S)),U=e.magnitudeSquared(e.subtract(f,c,S)),D=e.magnitudeSquared(e.subtract(O,l,S)),F=s,L=d,B=P;U>B&&(B=U,F=c,L=f),D>B&&(B=D,F=l,L=O);var z=A;z.x=.5*(F.x+L.x),z.y=.5*(F.y+L.y),z.z=.5*(F.z+L.z);var b=e.magnitudeSquared(e.subtract(L,z,S)),q=Math.sqrt(b),G=N;G.x=s.x,G.y=c.y,G.z=l.z;var W=M;W.x=d.x,W.y=f.y,W.z=O.z;var X=e.multiplyByScalar(e.add(G,W,S),.5,I),H=0;for(g=0;v>g;g+=i){u.x=t[g]+a.x,u.y=t[g+1]+a.y,u.z=t[g+2]+a.z;var V=e.magnitude(e.subtract(u,X,S));V>H&&(H=V);var Y=e.magnitudeSquared(e.subtract(u,z,S));if(Y>b){var Z=Math.sqrt(Y);q=.5*(q+Z),b=q*q;var k=Z-q;z.x=(q*z.x+k*u.x)/Z,z.y=(q*z.y+k*u.y)/Z,z.z=(q*z.z+k*u.z)/Z}}return H>q?(e.clone(z,o.center),o.radius=q):(e.clone(X,o.center),o.radius=H),o},E.fromEncodedCartesianVertices=function(t,n,a){if(r(a)||(a=new E),!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=y;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,m),s=e.clone(i,_),c=e.clone(i,R),l=e.clone(i,T),d=e.clone(i,p),f=t.length,O=0;f>O;O+=3){var v=t[O]+n[O],g=t[O+1]+n[O+1],w=t[O+2]+n[O+2];i.x=v,i.y=g,i.z=w,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),w<s.z&&e.clone(i,s),w>d.z&&e.clone(i,d)}var x=e.magnitudeSquared(e.subtract(c,o,S)),C=e.magnitudeSquared(e.subtract(l,u,S)),P=e.magnitudeSquared(e.subtract(d,s,S)),U=o,D=c,F=x;C>F&&(F=C,U=u,D=l),P>F&&(F=P,U=s,D=d);var L=A;L.x=.5*(U.x+D.x),L.y=.5*(U.y+D.y),L.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,L,S)),z=Math.sqrt(B),b=N;b.x=o.x,b.y=u.y,b.z=s.z;var q=M;q.x=c.x,q.y=l.y,q.z=d.z;var G=e.multiplyByScalar(e.add(b,q,S),.5,I),W=0;for(O=0;f>O;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,S));X>W&&(W=X);var H=e.magnitudeSquared(e.subtract(i,L,S));if(H>B){var V=Math.sqrt(H);z=.5*(z+V),B=z*z;var Y=V-z;L.x=(z*L.x+Y*i.x)/V,L.y=(z*L.y+Y*i.y)/V,L.z=(z*L.z+Y*i.z)/V}}return W>z?(e.clone(L,a.center),a.radius=z):(e.clone(G,a.center),a.radius=W),a},E.fromCornerPoints=function(t,n,a){r(a)||(a=new E);var i=a.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,n),a},E.fromEllipsoid=function(t,n){return r(n)||(n=new E),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var P=new e;E.fromBoundingSpheres=function(t,n){if(r(n)||(n=new E),!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 E.clone(t[0],n);if(2===a)return E.union(t[0],t[1],n);for(var i=[],o=0;a>o;o++)i.push(t[o].center);n=E.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;a>o;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return n.radius=s,n};var U=new e,D=new e,F=new e;E.fromOrientedBoundingBox=function(t,n){r(n)||(n=new E);var a=t.halfAxes,i=c.getColumn(a,0,U),o=c.getColumn(a,1,D),u=c.getColumn(a,2,F),s=e.magnitude(i),l=e.magnitude(o),d=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,d),n},E.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new E(t.center,t.radius):void 0},E.packedLength=4,E.pack=function(e,t,r){r=n(r,0);var a=e.center;t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius},E.unpack=function(e,t,a){t=n(t,0),r(a)||(a=new E);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;E.union=function(t,n,a){r(a)||(a=new E);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 d=.5*(o+l+s),f=e.multiplyByScalar(c,(-o+d)/l,B);return e.add(f,i,f),e.clone(f,a.center),a.radius=d,a};var z=new e;E.expand=function(t,n,r){r=E.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,z));return a>r.radius&&(r.radius=a),r},E.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return-a>o?u.OUTSIDE:a>o?u.INTERSECTING:u.INSIDE},E.transform=function(e,t,n){return r(n)||(n=new E),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var b=new e;E.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,b);return e.magnitudeSquared(r)-t.radius*t.radius},E.transformWithoutScale=function(e,t,n){return r(n)||(n=new E),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var q=new e;E.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,q),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,W=new e,X=new e,H=new e,V=new e,Y=new t,Z=new Array(8),k=0;8>k;++k)Z[k]=new e;var j=new o;return E.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,W);e.normalize(c,c);var l=e.cross(s,c,X);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var d=e.negate(l,V),f=e.negate(c,H),h=Z,m=h[0];e.add(s,l,m),e.add(m,c,m),m=h[1],e.add(s,l,m),e.add(m,f,m),m=h[2],e.add(s,d,m),e.add(m,f,m),m=h[3],e.add(s,d,m),e.add(m,c,m),e.negate(s,s),m=h[4],e.add(s,l,m),e.add(m,c,m),m=h[5],e.add(s,l,m),e.add(m,f,m),m=h[6],e.add(s,d,m),e.add(m,f,m),m=h[7],e.add(s,d,m),e.add(m,c,m);for(var _=h.length,R=0;_>R;++R){var T=h[R];e.add(o,T,T);var p=i.cartesianToCartographic(T,Y);r.project(p,T)}a=E.fromPoints(h,a),o=a.center;var y=o.x,S=o.y,A=o.z;return o.x=A,o.y=y,o.z=S,a},E.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},E.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},E.prototype.intersectPlane=function(e){return E.intersectPlane(this,e)},E.prototype.distanceSquaredTo=function(e){return E.distanceSquaredTo(this,e)},E.prototype.computePlaneDistances=function(e,t,n){return E.computePlaneDistances(this,e,t,n)},E.prototype.isOccluded=function(e){return E.isOccluded(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.prototype.clone=function(e){return E.clone(this,e)},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){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},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.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.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,h),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,d=Math.sqrt(i-1)*l;return 1/(s*l-c*d)}function c(e,n,r){return 0>=n||n===1/0||n!==n?void 0:t.multiplyByScalar(e,n,r)}function l(e,n){return 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 d=new t;u.prototype.isPointVisible=function(e){var t=this._ellipsoid,n=t.transformPositionToScaledSpace(e,d);return this.isScaledSpacePointVisible(n)},u.prototype.isScaledSpacePointVisible=function(e){var n=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,a=t.subtract(e,n,d),i=-t.dot(a,n),o=0>r?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,d=0,f=n.length;f>d;++d){var E=n[d],h=s(i,E,o);u=Math.max(u,h)}return c(o,u,a)};var f=new t;u.prototype.computeHorizonCullingPointFromVertices=function(e,a,i,o,u){r(u)||(u=new t),o=n(o,t.ZERO);for(var d=this._ellipsoid,E=l(d,e),h=0,m=0,_=a.length;_>m;m+=i){f.x=a[m]+o.x,f.y=a[m+1]+o.y,f.z=a[m+2]+o.z;var R=s(d,f,E);h=Math.max(h,R)}return c(E,h,u)},u.prototype.computeHorizonCullingPointFromPoints=function(e,n,a){r(a)||(a=new t);for(var i=this._ellipsoid,o=l(i,e),u=0,d=0,f=n.length;f>d;++d){var E=s(i,n[d],o);u=Math.max(u,E)}return c(o,u,a)};var E=[];u.prototype.computeHorizonCullingPointFromRectangle=function(n,r,a){var i=o.subsample(n,r,0,E),u=e.fromPoints(i);return t.magnitude(u.center)<.1*r.minimumRadius?void 0:this.computeHorizonCullingPoint(u.center,i,a)};var h=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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[]; +if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,0>i?[i,0]:[0,i];var c=r*r,l=4*e*a,d=n(c,-l,t.EPSILON14);if(0>d)return[];var f=-.5*n(r,t.sign(r)*Math.sqrt(d),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,d=u*c,f=u*u,E=s*s,h=o*s-f,m=o*c-u*s,_=u*c-E,R=4*h*_-m*m;if(0>R){var T,p,y;f*d>=l*E?(T=o,p=h,y=-2*u*h+o*m):(T=c,p=_,y=-c*m+2*s*_);var S=0>y?-1:1,A=-S*Math.abs(T)*Math.sqrt(-R);i=-y+A;var N=i/2,M=0>N?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===A?-M:-p/M;return a=0>=p?M+I:-y/(M*M+I*I+p),f*d>=l*E?[(a-u)/o]:[-c/(a+s)]}var O=h,v=-2*u*h+o*m,g=_,w=-c*m+2*s*_,x=Math.sqrt(R),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-v)/3);a=2*Math.sqrt(-O);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),F=i+D>2*u?i-u:D-u,L=o,B=F/L;P=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-g),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var z=-c,b=2*s>i+D?i+s:D+s,q=z/b,G=L*b,W=-F*b-L*z,X=F*z,H=(s*W-u*X)/(-u*W+s*G);return H>=B?q>=B?q>=H?[B,H,q]:[B,q,H]:[q,B,H]:q>=B?[H,B,q]:q>=H?[H,q,B]:[q,H,B]}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=0>u?-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,0>u?[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,d=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(d.length>0){var f=-t/4,E=d[d.length-1];if(Math.abs(E)<n.EPSILON14){var h=r.computeRealRoots(1,s,l);if(2===h.length){var m,_=h[0],R=h[1];if(_>=0&&R>=0){var T=Math.sqrt(_),p=Math.sqrt(R);return[f-p,f-T,f+T,f+p]}if(_>=0&&0>R)return m=Math.sqrt(_),[f-m,f+m];if(0>_&&R>=0)return m=Math.sqrt(R),[f-m,f+m]}return[]}if(E>0){var y=Math.sqrt(E),S=(s+E-c/y)/2,A=(s+E+c/y)/2,N=r.computeRealRoots(1,y,S),M=r.computeRealRoots(1,-y,A);return 0!==N.length?(N[0]+=f,N[1]+=f,0!==M.length?(M[0]+=f,M[1]+=f,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]+=f,M[1]+=f,M):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,d=i*t+s-4*o,f=c*o-i*a*t+u,E=e.computeRealRoots(1,l,d,f);if(E.length>0){var h,m,_=E[0],R=a-_,T=R*R,p=t/2,y=R/2,S=T-4*o,A=T+4*Math.abs(o),N=c-4*_,M=c+4*Math.abs(_);if(0>_||N*A>S*M){var I=Math.sqrt(N);h=I/2,m=0===I?0:(t*y-i)/I}else{var O=Math.sqrt(S);h=0===O?0:(t*y-i)/O,m=O/2}var v,g;0===p&&0===h?(v=0,g=0):n.sign(p)===n.sign(h)?(v=p+h,g=_/v):(g=p-h,v=_/g);var w,x;0===y&&0===m?(w=0,x=0):n.sign(y)===n.sign(m)?(w=y+m,x=o/w):(x=y-m,w=o/x);var C=r.computeRealRoots(1,v,w),P=r.computeRealRoots(1,g,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,d=r*r,f=d*r,E=a*a,h=E*a,m=u*c*d-4*s*f-4*e*l*d+18*e*t*n*f-27*i*d*d+256*o*h+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*d+144*i*n*d)+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,d=u/t,f=s/t,E=0>c?1:0;switch(E+=0>l?E+1:E,E+=0>d?E+1:E,E+=0>f?E+1:E){case 0:return a(c,l,d,f);case 1:return i(c,l,d,f);case 2:return i(c,l,d,f);case 3:return a(c,l,d,f);case 4:return a(c,l,d,f);case 5:return i(c,l,d,f);case 6:return a(c,l,d,f);case 7:return a(c,l,d,f);case 8:return i(c,l,d,f);case 9:return a(c,l,d,f);case 10:return a(c,l,d,f);case 11:return i(c,l,d,f);case 12:return a(c,l,d,f);case 13:return a(c,l,d,f);case 14:return a(c,l,d,f);case 15:return a(c,l,d,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","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(t,r,a,o,u){u=n(u,!1);var s,c,l,d,f,E=t.origin,h=t.direction,m=e.subtract(a,r,_),S=e.subtract(o,r,R),A=e.cross(h,S,T),N=e.dot(m,A);if(u){if(N<i.EPSILON6)return;if(s=e.subtract(E,r,p),l=e.dot(s,A),0>l||l>N)return;if(c=e.cross(s,m,y),d=e.dot(h,c),0>d||l+d>N)return;f=e.dot(S,c)/N}else{if(Math.abs(N)<i.EPSILON6)return;var M=1/N;if(s=e.subtract(E,r,p),l=e.dot(s,A)*M,0>l||l>1)return;if(c=e.cross(s,m,y),d=e.dot(h,c)*M,0>d||l+d>1)return;f=e.dot(S,c)*M}return f}function d(e,t,n,r){var a=t*t-4*e*n;if(!(0>a)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(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,T),l=e.dot(o,o),f=2*e.dot(o,c),E=e.magnitudeSquared(c)-s,h=d(l,f,E,A);return r(h)?(a.start=h.root0,a.stop=h.root1,a):void 0}function E(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,d=a*a,f=c*c,h=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*f,m=c*(a*E(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),_=t[o.COLUMN0ROW0]*d+t[o.COLUMN2ROW2]*f+a*n.x+r,R=f*E(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),T=c*(a*E(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),p=[];if(0===T&&0===R){if(l=u.computeRealRoots(h,m,_),0===l.length)return p;var y=l[0],S=Math.sqrt(Math.max(1-y*y,0));if(p.push(new e(a,c*y,c*-S)),p.push(new e(a,c*y,c*S)),2===l.length){var A=l[1],N=Math.sqrt(Math.max(1-A*A,0));p.push(new e(a,c*A,c*-N)),p.push(new e(a,c*A,c*N))}return p}var M=T*T,I=R*R,O=h*h,v=T*R,g=O+I,w=2*(m*h+v),x=2*_*h+m*m-I+M,C=2*(_*m-v),P=_*_-M;if(0===g&&0===w&&0===x&&0===C)return p;l=s.computeRealRoots(g,w,x,C,P);var U=l.length;if(0===U)return p;for(var D=0;U>D;++D){var F,L=l[D],B=L*L,z=Math.max(1-B,0),b=Math.sqrt(z);F=i.sign(h)===i.sign(_)?E(h*B+_,m*L,i.EPSILON12):i.sign(_)===i.sign(m*L)?E(h*B,m*L+_,i.EPSILON12):E(h*B+m*L,_,i.EPSILON12);var q=E(R*L,T,i.EPSILON15),G=F*q;0>G?p.push(new e(a,c*L,c*b)):G>0?p.push(new e(a,c*L,c*-b)):0!==b?(p.push(new e(a,c*L,c*-b)),p.push(new e(a,c*L,c*b)),++D):p.push(new e(a,c*L,c*b))}return p}var m={};m.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(!(0>l))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var _=new e,R=new e,T=new e,p=new e,y=new e;m.rayTriangle=function(t,n,a,i,o,u){var s=l(t,n,a,i,o);if(r(s)&&!(0>s))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var S=new c;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=S;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var d=l(c,a,i,o,u);return!r(d)||0>d||d>e.distance(t,n)?void 0:(r(s)||(s=new e),e.multiplyByScalar(c.direction,d,s),e.add(c.origin,s,s))};var A={root0:0,root1:0};m.raySphere=function(e,t,n){return n=f(e,t,n),!r(n)||n.stop<0?void 0:(n.start=Math.max(n.start,0),n)};var N=new c;m.lineSegmentSphere=function(t,n,a,i){var o=N,u=e.subtract(n,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=f(o,a,i),!r(i)||i.stop<0||i.start>s?void 0:(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,i,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,M),l=e.multiplyComponents(s,t.direction,I),d=e.magnitudeSquared(c),f=e.dot(c,l);if(d>1){if(f>=0)return;var E=f*f;if(r=d-1,a=e.magnitudeSquared(l),i=a*r,i>E)return;if(E>i){o=f*f-i,u=-f+Math.sqrt(o);var h=u/a,m=r/u;return m>h?{start:h,stop:m}:{start:m,stop:h}}var _=Math.sqrt(r/a);return{start:_,stop:_}}return 1>d?(r=d-1,a=e.magnitudeSquared(l),i=a*r,o=f*f-i,u=-f+Math.sqrt(o),{start:0,stop:u/a}):0>f?(a=e.magnitudeSquared(l),{start:0,stop:-f/a}):void 0};var O=new e,v=new e,g=new e,w=new e,x=new e,C=new o,P=new o,U=new o,D=new o,F=new o,L=new o,B=new o,z=new e,b=new e,q=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction,s=n.geodeticSurfaceNormal(a,O);if(e.dot(u,s)>=0)return a;var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u,O),d=e.normalize(l,l),f=e.mostOrthogonalAxis(l,w),E=e.normalize(e.cross(f,d,v),v),m=e.normalize(e.cross(d,E,g),g),_=C;_[0]=d.x,_[1]=d.y,_[2]=d.z,_[3]=E.x,_[4]=E.y,_[5]=E.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var R=o.transpose(_,P),T=o.fromScale(n.radii,U),p=o.fromScale(n.oneOverRadii,D),y=F;y[0]=0,y[1]=-u.z,y[2]=u.y,y[3]=u.z,y[4]=0,y[5]=-u.x,y[6]=-u.y,y[7]=u.x,y[8]=0;var S,A,N=o.multiply(o.multiply(R,p,L),y,L),M=o.multiply(o.multiply(N,T,B),_,B),I=o.multiplyByVector(N,a,x),G=h(M,e.negate(I,O),0,0,1),W=G.length;if(W>0){for(var X=e.clone(e.ZERO,b),H=Number.NEGATIVE_INFINITY,V=0;W>V;++V){S=o.multiplyByVector(T,o.multiplyByVector(_,G[V],z),z);var Y=e.normalize(e.subtract(S,a,w),w),Z=e.dot(Y,u);Z>H&&(H=Z,X=e.clone(S,X))}var k=n.cartesianToCartographic(X,q);return H=i.clamp(H,0,1),A=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-H*H),A=c?-A:A,k.height=A,n.cartographicToCartesian(k,new e)}};var G=new e;return m.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),d=-(a.distance+l)/c;if(!(0>d||d>1))return e.multiplyByScalar(u,d,o),e.add(t,o,o),o}},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 d,f;if((1===l||2===l)&&(d=new e,f=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,d),m.lineSegmentPlane(t,r,a,f),{positions:[t,n,r,d,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,d),m.lineSegmentPlane(n,t,a,f),{positions:[t,n,r,d,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,d),m.lineSegmentPlane(r,n,a,f),{positions:[t,n,r,d,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,d),m.lineSegmentPlane(r,t,a,f),{positions:[t,n,r,d,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,d),m.lineSegmentPlane(t,n,a,f),{positions:[t,n,r,d,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,d),m.lineSegmentPlane(n,r,a,f),{positions:[t,n,r,d,f],indices:[0,1,4,0,4,3,2,3,4]}}},m}),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(r){return i(r)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(a){return i(a)}});return n}function o(){function e(e,t,n){return f(e,t,n)}function n(e){return h(e)}function a(e){return h(i(e))}function u(e){return E(e)}var s,c,l,d,f,E,h;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],d=[],f=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(t){r.progress(t)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),d.push(a),r.promise},E=function(e){return m(d,e),e},h=function(e){return e=t(e),f=e.then,h=t,E=R,m(l,e),d=l=S,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){h(e)}var c,l,d,f,E,h,m,_,T,p;if(T=t.length>>>0,c=Math.max(0,Math.min(n,T)),d=[],l=T-c+1,f=[],E=o(),c)for(_=E.progress,m=function(e){f.push(e),--l||(h=m=R,E.reject(f))},h=function(e){d.push(e),--c||(h=m=R,E.resolve(d))},p=0;T>p;++p)p in t&&e(t[p],s,u,_);else E.resolve(d);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),f(e,T).then(t,n,r)}function d(){return f(arguments,T)}function f(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;a>s;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function E(t,n){var r=y.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)})})},p.apply(t,r)})}function h(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 R(){}function T(e){return e}var p,y,S;return e.defer=o,e.resolve=t,e.reject=n,e.join=d,e.all=l,e.map=f,e.reduce=E,e.any=c,e.some=s,e.chain=h,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(S,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(S,t)})})}},y=[].slice,p=[].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(;a>i;++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;o>=i;)if(r=~~((i+o)/2),a=n(e[r],t),0>a)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,d,f){var E,h,m,_,R;if("%%"==e)return"%";for(var T=!1,p="",y=!1,S=!1,A=" ",N=s.length,M=0;s&&N>M;M++)switch(s.charAt(M)){case" ":p=" ";break;case"+":p="+";break;case"-":T=!0;break;case"'":A=s.charAt(M+1);break;case"0":y=!0;break;case"#":S=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(c=-c,T=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(d=d?"*"==d?+t[n++]:"*"==d.charAt(0)?+t[d.slice(1,-1)]:+d:"fFeE".indexOf(f)>-1?6:"d"==f?0:void 0,R=r?t[r.slice(0,-1)]:t[n++],f){case"s":return u(String(R),T,c,d,y,A);case"c":return u(String.fromCharCode(+R),T,c,d,y);case"b":return o(R,2,S,T,c,d,y);case"o":return o(R,8,S,T,c,d,y);case"x":return o(R,16,S,T,c,d,y);case"X":return o(R,16,S,T,c,d,y).toUpperCase();case"u":return o(R,10,S,T,c,d,y);case"i":case"d":return E=+R||0,E=Math.round(E-E%1),h=0>E?"-":p,R=h+a(String(Math.abs(E)),d,"0",!1),i(R,h,T,c,y);case"e":case"E":case"f":case"F":case"g":case"G":return E=+R,h=0>E?"-":p,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(f.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(f)%2],R=h+Math.abs(E)[m](d),i(R,h,T,c,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 m.compare(e.julianDate,t.julianDate)}function d(e){p.julianDate=e;var n=m.leapSeconds,r=t(n,p,l);0>r&&(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 f(e,n){p.julianDate=e;var r=m.leapSeconds,a=t(r,p,l);if(0>a&&(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):1>=i?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,0>t&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function h(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,0>r&&(r+=24);var d=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return d>=43200&&(l-=1),[l,d]}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&&d(this)}var _=new i,R=[31,28,31,30,31,30,31,31,30,31,30,31],T=29,p=new u,y=/^(\d{4})$/,S=/^(\d{4})-(\d{2})$/,A=/^(\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,w="Invalid ISO 8601 date.";m.fromDate=function(e,t){var n=h(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(E(n[0],n[1],t),d(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,i,u,s=e.split("T"),l=1,f=1,_=0,p=0,I=0,x=0,C=s[0],P=s[1];if(!r(C))throw new a(w);var U;if(s=C.match(M),null!==s){if(U=C.split("-").length-1,U>0&&2!==U)throw new a(w);n=+s[1],l=+s[2],f=+s[3]}else if(s=C.match(S),null!==s)n=+s[1],l=+s[2];else if(s=C.match(y),null!==s)n=+s[1];else{var D;if(s=C.match(A),null!==s){if(n=+s[1],D=+s[2],u=o(n),1>D||u&&D>366||!u&&D>365)throw new a(w)}else{if(s=C.match(N),null===s)throw new a(w);n=+s[1];var F=+s[2],L=+s[3]||0;if(U=C.split("-").length-1,U>0&&(!r(s[3])&&1!==U||r(s[3])&&2!==U))throw new a(w);var B=new Date(Date.UTC(n,0,4));D=7*F+L-B.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(D),l=i.getUTCMonth()+1,f=i.getUTCDate()}if(u=o(n),1>l||l>12||1>f||(2!==l||!u)&&f>R[l-1]||u&&2===l&&f>T)throw new a(w);var z;if(r(P)){if(s=P.match(g),null!==s){if(U=P.split(":").length-1,U>0&&2!==U&&3!==U)throw new a(w);_=+s[1],p=+s[2],I=+s[3],x=1e3*+(s[4]||0),z=5}else if(s=P.match(v),null!==s){if(U=P.split(":").length-1,U>2)throw new a(w);_=+s[1],p=+s[2],I=60*+(s[3]||0),z=4}else{if(s=P.match(O),null===s)throw new a(w);_=+s[1],p=60*+(s[2]||0),z=3}if(p>=60||I>=61||_>24||24===_&&(p>0||I>0||x>0))throw new a(w);var b=s[z],q=+s[z+1],G=+(s[z+2]||0);switch(b){case"+":_-=q,p-=G;break;case"-":_+=q,p+=G;break;case"Z":break;default:p+=new Date(Date.UTC(n,l-1,f,_,p)).getTimezoneOffset()}}else p+=new Date(n,l-1,f).getTimezoneOffset();var W=60===I;for(W&&I--;p>=60;)p-=60,_++;for(;_>=24;)_-=24,f++;for(i=u&&2===l?T:R[l-1];f>i;)f-=i,l++,l>12&&(l-=12,n++),i=u&&2===l?T:R[l-1];for(;0>p;)p+=60,_--;for(;0>_;)_+=24,f--;for(;1>f;)l--,1>l&&(l+=12,n--),i=u&&2===l?T:R[l-1],f+=i;var X=h(n,l,f,_,p,I,x);return r(t)?(E(X[0],X[1],t),d(t)):t=new m(X[0],X[1],c.UTC),W&&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=f(e,x);r(a)||(m.addSeconds(e,-1,x),a=f(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 d=4e3*(c+1)/1461001|0;c=c-(1461*d/4|0)+31|0;var E=80*c/2447|0,h=c-(2447*E/80|0)|0;c=E/11|0;var _=E+2-12*c|0,R=100*(l-49)+d+c|0,T=u/s.SECONDS_PER_HOUR|0,p=u-T*s.SECONDS_PER_HOUR,y=p/s.SECONDS_PER_MINUTE|0;p-=y*s.SECONDS_PER_MINUTE;var S=0|p,A=(p-S)/s.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(S+=1),r(t)?(t.year=R,t.month=_,t.day=h,t.hour=T,t.minute=y,t.second=S,t.millisecond=A,t.isLeapSecond=n,t):new i(R,_,h,T,y,S,A,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){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI):void 0},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){p.julianDate=e;var n=m.leapSeconds,r=t(n,p,l);return 0>r&&(r=~r,--r,0>r&&(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)],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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,n,r,a,i){"use strict";function o(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,u=n.headers,s=n.overrideMimeType,c=n.withCredentials;return e(n.url,function(t){var n=e.defer();return o.load(t,r,a,i,u,n,s,c),n.promise})}function u(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function s(e,t){for(var n=u(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 c(e,n){n=t(n,"");var a=e[1],i=!!e[2],o=e[3];switch(n){case"":case"text":return u(i,o);case"arraybuffer":return s(i,o);case"blob":var c=s(i,o);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(u(i,o),a);case"json":return JSON.parse(u(i,o));default:throw new r("Unhandled responseType: "+n)}}var l=/^data:(.*?)(;base64)?,(.*)$/;return o.load=function(e,t,r,o,u,s,d,f){var E=l.exec(e);if(null!==E)return void s.resolve(c(E,t));var h=new XMLHttpRequest;if(n(d)&&n(h.overrideMimeType)&&h.overrideMimeType(d),h.open(r,e,!0),n(u))for(var m in u)u.hasOwnProperty(m)&&h.setRequestHeader(m,u[m]);n(t)&&(h.responseType=t),n(f)&&(h.withCredentials=f),h.onload=function(){h.status>=200&&h.status<300?n(h.response)?s.resolve(h.response):n(h.responseXML)&&h.responseXML.hasChildNodes()?s.resolve(h.responseXML):n(h.responseText)?s.resolve(h.responseText):s.reject(new i("unknown XMLHttpRequest response type.")):s.reject(new a(h.status,h.response,h.getAllResponseHeaders()))},h.onerror=function(e){s.reject(new a)},h.send(o)},o.defaultLoad=o.load,o}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";function n(n,r){return e({url:n,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return n}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)||(a={}),t(a.headers)?t(a.headers.Accept)||(a.headers=e(a.headers),a.headers.Accept=i.Accept):a.headers=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,d){"use strict";function f(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))h(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){h(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else h(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function E(e,t){return o.compare(e.julianDate,t)}function h(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"),f=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),h=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(0>a||0>i||0>s||0>c||0>f||0>h||0>m)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,R=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=f,e._yCelestialPoleOffsetRadiansColumn=h,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var T,p=e._addNewLeapSeconds,y=0,S=_.length;S>y;y+=e._columnCount){var A=_[y+a],N=_[y+m],M=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(M,N,d.TAI);if(R.push(I),p){if(N!==T&&r(T)){var O=o.leapSeconds,v=t(O,I,E);if(0>v){var g=new u(I,N);O.splice(~v,0,g)}}T=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 R(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 d=o.secondsDifference(r,c)/o.secondsDifference(l,c),f=a*s,E=i*s,h=n[f+e._ut1MinusUtcSecondsColumn],R=n[E+e._ut1MinusUtcSecondsColumn],T=R-h;if(T>.5||-.5>T){var p=n[f+e._taiMinusUtcSecondsColumn],y=n[E+e._taiMinusUtcSecondsColumn];p!==y&&(l.equals(r)?h=R:R-=y-p)}return u.xPoleWander=_(d,n[f+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(d,n[f+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(d,n[f+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(d,n[f+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(d,h,R),u}return f.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}}),f.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},f.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 d=i[u],f=i[u+1],E=o.lessThanOrEquals(d,e),h=!r(f),m=h||o.greaterThanOrEquals(f,e);if(E&&m)return s=u,!h&&f.equals(e)&&++s,l=s+1,R(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,0>s&&(s=0)),this._lastIndex=s,R(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},f}),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/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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","require"],function(e,t,n,r,a){"use strict";function i(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function o(){if(t(l))return l;var a;if(a="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:i(),!t(a))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new e(r(a))}function u(e){return a.toUrl("../"+e)}function s(t){return new e(t).resolve(o()).toString()}function c(e){t(d)||(d=t(a.toUrl)?u:s),t(f)||(f=document.createElement("a"));var n=d(e);return f.href=n,f.href=f.href,f.href}var l,d,f,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=E,c.setBaseUrl=function(t){l=new e(t).resolve(new e(document.location.href))},c}),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;t>=s;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;t>=c;++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=d;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;s>u;++u)t[o+u]=r[u];i.resolve()}),i.promise}var d=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;0>u&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var d=u/this._samplesPerXysFile|0,f=s/this._samplesPerXysFile|0,E=[],h=d;f>=h;++h)E.push(l(this,h));return e.all(E)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(0>i)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);0>s&&(s=0);var d=s+u;d>=this._totalSamples&&(d=this._totalSamples-1,s=d-u,0>s&&(s=0));var f=!1,E=this._samples;if(r(E[3*s])||(l(this,s/this._samplesPerXysFile|0),f=!0),r(E[3*d])||(l(this,d/this._samplesPerXysFile|0),f=!0),!f){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var h,m,_=i-s*this._stepSizeDays,R=this._work,T=this._denominators,p=this._coef,y=this._xTable;for(h=0;u>=h;++h)R[h]=_-y[h];for(h=0;u>=h;++h){for(p[h]=1,m=0;u>=m;++m)m!==h&&(p[h]*=R[m]);p[h]*=T[h];var S=3*(s+h);n.x+=p[h]*E[S++],n.y+=p[h]*E[S++],n.s+=p[h]*E[S]}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(){return a.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?r.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(r.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",e(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;r>n;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(p)){p=!1;var e=/ Chrome\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(p=!0,y=r(e[1]))}return p}function i(){return a()&&y}function o(){if(!t(S)&&(S=!1,!a()&&/ Safari\/[\.0-9]+/.test(T.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(S=!0,A=r(e[1]))}return S}function u(){return o()&&A}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(T.userAgent);null!==e&&(N=!0,M=r(e[1]),M.isNightly=!!e[2])}return N}function c(){return s()&&M}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 d(){return l()&&O}function f(){if(!t(v)){v=!1;var e=/Firefox\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(v=!0,g=r(e[1]))}return v}function E(){return t(w)||(w=/Windows/i.test(T.appVersion)),w}function h(){return f()&&g}function m(){return t(x)||(x="undefined"!=typeof PointerEvent&&(!t(T.pointerEnabled)||T.pointerEnabled)),x}function _(){if(!t(P)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;P=t(n)&&""!==n,P&&(C=n)}return P}function R(){return _()?C:void 0}var T;T="undefined"!=typeof navigator?navigator:{};var p,y,S,A,N,M,I,O,v,g,w,x,C,P,U={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:d,isFirefox:f,firefoxVersion:h,isWindows:E,hardwareConcurrency:e(T.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:_,imageRenderingValue:R};return U.supportsFullscreen=function(){return n.supportsFullscreen()},U.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},U.supportsWebWorkers=function(){return"undefined"!=typeof Worker},U}),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,d=c.z*o,f=Math.cos(i);return n(a)?(a.x=u,a.y=l,a.z=d,a.w=f,a):new s(u,l,d,f)};var l=[1,2,0],d=new Array(3);s.fromRotationMatrix=function(e,t){var r,a,i,o,c,f=e[u.COLUMN0ROW0],E=e[u.COLUMN1ROW1],h=e[u.COLUMN2ROW2],m=f+E+h;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,R=0;E>f&&(R=1),h>f&&h>E&&(R=2);var T=_[R],p=_[T];r=Math.sqrt(e[u.getElementIndex(R,R)]-e[u.getElementIndex(T,T)]-e[u.getElementIndex(p,p)]+1);var y=d;y[R]=.5*r,r=.5/r,c=(e[u.getElementIndex(p,T)]-e[u.getElementIndex(T,p)])*r,y[T]=(e[u.getElementIndex(T,R)]+e[u.getElementIndex(R,T)])*r,y[p]=(e[u.getElementIndex(p,R)]+e[u.getElementIndex(R,p)])*r,a=-y[0],i=-y[1],o=-y[2]}return n(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,n,r,a){var i=s.fromAxisAngle(e.UNIT_X,r,f),o=s.fromAxisAngle(e.UNIT_Y,-n,a);a=s.multiply(o,i,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,f);return s.multiply(u,a,a)};var E=new e,h=new e,m=new s,_=new s,R=new s;s.packedLength=4,s.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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,R),s.conjugate(R,R);for(var a=0,i=n-t+1;i>a;a++){var o=3*a;s.unpack(e,4*(t+a),m),s.multiply(m,R,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,a,i,o){n(o)||(o=new s),e.fromArray(t,0,h);var u=e.magnitude(h);return s.unpack(r,4*i,_),0===u?s.clone(s.IDENTITY,m):s.fromAxisAngle(h,u,m),s.multiply(m,_,o)},s.clone=function(e,t){return n(e)?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):void 0},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,d=o*u+r*l+a*c-i*s,f=o*s-r*c+a*l+i*u,E=o*c+r*s-a*u+i*l,h=o*l-r*u-a*s-i*c;return n.x=d,n.y=f,n.z=E,n.w=h,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 T=new s;s.lerp=function(e,t,n,r){return T=s.multiplyByScalar(t,n,T),r=s.multiplyByScalar(e,1-n,r),s.add(T,r,r)};var p=new s,y=new s,S=new s;s.slerp=function(e,t,n,r){var a=s.dot(e,t),i=t;if(0>a&&(a=-a,i=p=s.negate(t,p)),1-a<o.EPSILON6)return s.lerp(e,i,n,r);var u=Math.acos(a);return y=s.multiplyByScalar(e,Math.sin((1-n)*u),y),S=s.multiplyByScalar(i,Math.sin(n*u),S),r=s.add(y,S,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,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,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,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 O=new s,v=1.9011074535173003,g=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;7>P;++P){var U=P+1,D=2*U+1;g[P]=1/(U*D),w[P]=U/D}return g[7]=v/136,w[7]=8*v/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,d=7;d>=0;--d)x[d]=(g[d]*c-w[d])*o,C[d]=(g[d]*l-w[d])*o;var f=a*n*(1+x[0]*(1+x[1]*(1+x[2]*(1+x[3]*(1+x[4]*(1+x[5]*(1+x[6]*(1+x[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])))))))),h=s.multiplyByScalar(e,E,O);return s.multiplyByScalar(t,f,r),s.add(h,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","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,E,h,m,_,R){"use strict";var T={},p=new n,y=new n,S=new n;T.eastNorthUpToFixedFrame=function(e,t,r){if(E.equalsEpsilon(e.x,0,E.EPSILON14)&&E.equalsEpsilon(e.y,0,E.EPSILON14)){var o=E.sign(e.z);return i(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=p,s=y,l=S;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.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 m(s.x,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var A=new n,N=new n,M=new n;T.northEastDownToFixedFrame=function(e,t,r){if(E.equalsEpsilon(e.x,0,E.EPSILON14)&&E.equalsEpsilon(e.y,0,E.EPSILON14)){var o=E.sign(e.z);return i(r)?(r[0]=-o,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]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=A,s=N,l=M;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.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 m(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},T.northUpEastToFixedFrame=function(e,t,r){if(E.equalsEpsilon(e.x,0,E.EPSILON14)&&E.equalsEpsilon(e.y,0,E.EPSILON14)){var o=E.sign(e.z);return i(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=o,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(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=p,s=y,l=S;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(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 m(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 I=new _,O=new n(1,1,1),v=new m;T.headingPitchRollToFixedFrame=function(e,t,r,a,i,o){var u=_.fromHeadingPitchRoll(t,r,a,I),s=m.fromTranslationQuaternionRotationScale(n.ZERO,u,O,v);return o=T.eastNorthUpToFixedFrame(e,i,o),m.multiply(o,s,o)};var g=new m,w=new h;T.headingPitchRollQuaternion=function(e,t,n,r,a,i){var o=T.headingPitchRollToFixedFrame(e,t,n,r,a,g),u=m.getRotation(o,w);return _.fromRotationMatrix(u,i)};var x=24110.54841,C=8640184.812866,P=.093104,U=-62e-7,D=1.1772758384668e-19,F=72921158553e-15,L=E.TWO_PI/86400,B=new f;T.computeTemeToPseudoFixedMatrix=function(e,t){B=f.addSeconds(e,-f.computeTaiMinusUtc(e),B);var n,r=B.dayNumber,a=B.secondsOfDay,o=r-2451545;n=a>=43200?(o+.5)/R.DAYS_PER_JULIAN_CENTURY:(o-.5)/R.DAYS_PER_JULIAN_CENTURY;var u=x+n*(C+n*(P+n*U)),s=u*L%E.TWO_PI,c=F+D*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,d=s+c*l,m=Math.cos(d),_=Math.sin(d);return i(t)?(t[0]=m,t[1]=-_,t[2]=0,t[3]=_,t[4]=m,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new h(m,_,0,-_,m,0,0,0,1)},T.iau2006XysData=new l,T.earthOrientationParameters=u.NONE;var z=32.184,b=2451545;T.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+z,a=t.stop.dayNumber,i=t.stop.secondsOfDay+z,o=T.iau2006XysData.preload(n,r,a,i),u=T.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},T.computeIcrfToFixedMatrix=function(e,t){i(t)||(t=new h);var n=T.computeFixedToIcrfMatrix(e,t);if(i(n))return h.transpose(n,t)};var q=new d(0,0,0),G=new s(0,0,0,0,0,0),W=new h,X=new h;T.computeFixedToIcrfMatrix=function(e,t){i(t)||(t=new h);var n=T.earthOrientationParameters.compute(e,G);if(i(n)){var r=e.dayNumber,a=e.secondsOfDay+z,o=T.iau2006XysData.computeXysRadians(r,a,q);if(i(o)){var u=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=W;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 d=h.fromRotationZ(-o.s,X),m=h.multiply(l,d,W),_=e.dayNumber,p=e.secondsOfDay-f.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=_-2451545,S=p/R.SECONDS_PER_DAY,A=.779057273264+S+.00273781191135448*(y+S);A=A%1*E.TWO_PI;var N=h.fromRotationZ(A,X),M=h.multiply(m,N,W),I=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),g=Math.sin(n.yPoleWander),w=r-b+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*E.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),U=X;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,h.multiply(M,U,t)}}};var H=new r;T.pointToWindowCoordinates=function(e,t,n,r){return r=T.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},T.pointToGLWindowCoordinates=function(e,n,a,o){i(o)||(o=new t);var u=H;return m.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,u),u),r.multiplyByScalar(u,1/u.w,u),m.multiplyByVector(n,u,u),t.fromCartesian4(u,o)};var V=new n,Y=new n,Z=new n;return T.rotationMatrixFromPositionVelocity=function(e,t,r,o){var u=a(r,c.WGS84).geodeticSurfaceNormal(e,V),s=n.cross(t,u,Y);n.equalsEpsilon(s,n.ZERO,E.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var l=n.cross(s,t,Z);return n.cross(t,l,s),n.negate(s,s),i(o)||(o=new h),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=s.x,o[4]=s.y,o[5]=s.z,o[6]=l.x,o[7]=l.y,o[8]=l.z,o},T}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix3","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,E,h){"use strict";function m(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(d.getColumn(r,0,_)),this._yAxis=n.fromCartesian4(d.getColumn(r,1,_));var i=n.fromCartesian4(d.getColumn(r,2,_));this._plane=f.fromPointNormal(e,i)}var _=new r;o(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 R=new e;m.fromPoints=function(t,n){var r=e.fromPoints(t,R);return new m(r.center,n)};var T=new E,p=new n;m.prototype.projectPointOntoPlane=function(e,r){var a=T;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)}},m.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;r>a;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},m.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=T;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},m.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;n>r;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var y=new n;return m.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=y,l=0;r>l;++l){var d=e[l];n.multiplyByScalar(u,d.x,c),i(t[l])||(t[l]=new n);var f=n.add(o,c,t[l]);n.multiplyByScalar(s,d.y,c),n.add(f,c,f),a.scaleToGeocentricSurface(f,f)}return t},m}),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,d,f,E,h){"use strict";function m(e,t){this.center=n.clone(a(e,n.ZERO)),this.halfAxes=f.clone(a(t,f.ZERO))}function _(e,t,r,a,o,u,s,c){i(c)||(c=new m);var l=c.halfAxes;f.setColumn(l,0,e.xAxis,l),f.setColumn(l,1,e.yAxis,l),f.setColumn(l,2,e.zAxis,l);var d=M;d.x=(t+r)/2,d.y=(a+o)/2,d.z=(u+s)/2;var E=I;E.x=(r-t)/2,E.y=(o-a)/2,E.z=(s-u)/2;var h=c.center;return d=f.multiplyByVector(l,d,d),n.add(e.origin,d,h),f.multiplyByScale(l,E,l),c}var R=new n,T=new n,p=new n,y=new n,S=new n,A=new f,N={unitary:new f,diagonal:new f};m.fromPoints=function(e,t){if(i(t)||(t=new m),!i(e)||0===e.length)return t.halfAxes=f.ZERO,t.center=n.ZERO,t;var r,a=e.length,o=n.clone(e[0],R);for(r=1;a>r;r++)n.add(o,e[r],o);var u=1/a;n.multiplyByScalar(o,u,o);var s,c=0,l=0,d=0,E=0,h=0,_=0;for(r=0;a>r;r++)s=n.subtract(e[r],o,T),c+=s.x*s.x,l+=s.x*s.y,d+=s.x*s.z,E+=s.y*s.y,h+=s.y*s.z,_+=s.z*s.z;c*=u,l*=u,d*=u,E*=u,h*=u,_*=u;var M=A;M[0]=c,M[1]=l,M[2]=d,M[3]=l,M[4]=E,M[5]=h,M[6]=d,M[7]=h,M[8]=_;var I=f.computeEigenDecomposition(M,N),O=f.transpose(I.unitary,t.halfAxes);s=n.subtract(e[0],o,T);var v=f.multiplyByVector(O,s,p),g=n.clone(v,y),w=n.clone(v,S);for(r=1;a>r;r++)s=n.subtract(e[r],o,s),f.multiplyByVector(O,s,v),n.minimumByComponent(w,v,w),n.maximumByComponent(g,v,g);var x=n.add(w,g,p);n.multiplyByScalar(x,.5,x),f.multiplyByVector(O,x,x),n.add(o,x,t.center);var C=n.subtract(g,w,p);return n.multiplyByScalar(C,.5,C),f.multiplyByScale(t.halfAxes,C,t.halfAxes),t};var M=new n,I=new n,O=new r,v=new n,g=[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],x=[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=h.center(e,O),c=r.cartographicToCartesian(o,v),l=new s(c,r),d=l.plane,f=g[0],m=g[1],R=g[2],T=g[3],p=g[4],y=g[5],S=g[6],A=g[7],N=o.longitude,M=e.south<0&&e.north>0?0:o.latitude;S.latitude=y.latitude=p.latitude=e.south,A.latitude=T.latitude=M,f.latitude=m.latitude=R.latitude=e.north,S.longitude=A.longitude=f.longitude=e.west,y.longitude=m.longitude=N,p.longitude=T.longitude=R.longitude=e.east,R.height=m.height=f.height=A.height=S.height=y.height=p.height=T.height=n,r.cartographicArrayToCartesianArray(g,w),l.projectPointsToNearestOnPlane(w,x);var I=Math.min(x[6].x,x[7].x,x[0].x),C=Math.max(x[2].x,x[3].x,x[4].x),P=Math.min(x[4].y,x[5].y,x[6].y),U=Math.max(x[0].y,x[1].y,x[2].y);R.height=f.height=p.height=S.height=t,r.cartographicArrayToCartesianArray(g,w);var D=Math.min(E.getPointDistance(d,w[0]),E.getPointDistance(d,w[2]),E.getPointDistance(d,w[4]),E.getPointDistance(d,w[6])),F=n;return _(l,I,C,P,U,D,F,i)},m.clone=function(e,t){return i(e)?i(t)?(n.clone(e.center,t.center),f.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes):void 0},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[f.COLUMN0ROW0]+u*i[f.COLUMN0ROW1]+s*i[f.COLUMN0ROW2])+Math.abs(o*i[f.COLUMN1ROW0]+u*i[f.COLUMN1ROW1]+s*i[f.COLUMN1ROW2])+Math.abs(o*i[f.COLUMN2ROW0]+u*i[f.COLUMN2ROW1]+s*i[f.COLUMN2ROW2]),d=n.dot(a,r)+t.distance;return-l>=d?c.OUTSIDE:d>=l?c.INSIDE:c.INTERSECTING};var C=new n,P=new n,U=new n,D=new n;m.distanceSquaredTo=function(e,t){var r=n.subtract(t,e.center,M),a=e.halfAxes,i=f.getColumn(a,0,C),o=f.getColumn(a,1,P),u=f.getColumn(a,2,U),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 d=D;d.x=n.dot(r,i),d.y=n.dot(r,o),d.z=n.dot(r,u);var E,h=0;return d.x<-s?(E=d.x+s,h+=E*E):d.x>s&&(E=d.x-s,h+=E*E),d.y<-c?(E=d.y+c,h+=E*E):d.y>c&&(E=d.y-c,h+=E*E),d.z<-l?(E=d.z+l,h+=E*E):d.z>l&&(E=d.z-l,h+=E*E),h};var F=new n,L=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,d=f.getColumn(c,0,C),E=f.getColumn(c,1,P),h=f.getColumn(c,2,U),m=n.add(d,E,F);n.add(m,h,m),n.add(m,s,m);var _=n.subtract(m,t,L),R=n.dot(r,_);return o=Math.min(R,o),u=Math.max(R,u),n.add(s,d,m),n.add(m,E,m),n.subtract(m,h,m),n.subtract(m,t,_),R=n.dot(r,_),o=Math.min(R,o),u=Math.max(R,u),n.add(s,d,m),n.subtract(m,E,m),n.add(m,h,m),n.subtract(m,t,_),R=n.dot(r,_),o=Math.min(R,o),u=Math.max(R,u),n.add(s,d,m),n.subtract(m,E,m),n.subtract(m,h,m),n.subtract(m,t,_),R=n.dot(r,_),o=Math.min(R,o),u=Math.max(R,u),n.subtract(s,d,m),n.add(m,E,m),n.add(m,h,m),n.subtract(m,t,_),R=n.dot(r,_),o=Math.min(R,o),u=Math.max(R,u),n.subtract(s,d,m),n.add(m,E,m),n.subtract(m,h,m),n.subtract(m,t,_),R=n.dot(r,_),o=Math.min(R,o),u=Math.max(R,u),n.subtract(s,d,m),n.subtract(m,E,m),n.add(m,h,m),n.subtract(m,t,_),R=n.dot(r,_),o=Math.min(R,o),u=Math.max(R,u),n.subtract(s,d,m),n.subtract(m,E,m),n.subtract(m,h,m),n.subtract(m,t,_),R=n.dot(r,_),o=Math.min(R,o),u=Math.max(R,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)&&f.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.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=t.x,r=t.y;t.x=(1-Math.abs(r))*a.signNotZero(n),t.y=(1-Math.abs(n))*a.signNotZero(r)}return t.x=a.toSNorm(t.x),t.y=a.toSNorm(t.y),t},i.octDecode=function(e,n,r){if(r.x=a.fromSNorm(e),r.y=a.fromSNorm(n),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){var i=r.x;r.x=(1-Math.abs(r.y))*a.signNotZero(i),r.y=(1-Math.abs(i))*a.signNotZero(r.y)}return t.normalize(r,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 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=1===e.x?4095:4096*e.x|0,n=1===e.y?4095:4096*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096;return t.x=Math.floor(n)/4096,t.y=n-Math.floor(n),t},i}),define("Renderer/WebGLConstants",["../Core/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",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,a,i){"use strict";if(!a.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return n(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,n,a,i){switch(a=t(a,0),i=t(i,(n.byteLength-a)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,a,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,a,i);case o.SHORT:return new Int16Array(n,a,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,a,i);case o.FLOAT:return new Float32Array(n,a,i);case o.DOUBLE:return new Float64Array(n,a,i);default:throw new r("componentDatatype is not a valid value.")}},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","./defined","./Math","./Matrix3","./Matrix4","./TerrainQuantization"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,i,o){var c,f,_,R;if(a(e)&&a(t)&&a(r)&&a(i)){var T=e.minimum,p=e.maximum,y=n.subtract(p,T,d),S=r-t,A=Math.max(n.maximumComponent(y),S);c=m-1>A?s.BITS12:s.NONE,f=e.center,_=u.inverseTransformation(i,new u);var N=n.negate(T,l);u.multiply(u.fromTranslation(N,E),_,_);var M=l;M.x=1/y.x,M.y=1/y.y,M.z=1/y.z,u.multiply(u.fromScale(M,E),_,_),R=u.clone(i),u.setTranslation(R,n.ZERO,R),i=u.clone(i,new u);var I=u.fromTranslation(T,E),O=u.fromScale(y,h),v=u.multiply(I,O,E);u.multiply(i,v,i),u.multiply(R,v,R)}this.quantization=c,this.minimumHeight=t,this.maximumHeight=r,this.center=f,this.toScaledENU=_,this.fromScaledENU=i,this.matrix=R,this.hasVertexNormals=o}var l=new n,d=new n,f=new t,E=new u,h=new u,m=Math.pow(2,12);c.prototype.encode=function(r,a,o,c,d,E){var h=c.x,m=c.y;if(this.quantization===s.BITS12){o=u.multiplyByPoint(this.toScaledENU,o,l),o.x=i.clamp(o.x,0,1),o.y=i.clamp(o.y,0,1),o.z=i.clamp(o.z,0,1);var _=this.maximumHeight-this.minimumHeight,R=i.clamp((d-this.minimumHeight)/_,0,1);t.fromElements(o.x,o.y,f);var T=e.compressTextureCoordinates(f);t.fromElements(o.z,R,f);var p=e.compressTextureCoordinates(f);t.fromElements(h,m,f);var y=e.compressTextureCoordinates(f);r[a++]=T,r[a++]=p,r[a++]=y}else n.subtract(o,this.center,l),r[a++]=l.x,r[a++]=l.y,r[a++]=l.z,r[a++]=d,r[a++]=h,r[a++]=m;return this.hasVertexNormals&&(r[a++]=e.octPackFloat(E)),a},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],f);i.x=o.x,i.y=o.y;var c=e.decompressTextureCoordinates(t[r+1],f);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],f);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.hasVertexNormals&&++e,e};var _={position3DAndHeight:0,textureCoordAndEncodedNormals:1},R={compressed:0};return c.prototype.getAttributes=function(e){var t=r.FLOAT;if(this.quantization===s.NONE){var n=r.getSizeInBytes(t),a=4,i=this.hasVertexNormals?3:2,o=(this.hasVertexNormals?7:6)*n;return[{index:_.position3DAndHeight,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:a,offsetInBytes:0,strideInBytes:o},{index:_.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:i,offsetInBytes:a*n,strideInBytes:o}]}var u=3;return u+=this.hasVertexNormals?1:0,[{index:R.compressed,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:u}]},c.prototype.getAttributeLocations=function(){return this.quantization===s.NONE?_:R},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},c}),define("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,E,h,m){"use strict";var _={};_.DEFAULT_STRUCTURE=c({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var R=new r,T=new d,p=new r,y=new r;return _.computeVertices=function(o){var c,S,A,N,M=Math.cos,I=Math.sin,O=Math.sqrt,v=Math.atan,g=Math.exp,w=l.PI_OVER_TWO,x=l.toRadians,C=o.heightmap,P=o.width,U=o.height,D=o.skirtHeight,F=a(o.isGeographic,!0),L=a(o.ellipsoid,u.WGS84),B=1/L.maximumRadius,z=o.nativeRectangle,b=o.rectangle;i(b)?(c=b.west,S=b.south,A=b.east,N=b.north):F?(c=x(z.west),S=x(z.south),A=x(z.east),N=x(z.north)):(c=z.west*B,S=w-2*v(g(-z.south*B)),A=z.east*B,N=w-2*v(g(-z.north*B)));var q=a(o.relativeToCenter,r.ZERO),G=a(o.exaggeration,1),W=a(o.structure,_.DEFAULT_STRUCTURE),X=a(W.heightScale,_.DEFAULT_STRUCTURE.heightScale),H=a(W.heightOffset,_.DEFAULT_STRUCTURE.heightOffset),V=a(W.elementsPerHeight,_.DEFAULT_STRUCTURE.elementsPerHeight),Y=a(W.stride,_.DEFAULT_STRUCTURE.stride),Z=a(W.elementMultiplier,_.DEFAULT_STRUCTURE.elementMultiplier),k=a(W.isBigEndian,_.DEFAULT_STRUCTURE.isBigEndian),j=E.computeWidth(z)/(P-1),K=E.computeHeight(z)/(U-1),J=L.radiiSquared,Q=J.x,$=J.y,ee=J.z,te=65536,ne=-65536,re=m.eastNorthUpToFixedFrame(q,L),ae=d.inverseTransformation(re,T),ie=p;ie.x=Number.POSITIVE_INFINITY,ie.y=Number.POSITIVE_INFINITY,ie.z=Number.POSITIVE_INFINITY;var oe=y;oe.x=Number.NEGATIVE_INFINITY,oe.y=Number.NEGATIVE_INFINITY,oe.z=Number.NEGATIVE_INFINITY;var ue=Number.POSITIVE_INFINITY,se=P+(D>0?2:0),ce=U+(D>0?2:0),le=se*ce,de=new Array(le),fe=new Array(le),Ee=new Array(le),he=0,me=U,_e=0,Re=P;D>0&&(--he,++me,--_e,++Re);for(var Te=0,pe=he;me>pe;++pe){var ye=pe;0>ye&&(ye=0),ye>=U&&(ye=U-1);var Se=z.north-K*ye;Se=F?x(Se):w-2*v(g(-Se*B));var Ae=M(Se),Ne=I(Se),Me=ee*Ne,Ie=(Se-S)/(N-S);Ie=l.clamp(Ie,0,1);for(var Oe=_e;Re>Oe;++Oe){var ve=Oe;0>ve&&(ve=0),ve>=P&&(ve=P-1);var ge=z.west+j*ve;F?ge=x(ge):ge*=B;var we,xe=ye*(P*Y)+ve*Y;if(1===V)we=C[xe];else{we=0;var Ce;if(k)for(Ce=0;V>Ce;++Ce)we=we*Z+C[xe+Ce];else for(Ce=V-1;Ce>=0;--Ce)we=we*Z+C[xe+Ce]}we=(we*X+H)*G,ne=Math.max(ne,we),te=Math.min(te,we),(Oe!==ve||pe!==ye)&&(we-=D);var Pe=Ae*M(ge),Ue=Ae*I(ge),De=Q*Pe,Fe=$*Ue,Le=O(De*Pe+Fe*Ue+Me*Ne),Be=1/Le,ze=De*Be,be=Fe*Be,qe=Me*Be,Ge=new r;Ge.x=ze+Pe*we,Ge.y=be+Ue*we,Ge.z=qe+Ne*we,de[Te]=Ge,fe[Te]=we;var We=(ge-c)/(A-c);We=l.clamp(We,0,1),Ee[Te]=new n(We,Ie),Te++,d.multiplyByPoint(ae,Ge,R),r.minimumByComponent(R,ie,ie),r.maximumByComponent(R,oe,oe),ue=Math.min(ue,we)}}var Xe,He=t.fromPoints(de);i(b)&&b.width<l.PI_OVER_TWO+l.EPSILON5&&(Xe=f.fromRectangle(b,te,ne,L));var Ve,Ye=o.relativetoCenter;if(i(Ye)){var Ze=new s(L);Ve=Ze.computeHorizonCullingPointFromPoints(Ye,de)}for(var ke=new e(ie,oe,q),je=new h(ke,ue,ne,re,!1),Ke=new Float32Array(le*je.getStride()),Je=0,Qe=0;le>Qe;++Qe)Je=je.encode(Ke,Je,de[Qe],Ee[Qe],fe[Qe]);return{vertices:Ke,maximumHeight:ne,minimumHeight:te,encoding:je,boundingSphere3D:He,orientedBoundingBox:Xe,occludeePointInScaledSpace:Ve}},_}),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(c){c instanceof Error?o.error={name:c.name,message:c.message,stack:c.stack}:o.error=c}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(c){o.result=void 0,o.error="postMessage failed with error: "+n(c)+"\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/Workers/createVerticesFromQuantizedTerrainMesh.js b/Workers/createVerticesFromQuantizedTerrainMesh.js index 57d0ccf..46b0186 100644 --- a/Workers/createVerticesFromQuantizedTerrainMesh.js +++ b/Workers/createVerticesFromQuantizedTerrainMesh.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,4 +55,175 @@ 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";var t=function(t){return void 0!==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";var e=function(t,e){return void 0!==t?t:e};return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";var e=function(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(r){e=r.stack}this.stack=e};return 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("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^=2636928640&t<<7,t^=4022730752&t<<15,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){"use strict";var r={};r.EPSILON1=.1,r.EPSILON2=.01,r.EPSILON3=.001,r.EPSILON4=1e-4,r.EPSILON5=1e-5,r.EPSILON6=1e-6,r.EPSILON7=1e-7,r.EPSILON8=1e-8,r.EPSILON9=1e-9,r.EPSILON10=1e-10,r.EPSILON11=1e-11,r.EPSILON12=1e-12,r.EPSILON13=1e-13,r.EPSILON14=1e-14,r.EPSILON15=1e-15,r.EPSILON16=1e-16,r.EPSILON17=1e-17,r.EPSILON18=1e-18,r.EPSILON19=1e-19,r.EPSILON20=1e-20,r.GRAVITATIONALPARAMETER=3986004418e5,r.SOLAR_RADIUS=6955e5,r.LUNAR_RADIUS=1737400,r.SIXTY_FOUR_KILOBYTES=65536,r.sign=function(t){return t>0?1:0>t?-1:0},r.signNotZero=function(t){return 0>t?-1:1},r.toSNorm=function(t){return Math.round(255*(.5*r.clamp(t,-1,1)+.5))},r.fromSNorm=function(t){return 2*(r.clamp(t,0,255)/255)-1},r.sinh=function(t){var e=Math.pow(Math.E,t),r=Math.pow(Math.E,-1*t);return.5*(e-r)},r.cosh=function(t){var e=Math.pow(Math.E,t),r=Math.pow(Math.E,-1*t);return.5*(e+r)},r.lerp=function(t,e,r){return(1-r)*t+r*e},r.PI=Math.PI,r.ONE_OVER_PI=1/Math.PI,r.PI_OVER_TWO=.5*Math.PI,r.PI_OVER_THREE=Math.PI/3,r.PI_OVER_FOUR=Math.PI/4,r.PI_OVER_SIX=Math.PI/6,r.THREE_PI_OVER_TWO=.5*3*Math.PI,r.TWO_PI=2*Math.PI,r.ONE_OVER_TWO_PI=1/(2*Math.PI),r.RADIANS_PER_DEGREE=Math.PI/180,r.DEGREES_PER_RADIAN=180/Math.PI,r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600,r.toRadians=function(t){return t*r.RADIANS_PER_DEGREE},r.toDegrees=function(t){return t*r.DEGREES_PER_RADIAN},r.convertLongitudeRange=function(t){var e=r.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},r.negativePiToPi=function(t){for(var e=r.EPSILON10,n=r.PI,i=r.TWO_PI;-(n+e)>t;)t+=i;if(-n>t)return-n;for(;t>n+e;)t-=i;return t>n?n:t},r.zeroToTwoPi=function(t){var e=t%r.TWO_PI;return 0>e?(e+r.TWO_PI)%r.TWO_PI:e},r.equalsEpsilon=function(t,r,n){return n=e(n,0),Math.abs(t-r)<=n};var n=[1];r.factorial=function(t){var e=n.length;if(t>=e)for(var r=n[e-1],i=e;t>=i;i++)n.push(r*i);return n[t]},r.incrementWrap=function(t,r,n){return n=e(n,0),++t,t>r&&(t=n),t},r.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},r.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},r.clamp=function(t,e,r){return e>t?e:t>r?r:t};var i=new t;return r.setRandomNumberSeed=function(e){i=new t(e)},r.nextRandomNumber=function(){return i.random()},r.acosClamped=function(t){return Math.acos(r.clamp(t,-1,1))},r.asinClamped=function(t){return Math.asin(r.clamp(t,-1,1))},r}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,i){"use strict";var a=function(e,r){this.x=t(e,0),this.y=t(r,0)};a.fromElements=function(t,r,n){return e(n)?(n.x=t,n.y=r,n):new a(t,r)},a.clone=function(t,r){return e(t)?e(r)?(r.x=t.x,r.y=t.y,r):new a(t.x,t.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,r,n){n=t(n,0),r[n++]=e.x,r[n]=e.y},a.unpack=function(r,n,i){return n=t(n,0),e(i)||(i=new a),i.x=r[n++],i.y=r[n],i},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,r){return r.x=Math.min(t.x,e.x),r.y=Math.min(t.y,e.y),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},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.normalize=function(t,e){var r=a.magnitude(t);return e.x=t.x/r,e.y=t.y/r,e},a.dot=function(t,e){return t.x*e.x+t.y*e.y},a.multiplyComponents=function(t,e,r){return r.x=t.x*e.x,r.y=t.y*e.y,r},a.add=function(t,e,r){return r.x=t.x+e.x,r.y=t.y+e.y,r},a.subtract=function(t,e,r){return r.x=t.x-e.x,r.y=t.y-e.y,r},a.multiplyByScalar=function(t,e,r){return r.x=t.x*e,r.y=t.y*e,r},a.divideByScalar=function(t,e,r){return r.x=t.x/e,r.y=t.y/e,r},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,r,n){return a.multiplyByScalar(e,r,u),n=a.multiplyByScalar(t,1-r,n),a.add(u,n,n)};var s=new a,c=new a;a.angleBetween=function(t,e){return a.normalize(t,s),a.normalize(e,c),i.acosClamped(a.dot(s,c))};var h=new a;return a.mostOrthogonalAxis=function(t,e){var r=a.normalize(t,h);return a.abs(r,r),e=r.x<=r.y?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Y,e)},a.equals=function(t,r){return t===r||e(t)&&e(r)&&t.x===r.x&&t.y===r.y},a.equalsEpsilon=function(t,r,n){return t===r||e(t)&&e(r)&&Math.abs(t.x-r.x)<=n&&Math.abs(t.y-r.y)<=n},a.ZERO=n(new a(0,0)),a.UNIT_X=n(new a(1,0)),a.UNIT_Y=n(new a(0,1)),a.prototype.clone=function(t){return a.clone(this,t)},a.prototype.equals=function(t){return a.equals(this,t)},a.prototype.equalsEpsilon=function(t,e){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,i){"use strict";var a=function(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)};a.fromSpherical=function(r,n){e(n)||(n=new a);var i=r.clock,o=r.cone,u=t(r.magnitude,1),s=u*Math.sin(o);return n.x=s*Math.cos(i),n.y=s*Math.sin(i),n.z=u*Math.cos(o),n},a.fromElements=function(t,r,n,i){return e(i)?(i.x=t,i.y=r,i.z=n,i):new a(t,r,n)},a.clone=function(t,r){return e(t)?e(r)?(r.x=t.x,r.y=t.y,r.z=t.z,r):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,r,n){n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z},a.unpack=function(r,n,i){return n=t(n,0),e(i)||(i=new a),i.x=r[n++],i.y=r[n++],i.z=r[n],i},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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.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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,r){return r.x=t.x*e,r.y=t.y*e,r.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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,c=new a;a.angleBetween=function(t,e){a.normalize(t,s),a.normalize(e,c);var r=a.dot(s,c),n=a.magnitude(a.cross(s,c,s));return Math.atan2(n,r)};var h=new a;a.mostOrthogonalAxis=function(t,e){var r=a.normalize(t,h);return a.abs(r,r),e=r.x<=r.y?r.x<=r.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):r.y<=r.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsEpsilon=function(t,r,n){return t===r||e(t)&&e(r)&&Math.abs(t.x-r.x)<=n&&Math.abs(t.y-r.y)<=n&&Math.abs(t.z-r.z)<=n},a.cross=function(t,e,r){var n=t.x,i=t.y,a=t.z,o=e.x,u=e.y,s=e.z,c=i*s-a*u,h=a*o-n*s,d=n*u-i*o;return r.x=c,r.y=h,r.z=d,r},a.fromDegrees=function(t,e,r,n,o){var u=i.toRadians(t),s=i.toRadians(e);return a.fromRadians(u,s,r,n,o)};var d=new a,f=new a,l=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(r,n,i,o,u){i=t(i,0);var s=e(o)?o.radiiSquared:l,c=Math.cos(n);d.x=c*Math.cos(r),d.y=c*Math.sin(r),d.z=Math.sin(n),d=a.normalize(d,d),a.multiplyComponents(s,d,f);var h=Math.sqrt(a.dot(d,f));return f=a.divideByScalar(f,h,f),d=a.multiplyByScalar(d,i,d),e(u)||(u=new a),a.add(f,d,u)},a.fromDegreesArray=function(t,e,r){for(var n=new Array(t.length),o=0;o<t.length;o++)n[o]=i.toRadians(t[o]);return a.fromRadiansArray(n,e,r)},a.fromRadiansArray=function(t,r,n){var i=t.length;e(n)?n.length=i/2:n=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],s=t[o+1];n[o/2]=a.fromRadians(u,s,0,r,n[o/2])}return n},a.fromDegreesArrayHeights=function(t,e,r){for(var n=new Array(t.length),o=0;o<t.length;o+=3)n[o]=i.toRadians(t[o]),n[o+1]=i.toRadians(t[o+1]),n[o+2]=t[o+2];return a.fromRadiansArrayHeights(n,e,r)},a.fromRadiansArrayHeights=function(t,r,n){var i=t.length;e(n)?n.length=i/3:n=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],s=t[o+1],c=t[o+2];n[o/3]=a.fromRadians(u,s,c,r,n[o/3])}return n},a.ZERO=n(new a(0,0,0)),a.UNIT_X=n(new a(1,0,0)),a.UNIT_Y=n(new a(0,1,0)),a.UNIT_Z=n(new a(0,0,1)),a.prototype.clone=function(t){return a.clone(this,t)},a.prototype.equals=function(t){return a.equals(this,t)},a.prototype.equalsEpsilon=function(t,e){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,r,n,i){"use strict";var a={};a.octEncode=function(t,e){if(e.x=t.x/(Math.abs(t.x)+Math.abs(t.y)+Math.abs(t.z)),e.y=t.y/(Math.abs(t.x)+Math.abs(t.y)+Math.abs(t.z)),t.z<0){var r=e.x,n=e.y;e.x=(1-Math.abs(n))*i.signNotZero(r),e.y=(1-Math.abs(r))*i.signNotZero(n)}return e.x=i.toSNorm(e.x),e.y=i.toSNorm(e.y),e},a.octDecode=function(t,r,n){if(n.x=i.fromSNorm(t),n.y=i.fromSNorm(r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var a=n.x;n.x=(1-Math.abs(n.y))*i.signNotZero(a),n.y=(1-Math.abs(a))*i.signNotZero(n.y)}return e.normalize(n,n)},a.octPackFloat=function(t){return 256*t.x+t.y};var o=new t;return a.octEncodeFloat=function(t){return a.octEncode(t,o),a.octPackFloat(o)},a.octDecodeFloat=function(t,e){var r=t/256,n=Math.floor(r),i=256*(r-n);return a.octDecode(n,i,e)},a.octPack=function(t,e,r,n){var i=a.octEncodeFloat(t),u=a.octEncodeFloat(e),s=a.octEncode(r,o);return n.x=65536*s.x+i,n.y=65536*s.y+u,n},a.octUnpack=function(t,e,r,n){var i=t.x/65536,o=Math.floor(i),u=65536*(i-o);i=t.y/65536;var s=Math.floor(i),c=65536*(i-s);a.octDecodeFloat(u,e),a.octDecodeFloat(c,r),a.octDecode(o,s,n)},a.compressTextureCoordinates=function(t){var e=1===t.x?4095:0|4096*t.x,r=1===t.y?4095:0|4096*t.y;return 4096*e+r},a.decompressTextureCoordinates=function(t,e){var r=t/4096;return e.x=Math.floor(r)/4096,e.y=r-Math.floor(r),e},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,i){"use strict";var a=function(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)};return a.fromRadians=function(r,n,i,o){return i=t(i,0),e(o)?(o.longitude=r,o.latitude=n,o.height=i,o):new a(r,n,i)},a.fromDegrees=function(t,e,r,n){return t=i.toRadians(t),e=i.toRadians(e),a.fromRadians(t,e,r,n)},a.clone=function(t,r){return e(t)?e(r)?(r.longitude=t.longitude,r.latitude=t.latitude,r.height=t.height,r):new a(t.longitude,t.latitude,t.height):void 0},a.equals=function(t,r){return t===r||e(t)&&e(r)&&t.longitude===r.longitude&&t.latitude===r.latitude&&t.height===r.height},a.equalsEpsilon=function(t,r,n){return t===r||e(t)&&e(r)&&Math.abs(t.longitude-r.longitude)<=n&&Math.abs(t.latitude-r.latitude)<=n&&Math.abs(t.height-r.height)<=n},a.ZERO=n(new a(0,0,0)),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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),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"],function(t,e,r,n,i,a,o,u){"use strict";function s(e,n,i,a){n=r(n,0),i=r(i,0),a=r(a,0),e._radii=new t(n,i,a),e._radiiSquared=new t(n*n,i*i,a*a),e._radiiToTheFourth=new t(n*n*n*n,i*i*i*i,a*a*a*a),e._oneOverRadii=new t(0===n?0:1/n,0===i?0:1/i,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===n?0:1/(n*n),0===i?0:1/(i*i),0===a?0:1/(a*a)),e._minimumRadius=Math.min(n,i,a),e._maximumRadius=Math.max(n,i,a),e._centerToleranceSquared=u.EPSILON1}var c=function(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,s(this,t,e,r)};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,r){if(!n(e))return void 0;var i=e._radii;return n(r)?(t.clone(i,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(i.x,i.y,i.z)},c.fromCartesian3=function(t,e){return n(e)||(e=new c),n(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.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,r){var i=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),c=Math.sin(a);return n(r)||(r=new t),r.x=u,r.y=s,r.z=c,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 h=new t,d=new t;c.prototype.cartographicToCartesian=function(e,r){var i=h,a=d;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),n(r)||(r=new t),t.add(a,i,r)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var i=0;r>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var f=new t,l=new t,m=new t;c.prototype.cartesianToCartographic=function(r,i){var a=this.scaleToGeodeticSurface(r,l);if(!n(a))return void 0;var o=this.geodeticSurfaceNormal(a,f),s=t.subtract(r,a,m),c=Math.atan2(o.y,o.x),h=Math.asin(o.z),d=u.sign(t.dot(s,r))*t.magnitude(s);return n(i)?(i.longitude=c,i.latitude=h,i.height=d,i):new e(c,h,d)},c.prototype.cartesianArrayToCartographicArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var i=0;r>i;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e};var y=new t,p=new t;return c.prototype.scaleToGeodeticSurface=function(e,r){var i=e.x,a=e.y,o=e.z,s=this._oneOverRadii,c=s.x,h=s.y,d=s.z,f=i*i*c*c,l=a*a*h*h,m=o*o*d*d,x=f+l+m,g=Math.sqrt(1/x),v=t.multiplyByScalar(e,g,y);if(x<this._centerToleranceSquared)return isFinite(g)?t.clone(v,r):void 0;var E=this._oneOverRadiiSquared,S=E.x,_=E.y,M=E.z,R=p;R.x=2*v.x*S,R.y=2*v.y*_,R.z=2*v.z*M;var I,w,N,T,O,z,P,A,C,b,q,D=(1-g)*t.magnitude(e)/(.5*t.magnitude(R)),U=0;do{D-=U,N=1/(1+D*S),T=1/(1+D*_),O=1/(1+D*M),z=N*N,P=T*T,A=O*O,C=z*N,b=P*T,q=A*O,I=f*z+l*P+m*A-1,w=f*C*S+l*b*_+m*q*M;var L=-2*w;U=I/L}while(Math.abs(I)>u.EPSILON12);return n(r)?(r.x=i*N,r.y=a*T,r.z=o*O,r):new t(i*N,a*T,o*O)},c.prototype.scaleToGeocentricSurface=function(e,r){n(r)||(r=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*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}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},i.createTypedArrayFromArrayBuffer=function(t,e,r,i){return t>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,r,i):new Uint16Array(e,r,i)},r(i)}),define("Core/formatError",["./defined"],function(t){"use strict";var e=function(e){var r,n=e.name,i=e.message;r=t(n)&&t(i)?n+": "+i:e.toString();var a=e.stack;return t(a)&&(r+="\n"+a),r};return e}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(t,e,r){"use strict";var n=function(n){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=n(s.parameters,a)}catch(c){o.error=c instanceof Error?{name:c.name,message:c.message,stack:c.stack}:c}e(i)||(i=t(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(a.length=0);try{i(o,a)}catch(c){o.result=void 0,o.error="postMessage failed with error: "+r(c)+"\n with responseMessage: "+JSON.stringify(o),i(o)}}};return n}),define("Workers/createVerticesFromQuantizedTerrainMesh",["../Core/AttributeCompression","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defined","../Core/Ellipsoid","../Core/IndexDatatype","../Core/Math","./createTaskProcessorWorker"],function(t,e,r,n,i,a,o,u,s){"use strict";function c(e,r){var n=e.quantizedVertices,s=n.length/3,c=e.octEncodedNormals,_=e.westIndices.length+e.eastIndices.length+e.southIndices.length+e.northIndices.length,M=e.minimumHeight,R=e.maximumHeight,I=e.relativeToCenter,w=e.rectangle,N=w.west,T=w.south,O=w.east,z=w.north,P=a.clone(e.ellipsoid),A=n.subarray(0,s),C=n.subarray(s,2*s),b=n.subarray(2*s,3*s),q=i(c),D=6;q&&(D+=1);for(var U=new Float32Array(s*D+_*D),L=0,B=0,k=0;s>L;++L,B+=D,k+=2){var F=A[L]/d,G=C[L]/d,W=u.lerp(M,R,b[L]/d);E.longitude=u.lerp(N,O,F),E.latitude=u.lerp(T,z,G),E.height=W,P.cartographicToCartesian(E,v),U[B+f]=v.x-I.x,U[B+l]=v.y-I.y,U[B+m]=v.z-I.z,U[B+y]=W,U[B+p]=F,U[B+x]=G,q&&(S.x=c[k],S.y=c[k+1],U[B+g]=t.octPackFloat(S))}var V=Math.max(0,2*(_-4)),Y=e.indices.length+3*V,H=o.createTypedArray(s+_,Y);H.set(e.indices,0);var K=s*D,Z=e.indices.length;return Z=h(U,K,H,Z,e.westIndices,I,P,w,e.westSkirtHeight,!0,q),K+=e.westIndices.length*D,Z=h(U,K,H,Z,e.southIndices,I,P,w,e.southSkirtHeight,!1,q),K+=e.southIndices.length*D,Z=h(U,K,H,Z,e.eastIndices,I,P,w,e.eastSkirtHeight,!1,q),K+=e.eastIndices.length*D,Z=h(U,K,H,Z,e.northIndices,I,P,w,e.northSkirtHeight,!0,q),K+=e.northIndices.length*D,r.push(U.buffer,H.buffer),{vertices:U.buffer,indices:H.buffer}}function h(t,e,n,i,a,o,s,c,h,d,f){var l,m,S,_=6;f&&(_+=1),d?(l=a.length-1,m=-1,S=-1):(l=0,m=a.length,S=1);for(var M=-1,R=e/_,I=l;I!==m;I+=S){var w=a[I],N=w*_,T=t[N+p],O=t[N+x],z=t[N+y];E.longitude=u.lerp(c.west,c.east,T),E.latitude=u.lerp(c.south,c.north,O),E.height=z-h;var P=s.cartographicToCartesian(E,v);r.subtract(P,o,P),t[e++]=P.x,t[e++]=P.y,t[e++]=P.z,t[e++]=E.height,t[e++]=T,t[e++]=O,f&&(t[e++]=t[N+g]),-1!==M&&(n[i++]=M,n[i++]=R-1,n[i++]=w,n[i++]=R-1,n[i++]=R,n[i++]=w),M=w,++R}return i}var d=32767,f=0,l=1,m=2,y=3,p=4,x=5,g=6,v=new r,E=new n,S=new e;return s(c)})}(); \ No newline at end of file +/** + @license + when.js - https://github.com/cujojs/when + + MIT License (c) copyright B Cavalier & J Hann + + * A lightweight CommonJS Promises/A and when() implementation + * when is part of the cujo.js family of libraries (http://cujojs.com/) + * + * Licensed under the MIT License at: + * http://www.opensource.org/licenses/mit-license.php + * + * @version 1.7.1 + */ + +/** +@license +sprintf.js from the php.js project - https://github.com/kvz/phpjs +Directly from https://github.com/kvz/phpjs/blob/master/functions/strings/sprintf.js + +php.js is copyright 2012 Kevin van Zonneveld. + +Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld +(http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White +(http://getsprink.com), Waldo Malqui Silva, Paulo Freitas, Jack, Jonas +Raoni Soares Silva (http://www.jsfromhell.com), Philip Peterson, Legaev +Andrey, Ates Goral (http://magnetiq.com), Alex, Ratheous, Martijn Wieringa, +Rafa? Kukawski (http://blog.kukawski.pl), lmeyrick +(https://sourceforge.net/projects/bcmath-js/), Nate, Philippe Baumann, +Enrique Gonzalez, Webtoolkit.info (http://www.webtoolkit.info/), Carlos R. +L. Rodrigues (http://www.jsfromhell.com), Ash Searle +(http://hexmen.com/blog/), Jani Hartikainen, travc, Ole Vrijenhoek, +Erkekjetter, Michael Grier, Rafa? Kukawski (http://kukawski.pl), Johnny +Mast (http://www.phpvrouwen.nl), T.Wild, d3x, +http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript, +Rafa? Kukawski (http://blog.kukawski.pl/), stag019, pilus, WebDevHobo +(http://webdevhobo.blogspot.com/), marrtins, GeekFG +(http://geekfg.blogspot.com), Andrea Giammarchi +(http://webreflection.blogspot.com), Arpad Ray (mailto:arpad@php.net), +gorthaur, Paul Smith, Tim de Koning (http://www.kingsquare.nl), Joris, Oleg +Eremeev, Steve Hilder, majak, gettimeofday, KELAN, Josh Fraser +(http://onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/), +Marc Palau, Martin +(http://www.erlenwiese.de/), Breaking Par Consulting Inc +(http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256CFB006C45F7), +Chris, Mirek Slugen, saulius, Alfonso Jimenez +(http://www.alfonsojimenez.com), Diplom@t (http://difane.com/), felix, +Mailfaker (http://www.weedem.fr/), Tyler Akins (http://rumkin.com), Caio +Ariede (http://caioariede.com), Robin, Kankrelune +(http://www.webfaktory.info/), Karol Kowalski, Imgen Tata +(http://www.myipdf.com/), mdsjack (http://www.mdsjack.bo.it), Dreamer, +Felix Geisendoerfer (http://www.debuggable.com/felix), Lars Fischer, AJ, +David, Aman Gupta, Michael White, Public Domain +(http://www.json.org/json2.js), Steven Levithan +(http://blog.stevenlevithan.com), Sakimori, Pellentesque Malesuada, +Thunder.m, Dj (http://phpjs.org/functions/htmlentities:425#comment_134018), +Steve Clay, David James, Francois, class_exists, nobbler, T. Wild, Itsacon +(http://www.itsacon.net/), date, Ole Vrijenhoek (http://www.nervous.nl/), +Fox, Raphael (Ao RUDLER), Marco, noname, Mateusz "loonquawl" Zalega, Frank +Forte, Arno, ger, mktime, john (http://www.jd-tech.net), Nick Kolosov +(http://sammy.ru), marc andreu, Scott Cariss, Douglas Crockford +(http://javascript.crockford.com), madipta, Slawomir Kaniecki, +ReverseSyntax, Nathan, Alex Wilson, kenneth, Bayron Guevara, Adam Wallner +(http://web2.bitbaro.hu/), paulo kuong, jmweb, Lincoln Ramsay, djmix, +Pyerre, Jon Hohle, Thiago Mata (http://thiagomata.blog.com), lmeyrick +(https://sourceforge.net/projects/bcmath-js/this.), Linuxworld, duncan, +Gilbert, Sanjoy Roy, Shingo, sankai, Oskar Larsson H?gfeldt +(http://oskar-lh.name/), Denny Wardhana, 0m3r, Everlasto, Subhasis Deb, +josh, jd, Pier Paolo Ramon (http://www.mastersoup.com/), P, merabi, Soren +Hansen, Eugene Bulkin (http://doubleaw.com/), Der Simon +(http://innerdom.sourceforge.net/), echo is bad, Ozh, XoraX +(http://www.xorax.info), EdorFaus, JB, J A R, Marc Jansen, Francesco, LH, +Stoyan Kyosev (http://www.svest.org/), nord_ua, omid +(http://phpjs.org/functions/380:380#comment_137122), Brad Touesnard, MeEtc +(http://yass.meetcweb.com), Peter-Paul Koch +(http://www.quirksmode.org/js/beat.html), Olivier Louvignes +(http://mg-crea.com/), T0bsn, Tim Wiel, Bryan Elliott, Jalal Berrami, +Martin, JT, David Randall, Thomas Beaucourt (http://www.webapp.fr), taith, +vlado houba, Pierre-Luc Paour, Kristof Coomans (SCK-CEN Belgian Nucleair +Research Centre), Martin Pool, Kirk Strobeck, Rick Waldron, Brant Messenger +(http://www.brantmessenger.com/), Devan Penner-Woelk, Saulo Vallory, Wagner +B. Soares, Artur Tchernychev, Valentina De Rosa, Jason Wong +(http://carrot.org/), Christoph, Daniel Esteban, strftime, Mick@el, rezna, +Simon Willison (http://simonwillison.net), Anton Ongson, Gabriel Paderni, +Marco van Oort, penutbutterjelly, Philipp Lenssen, Bjorn Roesbeke +(http://www.bjornroesbeke.be/), Bug?, Eric Nagel, Tomasz Wesolowski, +Evertjan Garretsen, Bobby Drake, Blues (http://tech.bluesmoon.info/), Luke +Godfrey, Pul, uestla, Alan C, Ulrich, Rafal Kukawski, Yves Sucaet, +sowberry, Norman "zEh" Fuchs, hitwork, Zahlii, johnrembo, Nick Callen, +Steven Levithan (stevenlevithan.com), ejsanders, Scott Baker, Brian Tafoya +(http://www.premasolutions.com/), Philippe Jausions +(http://pear.php.net/user/jausions), Aidan Lister +(http://aidanlister.com/), Rob, e-mike, HKM, ChaosNo1, metjay, strcasecmp, +strcmp, Taras Bogach, jpfle, Alexander Ermolaev +(http://snippets.dzone.com/user/AlexanderErmolaev), DxGx, kilops, Orlando, +dptr1988, Le Torbi, James (http://www.james-bell.co.uk/), Pedro Tainha +(http://www.pedrotainha.com), James, Arnout Kazemier +(http://www.3rd-Eden.com), Chris McMacken, gabriel paderni, Yannoo, +FGFEmperor, baris ozdil, Tod Gentille, Greg Frazier, jakes, 3D-GRAF, Allan +Jensen (http://www.winternet.no), Howard Yeend, Benjamin Lupton, davook, +daniel airton wermann (http://wermann.com.br), Atli T¨®r, Maximusya, Ryan +W Tenney (http://ryan.10e.us), Alexander M Beedie, fearphage +(http://http/my.opera.com/fearphage/), Nathan Sepulveda, Victor, Matteo, +Billy, stensi, Cord, Manish, T.J. Leahy, Riddler +(http://www.frontierwebdev.com/), Rafa? Kukawski, FremyCompany, Matt +Bradley, Tim de Koning, Luis Salazar (http://www.freaky-media.com/), Diogo +Resende, Rival, Andrej Pavlovic, Garagoth, Le Torbi +(http://www.letorbi.de/), Dino, Josep Sanz (http://www.ws3.es/), rem, +Russell Walker (http://www.nbill.co.uk/), Jamie Beck +(http://www.terabit.ca/), setcookie, Michael, YUI Library: +http://developer.yahoo.com/yui/docs/YAHOO.util.DateLocale.html, Blues at +http://hacks.bluesmoon.info/strftime/strftime.js, Ben +(http://benblume.co.uk/), DtTvB +(http://dt.in.th/2008-09-16.string-length-in-bytes.html), Andreas, William, +meo, incidence, Cagri Ekin, Amirouche, Amir Habibi +(http://www.residence-mixte.com/), Luke Smith (http://lucassmith.name), +Kheang Hok Chin (http://www.distantia.ca/), Jay Klehr, Lorenzo Pisani, +Tony, Yen-Wei Liu, Greenseed, mk.keck, Leslie Hoare, dude, booeyOH, Ben +Bryan + +Licensed under the MIT (MIT-LICENSE.txt) license. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL KEVIN VAN ZONNEVELD BE LIABLE FOR ANY CLAIM, DAMAGES +OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. +*/ + +/** + * @license + * + * Grauw URI utilities + * + * See: http://hg.grauw.nl/grauw-lib/file/tip/src/uri.js + * + * @author Laurens Holst (http://www.grauw.nl/) + * + * Copyright 2012 Laurens Holst + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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:0>e?-1:0},a.signNotZero=function(e){return 0>e?-1:1},a.toSNorm=function(e){return Math.round(255*(.5*a.clamp(e,-1,1)+.5))},a.fromSNorm=function(e){return a.clamp(e,0,255)/255*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.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 a>=i||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;e>=r;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 t>e?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){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},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.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.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/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}i.fromSpherical=function(n,r){t(r)||(r=new i);var a=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(o),r},i.fromElements=function(e,n,r,a){return t(a)?(a.x=e,a.y=n,a.z=r,a):new i(e,n,r)},i.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 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},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},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 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){i.normalize(e,s),i.normalize(t,c);var n=i.dot(s,c),r=i.magnitude(i.cross(s,c,s));return Math.atan2(r,n)};var l=new i;i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):n.y<=n.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,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},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},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)},i.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,d=r*u-a*o;return n.x=c,n.y=l,n.z=d,n},i.fromDegrees=function(e,t,n,r,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,n,r,o)};var d=new i,f=new i,E=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(n,r,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:E,c=Math.cos(r);d.x=c*Math.cos(n),d.y=c*Math.sin(n),d.z=Math.sin(r),d=i.normalize(d,d),i.multiplyComponents(s,d,f);var l=Math.sqrt(i.dot(d,f));return f=i.divideByScalar(f,l,f),d=i.multiplyByScalar(d,a,d),t(u)||(u=new i),i.add(f,d,u)},i.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=a.toRadians(e[o]);return i.fromRadiansArray(r,t,n)},i.fromRadiansArray=function(e,n,r){var a=e.length;t(r)?r.length=a/2:r=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=i.fromRadians(u,s,0,n,r[o/2])}return r},i.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=a.toRadians(e[o]),r[o+1]=a.toRadians(e[o+1]),r[o+2]=e[o+2];return i.fromRadiansArrayHeights(r,t,n)},i.fromRadiansArrayHeights=function(e,n,r){var a=e.length;t(r)?r.length=a/3:r=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=i.fromRadians(u,s,c,n,r[o/3])}return r},i.ZERO=r(new i(0,0,0)),i.UNIT_X=r(new i(1,0,0)),i.UNIT_Y=r(new i(0,1,0)),i.UNIT_Z=r(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,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,a){"use strict";var i={};i.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=t.x,r=t.y;t.x=(1-Math.abs(r))*a.signNotZero(n),t.y=(1-Math.abs(n))*a.signNotZero(r)}return t.x=a.toSNorm(t.x),t.y=a.toSNorm(t.y),t},i.octDecode=function(e,n,r){if(r.x=a.fromSNorm(e),r.y=a.fromSNorm(n),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){var i=r.x;r.x=(1-Math.abs(r.y))*a.signNotZero(i),r.y=(1-Math.abs(i))*a.signNotZero(r.y)}return t.normalize(r,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 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=1===e.x?4095:4096*e.x|0,n=1===e.y?4095:4096*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096;return t.x=Math.floor(n)/4096,t.y=n-Math.floor(n),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,d=t.length,f=1;d>f;f++){var E=t[f],h=E.x,m=E.y,_=E.z;a=Math.min(h,a),s=Math.max(h,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 T=r.maximum;T.x=s,T.y=c,T.z=l;var p=e.add(y,T,r.center);return e.multiplyByScalar(p,.5,p),r},i.clone=function(t,r){return n(t)?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):void 0},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:0>s+u?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,d=n.y,f=n.z,E=a.x,h=a.y,m=a.z,_=l*l*E*E,y=d*d*h*h,T=f*f*m*m,p=_+y+T,R=Math.sqrt(1/p),S=e.multiplyByScalar(n,R,i);if(s>p)return isFinite(R)?e.clone(S,c):void 0;var A=u.x,N=u.y,I=u.z,M=o;M.x=S.x*A*2,M.y=S.y*N*2,M.z=S.z*I*2;var O,v,w,g,x,C,P,U,D,F,L,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(M)),z=0;do{B-=z,w=1/(1+B*A),g=1/(1+B*N),x=1/(1+B*I),C=w*w,P=g*g,U=x*x,D=C*w,F=P*g,L=U*x,O=_*C+y*P+T*U-1,v=_*D*A+y*F*N+T*L*I;var b=-2*v;z=O/b}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=l*w,c.y=d*g,c.z=f*x,c):new e(l*w,d*g,f*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,d=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),E=i.EPSILON1;return u.fromCartesian=function(t,r,a){var h=n(r)?r.oneOverRadii:d,m=n(r)?r.oneOverRadiiSquared:f,_=n(r)?r._centerToleranceSquared:E,y=o(t,h,m,_,c);if(n(y)){var T=e.multiplyComponents(t,m,s);T=e.normalize(T,T);var p=e.subtract(t,y,l),R=Math.atan2(T.y,T.x),S=Math.asin(T.z),A=i.sign(e.dot(p,t))*e.magnitude(p);return n(a)?(a.longitude=R,a.latitude=S,a.height=A,a):new u(R,S,A)}},u.clone=function(e,t){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){a=n(a,0),e.pack(t._radii,r,a)},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 d=new e,f=new e;l.prototype.cartographicToCartesian=function(t,n){var a=d,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;n>a;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var E=new e,h=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,h);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),d=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=d,a):new t(c,l,d)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;n>a;++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}),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","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(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 u(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;3>n;++n){var r=e[o.getElementIndex(E[n],f[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=i.EPSILON15,r=0,a=1,u=0;3>u;++u){var s=Math.abs(e[o.getElementIndex(E[u],f[u])]);s>r&&(a=u,r=s)}var c=1,l=0,d=f[a],h=E[a];if(Math.abs(e[o.getElementIndex(h,d)])>n){var m,_=e[o.getElementIndex(h,h)],y=e[o.getElementIndex(d,d)],T=e[o.getElementIndex(h,d)],p=(_-y)/2/T;m=0>p?-1/(-p+Math.sqrt(1+p*p)):1/(p+Math.sqrt(1+p*p)),c=1/Math.sqrt(1+m*m),l=m*c}return t=o.clone(o.IDENTITY,t),t[o.getElementIndex(d,d)]=t[o.getElementIndex(h,h)]=c,t[o.getElementIndex(h,d)]=l,t[o.getElementIndex(d,h)]=-l,t}o.packedLength=9,o.pack=function(e,n,r){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]},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},o.clone=function(e,t){return n(e)?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 o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},o.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,u=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,d=e.z*e.z,f=e.z*e.w,E=e.w*e.w,h=r-s-d+E,m=2*(a-f),_=2*(i+l),y=2*(a+f),T=-r+s-d+E,p=2*(c-u),R=2*(i-l),S=2*(c+u),A=-r-s+d+E;return n(t)?(t[0]=h,t[1]=y,t[2]=R,t[3]=m,t[4]=T,t[5]=S,t[6]=_,t[7]=p,t[8]=A,t):new o(h,m,_,y,T,p,R,S,A)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,r,-a,0,a,r)},o.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 o(r,0,a,0,1,0,-a,0,r)},o.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 o(r,-a,0,a,r,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},o.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},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;o.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 d=new e;o.getMaximumScale=function(t){return o.getScale(t,d),e.maximumComponent(d)},o.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],d=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]=d,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[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},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[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},o.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},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[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},o.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},o.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},o.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 f=[1,0,0],E=[2,2,1],h=new o,m=new o;return o.computeEigenDecomposition=function(e,t){var r=i.EPSILON20,a=10,l=0,d=0;n(t)||(t={});for(var f=t.unitary=o.clone(o.IDENTITY,t.unitary),E=t.diagonal=o.clone(e,t.diagonal),_=r*u(E);a>d&&s(E)>_;)c(E,h),o.transpose(h,m),o.multiply(E,h,E),o.multiply(m,E,E),o.multiply(f,h,f),++l>2&&(++d,l=0);return 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[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},o.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)},o.inverse=function(e,t){var n=e[0],a=e[1],u=e[2],s=e[3],c=e[4],l=e[5],d=e[6],f=e[7],E=e[8],h=o.determinant(e);if(Math.abs(h)<=i.EPSILON15)throw new r("matrix is not invertible");t[0]=c*E-f*l,t[1]=f*u-a*E,t[2]=a*l-c*u,t[3]=d*l-s*E,t[4]=n*E-d*u,t[5]=s*u-n*l,t[6]=s*f-d*c,t[7]=d*a-n*f,t[8]=n*c-s*a;var m=1/h;return o.multiplyByScalar(t,m,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=a(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=a(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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.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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a,i,o,u,s,c,l,d,f,E,h,m,_){this[0]=n(e,0),this[1]=n(i,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(h,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(d,0),this[11]=n(m,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(_,0)}c.packedLength=16,c.pack=function(e,t,r){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]},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),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},c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[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]):void 0},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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new c);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,l=t.x*t.y,d=t.x*t.z,f=t.x*t.w,E=t.y*t.y,h=t.y*t.z,m=t.y*t.w,_=t.z*t.z,y=t.z*t.w,T=t.w*t.w,p=s-E-_+T,R=2*(l-y),S=2*(d+m),A=2*(l+y),N=-s+E-_+T,I=2*(h-f),M=2*(d-m),O=2*(h+f),v=-s-E+_+T;return a[0]=p*i,a[1]=A*i,a[2]=M*i,a[3]=0,a[4]=R*o,a[5]=N*o,a[6]=O*o,a[7]=0,a[8]=S*u,a[9]=I*u,a[10]=v*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.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 l=new e,d=new e,f=new e;c.fromCamera=function(t,n){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,d),d),e.normalize(e.cross(d,l,f),f);var u=d.x,s=d.y,E=d.z,h=l.x,m=l.y,_=l.z,y=f.x,T=f.y,p=f.z,R=a.x,S=a.y,A=a.z,N=u*-R+s*-S+E*-A,I=y*-R+T*-S+p*-A,M=h*R+m*S+_*A;return r(n)?(n[0]=u,n[1]=y,n[2]=-h,n[3]=0,n[4]=s,n[5]=T,n[6]=-m,n[7]=0,n[8]=E,n[9]=p,n[10]=-_,n[11]=0,n[12]=N,n[13]=I,n[14]=M,n[15]=1,n):new c(u,s,E,N,y,T,p,I,-h,-m,-_,M,0,0,0,1)},c.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},c.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,d=-(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]=d,o[14]=f,o[15]=1,o},c.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),d=-(i+a)/(i-a),f=-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]=d,o[11]=f,o[12]=0,o[13]=0,o[14]=E,o[15]=0,o},c.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,d=-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]=d,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},c.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,d=.5*(r-t),f=c,E=l,h=d,m=i+c,_=o+l,y=t+d,T=1;return a[0]=f,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]=h,a[11]=0,a[12]=m,a[13]=_,a[14]=y,a[15]=T,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,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},c.setColumn=function(e,t,n,r){r=c.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},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],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},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 E=new e;c.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 h=new e;c.getMaximumScale=function(t){return c.getScale(t,h),e.maximumComponent(h)},c.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],d=e[8],f=e[9],E=e[10],h=e[11],m=e[12],_=e[13],y=e[14],T=e[15],p=t[0],R=t[1],S=t[2],A=t[3],N=t[4],I=t[5],M=t[6],O=t[7],v=t[8],w=t[9],g=t[10],x=t[11],C=t[12],P=t[13],U=t[14],D=t[15],F=r*p+u*R+d*S+m*A,L=a*p+s*R+f*S+_*A,B=i*p+c*R+E*S+y*A,z=o*p+l*R+h*S+T*A,b=r*N+u*I+d*M+m*O,q=a*N+s*I+f*M+_*O,G=i*N+c*I+E*M+y*O,W=o*N+l*I+h*M+T*O,X=r*v+u*w+d*g+m*x,H=a*v+s*w+f*g+_*x,V=i*v+c*w+E*g+y*x,Y=o*v+l*w+h*g+T*x,k=r*C+u*P+d*U+m*D,Z=a*C+s*P+f*U+_*D,j=i*C+c*P+E*U+y*D,K=o*C+l*P+h*U+T*D;return n[0]=F,n[1]=L,n[2]=B,n[3]=z,n[4]=b,n[5]=q,n[6]=G,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},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],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],d=e[10],f=e[12],E=e[13],h=e[14],m=t[0],_=t[1],y=t[2],T=t[4],p=t[5],R=t[6],S=t[8],A=t[9],N=t[10],I=t[12],M=t[13],O=t[14],v=r*m+o*_+c*y,w=a*m+u*_+l*y,g=i*m+s*_+d*y,x=r*T+o*p+c*R,C=a*T+u*p+l*R,P=i*T+s*p+d*R,U=r*S+o*A+c*N,D=a*S+u*A+l*N,F=i*S+s*A+d*N,L=r*I+o*M+c*O+f,B=a*I+u*M+l*O+E,z=i*I+s*M+d*O+h;return n[0]=v,n[1]=w,n[2]=g,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=F,n[11]=0,n[12]=L,n[13]=B,n[14]=z,n[15]=1,n},c.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],d=e[10],f=t[0],E=t[1],h=t[2],m=t[3],_=t[4],y=t[5],T=t[6],p=t[7],R=t[8],S=r*f+o*E+c*h,A=a*f+u*E+l*h,N=i*f+s*E+d*h,I=r*m+o*_+c*y,M=a*m+u*_+l*y,O=i*m+s*_+d*y,v=r*T+o*p+c*R,w=a*T+u*p+l*R,g=i*T+s*p+d*R;return n[0]=S,n[1]=A,n[2]=N,n[3]=0,n[4]=I,n[5]=M,n[6]=O,n[7]=0,n[8]=v,n[9]=w,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,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;c.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,c.multiplyByScale(e,m,n)},c.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?c.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)},c.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},c.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},c.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},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],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},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 _=new u,y=new u,T=new t,p=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,_),y,o.EPSILON7)&&t.equals(c.getRow(e,3,T),p))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],l=e[12],d=e[1],f=e[5],E=e[9],h=e[13],m=e[2],R=e[6],S=e[10],A=e[14],N=e[3],I=e[7],M=e[11],O=e[15],v=S*O,w=A*M,g=R*O,x=A*I,C=R*M,P=S*I,U=m*O,D=A*N,F=m*M,L=S*N,B=m*I,z=R*N,b=v*f+x*E+C*h-(w*f+g*E+P*h),q=w*d+U*E+L*h-(v*d+D*E+F*h),G=g*d+D*f+B*h-(x*d+U*f+z*h),W=P*d+F*f+z*E-(C*d+L*f+B*E),X=w*a+g*i+P*l-(v*a+x*i+C*l),H=v*r+D*i+F*l-(w*r+U*i+L*l),V=x*r+U*a+z*l-(g*r+D*a+B*l),Y=C*r+L*a+B*i-(P*r+F*a+z*i);v=i*h,w=l*E,g=a*h,x=l*f,C=a*E,P=i*f,U=r*h,D=l*d,F=r*E,L=i*d,B=r*f,z=a*d;var k=v*I+x*M+C*O-(w*I+g*M+P*O),Z=w*N+U*M+L*O-(v*N+D*M+F*O),j=g*N+D*I+B*O-(x*N+U*I+z*O),K=P*N+F*I+z*M-(C*N+L*I+B*M),J=g*S+P*A+w*R-(C*A+v*R+x*S),Q=F*A+v*m+D*S-(U*S+L*A+w*m),$=U*R+z*A+x*m-(B*A+g*m+D*R),ee=B*S+C*m+L*R-(F*R+z*S+P*m),te=r*b+a*q+i*G+l*W;if(Math.abs(te)<o.EPSILON20)throw new s("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]=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},c.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],d=e[12],f=e[13],E=e[14],h=-n*d-r*f-a*E,m=-i*d-o*f-u*E,_=-s*d-c*f-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]=h,t[13]=m,t[14]=_,t[15]=1,t},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,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/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/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){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},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 n>t&&(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,d=0,f=e.length;f>d;d++){var E=e[d];r=Math.min(r,E.longitude),a=Math.max(a,E.longitude),c=Math.min(c,E.latitude),l=Math.max(l,E.latitude);var h=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;i=Math.min(i,h),o=Math.max(o,h)}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.clone=function(e,t){return n(e)?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):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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;i>a&&(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;i>a&&o>0?a+=u.TWO_PI:c>o&&a>0&&(o+=u.TWO_PI),i>a&&0>c?c+=u.TWO_PI:c>o&&0>i&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),d=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&l>=d)){var f=Math.max(e.south,t.south),E=Math.min(e.north,t.north);if(!(f>=E))return n(r)?(r.west=l,r.south=f,r.east=d,r.north=E,r):new s(l,f,d,E)}},s.union=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.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,a=e.west,i=e.east;return a>i&&(i+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(i>n||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,d=e.north,f=e.south,E=e.east,h=e.west,m=c;m.height=a,m.longitude=h,m.latitude=d,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.latitude=f,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=r.cartographicToCartesian(m,o[l]),l++,0>d?m.latitude=d:f>0?m.latitude=f: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=h,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","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,d,f){"use strict";function E(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,m=new e,_=new e,y=new e,T=new e,p=new e,R=new e,S=new e,A=new e,N=new e,I=new e,M=new e;E.fromPoints=function(t,n){if(r(n)||(n=new E),!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],R),i=e.clone(a,h),o=e.clone(a,m),u=e.clone(a,_),s=e.clone(a,y),c=e.clone(a,T),l=e.clone(a,p),d=t.length,f=1;d>f;f++){e.clone(t[f],a);var O=a.x,v=a.y,w=a.z;O<i.x&&e.clone(a,i),O>s.x&&e.clone(a,s),v<o.y&&e.clone(a,o),v>c.y&&e.clone(a,c),w<u.z&&e.clone(a,u),w>l.z&&e.clone(a,l)}var g=e.magnitudeSquared(e.subtract(s,i,S)),x=e.magnitudeSquared(e.subtract(c,o,S)),C=e.magnitudeSquared(e.subtract(l,u,S)),P=i,U=s,D=g;x>D&&(D=x,P=o,U=c),C>D&&(D=C,P=u,U=l);var F=A;F.x=.5*(P.x+U.x),F.y=.5*(P.y+U.y),F.z=.5*(P.z+U.z);var L=e.magnitudeSquared(e.subtract(U,F,S)),B=Math.sqrt(L),z=N;z.x=i.x,z.y=o.y,z.z=u.z;var b=I;b.x=s.x,b.y=c.y,b.z=l.z;var q=e.multiplyByScalar(e.add(z,b,S),.5,M),G=0;for(f=0;d>f;f++){e.clone(t[f],a);var W=e.magnitude(e.subtract(a,q,S));W>G&&(G=W);var X=e.magnitudeSquared(e.subtract(a,F,S));if(X>L){var H=Math.sqrt(X);B=.5*(B+H),L=B*B;var V=H-B;F.x=(B*F.x+V*a.x)/H,F.y=(B*F.y+V*a.y)/H,F.z=(B*F.z+V*a.z)/H}}return G>B?(e.clone(F,n.center),n.radius=B):(e.clone(q,n.center),n.radius=G),n};var O=new o,v=new e,w=new e,g=new t,x=new t;E.fromRectangle2D=function(e,t,n){return E.fromRectangleWithHeights2D(e,t,0,0,n)},E.fromRectangleWithHeights2D=function(t,a,i,o,u){if(r(u)||(u=new E),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=n(a,O),f.southwest(t,g),g.height=i,f.northeast(t,x),x.height=o;var s=a.project(g,v),c=a.project(x,w),l=c.x-s.x,d=c.y-s.y,h=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+h*h);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*d,m.z=s.z+.5*h,u};var C=[];E.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,C)),E.fromPoints(u,o)},E.fromVertices=function(t,a,i,o){if(r(o)||(o=new E),!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=R;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,m),l=e.clone(u,_),d=e.clone(u,y),f=e.clone(u,T),O=e.clone(u,p),v=t.length,w=0;v>w;w+=i){var g=t[w]+a.x,x=t[w+1]+a.y,C=t[w+2]+a.z;u.x=g,u.y=x,u.z=C,g<s.x&&e.clone(u,s),g>d.x&&e.clone(u,d),x<c.y&&e.clone(u,c),x>f.y&&e.clone(u,f),C<l.z&&e.clone(u,l),C>O.z&&e.clone(u,O)}var P=e.magnitudeSquared(e.subtract(d,s,S)),U=e.magnitudeSquared(e.subtract(f,c,S)),D=e.magnitudeSquared(e.subtract(O,l,S)),F=s,L=d,B=P;U>B&&(B=U,F=c,L=f),D>B&&(B=D,F=l,L=O);var z=A;z.x=.5*(F.x+L.x),z.y=.5*(F.y+L.y),z.z=.5*(F.z+L.z);var b=e.magnitudeSquared(e.subtract(L,z,S)),q=Math.sqrt(b),G=N;G.x=s.x,G.y=c.y,G.z=l.z;var W=I;W.x=d.x,W.y=f.y,W.z=O.z;var X=e.multiplyByScalar(e.add(G,W,S),.5,M),H=0;for(w=0;v>w;w+=i){u.x=t[w]+a.x,u.y=t[w+1]+a.y,u.z=t[w+2]+a.z;var V=e.magnitude(e.subtract(u,X,S));V>H&&(H=V);var Y=e.magnitudeSquared(e.subtract(u,z,S));if(Y>b){var k=Math.sqrt(Y);q=.5*(q+k),b=q*q;var Z=k-q;z.x=(q*z.x+Z*u.x)/k,z.y=(q*z.y+Z*u.y)/k,z.z=(q*z.z+Z*u.z)/k}}return H>q?(e.clone(z,o.center),o.radius=q):(e.clone(X,o.center),o.radius=H),o},E.fromEncodedCartesianVertices=function(t,n,a){if(r(a)||(a=new E),!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=R;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,m),s=e.clone(i,_),c=e.clone(i,y),l=e.clone(i,T),d=e.clone(i,p),f=t.length,O=0;f>O;O+=3){var v=t[O]+n[O],w=t[O+1]+n[O+1],g=t[O+2]+n[O+2];i.x=v,i.y=w,i.z=g,v<o.x&&e.clone(i,o),v>c.x&&e.clone(i,c),w<u.y&&e.clone(i,u),w>l.y&&e.clone(i,l),g<s.z&&e.clone(i,s),g>d.z&&e.clone(i,d)}var x=e.magnitudeSquared(e.subtract(c,o,S)),C=e.magnitudeSquared(e.subtract(l,u,S)),P=e.magnitudeSquared(e.subtract(d,s,S)),U=o,D=c,F=x;C>F&&(F=C,U=u,D=l),P>F&&(F=P,U=s,D=d);var L=A;L.x=.5*(U.x+D.x),L.y=.5*(U.y+D.y),L.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,L,S)),z=Math.sqrt(B),b=N;b.x=o.x,b.y=u.y,b.z=s.z;var q=I;q.x=c.x,q.y=l.y,q.z=d.z;var G=e.multiplyByScalar(e.add(b,q,S),.5,M),W=0;for(O=0;f>O;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,S));X>W&&(W=X);var H=e.magnitudeSquared(e.subtract(i,L,S));if(H>B){var V=Math.sqrt(H);z=.5*(z+V),B=z*z;var Y=V-z;L.x=(z*L.x+Y*i.x)/V,L.y=(z*L.y+Y*i.y)/V,L.z=(z*L.z+Y*i.z)/V}}return W>z?(e.clone(L,a.center),a.radius=z):(e.clone(G,a.center),a.radius=W),a},E.fromCornerPoints=function(t,n,a){r(a)||(a=new E);var i=a.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,n),a},E.fromEllipsoid=function(t,n){return r(n)||(n=new E),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var P=new e;E.fromBoundingSpheres=function(t,n){if(r(n)||(n=new E),!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 E.clone(t[0],n);if(2===a)return E.union(t[0],t[1],n);for(var i=[],o=0;a>o;o++)i.push(t[o].center);n=E.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;a>o;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return n.radius=s,n};var U=new e,D=new e,F=new e;E.fromOrientedBoundingBox=function(t,n){r(n)||(n=new E);var a=t.halfAxes,i=c.getColumn(a,0,U),o=c.getColumn(a,1,D),u=c.getColumn(a,2,F),s=e.magnitude(i),l=e.magnitude(o),d=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,d),n},E.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new E(t.center,t.radius):void 0},E.packedLength=4,E.pack=function(e,t,r){r=n(r,0);var a=e.center;t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius},E.unpack=function(e,t,a){t=n(t,0),r(a)||(a=new E);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;E.union=function(t,n,a){r(a)||(a=new E);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 d=.5*(o+l+s),f=e.multiplyByScalar(c,(-o+d)/l,B);return e.add(f,i,f),e.clone(f,a.center),a.radius=d,a};var z=new e;E.expand=function(t,n,r){r=E.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,z));return a>r.radius&&(r.radius=a),r},E.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return-a>o?u.OUTSIDE:a>o?u.INTERSECTING:u.INSIDE},E.transform=function(e,t,n){return r(n)||(n=new E),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var b=new e;E.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,b);return e.magnitudeSquared(r)-t.radius*t.radius},E.transformWithoutScale=function(e,t,n){return r(n)||(n=new E),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var q=new e;E.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,q),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,W=new e,X=new e,H=new e,V=new e,Y=new t,k=new Array(8),Z=0;8>Z;++Z)k[Z]=new e;var j=new o;return E.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,W);e.normalize(c,c);var l=e.cross(s,c,X);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var d=e.negate(l,V),f=e.negate(c,H),h=k,m=h[0];e.add(s,l,m),e.add(m,c,m),m=h[1],e.add(s,l,m),e.add(m,f,m),m=h[2],e.add(s,d,m),e.add(m,f,m),m=h[3],e.add(s,d,m),e.add(m,c,m),e.negate(s,s),m=h[4],e.add(s,l,m),e.add(m,c,m),m=h[5],e.add(s,l,m),e.add(m,f,m),m=h[6],e.add(s,d,m),e.add(m,f,m),m=h[7],e.add(s,d,m),e.add(m,c,m);for(var _=h.length,y=0;_>y;++y){var T=h[y];e.add(o,T,T);var p=i.cartesianToCartographic(T,Y);r.project(p,T)}a=E.fromPoints(h,a),o=a.center;var R=o.x,S=o.y,A=o.z;return o.x=A,o.y=R,o.z=S,a},E.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},E.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},E.prototype.intersectPlane=function(e){return E.intersectPlane(this,e)},E.prototype.distanceSquaredTo=function(e){return E.distanceSquaredTo(this,e)},E.prototype.computePlaneDistances=function(e,t,n){return E.computePlaneDistances(this,e,t,n)},E.prototype.isOccluded=function(e){return E.isOccluded(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.prototype.clone=function(e){return E.clone(this,e)},E}),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,h),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,d=Math.sqrt(i-1)*l;return 1/(s*l-c*d)}function c(e,n,r){return 0>=n||n===1/0||n!==n?void 0:t.multiplyByScalar(e,n,r)}function l(e,n){return 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 d=new t;u.prototype.isPointVisible=function(e){var t=this._ellipsoid,n=t.transformPositionToScaledSpace(e,d);return this.isScaledSpacePointVisible(n)},u.prototype.isScaledSpacePointVisible=function(e){var n=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,a=t.subtract(e,n,d),i=-t.dot(a,n),o=0>r?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,d=0,f=n.length;f>d;++d){var E=n[d],h=s(i,E,o);u=Math.max(u,h)}return c(o,u,a)};var f=new t;u.prototype.computeHorizonCullingPointFromVertices=function(e,a,i,o,u){r(u)||(u=new t),o=n(o,t.ZERO);for(var d=this._ellipsoid,E=l(d,e),h=0,m=0,_=a.length;_>m;m+=i){f.x=a[m]+o.x,f.y=a[m+1]+o.y,f.z=a[m+2]+o.z;var y=s(d,f,E);h=Math.max(h,y)}return c(E,h,u)},u.prototype.computeHorizonCullingPointFromPoints=function(e,n,a){r(a)||(a=new t);for(var i=this._ellipsoid,o=l(i,e),u=0,d=0,f=n.length;f>d;++d){var E=s(i,n[d],o);u=Math.max(u,E)}return c(o,u,a)};var E=[];u.prototype.computeHorizonCullingPointFromRectangle=function(n,r,a){var i=o.subsample(n,r,0,E),u=e.fromPoints(i);return t.magnitude(u.center)<.1*r.minimumRadius?void 0:this.computeHorizonCullingPoint(u.center,i,a)};var h=new t,m=new t,_=new t;return u}),define("Renderer/WebGLConstants",["../Core/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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,r){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,r):new Uint16Array(t,n,r)},r(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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,0>i?[i,0]:[0,i];var c=r*r,l=4*e*a,d=n(c,-l,t.EPSILON14);if(0>d)return[];var f=-.5*n(r,t.sign(r)*Math.sqrt(d),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,d=u*c,f=u*u,E=s*s,h=o*s-f,m=o*c-u*s,_=u*c-E,y=4*h*_-m*m;if(0>y){var T,p,R;f*d>=l*E?(T=o,p=h,R=-2*u*h+o*m):(T=c,p=_,R=-c*m+2*s*_);var S=0>R?-1:1,A=-S*Math.abs(T)*Math.sqrt(-y);i=-R+A;var N=i/2,I=0>N?-Math.pow(-N,1/3):Math.pow(N,1/3),M=i===A?-I:-p/I;return a=0>=p?I+M:-R/(I*I+M*M+p),f*d>=l*E?[(a-u)/o]:[-c/(a+s)]}var O=h,v=-2*u*h+o*m,w=_,g=-c*m+2*s*_,x=Math.sqrt(y),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-v)/3);a=2*Math.sqrt(-O);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),F=i+D>2*u?i-u:D-u,L=o,B=F/L;P=Math.abs(Math.atan2(c*x,-g)/3),a=2*Math.sqrt(-w),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var z=-c,b=2*s>i+D?i+s:D+s,q=z/b,G=L*b,W=-F*b-L*z,X=F*z,H=(s*W-u*X)/(-u*W+s*G);return H>=B?q>=B?q>=H?[B,H,q]:[B,q,H]:[q,B,H]:q>=B?[H,B,q]:q>=H?[H,q,B]:[q,H,B]}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=0>u?-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,0>u?[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,d=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(d.length>0){var f=-t/4,E=d[d.length-1];if(Math.abs(E)<n.EPSILON14){var h=r.computeRealRoots(1,s,l);if(2===h.length){var m,_=h[0],y=h[1];if(_>=0&&y>=0){var T=Math.sqrt(_),p=Math.sqrt(y);return[f-p,f-T,f+T,f+p]}if(_>=0&&0>y)return m=Math.sqrt(_),[f-m,f+m];if(0>_&&y>=0)return m=Math.sqrt(y),[f-m,f+m]}return[]}if(E>0){var R=Math.sqrt(E),S=(s+E-c/R)/2,A=(s+E+c/R)/2,N=r.computeRealRoots(1,R,S),I=r.computeRealRoots(1,-R,A);return 0!==N.length?(N[0]+=f,N[1]+=f,0!==I.length?(I[0]+=f,I[1]+=f,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]+=f,I[1]+=f,I):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,d=i*t+s-4*o,f=c*o-i*a*t+u,E=e.computeRealRoots(1,l,d,f);if(E.length>0){var h,m,_=E[0],y=a-_,T=y*y,p=t/2,R=y/2,S=T-4*o,A=T+4*Math.abs(o),N=c-4*_,I=c+4*Math.abs(_);if(0>_||N*A>S*I){var M=Math.sqrt(N);h=M/2,m=0===M?0:(t*R-i)/M}else{var O=Math.sqrt(S);h=0===O?0:(t*R-i)/O,m=O/2}var v,w;0===p&&0===h?(v=0,w=0):n.sign(p)===n.sign(h)?(v=p+h,w=_/v):(w=p-h,v=_/w);var g,x;0===R&&0===m?(g=0,x=0):n.sign(R)===n.sign(m)?(g=R+m,x=o/g):(x=R-m,g=o/x);var C=r.computeRealRoots(1,v,g),P=r.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,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,d=r*r,f=d*r,E=a*a,h=E*a,m=u*c*d-4*s*f-4*e*l*d+18*e*t*n*f-27*i*d*d+256*o*h+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*d+144*i*n*d)+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,d=u/t,f=s/t,E=0>c?1:0;switch(E+=0>l?E+1:E,E+=0>d?E+1:E,E+=0>f?E+1:E){case 0:return a(c,l,d,f);case 1:return i(c,l,d,f);case 2:return i(c,l,d,f);case 3:return a(c,l,d,f);case 4:return a(c,l,d,f);case 5:return i(c,l,d,f);case 6:return a(c,l,d,f);case 7:return a(c,l,d,f);case 8:return i(c,l,d,f);case 9:return a(c,l,d,f);case 10:return a(c,l,d,f);case 11:return i(c,l,d,f);case 12:return a(c,l,d,f);case 13:return a(c,l,d,f);case 14:return a(c,l,d,f);case 15:return a(c,l,d,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","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(t,r,a,o,u){u=n(u,!1);var s,c,l,d,f,E=t.origin,h=t.direction,m=e.subtract(a,r,_),S=e.subtract(o,r,y),A=e.cross(h,S,T),N=e.dot(m,A);if(u){if(N<i.EPSILON6)return;if(s=e.subtract(E,r,p),l=e.dot(s,A),0>l||l>N)return;if(c=e.cross(s,m,R),d=e.dot(h,c),0>d||l+d>N)return;f=e.dot(S,c)/N}else{if(Math.abs(N)<i.EPSILON6)return;var I=1/N;if(s=e.subtract(E,r,p),l=e.dot(s,A)*I,0>l||l>1)return;if(c=e.cross(s,m,R),d=e.dot(h,c)*I,0>d||l+d>1)return;f=e.dot(S,c)*I}return f}function d(e,t,n,r){var a=t*t-4*e*n;if(!(0>a)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(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,T),l=e.dot(o,o),f=2*e.dot(o,c),E=e.magnitudeSquared(c)-s,h=d(l,f,E,A);return r(h)?(a.start=h.root0,a.stop=h.root1,a):void 0}function E(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,d=a*a,f=c*c,h=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*f,m=c*(a*E(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),_=t[o.COLUMN0ROW0]*d+t[o.COLUMN2ROW2]*f+a*n.x+r,y=f*E(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),T=c*(a*E(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),p=[];if(0===T&&0===y){if(l=u.computeRealRoots(h,m,_),0===l.length)return p;var R=l[0],S=Math.sqrt(Math.max(1-R*R,0));if(p.push(new e(a,c*R,c*-S)),p.push(new e(a,c*R,c*S)),2===l.length){var A=l[1],N=Math.sqrt(Math.max(1-A*A,0));p.push(new e(a,c*A,c*-N)),p.push(new e(a,c*A,c*N))}return p}var I=T*T,M=y*y,O=h*h,v=T*y,w=O+M,g=2*(m*h+v),x=2*_*h+m*m-M+I,C=2*(_*m-v),P=_*_-I;if(0===w&&0===g&&0===x&&0===C)return p;l=s.computeRealRoots(w,g,x,C,P);var U=l.length;if(0===U)return p;for(var D=0;U>D;++D){var F,L=l[D],B=L*L,z=Math.max(1-B,0),b=Math.sqrt(z);F=i.sign(h)===i.sign(_)?E(h*B+_,m*L,i.EPSILON12):i.sign(_)===i.sign(m*L)?E(h*B,m*L+_,i.EPSILON12):E(h*B+m*L,_,i.EPSILON12);var q=E(y*L,T,i.EPSILON15),G=F*q;0>G?p.push(new e(a,c*L,c*b)):G>0?p.push(new e(a,c*L,c*-b)):0!==b?(p.push(new e(a,c*L,c*-b)),p.push(new e(a,c*L,c*b)),++D):p.push(new e(a,c*L,c*b))}return p}var m={};m.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(!(0>l))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var _=new e,y=new e,T=new e,p=new e,R=new e;m.rayTriangle=function(t,n,a,i,o,u){var s=l(t,n,a,i,o);if(r(s)&&!(0>s))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var S=new c;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=S;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var d=l(c,a,i,o,u);return!r(d)||0>d||d>e.distance(t,n)?void 0:(r(s)||(s=new e),e.multiplyByScalar(c.direction,d,s),e.add(c.origin,s,s))};var A={root0:0,root1:0};m.raySphere=function(e,t,n){return n=f(e,t,n),!r(n)||n.stop<0?void 0:(n.start=Math.max(n.start,0),n)};var N=new c;m.lineSegmentSphere=function(t,n,a,i){var o=N,u=e.subtract(n,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=f(o,a,i),!r(i)||i.stop<0||i.start>s?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i)};var I=new e,M=new e;m.rayEllipsoid=function(t,n){var r,a,i,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,I),l=e.multiplyComponents(s,t.direction,M),d=e.magnitudeSquared(c),f=e.dot(c,l);if(d>1){if(f>=0)return;var E=f*f;if(r=d-1,a=e.magnitudeSquared(l),i=a*r,i>E)return;if(E>i){o=f*f-i,u=-f+Math.sqrt(o);var h=u/a,m=r/u;return m>h?{start:h,stop:m}:{start:m,stop:h}}var _=Math.sqrt(r/a);return{start:_,stop:_}}return 1>d?(r=d-1,a=e.magnitudeSquared(l),i=a*r,o=f*f-i,u=-f+Math.sqrt(o),{start:0,stop:u/a}):0>f?(a=e.magnitudeSquared(l),{start:0,stop:-f/a}):void 0};var O=new e,v=new e,w=new e,g=new e,x=new e,C=new o,P=new o,U=new o,D=new o,F=new o,L=new o,B=new o,z=new e,b=new e,q=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction,s=n.geodeticSurfaceNormal(a,O);if(e.dot(u,s)>=0)return a;var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u,O),d=e.normalize(l,l),f=e.mostOrthogonalAxis(l,g),E=e.normalize(e.cross(f,d,v),v),m=e.normalize(e.cross(d,E,w),w),_=C;_[0]=d.x,_[1]=d.y,_[2]=d.z,_[3]=E.x,_[4]=E.y,_[5]=E.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var y=o.transpose(_,P),T=o.fromScale(n.radii,U),p=o.fromScale(n.oneOverRadii,D),R=F;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 S,A,N=o.multiply(o.multiply(y,p,L),R,L),I=o.multiply(o.multiply(N,T,B),_,B),M=o.multiplyByVector(N,a,x),G=h(I,e.negate(M,O),0,0,1),W=G.length;if(W>0){for(var X=e.clone(e.ZERO,b),H=Number.NEGATIVE_INFINITY,V=0;W>V;++V){S=o.multiplyByVector(T,o.multiplyByVector(_,G[V],z),z);var Y=e.normalize(e.subtract(S,a,g),g),k=e.dot(Y,u);k>H&&(H=k,X=e.clone(S,X))}var Z=n.cartesianToCartographic(X,q);return H=i.clamp(H,0,1),A=e.magnitude(e.subtract(X,a,g))*Math.sqrt(1-H*H),A=c?-A:A,Z.height=A,n.cartographicToCartesian(Z,new e)}};var G=new e;return m.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),d=-(a.distance+l)/c;if(!(0>d||d>1))return e.multiplyByScalar(u,d,o),e.add(t,o,o),o}},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 d,f;if((1===l||2===l)&&(d=new e,f=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,d),m.lineSegmentPlane(t,r,a,f),{positions:[t,n,r,d,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,d),m.lineSegmentPlane(n,t,a,f),{positions:[t,n,r,d,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,d),m.lineSegmentPlane(r,n,a,f),{positions:[t,n,r,d,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,d),m.lineSegmentPlane(r,t,a,f),{positions:[t,n,r,d,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,d),m.lineSegmentPlane(t,n,a,f),{positions:[t,n,r,d,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,d),m.lineSegmentPlane(n,r,a,f),{positions:[t,n,r,d,f],indices:[0,1,4,0,4,3,2,3,4]}}},m}),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(r){return i(r)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(a){return i(a)}});return n}function o(){function e(e,t,n){return f(e,t,n)}function n(e){return h(e)}function a(e){return h(i(e))}function u(e){return E(e)}var s,c,l,d,f,E,h;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],d=[],f=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(t){r.progress(t)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),d.push(a),r.promise},E=function(e){return m(d,e),e},h=function(e){return e=t(e),f=e.then,h=t,E=y,m(l,e),d=l=S,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){h(e)}var c,l,d,f,E,h,m,_,T,p;if(T=t.length>>>0,c=Math.max(0,Math.min(n,T)),d=[],l=T-c+1,f=[],E=o(),c)for(_=E.progress,m=function(e){f.push(e),--l||(h=m=y,E.reject(f))},h=function(e){d.push(e),--c||(h=m=y,E.resolve(d))},p=0;T>p;++p)p in t&&e(t[p],s,u,_);else E.resolve(d);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),f(e,T).then(t,n,r)}function d(){return f(arguments,T)}function f(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;a>s;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)})})},p.apply(t,r)})}function h(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 T(e){return e}var p,R,S;return e.defer=o,e.resolve=t,e.reject=n,e.join=d,e.all=l,e.map=f,e.reduce=E,e.any=c,e.some=s,e.chain=h,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(S,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(S,t)})})}},R=[].slice,p=[].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(;a>i;++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;o>=i;)if(r=~~((i+o)/2),a=n(e[r],t),0>a)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,d,f){var E,h,m,_,y;if("%%"==e)return"%";for(var T=!1,p="",R=!1,S=!1,A=" ",N=s.length,I=0;s&&N>I;I++)switch(s.charAt(I)){case" ":p=" ";break;case"+":p="+";break;case"-":T=!0;break;case"'":A=s.charAt(I+1);break;case"0":R=!0;break;case"#":S=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(c=-c,T=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(d=d?"*"==d?+t[n++]:"*"==d.charAt(0)?+t[d.slice(1,-1)]:+d:"fFeE".indexOf(f)>-1?6:"d"==f?0:void 0,y=r?t[r.slice(0,-1)]:t[n++],f){case"s":return u(String(y),T,c,d,R,A);case"c":return u(String.fromCharCode(+y),T,c,d,R);case"b":return o(y,2,S,T,c,d,R);case"o":return o(y,8,S,T,c,d,R);case"x":return o(y,16,S,T,c,d,R);case"X":return o(y,16,S,T,c,d,R).toUpperCase();case"u":return o(y,10,S,T,c,d,R);case"i":case"d":return E=+y||0,E=Math.round(E-E%1),h=0>E?"-":p,y=h+a(String(Math.abs(E)),d,"0",!1),i(y,h,T,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return E=+y,h=0>E?"-":p,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(f.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(f)%2], +y=h+Math.abs(E)[m](d),i(y,h,T,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 d(e){p.julianDate=e;var n=m.leapSeconds,r=t(n,p,l);0>r&&(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 f(e,n){p.julianDate=e;var r=m.leapSeconds,a=t(r,p,l);if(0>a&&(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):1>=i?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,0>t&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function h(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,0>r&&(r+=24);var d=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return d>=43200&&(l-=1),[l,d]}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&&d(this)}var _=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],T=29,p=new u,R=/^(\d{4})$/,S=/^(\d{4})-(\d{2})$/,A=/^(\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})?$/,O=/^(\d{2})(\.\d+)?/.source+M.source,v=/^(\d{2}):?(\d{2})(\.\d+)?/.source+M.source,w=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+M.source,g="Invalid ISO 8601 date.";m.fromDate=function(e,t){var n=h(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(E(n[0],n[1],t),d(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,i,u,s=e.split("T"),l=1,f=1,_=0,p=0,M=0,x=0,C=s[0],P=s[1];if(!r(C))throw new a(g);var U;if(s=C.match(I),null!==s){if(U=C.split("-").length-1,U>0&&2!==U)throw new a(g);n=+s[1],l=+s[2],f=+s[3]}else if(s=C.match(S),null!==s)n=+s[1],l=+s[2];else if(s=C.match(R),null!==s)n=+s[1];else{var D;if(s=C.match(A),null!==s){if(n=+s[1],D=+s[2],u=o(n),1>D||u&&D>366||!u&&D>365)throw new a(g)}else{if(s=C.match(N),null===s)throw new a(g);n=+s[1];var F=+s[2],L=+s[3]||0;if(U=C.split("-").length-1,U>0&&(!r(s[3])&&1!==U||r(s[3])&&2!==U))throw new a(g);var B=new Date(Date.UTC(n,0,4));D=7*F+L-B.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(D),l=i.getUTCMonth()+1,f=i.getUTCDate()}if(u=o(n),1>l||l>12||1>f||(2!==l||!u)&&f>y[l-1]||u&&2===l&&f>T)throw new a(g);var z;if(r(P)){if(s=P.match(w),null!==s){if(U=P.split(":").length-1,U>0&&2!==U&&3!==U)throw new a(g);_=+s[1],p=+s[2],M=+s[3],x=1e3*+(s[4]||0),z=5}else if(s=P.match(v),null!==s){if(U=P.split(":").length-1,U>2)throw new a(g);_=+s[1],p=+s[2],M=60*+(s[3]||0),z=4}else{if(s=P.match(O),null===s)throw new a(g);_=+s[1],p=60*+(s[2]||0),z=3}if(p>=60||M>=61||_>24||24===_&&(p>0||M>0||x>0))throw new a(g);var b=s[z],q=+s[z+1],G=+(s[z+2]||0);switch(b){case"+":_-=q,p-=G;break;case"-":_+=q,p+=G;break;case"Z":break;default:p+=new Date(Date.UTC(n,l-1,f,_,p)).getTimezoneOffset()}}else p+=new Date(n,l-1,f).getTimezoneOffset();var W=60===M;for(W&&M--;p>=60;)p-=60,_++;for(;_>=24;)_-=24,f++;for(i=u&&2===l?T:y[l-1];f>i;)f-=i,l++,l>12&&(l-=12,n++),i=u&&2===l?T:y[l-1];for(;0>p;)p+=60,_--;for(;0>_;)_+=24,f--;for(;1>f;)l--,1>l&&(l+=12,n--),i=u&&2===l?T:y[l-1],f+=i;var X=h(n,l,f,_,p,M,x);return r(t)?(E(X[0],X[1],t),d(t)):t=new m(X[0],X[1],c.UTC),W&&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=f(e,x);r(a)||(m.addSeconds(e,-1,x),a=f(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 d=4e3*(c+1)/1461001|0;c=c-(1461*d/4|0)+31|0;var E=80*c/2447|0,h=c-(2447*E/80|0)|0;c=E/11|0;var _=E+2-12*c|0,y=100*(l-49)+d+c|0,T=u/s.SECONDS_PER_HOUR|0,p=u-T*s.SECONDS_PER_HOUR,R=p/s.SECONDS_PER_MINUTE|0;p-=R*s.SECONDS_PER_MINUTE;var S=0|p,A=(p-S)/s.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(S+=1),r(t)?(t.year=y,t.month=_,t.day=h,t.hour=T,t.minute=R,t.second=S,t.millisecond=A,t.isLeapSecond=n,t):new i(y,_,h,T,R,S,A,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){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI):void 0},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){p.julianDate=e;var n=m.leapSeconds,r=t(n,p,l);return 0>r&&(r=~r,--r,0>r&&(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)],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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,n,r,a,i){"use strict";function o(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,u=n.headers,s=n.overrideMimeType,c=n.withCredentials;return e(n.url,function(t){var n=e.defer();return o.load(t,r,a,i,u,n,s,c),n.promise})}function u(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function s(e,t){for(var n=u(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 c(e,n){n=t(n,"");var a=e[1],i=!!e[2],o=e[3];switch(n){case"":case"text":return u(i,o);case"arraybuffer":return s(i,o);case"blob":var c=s(i,o);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(u(i,o),a);case"json":return JSON.parse(u(i,o));default:throw new r("Unhandled responseType: "+n)}}var l=/^data:(.*?)(;base64)?,(.*)$/;return o.load=function(e,t,r,o,u,s,d,f){var E=l.exec(e);if(null!==E)return void s.resolve(c(E,t));var h=new XMLHttpRequest;if(n(d)&&n(h.overrideMimeType)&&h.overrideMimeType(d),h.open(r,e,!0),n(u))for(var m in u)u.hasOwnProperty(m)&&h.setRequestHeader(m,u[m]);n(t)&&(h.responseType=t),n(f)&&(h.withCredentials=f),h.onload=function(){h.status>=200&&h.status<300?n(h.response)?s.resolve(h.response):n(h.responseXML)&&h.responseXML.hasChildNodes()?s.resolve(h.responseXML):n(h.responseText)?s.resolve(h.responseText):s.reject(new i("unknown XMLHttpRequest response type.")):s.reject(new a(h.status,h.response,h.getAllResponseHeaders()))},h.onerror=function(e){s.reject(new a)},h.send(o)},o.defaultLoad=o.load,o}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";function n(n,r){return e({url:n,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return n}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)||(a={}),t(a.headers)?t(a.headers.Accept)||(a.headers=e(a.headers),a.headers.Accept=i.Accept):a.headers=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,d){"use strict";function f(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))h(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){h(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else h(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function E(e,t){return o.compare(e.julianDate,t)}function h(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"),f=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),h=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(0>a||0>i||0>s||0>c||0>f||0>h||0>m)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=f,e._yCelestialPoleOffsetRadiansColumn=h,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var T,p=e._addNewLeapSeconds,R=0,S=_.length;S>R;R+=e._columnCount){var A=_[R+a],N=_[R+m],I=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,M=new o(I,N,d.TAI);if(y.push(M),p){if(N!==T&&r(T)){var O=o.leapSeconds,v=t(O,M,E);if(0>v){var w=new u(M,N);O.splice(~v,0,w)}}T=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 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 d=o.secondsDifference(r,c)/o.secondsDifference(l,c),f=a*s,E=i*s,h=n[f+e._ut1MinusUtcSecondsColumn],y=n[E+e._ut1MinusUtcSecondsColumn],T=y-h;if(T>.5||-.5>T){var p=n[f+e._taiMinusUtcSecondsColumn],R=n[E+e._taiMinusUtcSecondsColumn];p!==R&&(l.equals(r)?h=y:y-=R-p)}return u.xPoleWander=_(d,n[f+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(d,n[f+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(d,n[f+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(d,n[f+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(d,h,y),u}return f.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}}),f.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},f.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 d=i[u],f=i[u+1],E=o.lessThanOrEquals(d,e),h=!r(f),m=h||o.greaterThanOrEquals(f,e);if(E&&m)return s=u,!h&&f.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,0>s&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},f}),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/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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","require"],function(e,t,n,r,a){"use strict";function i(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function o(){if(t(l))return l;var a;if(a="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:i(),!t(a))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new e(r(a))}function u(e){return a.toUrl("../"+e)}function s(t){return new e(t).resolve(o()).toString()}function c(e){t(d)||(d=t(a.toUrl)?u:s),t(f)||(f=document.createElement("a"));var n=d(e);return f.href=n,f.href=f.href,f.href}var l,d,f,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=E,c.setBaseUrl=function(t){l=new e(t).resolve(new e(document.location.href))},c}),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;t>=s;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;t>=c;++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=d;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;s>u;++u)t[o+u]=r[u];i.resolve()}),i.promise}var d=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;0>u&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var d=u/this._samplesPerXysFile|0,f=s/this._samplesPerXysFile|0,E=[],h=d;f>=h;++h)E.push(l(this,h));return e.all(E)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(0>i)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);0>s&&(s=0);var d=s+u;d>=this._totalSamples&&(d=this._totalSamples-1,s=d-u,0>s&&(s=0));var f=!1,E=this._samples;if(r(E[3*s])||(l(this,s/this._samplesPerXysFile|0),f=!0),r(E[3*d])||(l(this,d/this._samplesPerXysFile|0),f=!0),!f){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var h,m,_=i-s*this._stepSizeDays,y=this._work,T=this._denominators,p=this._coef,R=this._xTable;for(h=0;u>=h;++h)y[h]=_-R[h];for(h=0;u>=h;++h){for(p[h]=1,m=0;u>=m;++m)m!==h&&(p[h]*=y[m]);p[h]*=T[h];var S=3*(s+h);n.x+=p[h]*E[S++],n.y+=p[h]*E[S++],n.s+=p[h]*E[S]}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(){return a.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?r.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(r.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",e(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;r>n;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(p)){p=!1;var e=/ Chrome\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(p=!0,R=r(e[1]))}return p}function i(){return a()&&R}function o(){if(!t(S)&&(S=!1,!a()&&/ Safari\/[\.0-9]+/.test(T.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(S=!0,A=r(e[1]))}return S}function u(){return o()&&A}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(T.userAgent);null!==e&&(N=!0,I=r(e[1]),I.isNightly=!!e[2])}return N}function c(){return s()&&I}function l(){if(!t(M)){M=!1;var e;"Microsoft Internet Explorer"===T.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(M=!0,O=r(e[1]))):"Netscape"===T.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(M=!0,O=r(e[1])))}return M}function d(){return l()&&O}function f(){if(!t(v)){v=!1;var e=/Firefox\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(v=!0,w=r(e[1]))}return v}function E(){return t(g)||(g=/Windows/i.test(T.appVersion)),g}function h(){return f()&&w}function m(){return t(x)||(x="undefined"!=typeof PointerEvent&&(!t(T.pointerEnabled)||T.pointerEnabled)),x}function _(){if(!t(P)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;P=t(n)&&""!==n,P&&(C=n)}return P}function y(){return _()?C:void 0}var T;T="undefined"!=typeof navigator?navigator:{};var p,R,S,A,N,I,M,O,v,w,g,x,C,P,U={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:d,isFirefox:f,firefoxVersion:h,isWindows:E,hardwareConcurrency:e(T.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:_,imageRenderingValue:y};return U.supportsFullscreen=function(){return n.supportsFullscreen()},U.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},U.supportsWebWorkers=function(){return"undefined"!=typeof Worker},U}),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,d=c.z*o,f=Math.cos(i);return n(a)?(a.x=u,a.y=l,a.z=d,a.w=f,a):new s(u,l,d,f)};var l=[1,2,0],d=new Array(3);s.fromRotationMatrix=function(e,t){var r,a,i,o,c,f=e[u.COLUMN0ROW0],E=e[u.COLUMN1ROW1],h=e[u.COLUMN2ROW2],m=f+E+h;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;E>f&&(y=1),h>f&&h>E&&(y=2);var T=_[y],p=_[T];r=Math.sqrt(e[u.getElementIndex(y,y)]-e[u.getElementIndex(T,T)]-e[u.getElementIndex(p,p)]+1);var R=d;R[y]=.5*r,r=.5/r,c=(e[u.getElementIndex(p,T)]-e[u.getElementIndex(T,p)])*r,R[T]=(e[u.getElementIndex(T,y)]+e[u.getElementIndex(y,T)])*r,R[p]=(e[u.getElementIndex(p,y)]+e[u.getElementIndex(y,p)])*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 f=new s;s.fromHeadingPitchRoll=function(t,n,r,a){var i=s.fromAxisAngle(e.UNIT_X,r,f),o=s.fromAxisAngle(e.UNIT_Y,-n,a);a=s.multiply(o,i,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,f);return s.multiply(u,a,a)};var E=new e,h=new e,m=new s,_=new s,y=new s;s.packedLength=4,s.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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;i>a;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,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,a,i,o){n(o)||(o=new s),e.fromArray(t,0,h);var u=e.magnitude(h);return s.unpack(r,4*i,_),0===u?s.clone(s.IDENTITY,m):s.fromAxisAngle(h,u,m),s.multiply(m,_,o)},s.clone=function(e,t){return n(e)?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):void 0},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,d=o*u+r*l+a*c-i*s,f=o*s-r*c+a*l+i*u,E=o*c+r*s-a*u+i*l,h=o*l-r*u-a*s-i*c;return n.x=d,n.y=f,n.z=E,n.w=h,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 T=new s;s.lerp=function(e,t,n,r){return T=s.multiplyByScalar(t,n,T),r=s.multiplyByScalar(e,1-n,r),s.add(T,r,r)};var p=new s,R=new s,S=new s;s.slerp=function(e,t,n,r){var a=s.dot(e,t),i=t;if(0>a&&(a=-a,i=p=s.negate(t,p)),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),S=s.multiplyByScalar(i,Math.sin(n*u),S),r=s.add(R,S,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,N=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,A);s.multiply(i,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,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,v=1.9011074535173003,w=a.supportsTypedArrays()?new Float32Array(8):[],g=a.supportsTypedArrays()?new Float32Array(8):[],x=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],P=0;7>P;++P){var U=P+1,D=2*U+1;w[P]=1/(U*D),g[P]=U/D}return w[7]=v/136,g[7]=8*v/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,d=7;d>=0;--d)x[d]=(w[d]*c-g[d])*o,C[d]=(w[d]*l-g[d])*o;var f=a*n*(1+x[0]*(1+x[1]*(1+x[2]*(1+x[3]*(1+x[4]*(1+x[5]*(1+x[6]*(1+x[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])))))))),h=s.multiplyByScalar(e,E,O);return s.multiplyByScalar(t,f,r),s.add(h,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","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,E,h,m,_,y){"use strict";var T={},p=new n,R=new n,S=new n;T.eastNorthUpToFixedFrame=function(e,t,r){if(E.equalsEpsilon(e.x,0,E.EPSILON14)&&E.equalsEpsilon(e.y,0,E.EPSILON14)){var o=E.sign(e.z);return i(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=p,s=R,l=S;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.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 m(s.x,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var A=new n,N=new n,I=new n;T.northEastDownToFixedFrame=function(e,t,r){if(E.equalsEpsilon(e.x,0,E.EPSILON14)&&E.equalsEpsilon(e.y,0,E.EPSILON14)){var o=E.sign(e.z);return i(r)?(r[0]=-o,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]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=A,s=N,l=I;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.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 m(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},T.northUpEastToFixedFrame=function(e,t,r){if(E.equalsEpsilon(e.x,0,E.EPSILON14)&&E.equalsEpsilon(e.y,0,E.EPSILON14)){var o=E.sign(e.z);return i(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=o,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(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=p,s=R,l=S;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(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 m(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 M=new _,O=new n(1,1,1),v=new m;T.headingPitchRollToFixedFrame=function(e,t,r,a,i,o){var u=_.fromHeadingPitchRoll(t,r,a,M),s=m.fromTranslationQuaternionRotationScale(n.ZERO,u,O,v);return o=T.eastNorthUpToFixedFrame(e,i,o),m.multiply(o,s,o)};var w=new m,g=new h;T.headingPitchRollQuaternion=function(e,t,n,r,a,i){var o=T.headingPitchRollToFixedFrame(e,t,n,r,a,w),u=m.getRotation(o,g);return _.fromRotationMatrix(u,i)};var x=24110.54841,C=8640184.812866,P=.093104,U=-62e-7,D=1.1772758384668e-19,F=72921158553e-15,L=E.TWO_PI/86400,B=new f;T.computeTemeToPseudoFixedMatrix=function(e,t){B=f.addSeconds(e,-f.computeTaiMinusUtc(e),B);var n,r=B.dayNumber,a=B.secondsOfDay,o=r-2451545;n=a>=43200?(o+.5)/y.DAYS_PER_JULIAN_CENTURY:(o-.5)/y.DAYS_PER_JULIAN_CENTURY;var u=x+n*(C+n*(P+n*U)),s=u*L%E.TWO_PI,c=F+D*(r-2451545.5),l=(a+.5*y.SECONDS_PER_DAY)%y.SECONDS_PER_DAY,d=s+c*l,m=Math.cos(d),_=Math.sin(d);return i(t)?(t[0]=m,t[1]=-_,t[2]=0,t[3]=_,t[4]=m,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new h(m,_,0,-_,m,0,0,0,1)},T.iau2006XysData=new l,T.earthOrientationParameters=u.NONE;var z=32.184,b=2451545;T.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+z,a=t.stop.dayNumber,i=t.stop.secondsOfDay+z,o=T.iau2006XysData.preload(n,r,a,i),u=T.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},T.computeIcrfToFixedMatrix=function(e,t){i(t)||(t=new h);var n=T.computeFixedToIcrfMatrix(e,t);if(i(n))return h.transpose(n,t)};var q=new d(0,0,0),G=new s(0,0,0,0,0,0),W=new h,X=new h;T.computeFixedToIcrfMatrix=function(e,t){i(t)||(t=new h);var n=T.earthOrientationParameters.compute(e,G);if(i(n)){var r=e.dayNumber,a=e.secondsOfDay+z,o=T.iau2006XysData.computeXysRadians(r,a,q);if(i(o)){var u=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=W;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 d=h.fromRotationZ(-o.s,X),m=h.multiply(l,d,W),_=e.dayNumber,p=e.secondsOfDay-f.computeTaiMinusUtc(e)+n.ut1MinusUtc,R=_-2451545,S=p/y.SECONDS_PER_DAY,A=.779057273264+S+.00273781191135448*(R+S);A=A%1*E.TWO_PI;var N=h.fromRotationZ(A,X),I=h.multiply(m,N,W),M=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),w=Math.sin(n.yPoleWander),g=r-b+a/y.SECONDS_PER_DAY;g/=36525;var x=-47e-6*g*E.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),U=X;return U[0]=M*C,U[1]=M*P,U[2]=v,U[3]=-O*P+w*v*C,U[4]=O*C+w*v*P,U[5]=-w*M,U[6]=-w*P-O*v*C,U[7]=w*C-O*v*P,U[8]=O*M,h.multiply(I,U,t)}}};var H=new r;T.pointToWindowCoordinates=function(e,t,n,r){return r=T.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},T.pointToGLWindowCoordinates=function(e,n,a,o){i(o)||(o=new t);var u=H;return m.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,u),u),r.multiplyByScalar(u,1/u.w,u),m.multiplyByVector(n,u,u),t.fromCartesian4(u,o)};var V=new n,Y=new n,k=new n;return T.rotationMatrixFromPositionVelocity=function(e,t,r,o){var u=a(r,c.WGS84).geodeticSurfaceNormal(e,V),s=n.cross(t,u,Y);n.equalsEpsilon(s,n.ZERO,E.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var l=n.cross(s,t,k);return n.cross(t,l,s),n.negate(s,s),i(o)||(o=new h),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=s.x,o[4]=s.y,o[5]=s.z,o[6]=l.x,o[7]=l.y,o[8]=l.z,o},T}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix3","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,E,h){"use strict";function m(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(d.getColumn(r,0,_)),this._yAxis=n.fromCartesian4(d.getColumn(r,1,_));var i=n.fromCartesian4(d.getColumn(r,2,_));this._plane=f.fromPointNormal(e,i)}var _=new r;o(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 y=new e;m.fromPoints=function(t,n){var r=e.fromPoints(t,y);return new m(r.center,n)};var T=new E,p=new n;m.prototype.projectPointOntoPlane=function(e,r){var a=T;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)}},m.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;r>a;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},m.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=T;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},m.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;n>r;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var R=new n;return m.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=R,l=0;r>l;++l){var d=e[l];n.multiplyByScalar(u,d.x,c),i(t[l])||(t[l]=new n);var f=n.add(o,c,t[l]);n.multiplyByScalar(s,d.y,c),n.add(f,c,f),a.scaleToGeocentricSurface(f,f)}return t},m}),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,d,f,E,h){"use strict";function m(e,t){this.center=n.clone(a(e,n.ZERO)),this.halfAxes=f.clone(a(t,f.ZERO))}function _(e,t,r,a,o,u,s,c){i(c)||(c=new m);var l=c.halfAxes;f.setColumn(l,0,e.xAxis,l),f.setColumn(l,1,e.yAxis,l),f.setColumn(l,2,e.zAxis,l);var d=I;d.x=(t+r)/2,d.y=(a+o)/2,d.z=(u+s)/2;var E=M;E.x=(r-t)/2,E.y=(o-a)/2,E.z=(s-u)/2;var h=c.center;return d=f.multiplyByVector(l,d,d),n.add(e.origin,d,h),f.multiplyByScale(l,E,l),c}var y=new n,T=new n,p=new n,R=new n,S=new n,A=new f,N={unitary:new f,diagonal:new f};m.fromPoints=function(e,t){if(i(t)||(t=new m),!i(e)||0===e.length)return t.halfAxes=f.ZERO,t.center=n.ZERO,t;var r,a=e.length,o=n.clone(e[0],y);for(r=1;a>r;r++)n.add(o,e[r],o);var u=1/a;n.multiplyByScalar(o,u,o);var s,c=0,l=0,d=0,E=0,h=0,_=0;for(r=0;a>r;r++)s=n.subtract(e[r],o,T),c+=s.x*s.x,l+=s.x*s.y,d+=s.x*s.z,E+=s.y*s.y,h+=s.y*s.z,_+=s.z*s.z;c*=u,l*=u,d*=u,E*=u,h*=u,_*=u;var I=A;I[0]=c,I[1]=l,I[2]=d,I[3]=l,I[4]=E,I[5]=h,I[6]=d,I[7]=h,I[8]=_;var M=f.computeEigenDecomposition(I,N),O=f.transpose(M.unitary,t.halfAxes);s=n.subtract(e[0],o,T);var v=f.multiplyByVector(O,s,p),w=n.clone(v,R),g=n.clone(v,S);for(r=1;a>r;r++)s=n.subtract(e[r],o,s),f.multiplyByVector(O,s,v),n.minimumByComponent(g,v,g),n.maximumByComponent(w,v,w);var x=n.add(g,w,p);n.multiplyByScalar(x,.5,x),f.multiplyByVector(O,x,x),n.add(o,x,t.center);var C=n.subtract(w,g,p);return n.multiplyByScalar(C,.5,C),f.multiplyByScale(t.halfAxes,C,t.halfAxes),t};var I=new n,M=new n,O=new r,v=new n,w=[new r,new r,new r,new r,new r,new r,new r,new r],g=[new n,new n,new n,new n,new n,new n,new n,new n],x=[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=h.center(e,O),c=r.cartographicToCartesian(o,v),l=new s(c,r),d=l.plane,f=w[0],m=w[1],y=w[2],T=w[3],p=w[4],R=w[5],S=w[6],A=w[7],N=o.longitude,I=e.south<0&&e.north>0?0:o.latitude;S.latitude=R.latitude=p.latitude=e.south,A.latitude=T.latitude=I,f.latitude=m.latitude=y.latitude=e.north,S.longitude=A.longitude=f.longitude=e.west,R.longitude=m.longitude=N,p.longitude=T.longitude=y.longitude=e.east,y.height=m.height=f.height=A.height=S.height=R.height=p.height=T.height=n,r.cartographicArrayToCartesianArray(w,g),l.projectPointsToNearestOnPlane(g,x);var M=Math.min(x[6].x,x[7].x,x[0].x),C=Math.max(x[2].x,x[3].x,x[4].x),P=Math.min(x[4].y,x[5].y,x[6].y),U=Math.max(x[0].y,x[1].y,x[2].y);y.height=f.height=p.height=S.height=t,r.cartographicArrayToCartesianArray(w,g);var D=Math.min(E.getPointDistance(d,g[0]),E.getPointDistance(d,g[2]),E.getPointDistance(d,g[4]),E.getPointDistance(d,g[6])),F=n;return _(l,M,C,P,U,D,F,i)},m.clone=function(e,t){return i(e)?i(t)?(n.clone(e.center,t.center),f.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes):void 0},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[f.COLUMN0ROW0]+u*i[f.COLUMN0ROW1]+s*i[f.COLUMN0ROW2])+Math.abs(o*i[f.COLUMN1ROW0]+u*i[f.COLUMN1ROW1]+s*i[f.COLUMN1ROW2])+Math.abs(o*i[f.COLUMN2ROW0]+u*i[f.COLUMN2ROW1]+s*i[f.COLUMN2ROW2]),d=n.dot(a,r)+t.distance;return-l>=d?c.OUTSIDE:d>=l?c.INSIDE:c.INTERSECTING};var C=new n,P=new n,U=new n,D=new n;m.distanceSquaredTo=function(e,t){var r=n.subtract(t,e.center,I),a=e.halfAxes,i=f.getColumn(a,0,C),o=f.getColumn(a,1,P),u=f.getColumn(a,2,U),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 d=D;d.x=n.dot(r,i),d.y=n.dot(r,o),d.z=n.dot(r,u);var E,h=0;return d.x<-s?(E=d.x+s,h+=E*E):d.x>s&&(E=d.x-s,h+=E*E),d.y<-c?(E=d.y+c,h+=E*E):d.y>c&&(E=d.y-c,h+=E*E),d.z<-l?(E=d.z+l,h+=E*E):d.z>l&&(E=d.z-l,h+=E*E),h};var F=new n,L=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,d=f.getColumn(c,0,C),E=f.getColumn(c,1,P),h=f.getColumn(c,2,U),m=n.add(d,E,F);n.add(m,h,m),n.add(m,s,m);var _=n.subtract(m,t,L),y=n.dot(r,_);return o=Math.min(y,o),u=Math.max(y,u),n.add(s,d,m),n.add(m,E,m),n.subtract(m,h,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.add(s,d,m),n.subtract(m,E,m),n.add(m,h,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.add(s,d,m),n.subtract(m,E,m),n.subtract(m,h,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.subtract(s,d,m),n.add(m,E,m),n.add(m,h,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.subtract(s,d,m),n.add(m,E,m),n.subtract(m,h,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.subtract(s,d,m),n.subtract(m,E,m),n.add(m,h,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.subtract(s,d,m),n.subtract(m,E,m),n.subtract(m,h,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)&&f.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",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,a,i){"use strict";if(!a.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return n(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,n,a,i){switch(a=t(a,0),i=t(i,(n.byteLength-a)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,a,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,a,i);case o.SHORT:return new Int16Array(n,a,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,a,i);case o.FLOAT:return new Float32Array(n,a,i);case o.DOUBLE:return new Float64Array(n,a,i);default:throw new r("componentDatatype is not a valid value.")}},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","./defined","./Math","./Matrix3","./Matrix4","./TerrainQuantization"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,i,o){var c,f,_,y;if(a(e)&&a(t)&&a(r)&&a(i)){var T=e.minimum,p=e.maximum,R=n.subtract(p,T,d),S=r-t,A=Math.max(n.maximumComponent(R),S);c=m-1>A?s.BITS12:s.NONE,f=e.center,_=u.inverseTransformation(i,new u);var N=n.negate(T,l);u.multiply(u.fromTranslation(N,E),_,_);var I=l;I.x=1/R.x,I.y=1/R.y,I.z=1/R.z,u.multiply(u.fromScale(I,E),_,_),y=u.clone(i),u.setTranslation(y,n.ZERO,y),i=u.clone(i,new u);var M=u.fromTranslation(T,E),O=u.fromScale(R,h),v=u.multiply(M,O,E);u.multiply(i,v,i),u.multiply(y,v,y)}this.quantization=c,this.minimumHeight=t,this.maximumHeight=r,this.center=f,this.toScaledENU=_,this.fromScaledENU=i,this.matrix=y,this.hasVertexNormals=o}var l=new n,d=new n,f=new t,E=new u,h=new u,m=Math.pow(2,12);c.prototype.encode=function(r,a,o,c,d,E){var h=c.x,m=c.y;if(this.quantization===s.BITS12){o=u.multiplyByPoint(this.toScaledENU,o,l),o.x=i.clamp(o.x,0,1),o.y=i.clamp(o.y,0,1),o.z=i.clamp(o.z,0,1);var _=this.maximumHeight-this.minimumHeight,y=i.clamp((d-this.minimumHeight)/_,0,1);t.fromElements(o.x,o.y,f);var T=e.compressTextureCoordinates(f);t.fromElements(o.z,y,f);var p=e.compressTextureCoordinates(f);t.fromElements(h,m,f);var R=e.compressTextureCoordinates(f);r[a++]=T,r[a++]=p,r[a++]=R}else n.subtract(o,this.center,l),r[a++]=l.x,r[a++]=l.y,r[a++]=l.z,r[a++]=d,r[a++]=h,r[a++]=m;return this.hasVertexNormals&&(r[a++]=e.octPackFloat(E)),a},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],f);i.x=o.x,i.y=o.y;var c=e.decompressTextureCoordinates(t[r+1],f);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],f);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.hasVertexNormals&&++e,e};var _={position3DAndHeight:0,textureCoordAndEncodedNormals:1},y={compressed:0};return c.prototype.getAttributes=function(e){var t=r.FLOAT;if(this.quantization===s.NONE){var n=r.getSizeInBytes(t),a=4,i=this.hasVertexNormals?3:2,o=(this.hasVertexNormals?7:6)*n;return[{index:_.position3DAndHeight,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:a,offsetInBytes:0,strideInBytes:o},{index:_.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:i,offsetInBytes:a*n,strideInBytes:o}]}var u=3;return u+=this.hasVertexNormals?1:0,[{index:y.compressed,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:u}]},c.prototype.getAttributeLocations=function(){return this.quantization===s.NONE?_:y},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},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(c){c instanceof Error?o.error={name:c.name,message:c.message,stack:c.stack}:o.error=c}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(c){o.result=void 0,o.error="postMessage failed with error: "+n(c)+"\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/EllipsoidalOccluder","../Core/IndexDatatype","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/TerrainEncoding","../Core/Transforms","./createTaskProcessorWorker"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,E,h,m,_){"use strict";function y(i,d){var _=i.quantizedVertices,y=_.length/3,g=i.octEncodedNormals,x=i.westIndices.length+i.eastIndices.length+i.southIndices.length+i.northIndices.length,C=i.rectangle,P=C.west,U=C.south,D=C.east,F=C.north,L=u.clone(i.ellipsoid),B=i.exaggeration,z=i.minimumHeight*B,b=i.maximumHeight*B,q=i.relativeToCenter,G=m.eastNorthUpToFixedFrame(q,L),W=f.inverseTransformation(G,new f),X=_.subarray(0,y),H=_.subarray(y,2*y),V=_.subarray(2*y,3*y),Y=o(g),k=new Array(y),Z=new Array(y),j=new Array(y),K=A;K.x=Number.POSITIVE_INFINITY,K.y=Number.POSITIVE_INFINITY,K.z=Number.POSITIVE_INFINITY;var J=N;J.x=Number.NEGATIVE_INFINITY,J.y=Number.NEGATIVE_INFINITY,J.z=Number.NEGATIVE_INFINITY;for(var Q=0;y>Q;++Q){var $=X[Q]/R,ee=H[Q]/R,te=l.lerp(z,b,V[Q]/R);I.longitude=l.lerp(P,D,$),I.latitude=l.lerp(U,F,ee),I.height=te;var ne=L.cartographicToCartesian(I);k[Q]=new r($,ee),Z[Q]=te,j[Q]=ne,f.multiplyByPoint(W,ne,S),a.minimumByComponent(S,K,K),a.maximumByComponent(S,J,J)}var re,ae,ie;if(1!==B){ie=n.fromPoints(j),ae=E.fromRectangle(C,z,b,L);var oe=new s(L);re=oe.computeHorizonCullingPointFromPoints(q,j)}var ue=z;ue=Math.min(ue,T(i.westIndices,i.westSkirtHeight,Z,k,C,L,W,K,J)),ue=Math.min(ue,T(i.southIndices,i.southSkirtHeight,Z,k,C,L,W,K,J)),ue=Math.min(ue,T(i.eastIndices,i.eastSkirtHeight,Z,k,C,L,W,K,J)),ue=Math.min(ue,T(i.northIndices,i.northSkirtHeight,Z,k,C,L,W,K,J));for(var se=new t(K,J,q),ce=new h(se,ue,b,G,Y),le=ce.getStride(),de=y*le+x*le,fe=new Float32Array(de),Ee=0,he=0;y>he;++he){if(Y){var me=2*he;if(M.x=g[me],M.y=g[me+1],1!==B){var _e=e.octDecode(M.x,M.y,O),ye=m.eastNorthUpToFixedFrame(S,L,w),Te=f.inverseTransformation(ye,v);f.multiplyByPointAsVector(Te,_e,_e),_e.z*=B,a.normalize(_e,_e),f.multiplyByPointAsVector(ye,_e,_e),a.normalize(_e,_e),e.octEncode(_e,M)}}Ee=ce.encode(fe,Ee,j[he],k[he],Z[he],M)}var pe=Math.max(0,2*(x-4)),Re=i.indices.length+3*pe,Se=c.createTypedArray(y+x,Re);Se.set(i.indices,0);var Ae=y*le,Ne=i.indices.length;return Ne=p(fe,Ae,Se,Ne,i.westIndices,ce,Z,k,g,L,C,i.westSkirtHeight,!0,B),Ae+=i.westIndices.length*le,Ne=p(fe,Ae,Se,Ne,i.southIndices,ce,Z,k,g,L,C,i.southSkirtHeight,!1,B),Ae+=i.southIndices.length*le,Ne=p(fe,Ae,Se,Ne,i.eastIndices,ce,Z,k,g,L,C,i.eastSkirtHeight,!1,B),Ae+=i.eastIndices.length*le,p(fe,Ae,Se,Ne,i.northIndices,ce,Z,k,g,L,C,i.northSkirtHeight,!0,B),d.push(fe.buffer,Se.buffer),{vertices:fe.buffer,indices:Se.buffer,vertexStride:le,center:q,minimumHeight:z,maximumHeight:b,boundingSphere:ie,orientedBoundingBox:ae,occludeePointInScaledSpace:re,encoding:ce,skirtIndex:i.indices.length}}function T(e,t,n,r,i,o,u,s,c){var d=Number.POSITIVE_INFINITY,E=i.north,h=i.south,m=i.east,_=i.west;_>m&&(m+=l.TWO_PI);for(var y=e.length,T=0;y>T;++T){var p=e[T],R=n[p],A=r[p];I.longitude=l.lerp(_,m,A.x),I.latitude=l.lerp(h,E,A.y),I.height=R-t;var N=o.cartographicToCartesian(I,S);f.multiplyByPoint(u,N,N),a.minimumByComponent(N,s,s),a.maximumByComponent(N,c,c),d=Math.min(d,I.height)}return d}function p(t,n,r,i,u,s,c,d,E,h,_,y,T,p){var R,A,N;T?(R=u.length-1,A=-1,N=-1):(R=0,A=u.length,N=1);var g=-1,x=o(E),C=s.getStride(),P=n/C,U=_.north,D=_.south,F=_.east,L=_.west;L>F&&(F+=l.TWO_PI);for(var B=R;B!==A;B+=N){var z=u[B],b=c[z],q=d[z];I.longitude=l.lerp(L,F,q.x),I.latitude=l.lerp(D,U,q.y),I.height=b-y;var G=h.cartographicToCartesian(I,S);if(x){var W=2*z;if(M.x=E[W],M.y=E[W+1],1!==p){var X=e.octDecode(M.x,M.y,O),H=m.eastNorthUpToFixedFrame(S,h,w),V=f.inverseTransformation(H,v);f.multiplyByPointAsVector(V,X,X),X.z*=p,a.normalize(X,X),f.multiplyByPointAsVector(H,X,X),a.normalize(X,X),e.octEncode(X,M)}}n=s.encode(t,n,G,q,I.height,M),-1!==g&&(r[i++]=g,r[i++]=P-1,r[i++]=z,r[i++]=P-1,r[i++]=P,r[i++]=z),g=z,++P}return i}var R=32767,S=new a,A=new a,N=new a,I=new i,M=new r,O=new a,v=new f,w=new f;return _(y)})}(); \ No newline at end of file diff --git a/Workers/createWallGeometry.js b/Workers/createWallGeometry.js index 8db33f4..56afe9d 100644 --- a/Workers/createWallGeometry.js +++ b/Workers/createWallGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,8 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(n){t=n.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:0>e?-1:0},n.signNotZero=function(e){return 0>e?-1:1},n.toSNorm=function(e){return Math.round(255*(.5*n.clamp(e,-1,1)+.5))},n.fromSNorm=function(e){return 2*(n.clamp(e,0,255)/255)-1},n.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},n.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},n.lerp=function(e,t,n){return(1-n)*e+n*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=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){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,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},n.negativePiToPi=function(e){for(var t=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+t)>e;)e+=i;if(-r>e)return-r;for(;e>r+t;)e-=i;return e>r?r:e},n.zeroToTwoPi=function(e){var t=e%n.TWO_PI;return 0>t?(t+n.TWO_PI)%n.TWO_PI:t},n.equalsEpsilon=function(e,n,r){return r=t(r,0),Math.abs(e-n)<=r};var r=[1];n.factorial=function(e){var t=r.length;if(e>=t)for(var n=r[t-1],i=t;e>=i;i++)r.push(n*i);return r[e]},n.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(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,n){return t>e?t:e>n?n:e};var i=new e;return n.setRandomNumberSeed=function(t){i=new e(t)},n.nextRandomNumber=function(){return i.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}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";var a=function(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)};a.fromSpherical=function(n,r){t(r)||(r=new a);var i=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(e,n,r,i){return t(i)?(i.x=e,i.y=n,i.z=r,i):new a(e,n,r)},a.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new a(e.x,e.y,e.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(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},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var u=new a;a.lerp=function(e,t,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){a.normalize(e,s),a.normalize(t,c);var n=a.dot(s,c),r=a.magnitude(a.cross(s,c,s));return Math.atan2(r,n)};var l=new a;a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,l);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):n.y<=n.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,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},a.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r&&Math.abs(e.z-n.z)<=r},a.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},a.fromDegrees=function(e,t,n,r,o){var u=i.toRadians(e),s=i.toRadians(t);return a.fromRadians(u,s,n,r,o)};var f=new a,h=new a,d=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=e(i,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=a.normalize(f,f),a.multiplyComponents(s,f,h);var l=Math.sqrt(a.dot(f,h));return h=a.divideByScalar(h,l,h),f=a.multiplyByScalar(f,i,f),t(u)||(u=new a),a.add(h,f,u)},a.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=i.toRadians(e[o]);return a.fromRadiansArray(r,t,n)},a.fromRadiansArray=function(e,n,r){var i=e.length;t(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=a.fromRadians(u,s,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=i.toRadians(e[o]),r[o+1]=i.toRadians(e[o+1]),r[o+2]=e[o+2];return a.fromRadiansArrayHeights(r,t,n)},a.fromRadiansArrayHeights=function(e,n,r){var i=e.length;t(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=a.fromRadians(u,s,c,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";var a=function(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)};return a.fromRadians=function(n,r,i,o){return i=e(i,0),t(o)?(o.longitude=n,o.latitude=r,o.height=i,o):new a(n,r,i)},a.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),a.fromRadians(e,t,n,r)},a.clone=function(e,n){return t(e)?t(n)?(n.longitude=e.longitude,n.latitude=e.latitude,n.height=e.height,n):new a(e.longitude,e.latitude,e.height):void 0},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.longitude===n.longitude&&e.latitude===n.latitude&&e.height===n.height},a.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.longitude-n.longitude)<=r&&Math.abs(e.latitude-n.latitude)<=r&&Math.abs(e.height-n.height)<=r},a.ZERO=r(new a(0,0,0)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"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}var c=function(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,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))return void 0;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.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),c=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,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 l=new e,f=new e;c.prototype.cartographicToCartesian=function(t,n){var i=l,a=f;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;n>i;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var h=new e,d=new e,m=new e;c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,d);if(!r(a))return void 0;var o=this.geodeticSurfaceNormal(a,h),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)},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;n>i;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};var p=new e,y=new e;return c.prototype.scaleToGeodeticSurface=function(t,n){var i=t.x,a=t.y,o=t.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,h=i*i*c*c,d=a*a*l*l,m=o*o*f*f,v=h+d+m,g=Math.sqrt(1/v),w=e.multiplyByScalar(t,g,p);if(v<this._centerToleranceSquared)return isFinite(g)?e.clone(w,n):void 0;var x=this._oneOverRadiiSquared,E=x.x,S=x.y,_=x.z,O=y;O.x=2*w.x*E,O.y=2*w.y*S,O.z=2*w.z*_;var M,T,P,C,R,N,I,b,z,A,D,U=(1-g)*e.magnitude(t)/(.5*e.magnitude(O)),q=0;do{U-=q,P=1/(1+U*E),C=1/(1+U*S),R=1/(1+U*_),N=P*P,I=C*C,b=R*R,z=N*P,A=I*C,D=b*R,M=h*N+d*I+m*b-1,T=h*z*E+d*A*S+m*D*_;var L=-2*T;q=M/L}while(Math.abs(M)>u.EPSILON12);return r(n)?(n.x=i*P,n.y=a*C,n.z=o*R,n):new e(i*P,a*C,o*R)},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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";var u=function(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";var t=function(t,n){this.start=e(t,0),this.stop=e(n,0)};return t}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";var i=function(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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 a=new i;i.distance=function(e,t){return i.subtract(e,t,a),i.magnitude(a)},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.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 o=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,o),r=i.multiplyByScalar(e,1-n,r),i.add(o,r,r)};var u=new i;return i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,u);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.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r&&Math.abs(e.z-n.z)<=r&&Math.abs(e.w-n.w)<=r},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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function u(e){for(var t=0,n=0;3>n;++n){var r=e[c.getElementIndex(d[n],h[n])];t+=2*r*r}return Math.sqrt(t)}function s(e,t){for(var n=a.EPSILON15,r=0,i=1,o=0;3>o;++o){var u=Math.abs(e[c.getElementIndex(d[o],h[o])]);u>r&&(i=o,r=u)}var s=1,l=0,f=h[i],m=d[i];if(Math.abs(e[c.getElementIndex(m,f)])>n){var p,y=e[c.getElementIndex(m,m)],v=e[c.getElementIndex(f,f)],g=e[c.getElementIndex(m,f)],w=(y-v)/2/g;p=0>w?-1/(-w+Math.sqrt(1+w*w)):1/(w+Math.sqrt(1+w*w)),s=1/Math.sqrt(1+p*p),l=p*s}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(f,f)]=t[c.getElementIndex(m,m)]=s,t[c.getElementIndex(m,f)]=l,t[c.getElementIndex(f,m)]=-l,t}var c=function(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)};c.clone=function(e,t){return n(e)?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 c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,r,i){return r=t(r,0),n(i)||(i=new c),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},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var r=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,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,m=r-u-f+d,p=2*(i-h),y=2*(a+l),v=2*(i+h),g=-r+u-f+d,w=2*(s-o),x=2*(a-l),E=2*(s+o),S=-r-u+f+d;return n(t)?(t[0]=m,t[1]=v,t[2]=x,t[3]=p,t[4]=g,t[5]=E,t[6]=y,t[7]=w,t[8]=S,t):new c(m,p,y,v,g,w,x,E,S)},c.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 c(e.x,0,0,0,e.y,0,0,0,e.z)},c.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 c(e,0,0,0,e,0,0,0,e)},c.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 c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.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 c(1,0,0,0,r,-i,0,i,r)},c.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 c(r,0,i,0,1,0,-i,0,r)},c.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 c(r,-i,0,i,r,0,0,0,1)},c.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]]},c.getElementIndex=function(e,t){return 3*e+t},c.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},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},c.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},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,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[3],t[4],t[5],l)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),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]*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},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},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},c.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},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},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},c.transpose=function(e,t){var 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 h=[1,0,0],d=[2,2,1],m=new c,p=new c;return c.computeEigenDecomposition=function(e,t){var r=a.EPSILON20,i=10,l=0,f=0;n(t)||(t={});for(var h=t.unitary=c.clone(c.IDENTITY,t.unitary),d=t.diagonal=c.clone(e,t.diagonal),y=r*o(d);i>f&&u(d)>y;)s(d,m),c.transpose(m,p),c.multiply(d,m,d),c.multiply(p,d,d),c.multiply(h,m,h),++l>2&&(++f,l=0);return t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},c.determinant=function(e){var t=e[0],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)},c.inverse=function(e,t){var n=e[0],i=e[1],o=e[2],u=e[3],s=e[4],l=e[5],f=e[6],h=e[7],d=e[8],m=c.determinant(e);if(Math.abs(m)<=a.EPSILON15)throw new r("matrix is not invertible");t[0]=s*d-h*l,t[1]=h*o-i*d,t[2]=i*l-s*o,t[3]=f*l-u*d,t[4]=n*d-f*o,t[5]=u*o-n*l,t[6]=u*h-f*s,t[7]=f*i-n*h,t[8]=n*s-u*i;var p=1/m;return c.multiplyByScalar(t,p,t)},c.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]},c.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},c.IDENTITY=i(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(n){t=n.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s){"use strict";var c=function(e,t,r,i,a,o,u,s,c,l,f,h,d,m,p,y){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(m,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(p,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(y,0)};c.packedLength=16,c.pack=function(e,t,r){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]},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){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new 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]):void 0},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,l=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,m=t.y*t.z,p=t.y*t.w,y=t.z*t.z,v=t.z*t.w,g=t.w*t.w,w=s-d-y+g,x=2*(l-v),E=2*(f+p),S=2*(l+v),_=-s+d-y+g,O=2*(m-h),M=2*(f-p),T=2*(m+h),P=-s-d+y+g;return i[0]=w*a,i[1]=S*a,i[2]=M*a,i[3]=0,i[4]=x*o,i[5]=_*o,i[6]=T*o,i[7]=0,i[8]=E*u,i[9]=O*u,i[10]=P*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.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 l=new e,f=new e,h=new e;c.fromCamera=function(t,n){var i=t.eye,a=t.target,o=t.up;e.normalize(e.subtract(a,i,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,m=l.x,p=l.y,y=l.z,v=h.x,g=h.y,w=h.z,x=i.x,E=i.y,S=i.z,_=u*-x+s*-E+d*-S,O=v*-x+g*-E+w*-S,M=m*x+p*E+y*S;return r(n)?(n[0]=u,n[1]=v,n[2]=-m,n[3]=0,n[4]=s,n[5]=g,n[6]=-p,n[7]=0,n[8]=d,n[9]=w,n[10]=-y,n[11]=0,n[12]=_,n[13]=O,n[14]=M,n[15]=1,n):new c(u,s,d,_,v,g,w,O,-m,-p,-y,M,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),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},c.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},c.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},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),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},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 c=.5*u,l=.5*s,f=.5*(r-t),h=c,d=l,m=f,p=a+c,y=o+l,v=t+f,g=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]=m,i[11]=0,i[12]=p,i[13]=y,i[14]=v,i[15]=g,i},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.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 d=new e;c.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;c.getMaximumScale=function(t){return c.getScale(t,m),e.maximumComponent(m)},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],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],m=e[11],p=e[12],y=e[13],v=e[14],g=e[15],w=t[0],x=t[1],E=t[2],S=t[3],_=t[4],O=t[5],M=t[6],T=t[7],P=t[8],C=t[9],R=t[10],N=t[11],I=t[12],b=t[13],z=t[14],A=t[15],D=r*w+u*x+f*E+p*S,U=i*w+s*x+h*E+y*S,q=a*w+c*x+d*E+v*S,L=o*w+l*x+m*E+g*S,W=r*_+u*O+f*M+p*T,B=i*_+s*O+h*M+y*T,F=a*_+c*O+d*M+v*T,G=o*_+l*O+m*M+g*T,Y=r*P+u*C+f*R+p*N,j=i*P+s*C+h*R+y*N,V=a*P+c*C+d*R+v*N,H=o*P+l*C+m*R+g*N,k=r*I+u*b+f*z+p*A,X=i*I+s*b+h*z+y*A,Z=a*I+c*b+d*z+v*A,J=o*I+l*b+m*z+g*A;return n[0]=D,n[1]=U,n[2]=q,n[3]=L,n[4]=W,n[5]=B,n[6]=F,n[7]=G,n[8]=Y,n[9]=j,n[10]=V,n[11]=H,n[12]=k,n[13]=X,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],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],m=e[14],p=t[0],y=t[1],v=t[2],g=t[4],w=t[5],x=t[6],E=t[8],S=t[9],_=t[10],O=t[12],M=t[13],T=t[14],P=r*p+o*y+c*v,C=i*p+u*y+l*v,R=a*p+s*y+f*v,N=r*g+o*w+c*x,I=i*g+u*w+l*x,b=a*g+s*w+f*x,z=r*E+o*S+c*_,A=i*E+u*S+l*_,D=a*E+s*S+f*_,U=r*O+o*M+c*T+h,q=i*O+u*M+l*T+d,L=a*O+s*M+f*T+m;return n[0]=P,n[1]=C,n[2]=R,n[3]=0,n[4]=N,n[5]=I,n[6]=b,n[7]=0,n[8]=z,n[9]=A,n[10]=D,n[11]=0,n[12]=U,n[13]=q,n[14]=L,n[15]=1,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 p=new e;c.multiplyByUniformScale=function(e,t,n){return p.x=t,p.y=t,p.z=t,c.multiplyByScale(e,p,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,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},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[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]},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 y=new u,v=new u,g=new t,w=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,y),v,o.EPSILON7)&&t.equals(c.getRow(e,3,g),w))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],l=e[12],f=e[1],h=e[5],d=e[9],m=e[13],p=e[2],x=e[6],E=e[10],S=e[14],_=e[3],O=e[7],M=e[11],T=e[15],P=E*T,C=S*M,R=x*T,N=S*O,I=x*M,b=E*O,z=p*T,A=S*_,D=p*M,U=E*_,q=p*O,L=x*_,W=P*h+N*d+I*m-(C*h+R*d+b*m),B=C*f+z*d+U*m-(P*f+A*d+D*m),F=R*f+A*h+q*m-(N*f+z*h+L*m),G=b*f+D*h+L*d-(I*f+U*h+q*d),Y=C*i+R*a+b*l-(P*i+N*a+I*l),j=P*r+A*a+D*l-(C*r+z*a+U*l),V=N*r+z*i+L*l-(R*r+A*i+q*l),H=I*r+U*i+q*a-(b*r+D*i+L*a);P=a*m,C=l*d,R=i*m,N=l*h,I=i*d,b=a*h,z=r*m,A=l*f,D=r*d,U=a*f,q=r*h,L=i*f;var k=P*O+N*M+I*T-(C*O+R*M+b*T),X=C*_+z*M+U*T-(P*_+A*M+D*T),Z=R*_+A*O+q*T-(N*_+z*O+L*T),J=b*_+D*O+L*M-(I*_+U*O+q*M),K=R*E+b*S+C*x-(I*S+P*x+N*E),$=D*S+P*p+A*E-(z*E+U*S+C*p),Q=z*x+L*S+N*p-(q*S+R*p+A*x),et=q*E+I*p+U*x-(D*x+L*E+b*p),tt=r*W+i*B+a*F+l*G;if(Math.abs(tt)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return tt=1/tt,n[0]=W*tt,n[1]=B*tt,n[2]=F*tt,n[3]=G*tt,n[4]=Y*tt,n[5]=j*tt,n[6]=V*tt,n[7]=H*tt,n[8]=k*tt,n[9]=X*tt,n[10]=Z*tt,n[11]=J*tt,n[12]=K*tt,n[13]=$*tt,n[14]=Q*tt,n[15]=et*tt,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],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],m=-n*f-r*h-i*d,p=-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]=m,t[13]=p,t[14]=y,t[15]=1,t},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o){"use strict";var u=function(e,n,r,i){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(i,0)};u.fromDegrees=function(e,r,i,a,s){return e=o.toRadians(t(e,0)),r=o.toRadians(t(r,0)),i=o.toRadians(t(i,0)),a=o.toRadians(t(a,0)),n(s)?(s.west=e,s.south=r,s.east=i,s.north=a,s):new u(e,r,i,a)},u.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=e.length;c>s;s++){var l=e[s];r=Math.min(r,l.longitude),i=Math.max(i,l.longitude),a=Math.min(a,l.latitude),o=Math.max(o,l.latitude)}return n(t)?(t.west=r,t.south=a,t.east=i,t.north=o,t):new u(r,a,i,o)},u.packedLength=4,u.pack=function(e,n,r){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},u.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i.west=e[r++],i.south=e[r++],i.east=e[r++],i.north=e[r],i},u.clone=function(e,t){return n(e)?n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.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},u.validate=function(){},u.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)},u.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)},u.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)},u.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)},u.center=function(t,r){var i=t.east,a=t.west,u=.5*(a+i);return a>i&&(u=o.negativePiToPi(u+o.PI)),n(r)?(r.longitude=u,r.latitude=.5*(t.south+t.north),r.height=0,r):new e(u,.5*(t.south+t.north))},u.intersectWith=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),s=Math.min(e.north,t.north);return n(r)?(r.west=i,r.south=a,r.east=o,r.north=s,r):new u(i,a,o,s)},u.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},u.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var s=new e;return u.subsample=function(e,r,a,u){r=t(r,i.WGS84),a=t(a,0),n(u)||(u=[]);var c=0,l=e.north,f=e.south,h=e.east,d=e.west,m=s;m.height=a,m.longitude=d,m.latitude=l,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:f>0?f:0;for(var p=1;8>p;++p){var y=-Math.PI+p*o.PI_OVER_TWO;y>d&&h>y&&(m.longitude=y,u[c]=r.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,c,l){"use strict";var f=function(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)},h=new e,d=new e,m=new e,p=new e,y=new e,v=new e,g=new e,w=new e,x=new e,E=new e,S=new e,_=new e;f.fromPoints=function(t,n){if(r(n)||(n=new f),!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],g),a=e.clone(i,h),o=e.clone(i,d),u=e.clone(i,m),s=e.clone(i,p),c=e.clone(i,y),l=e.clone(i,v),O=t.length,M=1;O>M;M++){e.clone(t[M],i);var T=i.x,P=i.y,C=i.z;T<a.x&&e.clone(i,a),T>s.x&&e.clone(i,s),P<o.y&&e.clone(i,o),P>c.y&&e.clone(i,c),C<u.z&&e.clone(i,u),C>l.z&&e.clone(i,l)}var R=e.magnitudeSquared(e.subtract(s,a,w)),N=e.magnitudeSquared(e.subtract(c,o,w)),I=e.magnitudeSquared(e.subtract(l,u,w)),b=a,z=s,A=R;N>A&&(A=N,b=o,z=c),I>A&&(A=I,b=u,z=l);var D=x;D.x=.5*(b.x+z.x),D.y=.5*(b.y+z.y),D.z=.5*(b.z+z.z);var U=e.magnitudeSquared(e.subtract(z,D,w)),q=Math.sqrt(U),L=E;L.x=a.x,L.y=o.y,L.z=u.z;var W=S;W.x=s.x,W.y=c.y,W.z=l.z;var B=e.multiplyByScalar(e.add(L,W,w),.5,_),F=0;for(M=0;O>M;M++){e.clone(t[M],i);var G=e.magnitude(e.subtract(i,B,w));G>F&&(F=G);var Y=e.magnitudeSquared(e.subtract(i,D,w));if(Y>U){var j=Math.sqrt(Y);q=.5*(q+j),U=q*q;var V=j-q;D.x=(q*D.x+V*i.x)/j,D.y=(q*D.y+V*i.y)/j,D.z=(q*D.z+V*i.z)/j}}return F>q?(e.clone(D,n.center),n.radius=q):(e.clone(B,n.center),n.radius=F),n};var O=new o,M=new e,T=new e,P=new t,C=new t;f.fromRectangle2D=function(e,t,n){return f.fromRectangleWithHeights2D(e,t,0,0,n)},f.fromRectangleWithHeights2D=function(t,i,a,o,u){if(r(u)||(u=new f),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=n(i,O),l.southwest(t,P),P.height=a,l.northeast(t,C),C.height=o;var s=i.project(P,M),c=i.project(C,T),h=c.x-s.x,d=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(h*h+d*d+m*m);var p=u.center;return p.x=s.x+.5*h,p.y=s.y+.5*d,p.z=s.z+.5*m,u};var R=[];f.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,R)),f.fromPoints(u,o)},f.fromVertices=function(t,i,a,o){if(r(o)||(o=new f),!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=g;u.x=t[0]+i.x,u.y=t[1]+i.y,u.z=t[2]+i.z;for(var s=e.clone(u,h),c=e.clone(u,d),l=e.clone(u,m),O=e.clone(u,p),M=e.clone(u,y),T=e.clone(u,v),P=t.length,C=0;P>C;C+=a){var R=t[C]+i.x,N=t[C+1]+i.y,I=t[C+2]+i.z;u.x=R,u.y=N,u.z=I,R<s.x&&e.clone(u,s),R>O.x&&e.clone(u,O),N<c.y&&e.clone(u,c),N>M.y&&e.clone(u,M),I<l.z&&e.clone(u,l),I>T.z&&e.clone(u,T)}var b=e.magnitudeSquared(e.subtract(O,s,w)),z=e.magnitudeSquared(e.subtract(M,c,w)),A=e.magnitudeSquared(e.subtract(T,l,w)),D=s,U=O,q=b;z>q&&(q=z,D=c,U=M),A>q&&(q=A,D=l,U=T);var L=x;L.x=.5*(D.x+U.x),L.y=.5*(D.y+U.y),L.z=.5*(D.z+U.z);var W=e.magnitudeSquared(e.subtract(U,L,w)),B=Math.sqrt(W),F=E;F.x=s.x,F.y=c.y,F.z=l.z;var G=S;G.x=O.x,G.y=M.y,G.z=T.z;var Y=e.multiplyByScalar(e.add(F,G,w),.5,_),j=0;for(C=0;P>C;C+=a){u.x=t[C]+i.x,u.y=t[C+1]+i.y,u.z=t[C+2]+i.z;var V=e.magnitude(e.subtract(u,Y,w));V>j&&(j=V);var H=e.magnitudeSquared(e.subtract(u,L,w));if(H>W){var k=Math.sqrt(H);B=.5*(B+k),W=B*B;var X=k-B;L.x=(B*L.x+X*u.x)/k,L.y=(B*L.y+X*u.y)/k,L.z=(B*L.z+X*u.z)/k}}return j>B?(e.clone(L,o.center),o.radius=B):(e.clone(Y,o.center),o.radius=j),o},f.fromCornerPoints=function(t,n,i){r(i)||(i=new f);var a=i.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,n),i},f.fromEllipsoid=function(t,n){return r(n)||(n=new f),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n},f.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new f(t.center,t.radius):void 0},f.packedLength=4,f.pack=function(e,t,r){r=n(r,0);var i=e.center;t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius},f.unpack=function(e,t,i){t=n(t,0),r(i)||(i=new f);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var N=new e,I=new e;f.union=function(t,n,i){r(i)||(i=new f);var a=t.center,o=n.center;e.add(a,o,I);var u=e.multiplyByScalar(I,.5,I),s=e.magnitude(e.subtract(a,u,N))+t.radius,c=e.magnitude(e.subtract(o,u,N))+n.radius;return i.radius=Math.max(s,c),e.clone(u,i.center),i};var b=new e;f.expand=function(t,n,r){r=f.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,b));return i>r.radius&&(r.radius=i),r},f.intersect=function(t,n){var r=t.center,i=t.radius,a=e.dot(n,r)+n.w;return-i>a?u.OUTSIDE:i>a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;f.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},f.transformWithoutScale=function(e,t,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var A=new e;f.computePlaneDistances=function(t,n,i,a){r(a)||(a=new s);var o=e.subtract(t.center,n,A),u=e.multiplyByScalar(i,e.dot(i,o),A),c=e.magnitude(u);return a.start=c-t.radius,a.stop=c+t.radius,a};for(var D=new e,U=new e,q=new e,L=new e,W=new e,B=new t,F=new Array(8),G=0;8>G;++G)F[G]=new e;var Y=new o;return f.projectTo2D=function(t,r,i){r=n(r,Y);var a=r.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,D),c=e.cross(e.UNIT_Z,s,U);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 h=e.negate(l,W),d=e.negate(c,L),m=F,p=m[0];e.add(s,l,p),e.add(p,c,p),p=m[1],e.add(s,l,p),e.add(p,d,p),p=m[2],e.add(s,h,p),e.add(p,d,p),p=m[3],e.add(s,h,p),e.add(p,c,p),e.negate(s,s),p=m[4],e.add(s,l,p),e.add(p,c,p),p=m[5],e.add(s,l,p),e.add(p,d,p),p=m[6],e.add(s,h,p),e.add(p,d,p),p=m[7],e.add(s,h,p),e.add(p,c,p);for(var y=m.length,v=0;y>v;++v){var g=m[v];e.add(o,g,g);var w=a.cartesianToCartographic(g,B);r.project(w,g)}i=f.fromPoints(m,i),o=i.center;var x=o.x,E=o.y,S=o.z;return o.x=S,o.y=x,o.z=E,i},f.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},f.prototype.intersect=function(e){return f.intersect(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var 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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++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",e(document[i])?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",e(document[i])&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",e(document[i])?r.fullscreenElement=i:(i=s+"FullScreenElement",e(document[i])&&(r.fullscreenElement=i)),i=s+"fullscreenchange",e(document["on"+i])&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",e(document["on"+i])&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e){i.supportsFullscreen()&&e[r.requestFullscreen]()},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;r>n;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(m)){m=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(m=!0,p=r(e[1]))}return m}function a(){return i()&&p}function o(){if(!t(y)&&(y=!1,!i()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(y=!0,v=r(e[1]))}return y}function u(){return o()&&v}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(g=!0,w=r(e[1]),w.isNightly=!!e[2])}return g}function c(){return s()&&w}function l(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=r(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(x=!0,E=r(e[1])))}return x}function f(){return l()&&E}function h(){if(!t(S)){S=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(S=!0,_=r(e[1]))}return S}function d(){return h()&&_}var m,p,y,v,g,w,x,E,S,_,O={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:d,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};return O.supportsFullscreen=function(){return n.supportsFullscreen()},O.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},O.supportsWebWorkers=function(){return"undefined"!=typeof Worker},O}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,i){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return t(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(t,r,i,o){switch(i=e(i,0),o=e(o,(r.byteLength-i)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(r,i,o);case a.UNSIGNED_BYTE:return new Uint8Array(r,i,o);case a.SHORT:return new Int16Array(r,i,o);case a.UNSIGNED_SHORT:return new Uint16Array(r,i,o);case a.FLOAT:return new Float32Array(r,i,o);case a.DOUBLE:return new Float64Array(r,i,o);default:throw new n("componentDatatype is not a valid value.")}},i(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"],function(e){"use strict";var t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===t.POINTS||e===t.LINES||e===t.LINE_LOOP||e===t.LINE_STRIP||e===t.TRIANGLES||e===t.TRIANGLE_STRIP||e===t.TRIANGLE_FAN}};return e(t)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";var a=function(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)};return a.computeNumberOfVertices=function(e){var r=-1;for(var i in e.attributes)if(e.attributes.hasOwnProperty(i)&&t(e.attributes[i])&&t(e.attributes[i].values)){var a=e.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(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"],function(e,t,n,r){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,i){return e>r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(i)}),define("Core/VertexFormat",["./defaultValue","./freezeObject"],function(e,t){"use strict";var n=function(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=t(new n({position:!0})),n.POSITION_AND_NORMAL=t(new n({position:!0,normal:!0})),n.POSITION_NORMAL_AND_ST=t(new n({position:!0,normal:!0,st:!0})),n.POSITION_AND_ST=t(new n({position:!0,st:!0})),n.POSITION_AND_COLOR=t(new n({position:!0,color:!0})),n.ALL=t(new n({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),n.DEFAULT=n.POSITION_NORMAL_AND_ST,n}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,i){"use strict";var a=function(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;f>h;h++){var d=t[h],m=d.x,p=d.y,y=d.z;i=Math.min(m,i),s=Math.max(m,s),o=Math.min(p,o),c=Math.max(p,c),u=Math.min(y,u),l=Math.max(y,l)}var v=r.minimum;v.x=i,v.y=o,v.z=u;var g=r.maximum;g.x=s,g.y=c,g.z=l;var w=e.add(v,g,r.center);return e.multiplyByScalar(w,.5,w),r},a.clone=function(t,r){return n(t)?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):void 0},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.intersect=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),a=r.x*Math.abs(n.x)+r.y*Math.abs(n.y)+r.z*Math.abs(n.z),u=e.dot(t.center,n)+n.w;return u-a>0?i.INSIDE:0>u+a?i.OUTSIDE:i.INTERSECTING},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.intersect=function(e){return a.intersect(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";var a=function(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){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new a(e.x,e.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},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.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.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.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.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r},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){return a.equalsEpsilon(this,e,t)},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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(a=-i/e,0>a)return[];var s=Math.sqrt(a);return[-s,s]}if(0===i)return a=-r/e,0>a?[a,0]:[0,a];var c=r*r,l=4*e*i,f=n(c,-l,t.EPSILON14);if(0>f)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,m=o*s-h,p=o*c-u*s,y=u*c-d,v=4*m*y-p*p;if(0>v){var g,w,x;h*f>=l*d?(g=o,w=m,x=-2*u*m+o*p):(g=c,w=y,x=-c*p+2*s*y);var E=0>x?-1:1,S=-E*Math.abs(g)*Math.sqrt(-v);a=-x+S;var _=a/2,O=0>_?-Math.pow(-_,1/3):Math.pow(_,1/3),M=a===S?-O:-w/O;return i=0>=w?O+M:-x/(O*O+M*M+w),h*f>=l*d?[(i-u)/o]:[-c/(i+s)]}var T=m,P=-2*u*m+o*p,C=y,R=-c*p+2*s*y,N=Math.sqrt(v),I=Math.sqrt(3)/2,b=Math.abs(Math.atan2(o*N,-P)/3);i=2*Math.sqrt(-T);var z=Math.cos(b);a=i*z;var A=i*(-z/2-I*Math.sin(b)),D=a+A>2*u?a-u:A-u,U=o,q=D/U;b=Math.abs(Math.atan2(c*N,-R)/3),i=2*Math.sqrt(-C),z=Math.cos(b),a=i*z,A=i*(-z/2-I*Math.sin(b));var L=-c,W=2*s>a+A?a+s:A+s,B=L/W,F=U*W,G=-D*W-U*L,Y=D*L,j=(s*G-u*Y)/(-u*G+s*F);return j>=q?B>=q?B>=j?[q,j,B]:[q,B,j]:[B,q,j]:B>=q?[j,q,B]:B>=j?[j,B,q]:[B,j,q]}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=0>u?-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,0>u?[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 m=r.computeRealRoots(1,s,l);if(2===m.length){var p,y=m[0],v=m[1];if(y>=0&&v>=0){var g=Math.sqrt(y),w=Math.sqrt(v);return[h-w,h-g,h+g,h+w]}if(y>=0&&0>v)return p=Math.sqrt(y),[h-p,h+p];if(0>y&&v>=0)return p=Math.sqrt(v),[h-p,h+p]}return[]}if(d>0){var x=Math.sqrt(d),E=(s+d-c/x)/2,S=(s+d+c/x)/2,_=r.computeRealRoots(1,x,E),O=r.computeRealRoots(1,-x,S);return 0!==_.length?(_[0]+=h,_[1]+=h,0!==O.length?(O[0]+=h,O[1]+=h,_[1]<=O[0]?[_[0],_[1],O[0],O[1]]:O[1]<=_[0]?[O[0],O[1],_[0],_[1]]:_[0]>=O[0]&&_[1]<=O[1]?[O[0],_[0],_[1],O[1]]:O[0]>=_[0]&&O[1]<=_[1]?[_[0],O[0],O[1],_[1]]:_[0]>O[0]&&_[0]<O[1]?[O[0],_[0],O[1],_[1]]:[_[0],O[0],_[1],O[1]]):_):0!==O.length?(O[0]+=h,O[1]+=h,O):[]}}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 m,p,y=d[0],v=i-y,g=v*v,w=t/2,x=v/2,E=g-4*o,S=g+4*Math.abs(o),_=c-4*y,O=c+4*Math.abs(y);if(0>y||_*S>E*O){var M=Math.sqrt(_);m=M/2,p=0===M?0:(t*x-a)/M}else{var T=Math.sqrt(E);m=0===T?0:(t*x-a)/T,p=T/2}var P,C;0===w&&0===m?(P=0,C=0):n.sign(w)===n.sign(m)?(P=w+m,C=y/P):(C=w-m,P=y/C);var R,N;0===x&&0===p?(R=0,N=0):n.sign(x)===n.sign(p)?(R=x+p,N=o/R):(N=x-p,R=o/N);var I=r.computeRealRoots(1,P,R),b=r.computeRealRoots(1,C,N);if(0!==I.length)return 0!==b.length?I[1]<=b[0]?[I[0],I[1],b[0],b[1]]:b[1]<=I[0]?[b[0],b[1],I[0],I[1]]:I[0]>=b[0]&&I[1]<=b[1]?[b[0],I[0],I[1],b[1]]:b[0]>=I[0]&&b[1]<=I[1]?[I[0],b[0],b[1],I[1]]:I[0]>b[0]&&I[0]<b[1]?[b[0],I[0],b[1],I[1]]:[I[0],b[0],I[1],b[1]]:I;if(0!==b.length)return b}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,m=d*i,p=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*a*f*f+256*o*m+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 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=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>f?d+1:d,d+=0>h?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 void 0}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r=function(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 r.getPoint=function(t,r,i){return n(i)||(i=new e),i=e.multiplyByScalar(t.direction,r,i),e.add(t.origin,i,i)},r}),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(t,r,i,o,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,m=t.direction,p=e.subtract(i,r,y),E=e.subtract(o,r,v),S=e.cross(m,E,g),_=e.dot(p,S);if(u){if(_<a.EPSILON6)return void 0;if(s=e.subtract(d,r,w),l=e.dot(s,S),0>l||l>_)return void 0;if(c=e.cross(s,p,x),f=e.dot(m,c),0>f||l+f>_)return void 0;h=e.dot(E,c)/_}else{if(Math.abs(_)<a.EPSILON6)return void 0;var O=1/_;if(s=e.subtract(d,r,w),l=e.dot(s,S)*O,0>l||l>1)return void 0;if(c=e.cross(s,p,x),f=e.dot(m,c)*O,0>f||l+f>1)return void 0;h=e.dot(E,c)*O}return h}function f(e,t,n,r){var i=t*t-4*e*n;if(0>i)return void 0;if(i>0){var a=1/(2*e),o=Math.sqrt(i),u=(-t+o)*a,s=(-t-o)*a;return s>u?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);return 0===c?void 0:(r.root0=r.root1=c,r)}function h(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,g),l=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,m=f(l,h,d,S);return r(m)?(i.start=m.root0,i.stop=m.root1,i):void 0}function d(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 m(t,n,r,i,c){var l,f=i*i,h=c*c,m=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,p=c*(i*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],a.EPSILON15)+n.y),y=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*h+i*n.x+r,v=h*d(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],a.EPSILON15),g=c*(i*d(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),w=[];if(0===g&&0===v){if(l=u.computeRealRoots(m,p,y),0===l.length)return w;var x=l[0],E=Math.sqrt(Math.max(1-x*x,0));if(w.push(new e(i,c*x,c*-E)),w.push(new e(i,c*x,c*E)),2===l.length){var S=l[1],_=Math.sqrt(Math.max(1-S*S,0));w.push(new e(i,c*S,c*-_)),w.push(new e(i,c*S,c*_))}return w}var O=g*g,M=v*v,T=m*m,P=g*v,C=T+M,R=2*(p*m+P),N=2*y*m+p*p-M+O,I=2*(y*p-P),b=y*y-O;if(0===C&&0===R&&0===N&&0===I)return w;l=s.computeRealRoots(C,R,N,I,b);var z=l.length;if(0===z)return w;for(var A=0;z>A;++A){var D,U=l[A],q=U*U,L=Math.max(1-q,0),W=Math.sqrt(L);D=a.sign(m)===a.sign(y)?d(m*q+y,p*U,a.EPSILON12):a.sign(y)===a.sign(p*U)?d(m*q,p*U+y,a.EPSILON12):d(m*q+p*U,y,a.EPSILON12);var B=d(v*U,g,a.EPSILON15),F=D*B;0>F?w.push(new e(i,c*U,c*W)):F>0?w.push(new e(i,c*U,c*-W)):0!==W?(w.push(new e(i,c*U,c*-W)),w.push(new e(i,c*U,c*W)),++A):w.push(new e(i,c*U,c*W))}return w}var p={};p.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)return void 0;var l=(-n.distance-e.dot(s,o))/c;return 0>l?void 0:(i=e.multiplyByScalar(u,l,i),e.add(o,i,i))};var y=new e,v=new e,g=new e,w=new e,x=new e;p.rayTriangle=function(t,n,i,a,o,u){var s=l(t,n,i,a,o);return!r(s)||0>s?void 0:(r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u))};var E=new c;p.lineSegmentTriangle=function(t,n,i,a,o,u,s){var c=E;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var f=l(c,i,a,o,u);return!r(f)||0>f||f>e.distance(t,n)?void 0:(r(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var S={root0:0,root1:0};p.raySphere=function(e,t,n){return n=h(e,t,n),!r(n)||n.stop<0?void 0:(n.start=Math.max(n.start,0),n)};var _=new c;p.lineSegmentSphere=function(t,n,i,a){var o=_;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),a=h(o,i,a),!r(a)||a.stop<0||a.start>s?void 0:(a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a)};var O=new e,M=new e;p.rayEllipsoid=function(t,n){var r,i,a,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,O),l=e.multiplyComponents(s,t.direction,M),f=e.magnitudeSquared(c),h=e.dot(c,l);if(f>1){if(h>=0)return void 0;var d=h*h;if(r=f-1,i=e.magnitudeSquared(l),a=i*r,a>d)return void 0;if(d>a){o=h*h-a,u=-h+Math.sqrt(o);var m=u/i,p=r/u;return p>m?{start:m,stop:p}:{start:p,stop:m}}var y=Math.sqrt(r/i);return{start:y,stop:y}}return 1>f?(r=f-1,i=e.magnitudeSquared(l),a=i*r,o=h*h-a,u=-h+Math.sqrt(o),{start:0,stop:u/i}):0>h?(i=e.magnitudeSquared(l),{start:0,stop:-h/i}):void 0};var T=new e,P=new e,C=new e,R=new e,N=new e,I=new o,b=new o,z=new o,A=new o,D=new o,U=new o,q=new o,L=new e,W=new e,B=new t;p.grazingAltitudeLocation=function(t,n){var i=t.origin,u=t.direction,s=n.geodeticSurfaceNormal(i);if(e.dot(u,s)>=0)return i;var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u),f=e.normalize(l,T),h=e.mostOrthogonalAxis(l,R),d=e.normalize(e.cross(h,f,P),P),p=e.normalize(e.cross(f,d,C),C),y=I;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 v=o.transpose(y,b),g=o.fromScale(n.radii,z),w=o.fromScale(n.oneOverRadii,A),x=D;x[0]=0,x[1]=-u.z,x[2]=u.y,x[3]=u.z,x[4]=0,x[5]=-u.x,x[6]=-u.y,x[7]=u.x,x[8]=0;var E,S,_=o.multiply(o.multiply(v,w,U),x,U),O=o.multiply(o.multiply(_,g,q),y,q),M=o.multiplyByVector(_,i,N),F=m(O,e.negate(M,T),0,0,1),G=F.length;if(G>0){for(var Y=e.clone(e.ZERO,W),j=Number.NEGATIVE_INFINITY,V=0;G>V;++V){E=o.multiplyByVector(g,o.multiplyByVector(y,F[V],L),L);var H=e.normalize(e.subtract(E,i,R),R),k=e.dot(H,u);k>j&&(j=k,Y=e.clone(E,Y))}var X=n.cartesianToCartographic(Y,B);return j=a.clamp(j,0,1),S=e.magnitude(e.subtract(Y,i,R))*Math.sqrt(1-j*j),S=c?-S:S,X.height=S,n.cartographicToCartesian(X)}return void 0};var F=new e;return p.lineSegmentPlane=function(t,n,i,o){r(o)||(o=new e);var u=e.subtract(n,t,F),s=i.normal,c=e.dot(s,u);if(Math.abs(c)<a.EPSILON6)return void 0;var l=e.dot(s,t),f=-(i.distance+l)/c;return 0>f||f>1?void 0:(e.multiplyByScalar(u,f,o),e.add(t,o,o),o)},p.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 p.lineSegmentPlane(t,n,i,f),p.lineSegmentPlane(t,r,i,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(n,r,i,f),p.lineSegmentPlane(n,t,i,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(r,t,i,f),p.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 p.lineSegmentPlane(n,t,i,f),p.lineSegmentPlane(r,t,i,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(r,n,i,f),p.lineSegmentPlane(t,n,i,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,r,i,f),p.lineSegmentPlane(n,r,i,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},p}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var n=function(t,n){this.normal=e.clone(t),this.distance=n};return n.fromPointNormal=function(r,i,a){var o=-e.dot(i,r);return t(a)?(e.clone(i,a.normal),a.distance=o,a):new n(i,o)},n.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},n}),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(r){return a(r)}});return n}function a(e){var n=new r(function(n,r){try{return r?t(r(e)):a(e)}catch(i){return a(i)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return m(e)}function i(e){return m(a(e))}function u(e){return d(e)}var s,c,l,f,h,d,m;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(t){r.progress(t)}}: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 p(f,e),e},m=function(e){return e=t(e),h=e.then,m=t,d=v,p(l,e),f=l=E,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){p(e)}function s(e){m(e)}var c,l,f,h,d,m,p,y,g,w;if(g=t.length>>>0,c=Math.max(0,Math.min(n,g)),f=[],l=g-c+1,h=[],d=o(),c)for(y=d.progress,p=function(e){h.push(e),--l||(m=p=v,d.reject(h))},m=function(e){f.push(e),--c||(m=p=v,d.resolve(f))},w=0;g>w;++w)w in t&&e(t[w],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,g).then(t,n,r)}function f(){return h(arguments,g)}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;i>s;s++)s in t?u(t[s],s):--a;else c.resolve(r);return c.promise})}function d(t,n){var r=x.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)})})},w.apply(t,r)})}function m(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 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 v(){}function g(e){return e}var w,x,E;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=m,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(E,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(E,t)})})}},x=[].slice,w=[].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(;i>a;++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(){"use strict";var e=function(e,t,n){for(var r,i,a=0,o=e.length-1;o>=a;)if(r=~~((a+o)/2),i=n(e[r],t),0>i)a=r+1;else{if(!(i>0))return r;o=r-1}return~(o+1)};return e}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";var e=function(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,m,p,y,v;if("%%"==e)return"%";for(var g=!1,w="",x=!1,E=!1,S=" ",_=s.length,O=0;s&&_>O;O++)switch(s.charAt(O)){case" ":w=" ";break;case"+":w="+";break;case"-":g=!0;break;case"'":S=s.charAt(O+1);break;case"0":x=!0;break;case"#":E=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(c=-c,g=!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,v=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(v),g,c,f,x,S);case"c":return u(String.fromCharCode(+v),g,c,f,x);case"b":return o(v,2,E,g,c,f,x);case"o":return o(v,8,E,g,c,f,x);case"x":return o(v,16,E,g,c,f,x);case"X":return o(v,16,E,g,c,f,x).toUpperCase();case"u":return o(v,10,E,g,c,f,x);case"i":case"d":return d=+v||0,d=Math.round(d-d%1),m=0>d?"-":w,v=m+i(String(Math.abs(d)),f,"0",!1),a(v,m,g,c,x);case"e":case"E":case"f":case"F":case"g":case"G":return d=+v,m=0>d?"-":w,p=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],y=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],v=m+Math.abs(d)[p](f),a(v,m,g,c,x)[y]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";var e=function(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(){"use strict";function e(e){return 0===e%4&&0!==e%100||0===e%400}return e}),define("Core/LeapSecond",[],function(){"use strict";var e=function(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 R.compare(e.julianDate,t.julianDate)}function f(e){g.julianDate=e;var n=R.leapSeconds,r=t(n,g,l);0>r&&(r=~r),r>=n.length&&(r=n.length-1);var i=n[r].offset;if(r>0){var a=R.secondsDifference(n[r].julianDate,e);a>i&&(r--,i=n[r].offset)}R.addSeconds(e,i,e)}function h(e,n){g.julianDate=e;var r=R.leapSeconds,i=t(r,g,l);if(0>i&&(i=~i),0===i)return R.addSeconds(e,-r[0].offset,n);if(i>=r.length)return R.addSeconds(e,-r[i-1].offset,n);var a=R.secondsDifference(r[i].julianDate,e);return 0===a?R.addSeconds(e,-r[i].offset,n):1>=a?void 0:R.addSeconds(e,-r[--i].offset,n)}function d(e,t,n){var r=0|t/s.SECONDS_PER_DAY;return e+=r,t-=s.SECONDS_PER_DAY*r,0>t&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function m(e,t,n,r,i,a,o){var u=0|(t-14)/12,c=e+4800+u,l=(0|1461*c/4)+(0|367*(t-2-12*u)/12)-(0|3*((c+100)/100)/4)+n-32075;r-=12,0>r&&(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]}var p=new a,y=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,g=new u,w=/^(\d{4})$/,x=/^(\d{4})-(\d{2})$/,E=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,_=/^(\d{4})-?(\d{2})-?(\d{2})$/,O=/([Z+\-])?(\d{2})?:?(\d{2})?$/,M=/^(\d{2})(\.\d+)?/.source+O.source,T=/^(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,P=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,C="Invalid ISO 8601 date.",R=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 i=0|e;t+=(e-i)*s.SECONDS_PER_DAY,d(i,t,this),r===c.UTC&&f(this)};R.fromDate=function(e,t){var n=m(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 R(n[0],n[1],c.UTC)},R.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,u,s=e.split("T"),l=1,h=1,p=0,g=0,O=0,N=0,I=s[0],b=s[1];if(!r(I))throw new i(C);var z;if(s=I.match(_),null!==s){if(z=I.split("-").length-1,z>0&&2!==z)throw new i(C);n=+s[1],l=+s[2],h=+s[3]}else if(s=I.match(x),null!==s)n=+s[1],l=+s[2];else if(s=I.match(w),null!==s)n=+s[1];else{var A;if(s=I.match(E),null!==s){if(n=+s[1],A=+s[2],u=o(n),1>A||u&&A>366||!u&&A>365)throw new i(C)}else{if(s=I.match(S),null===s)throw new i(C);n=+s[1];var D=+s[2],U=+s[3]||0;if(z=I.split("-").length-1,z>0&&(!r(s[3])&&1!==z||r(s[3])&&2!==z))throw new i(C);var q=new Date(Date.UTC(n,0,4));A=7*D+U-q.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(A),l=a.getUTCMonth()+1,h=a.getUTCDate()}if(u=o(n),1>l||l>12||1>h||(2!==l||!u)&&h>y[l-1]||u&&2===l&&h>v)throw new i(C);var L;if(r(b)){if(s=b.match(P),null!==s){if(z=b.split(":").length-1,z>0&&2!==z&&3!==z)throw new i(C);p=+s[1],g=+s[2],O=+s[3],N=1e3*+(s[4]||0),L=5}else if(s=b.match(T),null!==s){if(z=b.split(":").length-1,z>0&&1!==z)throw new i(C);p=+s[1],g=+s[2],O=60*+(s[3]||0),L=4}else{if(s=b.match(M),null===s)throw new i(C);p=+s[1],g=60*+(s[2]||0),L=3}if(g>=60||O>=61||p>24||24===p&&(g>0||O>0||N>0))throw new i(C);var W=s[L],B=+s[L+1],F=+(s[L+2]||0);switch(W){case"+":p-=B,g-=F;break;case"-":p+=B,g+=F;break;case"Z":break;default:g+=new Date(Date.UTC(n,l-1,h,p,g)).getTimezoneOffset()}}else g+=new Date(Date.UTC(n,l-1,h)).getTimezoneOffset();var G=60===O;for(G&&O--;g>=60;)g-=60,p++;for(;p>=24;)p-=24,h++;for(a=u&&2===l?v:y[l-1];h>a;)h-=a,l++,l>12&&(l-=12,n++),a=u&&2===l?v:y[l-1];for(;0>g;)g+=60,p--;for(;0>p;)p+=24,h--;for(;1>h;)l--,1>l&&(l+=12,n--),a=u&&2===l?v:y[l-1],h+=a;var Y=m(n,l,h,p,g,O,N);return r(t)?(d(Y[0],Y[1],t),f(t)):t=new R(Y[0],Y[1],c.UTC),G&&R.addSeconds(t,1,t),t},R.now=function(e){return R.fromDate(new Date,e)};var N=new R(0,0,c.TAI);return R.toGregorianDate=function(e,t){var n=!1,i=h(e,N);r(i)||(R.addSeconds(e,-1,N),i=h(N,N),n=!0);var o=i.dayNumber,u=i.secondsOfDay;u>=43200&&(o+=1);var c=0|o+68569,l=0|4*c/146097;c=0|c-(0|(146097*l+3)/4);var f=0|4e3*(c+1)/1461001;c=0|c-(0|1461*f/4)+31;var d=0|80*c/2447,m=0|c-(0|2447*d/80);c=0|d/11;var p=0|d+2-12*c,y=0|100*(l-49)+f+c,v=0|u/s.SECONDS_PER_HOUR,g=u-v*s.SECONDS_PER_HOUR,w=0|g/s.SECONDS_PER_MINUTE;g-=w*s.SECONDS_PER_MINUTE;var x=0|g,E=(g-x)/s.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),n&&(x+=1),r(t)?(t.year=y,t.month=p,t.day=m,t.hour=v,t.minute=w,t.second=x,t.millisecond=E,t.isLeapSecond=n,t):new a(y,p,m,v,w,x,E,n)},R.toDate=function(e){var t=R.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))},R.toIso8601=function(t,n){var i,a=R.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))},R.clone=function(e,t){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new R(e.dayNumber,e.secondsOfDay,c.TAI):void 0},R.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},R.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},R.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(R.secondsDifference(e,t))<=n},R.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},R.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},R.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},R.computeTaiMinusUtc=function(e){g.julianDate=e;var n=R.leapSeconds,r=t(n,g,l);return 0>r&&(r=~r,--r,0>r&&(r=0)),n[r].offset},R.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},R.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},R.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},R.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},R.lessThan=function(e,t){return R.compare(e,t)<0},R.lessThanOrEquals=function(e,t){return R.compare(e,t)<=0},R.greaterThan=function(e,t){return R.compare(e,t)>0},R.greaterThanOrEquals=function(e,t){return R.compare(e,t)>=0},R.prototype.clone=function(e){return R.clone(this,e)},R.prototype.equals=function(e){return R.equals(this,e)},R.prototype.equalsEpsilon=function(e,t){return R.equalsEpsilon(this,e,t)},R.prototype.toString=function(){return R.toIso8601(this)},R.leapSeconds=[new u(new R(2441317,43210,c.TAI),10),new u(new R(2441499,43211,c.TAI),11),new u(new R(2441683,43212,c.TAI),12),new u(new R(2442048,43213,c.TAI),13),new u(new R(2442413,43214,c.TAI),14),new u(new R(2442778,43215,c.TAI),15),new u(new R(2443144,43216,c.TAI),16),new u(new R(2443509,43217,c.TAI),17),new u(new R(2443874,43218,c.TAI),18),new u(new R(2444239,43219,c.TAI),19),new u(new R(2444786,43220,c.TAI),20),new u(new R(2445151,43221,c.TAI),21),new u(new R(2445516,43222,c.TAI),22),new u(new R(2446247,43223,c.TAI),23),new u(new R(2447161,43224,c.TAI),24),new u(new R(2447892,43225,c.TAI),25),new u(new R(2448257,43226,c.TAI),26),new u(new R(2448804,43227,c.TAI),27),new u(new R(2449169,43228,c.TAI),28),new u(new R(2449534,43229,c.TAI),29),new u(new R(2450083,43230,c.TAI),30),new u(new R(2450630,43231,c.TAI),31),new u(new R(2451179,43232,c.TAI),32),new u(new R(2453736,43233,c.TAI),33),new u(new R(2454832,43234,c.TAI),34),new u(new R(2456109,43235,c.TAI),35)],R}),define("Core/clone",["./defaultValue"],function(e){"use strict";var t=function(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";var e=function(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";var n=function(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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,n,r,i,a){"use strict";function o(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function u(e,t){for(var n=o(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 s(e,n){n=t(n,"");var i=e[1],a=!!e[2],s=e[3];switch(n){case"":case"text":return o(a,s);case"arraybuffer":return u(a,s);case"blob":var c=u(a,s);return new Blob([c],{type:i});case"document":var l=new DOMParser;return l.parseFromString(o(a,s),i);case"json":return JSON.parse(o(a,s));default:throw new r("Unhandled responseType: "+n)}}var c=function(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,i=t(n.method,"GET"),a=n.data,o=n.headers,u=n.overrideMimeType,s=n.withCredentials;return e(n.url,function(t){var n=e.defer();return c.load(t,r,i,a,o,n,u,s),n.promise})},l=/^data:(.*?)(;base64)?,(.*)$/;return c.load=function(e,t,r,o,u,c,f,h){var d=l.exec(e);if(null!==d)return c.resolve(s(d,t)),void 0;var m=new XMLHttpRequest;if(n(f)&&n(m.overrideMimeType)&&m.overrideMimeType(f),m.open(r,e,!0),n(u))for(var p in u)u.hasOwnProperty(p)&&m.setRequestHeader(p,u[p]);n(t)&&(m.responseType=t),n(h)&&(m.withCredentials=h),m.onload=function(){200===m.status?n(m.response)?c.resolve(m.response):n(m.responseXML)&&m.responseXML.hasChildNodes()?c.resolve(m.responseXML):n(m.responseText)?c.resolve(m.responseText):c.reject(new a("unknown XMLHttpRequest response type.")):c.reject(new i(m.status,m.response,m.getAllResponseHeaders()))},m.onerror=function(){c.reject(new i)},m.send(o)},c.defaultLoad=c.load,c}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";var n=function(n,r){return e({url:n,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})};return n}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";var i={Accept:"application/json,*/*;q=0.01"},a=function(n,a){return t(a)||(a={}),t(a.headers)?t(a.headers.Accept)||(a.headers=e(a.headers),a.headers.Accept=i.Accept):a.headers=i,r(n,a).then(function(e){return JSON.parse(e)})};return a}),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(e,t){return o.compare(e.julianDate,t)}function d(e,n){if(!r(n.columnNames))return e._dataError="Error in loaded EOP data: The columnNames property is required.",void 0;if(!r(n.samples))return e._dataError="Error in loaded EOP data: The samples property is required.",void 0;var i=n.columnNames.indexOf("modifiedJulianDateUtc"),a=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),d=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),p=n.columnNames.indexOf("taiMinusUtcSeconds");if(0>i||0>a||0>s||0>c||0>d||0>m||0>p)return e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns",void 0;var y=e._samples=n.samples,v=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=a,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=m,e._taiMinusUtcSecondsColumn=p,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var g,w=e._addNewLeapSeconds,x=0,E=y.length;E>x;x+=e._columnCount){var S=y[x+i],_=y[x+p],O=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,M=new o(O,_,f.TAI);if(v.push(M),w){if(_!==g&&r(g)){var T=o.leapSeconds,P=t(T,M,h);if(0>P){var C=new u(M,_);T.splice(~P,0,C)}}g=_}}}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 y(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,y=n[h+e._ut1MinusUtcSecondsColumn],v=n[d+e._ut1MinusUtcSecondsColumn],g=v-y;if(g>.5||-.5>g){var w=n[h+e._taiMinusUtcSecondsColumn],x=n[d+e._taiMinusUtcSecondsColumn];w!==x&&(l.equals(r)?y=v:v-=x-w)}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,y,v),u}var v=function(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:[]})};return v.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}}),v.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},v.prototype.compute=function(e,n){if(!r(this._samples)){if(r(this._dataError))throw new c(this._dataError);return void 0}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),m=!r(h),p=m||o.greaterThanOrEquals(h,e);if(d&&p)return s=u,!m&&h.equals(e)&&++s,l=s+1,y(this,a,this._samples,e,s,l,n),n}var v=t(a,e,o.compare,this._dateColumn);return v>=0?(v<a.length-1&&a[v+1].equals(e)&&++v,s=v,l=v):(l=~v,s=l-1,0>s&&(s=0)),this._lastIndex=s,y(this,a,this._samples,e,s,l,n),n},v}),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()):(n.path=t.authority&&""==t.path?"/"+this.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];for(r&&t.shift(),""==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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","require"],function(e,t,n,r){"use strict";function i(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),i=f.exec(r);if(null!==i)return i[1]}return void 0}function a(){if(t(s))return s;var r;if(r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:i(),!t(r))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return s=new e(r).resolve(new e(document.location.href))}function o(e){return r.toUrl("../"+e)}function u(t){return new e(t).resolve(a()).toString()}var s,c,l,f=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i,h=function(e){t(c)||(c=t(r.toUrl)?o:u),t(l)||(l=document.createElement("a"));var n=c(e);return l.href=n,l.href=l.href,l.href};return h._cesiumScriptRegex=f,h}),define("Core/Iau2006XysSample",[],function(){"use strict";var e=function(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,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,a.daysDifference(r,e._sampleZeroDateTT)}function c(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=3*i*n._samplesPerXysFile,u=0,s=r.length;s>u;++u)t[o+u]=r[u];a.resolve()}),a.promise}var l=function(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;t>=s;++s){r[s]=o,i[s]=s*this._stepSizeDays;for(var c=0;t>=c;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)},f=new a(0,0,u.TAI);return l.prototype.preload=function(t,n,r,i){var a=s(this,t,n),o=s(this,r,i),u=0|a/this._stepSizeDays-this._interpolationOrder/2;0>u&&(u=0);var l=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var f=0|u/this._samplesPerXysFile,h=0|l/this._samplesPerXysFile,d=[],m=f;h>=m;++m)d.push(c(this,m));return e.all(d)},l.prototype.computeXysRadians=function(e,t,n){var a=s(this,e,t);if(0>a)return void 0;var o=0|a/this._stepSizeDays;if(o>=this._totalSamples)return void 0;var u=this._interpolationOrder,l=o-(0|u/2);0>l&&(l=0);var f=l+u;f>=this._totalSamples&&(f=this._totalSamples-1,l=f-u,0>l&&(l=0));var h=!1,d=this._samples;if(r(d[3*l])||(c(this,0|l/this._samplesPerXysFile),h=!0),r(d[3*f])||(c(this,0|f/this._samplesPerXysFile),h=!0),h)return void 0;r(n)?(n.x=0,n.y=0,n.s=0):n=new i(0,0,0);var m,p,y=a-l*this._stepSizeDays,v=this._work,g=this._denominators,w=this._coef,x=this._xTable;for(m=0;u>=m;++m)v[m]=y-x[m];for(m=0;u>=m;++m){for(w[m]=1,p=0;u>=p;++p)p!==m&&(w[m]*=v[p]);w[m]*=g[m];var E=3*(l+m);n.x+=w[m]*d[E++],n.y+=w[m]*d[E++],n.s+=w[m]*d[E]}return n},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./TimeConstants"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d,m,p,y){"use strict";var v={},g=new n,w=new n,x=new n;v.eastNorthUpToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return a(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=g,s=w,l=x;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),a(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.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,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var E=new n,S=new n,_=new n;v.northEastDownToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return a(r)?(r[0]=-o,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]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=E,s=S,l=_;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),a(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.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(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},v.northUpEastToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return a(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=o,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(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=g,s=w,l=x;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),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 p(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 O=24110.54841,M=8640184.812866,T=.093104,P=-62e-7,C=1.1772758384668e-19,R=72921158553e-15,N=d.TWO_PI/86400,I=new h;v.computeTemeToPseudoFixedMatrix=function(e,t){I=h.addSeconds(e,-h.computeTaiMinusUtc(e),I);var n,r=I.dayNumber,i=I.secondsOfDay,o=r-2451545;n=i>=43200?(o+.5)/y.DAYS_PER_JULIAN_CENTURY:(o-.5)/y.DAYS_PER_JULIAN_CENTURY;var u=O+n*(M+n*(T+n*P)),s=u*N%d.TWO_PI,c=R+C*(r-2451545.5),l=(i+.5*y.SECONDS_PER_DAY)%y.SECONDS_PER_DAY,f=s+c*l,p=Math.cos(f),v=Math.sin(f);return a(t)?(t[0]=p,t[1]=-v,t[2]=0,t[3]=v,t[4]=p,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(p,v,0,-v,p,0,0,0,1)},v.iau2006XysData=new l,v.earthOrientationParameters=u.NONE;var b=32.184,z=2451545;v.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+b,i=t.stop.dayNumber,a=t.stop.secondsOfDay+b,o=v.iau2006XysData.preload(n,r,i,a),u=v.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},v.computeIcrfToFixedMatrix=function(e,t){a(t)||(t=new m);var n=v.computeFixedToIcrfMatrix(e,t);return a(n)?m.transpose(n,t):void 0};var A=new f(0,0,0),D=new s(0,0,0,0,0,0),U=new m,q=new m;v.computeFixedToIcrfMatrix=function(e,t){a(t)||(t=new m);var n=v.earthOrientationParameters.compute(e,D);if(!a(n))return void 0;var r=e.dayNumber,i=e.secondsOfDay+b,o=v.iau2006XysData.computeXysRadians(r,i,A);if(!a(o))return void 0;var u=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=U;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(-o.s,q),p=m.multiply(l,f,U),g=e.dayNumber,w=e.secondsOfDay-h.computeTaiMinusUtc(e)+n.ut1MinusUtc,x=g-2451545,E=w/y.SECONDS_PER_DAY,S=.779057273264+E+.00273781191135448*(x+E);S=S%1*d.TWO_PI;var _=m.fromRotationZ(S,q),O=m.multiply(p,_,U),M=Math.cos(n.xPoleWander),T=Math.cos(n.yPoleWander),P=Math.sin(n.xPoleWander),C=Math.sin(n.yPoleWander),R=r-z+i/y.SECONDS_PER_DAY;R/=36525;var N=-47e-6*R*d.RADIANS_PER_DEGREE/3600,I=Math.cos(N),L=Math.sin(N),W=q;return W[0]=M*I,W[1]=M*L,W[2]=P,W[3]=-T*L+C*P*I,W[4]=T*I+C*P*L,W[5]=-C*M,W[6]=-C*L-T*P*I,W[7]=C*I-T*P*L,W[8]=T*M,m.multiply(O,W,t)};var L=new r;return v.pointToWindowCoordinates=function(e,t,n,r){return r=v.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},v.pointToGLWindowCoordinates=function(e,n,i,o){a(o)||(o=new t);var u=L;return p.multiplyByVector(e,r.fromElements(i.x,i.y,i.z,1,u),u),r.multiplyByScalar(u,1/u.w,u),p.multiplyByVector(n,u,u),t.fromCartesian4(u,o)},v}),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";var m=new r,p=function(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)};o(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}}});var y=new e;p.fromPoints=function(t,n){var r=e.fromPoints(t,y);return new p(r.center,n)};var v=new h,g=new n;p.prototype.projectPointOntoPlane=function(e,r){var i=v;i.origin=e,n.normalize(e,i.direction);var o=c.rayPlane(i,this._plane,g);if(a(o)||(n.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,g)),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)}return void 0},p.prototype.projectPointsOntoPlane=function(e,t){a(t)||(t=[]);for(var n=0,r=e.length,i=0;r>i;i++){var o=this.projectPointOntoPlane(e[i],t[n]);a(o)&&(t[n]=o,n++)}return t.length=n,t};var w=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=w,l=0;r>l;++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/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";var r=new t,i=new t,a=new t,o=function(o,u,s,c,l){n(l)||(l=new t);var f,h,d,m,p,y,v,g;n(u.z)?(f=t.subtract(s,u,r),h=t.subtract(c,u,i),d=t.subtract(o,u,a),m=t.dot(f,f),p=t.dot(f,h),y=t.dot(f,d),v=t.dot(h,h),g=t.dot(h,d)):(f=e.subtract(s,u,r),h=e.subtract(c,u,i),d=e.subtract(o,u,a),m=e.dot(f,f),p=e.dot(f,h),y=e.dot(f,d),v=e.dot(h,h),g=e.dot(h,d));var w=1/(m*v-p*p);return l.y=(v*y-p*g)*w,l.z=(m*g-p*y)*w,l.x=1-l.y-l.z,l};return o}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";var n=new t,r=function(t,r,i,a){return e(t,r,i,a,n),n.x>0&&n.y>0&&n.z>0};return r}),define("Core/Queue",[],function(){"use strict";var e=function(){this._array=[],this._offset=0,this.length=0};return e.prototype.enqueue=function(e){this._array.push(e),this.length++},e.prototype.dequeue=function(){if(0===this.length)return void 0;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},e.prototype.contains=function(e){return-1!==this._array.indexOf(e)},e.prototype.clear=function(){this._array.length=this._offset=this.length=0},e.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},e}),define("Core/WindingOrder",["./freezeObject"],function(e){"use strict";var t={CLOCKWISE:2304,COUNTER_CLOCKWISE:2305,validate:function(e){return e===t.CLOCKWISE||e===t.COUNTER_CLOCKWISE}};return e(t)}),define("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d,m){"use strict";function p(t,n,r){var i=e.subtract(n,t,L),a=e.subtract(r,n,W);return i.x*a.y-i.y*a.x>=0}function y(e){for(var t=e[0].x,n=0,r=0;r<e.length;r++)e[r].x>t&&(t=e[r].x,n=r);return n}function v(e){for(var t=e[0][0].x,n=0,r=0;r<e.length;r++){var i=e[r][y(e[r])].x;i>t&&(t=i,n=r)}return n}function g(e){for(var t=[],n=0;n<e.length;n++){var r=e[(n-1+e.length)%e.length],i=e[n],a=e[(n+1)%e.length];p(r,i,a)||t.push(i)}return t}function w(t,n){for(var r=0;r<t.length;r++)if(e.equals(n,t[r]))return r;return-1}function x(n,i,a){a=r(a,[]);var o=Number.MAX_VALUE,u=y(i),s=new e(i[u].x,n.y);a.push(u),a.push((u+1)%i.length);for(var c=i[0].x,l=c,f=1;f<i.length;++f)i[f].x<c?c=i[f].x:i[f].x>l&&(l=i[f].x);l+=l-c;var h=new t(l,n.y,0);for(f=0;f<i.length;f++){var d=i[f],m=i[(f+1)%i.length];if((d.x>=n.x||m.x>=n.x)&&(d.y>=n.y&&m.y<=n.y||d.y<=n.y&&m.y>=n.y)){var p=(m.y-d.y)*(h.x-n.x)-(m.x-d.x)*(h.y-n.y);if(0!==p){p=1/p;var v=((m.x-d.x)*(n.y-d.y)-(m.y-d.y)*(n.x-d.x))*p,g=((h.x-n.x)*(n.y-d.y)-(h.y-n.y)*(n.x-d.x))*p;if(v>=0&&1>=v&&g>=0&&1>=g){var w=new e(n.x+v*(h.x-n.x),n.y+v*(h.y-n.y)),x=e.subtract(w,n,B);p=e.magnitudeSquared(x),o>p&&(s=w,o=p,a[0]=f,a[1]=(f+1)%i.length)}}}}return s}function E(t,n){var r=v(n),i=n[r],a=y(i),o=i[a],u=[],s=x(o,t,u),c=w(t,s);if(-1!==c)return c;var h=e.magnitudeSquared(e.subtract(t[u[0]],o,F)),d=e.magnitudeSquared(e.subtract(t[u[1]],o,F)),m=d>h?t[u[0]]:t[u[1]],p=g(t),E=p.indexOf(m);-1!==E&&p.splice(E,1);for(var S=[],_=0;_<p.length;_++){var O=p[_];f(O,o,s,m)&&S.push(O)}var M=Number.MAX_VALUE;if(S.length>0){var T=e.fromElements(1,0,F);for(_=0;_<S.length;_++){var P=e.subtract(S[_],o,G),C=e.magnitude(T)*e.magnitudeSquared(P);if(0!==C){var R=Math.abs(l.acosClamped(e.dot(T,P)/C));M>R&&(M=R,m=S[_])}}}return t.indexOf(m)}function S(e,n,r){for(var i=ut.computeWindingOrder2D(e),a=0;a<n.length;a++){var o=n[a];t.equals(o[0],o[o.length-1])||o.push(o[0]);var s=ut.computeWindingOrder2D(o);s===i&&o.reverse()}var c=u.fromPoints(e,r),l=c.projectPointsOntoPlane(e),f=[];for(a=0;a<n.length;a++)f.push(c.projectPointsOntoPlane(n[a]));var h=E(l,f),d=v(f),m=y(f[d]),p=n[d],g=[];for(a=0;a<e.length;a++)g.push(e[a]);var w,x=[];if(0!==m)for(w=0;w<=p.length;w++){var S=(w+m)%p.length;0!==S&&x.push(p[S])}else for(w=0;w<p.length;w++)x.push(p[(w+m)%p.length]);var _=g.lastIndexOf(e[h]);x.push(e[_]);var O=g.slice(0,_+1),M=g.slice(_+1);return g=O.concat(x,M),n.splice(d,1),g}function _(e){var t="0."+Math.sin(Y).toString().substr(5);Y+=.2;var n=Math.floor(t*e);return n===e&&n--,n}function O(t,n,r){return M(t,n,r)&&M(n,t,r)&&!A(r[t].position,r[n].position,r)&&!e.equals(r[t].position,r[n].position)}function M(t,n,r){C(t,r);var i=r[t],a=r[n],o=P(t,r,j),u=P(t,r,V),s=e.subtract(r[o].position,i.position,H),c=e.subtract(r[u].position,i.position,k),l=e.subtract(a.position,i.position,X);return R(s,l)?T(s,l):R(c,l)?T(c,l):N(s,c)?z(s,c,l)?!0:!1:I(s,c)?b(s,c,l)?!1:!0:void 0}function T(t,n){return e.magnitude(n)<e.magnitude(t)}function P(e,t,n){var r=e+n;return 0>r&&(r=t.length-1),r===t.length&&(r=0),C(r,t),r}function C(t,n){var r=t-1,i=t+1;0>r&&(r=n.length-1),i===n.length&&(i=0);var o=e.subtract(n[r].position,n[t].position,Z),u=e.subtract(n[i].position,n[t].position,J);if(R(o,u)){var s=new a("Superfluous vertex found.");throw s.vertexIndex=t,s}}function R(e,n){return 0===t.cross(e,n,K).z}function N(e,n){return t.cross(e,n,$).z<0}function I(e,n){return t.cross(e,n,Q).z>0}function b(e,n,r){return t.cross(e,r,et).z>0&&t.cross(r,n,et).z>0}function z(e,n,r){return t.cross(e,r,tt).z<0&&t.cross(r,n,tt).z<0}function A(t,n,r){for(var i=0;i<r.length;i++){var a,o=r[i].position;if(a=i<r.length-1?r[i+1].position:r[0].position,!(e.equals(t,o)||e.equals(n,a)||e.equals(t,a)||e.equals(n,o))){var u=(n.y-t.y)/(n.x-t.x),s=(a.y-o.y)/(a.x-o.x);if(!(u===s||isNaN(u)&&isNaN(s))){var c;c=isNaN(u)?t.x:isNaN(s)?o.x:(t.y-o.y-u*t.x+s*o.x)/(s-u);var l=u*c+t.y-u*t.x,f=e.fromElements(c,l,nt);if(!(e.equals(f,t)||e.equals(f,n)||e.equals(f,o)||e.equals(f,a))){var h=U(c,t.x,n.x)&&U(l,t.y,n.y)&&U(c,o.x,a.x)&&U(l,o.y,a.y);if(h)return!0}}}}return!1}function D(t){var n=t[0].position,r=t[1].position,i=t[2].position,a=e.subtract(r,n,rt),o=e.subtract(i,n,it);return R(a,o)}function U(e,t,n){return(e>t||e>n)&&(t>e||n>e)||t===n&&t===e}function q(e){var t=e.length;if(3===t)return D(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new a("Invalid polygon: must have at least three vertices.");for(var n=!1,r=0;!n;){var i=10*e.length;if(r>i)return[];r++;for(var o=_(e.length),u=o+1;Math.abs(o-u)<2||Math.abs(o-u)>e.length-2;)u=_(e.length);if(o>u){var s=o;o=u,u=s}try{if(O(o,u,e)){var c=e.splice(o,u-o+1,e[o],e[u]);return q(e).concat(q(c))}}catch(l){if(l.hasOwnProperty("vertexIndex"))return e.splice(l.vertexIndex,1),q(e);throw l}}}var L=new e,W=new e,B=new e,F=new e(1,0),G=new e,Y=0,j=-1,V=1,H=new t,k=new t,X=new t,Z=new t,J=new t,K=new t,$=new t,Q=new t,et=new t,tt=new t,nt=new e,rt=new t,it=new t,at=new t,ot=new t,ut={};return ut.removeDuplicates=function(e){for(var n=e.length,r=[],i=n-1,a=0;n>a;i=a++){var o=e[i],u=e[a];t.equals(o,u)||r.push(u)}return r},ut.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,i=0;t>i;r=i++){var a=e[r],o=e[i];n+=a.x*o.y-o.x*a.y}return.5*n},ut.computeWindingOrder2D=function(e){var t=ut.computeArea2D(e);return t>0?m.COUNTER_CLOCKWISE:m.CLOCKWISE},ut.triangulate=function(e){for(var t=e.length,n=[],r=0;t>r;++r)n[r]={position:e[r],index:r};return q(n)},ut.resetSeed=function(e){Y=r(e,0)},ut.computeSubdivision=function(e,i,a){a=r(a,l.RADIANS_PER_DEGREE);for(var o=new d,u=i.length,f=0;u>f;f+=3)o.enqueue({i0:i[f],i1:i[f+1],i2:i[f+2]});for(var m,p=e.slice(0),y=[],v={};o.length>0;){var g,w,x=o.dequeue(),E=p[x.i0],S=p[x.i1],_=p[x.i2],O=t.angleBetween(E,S),M=t.angleBetween(S,_),T=t.angleBetween(_,E),P=Math.max(O,Math.max(M,T));P>a?O===P?(g=Math.min(x.i0,x.i1).toString()+" "+Math.max(x.i0,x.i1).toString(),m=v[g],m||(w=t.add(E,S,new t),t.multiplyByScalar(w,.5,w),p.push(w),m=p.length-1,v[g]=m),o.enqueue({i0:x.i0,i1:m,i2:x.i2}),o.enqueue({i0:m,i1:x.i1,i2:x.i2})):M===P?(g=Math.min(x.i1,x.i2).toString()+" "+Math.max(x.i1,x.i2).toString(),m=v[g],m||(w=t.add(S,_,new t),t.multiplyByScalar(w,.5,w),p.push(w),m=p.length-1,v[g]=m),o.enqueue({i0:x.i1,i1:m,i2:x.i0}),o.enqueue({i0:m,i1:x.i2,i2:x.i0})):T===P&&(g=Math.min(x.i2,x.i0).toString()+" "+Math.max(x.i2,x.i0).toString(),m=v[g],m||(w=t.add(_,E,new t),t.multiplyByScalar(w,.5,w),p.push(w),m=p.length-1,v[g]=m),o.enqueue({i0:x.i2,i1:m,i2:x.i1}),o.enqueue({i0:m,i1:x.i0,i2:x.i1})):(y.push(x.i0),y.push(x.i1),y.push(x.i2))}var C=p.length,R=new Array(3*C),N=0;for(m=0;C>m;m++){var I=p[m];R[N++]=I.x,R[N++]=I.y,R[N++]=I.z}return new s({attributes:{position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:R})},indices:y,primitiveType:h.TRIANGLES})},ut.scaleToGeodeticHeight=function(e,n,a,u){a=r(a,o.WGS84);var s=at,c=ot;if(n=r(n,0),u=r(u,!0),i(e)&&i(e.attributes)&&i(e.attributes.position))for(var l=e.attributes.position.values,f=l.length,h=0;f>h;h+=3)t.fromArray(l,h,c),u&&(c=a.scaleToGeodeticSurface(c,c)),s=a.geodeticSurfaceNormal(c,s),t.multiplyByScalar(s,n,s),t.add(c,s,c),l[h]=c.x,l[h+1]=c.y,l[h+2]=c.z;return e},ut.eliminateHoles=function(e,n,i){i=r(i,o.WGS84);for(var a=[],u=0;u<n.length;u++){for(var s=[],c=0;c<n[u].length;c++)s.push(t.clone(n[u][c]));a.push(s)}for(var l=e;a.length>0;)l=S(l,a,i);return l},ut}),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,d=1-h,m=Math.sqrt(d),p=t/4,y=p*p,v=y*p,g=y*y,w=1+p-3*y/4+5*v/4-175*g/64,x=1-p+15*y/8-35*v/8,E=1-3*p+35*y/4,S=1-5*p,_=w*l-x*Math.sin(2*l)*p/2-E*Math.sin(4*l)*y/16-S*Math.sin(6*l)*v/48-5*Math.sin(8*l)*g/512,O=e._constants;O.a=n,O.b=r,O.f=i,O.cosineHeading=a,O.sineHeading=o,O.tanU=u,O.cosineU=s,O.sineU=c,O.sigma=l,O.sineAlpha=f,O.sineSquaredAlpha=h,O.cosineSquaredAlpha=d,O.cosineAlpha=m,O.u2Over4=p,O.u4Over16=y,O.u6Over64=v,O.u8Over256=g,O.a0=w,O.a1=x,O.a2=E,O.a3=S,O.distanceRatio=_}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,d,m=(t-n)/t,p=a-r,y=Math.atan((1-m)*Math.tan(i)),v=Math.atan((1-m)*Math.tan(o)),g=Math.cos(y),w=Math.sin(y),x=Math.cos(v),E=Math.sin(v),S=g*x,_=g*E,O=w*E,M=w*x,T=p,P=u.TWO_PI,C=Math.cos(T),R=Math.sin(T);do{C=Math.cos(T),R=Math.sin(T);var N=_-M*C;f=Math.sqrt(x*x*R*R+N*N),c=O+S*C,s=Math.atan2(f,c);var I;0===f?(I=0,h=1):(I=S*R/f,h=1-I*I),P=T,d=c-2*O/h,isNaN(d)&&(d=0),T=p+l(m,I,h,s,f,c,d)}while(Math.abs(T-P)>u.EPSILON12);var b=h*(t*t-n*n)/(n*n),z=1+b*(4096+b*(b*(320-175*b)-768))/16384,A=b*(256+b*(b*(74-47*b)-128))/1024,D=d*d,U=A*f*(d+A*(c*(2*D-1)-A*d*(4*f*f-3)*(4*D-3)/6)/4),q=n*z*(s-U),L=Math.atan2(x*R,_-M*C),W=Math.atan2(g*R,_*C-M);e._distance=q,e._startHeading=L,e._endHeading=W,e._uSquared=b}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),r.height=0,i.height=0,n._start=t.clone(r,n._start),n._end=t.clone(i,n._end),s(n)}var d=new e,m=new e,p=function(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)};return i(p.prototype,{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){h(this,e,t,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.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),d=Math.sin(8*a),m=a*a,p=a*m,y=i.u8Over256,v=i.u2Over4,g=i.u6Over64,w=i.u4Over16,x=2*p*y*o/3+a*(1-v+7*w/4-15*g/4+579*y/64-(w-15*g/4+187*y/16)*o-(5*g/4-115*y/16)*u-29*y*s/16)+(v/2-w+71*g/32-85*y/16)*c+(5*w/16-5*g/4+383*y/96)*f-m*((g-11*y/2)*c+5*y*f/2)+(29*g/96-29*y/16)*h+539*y*d/1536,E=Math.asin(Math.sin(x)*i.cosineAlpha),S=Math.atan(i.a/i.b*Math.tan(E));x-=i.sigma;var _=Math.cos(2*i.sigma+x),O=Math.sin(x),M=Math.cos(x),T=i.cosineU*M,P=i.sineU*O,C=Math.atan2(O*i.sineHeading,T-P*i.cosineHeading),R=C-l(i.f,i.sineAlpha,i.cosineSquaredAlpha,x,O,M,_);return r(n)?(n.longitude=this._start.longitude+R,n.latitude=S,n.height=0,n):new t(this._start.longitude+R,S,0)},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/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,i=new Array(e);if(t===n){for(r=0;e>r;r++)i[r]=t;return i}var a=n-t,o=a/e;for(r=1;e>r;r++){var u=t+r*o;i[r]=u}return i[0]=t,i}function d(t,n,r,i,a,o,u,s){var c=i.scaleToGeodeticSurface(t,P),l=i.scaleToGeodeticSurface(n,C),f=m.numberOfPoints(t,n,r),d=i.cartesianToCartographic(c,O),p=i.cartesianToCartographic(l,M),y=h(f,a,o);R.setEndPoints(d,p);var v=R.surfaceDistance/f,g=s;d.height=a;var w=i.cartographicToCartesian(d,T);e.pack(w,u,g),g+=3;for(var x=1;f>x;x++){var E=R.interpolateUsingSurfaceDistance(x*v,M);E.height=y[x],w=i.cartographicToCartesian(E,T),e.pack(w,u,g),g+=3}return g}var m={};m.numberOfPoints=function(t,n,r){var i=e.angleBetween(t,n);return Math.ceil(i/r)};var p=new t;m.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),i=0;n>i;i++){var a=e[i];r[i]=t.cartesianToCartographic(a,p).height}return r};var y=new l,v=new e,g=new e,w=new f(e.ZERO,0),x=new e,E=new f(e.ZERO,0),S=new e,_=new e,O=new t,M=new t,T=new e,P=new e,C=new e,R=new o;return m.wrapLongitude=function(t,i){var a=[],o=[];if(r(t)&&t.length>0){i=n(i,l.IDENTITY);var s=l.inverseTransformation(i,y),c=l.multiplyByPoint(s,e.ZERO,v),h=l.multiplyByPointAsVector(s,e.UNIT_Y,g),d=f.fromPointNormal(c,h,w),m=l.multiplyByPointAsVector(s,e.UNIT_X,x),p=f.fromPointNormal(c,m,E),O=1;a.push(e.clone(t[0]));for(var M=a[0],T=t.length,P=1;T>P;++P){var C=t[P];if(f.getPointDistance(p,M)<0||f.getPointDistance(p,C)<0){var R=u.lineSegmentPlane(M,C,d,S);if(r(R)){var N=e.multiplyByScalar(h,5e-9,_);f.getPointDistance(d,M)<0&&e.negate(N,N),a.push(e.add(R,N,new e)),o.push(O+1),e.negate(N,N),a.push(e.add(R,N,new e)),O=1}}a.push(e.clone(t[P])),O++,M=C}o.push(O)}return{positions:a,lengths:o}},m.removeDuplicates=function(t){var n=t.length;if(2>n)return void 0;var r,i,a;for(r=1;n>r&&(i=t[r-1],a=t[r],!e.equals(i,a));++r);if(r===n)return void 0;var o=[];for(o.push(t[0]);n>r;++r)i=t[r-1],a=t[r],e.equals(i,a)||o.push(e.clone(a));return o},m.generateArc=function(t){r(t)||(t={});var i,o,u,l=t.positions,f=n(t.ellipsoid,a.WGS84),h=n(t.height,0),p=n(t.granularity,c.RADIANS_PER_DEGREE),y=l.length,v=0;for(i=0;y-1>i;i++)o=l[i],u=l[i+1],v+=m.numberOfPoints(o,u,p);v++;var g=3*v,w=new Array(g),x=0;for(i=0;y-1>i;i++){o=l[i],u=l[i+1];var E,S;s(h)?(E=h[i],S=h[i+1]):(E=h,S=h),x=d(o,u,p,f,E,S,w,x)}var _=l[y-1],M=f.cartesianToCartographic(_,O);M.height=s(h)?h[y-1]:h;var P=f.cartographicToCartesian(M,T);return e.pack(P,w,g-3),w},m.generateCartesianArc=function(t){for(var n=m.generateArc(t),r=n.length/3,i=new Array(r),a=0;r>a;a++)i[a]=e.unpack(n,3*a);return i},m}),define("Core/WallGeometryLibrary",["./Cartographic","./defined","./DeveloperError","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t){return i.equalsEpsilon(e.latitude,t.latitude,i.EPSILON14)&&i.equalsEpsilon(e.longitude,t.longitude,i.EPSILON14)}function c(n,r,i,a){var o=t(a),u=t(i),c=[],l=[],d=[],m=r.length;if(2>m)return{positions:r};var p=r[0];c.push(p);var y=n.cartesianToCartographic(p,f);u&&(y.height=i[0]),l.push(y.height),o?d.push(a[0]):d.push(0);for(var v=1;m>v;++v){var g=r[v],w=n.cartesianToCartographic(g,h);u&&(w.height=i[v]),s(y,w)?y.height<w.height&&(l[l.length-1]=w.height):(c.push(g),l.push(w.height),o?d.push(a[v]):d.push(0)),e.clone(w,y)}return{positions:c,topHeights:l,bottomHeights:d}}var l={},f=new e,h=new e;return l.computePositions=function(e,t,n,i,s,l){var f=c(e,t,n,i);if(t=f.positions,n=f.topHeights,i=f.bottomHeights,t.length>=3){var h=r.fromPoints(t,e),d=h.projectPointsOntoPlane(t);a.computeWindingOrder2D(d)===u.CLOCKWISE&&(t.reverse(),n.reverse(),i.reverse())}var m,p,y,v,g,w=t.length;if(l){var x=0;for(m=0;w-1>m;m++)v=t[m],g=t[m+1],x+=o.numberOfPoints(v,g,s),x++;p=new Float64Array(3*x),y=new Float64Array(3*x);var E=0;for(m=0;w-1>m;m++){v=t[m],g=t[m+1];var S=n[m],_=n[m+1],O=o.generateArc({positions:[v,g],height:[S,_],granularity:s,ellipsoid:e});p.set(O,E),S=i[m],_=i[m+1],y.set(o.generateArc({positions:[v,g],height:[S,_],granularity:s,ellipsoid:e}),E),E+=O.length}}else p=new Float64Array(o.generateArc({positions:t,height:n,granularity:s,ellipsoid:e})),y=new Float64Array(o.generateArc({positions:t,height:i,granularity:s,ellipsoid:e}));return{bottomPositions:y,topPositions:p}},l}),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,d,m){"use strict";var p=new t,y=new t,v=new t,g=new t,w=new t,x=new t,E=new t,S=new t,_=function(e){e=r(e,r.EMPTY_OBJECT);var t=e.positions,n=e.maximumHeights,i=e.minimumHeights,a=r(e.vertexFormat,d.DEFAULT),u=r(e.granularity,f.RADIANS_PER_DEGREE),s=r(e.ellipsoid,o.WGS84); -this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=a,this._granularity=u,this._ellipsoid=s,this._workerName="createWallGeometry"};return _.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;l>f;++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 _(h)},_.createGeometry=function(r){var i=r._positions,a=r._minimumHeights,o=r._maximumHeights,d=r._vertexFormat,_=r._granularity,O=r._ellipsoid,M=m.computePositions(O,i,o,a,_,!0),T=M.bottomPositions,P=M.topPositions,C=P.length,R=2*C,N=d.position?new Float64Array(R):void 0,I=d.normal?new Float32Array(R):void 0,b=d.tangent?new Float32Array(R):void 0,z=d.binormal?new Float32Array(R):void 0,A=d.st?new Float32Array(2*(R/3)):void 0,D=0,U=0,q=0,L=0,W=0,B=S,F=E,G=x,Y=!0;C/=3;var j;for(j=0;C>j;++j){var V=3*j,H=t.fromArray(P,V,p),k=t.fromArray(T,V,y);if(d.position&&(N[D++]=k.x,N[D++]=k.y,N[D++]=k.z,N[D++]=H.x,N[D++]=H.y,N[D++]=H.z),d.normal||d.tangent||d.binormal){var X,Z=new t,J=O.scaleToGeodeticSurface(t.fromArray(P,V,y),y);if(C>j+1&&(X=O.scaleToGeodeticSurface(t.fromArray(P,V+3,v),v),Z=t.fromArray(P,V+3,w)),Y){var K=t.subtract(Z,H,g),$=t.subtract(J,H,p);B=t.normalize(t.cross($,K,B),B),Y=!1}t.equalsEpsilon(X,J,f.EPSILON6)?Y=!0:(d.tangent&&(F=t.normalize(t.subtract(X,J,F),F)),d.binormal&&(G=t.normalize(t.cross(B,F,G),G))),d.normal&&(I[U++]=B.x,I[U++]=B.y,I[U++]=B.z,I[U++]=B.x,I[U++]=B.y,I[U++]=B.z),d.tangent&&(b[L++]=F.x,b[L++]=F.y,b[L++]=F.z,b[L++]=F.x,b[L++]=F.y,b[L++]=F.z),d.binormal&&(z[q++]=G.x,z[q++]=G.y,z[q++]=G.z,z[q++]=G.x,z[q++]=G.y,z[q++]=G.z)}if(d.st){var Q=j/(C-1);A[W++]=Q,A[W++]=0,A[W++]=Q,A[W++]=1}}var et=new c;d.position&&(et.position=new s({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:N})),d.normal&&(et.normal=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:I})),d.tangent&&(et.tangent=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:b})),d.binormal&&(et.binormal=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:z})),d.st&&(et.st=new s({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:A}));var tt=R/3;R-=6;var nt=l.createTypedArray(tt,R),rt=0;for(j=0;tt-2>j;j+=2){var it=j,at=j+2,ot=t.fromArray(N,3*it,p),ut=t.fromArray(N,3*at,y);if(!t.equalsEpsilon(ot,ut,f.EPSILON6)){var st=j+1,ct=j+3;nt[rt++]=st,nt[rt++]=it,nt[rt++]=ct,nt[rt++]=ct,nt[rt++]=it,nt[rt++]=at}}return new u({attributes:et,indices:nt,primitiveType:h.TRIANGLES,boundingSphere:new e.fromVertices(N)})},_}),define("Workers/createWallGeometry",["../Core/Ellipsoid","../Core/WallGeometry"],function(e,t){"use strict";function n(n){return n._ellipsoid=e.clone(n._ellipsoid),t.createGeometry(n)}return n})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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:0>e?-1:0},a.signNotZero=function(e){return 0>e?-1:1},a.toSNorm=function(e){return Math.round(255*(.5*a.clamp(e,-1,1)+.5))},a.fromSNorm=function(e){return a.clamp(e,0,255)/255*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.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 a>=i||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;e>=r;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}i.fromSpherical=function(n,r){t(r)||(r=new i);var a=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(o),r},i.fromElements=function(e,n,r,a){return t(a)?(a.x=e,a.y=n,a.z=r,a):new i(e,n,r)},i.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 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},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},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 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){i.normalize(e,s),i.normalize(t,c);var n=i.dot(s,c),r=i.magnitude(i.cross(s,c,s));return Math.atan2(r,n)};var l=new i;i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):n.y<=n.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,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},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},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)},i.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},i.fromDegrees=function(e,t,n,r,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,n,r,o)};var f=new i,h=new i,d=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(n,r,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=i.normalize(f,f),i.multiplyComponents(s,f,h);var l=Math.sqrt(i.dot(f,h));return h=i.divideByScalar(h,l,h),f=i.multiplyByScalar(f,a,f),t(u)||(u=new i),i.add(h,f,u)},i.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=a.toRadians(e[o]);return i.fromRadiansArray(r,t,n)},i.fromRadiansArray=function(e,n,r){var a=e.length;t(r)?r.length=a/2:r=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=i.fromRadians(u,s,0,n,r[o/2])}return r},i.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=a.toRadians(e[o]),r[o+1]=a.toRadians(e[o+1]),r[o+2]=e[o+2];return i.fromRadiansArrayHeights(r,t,n)},i.fromRadiansArrayHeights=function(e,n,r){var a=e.length;t(r)?r.length=a/3:r=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=i.fromRadians(u,s,c,n,r[o/3])}return r},i.ZERO=r(new i(0,0,0)),i.UNIT_X=r(new i(1,0,0)),i.UNIT_Y=r(new i(0,1,0)),i.UNIT_Z=r(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,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},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,_=a.z,m=l*l*d*d,p=f*f*E*E,y=h*h*_*_,R=m+p+y,T=Math.sqrt(1/R),A=e.multiplyByScalar(n,T,i);if(s>R)return isFinite(T)?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 M,g,I,w,C,x,P,U,D,L,F,B=(1-T)*e.magnitude(n)/(.5*e.magnitude(O)),z=0;do{B-=z,I=1/(1+B*S),w=1/(1+B*v),C=1/(1+B*N),x=I*I,P=w*w,U=C*C,D=x*I,L=P*w,F=U*C,M=m*x+p*P+y*U-1,g=m*D*S+p*L*v+y*F*N;var b=-2*g;z=M/b}while(Math.abs(M)>r.EPSILON12);return t(c)?(c.x=l*I,c.y=f*w,c.z=h*C,c):new e(l*I,f*w,h*C)}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,m=n(r)?r._centerToleranceSquared:d,p=o(t,E,_,m,c);if(n(p)){var y=e.multiplyComponents(t,_,s);y=e.normalize(y,y);var R=e.subtract(t,p,l),T=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=i.sign(e.dot(R,t))*e.magnitude(R);return n(a)?(a.longitude=T,a.latitude=A,a.height=S,a):new u(T,A,S)}},u.clone=function(e,t){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){a=n(a,0),e.pack(t._radii,r,a)},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;n>a;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;n>a;++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}),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","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(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 u(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;3>n;++n){var r=e[o.getElementIndex(d[n],h[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=i.EPSILON15,r=0,a=1,u=0;3>u;++u){var s=Math.abs(e[o.getElementIndex(d[u],h[u])]);s>r&&(a=u,r=s)}var c=1,l=0,f=h[a],E=d[a];if(Math.abs(e[o.getElementIndex(E,f)])>n){var _,m=e[o.getElementIndex(E,E)],p=e[o.getElementIndex(f,f)],y=e[o.getElementIndex(E,f)],R=(m-p)/2/y;_=0>R?-1/(-R+Math.sqrt(1+R*R)):1/(R+Math.sqrt(1+R*R)),c=1/Math.sqrt(1+_*_),l=_*c}return t=o.clone(o.IDENTITY,t),t[o.getElementIndex(f,f)]=t[o.getElementIndex(E,E)]=c,t[o.getElementIndex(E,f)]=l,t[o.getElementIndex(f,E)]=-l,t}o.packedLength=9,o.pack=function(e,n,r){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]},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},o.clone=function(e,t){return n(e)?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 o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},o.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,u=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,_=2*(a-h),m=2*(i+l),p=2*(a+h),y=-r+s-f+d,R=2*(c-u),T=2*(i-l),A=2*(c+u),S=-r-s+f+d;return n(t)?(t[0]=E,t[1]=p,t[2]=T,t[3]=_,t[4]=y,t[5]=A,t[6]=m,t[7]=R,t[8]=S,t):new o(E,_,m,p,y,R,T,A,S)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,r,-a,0,a,r)},o.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 o(r,0,a,0,1,0,-a,0,r)},o.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 o(r,-a,0,a,r,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},o.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},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;o.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 f=new e;o.getMaximumScale=function(t){return o.getScale(t,f),e.maximumComponent(f)},o.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},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[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},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[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},o.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},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[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},o.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},o.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},o.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],d=[2,2,1],E=new o,_=new o;return o.computeEigenDecomposition=function(e,t){var r=i.EPSILON20,a=10,l=0,f=0;n(t)||(t={});for(var h=t.unitary=o.clone(o.IDENTITY,t.unitary),d=t.diagonal=o.clone(e,t.diagonal),m=r*u(d);a>f&&s(d)>m;)c(d,E),o.transpose(E,_),o.multiply(d,E,d),o.multiply(_,d,d),o.multiply(h,E,h),++l>2&&(++f,l=0);return 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[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},o.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)},o.inverse=function(e,t){var n=e[0],a=e[1],u=e[2],s=e[3],c=e[4],l=e[5],f=e[6],h=e[7],d=e[8],E=o.determinant(e);if(Math.abs(E)<=i.EPSILON15)throw new r("matrix is not invertible");t[0]=c*d-h*l,t[1]=h*u-a*d,t[2]=a*l-c*u,t[3]=f*l-s*d,t[4]=n*d-f*u,t[5]=s*u-n*l,t[6]=s*h-f*c,t[7]=f*a-n*h,t[8]=n*c-s*a;var _=1/E;return o.multiplyByScalar(t,_,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=a(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=a(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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.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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a,i,o,u,s,c,l,f,h,d,E,_,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(_,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(m,0)}c.packedLength=16,c.pack=function(e,t,r){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]},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),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},c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[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]):void 0},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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new c);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,l=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,_=t.y*t.w,m=t.z*t.z,p=t.z*t.w,y=t.w*t.w,R=s-d-m+y,T=2*(l-p),A=2*(f+_),S=2*(l+p),v=-s+d-m+y,N=2*(E-h),O=2*(f-_),M=2*(E+h),g=-s-d+m+y;return a[0]=R*i,a[1]=S*i,a[2]=O*i,a[3]=0,a[4]=T*o,a[5]=v*o,a[6]=M*o,a[7]=0,a[8]=A*u,a[9]=N*u,a[10]=g*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.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 l=new e,f=new e,h=new e;c.fromCamera=function(t,n){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,E=l.x,_=l.y,m=l.z,p=h.x,y=h.y,R=h.z,T=a.x,A=a.y,S=a.z,v=u*-T+s*-A+d*-S,N=p*-T+y*-A+R*-S,O=E*T+_*A+m*S; +return r(n)?(n[0]=u,n[1]=p,n[2]=-E,n[3]=0,n[4]=s,n[5]=y,n[6]=-_,n[7]=0,n[8]=d,n[9]=R,n[10]=-m,n[11]=0,n[12]=v,n[13]=N,n[14]=O,n[15]=1,n):new c(u,s,d,v,p,y,R,N,-E,-_,-m,O,0,0,0,1)},c.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},c.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},c.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},c.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},c.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,_=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]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=_,a[13]=m,a[14]=p,a[15]=y,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,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},c.setColumn=function(e,t,n,r){r=c.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},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],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},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 d=new e;c.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 E=new e;c.getMaximumScale=function(t){return c.getScale(t,E),e.maximumComponent(E)},c.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],m=e[13],p=e[14],y=e[15],R=t[0],T=t[1],A=t[2],S=t[3],v=t[4],N=t[5],O=t[6],M=t[7],g=t[8],I=t[9],w=t[10],C=t[11],x=t[12],P=t[13],U=t[14],D=t[15],L=r*R+u*T+f*A+_*S,F=a*R+s*T+h*A+m*S,B=i*R+c*T+d*A+p*S,z=o*R+l*T+E*A+y*S,b=r*v+u*N+f*O+_*M,G=a*v+s*N+h*O+m*M,q=i*v+c*N+d*O+p*M,W=o*v+l*N+E*O+y*M,H=r*g+u*I+f*w+_*C,X=a*g+s*I+h*w+m*C,V=i*g+c*I+d*w+p*C,Y=o*g+l*I+E*w+y*C,k=r*x+u*P+f*U+_*D,j=a*x+s*P+h*U+m*D,Z=i*x+c*P+d*U+p*D,K=o*x+l*P+E*U+y*D;return n[0]=L,n[1]=F,n[2]=B,n[3]=z,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]=k,n[13]=j,n[14]=Z,n[15]=K,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],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],m=t[1],p=t[2],y=t[4],R=t[5],T=t[6],A=t[8],S=t[9],v=t[10],N=t[12],O=t[13],M=t[14],g=r*_+o*m+c*p,I=a*_+u*m+l*p,w=i*_+s*m+f*p,C=r*y+o*R+c*T,x=a*y+u*R+l*T,P=i*y+s*R+f*T,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*M+h,B=a*N+u*O+l*M+d,z=i*N+s*O+f*M+E;return n[0]=g,n[1]=I,n[2]=w,n[3]=0,n[4]=C,n[5]=x,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=B,n[14]=z,n[15]=1,n},c.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],m=t[4],p=t[5],y=t[6],R=t[7],T=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*m+c*p,O=a*_+u*m+l*p,M=i*_+s*m+f*p,g=r*y+o*R+c*T,I=a*y+u*R+l*T,w=i*y+s*R+f*T;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=O,n[6]=M,n[7]=0,n[8]=g,n[9]=I,n[10]=w,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,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;c.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,c.multiplyByScale(e,_,n)},c.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?c.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)},c.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},c.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},c.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},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],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},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 m=new u,p=new u,y=new t,R=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,m),p,o.EPSILON7)&&t.equals(c.getRow(e,3,y),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],l=e[12],f=e[1],h=e[5],d=e[9],E=e[13],_=e[2],T=e[6],A=e[10],S=e[14],v=e[3],N=e[7],O=e[11],M=e[15],g=A*M,I=S*O,w=T*M,C=S*N,x=T*O,P=A*N,U=_*M,D=S*v,L=_*O,F=A*v,B=_*N,z=T*v,b=g*h+C*d+x*E-(I*h+w*d+P*E),G=I*f+U*d+F*E-(g*f+D*d+L*E),q=w*f+D*h+B*E-(C*f+U*h+z*E),W=P*f+L*h+z*d-(x*f+F*h+B*d),H=I*a+w*i+P*l-(g*a+C*i+x*l),X=g*r+D*i+L*l-(I*r+U*i+F*l),V=C*r+U*a+z*l-(w*r+D*a+B*l),Y=x*r+F*a+B*i-(P*r+L*a+z*i);g=i*E,I=l*d,w=a*E,C=l*h,x=a*d,P=i*h,U=r*E,D=l*f,L=r*d,F=i*f,B=r*h,z=a*f;var k=g*N+C*O+x*M-(I*N+w*O+P*M),j=I*v+U*O+F*M-(g*v+D*O+L*M),Z=w*v+D*N+B*M-(C*v+U*N+z*M),K=P*v+L*N+z*O-(x*v+F*N+B*O),J=w*A+P*S+I*T-(x*S+g*T+C*A),Q=L*S+g*_+D*A-(U*A+F*S+I*_),$=U*T+z*S+C*_-(B*S+w*_+D*T),ee=B*A+x*_+F*T-(L*T+z*A+P*_),te=r*b+a*G+i*q+l*W;if(Math.abs(te)<o.EPSILON20)throw new s("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]=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},c.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,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]=_,t[14]=m,t[15]=1,t},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,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/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/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){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},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 n>t&&(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;h>f;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.clone=function(e,t){return n(e)?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):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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;i>a&&(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;i>a&&o>0?a+=u.TWO_PI:c>o&&a>0&&(o+=u.TWO_PI),i>a&&0>c?c+=u.TWO_PI:c>o&&0>i&&(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)&&l>=f)){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.union=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.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,a=e.west,i=e.east;return a>i&&(i+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(i>n||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,_=c;_.height=a,_.longitude=E,_.latitude=f,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.latitude=h,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.longitude=E,o[l]=r.cartographicToCartesian(_,o[l]),l++,0>f?_.latitude=f:h>0?_.latitude=h:_.latitude=0;for(var m=1;8>m;++m)_.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,_)&&(o[l]=r.cartographicToCartesian(_,o[l]),l++);return 0===_.latitude&&(_.longitude=E,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=r.cartographicToCartesian(_,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","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";function d(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var E=new e,_=new e,m=new e,p=new e,y=new e,R=new e,T=new e,A=new e,S=new e,v=new e,N=new e,O=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,E),o=e.clone(a,_),u=e.clone(a,m),s=e.clone(a,p),c=e.clone(a,y),l=e.clone(a,R),f=t.length,h=1;f>h;h++){e.clone(t[h],a);var M=a.x,g=a.y,I=a.z;M<i.x&&e.clone(a,i),M>s.x&&e.clone(a,s),g<o.y&&e.clone(a,o),g>c.y&&e.clone(a,c),I<u.z&&e.clone(a,u),I>l.z&&e.clone(a,l)}var w=e.magnitudeSquared(e.subtract(s,i,A)),C=e.magnitudeSquared(e.subtract(c,o,A)),x=e.magnitudeSquared(e.subtract(l,u,A)),P=i,U=s,D=w;C>D&&(D=C,P=o,U=c),x>D&&(D=x,P=u,U=l);var L=S;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,A)),B=Math.sqrt(F),z=v;z.x=i.x,z.y=o.y,z.z=u.z;var b=N;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(z,b,A),.5,O),q=0;for(h=0;f>h;h++){e.clone(t[h],a);var W=e.magnitude(e.subtract(a,G,A));W>q&&(q=W);var H=e.magnitudeSquared(e.subtract(a,L,A));if(H>F){var X=Math.sqrt(H);B=.5*(B+X),F=B*B;var V=X-B;L.x=(B*L.x+V*a.x)/X,L.y=(B*L.y+V*a.y)/X,L.z=(B*L.z+V*a.z)/X}}return q>B?(e.clone(L,n.center),n.radius=B):(e.clone(G,n.center),n.radius=q),n};var M=new o,g=new e,I=new e,w=new t,C=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),h.southwest(t,w),w.height=i,h.northeast(t,C),C.height=o;var s=a.project(w,g),c=a.project(C,I),l=c.x-s.x,f=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+f*f+E*E);var _=u.center;return _.x=s.x+.5*l,_.y=s.y+.5*f,_.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0);var u;return r(e)&&(u=h.subsample(e,t,a,x)),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,E),c=e.clone(u,_),l=e.clone(u,m),f=e.clone(u,p),h=e.clone(u,y),M=e.clone(u,R),g=t.length,I=0;g>I;I+=i){var w=t[I]+a.x,C=t[I+1]+a.y,x=t[I+2]+a.z;u.x=w,u.y=C,u.z=x,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),C<c.y&&e.clone(u,c),C>h.y&&e.clone(u,h),x<l.z&&e.clone(u,l),x>M.z&&e.clone(u,M)}var P=e.magnitudeSquared(e.subtract(f,s,A)),U=e.magnitudeSquared(e.subtract(h,c,A)),D=e.magnitudeSquared(e.subtract(M,l,A)),L=s,F=f,B=P;U>B&&(B=U,L=c,F=h),D>B&&(B=D,L=l,F=M);var z=S;z.x=.5*(L.x+F.x),z.y=.5*(L.y+F.y),z.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,z,A)),G=Math.sqrt(b),q=v;q.x=s.x,q.y=c.y,q.z=l.z;var W=N;W.x=f.x,W.y=h.y,W.z=M.z;var H=e.multiplyByScalar(e.add(q,W,A),.5,O),X=0;for(I=0;g>I;I+=i){u.x=t[I]+a.x,u.y=t[I+1]+a.y,u.z=t[I+2]+a.z;var V=e.magnitude(e.subtract(u,H,A));V>X&&(X=V);var Y=e.magnitudeSquared(e.subtract(u,z,A));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 X>G?(e.clone(z,o.center),o.radius=G):(e.clone(H,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,E),u=e.clone(i,_),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,y),f=e.clone(i,R),h=t.length,M=0;h>M;M+=3){var g=t[M]+n[M],I=t[M+1]+n[M+1],w=t[M+2]+n[M+2];i.x=g,i.y=I,i.z=w,g<o.x&&e.clone(i,o),g>c.x&&e.clone(i,c),I<u.y&&e.clone(i,u),I>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var C=e.magnitudeSquared(e.subtract(c,o,A)),x=e.magnitudeSquared(e.subtract(l,u,A)),P=e.magnitudeSquared(e.subtract(f,s,A)),U=o,D=c,L=C;x>L&&(L=x,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=S;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,F,A)),z=Math.sqrt(B),b=v;b.x=o.x,b.y=u.y,b.z=s.z;var G=N;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,A),.5,O),W=0;for(M=0;h>M;M+=3){i.x=t[M]+n[M],i.y=t[M+1]+n[M+1],i.z=t[M+2]+n[M+2];var H=e.magnitude(e.subtract(i,q,A));H>W&&(W=H);var X=e.magnitudeSquared(e.subtract(i,F,A));if(X>B){var V=Math.sqrt(X);z=.5*(z+V),B=z*z;var Y=V-z;F.x=(z*F.x+Y*i.x)/V,F.y=(z*F.y+Y*i.y)/V,F.z=(z*F.z+Y*i.z)/V}}return W>z?(e.clone(F,a.center),a.radius=z):(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 P=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;a>o;o++)i.push(t[o].center);n=d.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;a>o;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return n.radius=s,n};var U=new e,D=new e,L=new e;d.fromOrientedBoundingBox=function(t,n){r(n)||(n=new d);var a=t.halfAxes,i=c.getColumn(a,0,U),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 n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},d.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new d(t.center,t.radius):void 0},d.packedLength=4,d.pack=function(e,t,r){r=n(r,0);var a=e.center;t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius},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 F=new e,B=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,F),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,B);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-a>o?u.OUTSIDE:a>o?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 G=new e;d.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,G),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,W=new e,H=new e,X=new e,V=new e,Y=new t,k=new Array(8),j=0;8>j;++j)k[j]=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,q),c=e.cross(e.UNIT_Z,s,W);e.normalize(c,c);var l=e.cross(s,c,H);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=k,_=E[0];e.add(s,l,_),e.add(_,c,_),_=E[1],e.add(s,l,_),e.add(_,h,_),_=E[2],e.add(s,f,_),e.add(_,h,_),_=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(_,h,_),_=E[6],e.add(s,f,_),e.add(_,h,_),_=E[7],e.add(s,f,_),e.add(_,c,_);for(var m=E.length,p=0;m>p;++p){var y=E[p];e.add(o,y,y);var R=i.cartesianToCartographic(y,Y);r.project(R,y)}a=d.fromPoints(E,a),o=a.center;var T=o.x,A=o.y,S=o.z;return o.x=S,o.y=T,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("Renderer/WebGLConstants",["../Core/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/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(){return a.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?r.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(r.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",e(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;r>n;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(R)){R=!1;var e=/ Chrome\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(R=!0,T=r(e[1]))}return R}function i(){return a()&&T}function o(){if(!t(A)&&(A=!1,!a()&&/ Safari\/[\.0-9]+/.test(y.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function u(){return o()&&S}function s(){if(!t(v)){v=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(y.userAgent);null!==e&&(v=!0,N=r(e[1]),N.isNightly=!!e[2])}return v}function c(){return s()&&N}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===y.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(y.userAgent),null!==e&&(O=!0,M=r(e[1]))):"Netscape"===y.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(y.userAgent),null!==e&&(O=!0,M=r(e[1])))}return O}function f(){return l()&&M}function h(){if(!t(g)){g=!1;var e=/Firefox\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(g=!0,I=r(e[1]))}return g}function d(){return t(w)||(w=/Windows/i.test(y.appVersion)),w}function E(){return h()&&I}function _(){return t(C)||(C="undefined"!=typeof PointerEvent&&(!t(y.pointerEnabled)||y.pointerEnabled)),C}function m(){if(!t(P)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;P=t(n)&&""!==n,P&&(x=n)}return P}function p(){return m()?x:void 0}var y;y="undefined"!=typeof navigator?navigator:{};var R,T,A,S,v,N,O,M,g,I,w,C,x,P,U={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:E,isWindows:d,hardwareConcurrency:e(y.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:m,imageRenderingValue:p};return U.supportsFullscreen=function(){return n.supportsFullscreen()},U.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},U.supportsWebWorkers=function(){return"undefined"!=typeof Worker},U}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,a,i){"use strict";if(!a.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return n(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,n,a,i){switch(a=t(a,0),i=t(i,(n.byteLength-a)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,a,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,a,i);case o.SHORT:return new Int16Array(n,a,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,a,i);case o.FLOAT:return new Float32Array(n,a,i);case o.DOUBLE:return new Float64Array(n,a,i);default:throw new r("componentDatatype is not a valid value.")}},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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(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=void 0}return i.computeNumberOfVertices=function(e){var r=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,r){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,r):new Uint16Array(t,n,r)},r(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.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){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},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){return t(e)?(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):void 0},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;f>h;h++){var d=t[h],E=d.x,_=d.y,m=d.z;a=Math.min(E,a),s=Math.max(E,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 R=e.add(p,y,r.center);return e.multiplyByScalar(R,.5,R),r},i.clone=function(t,r){return n(t)?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):void 0},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:0>s+u?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",["./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){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},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.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.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/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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,0>i?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(0>f)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,m=u*c-d,p=4*E*m-_*_;if(0>p){var y,R,T;h*f>=l*d?(y=o,R=E,T=-2*u*E+o*_):(y=c,R=m,T=-c*_+2*s*m);var A=0>T?-1:1,S=-A*Math.abs(y)*Math.sqrt(-p);i=-T+S;var v=i/2,N=0>v?-Math.pow(-v,1/3):Math.pow(v,1/3),O=i===S?-N:-R/N;return a=0>=R?N+O:-T/(N*N+O*O+R),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var M=E,g=-2*u*E+o*_,I=m,w=-c*_+2*s*m,C=Math.sqrt(p),x=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*C,-g)/3);a=2*Math.sqrt(-M);var U=Math.cos(P);i=a*U;var D=a*(-U/2-x*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,B=L/F;P=Math.abs(Math.atan2(c*C,-w)/3),a=2*Math.sqrt(-I),U=Math.cos(P),i=a*U,D=a*(-U/2-x*Math.sin(P));var z=-c,b=2*s>i+D?i+s:D+s,G=z/b,q=F*b,W=-L*b-F*z,H=L*z,X=(s*W-u*H)/(-u*W+s*q);return X>=B?G>=B?G>=X?[B,X,G]:[B,G,X]:[G,B,X]:G>=B?[X,B,G]:G>=X?[X,G,B]:[G,X,B]}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=0>u?-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,0>u?[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=E[0],p=E[1];if(m>=0&&p>=0){var y=Math.sqrt(m),R=Math.sqrt(p);return[h-R,h-y,h+y,h+R]}if(m>=0&&0>p)return _=Math.sqrt(m),[h-_,h+_];if(0>m&&p>=0)return _=Math.sqrt(p),[h-_,h+_]}return[]}if(d>0){var T=Math.sqrt(d),A=(s+d-c/T)/2,S=(s+d+c/T)/2,v=r.computeRealRoots(1,T,A),N=r.computeRealRoots(1,-T,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,_,m=d[0],p=a-m,y=p*p,R=t/2,T=p/2,A=y-4*o,S=y+4*Math.abs(o),v=c-4*m,N=c+4*Math.abs(m);if(0>m||v*S>A*N){var O=Math.sqrt(v);E=O/2,_=0===O?0:(t*T-i)/O}else{var M=Math.sqrt(A);E=0===M?0:(t*T-i)/M,_=M/2}var g,I;0===R&&0===E?(g=0,I=0):n.sign(R)===n.sign(E)?(g=R+E,I=m/g):(I=R-E,g=m/I);var w,C;0===T&&0===_?(w=0,C=0):n.sign(T)===n.sign(_)?(w=T+_,C=o/w):(C=T-_,w=o/C);var x=r.computeRealRoots(1,g,w),P=r.computeRealRoots(1,I,C);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,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=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>f?d+1:d,d+=0>h?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(t,r,a,o,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,_=e.subtract(a,r,m),A=e.subtract(o,r,p),S=e.cross(E,A,y),v=e.dot(_,S);if(u){if(v<i.EPSILON6)return;if(s=e.subtract(d,r,R),l=e.dot(s,S),0>l||l>v)return;if(c=e.cross(s,_,T),f=e.dot(E,c),0>f||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,R),l=e.dot(s,S)*N,0>l||l>1)return;if(c=e.cross(s,_,T),f=e.dot(E,c)*N,0>f||l+f>1)return;h=e.dot(A,c)*N}return h}function f(e,t,n,r){var a=t*t-4*e*n;if(!(0>a)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(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={});var i=t.origin,o=t.direction,u=n.center,s=n.radius*n.radius,c=e.subtract(i,u,y),l=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,E=f(l,h,d,S);return r(E)?(a.start=E.root0,a.stop=E.root1,a):void 0}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 E(t,n,r,a,c){var l,f=a*a,h=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,_=c*(a*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),m=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),R=[];if(0===y&&0===p){if(l=u.computeRealRoots(E,_,m),0===l.length)return R;var T=l[0],A=Math.sqrt(Math.max(1-T*T,0));if(R.push(new e(a,c*T,c*-A)),R.push(new e(a,c*T,c*A)),2===l.length){var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));R.push(new e(a,c*S,c*-v)),R.push(new e(a,c*S,c*v))}return R}var N=y*y,O=p*p,M=E*E,g=y*p,I=M+O,w=2*(_*E+g),C=2*m*E+_*_-O+N,x=2*(m*_-g),P=m*m-N;if(0===I&&0===w&&0===C&&0===x)return R;l=s.computeRealRoots(I,w,C,x,P);var U=l.length;if(0===U)return R;for(var D=0;U>D;++D){var L,F=l[D],B=F*F,z=Math.max(1-B,0),b=Math.sqrt(z);L=i.sign(E)===i.sign(m)?d(E*B+m,_*F,i.EPSILON12):i.sign(m)===i.sign(_*F)?d(E*B,_*F+m,i.EPSILON12):d(E*B+_*F,m,i.EPSILON12);var G=d(p*F,y,i.EPSILON15),q=L*G;0>q?R.push(new e(a,c*F,c*b)):q>0?R.push(new e(a,c*F,c*-b)):0!==b?(R.push(new e(a,c*F,c*-b)),R.push(new e(a,c*F,c*b)),++D):R.push(new e(a,c*F,c*b))}return R}var _={};_.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(!(0>l))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var m=new e,p=new e,y=new e,R=new e,T=new e;_.rayTriangle=function(t,n,a,i,o,u){var s=l(t,n,a,i,o);if(r(s)&&!(0>s))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new c;_.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 f=l(c,a,i,o,u);return!r(f)||0>f||f>e.distance(t,n)?void 0:(r(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var S={root0:0,root1:0};_.raySphere=function(e,t,n){return n=h(e,t,n),!r(n)||n.stop<0?void 0:(n.start=Math.max(n.start,0),n)};var v=new c;_.lineSegmentSphere=function(t,n,a,i){var o=v,u=e.subtract(n,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=h(o,a,i),!r(i)||i.stop<0||i.start>s?void 0:(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,i,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,N),l=e.multiplyComponents(s,t.direction,O),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,i>d)return;if(d>i){o=h*h-i,u=-h+Math.sqrt(o);var E=u/a,_=r/u;return _>E?{start:E,stop:_}:{start:_,stop:E}}var m=Math.sqrt(r/a);return{start:m,stop:m}}return 1>f?(r=f-1,a=e.magnitudeSquared(l),i=a*r,o=h*h-i,u=-h+Math.sqrt(o),{start:0,stop:u/a}):0>h?(a=e.magnitudeSquared(l),{start:0,stop:-h/a}):void 0};var M=new e,g=new e,I=new e,w=new e,C=new e,x=new o,P=new o,U=new o,D=new o,L=new o,F=new o,B=new o,z=new e,b=new e,G=new t;_.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction,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),h=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(h,f,g),g),_=e.normalize(e.cross(f,d,I),I),m=x;m[0]=f.x,m[1]=f.y,m[2]=f.z,m[3]=d.x,m[4]=d.y,m[5]=d.z,m[6]=_.x,m[7]=_.y,m[8]=_.z;var p=o.transpose(m,P),y=o.fromScale(n.radii,U),R=o.fromScale(n.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 A,S,v=o.multiply(o.multiply(p,R,F),T,F),N=o.multiply(o.multiply(v,y,B),m,B),O=o.multiplyByVector(v,a,C),q=E(N,e.negate(O,M),0,0,1),W=q.length;if(W>0){for(var H=e.clone(e.ZERO,b),X=Number.NEGATIVE_INFINITY,V=0;W>V;++V){A=o.multiplyByVector(y,o.multiplyByVector(m,q[V],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,u);k>X&&(X=k,H=e.clone(A,H))}var j=n.cartesianToCartographic(H,G);return X=i.clamp(X,0,1),S=e.magnitude(e.subtract(H,a,w))*Math.sqrt(1-X*X),S=c?-S:S,j.height=S,n.cartographicToCartesian(j,new e)}};var q=new e;return _.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(!(0>f||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},_.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]}}},_}),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(r){return i(r)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(a){return i(a)}});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(t){r.progress(t)}}: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=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){E(e)}var c,l,f,h,d,E,_,m,y,R;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],d=o(),c)for(m=d.progress,_=function(e){h.push(e),--l||(E=_=p,d.reject(h))},E=function(e){f.push(e),--c||(E=_=p,d.resolve(f))},R=0;y>R;++R)R in t&&e(t[R],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,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;a>s;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)})})},R.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 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 R,T,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)})})}},T=[].slice,R=[].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(;a>i;++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;o>=i;)if(r=~~((i+o)/2),a=n(e[r],t),0>a)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,R="",T=!1,A=!1,S=" ",v=s.length,N=0;s&&v>N;N++)switch(s.charAt(N)){case" ":R=" ";break;case"+":R="+";break;case"-":y=!0;break;case"'":S=s.charAt(N+1);break;case"0":T=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(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,T,S);case"c":return u(String.fromCharCode(+p),y,c,f,T);case"b":return o(p,2,A,y,c,f,T);case"o":return o(p,8,A,y,c,f,T);case"x":return o(p,16,A,y,c,f,T);case"X":return o(p,16,A,y,c,f,T).toUpperCase();case"u":return o(p,10,A,y,c,f,T);case"i":case"d":return d=+p||0,d=Math.round(d-d%1),E=0>d?"-":R,p=E+a(String(Math.abs(d)),f,"0",!1),i(p,E,y,c,T);case"e":case"E":case"f":case"F":case"g":case"G":return d=+p,E=0>d?"-":R,_=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],p=E+Math.abs(d)[_](f),i(p,E,y,c,T)[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){R.julianDate=e;var n=_.leapSeconds,r=t(n,R,l);0>r&&(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){R.julianDate=e;var r=_.leapSeconds,a=t(r,R,l);if(0>a&&(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):1>=i?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,0>t&&(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,0>r&&(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 m=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,R=new u,T=/^(\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})?$/,M=/^(\d{2})(\.\d+)?/.source+O.source,g=/^(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,I=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,w="Invalid ISO 8601 date.";_.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,i,u,s=e.split("T"),l=1,h=1,m=0,R=0,O=0,C=0,x=s[0],P=s[1];if(!r(x))throw new a(w);var U;if(s=x.match(N),null!==s){if(U=x.split("-").length-1,U>0&&2!==U)throw new a(w);n=+s[1],l=+s[2],h=+s[3]}else if(s=x.match(A),null!==s)n=+s[1],l=+s[2];else if(s=x.match(T),null!==s)n=+s[1];else{var D;if(s=x.match(S),null!==s){if(n=+s[1],D=+s[2],u=o(n),1>D||u&&D>366||!u&&D>365)throw new a(w)}else{if(s=x.match(v),null===s)throw new a(w);n=+s[1];var L=+s[2],F=+s[3]||0;if(U=x.split("-").length-1,U>0&&(!r(s[3])&&1!==U||r(s[3])&&2!==U))throw new a(w);var B=new Date(Date.UTC(n,0,4));D=7*L+F-B.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(D),l=i.getUTCMonth()+1,h=i.getUTCDate()}if(u=o(n),1>l||l>12||1>h||(2!==l||!u)&&h>p[l-1]||u&&2===l&&h>y)throw new a(w);var z;if(r(P)){if(s=P.match(I),null!==s){if(U=P.split(":").length-1,U>0&&2!==U&&3!==U)throw new a(w);m=+s[1],R=+s[2],O=+s[3],C=1e3*+(s[4]||0),z=5}else if(s=P.match(g),null!==s){if(U=P.split(":").length-1,U>2)throw new a(w);m=+s[1],R=+s[2],O=60*+(s[3]||0),z=4}else{if(s=P.match(M),null===s)throw new a(w);m=+s[1],R=60*+(s[2]||0),z=3}if(R>=60||O>=61||m>24||24===m&&(R>0||O>0||C>0))throw new a(w);var b=s[z],G=+s[z+1],q=+(s[z+2]||0);switch(b){case"+":m-=G,R-=q;break;case"-":m+=G,R+=q;break;case"Z":break;default:R+=new Date(Date.UTC(n,l-1,h,m,R)).getTimezoneOffset()}}else R+=new Date(n,l-1,h).getTimezoneOffset();var W=60===O;for(W&&O--;R>=60;)R-=60,m++;for(;m>=24;)m-=24,h++;for(i=u&&2===l?y:p[l-1];h>i;)h-=i,l++,l>12&&(l-=12,n++),i=u&&2===l?y:p[l-1];for(;0>R;)R+=60,m--;for(;0>m;)m+=24,h--;for(;1>h;)l--,1>l&&(l+=12,n--),i=u&&2===l?y:p[l-1],h+=i;var H=E(n,l,h,m,R,O,C);return r(t)?(d(H[0],H[1],t),f(t)):t=new _(H[0],H[1],c.UTC),W&&_.addSeconds(t,1,t),t},_.now=function(e){return _.fromDate(new Date,e)};var C=new _(0,0,c.TAI);return _.toGregorianDate=function(e,t){var n=!1,a=h(e,C);r(a)||(_.addSeconds(e,-1,C),a=h(C,C),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,p=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,R=u-y*s.SECONDS_PER_HOUR,T=R/s.SECONDS_PER_MINUTE|0;R-=T*s.SECONDS_PER_MINUTE;var A=0|R,S=(R-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=E,t.hour=y,t.minute=T,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(p,m,E,y,T,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){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new _(e.dayNumber,e.secondsOfDay,c.TAI):void 0},_.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){R.julianDate=e;var n=_.leapSeconds,r=t(n,R,l);return 0>r&&(r=~r,--r,0>r&&(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)],_}),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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,n,r,a,i){"use strict";function o(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,u=n.headers,s=n.overrideMimeType,c=n.withCredentials;return e(n.url,function(t){var n=e.defer();return o.load(t,r,a,i,u,n,s,c),n.promise})}function u(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function s(e,t){for(var n=u(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 c(e,n){n=t(n,"");var a=e[1],i=!!e[2],o=e[3];switch(n){case"":case"text":return u(i,o);case"arraybuffer":return s(i,o);case"blob":var c=s(i,o);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(u(i,o),a);case"json":return JSON.parse(u(i,o));default:throw new r("Unhandled responseType: "+n)}}var l=/^data:(.*?)(;base64)?,(.*)$/;return o.load=function(e,t,r,o,u,s,f,h){var d=l.exec(e);if(null!==d)return void s.resolve(c(d,t));var E=new XMLHttpRequest;if(n(f)&&n(E.overrideMimeType)&&E.overrideMimeType(f),E.open(r,e,!0),n(u))for(var _ in u)u.hasOwnProperty(_)&&E.setRequestHeader(_,u[_]);n(t)&&(E.responseType=t),n(h)&&(E.withCredentials=h),E.onload=function(){E.status>=200&&E.status<300?n(E.response)?s.resolve(E.response):n(E.responseXML)&&E.responseXML.hasChildNodes()?s.resolve(E.responseXML):n(E.responseText)?s.resolve(E.responseText):s.reject(new i("unknown XMLHttpRequest response type.")):s.reject(new a(E.status,E.response,E.getAllResponseHeaders()))},E.onerror=function(e){s.reject(new a)},E.send(o)},o.defaultLoad=o.load,o}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";function n(n,r){return e({url:n,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return n}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)||(a={}),t(a.headers)?t(a.headers.Accept)||(a.headers=e(a.headers),a.headers.Accept=i.Accept):a.headers=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(0>a||0>i||0>s||0>c||0>h||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 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=E,e._taiMinusUtcSecondsColumn=_,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,R=e._addNewLeapSeconds,T=0,A=m.length;A>T;T+=e._columnCount){var S=m[T+a],v=m[T+_],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,O=new o(N,v,f.TAI);if(p.push(O),R){if(v!==y&&r(y)){var M=o.leapSeconds,g=t(M,O,d);if(0>g){var I=new u(O,v);M.splice(~g,0,I)}}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,d=i*s,E=n[h+e._ut1MinusUtcSecondsColumn],p=n[d+e._ut1MinusUtcSecondsColumn],y=p-E;if(y>.5||-.5>y){var R=n[h+e._taiMinusUtcSecondsColumn],T=n[d+e._taiMinusUtcSecondsColumn];R!==T&&(l.equals(r)?E=p:p-=T-R)}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,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],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,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,0>s&&(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("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/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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","require"],function(e,t,n,r,a){"use strict";function i(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),a=d.exec(r);if(null!==a)return a[1]}}function o(){if(t(l))return l;var a;if(a="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:i(),!t(a))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new e(r(a))}function u(e){return a.toUrl("../"+e)}function s(t){return new e(t).resolve(o()).toString()}function c(e){t(f)||(f=t(a.toUrl)?u:s),t(h)||(h=document.createElement("a"));var n=f(e);return h.href=n,h.href=h.href,h.href}var l,f,h,d=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=d,c.setBaseUrl=function(t){l=new e(t).resolve(new e(document.location.href))},c}),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;t>=s;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;t>=c;++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;s>u;++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;0>u&&(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;h>=E;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(0>i)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);0>s&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,0>s&&(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=i-s*this._stepSizeDays,p=this._work,y=this._denominators,R=this._coef,T=this._xTable;for(E=0;u>=E;++E)p[E]=m-T[E];for(E=0;u>=E;++E){for(R[E]=1,_=0;u>=_;++_)_!==E&&(R[E]*=p[_]);R[E]*=y[E];var A=3*(s+E);n.x+=R[E]*d[A++],n.y+=R[E]*d[A++],n.s+=R[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],_=h+d+E;if(_>0)r=Math.sqrt(_+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,p=0;d>h&&(p=1),E>h&&E>d&&(p=2);var y=m[p],R=m[y];r=Math.sqrt(e[u.getElementIndex(p,p)]-e[u.getElementIndex(y,y)]-e[u.getElementIndex(R,R)]+1);var T=f;T[p]=.5*r,r=.5/r,c=(e[u.getElementIndex(R,y)]-e[u.getElementIndex(y,R)])*r,T[y]=(e[u.getElementIndex(y,p)]+e[u.getElementIndex(p,y)])*r,T[R]=(e[u.getElementIndex(R,p)]+e[u.getElementIndex(p,R)])*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,E=new e,_=new s,m=new s,p=new s;s.packedLength=4,s.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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;i>a;a++){var o=3*a;s.unpack(e,4*(t+a),_),s.multiply(_,p,_),_.w<0&&s.negate(_,_),s.computeAxis(_,d);var u=s.computeAngle(_);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,_):s.fromAxisAngle(E,u,_),s.multiply(_,m,o)},s.clone=function(e,t){return n(e)?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):void 0},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 R=new s,T=new s,A=new s;s.slerp=function(e,t,n,r){var a=s.dot(e,t),i=t;if(0>a&&(a=-a,i=R=s.negate(t,R)),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),A=s.multiplyByScalar(i,Math.sin(n*u),A),r=s.add(T,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,O=new s;s.computeInnerQuadrangle=function(t,n,r,a){var i=s.conjugate(n,N);s.multiply(i,r,O);var o=s.log(O,S);s.multiply(i,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,a)},s.squad=function(e,t,n,r,a,i){var o=s.slerp(e,t,a,N),u=s.slerp(n,r,a,O);return s.slerp(o,u,2*a*(1-a),i)};for(var M=new s,g=1.9011074535173003,I=a.supportsTypedArrays()?new Float32Array(8):[],w=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],x=a.supportsTypedArrays()?new Float32Array(8):[],P=0;7>P;++P){var U=P+1,D=2*U+1;I[P]=1/(U*D),w[P]=U/D}return I[7]=g/136,w[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)C[f]=(I[f]*c-w[f])*o,x[f]=(I[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+x[0]*(1+x[1]*(1+x[2]*(1+x[3]*(1+x[4]*(1+x[5]*(1+x[6]*(1+x[7])))))))),E=s.multiplyByScalar(e,d,M);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,O);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","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./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){"use strict";var y={},R=new n,T=new n,A=new n;y.eastNorthUpToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=R,s=T,l=A;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.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,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var S=new n,v=new n,N=new n;y.northEastDownToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=-o,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]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=S,s=v,l=N;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.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 _(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},y.northUpEastToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=o,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 _(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=R,s=T,l=A;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(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 _(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 O=new m,M=new n(1,1,1),g=new _;y.headingPitchRollToFixedFrame=function(e,t,r,a,i,o){var u=m.fromHeadingPitchRoll(t,r,a,O),s=_.fromTranslationQuaternionRotationScale(n.ZERO,u,M,g);return o=y.eastNorthUpToFixedFrame(e,i,o),_.multiply(o,s,o)};var I=new _,w=new E;y.headingPitchRollQuaternion=function(e,t,n,r,a,i){var o=y.headingPitchRollToFixedFrame(e,t,n,r,a,I),u=_.getRotation(o,w);return m.fromRotationMatrix(u,i)};var C=24110.54841,x=8640184.812866,P=.093104,U=-62e-7,D=1.1772758384668e-19,L=72921158553e-15,F=d.TWO_PI/86400,B=new h;y.computeTemeToPseudoFixedMatrix=function(e,t){B=h.addSeconds(e,-h.computeTaiMinusUtc(e),B);var n,r=B.dayNumber,a=B.secondsOfDay,o=r-2451545;n=a>=43200?(o+.5)/p.DAYS_PER_JULIAN_CENTURY:(o-.5)/p.DAYS_PER_JULIAN_CENTURY;var u=C+n*(x+n*(P+n*U)),s=u*F%d.TWO_PI,c=L+D*(r-2451545.5),l=(a+.5*p.SECONDS_PER_DAY)%p.SECONDS_PER_DAY,f=s+c*l,_=Math.cos(f),m=Math.sin(f);return i(t)?(t[0]=_,t[1]=-m,t[2]=0,t[3]=m,t[4]=_,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(_,m,0,-m,_,0,0,0,1)},y.iau2006XysData=new l,y.earthOrientationParameters=u.NONE;var z=32.184,b=2451545;y.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+z,a=t.stop.dayNumber,i=t.stop.secondsOfDay+z,o=y.iau2006XysData.preload(n,r,a,i),u=y.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},y.computeIcrfToFixedMatrix=function(e,t){i(t)||(t=new E);var n=y.computeFixedToIcrfMatrix(e,t);if(i(n))return E.transpose(n,t)};var G=new f(0,0,0),q=new s(0,0,0,0,0,0),W=new E,H=new E;y.computeFixedToIcrfMatrix=function(e,t){i(t)||(t=new E);var n=y.earthOrientationParameters.compute(e,q);if(i(n)){var r=e.dayNumber,a=e.secondsOfDay+z,o=y.iau2006XysData.computeXysRadians(r,a,G);if(i(o)){var u=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=W;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=E.fromRotationZ(-o.s,H),_=E.multiply(l,f,W),m=e.dayNumber,R=e.secondsOfDay-h.computeTaiMinusUtc(e)+n.ut1MinusUtc,T=m-2451545,A=R/p.SECONDS_PER_DAY,S=.779057273264+A+.00273781191135448*(T+A);S=S%1*d.TWO_PI;var v=E.fromRotationZ(S,H),N=E.multiply(_,v,W),O=Math.cos(n.xPoleWander),M=Math.cos(n.yPoleWander),g=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),w=r-b+a/p.SECONDS_PER_DAY;w/=36525;var C=-47e-6*w*d.RADIANS_PER_DEGREE/3600,x=Math.cos(C),P=Math.sin(C),U=H;return U[0]=O*x,U[1]=O*P,U[2]=g,U[3]=-M*P+I*g*x,U[4]=M*x+I*g*P,U[5]=-I*O,U[6]=-I*P-M*g*x,U[7]=I*x-M*g*P,U[8]=M*O,E.multiply(N,U,t)}}};var X=new r;y.pointToWindowCoordinates=function(e,t,n,r){return r=y.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},y.pointToGLWindowCoordinates=function(e,n,a,o){i(o)||(o=new t);var u=X;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,o)};var V=new n,Y=new n,k=new n;return y.rotationMatrixFromPositionVelocity=function(e,t,r,o){var u=a(r,c.WGS84).geodeticSurfaceNormal(e,V),s=n.cross(t,u,Y);n.equalsEpsilon(s,n.ZERO,d.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var l=n.cross(s,t,k);return n.cross(t,l,s),n.negate(s,s),i(o)||(o=new E),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=s.x,o[4]=s.y,o[5]=s.z,o[6]=l.x,o[7]=l.y,o[8]=l.z,o},y}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix3","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E){"use strict";function _(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(f.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(f.getColumn(r,1,m));var i=n.fromCartesian4(f.getColumn(r,2,m));this._plane=h.fromPointNormal(e,i)}var m=new r;o(_.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;_.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new _(r.center,n)};var y=new d,R=new n;_.prototype.projectPointOntoPlane=function(e,r){var a=y;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,R);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,R)),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)}},_.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;r>a;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},_.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,R);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,R));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},_.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;n>r;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return _.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;r>l;++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},_}),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,E,_,m,p,y;n(a.z)?(f=t.subtract(s,a,i),h=t.subtract(c,a,o),d=t.subtract(r,a,u),E=t.dot(f,f),_=t.dot(f,h),m=t.dot(f,d),p=t.dot(h,h),y=t.dot(h,d)):(f=e.subtract(s,a,i),h=e.subtract(c,a,o),d=e.subtract(r,a,u),E=e.dot(f,f),_=e.dot(f,h),m=e.dot(f,d),p=e.dot(h,h),y=e.dot(h,d));var R=1/(E*p-_*_);return l.y=(p*m-_*y)*R,l.z=(E*y-_*m)*R,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";function n(t,n,a,i){return e(t,n,a,i,r),r.x>0&&r.y>0&&r.z>0}var r=new t;return n}),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,m=_*_,p=m*_,y=m*m,R=1+_-3*m/4+5*p/4-175*y/64,T=1-_+15*m/8-35*p/8,A=1-3*_+35*m/4,S=1-5*_,v=R*l-T*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=d,N.cosineAlpha=E,N.u2Over4=_,N.u4Over16=m,N.u6Over64=p,N.u8Over256=y,N.a0=R,N.a1=T,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,m=Math.atan((1-E)*Math.tan(a)),p=Math.atan((1-E)*Math.tan(o)),y=Math.cos(m),R=Math.sin(m),T=Math.cos(p),A=Math.sin(p),S=y*T,v=y*A,N=R*A,O=R*T,M=_,g=u.TWO_PI,I=Math.cos(M),w=Math.sin(M);do{I=Math.cos(M),w=Math.sin(M);var C=v-O*I;f=Math.sqrt(T*T*w*w+C*C),c=N+S*I,s=Math.atan2(f,c);var x;0===f?(x=0,h=1):(x=S*w/f,h=1-x*x),g=M,d=c-2*N/h,isNaN(d)&&(d=0),M=_+l(E,x,h,s,f,c,d)}while(Math.abs(M-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=d*d,F=D*f*(d+D*(c*(2*L-1)-D*d*(4*f*f-3)*(4*L-3)/6)/4),B=n*U*(s-F),z=Math.atan2(T*w,v-O*I),b=Math.atan2(y*w,v*I-O);e._distance=B,e._startHeading=z,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,m=a.u8Over256,p=a.u2Over4,y=a.u6Over64,R=a.u4Over16,T=2*_*m*o/3+i*(1-p+7*R/4-15*y/4+579*m/64-(R-15*y/4+187*m/16)*o-(5*y/4-115*m/16)*u-29*m*s/16)+(p/2-R+71*y/32-85*m/16)*c+(5*R/16-5*y/4+383*m/96)*f-E*((y-11*m/2)*c+5*m*f/2)+(29*y/96-29*m/16)*h+539*m*d/1536,A=Math.asin(Math.sin(T)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(A));T-=a.sigma;var v=Math.cos(2*a.sigma+T),N=Math.sin(T),O=Math.cos(T),M=a.cosineU*O,g=a.sineU*N,I=Math.atan2(N*a.sineHeading,M-g*a.cosineHeading),w=I-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,T,N,O,v);return r(n)?(n.longitude=this._start.longitude+w,n.latitude=S,n.height=0,n):new t(this._start.longitude+w,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;e>a;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;e>a;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,w),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,O),_=a.cartesianToCartographic(l,M),m=h(f,i,o);C.setEndPoints(d,_);var p=C.surfaceDistance/f,y=s;d.height=i;var R=a.cartographicToCartesian(d,g);e.pack(R,u,y),y+=3;for(var T=1;f>T;T++){var A=C.interpolateUsingSurfaceDistance(T*p,M);A.height=m[T],R=a.cartographicToCartesian(A,g),e.pack(R,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 _=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;n>a;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,_).height}return r};var m=new l,p=new e,y=new e,R=new f(e.ZERO,0),T=new e,A=new f(e.ZERO,0),S=new e,v=new e,N=[],O=new t,M=new t,g=new e,I=new e,w=new e,C=new o;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,p),h=l.multiplyByPointAsVector(s,e.UNIT_Y,y),d=f.fromPointNormal(c,h,R),E=l.multiplyByPointAsVector(s,e.UNIT_X,T),_=f.fromPointNormal(c,E,A),N=1;i.push(e.clone(t[0]));for(var O=i[0],M=t.length,g=1;M>g;++g){var I=t[g];if(f.getPointDistance(_,O)<0||f.getPointDistance(_,I)<0){var w=u.lineSegmentPlane(O,I,d,S);if(r(w)){var C=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(d,O)<0&&e.negate(C,C),i.push(e.add(w,C,new e)),o.push(N+1),e.negate(C,C),i.push(e.add(w,C,new e)),N=1}}i.push(e.clone(t[g])),N++,O=I}o.push(N)}return{positions:i,lengths:o}};var x=c.EPSILON10;return E.removeDuplicates=function(t){var n=t.length;if(2>n)return t;var r,a,i;for(r=1;n>r&&(a=t[r-1],i=t[r],!e.equalsEpsilon(a,i,x));++r);if(r===n)return t;for(var o=t.slice(0,r);n>r;++r)i=t[r],e.equalsEpsilon(a,i,x)||(o.push(e.clone(i)),a=i);return 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);if(1>o)return[];if(1===o){var f=u.scaleToGeodeticSurface(a[0],I);if(0!==l){var h=u.geodeticSurfaceNormal(f,g);e.multiplyByScalar(h,l,h),e.add(f,h,f)}return[f.x,f.y,f.z]}var _=t.minDistance;if(!r(_)){var m=n(t.granularity,c.RADIANS_PER_DEGREE);_=c.chordLength(m,u.maximumRadius)}var p,y=0;for(p=0;o-1>p;p++)y+=E.numberOfPoints(a[p],a[p+1],_);var R=3*(y+1),T=new Array(R),A=0,S=s(l);for(p=0;o-1>p;p++){var v=a[p],M=a[p+1],w=S?l[p]:l,C=S?l[p+1]:l;A=d(v,M,_,u,w,C,T,A)}N.length=0;var x=a[o-1],P=u.cartesianToCartographic(x,O);P.height=S?l[o-1]:l;var U=u.cartographicToCartesian(P,g);return e.pack(U,T,R-3),T},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;r>i;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/Queue",["../Core/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(){return 0!==this._length?this._array[this._offset]:void 0},t.prototype.contains=function(e){return-1!==this._array.indexOf(e)},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/WindingOrder",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"use strict";var n={CLOCKWISE:e.CW,COUNTER_CLOCKWISE:e.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return t(n)}),define("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PolylinePipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,_){"use strict";function m(t,n,r){var a=e.subtract(n,t,F),i=e.subtract(r,n,B);return a.x*i.y-a.y*i.x>=0}function p(e){for(var t=e[0].x,n=0,r=0;r<e.length;r++)e[r].x>t&&(t=e[r].x,n=r);return n}function y(e){for(var t=e[0][0].x,n=0,r=0;r<e.length;r++){var a=e[r][p(e[r])].x;a>t&&(t=a,n=r)}return n}function R(e){for(var t=[],n=0;n<e.length;n++){var r=e[(n-1+e.length)%e.length],a=e[n],i=e[(n+1)%e.length];m(r,a,i)||t.push(a)}return t}function T(t,n){for(var r=0;r<t.length;r++)if(e.equals(n,t[r]))return r;return-1}function A(n,a,i){i=r(i,[]);var o=Number.MAX_VALUE,u=p(a),s=new e(a[u].x,n.y);i.push(u),i.push((u+1)%a.length);for(var c=a[0].x,l=c,f=1;f<a.length;++f)a[f].x<c?c=a[f].x:a[f].x>l&&(l=a[f].x);l+=l-c;var h=new t(l,n.y,0);for(f=0;f<a.length;f++){var d=a[f],E=a[(f+1)%a.length];if((d.x>=n.x||E.x>=n.x)&&(d.y>=n.y&&E.y<=n.y||d.y<=n.y&&E.y>=n.y)){var _=(E.y-d.y)*(h.x-n.x)-(E.x-d.x)*(h.y-n.y);if(0!==_){_=1/_;var m=((E.x-d.x)*(n.y-d.y)-(E.y-d.y)*(n.x-d.x))*_,y=((h.x-n.x)*(n.y-d.y)-(h.y-n.y)*(n.x-d.x))*_;if(m>=0&&1>=m&&y>=0&&1>=y){var R=new e(n.x+m*(h.x-n.x),n.y+m*(h.y-n.y)),T=e.subtract(R,n,z);_=e.magnitudeSquared(T),o>_&&(s=R,o=_,i[0]=f,i[1]=(f+1)%a.length)}}}}return s}function S(t,n){var r=y(n),a=n[r],i=p(a),o=a[i],u=[],s=A(o,t,u),c=T(t,s);if(-1!==c)return c;var h=e.magnitudeSquared(e.subtract(t[u[0]],o,b)),d=e.magnitudeSquared(e.subtract(t[u[1]],o,b)),E=d>h?t[u[0]]:t[u[1]],_=R(t),m=_.indexOf(E);-1!==m&&_.splice(m,1);for(var S=[],v=0;v<_.length;v++){var N=_[v];f(N,o,s,E)&&S.push(N)}var O=Number.MAX_VALUE;if(S.length>0){var M=e.fromElements(1,0,b);for(v=0;v<S.length;v++){var g=e.subtract(S[v],o,G),I=e.magnitude(M)*e.magnitudeSquared(g);if(0!==I){var w=Math.abs(l.acosClamped(e.dot(M,g)/I));O>w&&(O=w,E=S[v])}}}return t.indexOf(E)}function v(e,n,r){for(var a=ee.computeWindingOrder2D(e),i=0;i<n.length;i++){var o=n[i];t.equals(o[0],o[o.length-1])||o.push(o[0]);var s=ee.computeWindingOrder2D(o);s===a&&o.reverse()}var c=u.fromPoints(e,r),l=c.projectPointsOntoPlane(e),f=[];for(i=0;i<n.length;i++)f.push(c.projectPointsOntoPlane(n[i]));var h=S(l,f),d=y(f),E=p(f[d]),_=n[d],m=[];for(i=0;i<e.length;i++)m.push(e[i]);var R,T=[];if(0!==E)for(R=0;R<=_.length;R++){var A=(R+E)%_.length;0!==A&&T.push(_[A])}else for(R=0;R<_.length;R++)T.push(_[(R+E)%_.length]);var v=m.lastIndexOf(e[h]);T.push(e[v]);var N=m.slice(0,v+1),O=m.slice(v+1);return m=N.concat(T,O),n.splice(d,1),m}function N(e){var t=l.nextRandomNumber(),n=Math.floor(t*e);return n===e&&n--,n}function O(e,t,n,r){var a=r[e].position,i=r[t].position,o=r[n].position,u=o.x,s=o.y,c=a.x-u,l=a.y-s,f=i.x-u,h=i.y-s;return c*h-l*f}function M(e,t){return e.x*t.y-e.y*t.x}function g(e,t){var n=t.length,r=l.mod(e-1,n),a=l.mod(e+1,n);return 0===O(r,a,e,t)?!1:!0}function I(t,n){return e.magnitudeSquared(n)<e.magnitudeSquared(t)}function w(t,n,r){if(!g(t,r))return t;var a=r[t].position,i=r[n].position,o=r.length,u=l.mod(t-1,o);if(!g(u,r))return u;var s=l.mod(t+1,o);if(!g(s,r))return s;var c=e.subtract(r[u].position,a,H),f=e.subtract(r[s].position,a,X),h=e.subtract(i,a,V),d=M(c,h),E=M(f,h);if(0===d)return I(c,h)?q:W;if(0===E)return I(f,h)?q:W;var _=M(c,f);return 0>_?0>d&&E>0?q:W:_>0?d>0&&0>E?W:q:void 0}function C(e,t,n){return(e>t||e>n)&&(t>e||n>e)||t===n&&t===e}function x(t,n,r,a){var i=e.subtract(r,t,k),o=n.x*a.y-n.y*a.x,u=o*o,s=e.magnitudeSquared(n),c=e.magnitudeSquared(a);if(u>Y*s*c){var l=(i.x*a.y-i.y*a.x)/o;return e.add(t,e.multiplyByScalar(n,l,k),k)}}function P(t,n,r){for(var i=e.subtract(n,t,j),o=r.length,u=0;o>u;u++){var s=r[u].position,c=r[l.mod(u+1,o)].position;if(!(e.equals(t,s)||e.equals(n,c)||e.equals(t,c)||e.equals(n,s))){var f=e.subtract(c,s,Z),h=x(t,i,s,f);if(a(h)&&!(e.equals(h,t)||e.equals(h,n)||e.equals(h,s)||e.equals(h,c))){var d=h.x,E=h.y,_=C(d,t.x,n.x)&&C(E,t.y,n.y)&&C(d,s.x,c.x)&&C(E,s.y,c.y);if(_)return!0}}}return!1}function U(t,n,r){var a=w(t,n,r);if(a>=0)return a;var i=w(n,t,r);return i>=0?i:a!==q||i!==q||P(r[t].position,r[n].position,r)||e.equals(r[t].position,r[n].position)?J:K}function D(e){return 0===O(1,2,0,e)}function L(e){var t=e.length;if(3===t)return D(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new i("Invalid polygon: must have at least three vertices.");for(var n,r,a=0,o=10*e.length,u=J;K>u&&a++<o;){for(n=N(e.length),r=n+1;Math.abs(n-r)<2||Math.abs(n-r)>e.length-2;)r=N(e.length);if(n>r){var s=n;n=r,r=s}u=U(n,r,e)}if(u===K){var c=e.splice(n,r-n+1,e[n],e[r]);return L(e).concat(L(c))}return u>=0?(e.splice(u,1),L(e)):[]}var F=new e,B=new e,z=new e,b=new e(1,0),G=new e,q=-1,W=-2,H=new t,X=new t,V=new t,Y=l.EPSILON14,k=new e,j=new e,Z=new e,K=-1,J=-2,Q=new t,$=new t,ee={};ee.removeDuplicates=function(e){var n=h.removeDuplicates(e);return t.equals(n[0],n[n.length-1])?n.slice(1):n},ee.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;t>a;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},ee.computeWindingOrder2D=function(e){var t=ee.computeArea2D(e);return t>0?_.COUNTER_CLOCKWISE:_.CLOCKWISE},ee.triangulate=function(e){for(var t=e.length,n=[],r=0;t>r;++r)n[r]={position:e[r],index:r};return L(n)};var te=new t,ne=new t,re=new t,ae=new t,ie=new t,oe=new t,ue=new t;return ee.computeSubdivision=function(e,i,o,u){u=r(u,l.RADIANS_PER_DEGREE);var f,h=o.slice(0),E=i.length,_=new Array(3*E),m=0;for(f=0;E>f;f++){var p=i[f];_[m++]=p.x,_[m++]=p.y,_[m++]=p.z}for(var y=[],R={},T=e.maximumRadius,A=l.chordLength(u,T),S=A*A;h.length>0;){var v,N,O=h.pop(),M=h.pop(),g=h.pop(),I=t.fromArray(_,3*g,te),w=t.fromArray(_,3*M,ne),C=t.fromArray(_,3*O,re),x=t.multiplyByScalar(t.normalize(I,ae),T,ae),P=t.multiplyByScalar(t.normalize(w,ie),T,ie),U=t.multiplyByScalar(t.normalize(C,oe),T,oe),D=t.magnitudeSquared(t.subtract(x,P,ue)),L=t.magnitudeSquared(t.subtract(P,U,ue)),F=t.magnitudeSquared(t.subtract(U,x,ue)),B=Math.max(D,L,F);B>S?D===B?(v=Math.min(g,M)+" "+Math.max(g,M),f=R[v],a(f)||(N=t.add(I,w,ue),t.multiplyByScalar(N,.5,N),_.push(N.x,N.y,N.z),f=_.length/3-1,R[v]=f),h.push(g,f,O),h.push(f,M,O)):L===B?(v=Math.min(M,O)+" "+Math.max(M,O),f=R[v],a(f)||(N=t.add(w,C,ue),t.multiplyByScalar(N,.5,N),_.push(N.x,N.y,N.z),f=_.length/3-1,R[v]=f),h.push(M,f,g),h.push(f,O,g)):F===B&&(v=Math.min(O,g)+" "+Math.max(O,g),f=R[v],a(f)||(N=t.add(C,I,ue),t.multiplyByScalar(N,.5,N),_.push(N.x,N.y,N.z),f=_.length/3-1,R[v]=f),h.push(O,f,M),h.push(f,g,M)):(y.push(g),y.push(M),y.push(O))}return new s({attributes:{position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:_})},indices:y,primitiveType:d.TRIANGLES})},ee.scaleToGeodeticHeight=function(e,n,i,u){i=r(i,o.WGS84);var s=Q,c=$;if(n=r(n,0),u=r(u,!0),a(e)&&a(e.attributes)&&a(e.attributes.position))for(var l=e.attributes.position.values,f=l.length,h=0;f>h;h+=3)t.fromArray(l,h,c),u&&(c=i.scaleToGeodeticSurface(c,c)),0!==n&&(s=i.geodeticSurfaceNormal(c,s),t.multiplyByScalar(s,n,s),t.add(c,s,c)),l[h]=c.x,l[h+1]=c.y,l[h+2]=c.z;return e},ee.eliminateHoles=function(e,n,a){a=r(a,o.WGS84);for(var i=[],u=0;u<n.length;u++){for(var s=[],c=0;c<n[u].length;c++)s.push(t.clone(n[u][c]));i.push(s)}for(var l=e;i.length>0;)l=v(l,i,a);return l},ee}),define("Core/WallGeometryLibrary",["./Cartographic","./defined","./DeveloperError","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t){return a.equalsEpsilon(e.latitude,t.latitude,a.EPSILON14)&&a.equalsEpsilon(e.longitude,t.longitude,a.EPSILON14)}function c(n,r,a,i){var o=r.length;if(2>o)return{positions:r};var u=t(i),c=t(a),l=new Array(o),d=new Array(o),E=new Array(o),_=r[0];l[0]=_;var m=n.cartesianToCartographic(_,f);c&&(m.height=a[0]),d[0]=m.height,u?E[0]=i[0]:E[0]=0;for(var p=1,y=1;o>y;++y){var R=r[y],T=n.cartesianToCartographic(R,h);c&&(T.height=a[y]),s(m,T)?m.height<T.height&&(d[p-1]=T.height):(l[p]=R,d[p]=T.height,u?E[p]=i[y]:E[p]=0,e.clone(T,m),++p)}return l.length=p,d.length=p,E.length=p,{positions:l,topHeights:d,bottomHeights:E}}var l={},f=new e,h=new e,d=new Array(2),E=new Array(2),_={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return l.computePositions=function(e,t,n,s,l,f){var h=c(e,t,n,s);if(t=h.positions,n=h.topHeights,s=h.bottomHeights,!(t.length<2)){if(t.length>=3){var m=r.fromPoints(t,e),p=m.projectPointsOntoPlane(t);i.computeWindingOrder2D(p)===u.CLOCKWISE&&(t.reverse(),n.reverse(),s.reverse())}var y,R,T=t.length,A=a.chordLength(l,e.maximumRadius),S=_;if(S.minDistance=A,S.ellipsoid=e,f){var v,N=0;for(v=0;T-1>v;v++)N+=o.numberOfPoints(t[v],t[v+1],A)+1;y=new Float64Array(3*N),R=new Float64Array(3*N);var O=d,M=E;S.positions=O,S.height=M;var g=0;for(v=0;T-1>v;v++){O[0]=t[v],O[1]=t[v+1],M[0]=n[v],M[1]=n[v+1];var I=o.generateArc(S);y.set(I,g),M[0]=s[v],M[1]=s[v+1],R.set(o.generateArc(S),g),g+=I.length}}else S.positions=t,S.height=n,y=new Float64Array(o.generateArc(S)),S.height=s,R=new Float64Array(o.generateArc(S));return{bottomPositions:R,topPositions:y}}},l}),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,d,E){"use strict";function _(e){e=r(e,r.EMPTY_OBJECT);var n=e.positions,i=e.maximumHeights,u=e.minimumHeights,s=r(e.vertexFormat,d.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=d.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+d.packedLength+1}var m=new t,p=new t,y=new t,R=new t,T=new t,A=new t,S=new t,v=new t;_.pack=function(e,n,i){i=r(i,0);var u,s=e._positions,c=s.length;for(n[i++]=c,u=0;c>u;++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;c>u;++u)n[i++]=l[u];var f=e._maximumHeights;if(c=a(f)?f.length:0,n[i++]=c,a(f))for(u=0;c>u;++u)n[i++]=f[u];o.pack(e._ellipsoid,n,i),i+=o.packedLength,d.pack(e._vertexFormat,n,i),i+=d.packedLength,n[i]=e._granularity};var N=o.clone(o.UNIT_SPHERE),O=new d,M={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:N,vertexFormat:O,granularity:void 0};return _.unpack=function(e,n,i){n=r(n,0);var u,s=e[n++],c=new Array(s);for(u=0;s>u;++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;s>u;++u)l[u]=e[n++];s=e[n++];var f;if(s>0)for(f=new Array(s),u=0;s>u;++u)f[u]=e[n++];var h=o.unpack(e,n,N);n+=o.packedLength;var E=d.unpack(e,n,O);n+=d.packedLength;var m=e[n];return a(i)?(i._positions=c,i._minimumHeights=l,i._maximumHeights=f,i._ellipsoid=o.clone(h,i._ellipsoid),i._vertexFormat=d.clone(E,i._vertexFormat),i._granularity=m,i):(M.positions=c,M.minimumHeights=l,M.maximumHeights=f,M.granularity=m,new _(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;l>f;++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 _(h)},_.createGeometry=function(r){var i=r._positions,o=r._minimumHeights,d=r._maximumHeights,_=r._vertexFormat,N=r._granularity,O=r._ellipsoid,M=E.computePositions(O,i,d,o,N,!0);if(a(M)){var g=M.bottomPositions,I=M.topPositions,w=I.length,C=2*w,x=_.position?new Float64Array(C):void 0,P=_.normal?new Float32Array(C):void 0,U=_.tangent?new Float32Array(C):void 0,D=_.binormal?new Float32Array(C):void 0,L=_.st?new Float32Array(C/3*2):void 0,F=0,B=0,z=0,b=0,G=0,q=v,W=S,H=A,X=!0;w/=3;var V,Y=0,k=1/(w-i.length+1);for(V=0;w>V;++V){var j=3*V,Z=t.fromArray(I,j,m),K=t.fromArray(g,j,p);if(_.position&&(x[F++]=K.x,x[F++]=K.y,x[F++]=K.z,x[F++]=Z.x,x[F++]=Z.y,x[F++]=Z.z), +_.st&&(L[G++]=Y,L[G++]=0,L[G++]=Y,L[G++]=1),_.normal||_.tangent||_.binormal){var J,Q=t.clone(t.ZERO,T),$=O.scaleToGeodeticSurface(t.fromArray(I,j,p),p);if(w>V+1&&(J=O.scaleToGeodeticSurface(t.fromArray(I,j+3,y),y),Q=t.fromArray(I,j+3,T)),X){var ee=t.subtract(Q,Z,R),te=t.subtract($,Z,m);q=t.normalize(t.cross(te,ee,q),q),X=!1}t.equalsEpsilon(J,$,f.EPSILON10)?X=!0:(Y+=k,_.tangent&&(W=t.normalize(t.subtract(J,$,W),W)),_.binormal&&(H=t.normalize(t.cross(q,W,H),H))),_.normal&&(P[B++]=q.x,P[B++]=q.y,P[B++]=q.z,P[B++]=q.x,P[B++]=q.y,P[B++]=q.z),_.tangent&&(U[b++]=W.x,U[b++]=W.y,U[b++]=W.z,U[b++]=W.x,U[b++]=W.y,U[b++]=W.z),_.binormal&&(D[z++]=H.x,D[z++]=H.y,D[z++]=H.z,D[z++]=H.x,D[z++]=H.y,D[z++]=H.z)}}var ne=new c;_.position&&(ne.position=new s({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:x})),_.normal&&(ne.normal=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:P})),_.tangent&&(ne.tangent=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:U})),_.binormal&&(ne.binormal=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:D})),_.st&&(ne.st=new s({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:L}));var re=C/3;C-=6;var ae=l.createTypedArray(re,C),ie=0;for(V=0;re-2>V;V+=2){var oe=V,ue=V+2,se=t.fromArray(x,3*oe,m),ce=t.fromArray(x,3*ue,p);if(!t.equalsEpsilon(se,ce,f.EPSILON10)){var le=V+1,fe=V+3;ae[ie++]=le,ae[ie++]=oe,ae[ie++]=fe,ae[ie++]=fe,ae[ie++]=oe,ae[ie++]=ue}}return new u({attributes:ne,indices:ae,primitiveType:h.TRIANGLES,boundingSphere:new e.fromVertices(x)})}},_}),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/Workers/createWallOutlineGeometry.js b/Workers/createWallOutlineGeometry.js index 4028af8..aa6755f 100644 --- a/Workers/createWallOutlineGeometry.js +++ b/Workers/createWallOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,8 +222,8 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(n){t=n.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:0>e?-1:0},n.signNotZero=function(e){return 0>e?-1:1},n.toSNorm=function(e){return Math.round(255*(.5*n.clamp(e,-1,1)+.5))},n.fromSNorm=function(e){return 2*(n.clamp(e,0,255)/255)-1},n.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},n.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},n.lerp=function(e,t,n){return(1-n)*e+n*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=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){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,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},n.negativePiToPi=function(e){for(var t=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+t)>e;)e+=i;if(-r>e)return-r;for(;e>r+t;)e-=i;return e>r?r:e},n.zeroToTwoPi=function(e){var t=e%n.TWO_PI;return 0>t?(t+n.TWO_PI)%n.TWO_PI:t},n.equalsEpsilon=function(e,n,r){return r=t(r,0),Math.abs(e-n)<=r};var r=[1];n.factorial=function(e){var t=r.length;if(e>=t)for(var n=r[t-1],i=t;e>=i;i++)r.push(n*i);return r[e]},n.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(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,n){return t>e?t:e>n?n:e};var i=new e;return n.setRandomNumberSeed=function(t){i=new e(t)},n.nextRandomNumber=function(){return i.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}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";var a=function(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)};a.fromSpherical=function(n,r){t(r)||(r=new a);var i=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(e,n,r,i){return t(i)?(i.x=e,i.y=n,i.z=r,i):new a(e,n,r)},a.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new a(e.x,e.y,e.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(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},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var u=new a;a.lerp=function(e,t,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){a.normalize(e,s),a.normalize(t,c);var n=a.dot(s,c),r=a.magnitude(a.cross(s,c,s));return Math.atan2(r,n)};var l=new a;a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,l);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):n.y<=n.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,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},a.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r&&Math.abs(e.z-n.z)<=r},a.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},a.fromDegrees=function(e,t,n,r,o){var u=i.toRadians(e),s=i.toRadians(t);return a.fromRadians(u,s,n,r,o)};var f=new a,h=new a,d=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=e(i,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=a.normalize(f,f),a.multiplyComponents(s,f,h);var l=Math.sqrt(a.dot(f,h));return h=a.divideByScalar(h,l,h),f=a.multiplyByScalar(f,i,f),t(u)||(u=new a),a.add(h,f,u)},a.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=i.toRadians(e[o]);return a.fromRadiansArray(r,t,n)},a.fromRadiansArray=function(e,n,r){var i=e.length;t(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=a.fromRadians(u,s,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=i.toRadians(e[o]),r[o+1]=i.toRadians(e[o+1]),r[o+2]=e[o+2];return a.fromRadiansArrayHeights(r,t,n)},a.fromRadiansArrayHeights=function(e,n,r){var i=e.length;t(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=a.fromRadians(u,s,c,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";var a=function(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)};return a.fromRadians=function(n,r,i,o){return i=e(i,0),t(o)?(o.longitude=n,o.latitude=r,o.height=i,o):new a(n,r,i)},a.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),a.fromRadians(e,t,n,r)},a.clone=function(e,n){return t(e)?t(n)?(n.longitude=e.longitude,n.latitude=e.latitude,n.height=e.height,n):new a(e.longitude,e.latitude,e.height):void 0},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.longitude===n.longitude&&e.latitude===n.latitude&&e.height===n.height},a.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.longitude-n.longitude)<=r&&Math.abs(e.latitude-n.latitude)<=r&&Math.abs(e.height-n.height)<=r},a.ZERO=r(new a(0,0,0)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"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}var c=function(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,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))return void 0;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.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),c=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,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 l=new e,f=new e;c.prototype.cartographicToCartesian=function(t,n){var i=l,a=f;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;n>i;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var h=new e,d=new e,m=new e;c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,d);if(!r(a))return void 0;var o=this.geodeticSurfaceNormal(a,h),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)},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;n>i;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};var p=new e,y=new e;return c.prototype.scaleToGeodeticSurface=function(t,n){var i=t.x,a=t.y,o=t.z,s=this._oneOverRadii,c=s.x,l=s.y,f=s.z,h=i*i*c*c,d=a*a*l*l,m=o*o*f*f,v=h+d+m,g=Math.sqrt(1/v),w=e.multiplyByScalar(t,g,p);if(v<this._centerToleranceSquared)return isFinite(g)?e.clone(w,n):void 0;var E=this._oneOverRadiiSquared,x=E.x,S=E.y,M=E.z,_=y;_.x=2*w.x*x,_.y=2*w.y*S,_.z=2*w.z*M;var O,T,P,C,R,N,I,b,z,A,D,U=(1-g)*e.magnitude(t)/(.5*e.magnitude(_)),q=0;do{U-=q,P=1/(1+U*x),C=1/(1+U*S),R=1/(1+U*M),N=P*P,I=C*C,b=R*R,z=N*P,A=I*C,D=b*R,O=h*N+d*I+m*b-1,T=h*z*x+d*A*S+m*D*M;var L=-2*T;q=O/L}while(Math.abs(O)>u.EPSILON12);return r(n)?(n.x=i*P,n.y=a*C,n.z=o*R,n):new e(i*P,a*C,o*R)},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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";var u=function(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";var t=function(t,n){this.start=e(t,0),this.stop=e(n,0)};return t}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";var i=function(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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 a=new i;i.distance=function(e,t){return i.subtract(e,t,a),i.magnitude(a)},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.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 o=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,o),r=i.multiplyByScalar(e,1-n,r),i.add(o,r,r)};var u=new i;return i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,u);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.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r&&Math.abs(e.z-n.z)<=r&&Math.abs(e.w-n.w)<=r},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){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function u(e){for(var t=0,n=0;3>n;++n){var r=e[c.getElementIndex(d[n],h[n])];t+=2*r*r}return Math.sqrt(t)}function s(e,t){for(var n=a.EPSILON15,r=0,i=1,o=0;3>o;++o){var u=Math.abs(e[c.getElementIndex(d[o],h[o])]);u>r&&(i=o,r=u)}var s=1,l=0,f=h[i],m=d[i];if(Math.abs(e[c.getElementIndex(m,f)])>n){var p,y=e[c.getElementIndex(m,m)],v=e[c.getElementIndex(f,f)],g=e[c.getElementIndex(m,f)],w=(y-v)/2/g;p=0>w?-1/(-w+Math.sqrt(1+w*w)):1/(w+Math.sqrt(1+w*w)),s=1/Math.sqrt(1+p*p),l=p*s}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(f,f)]=t[c.getElementIndex(m,m)]=s,t[c.getElementIndex(m,f)]=l,t[c.getElementIndex(f,m)]=-l,t}var c=function(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)};c.clone=function(e,t){return n(e)?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 c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,r,i){return r=t(r,0),n(i)||(i=new c),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},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.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 c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var r=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,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,m=r-u-f+d,p=2*(i-h),y=2*(a+l),v=2*(i+h),g=-r+u-f+d,w=2*(s-o),E=2*(a-l),x=2*(s+o),S=-r-u+f+d;return n(t)?(t[0]=m,t[1]=v,t[2]=E,t[3]=p,t[4]=g,t[5]=x,t[6]=y,t[7]=w,t[8]=S,t):new c(m,p,y,v,g,w,E,x,S)},c.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 c(e.x,0,0,0,e.y,0,0,0,e.z)},c.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 c(e,0,0,0,e,0,0,0,e)},c.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 c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.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 c(1,0,0,0,r,-i,0,i,r)},c.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 c(r,0,i,0,1,0,-i,0,r)},c.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 c(r,-i,0,i,r,0,0,0,1)},c.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]]},c.getElementIndex=function(e,t){return 3*e+t},c.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},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},c.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},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,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[3],t[4],t[5],l)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),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]*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},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},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},c.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},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},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},c.transpose=function(e,t){var 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 h=[1,0,0],d=[2,2,1],m=new c,p=new c;return c.computeEigenDecomposition=function(e,t){var r=a.EPSILON20,i=10,l=0,f=0;n(t)||(t={});for(var h=t.unitary=c.clone(c.IDENTITY,t.unitary),d=t.diagonal=c.clone(e,t.diagonal),y=r*o(d);i>f&&u(d)>y;)s(d,m),c.transpose(m,p),c.multiply(d,m,d),c.multiply(p,d,d),c.multiply(h,m,h),++l>2&&(++f,l=0);return t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},c.determinant=function(e){var t=e[0],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)},c.inverse=function(e,t){var n=e[0],i=e[1],o=e[2],u=e[3],s=e[4],l=e[5],f=e[6],h=e[7],d=e[8],m=c.determinant(e);if(Math.abs(m)<=a.EPSILON15)throw new r("matrix is not invertible");t[0]=s*d-h*l,t[1]=h*o-i*d,t[2]=i*l-s*o,t[3]=f*l-u*d,t[4]=n*d-f*o,t[5]=u*o-n*l,t[6]=u*h-f*s,t[7]=f*i-n*h,t[8]=n*s-u*i;var p=1/m;return c.multiplyByScalar(t,p,t)},c.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]},c.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},c.IDENTITY=i(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(n){t=n.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s){"use strict";var c=function(e,t,r,i,a,o,u,s,c,l,f,h,d,m,p,y){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(m,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(p,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(y,0)};c.packedLength=16,c.pack=function(e,t,r){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]},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){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new 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]):void 0},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,l=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,m=t.y*t.z,p=t.y*t.w,y=t.z*t.z,v=t.z*t.w,g=t.w*t.w,w=s-d-y+g,E=2*(l-v),x=2*(f+p),S=2*(l+v),M=-s+d-y+g,_=2*(m-h),O=2*(f-p),T=2*(m+h),P=-s-d+y+g;return i[0]=w*a,i[1]=S*a,i[2]=O*a,i[3]=0,i[4]=E*o,i[5]=M*o,i[6]=T*o,i[7]=0,i[8]=x*u,i[9]=_*u,i[10]=P*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.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 l=new e,f=new e,h=new e;c.fromCamera=function(t,n){var i=t.eye,a=t.target,o=t.up;e.normalize(e.subtract(a,i,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,m=l.x,p=l.y,y=l.z,v=h.x,g=h.y,w=h.z,E=i.x,x=i.y,S=i.z,M=u*-E+s*-x+d*-S,_=v*-E+g*-x+w*-S,O=m*E+p*x+y*S;return r(n)?(n[0]=u,n[1]=v,n[2]=-m,n[3]=0,n[4]=s,n[5]=g,n[6]=-p,n[7]=0,n[8]=d,n[9]=w,n[10]=-y,n[11]=0,n[12]=M,n[13]=_,n[14]=O,n[15]=1,n):new c(u,s,d,M,v,g,w,_,-m,-p,-y,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),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},c.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},c.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},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),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},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 c=.5*u,l=.5*s,f=.5*(r-t),h=c,d=l,m=f,p=a+c,y=o+l,v=t+f,g=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]=m,i[11]=0,i[12]=p,i[13]=y,i[14]=v,i[15]=g,i},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.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 d=new e;c.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;c.getMaximumScale=function(t){return c.getScale(t,m),e.maximumComponent(m)},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],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],m=e[11],p=e[12],y=e[13],v=e[14],g=e[15],w=t[0],E=t[1],x=t[2],S=t[3],M=t[4],_=t[5],O=t[6],T=t[7],P=t[8],C=t[9],R=t[10],N=t[11],I=t[12],b=t[13],z=t[14],A=t[15],D=r*w+u*E+f*x+p*S,U=i*w+s*E+h*x+y*S,q=a*w+c*E+d*x+v*S,L=o*w+l*E+m*x+g*S,W=r*M+u*_+f*O+p*T,B=i*M+s*_+h*O+y*T,F=a*M+c*_+d*O+v*T,G=o*M+l*_+m*O+g*T,Y=r*P+u*C+f*R+p*N,j=i*P+s*C+h*R+y*N,H=a*P+c*C+d*R+v*N,V=o*P+l*C+m*R+g*N,k=r*I+u*b+f*z+p*A,X=i*I+s*b+h*z+y*A,Z=a*I+c*b+d*z+v*A,J=o*I+l*b+m*z+g*A;return n[0]=D,n[1]=U,n[2]=q,n[3]=L,n[4]=W,n[5]=B,n[6]=F,n[7]=G,n[8]=Y,n[9]=j,n[10]=H,n[11]=V,n[12]=k,n[13]=X,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],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],m=e[14],p=t[0],y=t[1],v=t[2],g=t[4],w=t[5],E=t[6],x=t[8],S=t[9],M=t[10],_=t[12],O=t[13],T=t[14],P=r*p+o*y+c*v,C=i*p+u*y+l*v,R=a*p+s*y+f*v,N=r*g+o*w+c*E,I=i*g+u*w+l*E,b=a*g+s*w+f*E,z=r*x+o*S+c*M,A=i*x+u*S+l*M,D=a*x+s*S+f*M,U=r*_+o*O+c*T+h,q=i*_+u*O+l*T+d,L=a*_+s*O+f*T+m;return n[0]=P,n[1]=C,n[2]=R,n[3]=0,n[4]=N,n[5]=I,n[6]=b,n[7]=0,n[8]=z,n[9]=A,n[10]=D,n[11]=0,n[12]=U,n[13]=q,n[14]=L,n[15]=1,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 p=new e;c.multiplyByUniformScale=function(e,t,n){return p.x=t,p.y=t,p.z=t,c.multiplyByScale(e,p,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,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},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[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]},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 y=new u,v=new u,g=new t,w=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,y),v,o.EPSILON7)&&t.equals(c.getRow(e,3,g),w))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],l=e[12],f=e[1],h=e[5],d=e[9],m=e[13],p=e[2],E=e[6],x=e[10],S=e[14],M=e[3],_=e[7],O=e[11],T=e[15],P=x*T,C=S*O,R=E*T,N=S*_,I=E*O,b=x*_,z=p*T,A=S*M,D=p*O,U=x*M,q=p*_,L=E*M,W=P*h+N*d+I*m-(C*h+R*d+b*m),B=C*f+z*d+U*m-(P*f+A*d+D*m),F=R*f+A*h+q*m-(N*f+z*h+L*m),G=b*f+D*h+L*d-(I*f+U*h+q*d),Y=C*i+R*a+b*l-(P*i+N*a+I*l),j=P*r+A*a+D*l-(C*r+z*a+U*l),H=N*r+z*i+L*l-(R*r+A*i+q*l),V=I*r+U*i+q*a-(b*r+D*i+L*a);P=a*m,C=l*d,R=i*m,N=l*h,I=i*d,b=a*h,z=r*m,A=l*f,D=r*d,U=a*f,q=r*h,L=i*f;var k=P*_+N*O+I*T-(C*_+R*O+b*T),X=C*M+z*O+U*T-(P*M+A*O+D*T),Z=R*M+A*_+q*T-(N*M+z*_+L*T),J=b*M+D*_+L*O-(I*M+U*_+q*O),K=R*x+b*S+C*E-(I*S+P*E+N*x),$=D*S+P*p+A*x-(z*x+U*S+C*p),Q=z*E+L*S+N*p-(q*S+R*p+A*E),et=q*x+I*p+U*E-(D*E+L*x+b*p),tt=r*W+i*B+a*F+l*G;if(Math.abs(tt)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return tt=1/tt,n[0]=W*tt,n[1]=B*tt,n[2]=F*tt,n[3]=G*tt,n[4]=Y*tt,n[5]=j*tt,n[6]=H*tt,n[7]=V*tt,n[8]=k*tt,n[9]=X*tt,n[10]=Z*tt,n[11]=J*tt,n[12]=K*tt,n[13]=$*tt,n[14]=Q*tt,n[15]=et*tt,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],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],m=-n*f-r*h-i*d,p=-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]=m,t[13]=p,t[14]=y,t[15]=1,t},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o){"use strict";var u=function(e,n,r,i){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(i,0)};u.fromDegrees=function(e,r,i,a,s){return e=o.toRadians(t(e,0)),r=o.toRadians(t(r,0)),i=o.toRadians(t(i,0)),a=o.toRadians(t(a,0)),n(s)?(s.west=e,s.south=r,s.east=i,s.north=a,s):new u(e,r,i,a)},u.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=e.length;c>s;s++){var l=e[s];r=Math.min(r,l.longitude),i=Math.max(i,l.longitude),a=Math.min(a,l.latitude),o=Math.max(o,l.latitude)}return n(t)?(t.west=r,t.south=a,t.east=i,t.north=o,t):new u(r,a,i,o)},u.packedLength=4,u.pack=function(e,n,r){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},u.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i.west=e[r++],i.south=e[r++],i.east=e[r++],i.north=e[r],i},u.clone=function(e,t){return n(e)?n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.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},u.validate=function(){},u.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)},u.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)},u.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)},u.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)},u.center=function(t,r){var i=t.east,a=t.west,u=.5*(a+i);return a>i&&(u=o.negativePiToPi(u+o.PI)),n(r)?(r.longitude=u,r.latitude=.5*(t.south+t.north),r.height=0,r):new e(u,.5*(t.south+t.north))},u.intersectWith=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),s=Math.min(e.north,t.north);return n(r)?(r.west=i,r.south=a,r.east=o,r.north=s,r):new u(i,a,o,s)},u.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},u.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var s=new e;return u.subsample=function(e,r,a,u){r=t(r,i.WGS84),a=t(a,0),n(u)||(u=[]);var c=0,l=e.north,f=e.south,h=e.east,d=e.west,m=s;m.height=a,m.longitude=d,m.latitude=l,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=0>l?l:f>0?f:0;for(var p=1;8>p;++p){var y=-Math.PI+p*o.PI_OVER_TWO;y>d&&h>y&&(m.longitude=y,u[c]=r.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,c,l){"use strict";var f=function(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)},h=new e,d=new e,m=new e,p=new e,y=new e,v=new e,g=new e,w=new e,E=new e,x=new e,S=new e,M=new e;f.fromPoints=function(t,n){if(r(n)||(n=new f),!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],g),a=e.clone(i,h),o=e.clone(i,d),u=e.clone(i,m),s=e.clone(i,p),c=e.clone(i,y),l=e.clone(i,v),_=t.length,O=1;_>O;O++){e.clone(t[O],i);var T=i.x,P=i.y,C=i.z;T<a.x&&e.clone(i,a),T>s.x&&e.clone(i,s),P<o.y&&e.clone(i,o),P>c.y&&e.clone(i,c),C<u.z&&e.clone(i,u),C>l.z&&e.clone(i,l)}var R=e.magnitudeSquared(e.subtract(s,a,w)),N=e.magnitudeSquared(e.subtract(c,o,w)),I=e.magnitudeSquared(e.subtract(l,u,w)),b=a,z=s,A=R;N>A&&(A=N,b=o,z=c),I>A&&(A=I,b=u,z=l);var D=E;D.x=.5*(b.x+z.x),D.y=.5*(b.y+z.y),D.z=.5*(b.z+z.z);var U=e.magnitudeSquared(e.subtract(z,D,w)),q=Math.sqrt(U),L=x;L.x=a.x,L.y=o.y,L.z=u.z;var W=S;W.x=s.x,W.y=c.y,W.z=l.z;var B=e.multiplyByScalar(e.add(L,W,w),.5,M),F=0;for(O=0;_>O;O++){e.clone(t[O],i);var G=e.magnitude(e.subtract(i,B,w));G>F&&(F=G);var Y=e.magnitudeSquared(e.subtract(i,D,w));if(Y>U){var j=Math.sqrt(Y);q=.5*(q+j),U=q*q;var H=j-q;D.x=(q*D.x+H*i.x)/j,D.y=(q*D.y+H*i.y)/j,D.z=(q*D.z+H*i.z)/j}}return F>q?(e.clone(D,n.center),n.radius=q):(e.clone(B,n.center),n.radius=F),n};var _=new o,O=new e,T=new e,P=new t,C=new t;f.fromRectangle2D=function(e,t,n){return f.fromRectangleWithHeights2D(e,t,0,0,n)},f.fromRectangleWithHeights2D=function(t,i,a,o,u){if(r(u)||(u=new f),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=n(i,_),l.southwest(t,P),P.height=a,l.northeast(t,C),C.height=o;var s=i.project(P,O),c=i.project(C,T),h=c.x-s.x,d=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(h*h+d*d+m*m);var p=u.center;return p.x=s.x+.5*h,p.y=s.y+.5*d,p.z=s.z+.5*m,u};var R=[];f.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,R)),f.fromPoints(u,o)},f.fromVertices=function(t,i,a,o){if(r(o)||(o=new f),!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=g;u.x=t[0]+i.x,u.y=t[1]+i.y,u.z=t[2]+i.z;for(var s=e.clone(u,h),c=e.clone(u,d),l=e.clone(u,m),_=e.clone(u,p),O=e.clone(u,y),T=e.clone(u,v),P=t.length,C=0;P>C;C+=a){var R=t[C]+i.x,N=t[C+1]+i.y,I=t[C+2]+i.z;u.x=R,u.y=N,u.z=I,R<s.x&&e.clone(u,s),R>_.x&&e.clone(u,_),N<c.y&&e.clone(u,c),N>O.y&&e.clone(u,O),I<l.z&&e.clone(u,l),I>T.z&&e.clone(u,T)}var b=e.magnitudeSquared(e.subtract(_,s,w)),z=e.magnitudeSquared(e.subtract(O,c,w)),A=e.magnitudeSquared(e.subtract(T,l,w)),D=s,U=_,q=b;z>q&&(q=z,D=c,U=O),A>q&&(q=A,D=l,U=T);var L=E;L.x=.5*(D.x+U.x),L.y=.5*(D.y+U.y),L.z=.5*(D.z+U.z);var W=e.magnitudeSquared(e.subtract(U,L,w)),B=Math.sqrt(W),F=x;F.x=s.x,F.y=c.y,F.z=l.z;var G=S;G.x=_.x,G.y=O.y,G.z=T.z;var Y=e.multiplyByScalar(e.add(F,G,w),.5,M),j=0;for(C=0;P>C;C+=a){u.x=t[C]+i.x,u.y=t[C+1]+i.y,u.z=t[C+2]+i.z;var H=e.magnitude(e.subtract(u,Y,w));H>j&&(j=H);var V=e.magnitudeSquared(e.subtract(u,L,w));if(V>W){var k=Math.sqrt(V);B=.5*(B+k),W=B*B;var X=k-B;L.x=(B*L.x+X*u.x)/k,L.y=(B*L.y+X*u.y)/k,L.z=(B*L.z+X*u.z)/k}}return j>B?(e.clone(L,o.center),o.radius=B):(e.clone(Y,o.center),o.radius=j),o},f.fromCornerPoints=function(t,n,i){r(i)||(i=new f);var a=i.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,n),i},f.fromEllipsoid=function(t,n){return r(n)||(n=new f),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n},f.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new f(t.center,t.radius):void 0},f.packedLength=4,f.pack=function(e,t,r){r=n(r,0);var i=e.center;t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius},f.unpack=function(e,t,i){t=n(t,0),r(i)||(i=new f);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var N=new e,I=new e;f.union=function(t,n,i){r(i)||(i=new f);var a=t.center,o=n.center;e.add(a,o,I);var u=e.multiplyByScalar(I,.5,I),s=e.magnitude(e.subtract(a,u,N))+t.radius,c=e.magnitude(e.subtract(o,u,N))+n.radius;return i.radius=Math.max(s,c),e.clone(u,i.center),i};var b=new e;f.expand=function(t,n,r){r=f.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,b));return i>r.radius&&(r.radius=i),r},f.intersect=function(t,n){var r=t.center,i=t.radius,a=e.dot(n,r)+n.w;return-i>a?u.OUTSIDE:i>a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;f.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},f.transformWithoutScale=function(e,t,n){return r(n)||(n=new f),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var A=new e;f.computePlaneDistances=function(t,n,i,a){r(a)||(a=new s);var o=e.subtract(t.center,n,A),u=e.multiplyByScalar(i,e.dot(i,o),A),c=e.magnitude(u);return a.start=c-t.radius,a.stop=c+t.radius,a};for(var D=new e,U=new e,q=new e,L=new e,W=new e,B=new t,F=new Array(8),G=0;8>G;++G)F[G]=new e;var Y=new o;return f.projectTo2D=function(t,r,i){r=n(r,Y);var a=r.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,D),c=e.cross(e.UNIT_Z,s,U);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 h=e.negate(l,W),d=e.negate(c,L),m=F,p=m[0];e.add(s,l,p),e.add(p,c,p),p=m[1],e.add(s,l,p),e.add(p,d,p),p=m[2],e.add(s,h,p),e.add(p,d,p),p=m[3],e.add(s,h,p),e.add(p,c,p),e.negate(s,s),p=m[4],e.add(s,l,p),e.add(p,c,p),p=m[5],e.add(s,l,p),e.add(p,d,p),p=m[6],e.add(s,h,p),e.add(p,d,p),p=m[7],e.add(s,h,p),e.add(p,c,p);for(var y=m.length,v=0;y>v;++v){var g=m[v];e.add(o,g,g);var w=a.cartesianToCartographic(g,B);r.project(w,g)}i=f.fromPoints(m,i),o=i.center;var E=o.x,x=o.y,S=o.z;return o.x=S,o.y=E,o.z=x,i},f.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},f.prototype.intersect=function(e){return f.intersect(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var 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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++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",e(document[i])?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",e(document[i])&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",e(document[i])?r.fullscreenElement=i:(i=s+"FullScreenElement",e(document[i])&&(r.fullscreenElement=i)),i=s+"fullscreenchange",e(document["on"+i])&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",e(document["on"+i])&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e){i.supportsFullscreen()&&e[r.requestFullscreen]()},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;r>n;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(m)){m=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(m=!0,p=r(e[1]))}return m}function a(){return i()&&p}function o(){if(!t(y)&&(y=!1,!i()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(y=!0,v=r(e[1]))}return y}function u(){return o()&&v}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(g=!0,w=r(e[1]),w.isNightly=!!e[2])}return g}function c(){return s()&&w}function l(){if(!t(E)){E=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(E=!0,x=r(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(E=!0,x=r(e[1])))}return E}function f(){return l()&&x}function h(){if(!t(S)){S=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function d(){return h()&&M}var m,p,y,v,g,w,E,x,S,M,_={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:d,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};return _.supportsFullscreen=function(){return n.supportsFullscreen()},_.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},_.supportsWebWorkers=function(){return"undefined"!=typeof Worker},_}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,i){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return t(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(t,r,i,o){switch(i=e(i,0),o=e(o,(r.byteLength-i)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(r,i,o);case a.UNSIGNED_BYTE:return new Uint8Array(r,i,o);case a.SHORT:return new Int16Array(r,i,o);case a.UNSIGNED_SHORT:return new Uint16Array(r,i,o);case a.FLOAT:return new Float32Array(r,i,o);case a.DOUBLE:return new Float64Array(r,i,o);default:throw new n("componentDatatype is not a valid value.")}},i(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"],function(e){"use strict";var t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(e){return e===t.POINTS||e===t.LINES||e===t.LINE_LOOP||e===t.LINE_STRIP||e===t.TRIANGLES||e===t.TRIANGLE_STRIP||e===t.TRIANGLE_FAN}};return e(t)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";var a=function(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)};return a.computeNumberOfVertices=function(e){var r=-1;for(var i in e.attributes)if(e.attributes.hasOwnProperty(i)&&t(e.attributes[i])&&t(e.attributes[i].values)){var a=e.attributes[i],o=a.values.length/a.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(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"],function(e,t,n,r){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,i){return e>r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(i)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,i){"use strict";var a=function(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;f>h;h++){var d=t[h],m=d.x,p=d.y,y=d.z;i=Math.min(m,i),s=Math.max(m,s),o=Math.min(p,o),c=Math.max(p,c),u=Math.min(y,u),l=Math.max(y,l)}var v=r.minimum;v.x=i,v.y=o,v.z=u;var g=r.maximum;g.x=s,g.y=c,g.z=l;var w=e.add(v,g,r.center);return e.multiplyByScalar(w,.5,w),r},a.clone=function(t,r){return n(t)?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):void 0},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.intersect=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),a=r.x*Math.abs(n.x)+r.y*Math.abs(n.y)+r.z*Math.abs(n.z),u=e.dot(t.center,n)+n.w;return u-a>0?i.INSIDE:0>u+a?i.OUTSIDE:i.INTERSECTING},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.intersect=function(e){return a.intersect(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";var a=function(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){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new a(e.x,e.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},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.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.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.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.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r},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){return a.equalsEpsilon(this,e,t)},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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(a=-i/e,0>a)return[];var s=Math.sqrt(a);return[-s,s]}if(0===i)return a=-r/e,0>a?[a,0]:[0,a];var c=r*r,l=4*e*i,f=n(c,-l,t.EPSILON14);if(0>f)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,m=o*s-h,p=o*c-u*s,y=u*c-d,v=4*m*y-p*p;if(0>v){var g,w,E;h*f>=l*d?(g=o,w=m,E=-2*u*m+o*p):(g=c,w=y,E=-c*p+2*s*y);var x=0>E?-1:1,S=-x*Math.abs(g)*Math.sqrt(-v);a=-E+S;var M=a/2,_=0>M?-Math.pow(-M,1/3):Math.pow(M,1/3),O=a===S?-_:-w/_;return i=0>=w?_+O:-E/(_*_+O*O+w),h*f>=l*d?[(i-u)/o]:[-c/(i+s)]}var T=m,P=-2*u*m+o*p,C=y,R=-c*p+2*s*y,N=Math.sqrt(v),I=Math.sqrt(3)/2,b=Math.abs(Math.atan2(o*N,-P)/3);i=2*Math.sqrt(-T);var z=Math.cos(b);a=i*z;var A=i*(-z/2-I*Math.sin(b)),D=a+A>2*u?a-u:A-u,U=o,q=D/U;b=Math.abs(Math.atan2(c*N,-R)/3),i=2*Math.sqrt(-C),z=Math.cos(b),a=i*z,A=i*(-z/2-I*Math.sin(b));var L=-c,W=2*s>a+A?a+s:A+s,B=L/W,F=U*W,G=-D*W-U*L,Y=D*L,j=(s*G-u*Y)/(-u*G+s*F);return j>=q?B>=q?B>=j?[q,j,B]:[q,B,j]:[B,q,j]:B>=q?[j,q,B]:B>=j?[j,B,q]:[B,j,q]}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=0>u?-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,0>u?[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 m=r.computeRealRoots(1,s,l);if(2===m.length){var p,y=m[0],v=m[1];if(y>=0&&v>=0){var g=Math.sqrt(y),w=Math.sqrt(v);return[h-w,h-g,h+g,h+w]}if(y>=0&&0>v)return p=Math.sqrt(y),[h-p,h+p];if(0>y&&v>=0)return p=Math.sqrt(v),[h-p,h+p]}return[]}if(d>0){var E=Math.sqrt(d),x=(s+d-c/E)/2,S=(s+d+c/E)/2,M=r.computeRealRoots(1,E,x),_=r.computeRealRoots(1,-E,S);return 0!==M.length?(M[0]+=h,M[1]+=h,0!==_.length?(_[0]+=h,_[1]+=h,M[1]<=_[0]?[M[0],M[1],_[0],_[1]]:_[1]<=M[0]?[_[0],_[1],M[0],M[1]]:M[0]>=_[0]&&M[1]<=_[1]?[_[0],M[0],M[1],_[1]]:_[0]>=M[0]&&_[1]<=M[1]?[M[0],_[0],_[1],M[1]]:M[0]>_[0]&&M[0]<_[1]?[_[0],M[0],_[1],M[1]]:[M[0],_[0],M[1],_[1]]):M):0!==_.length?(_[0]+=h,_[1]+=h,_):[]}}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 m,p,y=d[0],v=i-y,g=v*v,w=t/2,E=v/2,x=g-4*o,S=g+4*Math.abs(o),M=c-4*y,_=c+4*Math.abs(y);if(0>y||M*S>x*_){var O=Math.sqrt(M);m=O/2,p=0===O?0:(t*E-a)/O}else{var T=Math.sqrt(x);m=0===T?0:(t*E-a)/T,p=T/2}var P,C;0===w&&0===m?(P=0,C=0):n.sign(w)===n.sign(m)?(P=w+m,C=y/P):(C=w-m,P=y/C);var R,N;0===E&&0===p?(R=0,N=0):n.sign(E)===n.sign(p)?(R=E+p,N=o/R):(N=E-p,R=o/N);var I=r.computeRealRoots(1,P,R),b=r.computeRealRoots(1,C,N);if(0!==I.length)return 0!==b.length?I[1]<=b[0]?[I[0],I[1],b[0],b[1]]:b[1]<=I[0]?[b[0],b[1],I[0],I[1]]:I[0]>=b[0]&&I[1]<=b[1]?[b[0],I[0],I[1],b[1]]:b[0]>=I[0]&&b[1]<=I[1]?[I[0],b[0],b[1],I[1]]:I[0]>b[0]&&I[0]<b[1]?[b[0],I[0],b[1],I[1]]:[I[0],b[0],I[1],b[1]]:I;if(0!==b.length)return b}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,m=d*i,p=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*a*f*f+256*o*m+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 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=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>f?d+1:d,d+=0>h?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 void 0}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r=function(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 r.getPoint=function(t,r,i){return n(i)||(i=new e),i=e.multiplyByScalar(t.direction,r,i),e.add(t.origin,i,i)},r}),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(t,r,i,o,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,m=t.direction,p=e.subtract(i,r,y),x=e.subtract(o,r,v),S=e.cross(m,x,g),M=e.dot(p,S);if(u){if(M<a.EPSILON6)return void 0;if(s=e.subtract(d,r,w),l=e.dot(s,S),0>l||l>M)return void 0;if(c=e.cross(s,p,E),f=e.dot(m,c),0>f||l+f>M)return void 0;h=e.dot(x,c)/M}else{if(Math.abs(M)<a.EPSILON6)return void 0;var _=1/M;if(s=e.subtract(d,r,w),l=e.dot(s,S)*_,0>l||l>1)return void 0;if(c=e.cross(s,p,E),f=e.dot(m,c)*_,0>f||l+f>1)return void 0;h=e.dot(x,c)*_}return h}function f(e,t,n,r){var i=t*t-4*e*n;if(0>i)return void 0;if(i>0){var a=1/(2*e),o=Math.sqrt(i),u=(-t+o)*a,s=(-t-o)*a;return s>u?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);return 0===c?void 0:(r.root0=r.root1=c,r)}function h(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,g),l=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,m=f(l,h,d,S);return r(m)?(i.start=m.root0,i.stop=m.root1,i):void 0}function d(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 m(t,n,r,i,c){var l,f=i*i,h=c*c,m=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,p=c*(i*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],a.EPSILON15)+n.y),y=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*h+i*n.x+r,v=h*d(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],a.EPSILON15),g=c*(i*d(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),w=[];if(0===g&&0===v){if(l=u.computeRealRoots(m,p,y),0===l.length)return w;var E=l[0],x=Math.sqrt(Math.max(1-E*E,0));if(w.push(new e(i,c*E,c*-x)),w.push(new e(i,c*E,c*x)),2===l.length){var S=l[1],M=Math.sqrt(Math.max(1-S*S,0));w.push(new e(i,c*S,c*-M)),w.push(new e(i,c*S,c*M))}return w}var _=g*g,O=v*v,T=m*m,P=g*v,C=T+O,R=2*(p*m+P),N=2*y*m+p*p-O+_,I=2*(y*p-P),b=y*y-_;if(0===C&&0===R&&0===N&&0===I)return w;l=s.computeRealRoots(C,R,N,I,b);var z=l.length;if(0===z)return w;for(var A=0;z>A;++A){var D,U=l[A],q=U*U,L=Math.max(1-q,0),W=Math.sqrt(L);D=a.sign(m)===a.sign(y)?d(m*q+y,p*U,a.EPSILON12):a.sign(y)===a.sign(p*U)?d(m*q,p*U+y,a.EPSILON12):d(m*q+p*U,y,a.EPSILON12);var B=d(v*U,g,a.EPSILON15),F=D*B;0>F?w.push(new e(i,c*U,c*W)):F>0?w.push(new e(i,c*U,c*-W)):0!==W?(w.push(new e(i,c*U,c*-W)),w.push(new e(i,c*U,c*W)),++A):w.push(new e(i,c*U,c*W))}return w}var p={};p.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)return void 0;var l=(-n.distance-e.dot(s,o))/c;return 0>l?void 0:(i=e.multiplyByScalar(u,l,i),e.add(o,i,i))};var y=new e,v=new e,g=new e,w=new e,E=new e;p.rayTriangle=function(t,n,i,a,o,u){var s=l(t,n,i,a,o);return!r(s)||0>s?void 0:(r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u))};var x=new c;p.lineSegmentTriangle=function(t,n,i,a,o,u,s){var c=x;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var f=l(c,i,a,o,u);return!r(f)||0>f||f>e.distance(t,n)?void 0:(r(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var S={root0:0,root1:0};p.raySphere=function(e,t,n){return n=h(e,t,n),!r(n)||n.stop<0?void 0:(n.start=Math.max(n.start,0),n)};var M=new c;p.lineSegmentSphere=function(t,n,i,a){var o=M;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),a=h(o,i,a),!r(a)||a.stop<0||a.start>s?void 0:(a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a)};var _=new e,O=new e;p.rayEllipsoid=function(t,n){var r,i,a,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,_),l=e.multiplyComponents(s,t.direction,O),f=e.magnitudeSquared(c),h=e.dot(c,l);if(f>1){if(h>=0)return void 0;var d=h*h;if(r=f-1,i=e.magnitudeSquared(l),a=i*r,a>d)return void 0;if(d>a){o=h*h-a,u=-h+Math.sqrt(o);var m=u/i,p=r/u;return p>m?{start:m,stop:p}:{start:p,stop:m}}var y=Math.sqrt(r/i);return{start:y,stop:y}}return 1>f?(r=f-1,i=e.magnitudeSquared(l),a=i*r,o=h*h-a,u=-h+Math.sqrt(o),{start:0,stop:u/i}):0>h?(i=e.magnitudeSquared(l),{start:0,stop:-h/i}):void 0};var T=new e,P=new e,C=new e,R=new e,N=new e,I=new o,b=new o,z=new o,A=new o,D=new o,U=new o,q=new o,L=new e,W=new e,B=new t;p.grazingAltitudeLocation=function(t,n){var i=t.origin,u=t.direction,s=n.geodeticSurfaceNormal(i);if(e.dot(u,s)>=0)return i;var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u),f=e.normalize(l,T),h=e.mostOrthogonalAxis(l,R),d=e.normalize(e.cross(h,f,P),P),p=e.normalize(e.cross(f,d,C),C),y=I;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 v=o.transpose(y,b),g=o.fromScale(n.radii,z),w=o.fromScale(n.oneOverRadii,A),E=D;E[0]=0,E[1]=-u.z,E[2]=u.y,E[3]=u.z,E[4]=0,E[5]=-u.x,E[6]=-u.y,E[7]=u.x,E[8]=0;var x,S,M=o.multiply(o.multiply(v,w,U),E,U),_=o.multiply(o.multiply(M,g,q),y,q),O=o.multiplyByVector(M,i,N),F=m(_,e.negate(O,T),0,0,1),G=F.length;if(G>0){for(var Y=e.clone(e.ZERO,W),j=Number.NEGATIVE_INFINITY,H=0;G>H;++H){x=o.multiplyByVector(g,o.multiplyByVector(y,F[H],L),L);var V=e.normalize(e.subtract(x,i,R),R),k=e.dot(V,u);k>j&&(j=k,Y=e.clone(x,Y))}var X=n.cartesianToCartographic(Y,B);return j=a.clamp(j,0,1),S=e.magnitude(e.subtract(Y,i,R))*Math.sqrt(1-j*j),S=c?-S:S,X.height=S,n.cartographicToCartesian(X)}return void 0};var F=new e;return p.lineSegmentPlane=function(t,n,i,o){r(o)||(o=new e);var u=e.subtract(n,t,F),s=i.normal,c=e.dot(s,u);if(Math.abs(c)<a.EPSILON6)return void 0;var l=e.dot(s,t),f=-(i.distance+l)/c;return 0>f||f>1?void 0:(e.multiplyByScalar(u,f,o),e.add(t,o,o),o)},p.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 p.lineSegmentPlane(t,n,i,f),p.lineSegmentPlane(t,r,i,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(n,r,i,f),p.lineSegmentPlane(n,t,i,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(r,t,i,f),p.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 p.lineSegmentPlane(n,t,i,f),p.lineSegmentPlane(r,t,i,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(r,n,i,f),p.lineSegmentPlane(t,n,i,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,r,i,f),p.lineSegmentPlane(n,r,i,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},p}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var n=function(t,n){this.normal=e.clone(t),this.distance=n};return n.fromPointNormal=function(r,i,a){var o=-e.dot(i,r);return t(a)?(e.clone(i,a.normal),a.distance=o,a):new n(i,o)},n.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},n}),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(r){return a(r)}});return n}function a(e){var n=new r(function(n,r){try{return r?t(r(e)):a(e)}catch(i){return a(i)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return m(e)}function i(e){return m(a(e))}function u(e){return d(e)}var s,c,l,f,h,d,m;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(t){r.progress(t)}}: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 p(f,e),e},m=function(e){return e=t(e),h=e.then,m=t,d=v,p(l,e),f=l=x,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){p(e)}function s(e){m(e)}var c,l,f,h,d,m,p,y,g,w;if(g=t.length>>>0,c=Math.max(0,Math.min(n,g)),f=[],l=g-c+1,h=[],d=o(),c)for(y=d.progress,p=function(e){h.push(e),--l||(m=p=v,d.reject(h))},m=function(e){f.push(e),--c||(m=p=v,d.resolve(f))},w=0;g>w;++w)w in t&&e(t[w],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,g).then(t,n,r)}function f(){return h(arguments,g)}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;i>s;s++)s in t?u(t[s],s):--a;else c.resolve(r);return c.promise})}function d(t,n){var r=E.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)})})},w.apply(t,r)})}function m(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 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 v(){}function g(e){return e}var w,E,x;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=m,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(x,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(x,t)})})}},E=[].slice,w=[].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(;i>a;++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(){"use strict";var e=function(e,t,n){for(var r,i,a=0,o=e.length-1;o>=a;)if(r=~~((a+o)/2),i=n(e[r],t),0>i)a=r+1;else{if(!(i>0))return r;o=r-1}return~(o+1)};return e}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";var e=function(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,m,p,y,v;if("%%"==e)return"%";for(var g=!1,w="",E=!1,x=!1,S=" ",M=s.length,_=0;s&&M>_;_++)switch(s.charAt(_)){case" ":w=" ";break;case"+":w="+";break;case"-":g=!0;break;case"'":S=s.charAt(_+1);break;case"0":E=!0;break;case"#":x=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(c=-c,g=!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,v=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(v),g,c,f,E,S);case"c":return u(String.fromCharCode(+v),g,c,f,E);case"b":return o(v,2,x,g,c,f,E);case"o":return o(v,8,x,g,c,f,E);case"x":return o(v,16,x,g,c,f,E);case"X":return o(v,16,x,g,c,f,E).toUpperCase();case"u":return o(v,10,x,g,c,f,E);case"i":case"d":return d=+v||0,d=Math.round(d-d%1),m=0>d?"-":w,v=m+i(String(Math.abs(d)),f,"0",!1),a(v,m,g,c,E);case"e":case"E":case"f":case"F":case"g":case"G":return d=+v,m=0>d?"-":w,p=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],y=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],v=m+Math.abs(d)[p](f),a(v,m,g,c,E)[y]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";var e=function(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(){"use strict";function e(e){return 0===e%4&&0!==e%100||0===e%400}return e}),define("Core/LeapSecond",[],function(){"use strict";var e=function(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 R.compare(e.julianDate,t.julianDate)}function f(e){g.julianDate=e;var n=R.leapSeconds,r=t(n,g,l);0>r&&(r=~r),r>=n.length&&(r=n.length-1);var i=n[r].offset;if(r>0){var a=R.secondsDifference(n[r].julianDate,e);a>i&&(r--,i=n[r].offset)}R.addSeconds(e,i,e)}function h(e,n){g.julianDate=e;var r=R.leapSeconds,i=t(r,g,l);if(0>i&&(i=~i),0===i)return R.addSeconds(e,-r[0].offset,n);if(i>=r.length)return R.addSeconds(e,-r[i-1].offset,n);var a=R.secondsDifference(r[i].julianDate,e);return 0===a?R.addSeconds(e,-r[i].offset,n):1>=a?void 0:R.addSeconds(e,-r[--i].offset,n)}function d(e,t,n){var r=0|t/s.SECONDS_PER_DAY;return e+=r,t-=s.SECONDS_PER_DAY*r,0>t&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function m(e,t,n,r,i,a,o){var u=0|(t-14)/12,c=e+4800+u,l=(0|1461*c/4)+(0|367*(t-2-12*u)/12)-(0|3*((c+100)/100)/4)+n-32075;r-=12,0>r&&(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]}var p=new a,y=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,g=new u,w=/^(\d{4})$/,E=/^(\d{4})-(\d{2})$/,x=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,M=/^(\d{4})-?(\d{2})-?(\d{2})$/,_=/([Z+\-])?(\d{2})?:?(\d{2})?$/,O=/^(\d{2})(\.\d+)?/.source+_.source,T=/^(\d{2}):?(\d{2})(\.\d+)?/.source+_.source,P=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+_.source,C="Invalid ISO 8601 date.",R=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 i=0|e;t+=(e-i)*s.SECONDS_PER_DAY,d(i,t,this),r===c.UTC&&f(this)};R.fromDate=function(e,t){var n=m(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 R(n[0],n[1],c.UTC)},R.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,u,s=e.split("T"),l=1,h=1,p=0,g=0,_=0,N=0,I=s[0],b=s[1];if(!r(I))throw new i(C);var z;if(s=I.match(M),null!==s){if(z=I.split("-").length-1,z>0&&2!==z)throw new i(C);n=+s[1],l=+s[2],h=+s[3]}else if(s=I.match(E),null!==s)n=+s[1],l=+s[2];else if(s=I.match(w),null!==s)n=+s[1];else{var A;if(s=I.match(x),null!==s){if(n=+s[1],A=+s[2],u=o(n),1>A||u&&A>366||!u&&A>365)throw new i(C)}else{if(s=I.match(S),null===s)throw new i(C);n=+s[1];var D=+s[2],U=+s[3]||0;if(z=I.split("-").length-1,z>0&&(!r(s[3])&&1!==z||r(s[3])&&2!==z))throw new i(C);var q=new Date(Date.UTC(n,0,4));A=7*D+U-q.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(A),l=a.getUTCMonth()+1,h=a.getUTCDate()}if(u=o(n),1>l||l>12||1>h||(2!==l||!u)&&h>y[l-1]||u&&2===l&&h>v)throw new i(C);var L;if(r(b)){if(s=b.match(P),null!==s){if(z=b.split(":").length-1,z>0&&2!==z&&3!==z)throw new i(C);p=+s[1],g=+s[2],_=+s[3],N=1e3*+(s[4]||0),L=5}else if(s=b.match(T),null!==s){if(z=b.split(":").length-1,z>0&&1!==z)throw new i(C);p=+s[1],g=+s[2],_=60*+(s[3]||0),L=4}else{if(s=b.match(O),null===s)throw new i(C);p=+s[1],g=60*+(s[2]||0),L=3}if(g>=60||_>=61||p>24||24===p&&(g>0||_>0||N>0))throw new i(C);var W=s[L],B=+s[L+1],F=+(s[L+2]||0);switch(W){case"+":p-=B,g-=F;break;case"-":p+=B,g+=F;break;case"Z":break;default:g+=new Date(Date.UTC(n,l-1,h,p,g)).getTimezoneOffset()}}else g+=new Date(Date.UTC(n,l-1,h)).getTimezoneOffset();var G=60===_;for(G&&_--;g>=60;)g-=60,p++;for(;p>=24;)p-=24,h++;for(a=u&&2===l?v:y[l-1];h>a;)h-=a,l++,l>12&&(l-=12,n++),a=u&&2===l?v:y[l-1];for(;0>g;)g+=60,p--;for(;0>p;)p+=24,h--;for(;1>h;)l--,1>l&&(l+=12,n--),a=u&&2===l?v:y[l-1],h+=a;var Y=m(n,l,h,p,g,_,N);return r(t)?(d(Y[0],Y[1],t),f(t)):t=new R(Y[0],Y[1],c.UTC),G&&R.addSeconds(t,1,t),t},R.now=function(e){return R.fromDate(new Date,e)};var N=new R(0,0,c.TAI);return R.toGregorianDate=function(e,t){var n=!1,i=h(e,N);r(i)||(R.addSeconds(e,-1,N),i=h(N,N),n=!0);var o=i.dayNumber,u=i.secondsOfDay;u>=43200&&(o+=1);var c=0|o+68569,l=0|4*c/146097;c=0|c-(0|(146097*l+3)/4);var f=0|4e3*(c+1)/1461001;c=0|c-(0|1461*f/4)+31;var d=0|80*c/2447,m=0|c-(0|2447*d/80);c=0|d/11;var p=0|d+2-12*c,y=0|100*(l-49)+f+c,v=0|u/s.SECONDS_PER_HOUR,g=u-v*s.SECONDS_PER_HOUR,w=0|g/s.SECONDS_PER_MINUTE;g-=w*s.SECONDS_PER_MINUTE;var E=0|g,x=(g-E)/s.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),n&&(E+=1),r(t)?(t.year=y,t.month=p,t.day=m,t.hour=v,t.minute=w,t.second=E,t.millisecond=x,t.isLeapSecond=n,t):new a(y,p,m,v,w,E,x,n)},R.toDate=function(e){var t=R.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))},R.toIso8601=function(t,n){var i,a=R.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))},R.clone=function(e,t){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new R(e.dayNumber,e.secondsOfDay,c.TAI):void 0},R.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},R.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},R.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(R.secondsDifference(e,t))<=n},R.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},R.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},R.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},R.computeTaiMinusUtc=function(e){g.julianDate=e;var n=R.leapSeconds,r=t(n,g,l);return 0>r&&(r=~r,--r,0>r&&(r=0)),n[r].offset},R.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},R.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},R.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},R.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},R.lessThan=function(e,t){return R.compare(e,t)<0},R.lessThanOrEquals=function(e,t){return R.compare(e,t)<=0},R.greaterThan=function(e,t){return R.compare(e,t)>0},R.greaterThanOrEquals=function(e,t){return R.compare(e,t)>=0},R.prototype.clone=function(e){return R.clone(this,e)},R.prototype.equals=function(e){return R.equals(this,e)},R.prototype.equalsEpsilon=function(e,t){return R.equalsEpsilon(this,e,t)},R.prototype.toString=function(){return R.toIso8601(this)},R.leapSeconds=[new u(new R(2441317,43210,c.TAI),10),new u(new R(2441499,43211,c.TAI),11),new u(new R(2441683,43212,c.TAI),12),new u(new R(2442048,43213,c.TAI),13),new u(new R(2442413,43214,c.TAI),14),new u(new R(2442778,43215,c.TAI),15),new u(new R(2443144,43216,c.TAI),16),new u(new R(2443509,43217,c.TAI),17),new u(new R(2443874,43218,c.TAI),18),new u(new R(2444239,43219,c.TAI),19),new u(new R(2444786,43220,c.TAI),20),new u(new R(2445151,43221,c.TAI),21),new u(new R(2445516,43222,c.TAI),22),new u(new R(2446247,43223,c.TAI),23),new u(new R(2447161,43224,c.TAI),24),new u(new R(2447892,43225,c.TAI),25),new u(new R(2448257,43226,c.TAI),26),new u(new R(2448804,43227,c.TAI),27),new u(new R(2449169,43228,c.TAI),28),new u(new R(2449534,43229,c.TAI),29),new u(new R(2450083,43230,c.TAI),30),new u(new R(2450630,43231,c.TAI),31),new u(new R(2451179,43232,c.TAI),32),new u(new R(2453736,43233,c.TAI),33),new u(new R(2454832,43234,c.TAI),34),new u(new R(2456109,43235,c.TAI),35)],R}),define("Core/clone",["./defaultValue"],function(e){"use strict";var t=function(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";var e=function(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";var n=function(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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,n,r,i,a){"use strict";function o(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function u(e,t){for(var n=o(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 s(e,n){n=t(n,"");var i=e[1],a=!!e[2],s=e[3];switch(n){case"":case"text":return o(a,s);case"arraybuffer":return u(a,s);case"blob":var c=u(a,s);return new Blob([c],{type:i});case"document":var l=new DOMParser;return l.parseFromString(o(a,s),i);case"json":return JSON.parse(o(a,s));default:throw new r("Unhandled responseType: "+n)}}var c=function(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,i=t(n.method,"GET"),a=n.data,o=n.headers,u=n.overrideMimeType,s=n.withCredentials;return e(n.url,function(t){var n=e.defer();return c.load(t,r,i,a,o,n,u,s),n.promise})},l=/^data:(.*?)(;base64)?,(.*)$/;return c.load=function(e,t,r,o,u,c,f,h){var d=l.exec(e);if(null!==d)return c.resolve(s(d,t)),void 0;var m=new XMLHttpRequest;if(n(f)&&n(m.overrideMimeType)&&m.overrideMimeType(f),m.open(r,e,!0),n(u))for(var p in u)u.hasOwnProperty(p)&&m.setRequestHeader(p,u[p]);n(t)&&(m.responseType=t),n(h)&&(m.withCredentials=h),m.onload=function(){200===m.status?n(m.response)?c.resolve(m.response):n(m.responseXML)&&m.responseXML.hasChildNodes()?c.resolve(m.responseXML):n(m.responseText)?c.resolve(m.responseText):c.reject(new a("unknown XMLHttpRequest response type.")):c.reject(new i(m.status,m.response,m.getAllResponseHeaders()))},m.onerror=function(){c.reject(new i)},m.send(o)},c.defaultLoad=c.load,c}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";var n=function(n,r){return e({url:n,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})};return n}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";var i={Accept:"application/json,*/*;q=0.01"},a=function(n,a){return t(a)||(a={}),t(a.headers)?t(a.headers.Accept)||(a.headers=e(a.headers),a.headers.Accept=i.Accept):a.headers=i,r(n,a).then(function(e){return JSON.parse(e)})};return a}),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(e,t){return o.compare(e.julianDate,t)}function d(e,n){if(!r(n.columnNames))return e._dataError="Error in loaded EOP data: The columnNames property is required.",void 0;if(!r(n.samples))return e._dataError="Error in loaded EOP data: The samples property is required.",void 0;var i=n.columnNames.indexOf("modifiedJulianDateUtc"),a=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),d=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),p=n.columnNames.indexOf("taiMinusUtcSeconds");if(0>i||0>a||0>s||0>c||0>d||0>m||0>p)return e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns",void 0;var y=e._samples=n.samples,v=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=a,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=m,e._taiMinusUtcSecondsColumn=p,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var g,w=e._addNewLeapSeconds,E=0,x=y.length;x>E;E+=e._columnCount){var S=y[E+i],M=y[E+p],_=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,O=new o(_,M,f.TAI);if(v.push(O),w){if(M!==g&&r(g)){var T=o.leapSeconds,P=t(T,O,h);if(0>P){var C=new u(O,M);T.splice(~P,0,C)}}g=M}}}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 y(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,y=n[h+e._ut1MinusUtcSecondsColumn],v=n[d+e._ut1MinusUtcSecondsColumn],g=v-y;if(g>.5||-.5>g){var w=n[h+e._taiMinusUtcSecondsColumn],E=n[d+e._taiMinusUtcSecondsColumn];w!==E&&(l.equals(r)?y=v:v-=E-w)}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,y,v),u}var v=function(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:[]})};return v.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}}),v.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},v.prototype.compute=function(e,n){if(!r(this._samples)){if(r(this._dataError))throw new c(this._dataError);return void 0}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),m=!r(h),p=m||o.greaterThanOrEquals(h,e); -if(d&&p)return s=u,!m&&h.equals(e)&&++s,l=s+1,y(this,a,this._samples,e,s,l,n),n}var v=t(a,e,o.compare,this._dateColumn);return v>=0?(v<a.length-1&&a[v+1].equals(e)&&++v,s=v,l=v):(l=~v,s=l-1,0>s&&(s=0)),this._lastIndex=s,y(this,a,this._samples,e,s,l,n),n},v}),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()):(n.path=t.authority&&""==t.path?"/"+this.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];for(r&&t.shift(),""==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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","require"],function(e,t,n,r){"use strict";function i(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),i=f.exec(r);if(null!==i)return i[1]}return void 0}function a(){if(t(s))return s;var r;if(r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:i(),!t(r))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return s=new e(r).resolve(new e(document.location.href))}function o(e){return r.toUrl("../"+e)}function u(t){return new e(t).resolve(a()).toString()}var s,c,l,f=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i,h=function(e){t(c)||(c=t(r.toUrl)?o:u),t(l)||(l=document.createElement("a"));var n=c(e);return l.href=n,l.href=l.href,l.href};return h._cesiumScriptRegex=f,h}),define("Core/Iau2006XysSample",[],function(){"use strict";var e=function(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,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,a.daysDifference(r,e._sampleZeroDateTT)}function c(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=3*i*n._samplesPerXysFile,u=0,s=r.length;s>u;++u)t[o+u]=r[u];a.resolve()}),a.promise}var l=function(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;t>=s;++s){r[s]=o,i[s]=s*this._stepSizeDays;for(var c=0;t>=c;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)},f=new a(0,0,u.TAI);return l.prototype.preload=function(t,n,r,i){var a=s(this,t,n),o=s(this,r,i),u=0|a/this._stepSizeDays-this._interpolationOrder/2;0>u&&(u=0);var l=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var f=0|u/this._samplesPerXysFile,h=0|l/this._samplesPerXysFile,d=[],m=f;h>=m;++m)d.push(c(this,m));return e.all(d)},l.prototype.computeXysRadians=function(e,t,n){var a=s(this,e,t);if(0>a)return void 0;var o=0|a/this._stepSizeDays;if(o>=this._totalSamples)return void 0;var u=this._interpolationOrder,l=o-(0|u/2);0>l&&(l=0);var f=l+u;f>=this._totalSamples&&(f=this._totalSamples-1,l=f-u,0>l&&(l=0));var h=!1,d=this._samples;if(r(d[3*l])||(c(this,0|l/this._samplesPerXysFile),h=!0),r(d[3*f])||(c(this,0|f/this._samplesPerXysFile),h=!0),h)return void 0;r(n)?(n.x=0,n.y=0,n.s=0):n=new i(0,0,0);var m,p,y=a-l*this._stepSizeDays,v=this._work,g=this._denominators,w=this._coef,E=this._xTable;for(m=0;u>=m;++m)v[m]=y-E[m];for(m=0;u>=m;++m){for(w[m]=1,p=0;u>=p;++p)p!==m&&(w[m]*=v[p]);w[m]*=g[m];var x=3*(l+m);n.x+=w[m]*d[x++],n.y+=w[m]*d[x++],n.s+=w[m]*d[x]}return n},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./TimeConstants"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d,m,p,y){"use strict";var v={},g=new n,w=new n,E=new n;v.eastNorthUpToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return a(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=g,s=w,l=E;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),a(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.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,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var x=new n,S=new n,M=new n;v.northEastDownToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return a(r)?(r[0]=-o,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]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=x,s=S,l=M;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),a(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.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(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},v.northUpEastToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return a(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=o,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(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=g,s=w,l=E;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),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 p(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 _=24110.54841,O=8640184.812866,T=.093104,P=-62e-7,C=1.1772758384668e-19,R=72921158553e-15,N=d.TWO_PI/86400,I=new h;v.computeTemeToPseudoFixedMatrix=function(e,t){I=h.addSeconds(e,-h.computeTaiMinusUtc(e),I);var n,r=I.dayNumber,i=I.secondsOfDay,o=r-2451545;n=i>=43200?(o+.5)/y.DAYS_PER_JULIAN_CENTURY:(o-.5)/y.DAYS_PER_JULIAN_CENTURY;var u=_+n*(O+n*(T+n*P)),s=u*N%d.TWO_PI,c=R+C*(r-2451545.5),l=(i+.5*y.SECONDS_PER_DAY)%y.SECONDS_PER_DAY,f=s+c*l,p=Math.cos(f),v=Math.sin(f);return a(t)?(t[0]=p,t[1]=-v,t[2]=0,t[3]=v,t[4]=p,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(p,v,0,-v,p,0,0,0,1)},v.iau2006XysData=new l,v.earthOrientationParameters=u.NONE;var b=32.184,z=2451545;v.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+b,i=t.stop.dayNumber,a=t.stop.secondsOfDay+b,o=v.iau2006XysData.preload(n,r,i,a),u=v.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},v.computeIcrfToFixedMatrix=function(e,t){a(t)||(t=new m);var n=v.computeFixedToIcrfMatrix(e,t);return a(n)?m.transpose(n,t):void 0};var A=new f(0,0,0),D=new s(0,0,0,0,0,0),U=new m,q=new m;v.computeFixedToIcrfMatrix=function(e,t){a(t)||(t=new m);var n=v.earthOrientationParameters.compute(e,D);if(!a(n))return void 0;var r=e.dayNumber,i=e.secondsOfDay+b,o=v.iau2006XysData.computeXysRadians(r,i,A);if(!a(o))return void 0;var u=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=U;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(-o.s,q),p=m.multiply(l,f,U),g=e.dayNumber,w=e.secondsOfDay-h.computeTaiMinusUtc(e)+n.ut1MinusUtc,E=g-2451545,x=w/y.SECONDS_PER_DAY,S=.779057273264+x+.00273781191135448*(E+x);S=S%1*d.TWO_PI;var M=m.fromRotationZ(S,q),_=m.multiply(p,M,U),O=Math.cos(n.xPoleWander),T=Math.cos(n.yPoleWander),P=Math.sin(n.xPoleWander),C=Math.sin(n.yPoleWander),R=r-z+i/y.SECONDS_PER_DAY;R/=36525;var N=-47e-6*R*d.RADIANS_PER_DEGREE/3600,I=Math.cos(N),L=Math.sin(N),W=q;return W[0]=O*I,W[1]=O*L,W[2]=P,W[3]=-T*L+C*P*I,W[4]=T*I+C*P*L,W[5]=-C*O,W[6]=-C*L-T*P*I,W[7]=C*I-T*P*L,W[8]=T*O,m.multiply(_,W,t)};var L=new r;return v.pointToWindowCoordinates=function(e,t,n,r){return r=v.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},v.pointToGLWindowCoordinates=function(e,n,i,o){a(o)||(o=new t);var u=L;return p.multiplyByVector(e,r.fromElements(i.x,i.y,i.z,1,u),u),r.multiplyByScalar(u,1/u.w,u),p.multiplyByVector(n,u,u),t.fromCartesian4(u,o)},v}),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";var m=new r,p=function(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)};o(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}}});var y=new e;p.fromPoints=function(t,n){var r=e.fromPoints(t,y);return new p(r.center,n)};var v=new h,g=new n;p.prototype.projectPointOntoPlane=function(e,r){var i=v;i.origin=e,n.normalize(e,i.direction);var o=c.rayPlane(i,this._plane,g);if(a(o)||(n.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,g)),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)}return void 0},p.prototype.projectPointsOntoPlane=function(e,t){a(t)||(t=[]);for(var n=0,r=e.length,i=0;r>i;i++){var o=this.projectPointOntoPlane(e[i],t[n]);a(o)&&(t[n]=o,n++)}return t.length=n,t};var w=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=w,l=0;r>l;++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/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";var r=new t,i=new t,a=new t,o=function(o,u,s,c,l){n(l)||(l=new t);var f,h,d,m,p,y,v,g;n(u.z)?(f=t.subtract(s,u,r),h=t.subtract(c,u,i),d=t.subtract(o,u,a),m=t.dot(f,f),p=t.dot(f,h),y=t.dot(f,d),v=t.dot(h,h),g=t.dot(h,d)):(f=e.subtract(s,u,r),h=e.subtract(c,u,i),d=e.subtract(o,u,a),m=e.dot(f,f),p=e.dot(f,h),y=e.dot(f,d),v=e.dot(h,h),g=e.dot(h,d));var w=1/(m*v-p*p);return l.y=(v*y-p*g)*w,l.z=(m*g-p*y)*w,l.x=1-l.y-l.z,l};return o}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";var n=new t,r=function(t,r,i,a){return e(t,r,i,a,n),n.x>0&&n.y>0&&n.z>0};return r}),define("Core/Queue",[],function(){"use strict";var e=function(){this._array=[],this._offset=0,this.length=0};return e.prototype.enqueue=function(e){this._array.push(e),this.length++},e.prototype.dequeue=function(){if(0===this.length)return void 0;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},e.prototype.contains=function(e){return-1!==this._array.indexOf(e)},e.prototype.clear=function(){this._array.length=this._offset=this.length=0},e.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},e}),define("Core/WindingOrder",["./freezeObject"],function(e){"use strict";var t={CLOCKWISE:2304,COUNTER_CLOCKWISE:2305,validate:function(e){return e===t.CLOCKWISE||e===t.COUNTER_CLOCKWISE}};return e(t)}),define("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d,m){"use strict";function p(t,n,r){var i=e.subtract(n,t,L),a=e.subtract(r,n,W);return i.x*a.y-i.y*a.x>=0}function y(e){for(var t=e[0].x,n=0,r=0;r<e.length;r++)e[r].x>t&&(t=e[r].x,n=r);return n}function v(e){for(var t=e[0][0].x,n=0,r=0;r<e.length;r++){var i=e[r][y(e[r])].x;i>t&&(t=i,n=r)}return n}function g(e){for(var t=[],n=0;n<e.length;n++){var r=e[(n-1+e.length)%e.length],i=e[n],a=e[(n+1)%e.length];p(r,i,a)||t.push(i)}return t}function w(t,n){for(var r=0;r<t.length;r++)if(e.equals(n,t[r]))return r;return-1}function E(n,i,a){a=r(a,[]);var o=Number.MAX_VALUE,u=y(i),s=new e(i[u].x,n.y);a.push(u),a.push((u+1)%i.length);for(var c=i[0].x,l=c,f=1;f<i.length;++f)i[f].x<c?c=i[f].x:i[f].x>l&&(l=i[f].x);l+=l-c;var h=new t(l,n.y,0);for(f=0;f<i.length;f++){var d=i[f],m=i[(f+1)%i.length];if((d.x>=n.x||m.x>=n.x)&&(d.y>=n.y&&m.y<=n.y||d.y<=n.y&&m.y>=n.y)){var p=(m.y-d.y)*(h.x-n.x)-(m.x-d.x)*(h.y-n.y);if(0!==p){p=1/p;var v=((m.x-d.x)*(n.y-d.y)-(m.y-d.y)*(n.x-d.x))*p,g=((h.x-n.x)*(n.y-d.y)-(h.y-n.y)*(n.x-d.x))*p;if(v>=0&&1>=v&&g>=0&&1>=g){var w=new e(n.x+v*(h.x-n.x),n.y+v*(h.y-n.y)),E=e.subtract(w,n,B);p=e.magnitudeSquared(E),o>p&&(s=w,o=p,a[0]=f,a[1]=(f+1)%i.length)}}}}return s}function x(t,n){var r=v(n),i=n[r],a=y(i),o=i[a],u=[],s=E(o,t,u),c=w(t,s);if(-1!==c)return c;var h=e.magnitudeSquared(e.subtract(t[u[0]],o,F)),d=e.magnitudeSquared(e.subtract(t[u[1]],o,F)),m=d>h?t[u[0]]:t[u[1]],p=g(t),x=p.indexOf(m);-1!==x&&p.splice(x,1);for(var S=[],M=0;M<p.length;M++){var _=p[M];f(_,o,s,m)&&S.push(_)}var O=Number.MAX_VALUE;if(S.length>0){var T=e.fromElements(1,0,F);for(M=0;M<S.length;M++){var P=e.subtract(S[M],o,G),C=e.magnitude(T)*e.magnitudeSquared(P);if(0!==C){var R=Math.abs(l.acosClamped(e.dot(T,P)/C));O>R&&(O=R,m=S[M])}}}return t.indexOf(m)}function S(e,n,r){for(var i=ut.computeWindingOrder2D(e),a=0;a<n.length;a++){var o=n[a];t.equals(o[0],o[o.length-1])||o.push(o[0]);var s=ut.computeWindingOrder2D(o);s===i&&o.reverse()}var c=u.fromPoints(e,r),l=c.projectPointsOntoPlane(e),f=[];for(a=0;a<n.length;a++)f.push(c.projectPointsOntoPlane(n[a]));var h=x(l,f),d=v(f),m=y(f[d]),p=n[d],g=[];for(a=0;a<e.length;a++)g.push(e[a]);var w,E=[];if(0!==m)for(w=0;w<=p.length;w++){var S=(w+m)%p.length;0!==S&&E.push(p[S])}else for(w=0;w<p.length;w++)E.push(p[(w+m)%p.length]);var M=g.lastIndexOf(e[h]);E.push(e[M]);var _=g.slice(0,M+1),O=g.slice(M+1);return g=_.concat(E,O),n.splice(d,1),g}function M(e){var t="0."+Math.sin(Y).toString().substr(5);Y+=.2;var n=Math.floor(t*e);return n===e&&n--,n}function _(t,n,r){return O(t,n,r)&&O(n,t,r)&&!A(r[t].position,r[n].position,r)&&!e.equals(r[t].position,r[n].position)}function O(t,n,r){C(t,r);var i=r[t],a=r[n],o=P(t,r,j),u=P(t,r,H),s=e.subtract(r[o].position,i.position,V),c=e.subtract(r[u].position,i.position,k),l=e.subtract(a.position,i.position,X);return R(s,l)?T(s,l):R(c,l)?T(c,l):N(s,c)?z(s,c,l)?!0:!1:I(s,c)?b(s,c,l)?!1:!0:void 0}function T(t,n){return e.magnitude(n)<e.magnitude(t)}function P(e,t,n){var r=e+n;return 0>r&&(r=t.length-1),r===t.length&&(r=0),C(r,t),r}function C(t,n){var r=t-1,i=t+1;0>r&&(r=n.length-1),i===n.length&&(i=0);var o=e.subtract(n[r].position,n[t].position,Z),u=e.subtract(n[i].position,n[t].position,J);if(R(o,u)){var s=new a("Superfluous vertex found.");throw s.vertexIndex=t,s}}function R(e,n){return 0===t.cross(e,n,K).z}function N(e,n){return t.cross(e,n,$).z<0}function I(e,n){return t.cross(e,n,Q).z>0}function b(e,n,r){return t.cross(e,r,et).z>0&&t.cross(r,n,et).z>0}function z(e,n,r){return t.cross(e,r,tt).z<0&&t.cross(r,n,tt).z<0}function A(t,n,r){for(var i=0;i<r.length;i++){var a,o=r[i].position;if(a=i<r.length-1?r[i+1].position:r[0].position,!(e.equals(t,o)||e.equals(n,a)||e.equals(t,a)||e.equals(n,o))){var u=(n.y-t.y)/(n.x-t.x),s=(a.y-o.y)/(a.x-o.x);if(!(u===s||isNaN(u)&&isNaN(s))){var c;c=isNaN(u)?t.x:isNaN(s)?o.x:(t.y-o.y-u*t.x+s*o.x)/(s-u);var l=u*c+t.y-u*t.x,f=e.fromElements(c,l,nt);if(!(e.equals(f,t)||e.equals(f,n)||e.equals(f,o)||e.equals(f,a))){var h=U(c,t.x,n.x)&&U(l,t.y,n.y)&&U(c,o.x,a.x)&&U(l,o.y,a.y);if(h)return!0}}}}return!1}function D(t){var n=t[0].position,r=t[1].position,i=t[2].position,a=e.subtract(r,n,rt),o=e.subtract(i,n,it);return R(a,o)}function U(e,t,n){return(e>t||e>n)&&(t>e||n>e)||t===n&&t===e}function q(e){var t=e.length;if(3===t)return D(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new a("Invalid polygon: must have at least three vertices.");for(var n=!1,r=0;!n;){var i=10*e.length;if(r>i)return[];r++;for(var o=M(e.length),u=o+1;Math.abs(o-u)<2||Math.abs(o-u)>e.length-2;)u=M(e.length);if(o>u){var s=o;o=u,u=s}try{if(_(o,u,e)){var c=e.splice(o,u-o+1,e[o],e[u]);return q(e).concat(q(c))}}catch(l){if(l.hasOwnProperty("vertexIndex"))return e.splice(l.vertexIndex,1),q(e);throw l}}}var L=new e,W=new e,B=new e,F=new e(1,0),G=new e,Y=0,j=-1,H=1,V=new t,k=new t,X=new t,Z=new t,J=new t,K=new t,$=new t,Q=new t,et=new t,tt=new t,nt=new e,rt=new t,it=new t,at=new t,ot=new t,ut={};return ut.removeDuplicates=function(e){for(var n=e.length,r=[],i=n-1,a=0;n>a;i=a++){var o=e[i],u=e[a];t.equals(o,u)||r.push(u)}return r},ut.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,i=0;t>i;r=i++){var a=e[r],o=e[i];n+=a.x*o.y-o.x*a.y}return.5*n},ut.computeWindingOrder2D=function(e){var t=ut.computeArea2D(e);return t>0?m.COUNTER_CLOCKWISE:m.CLOCKWISE},ut.triangulate=function(e){for(var t=e.length,n=[],r=0;t>r;++r)n[r]={position:e[r],index:r};return q(n)},ut.resetSeed=function(e){Y=r(e,0)},ut.computeSubdivision=function(e,i,a){a=r(a,l.RADIANS_PER_DEGREE);for(var o=new d,u=i.length,f=0;u>f;f+=3)o.enqueue({i0:i[f],i1:i[f+1],i2:i[f+2]});for(var m,p=e.slice(0),y=[],v={};o.length>0;){var g,w,E=o.dequeue(),x=p[E.i0],S=p[E.i1],M=p[E.i2],_=t.angleBetween(x,S),O=t.angleBetween(S,M),T=t.angleBetween(M,x),P=Math.max(_,Math.max(O,T));P>a?_===P?(g=Math.min(E.i0,E.i1).toString()+" "+Math.max(E.i0,E.i1).toString(),m=v[g],m||(w=t.add(x,S,new t),t.multiplyByScalar(w,.5,w),p.push(w),m=p.length-1,v[g]=m),o.enqueue({i0:E.i0,i1:m,i2:E.i2}),o.enqueue({i0:m,i1:E.i1,i2:E.i2})):O===P?(g=Math.min(E.i1,E.i2).toString()+" "+Math.max(E.i1,E.i2).toString(),m=v[g],m||(w=t.add(S,M,new t),t.multiplyByScalar(w,.5,w),p.push(w),m=p.length-1,v[g]=m),o.enqueue({i0:E.i1,i1:m,i2:E.i0}),o.enqueue({i0:m,i1:E.i2,i2:E.i0})):T===P&&(g=Math.min(E.i2,E.i0).toString()+" "+Math.max(E.i2,E.i0).toString(),m=v[g],m||(w=t.add(M,x,new t),t.multiplyByScalar(w,.5,w),p.push(w),m=p.length-1,v[g]=m),o.enqueue({i0:E.i2,i1:m,i2:E.i1}),o.enqueue({i0:m,i1:E.i0,i2:E.i1})):(y.push(E.i0),y.push(E.i1),y.push(E.i2))}var C=p.length,R=new Array(3*C),N=0;for(m=0;C>m;m++){var I=p[m];R[N++]=I.x,R[N++]=I.y,R[N++]=I.z}return new s({attributes:{position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:R})},indices:y,primitiveType:h.TRIANGLES})},ut.scaleToGeodeticHeight=function(e,n,a,u){a=r(a,o.WGS84);var s=at,c=ot;if(n=r(n,0),u=r(u,!0),i(e)&&i(e.attributes)&&i(e.attributes.position))for(var l=e.attributes.position.values,f=l.length,h=0;f>h;h+=3)t.fromArray(l,h,c),u&&(c=a.scaleToGeodeticSurface(c,c)),s=a.geodeticSurfaceNormal(c,s),t.multiplyByScalar(s,n,s),t.add(c,s,c),l[h]=c.x,l[h+1]=c.y,l[h+2]=c.z;return e},ut.eliminateHoles=function(e,n,i){i=r(i,o.WGS84);for(var a=[],u=0;u<n.length;u++){for(var s=[],c=0;c<n[u].length;c++)s.push(t.clone(n[u][c]));a.push(s)}for(var l=e;a.length>0;)l=S(l,a,i);return l},ut}),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,d=1-h,m=Math.sqrt(d),p=t/4,y=p*p,v=y*p,g=y*y,w=1+p-3*y/4+5*v/4-175*g/64,E=1-p+15*y/8-35*v/8,x=1-3*p+35*y/4,S=1-5*p,M=w*l-E*Math.sin(2*l)*p/2-x*Math.sin(4*l)*y/16-S*Math.sin(6*l)*v/48-5*Math.sin(8*l)*g/512,_=e._constants;_.a=n,_.b=r,_.f=i,_.cosineHeading=a,_.sineHeading=o,_.tanU=u,_.cosineU=s,_.sineU=c,_.sigma=l,_.sineAlpha=f,_.sineSquaredAlpha=h,_.cosineSquaredAlpha=d,_.cosineAlpha=m,_.u2Over4=p,_.u4Over16=y,_.u6Over64=v,_.u8Over256=g,_.a0=w,_.a1=E,_.a2=x,_.a3=S,_.distanceRatio=M}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,d,m=(t-n)/t,p=a-r,y=Math.atan((1-m)*Math.tan(i)),v=Math.atan((1-m)*Math.tan(o)),g=Math.cos(y),w=Math.sin(y),E=Math.cos(v),x=Math.sin(v),S=g*E,M=g*x,_=w*x,O=w*E,T=p,P=u.TWO_PI,C=Math.cos(T),R=Math.sin(T);do{C=Math.cos(T),R=Math.sin(T);var N=M-O*C;f=Math.sqrt(E*E*R*R+N*N),c=_+S*C,s=Math.atan2(f,c);var I;0===f?(I=0,h=1):(I=S*R/f,h=1-I*I),P=T,d=c-2*_/h,isNaN(d)&&(d=0),T=p+l(m,I,h,s,f,c,d)}while(Math.abs(T-P)>u.EPSILON12);var b=h*(t*t-n*n)/(n*n),z=1+b*(4096+b*(b*(320-175*b)-768))/16384,A=b*(256+b*(b*(74-47*b)-128))/1024,D=d*d,U=A*f*(d+A*(c*(2*D-1)-A*d*(4*f*f-3)*(4*D-3)/6)/4),q=n*z*(s-U),L=Math.atan2(E*R,M-O*C),W=Math.atan2(g*R,M*C-O);e._distance=q,e._startHeading=L,e._endHeading=W,e._uSquared=b}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),r.height=0,i.height=0,n._start=t.clone(r,n._start),n._end=t.clone(i,n._end),s(n)}var d=new e,m=new e,p=function(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)};return i(p.prototype,{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){h(this,e,t,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.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),d=Math.sin(8*a),m=a*a,p=a*m,y=i.u8Over256,v=i.u2Over4,g=i.u6Over64,w=i.u4Over16,E=2*p*y*o/3+a*(1-v+7*w/4-15*g/4+579*y/64-(w-15*g/4+187*y/16)*o-(5*g/4-115*y/16)*u-29*y*s/16)+(v/2-w+71*g/32-85*y/16)*c+(5*w/16-5*g/4+383*y/96)*f-m*((g-11*y/2)*c+5*y*f/2)+(29*g/96-29*y/16)*h+539*y*d/1536,x=Math.asin(Math.sin(E)*i.cosineAlpha),S=Math.atan(i.a/i.b*Math.tan(x));E-=i.sigma;var M=Math.cos(2*i.sigma+E),_=Math.sin(E),O=Math.cos(E),T=i.cosineU*O,P=i.sineU*_,C=Math.atan2(_*i.sineHeading,T-P*i.cosineHeading),R=C-l(i.f,i.sineAlpha,i.cosineSquaredAlpha,E,_,O,M);return r(n)?(n.longitude=this._start.longitude+R,n.latitude=S,n.height=0,n):new t(this._start.longitude+R,S,0)},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/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,i=new Array(e);if(t===n){for(r=0;e>r;r++)i[r]=t;return i}var a=n-t,o=a/e;for(r=1;e>r;r++){var u=t+r*o;i[r]=u}return i[0]=t,i}function d(t,n,r,i,a,o,u,s){var c=i.scaleToGeodeticSurface(t,P),l=i.scaleToGeodeticSurface(n,C),f=m.numberOfPoints(t,n,r),d=i.cartesianToCartographic(c,_),p=i.cartesianToCartographic(l,O),y=h(f,a,o);R.setEndPoints(d,p);var v=R.surfaceDistance/f,g=s;d.height=a;var w=i.cartographicToCartesian(d,T);e.pack(w,u,g),g+=3;for(var E=1;f>E;E++){var x=R.interpolateUsingSurfaceDistance(E*v,O);x.height=y[E],w=i.cartographicToCartesian(x,T),e.pack(w,u,g),g+=3}return g}var m={};m.numberOfPoints=function(t,n,r){var i=e.angleBetween(t,n);return Math.ceil(i/r)};var p=new t;m.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),i=0;n>i;i++){var a=e[i];r[i]=t.cartesianToCartographic(a,p).height}return r};var y=new l,v=new e,g=new e,w=new f(e.ZERO,0),E=new e,x=new f(e.ZERO,0),S=new e,M=new e,_=new t,O=new t,T=new e,P=new e,C=new e,R=new o;return m.wrapLongitude=function(t,i){var a=[],o=[];if(r(t)&&t.length>0){i=n(i,l.IDENTITY);var s=l.inverseTransformation(i,y),c=l.multiplyByPoint(s,e.ZERO,v),h=l.multiplyByPointAsVector(s,e.UNIT_Y,g),d=f.fromPointNormal(c,h,w),m=l.multiplyByPointAsVector(s,e.UNIT_X,E),p=f.fromPointNormal(c,m,x),_=1;a.push(e.clone(t[0]));for(var O=a[0],T=t.length,P=1;T>P;++P){var C=t[P];if(f.getPointDistance(p,O)<0||f.getPointDistance(p,C)<0){var R=u.lineSegmentPlane(O,C,d,S);if(r(R)){var N=e.multiplyByScalar(h,5e-9,M);f.getPointDistance(d,O)<0&&e.negate(N,N),a.push(e.add(R,N,new e)),o.push(_+1),e.negate(N,N),a.push(e.add(R,N,new e)),_=1}}a.push(e.clone(t[P])),_++,O=C}o.push(_)}return{positions:a,lengths:o}},m.removeDuplicates=function(t){var n=t.length;if(2>n)return void 0;var r,i,a;for(r=1;n>r&&(i=t[r-1],a=t[r],!e.equals(i,a));++r);if(r===n)return void 0;var o=[];for(o.push(t[0]);n>r;++r)i=t[r-1],a=t[r],e.equals(i,a)||o.push(e.clone(a));return o},m.generateArc=function(t){r(t)||(t={});var i,o,u,l=t.positions,f=n(t.ellipsoid,a.WGS84),h=n(t.height,0),p=n(t.granularity,c.RADIANS_PER_DEGREE),y=l.length,v=0;for(i=0;y-1>i;i++)o=l[i],u=l[i+1],v+=m.numberOfPoints(o,u,p);v++;var g=3*v,w=new Array(g),E=0;for(i=0;y-1>i;i++){o=l[i],u=l[i+1];var x,S;s(h)?(x=h[i],S=h[i+1]):(x=h,S=h),E=d(o,u,p,f,x,S,w,E)}var M=l[y-1],O=f.cartesianToCartographic(M,_);O.height=s(h)?h[y-1]:h;var P=f.cartographicToCartesian(O,T);return e.pack(P,w,g-3),w},m.generateCartesianArc=function(t){for(var n=m.generateArc(t),r=n.length/3,i=new Array(r),a=0;r>a;a++)i[a]=e.unpack(n,3*a);return i},m}),define("Core/WallGeometryLibrary",["./Cartographic","./defined","./DeveloperError","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t){return i.equalsEpsilon(e.latitude,t.latitude,i.EPSILON14)&&i.equalsEpsilon(e.longitude,t.longitude,i.EPSILON14)}function c(n,r,i,a){var o=t(a),u=t(i),c=[],l=[],d=[],m=r.length;if(2>m)return{positions:r};var p=r[0];c.push(p);var y=n.cartesianToCartographic(p,f);u&&(y.height=i[0]),l.push(y.height),o?d.push(a[0]):d.push(0);for(var v=1;m>v;++v){var g=r[v],w=n.cartesianToCartographic(g,h);u&&(w.height=i[v]),s(y,w)?y.height<w.height&&(l[l.length-1]=w.height):(c.push(g),l.push(w.height),o?d.push(a[v]):d.push(0)),e.clone(w,y)}return{positions:c,topHeights:l,bottomHeights:d}}var l={},f=new e,h=new e;return l.computePositions=function(e,t,n,i,s,l){var f=c(e,t,n,i);if(t=f.positions,n=f.topHeights,i=f.bottomHeights,t.length>=3){var h=r.fromPoints(t,e),d=h.projectPointsOntoPlane(t);a.computeWindingOrder2D(d)===u.CLOCKWISE&&(t.reverse(),n.reverse(),i.reverse())}var m,p,y,v,g,w=t.length;if(l){var E=0;for(m=0;w-1>m;m++)v=t[m],g=t[m+1],E+=o.numberOfPoints(v,g,s),E++;p=new Float64Array(3*E),y=new Float64Array(3*E);var x=0;for(m=0;w-1>m;m++){v=t[m],g=t[m+1];var S=n[m],M=n[m+1],_=o.generateArc({positions:[v,g],height:[S,M],granularity:s,ellipsoid:e});p.set(_,x),S=i[m],M=i[m+1],y.set(o.generateArc({positions:[v,g],height:[S,M],granularity:s,ellipsoid:e}),x),x+=_.length}}else p=new Float64Array(o.generateArc({positions:t,height:n,granularity:s,ellipsoid:e})),y=new Float64Array(o.generateArc({positions:t,height:i,granularity:s,ellipsoid:e}));return{bottomPositions:y,topPositions:p}},l}),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,d){"use strict";var m=new t,p=new t,y=function(e){e=r(e,r.EMPTY_OBJECT);var t=e.positions,n=e.maximumHeights,i=e.minimumHeights,a=r(e.granularity,f.RADIANS_PER_DEGREE),u=r(e.ellipsoid,o.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=a,this._ellipsoid=u,this._workerName="createWallOutlineGeometry"};return y.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;l>f;++f)s&&(t[f]=o),c&&(n[f]=u)}var h={positions:a,maximumHeights:n,minimumHeights:t,ellipsoid:e.ellipsoid};return new y(h)},y.createGeometry=function(r){var i=r._positions,a=r._minimumHeights,o=r._maximumHeights,y=r._granularity,v=r._ellipsoid,g=d.computePositions(v,i,o,a,y,!1),w=g.bottomPositions,E=g.topPositions,x=E.length,S=2*x,M=new Float64Array(S),_=0; -x/=3;var O;for(O=0;x>O;++O){var T=3*O,P=t.fromArray(E,T,m),C=t.fromArray(w,T,p);M[_++]=C.x,M[_++]=C.y,M[_++]=C.z,M[_++]=P.x,M[_++]=P.y,M[_++]=P.z}var R=new c({position:new s({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:M})}),N=S/3;S=2*N-4+N;var I=l.createTypedArray(N,S),b=0;for(O=0;N-2>O;O+=2){var z=O,A=O+2,D=t.fromArray(M,3*z,m),U=t.fromArray(M,3*A,p);if(!t.equalsEpsilon(D,U,f.EPSILON6)){var q=O+1,L=O+3;I[b++]=q,I[b++]=z,I[b++]=q,I[b++]=L,I[b++]=z,I[b++]=A}}return I[b++]=N-2,I[b++]=N-1,new u({attributes:R,indices:I,primitiveType:h.LINES,boundingSphere:new e.fromVertices(M)})},y}),define("Workers/createWallOutlineGeometry",["../Core/Ellipsoid","../Core/WallOutlineGeometry"],function(e,t){"use strict";function n(n){return n._ellipsoid=e.clone(n._ellipsoid),t.createGeometry(n)}return n})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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:0>e?-1:0},a.signNotZero=function(e){return 0>e?-1:1},a.toSNorm=function(e){return Math.round(255*(.5*a.clamp(e,-1,1)+.5))},a.fromSNorm=function(e){return a.clamp(e,0,255)/255*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.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 a>=i||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;e>=r;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 t>e?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",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}i.fromSpherical=function(n,r){t(r)||(r=new i);var a=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(o),r},i.fromElements=function(e,n,r,a){return t(a)?(a.x=e,a.y=n,a.z=r,a):new i(e,n,r)},i.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 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},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},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 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){i.normalize(e,s),i.normalize(t,c);var n=i.dot(s,c),r=i.magnitude(i.cross(s,c,s));return Math.atan2(r,n)};var l=new i;i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):n.y<=n.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,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},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},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)},i.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},i.fromDegrees=function(e,t,n,r,o){var u=a.toRadians(e),s=a.toRadians(t);return i.fromRadians(u,s,n,r,o)};var f=new i,h=new i,d=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(n,r,a,o,u){a=e(a,0);var s=t(o)?o.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(n),f.y=c*Math.sin(n),f.z=Math.sin(r),f=i.normalize(f,f),i.multiplyComponents(s,f,h);var l=Math.sqrt(i.dot(f,h));return h=i.divideByScalar(h,l,h),f=i.multiplyByScalar(f,a,f),t(u)||(u=new i),i.add(h,f,u)},i.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=a.toRadians(e[o]);return i.fromRadiansArray(r,t,n)},i.fromRadiansArray=function(e,n,r){var a=e.length;t(r)?r.length=a/2:r=new Array(a/2);for(var o=0;a>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=i.fromRadians(u,s,0,n,r[o/2])}return r},i.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=a.toRadians(e[o]),r[o+1]=a.toRadians(e[o+1]),r[o+2]=e[o+2];return i.fromRadiansArrayHeights(r,t,n)},i.fromRadiansArrayHeights=function(e,n,r){var a=e.length;t(r)?r.length=a/3:r=new Array(a/3);for(var o=0;a>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=i.fromRadians(u,s,c,n,r[o/3])}return r},i.ZERO=r(new i(0,0,0)),i.UNIT_X=r(new i(1,0,0)),i.UNIT_Y=r(new i(0,1,0)),i.UNIT_Z=r(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,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},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,_=a.z,m=l*l*d*d,p=f*f*E*E,y=h*h*_*_,R=m+p+y,T=Math.sqrt(1/R),A=e.multiplyByScalar(n,T,i);if(s>R)return isFinite(T)?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 M,I,g,w,C,x,P,U,D,L,F,B=(1-T)*e.magnitude(n)/(.5*e.magnitude(O)),z=0;do{B-=z,g=1/(1+B*S),w=1/(1+B*v),C=1/(1+B*N),x=g*g,P=w*w,U=C*C,D=x*g,L=P*w,F=U*C,M=m*x+p*P+y*U-1,I=m*D*S+p*L*v+y*F*N;var b=-2*I;z=M/b}while(Math.abs(M)>r.EPSILON12);return t(c)?(c.x=l*g,c.y=f*w,c.z=h*C,c):new e(l*g,f*w,h*C)}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,m=n(r)?r._centerToleranceSquared:d,p=o(t,E,_,m,c);if(n(p)){var y=e.multiplyComponents(t,_,s);y=e.normalize(y,y);var R=e.subtract(t,p,l),T=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=i.sign(e.dot(R,t))*e.magnitude(R);return n(a)?(a.longitude=T,a.latitude=A,a.height=S,a):new u(T,A,S)}},u.clone=function(e,t){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){a=n(a,0),e.pack(t._radii,r,a)},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;n>a;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;n>a;++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}),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","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(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 u(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;3>n;++n){var r=e[o.getElementIndex(d[n],h[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=i.EPSILON15,r=0,a=1,u=0;3>u;++u){var s=Math.abs(e[o.getElementIndex(d[u],h[u])]);s>r&&(a=u,r=s)}var c=1,l=0,f=h[a],E=d[a];if(Math.abs(e[o.getElementIndex(E,f)])>n){var _,m=e[o.getElementIndex(E,E)],p=e[o.getElementIndex(f,f)],y=e[o.getElementIndex(E,f)],R=(m-p)/2/y;_=0>R?-1/(-R+Math.sqrt(1+R*R)):1/(R+Math.sqrt(1+R*R)),c=1/Math.sqrt(1+_*_),l=_*c}return t=o.clone(o.IDENTITY,t),t[o.getElementIndex(f,f)]=t[o.getElementIndex(E,E)]=c,t[o.getElementIndex(E,f)]=l,t[o.getElementIndex(f,E)]=-l,t}o.packedLength=9,o.pack=function(e,n,r){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]},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},o.clone=function(e,t){return n(e)?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 o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},o.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new o),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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,u=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,_=2*(a-h),m=2*(i+l),p=2*(a+h),y=-r+s-f+d,R=2*(c-u),T=2*(i-l),A=2*(c+u),S=-r-s+f+d;return n(t)?(t[0]=E,t[1]=p,t[2]=T,t[3]=_,t[4]=y,t[5]=A,t[6]=m,t[7]=R,t[8]=S,t):new o(E,_,m,p,y,R,T,A,S)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,r,-a,0,a,r)},o.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 o(r,0,a,0,1,0,-a,0,r)},o.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 o(r,-a,0,a,r,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},o.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},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;o.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 f=new e;o.getMaximumScale=function(t){return o.getScale(t,f),e.maximumComponent(f)},o.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},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[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},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[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},o.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},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[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},o.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},o.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},o.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],d=[2,2,1],E=new o,_=new o;return o.computeEigenDecomposition=function(e,t){var r=i.EPSILON20,a=10,l=0,f=0;n(t)||(t={});for(var h=t.unitary=o.clone(o.IDENTITY,t.unitary),d=t.diagonal=o.clone(e,t.diagonal),m=r*u(d);a>f&&s(d)>m;)c(d,E),o.transpose(E,_),o.multiply(d,E,d),o.multiply(_,d,d),o.multiply(h,E,h),++l>2&&(++f,l=0);return 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[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},o.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)},o.inverse=function(e,t){var n=e[0],a=e[1],u=e[2],s=e[3],c=e[4],l=e[5],f=e[6],h=e[7],d=e[8],E=o.determinant(e);if(Math.abs(E)<=i.EPSILON15)throw new r("matrix is not invertible");t[0]=c*d-h*l,t[1]=h*u-a*d,t[2]=a*l-c*u,t[3]=f*l-s*d,t[4]=n*d-f*u,t[5]=s*u-n*l,t[6]=s*h-f*c,t[7]=f*a-n*h,t[8]=n*c-s*a;var _=1/E;return o.multiplyByScalar(t,_,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=a(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=a(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},i.packedLength=4,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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.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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a,i,o,u,s,c,l,f,h,d,E,_,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(_,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(m,0)}c.packedLength=16,c.pack=function(e,t,r){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]},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),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},c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[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]):void 0},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,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 c(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)},c.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new c);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,l=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,_=t.y*t.w,m=t.z*t.z,p=t.z*t.w,y=t.w*t.w,R=s-d-m+y,T=2*(l-p),A=2*(f+_),S=2*(l+p),v=-s+d-m+y,N=2*(E-h),O=2*(f-_),M=2*(E+h),I=-s-d+m+y;return a[0]=R*i,a[1]=S*i,a[2]=O*i,a[3]=0,a[4]=T*o,a[5]=v*o,a[6]=M*o,a[7]=0,a[8]=A*u,a[9]=N*u,a[10]=I*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(u.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 l=new e,f=new e,h=new e;c.fromCamera=function(t,n){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,f),f),e.normalize(e.cross(f,l,h),h);var u=f.x,s=f.y,d=f.z,E=l.x,_=l.y,m=l.z,p=h.x,y=h.y,R=h.z,T=a.x,A=a.y,S=a.z,v=u*-T+s*-A+d*-S,N=p*-T+y*-A+R*-S,O=E*T+_*A+m*S; +return r(n)?(n[0]=u,n[1]=p,n[2]=-E,n[3]=0,n[4]=s,n[5]=y,n[6]=-_,n[7]=0,n[8]=d,n[9]=R,n[10]=-m,n[11]=0,n[12]=v,n[13]=N,n[14]=O,n[15]=1,n):new c(u,s,d,v,p,y,R,N,-E,-_,-m,O,0,0,0,1)},c.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},c.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},c.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},c.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},c.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,_=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]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=_,a[13]=m,a[14]=p,a[15]=y,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,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},c.setColumn=function(e,t,n,r){r=c.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},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],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},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 d=new e;c.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 E=new e;c.getMaximumScale=function(t){return c.getScale(t,E),e.maximumComponent(E)},c.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],m=e[13],p=e[14],y=e[15],R=t[0],T=t[1],A=t[2],S=t[3],v=t[4],N=t[5],O=t[6],M=t[7],I=t[8],g=t[9],w=t[10],C=t[11],x=t[12],P=t[13],U=t[14],D=t[15],L=r*R+u*T+f*A+_*S,F=a*R+s*T+h*A+m*S,B=i*R+c*T+d*A+p*S,z=o*R+l*T+E*A+y*S,b=r*v+u*N+f*O+_*M,G=a*v+s*N+h*O+m*M,q=i*v+c*N+d*O+p*M,W=o*v+l*N+E*O+y*M,H=r*I+u*g+f*w+_*C,X=a*I+s*g+h*w+m*C,V=i*I+c*g+d*w+p*C,Y=o*I+l*g+E*w+y*C,k=r*x+u*P+f*U+_*D,j=a*x+s*P+h*U+m*D,Z=i*x+c*P+d*U+p*D,K=o*x+l*P+E*U+y*D;return n[0]=L,n[1]=F,n[2]=B,n[3]=z,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]=k,n[13]=j,n[14]=Z,n[15]=K,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],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],m=t[1],p=t[2],y=t[4],R=t[5],T=t[6],A=t[8],S=t[9],v=t[10],N=t[12],O=t[13],M=t[14],I=r*_+o*m+c*p,g=a*_+u*m+l*p,w=i*_+s*m+f*p,C=r*y+o*R+c*T,x=a*y+u*R+l*T,P=i*y+s*R+f*T,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*M+h,B=a*N+u*O+l*M+d,z=i*N+s*O+f*M+E;return n[0]=I,n[1]=g,n[2]=w,n[3]=0,n[4]=C,n[5]=x,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=B,n[14]=z,n[15]=1,n},c.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],m=t[4],p=t[5],y=t[6],R=t[7],T=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*m+c*p,O=a*_+u*m+l*p,M=i*_+s*m+f*p,I=r*y+o*R+c*T,g=a*y+u*R+l*T,w=i*y+s*R+f*T;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=O,n[6]=M,n[7]=0,n[8]=I,n[9]=g,n[10]=w,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,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;c.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,c.multiplyByScale(e,_,n)},c.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?c.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)},c.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},c.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},c.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},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],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},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 m=new u,p=new u,y=new t,R=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,m),p,o.EPSILON7)&&t.equals(c.getRow(e,3,y),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],l=e[12],f=e[1],h=e[5],d=e[9],E=e[13],_=e[2],T=e[6],A=e[10],S=e[14],v=e[3],N=e[7],O=e[11],M=e[15],I=A*M,g=S*O,w=T*M,C=S*N,x=T*O,P=A*N,U=_*M,D=S*v,L=_*O,F=A*v,B=_*N,z=T*v,b=I*h+C*d+x*E-(g*h+w*d+P*E),G=g*f+U*d+F*E-(I*f+D*d+L*E),q=w*f+D*h+B*E-(C*f+U*h+z*E),W=P*f+L*h+z*d-(x*f+F*h+B*d),H=g*a+w*i+P*l-(I*a+C*i+x*l),X=I*r+D*i+L*l-(g*r+U*i+F*l),V=C*r+U*a+z*l-(w*r+D*a+B*l),Y=x*r+F*a+B*i-(P*r+L*a+z*i);I=i*E,g=l*d,w=a*E,C=l*h,x=a*d,P=i*h,U=r*E,D=l*f,L=r*d,F=i*f,B=r*h,z=a*f;var k=I*N+C*O+x*M-(g*N+w*O+P*M),j=g*v+U*O+F*M-(I*v+D*O+L*M),Z=w*v+D*N+B*M-(C*v+U*N+z*M),K=P*v+L*N+z*O-(x*v+F*N+B*O),J=w*A+P*S+g*T-(x*S+I*T+C*A),Q=L*S+I*_+D*A-(U*A+F*S+g*_),$=U*T+z*S+C*_-(B*S+w*_+D*T),ee=B*A+x*_+F*T-(L*T+z*A+P*_),te=r*b+a*G+i*q+l*W;if(Math.abs(te)<o.EPSILON20)throw new s("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]=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},c.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,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]=_,t[14]=m,t[15]=1,t},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,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/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/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){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},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 n>t&&(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;h>f;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.clone=function(e,t){return n(e)?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):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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;i>a&&(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;i>a&&o>0?a+=u.TWO_PI:c>o&&a>0&&(o+=u.TWO_PI),i>a&&0>c?c+=u.TWO_PI:c>o&&0>i&&(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)&&l>=f)){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.union=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.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,a=e.west,i=e.east;return a>i&&(i+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(i>n||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,_=c;_.height=a,_.longitude=E,_.latitude=f,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.latitude=h,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.longitude=E,o[l]=r.cartographicToCartesian(_,o[l]),l++,0>f?_.latitude=f:h>0?_.latitude=h:_.latitude=0;for(var m=1;8>m;++m)_.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,_)&&(o[l]=r.cartographicToCartesian(_,o[l]),l++);return 0===_.latitude&&(_.longitude=E,o[l]=r.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=r.cartographicToCartesian(_,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","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";function d(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var E=new e,_=new e,m=new e,p=new e,y=new e,R=new e,T=new e,A=new e,S=new e,v=new e,N=new e,O=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,E),o=e.clone(a,_),u=e.clone(a,m),s=e.clone(a,p),c=e.clone(a,y),l=e.clone(a,R),f=t.length,h=1;f>h;h++){e.clone(t[h],a);var M=a.x,I=a.y,g=a.z;M<i.x&&e.clone(a,i),M>s.x&&e.clone(a,s),I<o.y&&e.clone(a,o),I>c.y&&e.clone(a,c),g<u.z&&e.clone(a,u),g>l.z&&e.clone(a,l)}var w=e.magnitudeSquared(e.subtract(s,i,A)),C=e.magnitudeSquared(e.subtract(c,o,A)),x=e.magnitudeSquared(e.subtract(l,u,A)),P=i,U=s,D=w;C>D&&(D=C,P=o,U=c),x>D&&(D=x,P=u,U=l);var L=S;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,A)),B=Math.sqrt(F),z=v;z.x=i.x,z.y=o.y,z.z=u.z;var b=N;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(z,b,A),.5,O),q=0;for(h=0;f>h;h++){e.clone(t[h],a);var W=e.magnitude(e.subtract(a,G,A));W>q&&(q=W);var H=e.magnitudeSquared(e.subtract(a,L,A));if(H>F){var X=Math.sqrt(H);B=.5*(B+X),F=B*B;var V=X-B;L.x=(B*L.x+V*a.x)/X,L.y=(B*L.y+V*a.y)/X,L.z=(B*L.z+V*a.z)/X}}return q>B?(e.clone(L,n.center),n.radius=B):(e.clone(G,n.center),n.radius=q),n};var M=new o,I=new e,g=new e,w=new t,C=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),h.southwest(t,w),w.height=i,h.northeast(t,C),C.height=o;var s=a.project(w,I),c=a.project(C,g),l=c.x-s.x,f=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+f*f+E*E);var _=u.center;return _.x=s.x+.5*l,_.y=s.y+.5*f,_.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0);var u;return r(e)&&(u=h.subsample(e,t,a,x)),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,E),c=e.clone(u,_),l=e.clone(u,m),f=e.clone(u,p),h=e.clone(u,y),M=e.clone(u,R),I=t.length,g=0;I>g;g+=i){var w=t[g]+a.x,C=t[g+1]+a.y,x=t[g+2]+a.z;u.x=w,u.y=C,u.z=x,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),C<c.y&&e.clone(u,c),C>h.y&&e.clone(u,h),x<l.z&&e.clone(u,l),x>M.z&&e.clone(u,M)}var P=e.magnitudeSquared(e.subtract(f,s,A)),U=e.magnitudeSquared(e.subtract(h,c,A)),D=e.magnitudeSquared(e.subtract(M,l,A)),L=s,F=f,B=P;U>B&&(B=U,L=c,F=h),D>B&&(B=D,L=l,F=M);var z=S;z.x=.5*(L.x+F.x),z.y=.5*(L.y+F.y),z.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,z,A)),G=Math.sqrt(b),q=v;q.x=s.x,q.y=c.y,q.z=l.z;var W=N;W.x=f.x,W.y=h.y,W.z=M.z;var H=e.multiplyByScalar(e.add(q,W,A),.5,O),X=0;for(g=0;I>g;g+=i){u.x=t[g]+a.x,u.y=t[g+1]+a.y,u.z=t[g+2]+a.z;var V=e.magnitude(e.subtract(u,H,A));V>X&&(X=V);var Y=e.magnitudeSquared(e.subtract(u,z,A));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 X>G?(e.clone(z,o.center),o.radius=G):(e.clone(H,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,E),u=e.clone(i,_),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,y),f=e.clone(i,R),h=t.length,M=0;h>M;M+=3){var I=t[M]+n[M],g=t[M+1]+n[M+1],w=t[M+2]+n[M+2];i.x=I,i.y=g,i.z=w,I<o.x&&e.clone(i,o),I>c.x&&e.clone(i,c),g<u.y&&e.clone(i,u),g>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var C=e.magnitudeSquared(e.subtract(c,o,A)),x=e.magnitudeSquared(e.subtract(l,u,A)),P=e.magnitudeSquared(e.subtract(f,s,A)),U=o,D=c,L=C;x>L&&(L=x,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=S;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,F,A)),z=Math.sqrt(B),b=v;b.x=o.x,b.y=u.y,b.z=s.z;var G=N;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,A),.5,O),W=0;for(M=0;h>M;M+=3){i.x=t[M]+n[M],i.y=t[M+1]+n[M+1],i.z=t[M+2]+n[M+2];var H=e.magnitude(e.subtract(i,q,A));H>W&&(W=H);var X=e.magnitudeSquared(e.subtract(i,F,A));if(X>B){var V=Math.sqrt(X);z=.5*(z+V),B=z*z;var Y=V-z;F.x=(z*F.x+Y*i.x)/V,F.y=(z*F.y+Y*i.y)/V,F.z=(z*F.z+Y*i.z)/V}}return W>z?(e.clone(F,a.center),a.radius=z):(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 P=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;a>o;o++)i.push(t[o].center);n=d.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;a>o;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return n.radius=s,n};var U=new e,D=new e,L=new e;d.fromOrientedBoundingBox=function(t,n){r(n)||(n=new d);var a=t.halfAxes,i=c.getColumn(a,0,U),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 n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},d.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new d(t.center,t.radius):void 0},d.packedLength=4,d.pack=function(e,t,r){r=n(r,0);var a=e.center;t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius},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 F=new e,B=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,F),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,B);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-a>o?u.OUTSIDE:a>o?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 G=new e;d.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,G),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,W=new e,H=new e,X=new e,V=new e,Y=new t,k=new Array(8),j=0;8>j;++j)k[j]=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,q),c=e.cross(e.UNIT_Z,s,W);e.normalize(c,c);var l=e.cross(s,c,H);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=k,_=E[0];e.add(s,l,_),e.add(_,c,_),_=E[1],e.add(s,l,_),e.add(_,h,_),_=E[2],e.add(s,f,_),e.add(_,h,_),_=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(_,h,_),_=E[6],e.add(s,f,_),e.add(_,h,_),_=E[7],e.add(s,f,_),e.add(_,c,_);for(var m=E.length,p=0;m>p;++p){var y=E[p];e.add(o,y,y);var R=i.cartesianToCartographic(y,Y);r.project(R,y)}a=d.fromPoints(E,a),o=a.center;var T=o.x,A=o.y,S=o.z;return o.x=S,o.y=T,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("Renderer/WebGLConstants",["../Core/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/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(){return a.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),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;u>o;++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",e(document[a])?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",e(document[a])&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",e(document[a])?r.fullscreenElement=a:(a=s+"FullScreenElement",e(document[a])&&(r.fullscreenElement=a)),a=s+"fullscreenchange",e(document["on"+a])&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",e(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;r>n;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(R)){R=!1;var e=/ Chrome\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(R=!0,T=r(e[1]))}return R}function i(){return a()&&T}function o(){if(!t(A)&&(A=!1,!a()&&/ Safari\/[\.0-9]+/.test(y.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function u(){return o()&&S}function s(){if(!t(v)){v=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(y.userAgent);null!==e&&(v=!0,N=r(e[1]),N.isNightly=!!e[2])}return v}function c(){return s()&&N}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===y.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(y.userAgent),null!==e&&(O=!0,M=r(e[1]))):"Netscape"===y.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(y.userAgent),null!==e&&(O=!0,M=r(e[1])))}return O}function f(){return l()&&M}function h(){if(!t(I)){I=!1;var e=/Firefox\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(I=!0,g=r(e[1]))}return I}function d(){return t(w)||(w=/Windows/i.test(y.appVersion)),w}function E(){return h()&&g}function _(){return t(C)||(C="undefined"!=typeof PointerEvent&&(!t(y.pointerEnabled)||y.pointerEnabled)),C}function m(){if(!t(P)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;P=t(n)&&""!==n,P&&(x=n)}return P}function p(){return m()?x:void 0}var y;y="undefined"!=typeof navigator?navigator:{};var R,T,A,S,v,N,O,M,I,g,w,C,x,P,U={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:h,firefoxVersion:E,isWindows:d,hardwareConcurrency:e(y.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:m,imageRenderingValue:p};return U.supportsFullscreen=function(){return n.supportsFullscreen()},U.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},U.supportsWebWorkers=function(){return"undefined"!=typeof Worker},U}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,a,i){"use strict";if(!a.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return n(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,n,a,i){switch(a=t(a,0),i=t(i,(n.byteLength-a)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,a,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,a,i);case o.SHORT:return new Int16Array(n,a,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,a,i);case o.FLOAT:return new Float32Array(n,a,i);case o.DOUBLE:return new Float64Array(n,a,i);default:throw new r("componentDatatype is not a valid value.")}},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",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"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(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 t(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=void 0}return i.computeNumberOfVertices=function(e){var r=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,r){return e>=a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,r):new Uint16Array(t,n,r)},r(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;f>h;h++){var d=t[h],E=d.x,_=d.y,m=d.z;a=Math.min(E,a),s=Math.max(E,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 R=e.add(p,y,r.center);return e.multiplyByScalar(R,.5,R),r},i.clone=function(t,r){return n(t)?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):void 0},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:0>s+u?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",["./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){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},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.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.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/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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,0>i?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(0>f)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,m=u*c-d,p=4*E*m-_*_;if(0>p){var y,R,T;h*f>=l*d?(y=o,R=E,T=-2*u*E+o*_):(y=c,R=m,T=-c*_+2*s*m);var A=0>T?-1:1,S=-A*Math.abs(y)*Math.sqrt(-p);i=-T+S;var v=i/2,N=0>v?-Math.pow(-v,1/3):Math.pow(v,1/3),O=i===S?-N:-R/N;return a=0>=R?N+O:-T/(N*N+O*O+R),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var M=E,I=-2*u*E+o*_,g=m,w=-c*_+2*s*m,C=Math.sqrt(p),x=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*C,-I)/3);a=2*Math.sqrt(-M);var U=Math.cos(P);i=a*U;var D=a*(-U/2-x*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,B=L/F;P=Math.abs(Math.atan2(c*C,-w)/3),a=2*Math.sqrt(-g),U=Math.cos(P),i=a*U,D=a*(-U/2-x*Math.sin(P));var z=-c,b=2*s>i+D?i+s:D+s,G=z/b,q=F*b,W=-L*b-F*z,H=L*z,X=(s*W-u*H)/(-u*W+s*q);return X>=B?G>=B?G>=X?[B,X,G]:[B,G,X]:[G,B,X]:G>=B?[X,B,G]:G>=X?[X,G,B]:[G,X,B]}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=0>u?-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,0>u?[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=E[0],p=E[1];if(m>=0&&p>=0){var y=Math.sqrt(m),R=Math.sqrt(p);return[h-R,h-y,h+y,h+R]}if(m>=0&&0>p)return _=Math.sqrt(m),[h-_,h+_];if(0>m&&p>=0)return _=Math.sqrt(p),[h-_,h+_]}return[]}if(d>0){var T=Math.sqrt(d),A=(s+d-c/T)/2,S=(s+d+c/T)/2,v=r.computeRealRoots(1,T,A),N=r.computeRealRoots(1,-T,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,_,m=d[0],p=a-m,y=p*p,R=t/2,T=p/2,A=y-4*o,S=y+4*Math.abs(o),v=c-4*m,N=c+4*Math.abs(m);if(0>m||v*S>A*N){var O=Math.sqrt(v);E=O/2,_=0===O?0:(t*T-i)/O}else{var M=Math.sqrt(A);E=0===M?0:(t*T-i)/M,_=M/2}var I,g;0===R&&0===E?(I=0,g=0):n.sign(R)===n.sign(E)?(I=R+E,g=m/I):(g=R-E,I=m/g);var w,C;0===T&&0===_?(w=0,C=0):n.sign(T)===n.sign(_)?(w=T+_,C=o/w):(C=T-_,w=o/C);var x=r.computeRealRoots(1,I,w),P=r.computeRealRoots(1,g,C);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,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=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>f?d+1:d,d+=0>h?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(t,r,a,o,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,_=e.subtract(a,r,m),A=e.subtract(o,r,p),S=e.cross(E,A,y),v=e.dot(_,S);if(u){if(v<i.EPSILON6)return;if(s=e.subtract(d,r,R),l=e.dot(s,S),0>l||l>v)return;if(c=e.cross(s,_,T),f=e.dot(E,c),0>f||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,R),l=e.dot(s,S)*N,0>l||l>1)return;if(c=e.cross(s,_,T),f=e.dot(E,c)*N,0>f||l+f>1)return;h=e.dot(A,c)*N}return h}function f(e,t,n,r){var a=t*t-4*e*n;if(!(0>a)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return s>u?(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={});var i=t.origin,o=t.direction,u=n.center,s=n.radius*n.radius,c=e.subtract(i,u,y),l=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,E=f(l,h,d,S);return r(E)?(a.start=E.root0,a.stop=E.root1,a):void 0}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 E(t,n,r,a,c){var l,f=a*a,h=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,_=c*(a*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),m=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),R=[];if(0===y&&0===p){if(l=u.computeRealRoots(E,_,m),0===l.length)return R;var T=l[0],A=Math.sqrt(Math.max(1-T*T,0));if(R.push(new e(a,c*T,c*-A)),R.push(new e(a,c*T,c*A)),2===l.length){var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));R.push(new e(a,c*S,c*-v)),R.push(new e(a,c*S,c*v))}return R}var N=y*y,O=p*p,M=E*E,I=y*p,g=M+O,w=2*(_*E+I),C=2*m*E+_*_-O+N,x=2*(m*_-I),P=m*m-N;if(0===g&&0===w&&0===C&&0===x)return R;l=s.computeRealRoots(g,w,C,x,P);var U=l.length;if(0===U)return R;for(var D=0;U>D;++D){var L,F=l[D],B=F*F,z=Math.max(1-B,0),b=Math.sqrt(z);L=i.sign(E)===i.sign(m)?d(E*B+m,_*F,i.EPSILON12):i.sign(m)===i.sign(_*F)?d(E*B,_*F+m,i.EPSILON12):d(E*B+_*F,m,i.EPSILON12);var G=d(p*F,y,i.EPSILON15),q=L*G;0>q?R.push(new e(a,c*F,c*b)):q>0?R.push(new e(a,c*F,c*-b)):0!==b?(R.push(new e(a,c*F,c*-b)),R.push(new e(a,c*F,c*b)),++D):R.push(new e(a,c*F,c*b))}return R}var _={};_.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(!(0>l))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var m=new e,p=new e,y=new e,R=new e,T=new e;_.rayTriangle=function(t,n,a,i,o,u){var s=l(t,n,a,i,o);if(r(s)&&!(0>s))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new c;_.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 f=l(c,a,i,o,u);return!r(f)||0>f||f>e.distance(t,n)?void 0:(r(s)||(s=new e),e.multiplyByScalar(c.direction,f,s),e.add(c.origin,s,s))};var S={root0:0,root1:0};_.raySphere=function(e,t,n){return n=h(e,t,n),!r(n)||n.stop<0?void 0:(n.start=Math.max(n.start,0),n)};var v=new c;_.lineSegmentSphere=function(t,n,a,i){var o=v,u=e.subtract(n,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),i=h(o,a,i),!r(i)||i.stop<0||i.start>s?void 0:(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,i,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,N),l=e.multiplyComponents(s,t.direction,O),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,i>d)return;if(d>i){o=h*h-i,u=-h+Math.sqrt(o);var E=u/a,_=r/u;return _>E?{start:E,stop:_}:{start:_,stop:E}}var m=Math.sqrt(r/a);return{start:m,stop:m}}return 1>f?(r=f-1,a=e.magnitudeSquared(l),i=a*r,o=h*h-i,u=-h+Math.sqrt(o),{start:0,stop:u/a}):0>h?(a=e.magnitudeSquared(l),{start:0,stop:-h/a}):void 0};var M=new e,I=new e,g=new e,w=new e,C=new e,x=new o,P=new o,U=new o,D=new o,L=new o,F=new o,B=new o,z=new e,b=new e,G=new t;_.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction,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),h=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(h,f,I),I),_=e.normalize(e.cross(f,d,g),g),m=x;m[0]=f.x,m[1]=f.y,m[2]=f.z,m[3]=d.x,m[4]=d.y,m[5]=d.z,m[6]=_.x,m[7]=_.y,m[8]=_.z;var p=o.transpose(m,P),y=o.fromScale(n.radii,U),R=o.fromScale(n.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 A,S,v=o.multiply(o.multiply(p,R,F),T,F),N=o.multiply(o.multiply(v,y,B),m,B),O=o.multiplyByVector(v,a,C),q=E(N,e.negate(O,M),0,0,1),W=q.length;if(W>0){for(var H=e.clone(e.ZERO,b),X=Number.NEGATIVE_INFINITY,V=0;W>V;++V){A=o.multiplyByVector(y,o.multiplyByVector(m,q[V],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,u);k>X&&(X=k,H=e.clone(A,H))}var j=n.cartesianToCartographic(H,G);return X=i.clamp(X,0,1),S=e.magnitude(e.subtract(H,a,w))*Math.sqrt(1-X*X),S=c?-S:S,j.height=S,n.cartographicToCartesian(j,new e)}};var q=new e;return _.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(!(0>f||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},_.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]}}},_}),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(r){return i(r)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(a){return i(a)}});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(t){r.progress(t)}}: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=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){E(e)}var c,l,f,h,d,E,_,m,y,R;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],d=o(),c)for(m=d.progress,_=function(e){h.push(e),--l||(E=_=p,d.reject(h))},E=function(e){f.push(e),--c||(E=_=p,d.resolve(f))},R=0;y>R;++R)R in t&&e(t[R],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,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;a>s;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)})})},R.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 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 R,T,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)})})}},T=[].slice,R=[].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(;a>i;++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;o>=i;)if(r=~~((i+o)/2),a=n(e[r],t),0>a)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,R="",T=!1,A=!1,S=" ",v=s.length,N=0;s&&v>N;N++)switch(s.charAt(N)){case" ":R=" ";break;case"+":R="+";break;case"-":y=!0;break;case"'":S=s.charAt(N+1);break;case"0":T=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(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,T,S);case"c":return u(String.fromCharCode(+p),y,c,f,T);case"b":return o(p,2,A,y,c,f,T);case"o":return o(p,8,A,y,c,f,T);case"x":return o(p,16,A,y,c,f,T);case"X":return o(p,16,A,y,c,f,T).toUpperCase();case"u":return o(p,10,A,y,c,f,T);case"i":case"d":return d=+p||0,d=Math.round(d-d%1),E=0>d?"-":R,p=E+a(String(Math.abs(d)),f,"0",!1),i(p,E,y,c,T);case"e":case"E":case"f":case"F":case"g":case"G":return d=+p,E=0>d?"-":R,_=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],p=E+Math.abs(d)[_](f),i(p,E,y,c,T)[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){R.julianDate=e;var n=_.leapSeconds,r=t(n,R,l);0>r&&(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){R.julianDate=e;var r=_.leapSeconds,a=t(r,R,l);if(0>a&&(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):1>=i?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,0>t&&(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,0>r&&(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 m=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,R=new u,T=/^(\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})?$/,M=/^(\d{2})(\.\d+)?/.source+O.source,I=/^(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,g=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,w="Invalid ISO 8601 date.";_.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,i,u,s=e.split("T"),l=1,h=1,m=0,R=0,O=0,C=0,x=s[0],P=s[1];if(!r(x))throw new a(w);var U;if(s=x.match(N),null!==s){if(U=x.split("-").length-1,U>0&&2!==U)throw new a(w);n=+s[1],l=+s[2],h=+s[3]}else if(s=x.match(A),null!==s)n=+s[1],l=+s[2];else if(s=x.match(T),null!==s)n=+s[1];else{var D;if(s=x.match(S),null!==s){if(n=+s[1],D=+s[2],u=o(n),1>D||u&&D>366||!u&&D>365)throw new a(w)}else{if(s=x.match(v),null===s)throw new a(w);n=+s[1];var L=+s[2],F=+s[3]||0;if(U=x.split("-").length-1,U>0&&(!r(s[3])&&1!==U||r(s[3])&&2!==U))throw new a(w);var B=new Date(Date.UTC(n,0,4));D=7*L+F-B.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(D),l=i.getUTCMonth()+1,h=i.getUTCDate()}if(u=o(n),1>l||l>12||1>h||(2!==l||!u)&&h>p[l-1]||u&&2===l&&h>y)throw new a(w);var z;if(r(P)){if(s=P.match(g),null!==s){if(U=P.split(":").length-1,U>0&&2!==U&&3!==U)throw new a(w);m=+s[1],R=+s[2],O=+s[3],C=1e3*+(s[4]||0),z=5}else if(s=P.match(I),null!==s){if(U=P.split(":").length-1,U>2)throw new a(w);m=+s[1],R=+s[2],O=60*+(s[3]||0),z=4}else{if(s=P.match(M),null===s)throw new a(w);m=+s[1],R=60*+(s[2]||0),z=3}if(R>=60||O>=61||m>24||24===m&&(R>0||O>0||C>0))throw new a(w);var b=s[z],G=+s[z+1],q=+(s[z+2]||0);switch(b){case"+":m-=G,R-=q;break;case"-":m+=G,R+=q;break;case"Z":break;default:R+=new Date(Date.UTC(n,l-1,h,m,R)).getTimezoneOffset()}}else R+=new Date(n,l-1,h).getTimezoneOffset();var W=60===O;for(W&&O--;R>=60;)R-=60,m++;for(;m>=24;)m-=24,h++;for(i=u&&2===l?y:p[l-1];h>i;)h-=i,l++,l>12&&(l-=12,n++),i=u&&2===l?y:p[l-1];for(;0>R;)R+=60,m--;for(;0>m;)m+=24,h--;for(;1>h;)l--,1>l&&(l+=12,n--),i=u&&2===l?y:p[l-1],h+=i;var H=E(n,l,h,m,R,O,C);return r(t)?(d(H[0],H[1],t),f(t)):t=new _(H[0],H[1],c.UTC),W&&_.addSeconds(t,1,t),t},_.now=function(e){return _.fromDate(new Date,e)};var C=new _(0,0,c.TAI);return _.toGregorianDate=function(e,t){var n=!1,a=h(e,C);r(a)||(_.addSeconds(e,-1,C),a=h(C,C),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,p=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,R=u-y*s.SECONDS_PER_HOUR,T=R/s.SECONDS_PER_MINUTE|0;R-=T*s.SECONDS_PER_MINUTE;var A=0|R,S=(R-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=E,t.hour=y,t.minute=T,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(p,m,E,y,T,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){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new _(e.dayNumber,e.secondsOfDay,c.TAI):void 0},_.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){R.julianDate=e;var n=_.leapSeconds,r=t(n,R,l);return 0>r&&(r=~r,--r,0>r&&(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)],_}),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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,n,r,a,i){"use strict";function o(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,u=n.headers,s=n.overrideMimeType,c=n.withCredentials;return e(n.url,function(t){var n=e.defer();return o.load(t,r,a,i,u,n,s,c),n.promise})}function u(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function s(e,t){for(var n=u(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 c(e,n){n=t(n,"");var a=e[1],i=!!e[2],o=e[3];switch(n){case"":case"text":return u(i,o);case"arraybuffer":return s(i,o);case"blob":var c=s(i,o);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(u(i,o),a);case"json":return JSON.parse(u(i,o));default:throw new r("Unhandled responseType: "+n)}}var l=/^data:(.*?)(;base64)?,(.*)$/;return o.load=function(e,t,r,o,u,s,f,h){var d=l.exec(e);if(null!==d)return void s.resolve(c(d,t));var E=new XMLHttpRequest;if(n(f)&&n(E.overrideMimeType)&&E.overrideMimeType(f),E.open(r,e,!0),n(u))for(var _ in u)u.hasOwnProperty(_)&&E.setRequestHeader(_,u[_]);n(t)&&(E.responseType=t),n(h)&&(E.withCredentials=h),E.onload=function(){E.status>=200&&E.status<300?n(E.response)?s.resolve(E.response):n(E.responseXML)&&E.responseXML.hasChildNodes()?s.resolve(E.responseXML):n(E.responseText)?s.resolve(E.responseText):s.reject(new i("unknown XMLHttpRequest response type.")):s.reject(new a(E.status,E.response,E.getAllResponseHeaders()))},E.onerror=function(e){s.reject(new a)},E.send(o)},o.defaultLoad=o.load,o}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";function n(n,r){return e({url:n,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return n}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)||(a={}),t(a.headers)?t(a.headers.Accept)||(a.headers=e(a.headers),a.headers.Accept=i.Accept):a.headers=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(0>a||0>i||0>s||0>c||0>h||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 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=E,e._taiMinusUtcSecondsColumn=_,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,R=e._addNewLeapSeconds,T=0,A=m.length;A>T;T+=e._columnCount){var S=m[T+a],v=m[T+_],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,O=new o(N,v,f.TAI);if(p.push(O),R){if(v!==y&&r(y)){var M=o.leapSeconds,I=t(M,O,d);if(0>I){var g=new u(O,v);M.splice(~I,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,d=i*s,E=n[h+e._ut1MinusUtcSecondsColumn],p=n[d+e._ut1MinusUtcSecondsColumn],y=p-E;if(y>.5||-.5>y){var R=n[h+e._taiMinusUtcSecondsColumn],T=n[d+e._taiMinusUtcSecondsColumn];R!==T&&(l.equals(r)?E=p:p-=T-R)}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,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],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,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,0>s&&(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("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/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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","require"],function(e,t,n,r,a){"use strict";function i(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),a=d.exec(r);if(null!==a)return a[1]}}function o(){if(t(l))return l;var a;if(a="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:i(),!t(a))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new e(r(a))}function u(e){return a.toUrl("../"+e)}function s(t){return new e(t).resolve(o()).toString()}function c(e){t(f)||(f=t(a.toUrl)?u:s),t(h)||(h=document.createElement("a"));var n=f(e);return h.href=n,h.href=h.href,h.href}var l,f,h,d=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=d,c.setBaseUrl=function(t){l=new e(t).resolve(new e(document.location.href))},c}),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;t>=s;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;t>=c;++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;s>u;++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;0>u&&(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;h>=E;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(0>i)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);0>s&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,0>s&&(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=i-s*this._stepSizeDays,p=this._work,y=this._denominators,R=this._coef,T=this._xTable;for(E=0;u>=E;++E)p[E]=m-T[E];for(E=0;u>=E;++E){for(R[E]=1,_=0;u>=_;++_)_!==E&&(R[E]*=p[_]);R[E]*=y[E];var A=3*(s+E);n.x+=R[E]*d[A++],n.y+=R[E]*d[A++],n.s+=R[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],_=h+d+E;if(_>0)r=Math.sqrt(_+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,p=0;d>h&&(p=1),E>h&&E>d&&(p=2);var y=m[p],R=m[y];r=Math.sqrt(e[u.getElementIndex(p,p)]-e[u.getElementIndex(y,y)]-e[u.getElementIndex(R,R)]+1);var T=f;T[p]=.5*r,r=.5/r,c=(e[u.getElementIndex(R,y)]-e[u.getElementIndex(y,R)])*r,T[y]=(e[u.getElementIndex(y,p)]+e[u.getElementIndex(p,y)])*r,T[R]=(e[u.getElementIndex(R,p)]+e[u.getElementIndex(p,R)])*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,E=new e,_=new s,m=new s,p=new s;s.packedLength=4,s.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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;i>a;a++){var o=3*a;s.unpack(e,4*(t+a),_),s.multiply(_,p,_),_.w<0&&s.negate(_,_),s.computeAxis(_,d);var u=s.computeAngle(_);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,_):s.fromAxisAngle(E,u,_),s.multiply(_,m,o)},s.clone=function(e,t){return n(e)?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):void 0},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 R=new s,T=new s,A=new s;s.slerp=function(e,t,n,r){var a=s.dot(e,t),i=t;if(0>a&&(a=-a,i=R=s.negate(t,R)),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),A=s.multiplyByScalar(i,Math.sin(n*u),A),r=s.add(T,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,O=new s;s.computeInnerQuadrangle=function(t,n,r,a){var i=s.conjugate(n,N);s.multiply(i,r,O); +var o=s.log(O,S);s.multiply(i,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,a)},s.squad=function(e,t,n,r,a,i){var o=s.slerp(e,t,a,N),u=s.slerp(n,r,a,O);return s.slerp(o,u,2*a*(1-a),i)};for(var M=new s,I=1.9011074535173003,g=a.supportsTypedArrays()?new Float32Array(8):[],w=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],x=a.supportsTypedArrays()?new Float32Array(8):[],P=0;7>P;++P){var U=P+1,D=2*U+1;g[P]=1/(U*D),w[P]=U/D}return g[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)C[f]=(g[f]*c-w[f])*o,x[f]=(g[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+x[0]*(1+x[1]*(1+x[2]*(1+x[3]*(1+x[4]*(1+x[5]*(1+x[6]*(1+x[7])))))))),E=s.multiplyByScalar(e,d,M);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,O);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","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./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){"use strict";var y={},R=new n,T=new n,A=new n;y.eastNorthUpToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=R,s=T,l=A;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.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,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var S=new n,v=new n,N=new n;y.northEastDownToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=-o,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]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=S,s=v,l=N;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.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 _(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},y.northUpEastToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=o,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 _(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=R,s=T,l=A;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),i(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 _(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 O=new m,M=new n(1,1,1),I=new _;y.headingPitchRollToFixedFrame=function(e,t,r,a,i,o){var u=m.fromHeadingPitchRoll(t,r,a,O),s=_.fromTranslationQuaternionRotationScale(n.ZERO,u,M,I);return o=y.eastNorthUpToFixedFrame(e,i,o),_.multiply(o,s,o)};var g=new _,w=new E;y.headingPitchRollQuaternion=function(e,t,n,r,a,i){var o=y.headingPitchRollToFixedFrame(e,t,n,r,a,g),u=_.getRotation(o,w);return m.fromRotationMatrix(u,i)};var C=24110.54841,x=8640184.812866,P=.093104,U=-62e-7,D=1.1772758384668e-19,L=72921158553e-15,F=d.TWO_PI/86400,B=new h;y.computeTemeToPseudoFixedMatrix=function(e,t){B=h.addSeconds(e,-h.computeTaiMinusUtc(e),B);var n,r=B.dayNumber,a=B.secondsOfDay,o=r-2451545;n=a>=43200?(o+.5)/p.DAYS_PER_JULIAN_CENTURY:(o-.5)/p.DAYS_PER_JULIAN_CENTURY;var u=C+n*(x+n*(P+n*U)),s=u*F%d.TWO_PI,c=L+D*(r-2451545.5),l=(a+.5*p.SECONDS_PER_DAY)%p.SECONDS_PER_DAY,f=s+c*l,_=Math.cos(f),m=Math.sin(f);return i(t)?(t[0]=_,t[1]=-m,t[2]=0,t[3]=m,t[4]=_,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(_,m,0,-m,_,0,0,0,1)},y.iau2006XysData=new l,y.earthOrientationParameters=u.NONE;var z=32.184,b=2451545;y.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+z,a=t.stop.dayNumber,i=t.stop.secondsOfDay+z,o=y.iau2006XysData.preload(n,r,a,i),u=y.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},y.computeIcrfToFixedMatrix=function(e,t){i(t)||(t=new E);var n=y.computeFixedToIcrfMatrix(e,t);if(i(n))return E.transpose(n,t)};var G=new f(0,0,0),q=new s(0,0,0,0,0,0),W=new E,H=new E;y.computeFixedToIcrfMatrix=function(e,t){i(t)||(t=new E);var n=y.earthOrientationParameters.compute(e,q);if(i(n)){var r=e.dayNumber,a=e.secondsOfDay+z,o=y.iau2006XysData.computeXysRadians(r,a,G);if(i(o)){var u=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=W;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=E.fromRotationZ(-o.s,H),_=E.multiply(l,f,W),m=e.dayNumber,R=e.secondsOfDay-h.computeTaiMinusUtc(e)+n.ut1MinusUtc,T=m-2451545,A=R/p.SECONDS_PER_DAY,S=.779057273264+A+.00273781191135448*(T+A);S=S%1*d.TWO_PI;var v=E.fromRotationZ(S,H),N=E.multiply(_,v,W),O=Math.cos(n.xPoleWander),M=Math.cos(n.yPoleWander),I=Math.sin(n.xPoleWander),g=Math.sin(n.yPoleWander),w=r-b+a/p.SECONDS_PER_DAY;w/=36525;var C=-47e-6*w*d.RADIANS_PER_DEGREE/3600,x=Math.cos(C),P=Math.sin(C),U=H;return U[0]=O*x,U[1]=O*P,U[2]=I,U[3]=-M*P+g*I*x,U[4]=M*x+g*I*P,U[5]=-g*O,U[6]=-g*P-M*I*x,U[7]=g*x-M*I*P,U[8]=M*O,E.multiply(N,U,t)}}};var X=new r;y.pointToWindowCoordinates=function(e,t,n,r){return r=y.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},y.pointToGLWindowCoordinates=function(e,n,a,o){i(o)||(o=new t);var u=X;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,o)};var V=new n,Y=new n,k=new n;return y.rotationMatrixFromPositionVelocity=function(e,t,r,o){var u=a(r,c.WGS84).geodeticSurfaceNormal(e,V),s=n.cross(t,u,Y);n.equalsEpsilon(s,n.ZERO,d.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var l=n.cross(s,t,k);return n.cross(t,l,s),n.negate(s,s),i(o)||(o=new E),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=s.x,o[4]=s.y,o[5]=s.z,o[6]=l.x,o[7]=l.y,o[8]=l.z,o},y}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix3","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E){"use strict";function _(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(f.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(f.getColumn(r,1,m));var i=n.fromCartesian4(f.getColumn(r,2,m));this._plane=h.fromPointNormal(e,i)}var m=new r;o(_.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;_.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new _(r.center,n)};var y=new d,R=new n;_.prototype.projectPointOntoPlane=function(e,r){var a=y;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,R);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,R)),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)}},_.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;r>a;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},_.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,R);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,R));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},_.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;n>r;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return _.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;r>l;++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},_}),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,E,_,m,p,y;n(a.z)?(f=t.subtract(s,a,i),h=t.subtract(c,a,o),d=t.subtract(r,a,u),E=t.dot(f,f),_=t.dot(f,h),m=t.dot(f,d),p=t.dot(h,h),y=t.dot(h,d)):(f=e.subtract(s,a,i),h=e.subtract(c,a,o),d=e.subtract(r,a,u),E=e.dot(f,f),_=e.dot(f,h),m=e.dot(f,d),p=e.dot(h,h),y=e.dot(h,d));var R=1/(E*p-_*_);return l.y=(p*m-_*y)*R,l.z=(E*y-_*m)*R,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";function n(t,n,a,i){return e(t,n,a,i,r),r.x>0&&r.y>0&&r.z>0}var r=new t;return n}),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,m=_*_,p=m*_,y=m*m,R=1+_-3*m/4+5*p/4-175*y/64,T=1-_+15*m/8-35*p/8,A=1-3*_+35*m/4,S=1-5*_,v=R*l-T*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=d,N.cosineAlpha=E,N.u2Over4=_,N.u4Over16=m,N.u6Over64=p,N.u8Over256=y,N.a0=R,N.a1=T,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,m=Math.atan((1-E)*Math.tan(a)),p=Math.atan((1-E)*Math.tan(o)),y=Math.cos(m),R=Math.sin(m),T=Math.cos(p),A=Math.sin(p),S=y*T,v=y*A,N=R*A,O=R*T,M=_,I=u.TWO_PI,g=Math.cos(M),w=Math.sin(M);do{g=Math.cos(M),w=Math.sin(M);var C=v-O*g;f=Math.sqrt(T*T*w*w+C*C),c=N+S*g,s=Math.atan2(f,c);var x;0===f?(x=0,h=1):(x=S*w/f,h=1-x*x),I=M,d=c-2*N/h,isNaN(d)&&(d=0),M=_+l(E,x,h,s,f,c,d)}while(Math.abs(M-I)>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),B=n*U*(s-F),z=Math.atan2(T*w,v-O*g),b=Math.atan2(y*w,v*g-O);e._distance=B,e._startHeading=z,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,m=a.u8Over256,p=a.u2Over4,y=a.u6Over64,R=a.u4Over16,T=2*_*m*o/3+i*(1-p+7*R/4-15*y/4+579*m/64-(R-15*y/4+187*m/16)*o-(5*y/4-115*m/16)*u-29*m*s/16)+(p/2-R+71*y/32-85*m/16)*c+(5*R/16-5*y/4+383*m/96)*f-E*((y-11*m/2)*c+5*m*f/2)+(29*y/96-29*m/16)*h+539*m*d/1536,A=Math.asin(Math.sin(T)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(A));T-=a.sigma;var v=Math.cos(2*a.sigma+T),N=Math.sin(T),O=Math.cos(T),M=a.cosineU*O,I=a.sineU*N,g=Math.atan2(N*a.sineHeading,M-I*a.cosineHeading),w=g-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,T,N,O,v);return r(n)?(n.longitude=this._start.longitude+w,n.latitude=S,n.height=0,n):new t(this._start.longitude+w,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;e>a;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;e>a;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,w),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,O),_=a.cartesianToCartographic(l,M),m=h(f,i,o);C.setEndPoints(d,_);var p=C.surfaceDistance/f,y=s;d.height=i;var R=a.cartographicToCartesian(d,I);e.pack(R,u,y),y+=3;for(var T=1;f>T;T++){var A=C.interpolateUsingSurfaceDistance(T*p,M);A.height=m[T],R=a.cartographicToCartesian(A,I),e.pack(R,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 _=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;n>a;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,_).height}return r};var m=new l,p=new e,y=new e,R=new f(e.ZERO,0),T=new e,A=new f(e.ZERO,0),S=new e,v=new e,N=[],O=new t,M=new t,I=new e,g=new e,w=new e,C=new o;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,p),h=l.multiplyByPointAsVector(s,e.UNIT_Y,y),d=f.fromPointNormal(c,h,R),E=l.multiplyByPointAsVector(s,e.UNIT_X,T),_=f.fromPointNormal(c,E,A),N=1;i.push(e.clone(t[0]));for(var O=i[0],M=t.length,I=1;M>I;++I){var g=t[I];if(f.getPointDistance(_,O)<0||f.getPointDistance(_,g)<0){var w=u.lineSegmentPlane(O,g,d,S);if(r(w)){var C=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(d,O)<0&&e.negate(C,C),i.push(e.add(w,C,new e)),o.push(N+1),e.negate(C,C),i.push(e.add(w,C,new e)),N=1}}i.push(e.clone(t[I])),N++,O=g}o.push(N)}return{positions:i,lengths:o}};var x=c.EPSILON10;return E.removeDuplicates=function(t){var n=t.length;if(2>n)return t;var r,a,i;for(r=1;n>r&&(a=t[r-1],i=t[r],!e.equalsEpsilon(a,i,x));++r);if(r===n)return t;for(var o=t.slice(0,r);n>r;++r)i=t[r],e.equalsEpsilon(a,i,x)||(o.push(e.clone(i)),a=i);return 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);if(1>o)return[];if(1===o){var f=u.scaleToGeodeticSurface(a[0],g);if(0!==l){var h=u.geodeticSurfaceNormal(f,I);e.multiplyByScalar(h,l,h),e.add(f,h,f)}return[f.x,f.y,f.z]}var _=t.minDistance;if(!r(_)){var m=n(t.granularity,c.RADIANS_PER_DEGREE);_=c.chordLength(m,u.maximumRadius)}var p,y=0;for(p=0;o-1>p;p++)y+=E.numberOfPoints(a[p],a[p+1],_);var R=3*(y+1),T=new Array(R),A=0,S=s(l);for(p=0;o-1>p;p++){var v=a[p],M=a[p+1],w=S?l[p]:l,C=S?l[p+1]:l;A=d(v,M,_,u,w,C,T,A)}N.length=0;var x=a[o-1],P=u.cartesianToCartographic(x,O);P.height=S?l[o-1]:l;var U=u.cartographicToCartesian(P,I);return e.pack(U,T,R-3),T},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;r>i;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/Queue",["../Core/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(){return 0!==this._length?this._array[this._offset]:void 0},t.prototype.contains=function(e){return-1!==this._array.indexOf(e)},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/WindingOrder",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"use strict";var n={CLOCKWISE:e.CW,COUNTER_CLOCKWISE:e.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return t(n)}),define("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PolylinePipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,_){"use strict";function m(t,n,r){var a=e.subtract(n,t,F),i=e.subtract(r,n,B);return a.x*i.y-a.y*i.x>=0}function p(e){for(var t=e[0].x,n=0,r=0;r<e.length;r++)e[r].x>t&&(t=e[r].x,n=r);return n}function y(e){for(var t=e[0][0].x,n=0,r=0;r<e.length;r++){var a=e[r][p(e[r])].x;a>t&&(t=a,n=r)}return n}function R(e){for(var t=[],n=0;n<e.length;n++){var r=e[(n-1+e.length)%e.length],a=e[n],i=e[(n+1)%e.length];m(r,a,i)||t.push(a)}return t}function T(t,n){for(var r=0;r<t.length;r++)if(e.equals(n,t[r]))return r;return-1}function A(n,a,i){i=r(i,[]);var o=Number.MAX_VALUE,u=p(a),s=new e(a[u].x,n.y);i.push(u),i.push((u+1)%a.length);for(var c=a[0].x,l=c,f=1;f<a.length;++f)a[f].x<c?c=a[f].x:a[f].x>l&&(l=a[f].x);l+=l-c;var h=new t(l,n.y,0);for(f=0;f<a.length;f++){var d=a[f],E=a[(f+1)%a.length];if((d.x>=n.x||E.x>=n.x)&&(d.y>=n.y&&E.y<=n.y||d.y<=n.y&&E.y>=n.y)){var _=(E.y-d.y)*(h.x-n.x)-(E.x-d.x)*(h.y-n.y);if(0!==_){_=1/_;var m=((E.x-d.x)*(n.y-d.y)-(E.y-d.y)*(n.x-d.x))*_,y=((h.x-n.x)*(n.y-d.y)-(h.y-n.y)*(n.x-d.x))*_;if(m>=0&&1>=m&&y>=0&&1>=y){var R=new e(n.x+m*(h.x-n.x),n.y+m*(h.y-n.y)),T=e.subtract(R,n,z);_=e.magnitudeSquared(T),o>_&&(s=R,o=_,i[0]=f,i[1]=(f+1)%a.length)}}}}return s}function S(t,n){var r=y(n),a=n[r],i=p(a),o=a[i],u=[],s=A(o,t,u),c=T(t,s);if(-1!==c)return c;var h=e.magnitudeSquared(e.subtract(t[u[0]],o,b)),d=e.magnitudeSquared(e.subtract(t[u[1]],o,b)),E=d>h?t[u[0]]:t[u[1]],_=R(t),m=_.indexOf(E);-1!==m&&_.splice(m,1);for(var S=[],v=0;v<_.length;v++){var N=_[v];f(N,o,s,E)&&S.push(N)}var O=Number.MAX_VALUE;if(S.length>0){var M=e.fromElements(1,0,b);for(v=0;v<S.length;v++){var I=e.subtract(S[v],o,G),g=e.magnitude(M)*e.magnitudeSquared(I);if(0!==g){var w=Math.abs(l.acosClamped(e.dot(M,I)/g));O>w&&(O=w,E=S[v])}}}return t.indexOf(E)}function v(e,n,r){for(var a=ee.computeWindingOrder2D(e),i=0;i<n.length;i++){var o=n[i];t.equals(o[0],o[o.length-1])||o.push(o[0]);var s=ee.computeWindingOrder2D(o);s===a&&o.reverse()}var c=u.fromPoints(e,r),l=c.projectPointsOntoPlane(e),f=[];for(i=0;i<n.length;i++)f.push(c.projectPointsOntoPlane(n[i]));var h=S(l,f),d=y(f),E=p(f[d]),_=n[d],m=[];for(i=0;i<e.length;i++)m.push(e[i]);var R,T=[];if(0!==E)for(R=0;R<=_.length;R++){var A=(R+E)%_.length;0!==A&&T.push(_[A])}else for(R=0;R<_.length;R++)T.push(_[(R+E)%_.length]);var v=m.lastIndexOf(e[h]);T.push(e[v]);var N=m.slice(0,v+1),O=m.slice(v+1);return m=N.concat(T,O),n.splice(d,1),m}function N(e){var t=l.nextRandomNumber(),n=Math.floor(t*e);return n===e&&n--,n}function O(e,t,n,r){var a=r[e].position,i=r[t].position,o=r[n].position,u=o.x,s=o.y,c=a.x-u,l=a.y-s,f=i.x-u,h=i.y-s;return c*h-l*f}function M(e,t){return e.x*t.y-e.y*t.x}function I(e,t){var n=t.length,r=l.mod(e-1,n),a=l.mod(e+1,n);return 0===O(r,a,e,t)?!1:!0}function g(t,n){return e.magnitudeSquared(n)<e.magnitudeSquared(t)}function w(t,n,r){if(!I(t,r))return t;var a=r[t].position,i=r[n].position,o=r.length,u=l.mod(t-1,o);if(!I(u,r))return u;var s=l.mod(t+1,o);if(!I(s,r))return s;var c=e.subtract(r[u].position,a,H),f=e.subtract(r[s].position,a,X),h=e.subtract(i,a,V),d=M(c,h),E=M(f,h);if(0===d)return g(c,h)?q:W;if(0===E)return g(f,h)?q:W;var _=M(c,f);return 0>_?0>d&&E>0?q:W:_>0?d>0&&0>E?W:q:void 0}function C(e,t,n){return(e>t||e>n)&&(t>e||n>e)||t===n&&t===e}function x(t,n,r,a){var i=e.subtract(r,t,k),o=n.x*a.y-n.y*a.x,u=o*o,s=e.magnitudeSquared(n),c=e.magnitudeSquared(a);if(u>Y*s*c){var l=(i.x*a.y-i.y*a.x)/o;return e.add(t,e.multiplyByScalar(n,l,k),k)}}function P(t,n,r){for(var i=e.subtract(n,t,j),o=r.length,u=0;o>u;u++){var s=r[u].position,c=r[l.mod(u+1,o)].position;if(!(e.equals(t,s)||e.equals(n,c)||e.equals(t,c)||e.equals(n,s))){var f=e.subtract(c,s,Z),h=x(t,i,s,f);if(a(h)&&!(e.equals(h,t)||e.equals(h,n)||e.equals(h,s)||e.equals(h,c))){var d=h.x,E=h.y,_=C(d,t.x,n.x)&&C(E,t.y,n.y)&&C(d,s.x,c.x)&&C(E,s.y,c.y);if(_)return!0}}}return!1}function U(t,n,r){var a=w(t,n,r);if(a>=0)return a;var i=w(n,t,r);return i>=0?i:a!==q||i!==q||P(r[t].position,r[n].position,r)||e.equals(r[t].position,r[n].position)?J:K}function D(e){return 0===O(1,2,0,e)}function L(e){var t=e.length;if(3===t)return D(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new i("Invalid polygon: must have at least three vertices.");for(var n,r,a=0,o=10*e.length,u=J;K>u&&a++<o;){for(n=N(e.length),r=n+1;Math.abs(n-r)<2||Math.abs(n-r)>e.length-2;)r=N(e.length);if(n>r){var s=n;n=r,r=s}u=U(n,r,e)}if(u===K){var c=e.splice(n,r-n+1,e[n],e[r]);return L(e).concat(L(c))}return u>=0?(e.splice(u,1),L(e)):[]}var F=new e,B=new e,z=new e,b=new e(1,0),G=new e,q=-1,W=-2,H=new t,X=new t,V=new t,Y=l.EPSILON14,k=new e,j=new e,Z=new e,K=-1,J=-2,Q=new t,$=new t,ee={};ee.removeDuplicates=function(e){var n=h.removeDuplicates(e);return t.equals(n[0],n[n.length-1])?n.slice(1):n},ee.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;t>a;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},ee.computeWindingOrder2D=function(e){var t=ee.computeArea2D(e);return t>0?_.COUNTER_CLOCKWISE:_.CLOCKWISE},ee.triangulate=function(e){for(var t=e.length,n=[],r=0;t>r;++r)n[r]={position:e[r],index:r};return L(n)};var te=new t,ne=new t,re=new t,ae=new t,ie=new t,oe=new t,ue=new t;return ee.computeSubdivision=function(e,i,o,u){u=r(u,l.RADIANS_PER_DEGREE);var f,h=o.slice(0),E=i.length,_=new Array(3*E),m=0;for(f=0;E>f;f++){var p=i[f];_[m++]=p.x,_[m++]=p.y,_[m++]=p.z}for(var y=[],R={},T=e.maximumRadius,A=l.chordLength(u,T),S=A*A;h.length>0;){var v,N,O=h.pop(),M=h.pop(),I=h.pop(),g=t.fromArray(_,3*I,te),w=t.fromArray(_,3*M,ne),C=t.fromArray(_,3*O,re),x=t.multiplyByScalar(t.normalize(g,ae),T,ae),P=t.multiplyByScalar(t.normalize(w,ie),T,ie),U=t.multiplyByScalar(t.normalize(C,oe),T,oe),D=t.magnitudeSquared(t.subtract(x,P,ue)),L=t.magnitudeSquared(t.subtract(P,U,ue)),F=t.magnitudeSquared(t.subtract(U,x,ue)),B=Math.max(D,L,F);B>S?D===B?(v=Math.min(I,M)+" "+Math.max(I,M),f=R[v],a(f)||(N=t.add(g,w,ue),t.multiplyByScalar(N,.5,N),_.push(N.x,N.y,N.z),f=_.length/3-1,R[v]=f),h.push(I,f,O),h.push(f,M,O)):L===B?(v=Math.min(M,O)+" "+Math.max(M,O),f=R[v],a(f)||(N=t.add(w,C,ue),t.multiplyByScalar(N,.5,N),_.push(N.x,N.y,N.z),f=_.length/3-1,R[v]=f),h.push(M,f,I),h.push(f,O,I)):F===B&&(v=Math.min(O,I)+" "+Math.max(O,I),f=R[v],a(f)||(N=t.add(C,g,ue),t.multiplyByScalar(N,.5,N),_.push(N.x,N.y,N.z),f=_.length/3-1,R[v]=f),h.push(O,f,M),h.push(f,I,M)):(y.push(I),y.push(M),y.push(O))}return new s({attributes:{position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:_})},indices:y,primitiveType:d.TRIANGLES})},ee.scaleToGeodeticHeight=function(e,n,i,u){i=r(i,o.WGS84);var s=Q,c=$;if(n=r(n,0),u=r(u,!0),a(e)&&a(e.attributes)&&a(e.attributes.position))for(var l=e.attributes.position.values,f=l.length,h=0;f>h;h+=3)t.fromArray(l,h,c),u&&(c=i.scaleToGeodeticSurface(c,c)),0!==n&&(s=i.geodeticSurfaceNormal(c,s),t.multiplyByScalar(s,n,s),t.add(c,s,c)),l[h]=c.x,l[h+1]=c.y,l[h+2]=c.z;return e},ee.eliminateHoles=function(e,n,a){a=r(a,o.WGS84);for(var i=[],u=0;u<n.length;u++){for(var s=[],c=0;c<n[u].length;c++)s.push(t.clone(n[u][c]));i.push(s)}for(var l=e;i.length>0;)l=v(l,i,a);return l},ee}),define("Core/WallGeometryLibrary",["./Cartographic","./defined","./DeveloperError","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t){return a.equalsEpsilon(e.latitude,t.latitude,a.EPSILON14)&&a.equalsEpsilon(e.longitude,t.longitude,a.EPSILON14)}function c(n,r,a,i){var o=r.length;if(2>o)return{positions:r};var u=t(i),c=t(a),l=new Array(o),d=new Array(o),E=new Array(o),_=r[0];l[0]=_;var m=n.cartesianToCartographic(_,f);c&&(m.height=a[0]),d[0]=m.height,u?E[0]=i[0]:E[0]=0;for(var p=1,y=1;o>y;++y){var R=r[y],T=n.cartesianToCartographic(R,h);c&&(T.height=a[y]),s(m,T)?m.height<T.height&&(d[p-1]=T.height):(l[p]=R,d[p]=T.height,u?E[p]=i[y]:E[p]=0,e.clone(T,m),++p)}return l.length=p,d.length=p,E.length=p,{positions:l,topHeights:d,bottomHeights:E}}var l={},f=new e,h=new e,d=new Array(2),E=new Array(2),_={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return l.computePositions=function(e,t,n,s,l,f){var h=c(e,t,n,s);if(t=h.positions,n=h.topHeights,s=h.bottomHeights,!(t.length<2)){if(t.length>=3){var m=r.fromPoints(t,e),p=m.projectPointsOntoPlane(t);i.computeWindingOrder2D(p)===u.CLOCKWISE&&(t.reverse(),n.reverse(),s.reverse())}var y,R,T=t.length,A=a.chordLength(l,e.maximumRadius),S=_;if(S.minDistance=A,S.ellipsoid=e,f){var v,N=0;for(v=0;T-1>v;v++)N+=o.numberOfPoints(t[v],t[v+1],A)+1;y=new Float64Array(3*N),R=new Float64Array(3*N);var O=d,M=E;S.positions=O,S.height=M;var I=0;for(v=0;T-1>v;v++){O[0]=t[v],O[1]=t[v+1],M[0]=n[v],M[1]=n[v+1];var g=o.generateArc(S);y.set(g,I),M[0]=s[v],M[1]=s[v+1],R.set(o.generateArc(S),I),I+=g.length}}else S.positions=t,S.height=n,y=new Float64Array(o.generateArc(S)),S.height=s,R=new Float64Array(o.generateArc(S));return{bottomPositions:R,topPositions:y}}},l}),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,d){"use strict";function E(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;E.pack=function(e,n,i){i=r(i,0);var u,s=e._positions,c=s.length;for(n[i++]=c,u=0;c>u;++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;c>u;++u)n[i++]=l[u];var f=e._maximumHeights;if(c=a(f)?f.length:0,n[i++]=c,a(f))for(u=0;c>u;++u)n[i++]=f[u];o.pack(e._ellipsoid,n,i),i+=o.packedLength,n[i]=e._granularity};var p=o.clone(o.UNIT_SPHERE),y={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:p,granularity:void 0};return E.unpack=function(e,n,i){n=r(n,0);var u,s=e[n++],c=new Array(s);for(u=0;s>u;++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;s>u;++u)l[u]=e[n++];s=e[n++];var f;if(s>0)for(f=new Array(s),u=0;s>u;++u)f[u]=e[n++];var h=o.unpack(e,n,p);n+=o.packedLength;var d=e[n];return a(i)?(i._positions=c,i._minimumHeights=l,i._maximumHeights=f,i._ellipsoid=o.clone(h,i._ellipsoid),i._granularity=d,i):(y.positions=c,y.minimumHeights=l,y.maximumHeights=f,y.granularity=d,new E(y))},E.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;l>f;++f)s&&(t[f]=o),c&&(n[f]=u)}var h={positions:i,maximumHeights:n,minimumHeights:t,ellipsoid:e.ellipsoid};return new E(h)},E.createGeometry=function(r){var i=r._positions,o=r._minimumHeights,E=r._maximumHeights,p=r._granularity,y=r._ellipsoid,R=d.computePositions(y,i,E,o,p,!1);if(a(R)){var T=R.bottomPositions,A=R.topPositions,S=A.length,v=2*S,N=new Float64Array(v),O=0;S/=3;var M;for(M=0;S>M;++M){var I=3*M,g=t.fromArray(A,I,_),w=t.fromArray(T,I,m);N[O++]=w.x,N[O++]=w.y,N[O++]=w.z,N[O++]=g.x,N[O++]=g.y,N[O++]=g.z}var C=new c({position:new s({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:N})}),x=v/3;v=2*x-4+x;var P=l.createTypedArray(x,v),U=0;for(M=0;x-2>M;M+=2){var D=M,L=M+2,F=t.fromArray(N,3*D,_),B=t.fromArray(N,3*L,m);if(!t.equalsEpsilon(F,B,f.EPSILON10)){var z=M+1,b=M+3;P[U++]=z,P[U++]=D,P[U++]=z,P[U++]=b,P[U++]=D,P[U++]=L}}return P[U++]=x-2,P[U++]=x-1,new u({attributes:C,indices:P,primitiveType:h.LINES,boundingSphere:new e.fromVertices(N)})}},E}),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/Workers/sanitizeHtml.js b/Workers/sanitizeHtml.js deleted file mode 100644 index 735f7c5..0000000 --- a/Workers/sanitizeHtml.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Cesium - https://github.com/AnalyticalGraphicsInc/cesium - * - * Copyright 2011-2014 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details. - */ -!function(){define("Core/defined",[],function(){"use strict";var e=function(e){return void 0!==e};return e}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var r=function(e){this.name="RuntimeError",this.message=e;var r;try{throw new Error}catch(t){r=t.stack}this.stack=r};return r.prototype.toString=function(){var r=this.name+": "+this.message;return e(this.stack)&&(r+="\n"+this.stack.toString()),r},r}),define("Core/freezeObject",["./defined"],function(e){"use strict";var r=Object.freeze;return e(r)||(r=function(e){return e}),r}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var r=function(e,r){return void 0!==e?e:r};return r.EMPTY_OBJECT=e({}),r}),define("Core/formatError",["./defined"],function(e){"use strict";var r=function(r){var t,n=r.name,i=r.message;t=e(n)&&e(i)?n+": "+i:r.toString();var s=r.stack;return e(s)&&(t+="\n"+s),t};return r}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,r,t){"use strict";var n=function(n){var i,s=[],o={id:void 0,result:void 0,error:void 0};return function(a){var c=a.data;s.length=0,o.id=c.id,o.error=void 0,o.result=void 0;try{o.result=n(c.parameters,s)}catch(u){o.error=u instanceof Error?{name:u.name,message:u.message,stack:u.stack}:u}r(i)||(i=e(self.webkitPostMessage,self.postMessage)),c.canTransferArrayBuffer||(s.length=0);try{i(o,s)}catch(u){o.result=void 0,o.error="postMessage failed with error: "+t(u)+"\n with responseMessage: "+JSON.stringify(o),i(o)}}};return n}),define("Workers/sanitizeHtml",["../Core/defined","../Core/RuntimeError","./createTaskProcessorWorker"],function(e,r,t){"use strict";var n,i="https://caja.appspot.com/html-css-sanitizer-minified.js",s=function(t){if(!e(n)&&(self.window={},importScripts(i),n=window.html_sanitize,!e(n)))throw new r("Unable to load Google Caja sanitizer script.");return n(t)};return t(s)})}(); \ No newline at end of file diff --git a/Workers/transferTypedArrayTest.js b/Workers/transferTypedArrayTest.js index 2f0681b..d38c334 100644 --- a/Workers/transferTypedArrayTest.js +++ b/Workers/transferTypedArrayTest.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Workers/upsampleQuantizedTerrainMesh.js b/Workers/upsampleQuantizedTerrainMesh.js index d0ba259..770cfac 100644 --- a/Workers/upsampleQuantizedTerrainMesh.js +++ b/Workers/upsampleQuantizedTerrainMesh.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2014 Cesium Contributors + * Copyright 2011-2015 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +55,175 @@ 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";var t=function(t){return void 0!==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";var e=function(t,e){return void 0!==t?t:e};return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";var e=function(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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("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^=2636928640&t<<7,t^=4022730752&t<<15,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){"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(t){return t>0?1:0>t?-1:0},n.signNotZero=function(t){return 0>t?-1:1},n.toSNorm=function(t){return Math.round(255*(.5*n.clamp(t,-1,1)+.5))},n.fromSNorm=function(t){return 2*(n.clamp(t,0,255)/255)-1},n.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},n.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},n.lerp=function(t,e,n){return(1-n)*t+n*e},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(t){return t*n.RADIANS_PER_DEGREE},n.toDegrees=function(t){return t*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(t){var e=n.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},n.negativePiToPi=function(t){for(var e=n.EPSILON10,r=n.PI,i=n.TWO_PI;-(r+e)>t;)t+=i;if(-r>t)return-r;for(;t>r+e;)t-=i;return t>r?r:t},n.zeroToTwoPi=function(t){var e=t%n.TWO_PI;return 0>e?(e+n.TWO_PI)%n.TWO_PI:e},n.equalsEpsilon=function(t,n,r){return r=e(r,0),Math.abs(t-n)<=r};var r=[1];n.factorial=function(t){var e=r.length;if(t>=e)for(var n=r[e-1],i=e;t>=i;i++)r.push(n*i);return r[t]},n.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},n.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},n.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},n.clamp=function(t,e,n){return e>t?e:t>n?n:t};var i=new t;return n.setRandomNumberSeed=function(e){i=new t(e)},n.nextRandomNumber=function(){return i.random()},n.acosClamped=function(t){return Math.acos(n.clamp(t,-1,1))},n.asinClamped=function(t){return Math.asin(n.clamp(t,-1,1))},n}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(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){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n):new a(t.x,t.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r]=e.y},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.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.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.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 s=new a,c=new a;a.angleBetween=function(t,e){return a.normalize(t,s),a.normalize(e,c),i.acosClamped(a.dot(s,c))};var h=new a;return a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,h);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.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r},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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)};a.fromSpherical=function(n,r){e(r)||(r=new a);var i=n.clock,o=n.cone,u=t(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(t,n,r,i){return e(i)?(i.x=t,i.y=n,i.z=r,i):new a(t,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new a(t.x,t.y,t.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z},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},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},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},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},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},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.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},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},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},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},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},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*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},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,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};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 s=new a,c=new a;a.angleBetween=function(t,e){a.normalize(t,s),a.normalize(e,c);var n=a.dot(s,c),r=a.magnitude(a.cross(s,c,s));return Math.atan2(r,n)};var h=new a;a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,h);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Z,e):n.y<=n.z?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_Z,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},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r},a.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,s=e.z,c=i*s-a*u,h=a*o-r*s,l=r*u-i*o;return n.x=c,n.y=h,n.z=l,n},a.fromDegrees=function(t,e,n,r,o){var u=i.toRadians(t),s=i.toRadians(e);return a.fromRadians(u,s,n,r,o)};var l=new a,f=new a,d=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=t(i,0);var s=e(o)?o.radiiSquared:d,c=Math.cos(r);l.x=c*Math.cos(n),l.y=c*Math.sin(n),l.z=Math.sin(r),l=a.normalize(l,l),a.multiplyComponents(s,l,f);var h=Math.sqrt(a.dot(l,f));return f=a.divideByScalar(f,h,f),l=a.multiplyByScalar(l,i,l),e(u)||(u=new a),a.add(f,l,u)},a.fromDegreesArray=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=i.toRadians(t[o]);return a.fromRadiansArray(r,e,n)},a.fromRadiansArray=function(t,n,r){var i=t.length;e(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=t[o],s=t[o+1];r[o/2]=a.fromRadians(u,s,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(t,e,n){for(var r=new Array(t.length),o=0;o<t.length;o+=3)r[o]=i.toRadians(t[o]),r[o+1]=i.toRadians(t[o+1]),r[o+2]=t[o+2];return a.fromRadiansArrayHeights(r,e,n)},a.fromRadiansArrayHeights=function(t,n,r){var i=t.length;e(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=t[o],s=t[o+1],c=t[o+2];r[o/3]=a.fromRadians(u,s,c,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r,i){"use strict";var a={};a.octEncode=function(t,e){if(e.x=t.x/(Math.abs(t.x)+Math.abs(t.y)+Math.abs(t.z)),e.y=t.y/(Math.abs(t.x)+Math.abs(t.y)+Math.abs(t.z)),t.z<0){var n=e.x,r=e.y;e.x=(1-Math.abs(r))*i.signNotZero(n),e.y=(1-Math.abs(n))*i.signNotZero(r)}return e.x=i.toSNorm(e.x),e.y=i.toSNorm(e.y),e},a.octDecode=function(t,n,r){if(r.x=i.fromSNorm(t),r.y=i.fromSNorm(n),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){var a=r.x;r.x=(1-Math.abs(r.y))*i.signNotZero(a),r.y=(1-Math.abs(a))*i.signNotZero(r.y)}return e.normalize(r,r)},a.octPackFloat=function(t){return 256*t.x+t.y};var o=new t;return a.octEncodeFloat=function(t){return a.octEncode(t,o),a.octPackFloat(o)},a.octDecodeFloat=function(t,e){var n=t/256,r=Math.floor(n),i=256*(n-r);return a.octDecode(r,i,e)},a.octPack=function(t,e,n,r){var i=a.octEncodeFloat(t),u=a.octEncodeFloat(e),s=a.octEncode(n,o);return r.x=65536*s.x+i,r.y=65536*s.y+u,r},a.octUnpack=function(t,e,n,r){var i=t.x/65536,o=Math.floor(i),u=65536*(i-o);i=t.y/65536;var s=Math.floor(i),c=65536*(i-s);a.octDecodeFloat(u,e),a.octDecodeFloat(c,n),a.octDecode(o,s,r)},a.compressTextureCoordinates=function(t){var e=1===t.x?4095:0|4096*t.x,n=1===t.y?4095:0|4096*t.y;return 4096*e+n},a.decompressTextureCoordinates=function(t,e){var n=t/4096;return e.x=Math.floor(n)/4096,e.y=n-Math.floor(n),e},a}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";var a=function(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)};return a.fromRadians=function(n,r,i,o){return i=t(i,0),e(o)?(o.longitude=n,o.latitude=r,o.height=i,o):new a(n,r,i)},a.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),a.fromRadians(t,e,n,r)},a.clone=function(t,n){return e(t)?e(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new a(t.longitude,t.latitude,t.height):void 0},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height},a.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.longitude-n.longitude)<=r&&Math.abs(t.latitude-n.latitude)<=r&&Math.abs(t.height-n.height)<=r},a.ZERO=r(new a(0,0,0)),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){return a.equalsEpsilon(this,t,e)},a.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},a}),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"],function(t,e,n,r,i,a,o,u){"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}var c=function(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,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))return void 0;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.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),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=s,n.z=c,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 h=new t,l=new t;c.prototype.cartographicToCartesian=function(e,n){var i=h,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;n>i;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var f=new t,d=new t,m=new t;c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,d);if(!r(a))return void 0;var o=this.geodeticSurfaceNormal(a,f),s=t.subtract(n,a,m),c=Math.atan2(o.y,o.x),h=Math.asin(o.z),l=u.sign(t.dot(s,n))*t.magnitude(s);return r(i)?(i.longitude=c,i.latitude=h,i.height=l,i):new e(c,h,l)},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;n>i;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e};var p=new t,y=new t;return c.prototype.scaleToGeodeticSurface=function(e,n){var i=e.x,a=e.y,o=e.z,s=this._oneOverRadii,c=s.x,h=s.y,l=s.z,f=i*i*c*c,d=a*a*h*h,m=o*o*l*l,x=f+d+m,v=Math.sqrt(1/x),g=t.multiplyByScalar(e,v,p);if(x<this._centerToleranceSquared)return isFinite(v)?t.clone(g,n):void 0;var w=this._oneOverRadiiSquared,M=w.x,z=w.y,S=w.z,E=y;E.x=2*g.x*M,E.y=2*g.y*z,E.z=2*g.z*S;var I,R,_,O,b,N,C,T,P,A,q,U=(1-v)*t.magnitude(e)/(.5*t.magnitude(E)),B=0;do{U-=B,_=1/(1+U*M),O=1/(1+U*z),b=1/(1+U*S),N=_*_,C=O*O,T=b*b,P=N*_,A=C*O,q=T*b,I=f*N+d*C+m*T-1,R=f*P*M+d*A*z+m*q*S;var L=-2*R;B=I/L}while(Math.abs(I)>u.EPSILON12);return r(n)?(n.x=i*_,n.y=a*O,n.z=o*b,n):new t(i*_,a*O,o*b)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,s,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}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";var u=function(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";var e=function(e,n){this.start=t(e,0),this.stop=t(n,0)};return e}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";var i=function(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)};i.fromElements=function(t,n,r,a,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=a,o):new i(t,n,r,a)},i.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 i(t.red,t.green,t.blue,t.alpha)},i.clone=function(t,n){return e(t)?e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new i(t.x,t.y,t.z,t.w):void 0},i.packedLength=4,i.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r++],a.w=n[r],a},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,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},i.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},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 a=new i;i.distance=function(t,e){return i.subtract(t,e,a),i.magnitude(a)},i.normalize=function(t,e){var n=i.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,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,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},i.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},i.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},i.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},i.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},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 o=new i;i.lerp=function(t,e,n,r){return i.multiplyByScalar(e,n,o),r=i.multiplyByScalar(t,1-n,r),i.add(o,r,r)};var u=new i;return i.mostOrthogonalAxis=function(t,e){var n=i.normalize(t,u);return i.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?i.clone(i.UNIT_X,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e):n.y<=n.z?n.y<=n.w?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_W,e):n.z<=n.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e)},i.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},i.equalsEpsilon=function(t,n,r){return t===n||e(t)&&e(n)&&Math.abs(t.x-n.x)<=r&&Math.abs(t.y-n.y)<=r&&Math.abs(t.z-n.z)<=r&&Math.abs(t.w-n.w)<=r},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(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e){return i.equalsEpsilon(this,t,e)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t){for(var e=0,n=0;9>n;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function u(t){for(var e=0,n=0;3>n;++n){var r=t[c.getElementIndex(d[n],f[n])];e+=2*r*r}return Math.sqrt(e)}function s(t,e){for(var n=a.EPSILON15,r=0,i=1,o=0;3>o;++o){var u=Math.abs(t[c.getElementIndex(d[o],f[o])]);u>r&&(i=o,r=u)}var s=1,h=0,l=f[i],m=d[i];if(Math.abs(t[c.getElementIndex(m,l)])>n){var p,y=t[c.getElementIndex(m,m)],x=t[c.getElementIndex(l,l)],v=t[c.getElementIndex(m,l)],g=(y-x)/2/v;p=0>g?-1/(-g+Math.sqrt(1+g*g)):1/(g+Math.sqrt(1+g*g)),s=1/Math.sqrt(1+p*p),h=p*s}return e=c.clone(c.IDENTITY,e),e[c.getElementIndex(l,l)]=e[c.getElementIndex(m,m)]=s,e[c.getElementIndex(m,l)]=h,e[c.getElementIndex(l,m)]=-h,e}var c=function(t,n,r,i,a,o,u,s,c){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(s,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(c,0)};c.clone=function(t,e){return n(t)?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 c(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]):void 0},c.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new c),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},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[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 c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},c.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,u=t.y*t.y,s=t.y*t.z,h=t.y*t.w,l=t.z*t.z,f=t.z*t.w,d=t.w*t.w,m=r-u-l+d,p=2*(i-f),y=2*(a+h),x=2*(i+f),v=-r+u-l+d,g=2*(s-o),w=2*(a-h),M=2*(s+o),z=-r-u+l+d;return n(e)?(e[0]=m,e[1]=x,e[2]=w,e[3]=p,e[4]=v,e[5]=M,e[6]=y,e[7]=g,e[8]=z,e):new c(m,p,y,x,v,g,w,M,z)},c.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 c(t.x,0,0,0,t.y,0,0,0,t.z)},c.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 c(t,0,0,0,t,0,0,0,t)},c.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 c(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},c.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 c(1,0,0,0,r,-i,0,i,r)},c.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 c(r,0,i,0,1,0,-i,0,r)},c.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 c(r,-i,0,i,r,0,0,0,1)},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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},c.getElementIndex=function(t,e){return 3*t+e},c.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},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},c.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},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var h=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],h)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],h)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],h)),n};var l=new t;c.getMaximumScale=function(e){return c.getScale(e,l),t.maximumComponent(l)},c.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],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],c=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],h=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 n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=h,n[8]=l,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},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},c.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,s=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=s,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},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},c.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],s=t[2],c=t[5],h=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=s,e[7]=c,e[8]=h,e};var f=[1,0,0],d=[2,2,1],m=new c,p=new c;return c.computeEigenDecomposition=function(t,e){var r=a.EPSILON20,i=10,h=0,l=0;n(e)||(e={});for(var f=e.unitary=c.clone(c.IDENTITY,e.unitary),d=e.diagonal=c.clone(t,e.diagonal),y=r*o(d);i>l&&u(d)>y;)s(d,m),c.transpose(m,p),c.multiply(d,m,d),c.multiply(p,d,d),c.multiply(f,m,f),++h>2&&(++l,h=0);return 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},c.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],s=t[5],c=t[8];return e*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},c.inverse=function(t,e){var n=t[0],i=t[1],o=t[2],u=t[3],s=t[4],h=t[5],l=t[6],f=t[7],d=t[8],m=c.determinant(t);if(Math.abs(m)<=a.EPSILON15)throw new r("matrix is not invertible");e[0]=s*d-f*h,e[1]=f*o-i*d,e[2]=i*h-s*o,e[3]=l*h-u*d,e[4]=n*d-l*o,e[5]=u*o-n*h,e[6]=u*f-l*s,e[7]=l*i-n*f,e[8]=n*s-u*i;var p=1/m;return c.multiplyByScalar(e,p,e)},c.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]},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},c.IDENTITY=i(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(t){"use strict";var e=function(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(n){e=n.stack}this.stack=e};return 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","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,s){"use strict";var c=function(t,e,r,i,a,o,u,s,c,h,l,f,d,m,p,y){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(e,0),this[5]=n(o,0),this[6]=n(h,0),this[7]=n(m,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(l,0),this[11]=n(p,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(y,0)};c.packedLength=16,c.pack=function(t,e,r){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]},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){return r(t)?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]):void 0},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,s=e.x*e.x,h=e.x*e.y,l=e.x*e.z,f=e.x*e.w,d=e.y*e.y,m=e.y*e.z,p=e.y*e.w,y=e.z*e.z,x=e.z*e.w,v=e.w*e.w,g=s-d-y+v,w=2*(h-x),M=2*(l+p),z=2*(h+x),S=-s+d-y+v,E=2*(m-f),I=2*(l-p),R=2*(m+f),_=-s-d+y+v;return i[0]=g*a,i[1]=z*a,i[2]=I*a,i[3]=0,i[4]=w*o,i[5]=S*o,i[6]=R*o,i[7]=0,i[8]=M*u,i[9]=E*u,i[10]=_*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},c.fromTranslation=function(t,e){return c.fromRotationTranslation(u.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 h=new t,l=new t,f=new t;c.fromCamera=function(e,n){var i=e.eye,a=e.target,o=e.up;t.normalize(t.subtract(a,i,h),h),t.normalize(t.cross(h,o,l),l),t.normalize(t.cross(l,h,f),f);var u=l.x,s=l.y,d=l.z,m=h.x,p=h.y,y=h.z,x=f.x,v=f.y,g=f.z,w=i.x,M=i.y,z=i.z,S=u*-w+s*-M+d*-z,E=x*-w+v*-M+g*-z,I=m*w+p*M+y*z;return r(n)?(n[0]=u,n[1]=x,n[2]=-m,n[3]=0,n[4]=s,n[5]=v,n[6]=-p,n[7]=0,n[8]=d,n[9]=g,n[10]=-y,n[11]=0,n[12]=S,n[13]=E,n[14]=I,n[15]=1,n):new c(u,s,d,S,x,v,g,E,-m,-p,-y,I,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,i){var a=Math.tan(.5*t),o=1/a,u=o/e,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},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),s=1/(r-n),c=1/(a-i),h=-(e+t)*u,l=-(r+n)*s,f=-(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]=h,o[13]=l,o[14]=f,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),s=2*i/(r-n),c=(e+t)/(e-t),h=(r+n)/(r-n),l=-(a+i)/(a-i),f=-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]=h,o[10]=l,o[11]=f,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),h=-1,l=-1,f=-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]=h,a[11]=l,a[12]=0,a[13]=0,a[14]=f,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),s=n(t.height,0);e=n(e,0),r=n(r,1);var c=.5*u,h=.5*s,l=.5*(r-e),f=c,d=h,m=l,p=a+c,y=o+h,x=e+l,v=1;return i[0]=f,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]=m,i[11]=0,i[12]=p,i[13]=y,i[14]=x,i[15]=v,i},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.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 d=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],d)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],d)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],d)),n};var m=new t;c.getMaximumScale=function(e){return c.getScale(e,m),t.maximumComponent(m)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],s=t[5],c=t[6],h=t[7],l=t[8],f=t[9],d=t[10],m=t[11],p=t[12],y=t[13],x=t[14],v=t[15],g=e[0],w=e[1],M=e[2],z=e[3],S=e[4],E=e[5],I=e[6],R=e[7],_=e[8],O=e[9],b=e[10],N=e[11],C=e[12],T=e[13],P=e[14],A=e[15],q=r*g+u*w+l*M+p*z,U=i*g+s*w+f*M+y*z,B=a*g+c*w+d*M+x*z,L=o*g+h*w+m*M+v*z,D=r*S+u*E+l*I+p*R,W=i*S+s*E+f*I+y*R,V=a*S+c*E+d*I+x*R,k=o*S+h*E+m*I+v*R,j=r*_+u*O+l*b+p*N,F=i*_+s*O+f*b+y*N,Y=a*_+c*O+d*b+x*N,G=o*_+h*O+m*b+v*N,Z=r*C+u*T+l*P+p*A,H=i*C+s*T+f*P+y*A,X=a*C+c*T+d*P+x*A,K=o*C+h*T+m*P+v*A;return n[0]=q,n[1]=U,n[2]=B,n[3]=L,n[4]=D,n[5]=W,n[6]=V,n[7]=k,n[8]=j,n[9]=F,n[10]=Y,n[11]=G,n[12]=Z,n[13]=H,n[14]=X,n[15]=K,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],s=t[6],c=t[8],h=t[9],l=t[10],f=t[12],d=t[13],m=t[14],p=e[0],y=e[1],x=e[2],v=e[4],g=e[5],w=e[6],M=e[8],z=e[9],S=e[10],E=e[12],I=e[13],R=e[14],_=r*p+o*y+c*x,O=i*p+u*y+h*x,b=a*p+s*y+l*x,N=r*v+o*g+c*w,C=i*v+u*g+h*w,T=a*v+s*g+l*w,P=r*M+o*z+c*S,A=i*M+u*z+h*S,q=a*M+s*z+l*S,U=r*E+o*I+c*R+f,B=i*E+u*I+h*R+d,L=a*E+s*I+l*R+m;return n[0]=_,n[1]=O,n[2]=b,n[3]=0,n[4]=N,n[5]=C,n[6]=T,n[7]=0,n[8]=P,n[9]=A,n[10]=q,n[11]=0,n[12]=U,n[13]=B,n[14]=L,n[15]=1,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],s=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]=s,n[15]=t[15],n};var p=new t;c.multiplyByUniformScale=function(t,e,n){return p.x=e,p.y=e,p.z=e,c.multiplyByScale(t,p,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,s=t[1]*r+t[5]*i+t[9]*a+t[13]*o,c=t[2]*r+t[6]*i+t[10]*a+t[14]*o,h=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=s,n.z=c,n.w=h,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,s=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=s,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],s=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=s,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[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[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]},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 y=new u,x=new u,v=new e,g=new e(0,0,0,1);return c.inverse=function(t,n){if(u.equalsEpsilon(c.getRotation(t,y),x,o.EPSILON7)&&e.equals(c.getRow(t,3,v),g))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],h=t[12],l=t[1],f=t[5],d=t[9],m=t[13],p=t[2],w=t[6],M=t[10],z=t[14],S=t[3],E=t[7],I=t[11],R=t[15],_=M*R,O=z*I,b=w*R,N=z*E,C=w*I,T=M*E,P=p*R,A=z*S,q=p*I,U=M*S,B=p*E,L=w*S,D=_*f+N*d+C*m-(O*f+b*d+T*m),W=O*l+P*d+U*m-(_*l+A*d+q*m),V=b*l+A*f+B*m-(N*l+P*f+L*m),k=T*l+q*f+L*d-(C*l+U*f+B*d),j=O*i+b*a+T*h-(_*i+N*a+C*h),F=_*r+A*a+q*h-(O*r+P*a+U*h),Y=N*r+P*i+L*h-(b*r+A*i+B*h),G=C*r+U*i+B*a-(T*r+q*i+L*a);_=a*m,O=h*d,b=i*m,N=h*f,C=i*d,T=a*f,P=r*m,A=h*l,q=r*d,U=a*l,B=r*f,L=i*l;var Z=_*E+N*I+C*R-(O*E+b*I+T*R),H=O*S+P*I+U*R-(_*S+A*I+q*R),X=b*S+A*E+B*R-(N*S+P*E+L*R),K=T*S+q*E+L*I-(C*S+U*E+B*I),J=b*M+T*z+O*w-(C*z+_*w+N*M),Q=q*z+_*p+A*M-(P*M+U*z+O*p),$=P*w+L*z+N*p-(B*z+b*p+A*w),te=B*M+C*p+U*w-(q*w+L*M+T*p),ee=r*D+i*W+a*V+h*k;if(Math.abs(ee)<o.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return ee=1/ee,n[0]=D*ee,n[1]=W*ee,n[2]=V*ee,n[3]=k*ee,n[4]=j*ee,n[5]=F*ee,n[6]=Y*ee,n[7]=G*ee,n[8]=Z*ee,n[9]=H*ee,n[10]=X*ee,n[11]=K*ee,n[12]=J*ee,n[13]=Q*ee,n[14]=$*ee,n[15]=te*ee,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],s=t[8],c=t[9],h=t[10],l=t[12],f=t[13],d=t[14],m=-n*l-r*f-i*d,p=-a*l-o*f-u*d,y=-s*l-c*f-h*d;return e[0]=n,e[1]=a,e[2]=s,e[3]=0,e[4]=r,e[5]=o,e[6]=c,e[7]=0,e[8]=i,e[9]=u,e[10]=h,e[11]=0,e[12]=m,e[13]=p,e[14]=y,e[15]=1,e},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),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,c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},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","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";var u=function(t,n,r,i){this.west=e(t,0),this.south=e(n,0),this.east=e(r,0),this.north=e(i,0)};u.fromDegrees=function(t,r,i,a,s){return t=o.toRadians(e(t,0)),r=o.toRadians(e(r,0)),i=o.toRadians(e(i,0)),a=o.toRadians(e(a,0)),n(s)?(s.west=t,s.south=r,s.east=i,s.north=a,s):new u(t,r,i,a)},u.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=0,c=t.length;c>s;s++){var h=t[s];r=Math.min(r,h.longitude),i=Math.max(i,h.longitude),a=Math.min(a,h.latitude),o=Math.max(o,h.latitude)}return n(e)?(e.west=r,e.south=a,e.east=i,e.north=o,e):new u(r,a,i,o)},u.packedLength=4,u.pack=function(t,n,r){r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i.west=t[r++],i.south=t[r++],i.east=t[r++],i.north=t[r],i},u.clone=function(t,e){return n(t)?n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new u(t.west,t.south,t.east,t.north):void 0},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.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},u.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},u.validate=function(){},u.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)},u.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)},u.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)},u.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)},u.center=function(e,r){var i=e.east,a=e.west,u=.5*(a+i);return a>i&&(u=o.negativePiToPi(u+o.PI)),n(r)?(r.longitude=u,r.latitude=.5*(e.south+e.north),r.height=0,r):new t(u,.5*(e.south+e.north))},u.intersectWith=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),s=Math.min(t.north,e.north);return n(r)?(r.west=i,r.south=a,r.east=o,r.north=s,r):new u(i,a,o,s)},u.contains=function(t,e){return e.longitude>=t.west&&e.longitude<=t.east&&e.latitude>=t.south&&e.latitude<=t.north},u.isEmpty=function(t){return t.west>=t.east||t.south>=t.north};var s=new t;return u.subsample=function(t,r,a,u){r=e(r,i.WGS84),a=e(a,0),n(u)||(u=[]);var c=0,h=t.north,l=t.south,f=t.east,d=t.west,m=s;m.height=a,m.longitude=d,m.latitude=h,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=l,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.latitude=0>h?h:l>0?l:0;for(var p=1;8>p;++p){var y=-Math.PI+p*o.PI_OVER_TWO;y>d&&f>y&&(m.longitude=y,u[c]=r.cartographicToCartesian(m,u[c]),c++)}return 0===m.latitude&&(m.longitude=d,u[c]=r.cartographicToCartesian(m,u[c]),c++,m.longitude=f,u[c]=r.cartographicToCartesian(m,u[c]),c++),u.length=c,u},u.MAX_VALUE=a(new u(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,s,c,h){"use strict";var l=function(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)},f=new t,d=new t,m=new t,p=new t,y=new t,x=new t,v=new t,g=new t,w=new t,M=new t,z=new t,S=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],v),a=t.clone(i,f),o=t.clone(i,d),u=t.clone(i,m),s=t.clone(i,p),c=t.clone(i,y),h=t.clone(i,x),E=e.length,I=1;E>I;I++){t.clone(e[I],i);var R=i.x,_=i.y,O=i.z;R<a.x&&t.clone(i,a),R>s.x&&t.clone(i,s),_<o.y&&t.clone(i,o),_>c.y&&t.clone(i,c),O<u.z&&t.clone(i,u),O>h.z&&t.clone(i,h)}var b=t.magnitudeSquared(t.subtract(s,a,g)),N=t.magnitudeSquared(t.subtract(c,o,g)),C=t.magnitudeSquared(t.subtract(h,u,g)),T=a,P=s,A=b;N>A&&(A=N,T=o,P=c),C>A&&(A=C,T=u,P=h);var q=w;q.x=.5*(T.x+P.x),q.y=.5*(T.y+P.y),q.z=.5*(T.z+P.z);var U=t.magnitudeSquared(t.subtract(P,q,g)),B=Math.sqrt(U),L=M;L.x=a.x,L.y=o.y,L.z=u.z;var D=z;D.x=s.x,D.y=c.y,D.z=h.z;var W=t.multiplyByScalar(t.add(L,D,g),.5,S),V=0;for(I=0;E>I;I++){t.clone(e[I],i);var k=t.magnitude(t.subtract(i,W,g));k>V&&(V=k);var j=t.magnitudeSquared(t.subtract(i,q,g));if(j>U){var F=Math.sqrt(j);B=.5*(B+F),U=B*B;var Y=F-B;q.x=(B*q.x+Y*i.x)/F,q.y=(B*q.y+Y*i.y)/F,q.z=(B*q.z+Y*i.z)/F}}return V>B?(t.clone(q,n.center),n.radius=B):(t.clone(W,n.center),n.radius=V),n};var E=new o,I=new t,R=new t,_=new e,O=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,E),h.southwest(e,_),_.height=a,h.northeast(e,O),O.height=o;var s=i.project(_,I),c=i.project(O,R),f=c.x-s.x,d=c.y-s.y,m=c.z-s.z;u.radius=.5*Math.sqrt(f*f+d*d+m*m);var p=u.center;return p.x=s.x+.5*f,p.y=s.y+.5*d,p.z=s.z+.5*m,u};var b=[];l.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=h.subsample(t,e,i,b)),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=v;u.x=e[0]+i.x,u.y=e[1]+i.y,u.z=e[2]+i.z;for(var s=t.clone(u,f),c=t.clone(u,d),h=t.clone(u,m),E=t.clone(u,p),I=t.clone(u,y),R=t.clone(u,x),_=e.length,O=0;_>O;O+=a){var b=e[O]+i.x,N=e[O+1]+i.y,C=e[O+2]+i.z;u.x=b,u.y=N,u.z=C,b<s.x&&t.clone(u,s),b>E.x&&t.clone(u,E),N<c.y&&t.clone(u,c),N>I.y&&t.clone(u,I),C<h.z&&t.clone(u,h),C>R.z&&t.clone(u,R)}var T=t.magnitudeSquared(t.subtract(E,s,g)),P=t.magnitudeSquared(t.subtract(I,c,g)),A=t.magnitudeSquared(t.subtract(R,h,g)),q=s,U=E,B=T;P>B&&(B=P,q=c,U=I),A>B&&(B=A,q=h,U=R);var L=w;L.x=.5*(q.x+U.x),L.y=.5*(q.y+U.y),L.z=.5*(q.z+U.z);var D=t.magnitudeSquared(t.subtract(U,L,g)),W=Math.sqrt(D),V=M;V.x=s.x,V.y=c.y,V.z=h.z;var k=z;k.x=E.x,k.y=I.y,k.z=R.z;var j=t.multiplyByScalar(t.add(V,k,g),.5,S),F=0;for(O=0;_>O;O+=a){u.x=e[O]+i.x,u.y=e[O+1]+i.y,u.z=e[O+2]+i.z;var Y=t.magnitude(t.subtract(u,j,g));Y>F&&(F=Y);var G=t.magnitudeSquared(t.subtract(u,L,g));if(G>D){var Z=Math.sqrt(G);W=.5*(W+Z),D=W*W;var H=Z-W;L.x=(W*L.x+H*u.x)/Z,L.y=(W*L.y+H*u.y)/Z,L.z=(W*L.z+H*u.z)/Z}}return F>W?(t.clone(L,o.center),o.radius=W):(t.clone(j,o.center),o.radius=F),o},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},l.clone=function(e,n){return r(e)?r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new l(e.center,e.radius):void 0},l.packedLength=4,l.pack=function(t,e,r){r=n(r,0);var i=t.center;e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius},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 N=new t,C=new t;l.union=function(e,n,i){r(i)||(i=new l);var a=e.center,o=n.center;t.add(a,o,C);var u=t.multiplyByScalar(C,.5,C),s=t.magnitude(t.subtract(a,u,N))+e.radius,c=t.magnitude(t.subtract(o,u,N))+n.radius;return i.radius=Math.max(s,c),t.clone(u,i.center),i};var T=new t;l.expand=function(e,n,r){r=l.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,T));return i>r.radius&&(r.radius=i),r},l.intersect=function(e,n){var r=e.center,i=e.radius,a=t.dot(n,r)+n.w;return-i>a?u.OUTSIDE:i>a?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 P=new t;l.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,P);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 A=new t;l.computePlaneDistances=function(e,n,i,a){r(a)||(a=new s);var o=t.subtract(e.center,n,A),u=t.multiplyByScalar(i,t.dot(i,o),A),c=t.magnitude(u);return a.start=c-e.radius,a.stop=c+e.radius,a};for(var q=new t,U=new t,B=new t,L=new t,D=new t,W=new e,V=new Array(8),k=0;8>k;++k)V[k]=new t;var j=new o;return l.projectTo2D=function(e,r,i){r=n(r,j);var a=r.ellipsoid,o=e.center,u=e.radius,s=a.geodeticSurfaceNormal(o,q),c=t.cross(t.UNIT_Z,s,U);t.normalize(c,c);var h=t.cross(s,c,B);t.normalize(h,h),t.multiplyByScalar(s,u,s),t.multiplyByScalar(h,u,h),t.multiplyByScalar(c,u,c);var f=t.negate(h,D),d=t.negate(c,L),m=V,p=m[0];t.add(s,h,p),t.add(p,c,p),p=m[1],t.add(s,h,p),t.add(p,d,p),p=m[2],t.add(s,f,p),t.add(p,d,p),p=m[3],t.add(s,f,p),t.add(p,c,p),t.negate(s,s),p=m[4],t.add(s,h,p),t.add(p,c,p),p=m[5],t.add(s,h,p),t.add(p,d,p),p=m[6],t.add(s,f,p),t.add(p,d,p),p=m[7],t.add(s,f,p),t.add(p,c,p);for(var y=m.length,x=0;y>x;++x){var v=m[x];t.add(o,v,v);var g=a.cartesianToCartographic(v,W);r.project(g,v)}i=l.fromPoints(m,i),o=i.center;var w=o.x,M=o.y,z=o.z;return o.x=z,o.y=w,o.z=M,i},l.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},l.prototype.intersect=function(t){return l.intersect(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/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r){var i=t.transformPositionToScaledSpace(n,m),a=e.magnitudeSquared(i),o=Math.sqrt(a),u=e.divideByScalar(i,o,p);a=Math.max(1,a),o=Math.max(1,o);var s=e.dot(u,r),c=e.magnitude(e.cross(u,r,u)),h=1/o,l=Math.sqrt(a-1)*h;return 1/(s*h-c*l)}function s(t,n,r){return 0>=n||n===1/0||n!==n?void 0:e.multiplyByScalar(t,n,r)}function c(t,n){return t.transformPositionToScaledSpace(n,y),e.normalize(y,y)}var h=function(t,n){this._ellipsoid=t,this._cameraPosition=new e,this._cameraPositionInScaledSpace=new e,this._distanceToLimbInScaledSpaceSquared=0,r(n)&&(this.cameraPosition=n)};i(h.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(t){var n=this._ellipsoid,r=n.transformPositionToScaledSpace(t,this._cameraPositionInScaledSpace),i=e.magnitudeSquared(r)-1;e.clone(t,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=i}}});var l=new e;h.prototype.isPointVisible=function(t){var e=this._ellipsoid,n=e.transformPositionToScaledSpace(t,l);return this.isScaledSpacePointVisible(n)},h.prototype.isScaledSpacePointVisible=function(t){var n=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,i=e.subtract(t,n,l),a=-e.dot(i,n),o=a>r&&a*a/e.magnitudeSquared(i)>r;return!o},h.prototype.computeHorizonCullingPoint=function(t,n,i){r(i)||(i=new e);for(var a=this._ellipsoid,o=c(a,t),h=0,l=0,f=n.length;f>l;++l){var d=n[l],m=u(a,d,o);h=Math.max(h,m)}return s(o,h,i)};var f=new e;h.prototype.computeHorizonCullingPointFromVertices=function(t,i,a,o,h){r(h)||(h=new e),o=n(o,e.ZERO);for(var l=this._ellipsoid,d=c(l,t),m=0,p=0,y=i.length;y>p;p+=a){f.x=i[p]+o.x,f.y=i[p+1]+o.y,f.z=i[p+2]+o.z;var x=u(l,f,d);m=Math.max(m,x)}return s(d,m,h)};var d=[];h.prototype.computeHorizonCullingPointFromRectangle=function(n,r,i){var a=o.subsample(n,r,0,d),u=t.fromPoints(a);return e.magnitude(u.center)<.1*r.minimumRadius?void 0:this.computeHorizonCullingPoint(u.center,a,i)};var m=new e,p=new e,y=new e;return h}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r){"use strict";var i={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};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,i){return t>r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(i)}),define("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(t,e){"use strict";var n={};return n.clipTriangleAtAxisAlignedThreshold=function(t,n,r,i,a,o){e(o)?o.length=0:o=[];var u,s,c;n?(u=t>r,s=t>i,c=t>a):(u=r>t,s=i>t,c=a>t);var h,l,f,d,m,p,y=u+s+c;return 1===y?u?(h=(t-r)/(i-r),l=(t-r)/(a-r),o.push(1),o.push(2),1!==l&&(o.push(-1),o.push(0),o.push(2),o.push(l)),1!==h&&(o.push(-1),o.push(0),o.push(1),o.push(h))):s?(f=(t-i)/(a-i),d=(t-i)/(r-i),o.push(2),o.push(0),1!==d&&(o.push(-1),o.push(1),o.push(0),o.push(d)),1!==f&&(o.push(-1),o.push(1),o.push(2),o.push(f))):c&&(m=(t-a)/(r-a),p=(t-a)/(i-a),o.push(0),o.push(1),1!==p&&(o.push(-1),o.push(2),o.push(1),o.push(p)),1!==m&&(o.push(-1),o.push(2),o.push(0),o.push(m))):2===y?u||r===t?s||i===t?c||a===t||(l=(t-r)/(a-r),f=(t-i)/(a-i),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(l),o.push(-1),o.push(1),o.push(2),o.push(f)):(p=(t-a)/(i-a),h=(t-r)/(i-r),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(p),o.push(-1),o.push(0),o.push(1),o.push(h)):(d=(t-i)/(r-i),m=(t-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(m)):3===y||(o.push(0),o.push(1),o.push(2)),o},n.computeBarycentricCoordinates=function(n,r,i,a,o,u,s,c,h){var l=i-s,f=s-o,d=u-c,m=a-c,p=1/(d*l+f*m),y=r-c,x=n-s,v=(d*x+f*y)*p,g=(-m*x+l*y)*p,w=1-v-g;return e(h)?(h.x=v,h.y=g,h.z=w,h):new t(v,g,w)},n}),define("Core/formatError",["./defined"],function(t){"use strict";var e=function(e){var n,r=e.name,i=e.message;n=t(r)&&t(i)?r+": "+i:e.toString();var a=e.stack;return t(a)&&(n+="\n"+a),n};return e}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(t,e,n){"use strict";var r=function(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(c){o.error=c instanceof Error?{name:c.name,message:c.message,stack:c.stack}:c}e(i)||(i=t(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(a.length=0);try{i(o,a)}catch(c){o.result=void 0,o.error="postMessage failed with error: "+n(c)+"\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","./createTaskProcessorWorker"],function(t,e,n,r,i,a,o,u,s,c,h,l){"use strict";function f(t,n){var i=t.isEastChild,l=t.isNorthChild,f=i?.5:0,m=i?1:.5,b=l?.5:0,N=l?1:.5,C=z,T=S,P=E,A=R;C.length=0,T.length=0,P.length=0,A.length=0;var q=I;q.length=0;var U,B,L,D,W={},V=t.vertices,k=t.encodedNormals,j=t.indices,F=V.length/3,Y=V.subarray(0,F),G=V.subarray(F,2*F),Z=V.subarray(2*F,3*F),H=0,X=a(k);for(U=0,B=0;F>U;++U,B+=2)L=Y[U]/y,D=G[U]/y,(i&&L>=.5||!i&&.5>=L)&&(l&&D>=.5||!l&&.5>=D)&&(W[U]=H,C.push(L),T.push(D),P.push(Z[U]),X&&(A.push(k[B]),A.push(k[B+1])),++H);var K=[];K.push(new d),K.push(new d),K.push(new d);var J=[];J.push(new d),J.push(new d),J.push(new d);var Q,$;for(U=0;U<j.length;U+=3){var te=j[U],ee=j[U+1],ne=j[U+2],re=Y[te]/y,ie=Y[ee]/y,ae=Y[ne]/y;K[0].initializeIndexed(Y,G,Z,k,te),K[1].initializeIndexed(Y,G,Z,k,ee),K[2].initializeIndexed(Y,G,Z,k,ne);var oe=c.clipTriangleAtAxisAlignedThreshold(.5,i,re,ie,ae,x);Q=0,Q>=oe.length||(Q=J[0].initializeFromClipResult(oe,Q,K),Q>=oe.length||(Q=J[1].initializeFromClipResult(oe,Q,K),Q>=oe.length||(Q=J[2].initializeFromClipResult(oe,Q,K),$=c.clipTriangleAtAxisAlignedThreshold(.5,l,J[0].getV(),J[1].getV(),J[2].getV(),v),p(C,T,P,A,q,W,$,J,X),Q<oe.length&&(J[2].clone(J[1]),J[2].initializeFromClipResult(oe,Q,K),$=c.clipTriangleAtAxisAlignedThreshold(.5,l,J[0].getV(),J[1].getV(),J[2].getV(),v),p(C,T,P,A,q,W,$,J,X)))))}var ue=i?-1:0,se=l?-1:0,ce=t.minimumHeight,he=t.maximumHeight,le=[],fe=[],de=[],me=[],pe=Number.MAX_VALUE,ye=-pe,xe=g;xe.length=0;var ve=o.clone(t.ellipsoid),ge=t.childRectangle;for(U=0;U<C.length;++U){L=C[U],f>=L?(le.push(U),L=0):L>=m?(de.push(U),L=1):L=2*L+ue,C[U]=L,D=T[U],b>=D?(fe.push(U),D=0):D>=N?(me.push(U),D=1):D=2*D+se,T[U]=D;var we=h.lerp(ce,he,P[U]/y);pe>we&&(pe=we),we>ye&&(ye=we),P[U]=we,w.longitude=h.lerp(ge.west,ge.east,L),w.latitude=h.lerp(ge.south,ge.north,D),w.height=we,ve.cartographicToCartesian(w,M),xe.push(M.x),xe.push(M.y),xe.push(M.z)}var Me=e.fromVertices(xe,r.ZERO,3,O),ze=new u(ve),Se=ze.computeHorizonCullingPointFromVertices(Me.center,xe,3,Me.center,_),Ee=ye-pe,Ie=new Uint16Array(C.length+T.length+P.length);for(U=0;U<C.length;++U)Ie[U]=C[U]*y;var Re=C.length;for(U=0;U<T.length;++U)Ie[Re+U]=T[U]*y;for(Re+=T.length,U=0;U<P.length;++U)Ie[Re+U]=y*(P[U]-pe)/Ee;var _e,Oe=s.createTypedArray(C.length,q);if(X){var be=new Uint8Array(A);n.push(Ie.buffer,Oe.buffer,be.buffer),_e=be.buffer}else n.push(Ie.buffer,Oe.buffer);return{vertices:Ie.buffer,encodedNormals:_e,indices:Oe.buffer,minimumHeight:pe,maximumHeight:ye,westIndices:le,southIndices:fe,eastIndices:de,northIndices:me,boundingSphere:Me,horizonOcclusionPoint:Se}}function d(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}function m(e,n){++N;var i=C[N],a=T[N];return i=t.octDecode(e.first.getNormalX(),e.first.getNormalY(),i),a=t.octDecode(e.second.getNormalX(),e.second.getNormalY(),a),M=r.lerp(i,a,e.ratio,M),r.normalize(M,M),t.octEncode(M,n),--N,n}function p(t,e,n,r,i,o,u,s,c){if(0!==u.length){for(var h=0,l=0;l<u.length;)l=P[h++].initializeFromClipResult(u,l,s);for(var f=0;h>f;++f){var d=P[f];if(d.isIndexed())d.newIndex=o[d.index],d.uBuffer=t,d.vBuffer=e,d.heightBuffer=n,c&&(d.normalBuffer=r);else{var m=d.getKey();if(a(o[m]))d.newIndex=o[m];else{var p=t.length;t.push(d.getU()),e.push(d.getV()),n.push(d.getH()),c&&(r.push(d.getNormalX()),r.push(d.getNormalY())),d.newIndex=p,o[m]=p}}}3===h?(i.push(P[0].newIndex),i.push(P[1].newIndex),i.push(P[2].newIndex)):4===h&&(i.push(P[0].newIndex),i.push(P[1].newIndex),i.push(P[2].newIndex),i.push(P[0].newIndex),i.push(P[2].newIndex),i.push(P[3].newIndex))}}var y=32767,x=[],v=[],g=[],w=new i,M=new r,z=[],S=[],E=[],I=[],R=[],_=new r,O=new e;d.prototype.clone=function(t){return a(t)||(t=new d),t.uBuffer=this.uBuffer,t.vBuffer=this.vBuffer,t.heightBuffer=this.heightBuffer,t.normalBuffer=this.normalBuffer,t.index=this.index,t.first=this.first,t.second=this.second,t.ratio=this.ratio,t},d.prototype.initializeIndexed=function(t,e,n,r,i){this.uBuffer=t,this.vBuffer=e,this.heightBuffer=n,this.normalBuffer=r,this.index=i,this.first=void 0,this.second=void 0,this.ratio=void 0},d.prototype.initializeInterpolated=function(t,e,n){this.vertexBuffer=void 0,this.index=void 0,this.newIndex=void 0,this.first=t,this.second=e,this.ratio=n},d.prototype.initializeFromClipResult=function(t,e,n){var r=e+1;return-1!==t[e]?n[t[e]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=n[t[r]],++r,this.second=n[t[r]],++r,this.ratio=t[r],++r),r},d.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})},d.prototype.isIndexed=function(){return a(this.index)},d.prototype.getH=function(){return a(this.index)?this.heightBuffer[this.index]:h.lerp(this.first.getH(),this.second.getH(),this.ratio)},d.prototype.getU=function(){return a(this.index)?this.uBuffer[this.index]/y:h.lerp(this.first.getU(),this.second.getU(),this.ratio)},d.prototype.getV=function(){return a(this.index)?this.vBuffer[this.index]/y:h.lerp(this.first.getV(),this.second.getV(),this.ratio)};var b=new n,N=-1,C=[new r,new r],T=[new r,new r];d.prototype.getNormalX=function(){return a(this.index)?this.normalBuffer[2*this.index]:(b=m(this,b),b.x) -},d.prototype.getNormalY=function(){return a(this.index)?this.normalBuffer[2*this.index+1]:(b=m(this,b),b.y)};var P=[];return P.push(new d),P.push(new d),P.push(new d),P.push(new d),l(f)})}(); \ No newline at end of file +/** + @license + when.js - https://github.com/cujojs/when + + MIT License (c) copyright B Cavalier & J Hann + + * A lightweight CommonJS Promises/A and when() implementation + * when is part of the cujo.js family of libraries (http://cujojs.com/) + * + * Licensed under the MIT License at: + * http://www.opensource.org/licenses/mit-license.php + * + * @version 1.7.1 + */ + +/** +@license +sprintf.js from the php.js project - https://github.com/kvz/phpjs +Directly from https://github.com/kvz/phpjs/blob/master/functions/strings/sprintf.js + +php.js is copyright 2012 Kevin van Zonneveld. + +Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld +(http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White +(http://getsprink.com), Waldo Malqui Silva, Paulo Freitas, Jack, Jonas +Raoni Soares Silva (http://www.jsfromhell.com), Philip Peterson, Legaev +Andrey, Ates Goral (http://magnetiq.com), Alex, Ratheous, Martijn Wieringa, +Rafa? Kukawski (http://blog.kukawski.pl), lmeyrick +(https://sourceforge.net/projects/bcmath-js/), Nate, Philippe Baumann, +Enrique Gonzalez, Webtoolkit.info (http://www.webtoolkit.info/), Carlos R. +L. Rodrigues (http://www.jsfromhell.com), Ash Searle +(http://hexmen.com/blog/), Jani Hartikainen, travc, Ole Vrijenhoek, +Erkekjetter, Michael Grier, Rafa? Kukawski (http://kukawski.pl), Johnny +Mast (http://www.phpvrouwen.nl), T.Wild, d3x, +http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript, +Rafa? Kukawski (http://blog.kukawski.pl/), stag019, pilus, WebDevHobo +(http://webdevhobo.blogspot.com/), marrtins, GeekFG +(http://geekfg.blogspot.com), Andrea Giammarchi +(http://webreflection.blogspot.com), Arpad Ray (mailto:arpad@php.net), +gorthaur, Paul Smith, Tim de Koning (http://www.kingsquare.nl), Joris, Oleg +Eremeev, Steve Hilder, majak, gettimeofday, KELAN, Josh Fraser +(http://onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/), +Marc Palau, Martin +(http://www.erlenwiese.de/), Breaking Par Consulting Inc +(http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256CFB006C45F7), +Chris, Mirek Slugen, saulius, Alfonso Jimenez +(http://www.alfonsojimenez.com), Diplom@t (http://difane.com/), felix, +Mailfaker (http://www.weedem.fr/), Tyler Akins (http://rumkin.com), Caio +Ariede (http://caioariede.com), Robin, Kankrelune +(http://www.webfaktory.info/), Karol Kowalski, Imgen Tata +(http://www.myipdf.com/), mdsjack (http://www.mdsjack.bo.it), Dreamer, +Felix Geisendoerfer (http://www.debuggable.com/felix), Lars Fischer, AJ, +David, Aman Gupta, Michael White, Public Domain +(http://www.json.org/json2.js), Steven Levithan +(http://blog.stevenlevithan.com), Sakimori, Pellentesque Malesuada, +Thunder.m, Dj (http://phpjs.org/functions/htmlentities:425#comment_134018), +Steve Clay, David James, Francois, class_exists, nobbler, T. Wild, Itsacon +(http://www.itsacon.net/), date, Ole Vrijenhoek (http://www.nervous.nl/), +Fox, Raphael (Ao RUDLER), Marco, noname, Mateusz "loonquawl" Zalega, Frank +Forte, Arno, ger, mktime, john (http://www.jd-tech.net), Nick Kolosov +(http://sammy.ru), marc andreu, Scott Cariss, Douglas Crockford +(http://javascript.crockford.com), madipta, Slawomir Kaniecki, +ReverseSyntax, Nathan, Alex Wilson, kenneth, Bayron Guevara, Adam Wallner +(http://web2.bitbaro.hu/), paulo kuong, jmweb, Lincoln Ramsay, djmix, +Pyerre, Jon Hohle, Thiago Mata (http://thiagomata.blog.com), lmeyrick +(https://sourceforge.net/projects/bcmath-js/this.), Linuxworld, duncan, +Gilbert, Sanjoy Roy, Shingo, sankai, Oskar Larsson H?gfeldt +(http://oskar-lh.name/), Denny Wardhana, 0m3r, Everlasto, Subhasis Deb, +josh, jd, Pier Paolo Ramon (http://www.mastersoup.com/), P, merabi, Soren +Hansen, Eugene Bulkin (http://doubleaw.com/), Der Simon +(http://innerdom.sourceforge.net/), echo is bad, Ozh, XoraX +(http://www.xorax.info), EdorFaus, JB, J A R, Marc Jansen, Francesco, LH, +Stoyan Kyosev (http://www.svest.org/), nord_ua, omid +(http://phpjs.org/functions/380:380#comment_137122), Brad Touesnard, MeEtc +(http://yass.meetcweb.com), Peter-Paul Koch +(http://www.quirksmode.org/js/beat.html), Olivier Louvignes +(http://mg-crea.com/), T0bsn, Tim Wiel, Bryan Elliott, Jalal Berrami, +Martin, JT, David Randall, Thomas Beaucourt (http://www.webapp.fr), taith, +vlado houba, Pierre-Luc Paour, Kristof Coomans (SCK-CEN Belgian Nucleair +Research Centre), Martin Pool, Kirk Strobeck, Rick Waldron, Brant Messenger +(http://www.brantmessenger.com/), Devan Penner-Woelk, Saulo Vallory, Wagner +B. Soares, Artur Tchernychev, Valentina De Rosa, Jason Wong +(http://carrot.org/), Christoph, Daniel Esteban, strftime, Mick@el, rezna, +Simon Willison (http://simonwillison.net), Anton Ongson, Gabriel Paderni, +Marco van Oort, penutbutterjelly, Philipp Lenssen, Bjorn Roesbeke +(http://www.bjornroesbeke.be/), Bug?, Eric Nagel, Tomasz Wesolowski, +Evertjan Garretsen, Bobby Drake, Blues (http://tech.bluesmoon.info/), Luke +Godfrey, Pul, uestla, Alan C, Ulrich, Rafal Kukawski, Yves Sucaet, +sowberry, Norman "zEh" Fuchs, hitwork, Zahlii, johnrembo, Nick Callen, +Steven Levithan (stevenlevithan.com), ejsanders, Scott Baker, Brian Tafoya +(http://www.premasolutions.com/), Philippe Jausions +(http://pear.php.net/user/jausions), Aidan Lister +(http://aidanlister.com/), Rob, e-mike, HKM, ChaosNo1, metjay, strcasecmp, +strcmp, Taras Bogach, jpfle, Alexander Ermolaev +(http://snippets.dzone.com/user/AlexanderErmolaev), DxGx, kilops, Orlando, +dptr1988, Le Torbi, James (http://www.james-bell.co.uk/), Pedro Tainha +(http://www.pedrotainha.com), James, Arnout Kazemier +(http://www.3rd-Eden.com), Chris McMacken, gabriel paderni, Yannoo, +FGFEmperor, baris ozdil, Tod Gentille, Greg Frazier, jakes, 3D-GRAF, Allan +Jensen (http://www.winternet.no), Howard Yeend, Benjamin Lupton, davook, +daniel airton wermann (http://wermann.com.br), Atli T¨®r, Maximusya, Ryan +W Tenney (http://ryan.10e.us), Alexander M Beedie, fearphage +(http://http/my.opera.com/fearphage/), Nathan Sepulveda, Victor, Matteo, +Billy, stensi, Cord, Manish, T.J. Leahy, Riddler +(http://www.frontierwebdev.com/), Rafa? Kukawski, FremyCompany, Matt +Bradley, Tim de Koning, Luis Salazar (http://www.freaky-media.com/), Diogo +Resende, Rival, Andrej Pavlovic, Garagoth, Le Torbi +(http://www.letorbi.de/), Dino, Josep Sanz (http://www.ws3.es/), rem, +Russell Walker (http://www.nbill.co.uk/), Jamie Beck +(http://www.terabit.ca/), setcookie, Michael, YUI Library: +http://developer.yahoo.com/yui/docs/YAHOO.util.DateLocale.html, Blues at +http://hacks.bluesmoon.info/strftime/strftime.js, Ben +(http://benblume.co.uk/), DtTvB +(http://dt.in.th/2008-09-16.string-length-in-bytes.html), Andreas, William, +meo, incidence, Cagri Ekin, Amirouche, Amir Habibi +(http://www.residence-mixte.com/), Luke Smith (http://lucassmith.name), +Kheang Hok Chin (http://www.distantia.ca/), Jay Klehr, Lorenzo Pisani, +Tony, Yen-Wei Liu, Greenseed, mk.keck, Leslie Hoare, dude, booeyOH, Ben +Bryan + +Licensed under the MIT (MIT-LICENSE.txt) license. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL KEVIN VAN ZONNEVELD BE LIABLE FOR ANY CLAIM, DAMAGES +OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. +*/ + +/** + * @license + * + * Grauw URI utilities + * + * See: http://hg.grauw.nl/grauw-lib/file/tip/src/uri.js + * + * @author Laurens Holst (http://www.grauw.nl/) + * + * Copyright 2012 Laurens Holst + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var 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:0>e?-1:0},i.signNotZero=function(e){return 0>e?-1:1},i.toSNorm=function(e){return Math.round(255*(.5*i.clamp(e,-1,1)+.5))},i.fromSNorm=function(e){return i.clamp(e,0,255)/255*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.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 i>=a||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;e>=r;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 t>e?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){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new a(e.x,e.y):void 0},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},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.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.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/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}a.fromSpherical=function(n,r){t(r)||(r=new a);var i=n.clock,o=n.cone,u=e(n.magnitude,1),s=u*Math.sin(o);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(o),r},a.fromElements=function(e,n,r,i){return t(i)?(i.x=e,i.y=n,i.z=r,i):new a(e,n,r)},a.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new a(e.x,e.y,e.z):void 0},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},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},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,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},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},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 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},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},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},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},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*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},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var u=new a;a.lerp=function(e,t,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){a.normalize(e,s),a.normalize(t,c);var n=a.dot(s,c),r=a.magnitude(a.cross(s,c,s));return Math.atan2(r,n)};var l=new a;a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,l);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):n.y<=n.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,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},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},a.equalsEpsilon=function(e,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)},a.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,h=r*u-i*o;return n.x=c,n.y=l,n.z=h,n},a.fromDegrees=function(e,t,n,r,o){var u=i.toRadians(e),s=i.toRadians(t);return a.fromRadians(u,s,n,r,o)};var h=new a,d=new a,f=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(n,r,i,o,u){i=e(i,0);var s=t(o)?o.radiiSquared:f,c=Math.cos(r);h.x=c*Math.cos(n),h.y=c*Math.sin(n),h.z=Math.sin(r),h=a.normalize(h,h),a.multiplyComponents(s,h,d);var l=Math.sqrt(a.dot(h,d));return d=a.divideByScalar(d,l,d),h=a.multiplyByScalar(h,i,h),t(u)||(u=new a),a.add(d,h,u)},a.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=i.toRadians(e[o]);return a.fromRadiansArray(r,t,n)},a.fromRadiansArray=function(e,n,r){var i=e.length;t(r)?r.length=i/2:r=new Array(i/2);for(var o=0;i>o;o+=2){var u=e[o],s=e[o+1];r[o/2]=a.fromRadians(u,s,0,n,r[o/2])}return r},a.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=i.toRadians(e[o]),r[o+1]=i.toRadians(e[o+1]),r[o+2]=e[o+2];return a.fromRadiansArrayHeights(r,t,n)},a.fromRadiansArrayHeights=function(e,n,r){var i=e.length;t(r)?r.length=i/3:r=new Array(i/3);for(var o=0;i>o;o+=3){var u=e[o],s=e[o+1],c=e[o+2];r[o/3]=a.fromRadians(u,s,c,n,r[o/3])}return r},a.ZERO=r(new a(0,0,0)),a.UNIT_X=r(new a(1,0,0)),a.UNIT_Y=r(new a(0,1,0)),a.UNIT_Z=r(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,i){"use strict";var a={};a.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=t.x,r=t.y;t.x=(1-Math.abs(r))*i.signNotZero(n),t.y=(1-Math.abs(n))*i.signNotZero(r)}return t.x=i.toSNorm(t.x),t.y=i.toSNorm(t.y),t},a.octDecode=function(e,n,r){if(r.x=i.fromSNorm(e),r.y=i.fromSNorm(n),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){var a=r.x;r.x=(1-Math.abs(r.y))*i.signNotZero(a),r.y=(1-Math.abs(a))*i.signNotZero(r.y)}return t.normalize(r,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 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=1===e.x?4095:4096*e.x|0,n=1===e.y?4095:4096*e.y|0;return 4096*t+n},a.decompressTextureCoordinates=function(e,t){var n=e/4096;return t.x=Math.floor(n)/4096,t.y=n-Math.floor(n),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,h=n.y,d=n.z,f=i.x,E=i.y,m=i.z,_=l*l*f*f,p=h*h*E*E,y=d*d*m*m,R=_+p+y,T=Math.sqrt(1/R),S=e.multiplyByScalar(n,T,a);if(s>R)return isFinite(T)?e.clone(S,c):void 0;var A=u.x,N=u.y,M=u.z,I=o;I.x=S.x*A*2,I.y=S.y*N*2,I.z=S.z*M*2;var v,O,g,x,w,C,P,U,D,L,F,B=(1-T)*e.magnitude(n)/(.5*e.magnitude(I)),z=0;do{B-=z,g=1/(1+B*A),x=1/(1+B*N),w=1/(1+B*M),C=g*g,P=x*x,U=w*w,D=C*g,L=P*x,F=U*w,v=_*C+p*P+y*U-1,O=_*D*A+p*L*N+y*F*M;var b=-2*O;z=v/b}while(Math.abs(v)>r.EPSILON12);return t(c)?(c.x=l*g,c.y=h*x,c.z=d*w,c):new e(l*g,h*x,d*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,h=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),f=a.EPSILON1;return u.fromCartesian=function(t,r,i){var E=n(r)?r.oneOverRadii:h,m=n(r)?r.oneOverRadiiSquared:d,_=n(r)?r._centerToleranceSquared:f,p=o(t,E,m,_,c);if(n(p)){var y=e.multiplyComponents(t,m,s);y=e.normalize(y,y);var R=e.subtract(t,p,l),T=Math.atan2(y.y,y.x),S=Math.asin(y.z),A=a.sign(e.dot(R,t))*e.magnitude(R);return n(i)?(i.longitude=T,i.latitude=S,i.height=A,i):new u(T,S,A)}},u.clone=function(e,t){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},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}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,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){i=n(i,0),e.pack(t._radii,r,i)},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 h=new e,d=new e;l.prototype.cartographicToCartesian=function(t,n){var i=h,a=d;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;n>i;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var f=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,f),s=e.subtract(n,a,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),h=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=c,i.latitude=l,i.height=h,i):new t(c,l,h)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;n>i;++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}),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","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(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 u(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;3>n;++n){var r=e[o.getElementIndex(f[n],d[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=a.EPSILON15,r=0,i=1,u=0;3>u;++u){var s=Math.abs(e[o.getElementIndex(f[u],d[u])]);s>r&&(i=u,r=s)}var c=1,l=0,h=d[i],E=f[i];if(Math.abs(e[o.getElementIndex(E,h)])>n){var m,_=e[o.getElementIndex(E,E)],p=e[o.getElementIndex(h,h)],y=e[o.getElementIndex(E,h)],R=(_-p)/2/y;m=0>R?-1/(-R+Math.sqrt(1+R*R)):1/(R+Math.sqrt(1+R*R)),c=1/Math.sqrt(1+m*m),l=m*c}return t=o.clone(o.IDENTITY,t),t[o.getElementIndex(h,h)]=t[o.getElementIndex(E,E)]=c,t[o.getElementIndex(E,h)]=l,t[o.getElementIndex(h,E)]=-l,t}o.packedLength=9,o.pack=function(e,n,r){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]},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[4]=e[r++],i[5]=e[r++],i[6]=e[r++],i[7]=e[r++],i[8]=e[r++],i},o.clone=function(e,t){return n(e)?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 o(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},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[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},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[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 o(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},o.fromQuaternion=function(e,t){var r=e.x*e.x,i=e.x*e.y,a=e.x*e.z,u=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,h=e.z*e.z,d=e.z*e.w,f=e.w*e.w,E=r-s-h+f,m=2*(i-d),_=2*(a+l),p=2*(i+d),y=-r+s-h+f,R=2*(c-u),T=2*(a-l),S=2*(c+u),A=-r-s+h+f;return n(t)?(t[0]=E,t[1]=p,t[2]=T,t[3]=m,t[4]=y,t[5]=S,t[6]=_,t[7]=R,t[8]=A,t):new o(E,m,_,p,y,R,T,S,A)},o.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 o(e.x,0,0,0,e.y,0,0,0,e.z)},o.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 o(e,0,0,0,e,0,0,0,e)},o.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 o(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},o.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 o(1,0,0,0,r,-i,0,i,r)},o.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 o(r,0,i,0,1,0,-i,0,r)},o.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 o(r,-i,0,i,r,0,0,0,1)},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[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]]},o.getElementIndex=function(e,t){return 3*e+t},o.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},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},o.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},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;o.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 h=new e;o.getMaximumScale=function(t){return o.getScale(t,h),e.maximumComponent(h)},o.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],h=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]=h,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[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},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[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},o.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},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[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},o.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},o.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},o.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],f=[2,2,1],E=new o,m=new o;return o.computeEigenDecomposition=function(e,t){var r=a.EPSILON20,i=10,l=0,h=0;n(t)||(t={});for(var d=t.unitary=o.clone(o.IDENTITY,t.unitary),f=t.diagonal=o.clone(e,t.diagonal),_=r*u(f);i>h&&s(f)>_;)c(f,E),o.transpose(E,m),o.multiply(f,E,f),o.multiply(m,f,f),o.multiply(d,E,d),++l>2&&(++h,l=0);return 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[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},o.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)},o.inverse=function(e,t){var n=e[0],i=e[1],u=e[2],s=e[3],c=e[4],l=e[5],h=e[6],d=e[7],f=e[8],E=o.determinant(e);if(Math.abs(E)<=a.EPSILON15)throw new r("matrix is not invertible");t[0]=c*f-d*l,t[1]=d*u-i*f,t[2]=i*l-c*u,t[3]=h*l-s*f,t[4]=n*f-h*u,t[5]=s*u-n*l,t[6]=s*d-h*c,t[7]=h*i-n*d,t[8]=n*c-s*i;var m=1/E;return o.multiplyByScalar(t,m,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]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},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&&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},o.IDENTITY=i(new o(1,0,0,0,1,0,0,0,1)),o.ZERO=i(new o(0,0,0,0,0,0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN0ROW2=2,o.COLUMN1ROW0=3,o.COLUMN1ROW1=4,o.COLUMN1ROW2=5,o.COLUMN2ROW0=6,o.COLUMN2ROW1=7,o.COLUMN2ROW2=8,o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},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]&&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]},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},o}),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){return t(e)?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):void 0},a.packedLength=4,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},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.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.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(n){t=n.stack}this.stack=t}return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s){"use strict";function c(e,t,r,i,a,o,u,s,c,l,h,d,f,E,m,_){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(l,0),this[7]=n(E,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(h,0),this[11]=n(m,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(d,0),this[15]=n(_,0)}c.packedLength=16,c.pack=function(e,t,r){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]},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){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new 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]):void 0},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,l=t.x*t.y,h=t.x*t.z,d=t.x*t.w,f=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,R=s-f-_+y,T=2*(l-p),S=2*(h+m),A=2*(l+p),N=-s+f-_+y,M=2*(E-d),I=2*(h-m),v=2*(E+d),O=-s-f+_+y;return i[0]=R*a,i[1]=A*a,i[2]=I*a,i[3]=0,i[4]=T*o,i[5]=N*o,i[6]=v*o,i[7]=0,i[8]=S*u,i[9]=M*u,i[10]=O*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(u.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 l=new e,h=new e,d=new e;c.fromCamera=function(t,n){var i=t.eye,a=t.target,o=t.up;e.normalize(e.subtract(a,i,l),l),e.normalize(e.cross(l,o,h),h),e.normalize(e.cross(h,l,d),d);var u=h.x,s=h.y,f=h.z,E=l.x,m=l.y,_=l.z,p=d.x,y=d.y,R=d.z,T=i.x,S=i.y,A=i.z,N=u*-T+s*-S+f*-A,M=p*-T+y*-S+R*-A,I=E*T+m*S+_*A;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]=f,n[9]=R,n[10]=-_,n[11]=0,n[12]=N,n[13]=M,n[14]=I,n[15]=1,n):new c(u,s,f,N,p,y,R,M,-E,-m,-_,I,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),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},c.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,h=-(r+n)*s,d=-(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]=h,o[14]=d,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),c=(t+e)/(t-e),l=(r+n)/(r-n),h=-(a+i)/(a-i),d=-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]=l,o[10]=h,o[11]=d,o[12]=0,o[13]=0,o[14]=f,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),c=(r+n)/(r-n),l=-1,h=-1,d=-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]=h,a[12]=0,a[13]=0,a[14]=d,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 c=.5*u,l=.5*s,h=.5*(r-t),d=c,f=l,E=h,m=a+c,_=o+l,p=t+h,y=1;return i[0]=d,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]=E,i[11]=0,i[12]=m,i[13]=_,i[14]=p,i[15]=y,i},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 f=new e;c.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 E=new e;c.getMaximumScale=function(t){return c.getScale(t,E),e.maximumComponent(E)},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],c=e[6],l=e[7],h=e[8],d=e[9],f=e[10],E=e[11],m=e[12],_=e[13],p=e[14],y=e[15],R=t[0],T=t[1],S=t[2],A=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*R+u*T+h*S+m*A,F=i*R+s*T+d*S+_*A,B=a*R+c*T+f*S+p*A,z=o*R+l*T+E*S+y*A,b=r*N+u*M+h*I+m*v,q=i*N+s*M+d*I+_*v,G=a*N+c*M+f*I+p*v,W=o*N+l*M+E*I+y*v,X=r*O+u*g+h*x+m*w,V=i*O+s*g+d*x+_*w,H=a*O+c*g+f*x+p*w,Y=o*O+l*g+E*x+y*w,Z=r*C+u*P+h*U+m*D,k=i*C+s*P+d*U+_*D,j=a*C+c*P+f*U+p*D,K=o*C+l*P+E*U+y*D;return n[0]=L,n[1]=F,n[2]=B,n[3]=z,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]=Z,n[13]=k,n[14]=j,n[15]=K,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],c=e[8],l=e[9],h=e[10],d=e[12],f=e[13],E=e[14],m=t[0],_=t[1],p=t[2],y=t[4],R=t[5],T=t[6],S=t[8],A=t[9],N=t[10],M=t[12],I=t[13],v=t[14],O=r*m+o*_+c*p,g=i*m+u*_+l*p,x=a*m+s*_+h*p,w=r*y+o*R+c*T,C=i*y+u*R+l*T,P=a*y+s*R+h*T,U=r*S+o*A+c*N,D=i*S+u*A+l*N,L=a*S+s*A+h*N,F=r*M+o*I+c*v+d,B=i*M+u*I+l*v+f,z=a*M+s*I+h*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]=B,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],c=e[8],l=e[9],h=e[10],d=t[0],f=t[1],E=t[2],m=t[3],_=t[4],p=t[5],y=t[6],R=t[7],T=t[8],S=r*d+o*f+c*E,A=i*d+u*f+l*E,N=a*d+s*f+h*E,M=r*m+o*_+c*p,I=i*m+u*_+l*p,v=a*m+s*_+h*p,O=r*y+o*R+c*T,g=i*y+u*R+l*T,x=a*y+s*R+h*T;return n[0]=S,n[1]=A,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},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 m=new e;c.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,c.multiplyByScale(e,m,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,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},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 _=new u,p=new u,y=new t,R=new t(0,0,0,1);return c.inverse=function(e,n){if(u.equalsEpsilon(c.getRotation(e,_),p,o.EPSILON7)&&t.equals(c.getRow(e,3,y),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],l=e[12],h=e[1],d=e[5],f=e[9],E=e[13],m=e[2],T=e[6],S=e[10],A=e[14],N=e[3],M=e[7],I=e[11],v=e[15],O=S*v,g=A*I,x=T*v,w=A*M,C=T*I,P=S*M,U=m*v,D=A*N,L=m*I,F=S*N,B=m*M,z=T*N,b=O*d+w*f+C*E-(g*d+x*f+P*E),q=g*h+U*f+F*E-(O*h+D*f+L*E),G=x*h+D*d+B*E-(w*h+U*d+z*E),W=P*h+L*d+z*f-(C*h+F*d+B*f),X=g*i+x*a+P*l-(O*i+w*a+C*l),V=O*r+D*a+L*l-(g*r+U*a+F*l),H=w*r+U*i+z*l-(x*r+D*i+B*l),Y=C*r+F*i+B*a-(P*r+L*i+z*a);O=a*E,g=l*f,x=i*E,w=l*d,C=i*f,P=a*d,U=r*E,D=l*h,L=r*f,F=a*h,B=r*d,z=i*h;var Z=O*M+w*I+C*v-(g*M+x*I+P*v),k=g*N+U*I+F*v-(O*N+D*I+L*v),j=x*N+D*M+B*v-(w*N+U*M+z*v),K=P*N+L*M+z*I-(C*N+F*M+B*I),J=x*S+P*A+g*T-(C*A+O*T+w*S),Q=L*A+O*m+D*S-(U*S+F*A+g*m),$=U*T+z*A+w*m-(B*A+x*m+D*T),ee=B*S+C*m+F*T-(L*T+z*S+P*m),te=r*b+i*q+a*G+l*W;if(Math.abs(te)<o.EPSILON20)throw new s("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]=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},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],c=e[9],l=e[10],h=e[12],d=e[13],f=e[14],E=-n*h-r*d-i*f,m=-a*h-o*d-u*f,_=-s*h-c*d-l*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]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=_,t[15]=1,t},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=a(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,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/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}),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){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},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 n>t&&(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,h=0,d=e.length;d>h;h++){var f=e[h];r=Math.min(r,f.longitude),i=Math.max(i,f.longitude),c=Math.min(c,f.latitude),l=Math.max(l,f.latitude);var E=f.longitude>=0?f.longitude:f.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.clone=function(e,t){return n(e)?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):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,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;a>i&&(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;a>i&&o>0?i+=u.TWO_PI:c>o&&i>0&&(o+=u.TWO_PI),a>i&&0>c?c+=u.TWO_PI:c>o&&0>a&&(a+=u.TWO_PI);var l=u.negativePiToPi(Math.max(a,c)),h=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&l>=h)){var d=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(d>=f))return n(r)?(r.west=l,r.south=d,r.east=h,r.north=f,r):new s(l,d,h,f)}},s.union=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.west),r.south=Math.min(e.south,t.south),r.east=Math.max(e.east,t.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 i>a&&(a+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(a>n||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,h=e.north,d=e.south,f=e.east,E=e.west,m=c;m.height=i,m.longitude=E,m.latitude=h,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=f,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++,0>h?m.latitude=h: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=f,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","./Plane","./Rectangle"],function(e,t,n,r,i,a,o,u,s,c,l,h,d){"use strict";function f(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var E=new e,m=new e,_=new e,p=new e,y=new e,R=new e,T=new e,S=new e,A=new e,N=new e,M=new e,I=new e;f.fromPoints=function(t,n){if(r(n)||(n=new f),!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,m),u=e.clone(i,_),s=e.clone(i,p),c=e.clone(i,y),l=e.clone(i,R),h=t.length,d=1;h>d;d++){e.clone(t[d],i);var v=i.x,O=i.y,g=i.z;v<a.x&&e.clone(i,a),v>s.x&&e.clone(i,s),O<o.y&&e.clone(i,o),O>c.y&&e.clone(i,c),g<u.z&&e.clone(i,u),g>l.z&&e.clone(i,l)}var x=e.magnitudeSquared(e.subtract(s,a,S)),w=e.magnitudeSquared(e.subtract(c,o,S)),C=e.magnitudeSquared(e.subtract(l,u,S)),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,S)),B=Math.sqrt(F),z=N;z.x=a.x,z.y=o.y,z.z=u.z;var b=M;b.x=s.x,b.y=c.y,b.z=l.z;var q=e.multiplyByScalar(e.add(z,b,S),.5,I),G=0;for(d=0;h>d;d++){e.clone(t[d],i);var W=e.magnitude(e.subtract(i,q,S));W>G&&(G=W);var X=e.magnitudeSquared(e.subtract(i,L,S));if(X>F){var V=Math.sqrt(X);B=.5*(B+V),F=B*B;var H=V-B;L.x=(B*L.x+H*i.x)/V,L.y=(B*L.y+H*i.y)/V,L.z=(B*L.z+H*i.z)/V}}return G>B?(e.clone(L,n.center),n.radius=B):(e.clone(q,n.center),n.radius=G),n};var v=new o,O=new e,g=new e,x=new t,w=new t;f.fromRectangle2D=function(e,t,n){return f.fromRectangleWithHeights2D(e,t,0,0,n)},f.fromRectangleWithHeights2D=function(t,i,a,o,u){if(r(u)||(u=new f),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=n(i,v),d.southwest(t,x),x.height=a,d.northeast(t,w),w.height=o;var s=i.project(x,O),c=i.project(w,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 C=[];f.fromRectangle3D=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0);var u;return r(e)&&(u=d.subsample(e,t,i,C)),f.fromPoints(u,o)},f.fromVertices=function(t,i,a,o){if(r(o)||(o=new f),!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,m),l=e.clone(u,_),h=e.clone(u,p),d=e.clone(u,y),v=e.clone(u,R),O=t.length,g=0;O>g;g+=a){var x=t[g]+i.x,w=t[g+1]+i.y,C=t[g+2]+i.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>h.x&&e.clone(u,h),w<c.y&&e.clone(u,c),w>d.y&&e.clone(u,d),C<l.z&&e.clone(u,l),C>v.z&&e.clone(u,v)}var P=e.magnitudeSquared(e.subtract(h,s,S)),U=e.magnitudeSquared(e.subtract(d,c,S)),D=e.magnitudeSquared(e.subtract(v,l,S)),L=s,F=h,B=P;U>B&&(B=U,L=c,F=d),D>B&&(B=D,L=l,F=v);var z=A;z.x=.5*(L.x+F.x),z.y=.5*(L.y+F.y),z.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,z,S)),q=Math.sqrt(b),G=N;G.x=s.x,G.y=c.y,G.z=l.z;var W=M;W.x=h.x,W.y=d.y,W.z=v.z;var X=e.multiplyByScalar(e.add(G,W,S),.5,I),V=0;for(g=0;O>g;g+=a){u.x=t[g]+i.x,u.y=t[g+1]+i.y,u.z=t[g+2]+i.z;var H=e.magnitude(e.subtract(u,X,S));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,z,S));if(Y>b){var Z=Math.sqrt(Y);q=.5*(q+Z),b=q*q;var k=Z-q;z.x=(q*z.x+k*u.x)/Z,z.y=(q*z.y+k*u.y)/Z,z.z=(q*z.z+k*u.z)/Z}}return V>q?(e.clone(z,o.center),o.radius=q):(e.clone(X,o.center),o.radius=V),o},f.fromEncodedCartesianVertices=function(t,n,i){if(r(i)||(i=new f),!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,m),s=e.clone(a,_),c=e.clone(a,p),l=e.clone(a,y),h=e.clone(a,R),d=t.length,v=0;d>v;v+=3){var O=t[v]+n[v],g=t[v+1]+n[v+1],x=t[v+2]+n[v+2];a.x=O,a.y=g,a.z=x,O<o.x&&e.clone(a,o),O>c.x&&e.clone(a,c),g<u.y&&e.clone(a,u),g>l.y&&e.clone(a,l),x<s.z&&e.clone(a,s),x>h.z&&e.clone(a,h)}var w=e.magnitudeSquared(e.subtract(c,o,S)),C=e.magnitudeSquared(e.subtract(l,u,S)),P=e.magnitudeSquared(e.subtract(h,s,S)),U=o,D=c,L=w;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=h);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 B=e.magnitudeSquared(e.subtract(D,F,S)),z=Math.sqrt(B),b=N;b.x=o.x,b.y=u.y,b.z=s.z;var q=M;q.x=c.x,q.y=l.y,q.z=h.z;var G=e.multiplyByScalar(e.add(b,q,S),.5,I),W=0;for(v=0;d>v;v+=3){a.x=t[v]+n[v],a.y=t[v+1]+n[v+1],a.z=t[v+2]+n[v+2];var X=e.magnitude(e.subtract(a,G,S));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(a,F,S));if(V>B){var H=Math.sqrt(V);z=.5*(z+H),B=z*z;var Y=H-z;F.x=(z*F.x+Y*a.x)/H,F.y=(z*F.y+Y*a.y)/H,F.z=(z*F.z+Y*a.z)/H}}return W>z?(e.clone(F,i.center),i.radius=z):(e.clone(G,i.center),i.radius=W),i},f.fromCornerPoints=function(t,n,i){r(i)||(i=new f);var a=i.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,n),i},f.fromEllipsoid=function(t,n){return r(n)||(n=new f),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var P=new e;f.fromBoundingSpheres=function(t,n){if(r(n)||(n=new f),!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 f.clone(t[0],n);if(2===i)return f.union(t[0],t[1],n);for(var a=[],o=0;i>o;o++)a.push(t[o].center);n=f.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;i>o;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return n.radius=s,n};var U=new e,D=new e,L=new e;f.fromOrientedBoundingBox=function(t,n){r(n)||(n=new f);var i=t.halfAxes,a=c.getColumn(i,0,U),o=c.getColumn(i,1,D),u=c.getColumn(i,2,L),s=e.magnitude(a),l=e.magnitude(o),h=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,h),n},f.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new f(t.center,t.radius):void 0},f.packedLength=4,f.pack=function(e,t,r){r=n(r,0);var i=e.center;t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius},f.unpack=function(e,t,i){t=n(t,0),r(i)||(i=new f);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;f.union=function(t,n,i){r(i)||(i=new f);var a=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,a,F),l=e.magnitude(c);if(o>=l+s)return t.clone(i),i;if(s>=l+o)return n.clone(i),i;var h=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+h)/l,B);return e.add(d,a,d),e.clone(d,i.center),i.radius=h,i};var z=new e;f.expand=function(t,n,r){r=f.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,z));return i>r.radius&&(r.radius=i),r},f.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return-i>o?u.OUTSIDE:i>o?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,n){return r(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 r(n)||(n=new f),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var q=new e;f.computePlaneDistances=function(t,n,i,a){r(a)||(a=new s);var o=e.subtract(t.center,n,q),u=e.dot(i,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var G=new e,W=new e,X=new e,V=new e,H=new e,Y=new t,Z=new Array(8),k=0;8>k;++k)Z[k]=new e;var j=new o;return f.projectTo2D=function(t,r,i){r=n(r,j);var a=r.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,W);e.normalize(c,c);var l=e.cross(s,c,X);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var h=e.negate(l,H),d=e.negate(c,V),E=Z,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,h,m),e.add(m,d,m),m=E[3],e.add(s,h,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,h,m),e.add(m,d,m),m=E[7],e.add(s,h,m),e.add(m,c,m);for(var _=E.length,p=0;_>p;++p){var y=E[p];e.add(o,y,y);var R=a.cartesianToCartographic(y,Y);r.project(R,y)}i=f.fromPoints(E,i),o=i.center;var T=o.x,S=o.y,A=o.z;return o.x=A,o.y=T,o.z=S,i},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,n){return t===n||r(t)&&r(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/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,h=Math.sqrt(a-1)*l;return 1/(s*l-c*h)}function c(e,n,r){return 0>=n||n===1/0||n!==n?void 0:t.multiplyByScalar(e,n,r)}function l(e,n){return e.transformPositionToScaledSpace(n,_),t.normalize(_,_)}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 h=new t;u.prototype.isPointVisible=function(e){var t=this._ellipsoid,n=t.transformPositionToScaledSpace(e,h);return this.isScaledSpacePointVisible(n)},u.prototype.isScaledSpacePointVisible=function(e){var n=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,i=t.subtract(e,n,h),a=-t.dot(i,n),o=0>r?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,h=0,d=n.length;d>h;++h){var f=n[h],E=s(a,f,o);u=Math.max(u,E)}return c(o,u,i)};var d=new t;u.prototype.computeHorizonCullingPointFromVertices=function(e,i,a,o,u){r(u)||(u=new t),o=n(o,t.ZERO);for(var h=this._ellipsoid,f=l(h,e),E=0,m=0,_=i.length;_>m;m+=a){d.x=i[m]+o.x,d.y=i[m+1]+o.y,d.z=i[m+2]+o.z;var p=s(h,d,f);E=Math.max(E,p)}return c(f,E,u)},u.prototype.computeHorizonCullingPointFromPoints=function(e,n,i){r(i)||(i=new t);for(var a=this._ellipsoid,o=l(a,e),u=0,h=0,d=n.length;d>h;++h){var f=s(a,n[h],o);u=Math.max(u,f)}return c(o,u,i)};var f=[];u.prototype.computeHorizonCullingPointFromRectangle=function(n,r,i){var a=o.subsample(n,r,0,f),u=e.fromPoints(a);return t.magnitude(u.center)<.1*r.minimumRadius?void 0:this.computeHorizonCullingPoint(u.center,a,i)};var E=new t,m=new t,_=new t;return u}),define("Renderer/WebGLConstants",["../Core/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",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.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(e){return t(e)&&(e===a.UNSIGNED_BYTE||e===a.UNSIGNED_SHORT||e===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,r){return e>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,r):new Uint16Array(t,n,r)},r(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=e>r,s=e>i,c=e>a):(u=r>e,s=i>e,c=a>e);var l,h,d,f,E,m,_=u+s+c;return 1===_?u?(l=(e-r)/(i-r),h=(e-r)/(a-r),o.push(1),o.push(2),1!==h&&(o.push(-1),o.push(0),o.push(2),o.push(h)),1!==l&&(o.push(-1),o.push(0),o.push(1),o.push(l))):s?(d=(e-i)/(a-i),f=(e-i)/(r-i),o.push(2),o.push(0),1!==f&&(o.push(-1),o.push(1),o.push(0),o.push(f)),1!==d&&(o.push(-1),o.push(1),o.push(2),o.push(d))):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===_?u||r===e?s||i===e?c||a===e||(h=(e-r)/(a-r),d=(e-i)/(a-i),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(h),o.push(-1),o.push(1),o.push(2),o.push(d)):(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)):(f=(e-i)/(r-i),E=(e-a)/(r-a),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(f),o.push(-1),o.push(2),o.push(0),o.push(E)):3!==_&&(o.push(0),o.push(1),o.push(2)),o},r.computeBarycentricCoordinates=function(n,r,i,a,o,u,s,c,l){var h=i-s,d=s-o,f=u-c,E=a-c,m=1/(f*h+d*E),_=r-c,p=n-s,y=(f*p+d*_)*m,R=(-E*p+h*_)*m,T=1-y-R;return t(l)?(l.x=y,l.y=R,l.z=T,l):new e(y,R,T)},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,h=t.length,d=1;h>d;d++){var f=t[d],E=f.x,m=f.y,_=f.z;i=Math.min(E,i),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=i,p.y=o,p.z=u;var y=r.maximum;y.x=s,y.y=c,y.z=l;var R=e.add(p,y,r.center);return e.multiplyByScalar(R,.5,R),r},a.clone=function(t,r){return n(t)?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):void 0},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:0>s+u?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(u>o&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(a=-i/e,0>a)return[];var s=Math.sqrt(a);return[-s,s]}if(0===i)return a=-r/e,0>a?[a,0]:[0,a];var c=r*r,l=4*e*i,h=n(c,-l,t.EPSILON14);if(0>h)return[];var d=-.5*n(r,t.sign(r)*Math.sqrt(h),t.EPSILON14);return r>0?[d/e,i/d]:[i/d,d/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,h=u*c,d=u*u,f=s*s,E=o*s-d,m=o*c-u*s,_=u*c-f,p=4*E*_-m*m;if(0>p){var y,R,T;d*h>=l*f?(y=o,R=E,T=-2*u*E+o*m):(y=c,R=_,T=-c*m+2*s*_);var S=0>T?-1:1,A=-S*Math.abs(y)*Math.sqrt(-p);a=-T+A;var N=a/2,M=0>N?-Math.pow(-N,1/3):Math.pow(N,1/3),I=a===A?-M:-R/M;return i=0>=R?M+I:-T/(M*M+I*I+R),d*h>=l*f?[(i-u)/o]:[-c/(i+s)]}var v=E,O=-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,-O)/3);i=2*Math.sqrt(-v);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,B=L/F;P=Math.abs(Math.atan2(c*w,-x)/3),i=2*Math.sqrt(-g),U=Math.cos(P),a=i*U,D=i*(-U/2-C*Math.sin(P));var z=-c,b=2*s>a+D?a+s:D+s,q=z/b,G=F*b,W=-L*b-F*z,X=L*z,V=(s*W-u*X)/(-u*W+s*G);return V>=B?q>=B?q>=V?[B,V,q]:[B,q,V]:[q,B,V]:q>=B?[V,B,q]:q>=V?[V,q,B]:[q,V,B]}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=0>u?-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,0>u?[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,h=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(h.length>0){var d=-t/4,f=h[h.length-1];if(Math.abs(f)<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(_),R=Math.sqrt(p);return[d-R,d-y,d+y,d+R]}if(_>=0&&0>p)return m=Math.sqrt(_),[d-m,d+m];if(0>_&&p>=0)return m=Math.sqrt(p),[d-m,d+m]}return[]}if(f>0){var T=Math.sqrt(f),S=(s+f-c/T)/2,A=(s+f+c/T)/2,N=r.computeRealRoots(1,T,S),M=r.computeRealRoots(1,-T,A);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 a(t,i,a,o){var u=a*a,s=i*i,c=t*t,l=-2*i,h=a*t+s-4*o,d=c*o-a*i*t+u,f=e.computeRealRoots(1,l,h,d);if(f.length>0){var E,m,_=f[0],p=i-_,y=p*p,R=t/2,T=p/2,S=y-4*o,A=y+4*Math.abs(o),N=c-4*_,M=c+4*Math.abs(_);if(0>_||N*A>S*M){var I=Math.sqrt(N);E=I/2,m=0===I?0:(t*T-a)/I}else{var v=Math.sqrt(S);E=0===v?0:(t*T-a)/v,m=v/2}var O,g;0===R&&0===E?(O=0,g=0):n.sign(R)===n.sign(E)?(O=R+E,g=_/O):(g=R-E,O=_/g);var x,w;0===T&&0===m?(x=0,w=0):n.sign(T)===n.sign(m)?(x=T+m,w=o/x):(w=T-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,i){var a=e*e,o=a*e,u=t*t,s=u*t,c=n*n,l=c*n,h=r*r,d=h*r,f=i*i,E=f*i,m=u*c*h-4*s*d-4*e*l*h+18*e*t*n*d-27*a*h*h+256*o*E+i*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*h+144*a*n*h)+f*(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,h=u/t,d=s/t,f=0>c?1:0;switch(f+=0>l?f+1:f,f+=0>h?f+1:f,f+=0>d?f+1:f){case 0:return i(c,l,h,d);case 1:return a(c,l,h,d);case 2:return a(c,l,h,d);case 3:return i(c,l,h,d);case 4:return i(c,l,h,d);case 5:return a(c,l,h,d);case 6:return i(c,l,h,d);case 7:return i(c,l,h,d);case 8:return a(c,l,h,d);case 9:return i(c,l,h,d);case 10:return i(c,l,h,d);case 11:return a(c,l,h,d);case 12:return i(c,l,h,d);case 13:return i(c,l,h,d);case 14:return i(c,l,h,d);case 15:return i(c,l,h,d);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(t,r,i,o,u){u=n(u,!1);var s,c,l,h,d,f=t.origin,E=t.direction,m=e.subtract(i,r,_),S=e.subtract(o,r,p),A=e.cross(E,S,y),N=e.dot(m,A);if(u){if(N<a.EPSILON6)return;if(s=e.subtract(f,r,R),l=e.dot(s,A),0>l||l>N)return;if(c=e.cross(s,m,T),h=e.dot(E,c),0>h||l+h>N)return;d=e.dot(S,c)/N}else{if(Math.abs(N)<a.EPSILON6)return;var M=1/N;if(s=e.subtract(f,r,R),l=e.dot(s,A)*M,0>l||l>1)return;if(c=e.cross(s,m,T),h=e.dot(E,c)*M,0>h||l+h>1)return;d=e.dot(S,c)*M}return d}function h(e,t,n,r){var i=t*t-4*e*n;if(!(0>i)){if(i>0){var a=1/(2*e),o=Math.sqrt(i),u=(-t+o)*a,s=(-t-o)*a;return s>u?(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,i){r(i)||(i={});var a=t.origin,o=t.direction,u=n.center,s=n.radius*n.radius,c=e.subtract(a,u,y),l=e.dot(o,o),d=2*e.dot(o,c),f=e.magnitudeSquared(c)-s,E=h(l,d,f,A);return r(E)?(i.start=E.root0,i.stop=E.root1,i):void 0}function f(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,h=i*i,d=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*d,m=c*(i*f(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],a.EPSILON15)+n.y),_=t[o.COLUMN0ROW0]*h+t[o.COLUMN2ROW2]*d+i*n.x+r,p=d*f(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],a.EPSILON15),y=c*(i*f(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),R=[];if(0===y&&0===p){if(l=u.computeRealRoots(E,m,_),0===l.length)return R;var T=l[0],S=Math.sqrt(Math.max(1-T*T,0));if(R.push(new e(i,c*T,c*-S)),R.push(new e(i,c*T,c*S)),2===l.length){var A=l[1],N=Math.sqrt(Math.max(1-A*A,0));R.push(new e(i,c*A,c*-N)),R.push(new e(i,c*A,c*N))}return R}var M=y*y,I=p*p,v=E*E,O=y*p,g=v+I,x=2*(m*E+O),w=2*_*E+m*m-I+M,C=2*(_*m-O),P=_*_-M;if(0===g&&0===x&&0===w&&0===C)return R;l=s.computeRealRoots(g,x,w,C,P);var U=l.length;if(0===U)return R;for(var D=0;U>D;++D){var L,F=l[D],B=F*F,z=Math.max(1-B,0),b=Math.sqrt(z);L=a.sign(E)===a.sign(_)?f(E*B+_,m*F,a.EPSILON12):a.sign(_)===a.sign(m*F)?f(E*B,m*F+_,a.EPSILON12):f(E*B+m*F,_,a.EPSILON12);var q=f(p*F,y,a.EPSILON15),G=L*q;0>G?R.push(new e(i,c*F,c*b)):G>0?R.push(new e(i,c*F,c*-b)):0!==b?(R.push(new e(i,c*F,c*-b)),R.push(new e(i,c*F,c*b)),++D):R.push(new e(i,c*F,c*b))}return R}var m={};m.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(!(0>l))return i=e.multiplyByScalar(u,l,i),e.add(o,i,i)}};var _=new e,p=new e,y=new e,R=new e,T=new e;m.rayTriangle=function(t,n,i,a,o,u){var s=l(t,n,i,a,o);if(r(s)&&!(0>s))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var S=new c;m.lineSegmentTriangle=function(t,n,i,a,o,u,s){var c=S;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var h=l(c,i,a,o,u);return!r(h)||0>h||h>e.distance(t,n)?void 0:(r(s)||(s=new e),e.multiplyByScalar(c.direction,h,s),e.add(c.origin,s,s))};var A={root0:0,root1:0};m.raySphere=function(e,t,n){return n=d(e,t,n),!r(n)||n.stop<0?void 0:(n.start=Math.max(n.start,0),n)};var N=new c;m.lineSegmentSphere=function(t,n,i,a){var o=N,u=e.subtract(n,t,o.direction),s=e.magnitude(u);return e.normalize(u,u),a=d(o,i,a),!r(a)||a.stop<0||a.start>s?void 0:(a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a)};var M=new e,I=new e;m.rayEllipsoid=function(t,n){var r,i,a,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,M),l=e.multiplyComponents(s,t.direction,I),h=e.magnitudeSquared(c),d=e.dot(c,l);if(h>1){if(d>=0)return;var f=d*d;if(r=h-1,i=e.magnitudeSquared(l),a=i*r,a>f)return;if(f>a){o=d*d-a,u=-d+Math.sqrt(o);var E=u/i,m=r/u;return m>E?{start:E,stop:m}:{start:m,stop:E}}var _=Math.sqrt(r/i);return{start:_,stop:_}}return 1>h?(r=h-1,i=e.magnitudeSquared(l),a=i*r,o=d*d-a,u=-d+Math.sqrt(o),{start:0,stop:u/i}):0>d?(i=e.magnitudeSquared(l),{start:0,stop:-d/i}):void 0};var v=new e,O=new e,g=new e,x=new e,w=new e,C=new o,P=new o,U=new o,D=new o,L=new o,F=new o,B=new o,z=new e,b=new e,q=new t;m.grazingAltitudeLocation=function(t,n){var i=t.origin,u=t.direction,s=n.geodeticSurfaceNormal(i,v);if(e.dot(u,s)>=0)return i;var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u,v),h=e.normalize(l,l),d=e.mostOrthogonalAxis(l,x),f=e.normalize(e.cross(d,h,O),O),m=e.normalize(e.cross(h,f,g),g),_=C;_[0]=h.x,_[1]=h.y,_[2]=h.z,_[3]=f.x,_[4]=f.y,_[5]=f.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var p=o.transpose(_,P),y=o.fromScale(n.radii,U),R=o.fromScale(n.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 S,A,N=o.multiply(o.multiply(p,R,F),T,F),M=o.multiply(o.multiply(N,y,B),_,B),I=o.multiplyByVector(N,i,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;W>H;++H){S=o.multiplyByVector(y,o.multiplyByVector(_,G[H],z),z);var Y=e.normalize(e.subtract(S,i,x),x),Z=e.dot(Y,u);Z>V&&(V=Z,X=e.clone(S,X))}var k=n.cartesianToCartographic(X,q);return V=a.clamp(V,0,1),A=e.magnitude(e.subtract(X,i,x))*Math.sqrt(1-V*V),A=c?-A:A,k.height=A,n.cartographicToCartesian(k,new e)}};var G=new e;return m.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),h=-(i.distance+l)/c;if(!(0>h||h>1))return e.multiplyByScalar(u,h,o),e.add(t,o,o),o}},m.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 h,d;if((1===l||2===l)&&(h=new e,d=new e),1===l){if(u)return m.lineSegmentPlane(t,n,i,h),m.lineSegmentPlane(t,r,i,d),{positions:[t,n,r,h,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,i,h),m.lineSegmentPlane(n,t,i,d),{positions:[t,n,r,h,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,i,h),m.lineSegmentPlane(r,n,i,d),{positions:[t,n,r,h,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,i,h),m.lineSegmentPlane(r,t,i,d),{positions:[t,n,r,h,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,i,h),m.lineSegmentPlane(t,n,i,d),{positions:[t,n,r,h,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,i,h),m.lineSegmentPlane(n,r,i,d),{positions:[t,n,r,h,d],indices:[0,1,4,0,4,3,2,3,4]}}},m}),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(r){return a(r)}});return n}function a(e){var n=new r(function(n,r){try{return r?t(r(e)):a(e)}catch(i){return a(i)}});return n}function o(){function e(e,t,n){return d(e,t,n)}function n(e){return E(e)}function i(e){return E(a(e))}function u(e){return f(e)}var s,c,l,h,d,f,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=[],h=[],d=function(e,t,n){var r,i;return r=o(),i="function"==typeof n?function(e){try{r.progress(n(e))}catch(t){r.progress(t)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,i)}),h.push(i),r.promise},f=function(e){return m(h,e),e},E=function(e){return e=t(e),d=e.then,E=t,f=p,m(l,e),h=l=S,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){E(e)}var c,l,h,d,f,E,m,_,y,R;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),h=[],l=y-c+1,d=[],f=o(),c)for(_=f.progress,m=function(e){d.push(e),--l||(E=m=p,f.reject(d))},E=function(e){h.push(e),--c||(E=m=p,f.resolve(h))},R=0;y>R;++R)R in t&&e(t[R],s,u,_);else f.resolve(h);return f.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),d(e,y).then(t,n,r)}function h(){return d(arguments,y)}function d(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;i>s;s++)s in t?u(t[s],s):--a;else c.resolve(r);return c.promise})}function f(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)})})},R.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 _(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 R,T,S;return e.defer=o,e.resolve=t,e.reject=n,e.join=h,e.all=l,e.map=d,e.reduce=f,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(S,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(S,t)})})}},T=[].slice,R=[].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(;i>a;++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;o>=a;)if(r=~~((a+o)/2),i=n(e[r],t),0>i)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,h,d){var f,E,m,_,p;if("%%"==e)return"%";for(var y=!1,R="",T=!1,S=!1,A=" ",N=s.length,M=0;s&&N>M;M++)switch(s.charAt(M)){case" ":R=" ";break;case"+":R="+";break;case"-":y=!0;break;case"'":A=s.charAt(M+1);break;case"0":T=!0;break;case"#":S=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(h=h?"*"==h?+t[n++]:"*"==h.charAt(0)?+t[h.slice(1,-1)]:+h:"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,h,T,A);case"c":return u(String.fromCharCode(+p),y,c,h,T);case"b":return o(p,2,S,y,c,h,T);case"o":return o(p,8,S,y,c,h,T);case"x":return o(p,16,S,y,c,h,T);case"X":return o(p,16,S,y,c,h,T).toUpperCase();case"u":return o(p,10,S,y,c,h,T);case"i":case"d":return f=+p||0,f=Math.round(f-f%1),E=0>f?"-":R,p=E+i(String(Math.abs(f)),h,"0",!1),a(p,E,y,c,T);case"e":case"E":case"f":case"F":case"g":case"G":return f=+p,E=0>f?"-":R,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],p=E+Math.abs(f)[m](h),a(p,E,y,c,T)[_]();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 h(e){R.julianDate=e;var n=m.leapSeconds,r=t(n,R,l);0>r&&(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 d(e,n){R.julianDate=e;var r=m.leapSeconds,i=t(r,R,l);if(0>i&&(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):1>=a?void 0:m.addSeconds(e,-r[--i].offset,n)}function f(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,0>t&&(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,0>r&&(r+=24);var h=a+(r*s.SECONDS_PER_HOUR+i*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return h>=43200&&(l-=1),[l,h]}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,f(i,t,this),r===c.UTC&&h(this)}var _=new a,p=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,R=new u,T=/^(\d{4})$/,S=/^(\d{4})-(\d{2})$/,A=/^(\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,x="Invalid ISO 8601 date.";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)?(f(n[0],n[1],t),h(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,u,s=e.split("T"),l=1,d=1,_=0,R=0,I=0,w=0,C=s[0],P=s[1];if(!r(C))throw new i(x);var U;if(s=C.match(M),null!==s){if(U=C.split("-").length-1,U>0&&2!==U)throw new i(x);n=+s[1],l=+s[2],d=+s[3]}else if(s=C.match(S),null!==s)n=+s[1],l=+s[2];else if(s=C.match(T),null!==s)n=+s[1];else{var D;if(s=C.match(A),null!==s){if(n=+s[1],D=+s[2],u=o(n),1>D||u&&D>366||!u&&D>365)throw new i(x)}else{if(s=C.match(N),null===s)throw new i(x);n=+s[1];var L=+s[2],F=+s[3]||0;if(U=C.split("-").length-1,U>0&&(!r(s[3])&&1!==U||r(s[3])&&2!==U))throw new i(x);var B=new Date(Date.UTC(n,0,4));D=7*L+F-B.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(D),l=a.getUTCMonth()+1,d=a.getUTCDate()}if(u=o(n),1>l||l>12||1>d||(2!==l||!u)&&d>p[l-1]||u&&2===l&&d>y)throw new i(x);var z;if(r(P)){if(s=P.match(g),null!==s){if(U=P.split(":").length-1,U>0&&2!==U&&3!==U)throw new i(x);_=+s[1],R=+s[2],I=+s[3],w=1e3*+(s[4]||0),z=5}else if(s=P.match(O),null!==s){if(U=P.split(":").length-1,U>2)throw new i(x);_=+s[1],R=+s[2],I=60*+(s[3]||0),z=4}else{if(s=P.match(v),null===s)throw new i(x);_=+s[1],R=60*+(s[2]||0),z=3}if(R>=60||I>=61||_>24||24===_&&(R>0||I>0||w>0))throw new i(x);var b=s[z],q=+s[z+1],G=+(s[z+2]||0);switch(b){case"+":_-=q,R-=G;break;case"-":_+=q,R+=G;break;case"Z":break;default:R+=new Date(Date.UTC(n,l-1,d,_,R)).getTimezoneOffset()}}else R+=new Date(n,l-1,d).getTimezoneOffset();var W=60===I;for(W&&I--;R>=60;)R-=60,_++;for(;_>=24;)_-=24,d++;for(a=u&&2===l?y:p[l-1];d>a;)d-=a,l++,l>12&&(l-=12,n++),a=u&&2===l?y:p[l-1];for(;0>R;)R+=60,_--;for(;0>_;)_+=24,d--;for(;1>d;)l--,1>l&&(l+=12,n--),a=u&&2===l?y:p[l-1],d+=a;var X=E(n,l,d,_,R,I,w);return r(t)?(f(X[0],X[1],t),h(t)):t=new m(X[0],X[1],c.UTC),W&&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,i=d(e,w);r(i)||(m.addSeconds(e,-1,w),i=d(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 h=4e3*(c+1)/1461001|0;c=c-(1461*h/4|0)+31|0;var f=80*c/2447|0,E=c-(2447*f/80|0)|0;c=f/11|0;var _=f+2-12*c|0,p=100*(l-49)+h+c|0,y=u/s.SECONDS_PER_HOUR|0,R=u-y*s.SECONDS_PER_HOUR,T=R/s.SECONDS_PER_MINUTE|0;R-=T*s.SECONDS_PER_MINUTE;var S=0|R,A=(R-S)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(S+=1),r(t)?(t.year=p,t.month=_,t.day=E,t.hour=y,t.minute=T,t.second=S,t.millisecond=A,t.isLeapSecond=n,t):new a(p,_,E,y,T,S,A,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){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI):void 0},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){R.julianDate=e;var n=m.leapSeconds,r=t(n,R,l);return 0>r&&(r=~r,--r,0>r&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return f(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return f(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return f(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return f(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)],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("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError"],function(e,t,n,r,i,a){"use strict";function o(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,i=t(n.method,"GET"),a=n.data,u=n.headers,s=n.overrideMimeType,c=n.withCredentials;return e(n.url,function(t){var n=e.defer();return o.load(t,r,i,a,u,n,s,c),n.promise})}function u(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function s(e,t){for(var n=u(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 c(e,n){n=t(n,"");var i=e[1],a=!!e[2],o=e[3];switch(n){case"":case"text":return u(a,o);case"arraybuffer":return s(a,o);case"blob":var c=s(a,o);return new Blob([c],{type:i});case"document":var l=new DOMParser;return l.parseFromString(u(a,o),i);case"json":return JSON.parse(u(a,o));default:throw new r("Unhandled responseType: "+n)}}var l=/^data:(.*?)(;base64)?,(.*)$/;return o.load=function(e,t,r,o,u,s,h,d){var f=l.exec(e);if(null!==f)return void s.resolve(c(f,t));var E=new XMLHttpRequest;if(n(h)&&n(E.overrideMimeType)&&E.overrideMimeType(h),E.open(r,e,!0),n(u))for(var m in u)u.hasOwnProperty(m)&&E.setRequestHeader(m,u[m]);n(t)&&(E.responseType=t),n(d)&&(E.withCredentials=d),E.onload=function(){E.status>=200&&E.status<300?n(E.response)?s.resolve(E.response):n(E.responseXML)&&E.responseXML.hasChildNodes()?s.resolve(E.responseXML):n(E.responseText)?s.resolve(E.responseText):s.reject(new a("unknown XMLHttpRequest response type.")):s.reject(new i(E.status,E.response,E.getAllResponseHeaders()))},E.onerror=function(e){s.reject(new i)},E.send(o)},o.defaultLoad=o.load,o}),define("Core/loadText",["./loadWithXhr","./defined"],function(e,t){"use strict";function n(n,r){return e({url:n,headers:t(r)?r.headers:void 0,overrideMimeType:t(r)?r.overrideMimeType:void 0,withCredentials:t(r)?r.withCredentials:void 0})}return n}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function i(n,i){return t(i)||(i={}),t(i.headers)?t(i.headers.Accept)||(i.headers=e(i.headers),i.headers.Accept=a.Accept):i.headers=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,h){"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 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 f(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"),d=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(0>i||0>a||0>s||0>c||0>d||0>E||0>m)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=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,R=e._addNewLeapSeconds,T=0,S=_.length;S>T;T+=e._columnCount){var A=_[T+i],N=_[T+m],M=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(M,N,h.TAI);if(p.push(I),R){if(N!==y&&r(y)){var v=o.leapSeconds,O=t(v,I,f);if(0>O){var g=new u(I,N);v.splice(~O,0,g)}}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 _(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 h=o.secondsDifference(r,c)/o.secondsDifference(l,c),d=i*s,f=a*s,E=n[d+e._ut1MinusUtcSecondsColumn],p=n[f+e._ut1MinusUtcSecondsColumn],y=p-E;if(y>.5||-.5>y){var R=n[d+e._taiMinusUtcSecondsColumn],T=n[f+e._taiMinusUtcSecondsColumn];R!==T&&(l.equals(r)?E=p:p-=T-R)}return u.xPoleWander=_(h,n[d+e._xPoleWanderRadiansColumn],n[f+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(h,n[d+e._yPoleWanderRadiansColumn],n[f+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(h,n[d+e._xCelestialPoleOffsetRadiansColumn],n[f+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(h,n[d+e._yCelestialPoleOffsetRadiansColumn],n[f+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(h,E,p),u}return d.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}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.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 h=a[u],d=a[u+1],f=o.lessThanOrEquals(h,e),E=!r(d),m=E||o.greaterThanOrEquals(d,e);if(f&&m)return s=u,!E&&d.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,0>s&&(s=0)),this._lastIndex=s,p(this,a,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},d}),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/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/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","require"],function(e,t,n,r,i){"use strict";function a(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),i=f.exec(r);if(null!==i)return i[1]}}function o(){if(t(l))return l;var i;if(i="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:a(),!t(i))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return l=new e(r(i))}function u(e){return i.toUrl("../"+e)}function s(t){return new e(t).resolve(o()).toString()}function c(e){t(h)||(h=t(i.toUrl)?u:s),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var l,h,d,f=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=f,c.setBaseUrl=function(t){l=new e(t).resolve(new e(document.location.href))},c}),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;t>=s;++s){r[s]=o,i[s]=s*this._stepSizeDays;for(var c=0;t>=c;++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=h;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;s>u;++u)t[o+u]=r[u];a.resolve()}),a.promise}var h=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;0>u&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var h=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,f=[],E=h;d>=E;++E)f.push(l(this,E));return e.all(f)},s.prototype.computeXysRadians=function(e,t,n){var a=c(this,e,t);if(!(0>a)){var o=a/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);0>s&&(s=0);var h=s+u;h>=this._totalSamples&&(h=this._totalSamples-1,s=h-u,0>s&&(s=0));var d=!1,f=this._samples;if(r(f[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),r(f[3*h])||(l(this,h/this._samplesPerXysFile|0),d=!0),!d){r(n)?(n.x=0,n.y=0,n.s=0):n=new i(0,0,0);var E,m,_=a-s*this._stepSizeDays,p=this._work,y=this._denominators,R=this._coef,T=this._xTable;for(E=0;u>=E;++E)p[E]=_-T[E];for(E=0;u>=E;++E){for(R[E]=1,m=0;u>=m;++m)m!==E&&(R[E]*=p[m]);R[E]*=y[E];var S=3*(s+E);n.x+=R[E]*f[S++],n.y+=R[E]*f[S++],n.s+=R[E]*f[S]}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(){return i.supportsFullscreen()?document[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return i.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return i.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return i.supportsFullscreen()?null!==i.element:void 0}}}),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;u>o;++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",e(document[i])?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",e(document[i])&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",e(document[i])?r.fullscreenElement=i:(i=s+"FullScreenElement",e(document[i])&&(r.fullscreenElement=i)),i=s+"fullscreenchange",e(document["on"+i])&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",e(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;r>n;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(R)){R=!1;var e=/ Chrome\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(R=!0,T=r(e[1]))}return R}function a(){return i()&&T}function o(){if(!t(S)&&(S=!1,!i()&&/ Safari\/[\.0-9]+/.test(y.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(S=!0,A=r(e[1]))}return S}function u(){return o()&&A}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(y.userAgent);null!==e&&(N=!0,M=r(e[1]),M.isNightly=!!e[2])}return N}function c(){return s()&&M}function l(){if(!t(I)){I=!1;var e;"Microsoft Internet Explorer"===y.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(y.userAgent),null!==e&&(I=!0,v=r(e[1]))):"Netscape"===y.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(y.userAgent),null!==e&&(I=!0,v=r(e[1])))}return I}function h(){return l()&&v}function d(){if(!t(O)){O=!1;var e=/Firefox\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(O=!0,g=r(e[1]))}return O}function f(){return t(x)||(x=/Windows/i.test(y.appVersion)),x}function E(){return d()&&g}function m(){return t(w)||(w="undefined"!=typeof PointerEvent&&(!t(y.pointerEnabled)||y.pointerEnabled)),w}function _(){if(!t(P)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;P=t(n)&&""!==n,P&&(C=n)}return P}function p(){return _()?C:void 0}var y;y="undefined"!=typeof navigator?navigator:{};var R,T,S,A,N,M,I,v,O,g,x,w,C,P,U={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:h,isFirefox:d,firefoxVersion:E,isWindows:f,hardwareConcurrency:e(y.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:_,imageRenderingValue:p};return U.supportsFullscreen=function(){return n.supportsFullscreen()},U.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},U.supportsWebWorkers=function(){return"undefined"!=typeof Worker},U}),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,h=c.z*o,d=Math.cos(a);return n(i)?(i.x=u,i.y=l,i.z=h,i.w=d,i):new s(u,l,h,d)};var l=[1,2,0],h=new Array(3);s.fromRotationMatrix=function(e,t){var r,i,a,o,c,d=e[u.COLUMN0ROW0],f=e[u.COLUMN1ROW1],E=e[u.COLUMN2ROW2],m=d+f+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 _=l,p=0;f>d&&(p=1),E>d&&E>f&&(p=2);var y=_[p],R=_[y];r=Math.sqrt(e[u.getElementIndex(p,p)]-e[u.getElementIndex(y,y)]-e[u.getElementIndex(R,R)]+1);var T=h;T[p]=.5*r,r=.5/r,c=(e[u.getElementIndex(R,y)]-e[u.getElementIndex(y,R)])*r,T[y]=(e[u.getElementIndex(y,p)]+e[u.getElementIndex(p,y)])*r,T[R]=(e[u.getElementIndex(R,p)]+e[u.getElementIndex(p,R)])*r,i=-T[0],a=-T[1],o=-T[2]}return n(t)?(t.x=i,t.y=a,t.z=o,t.w=c,t):new s(i,a,o,c)};var d=new s;s.fromHeadingPitchRoll=function(t,n,r,i){var a=s.fromAxisAngle(e.UNIT_X,r,d),o=s.fromAxisAngle(e.UNIT_Y,-n,i);i=s.multiply(o,a,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,d);return s.multiply(u,i,i)};var f=new e,E=new e,m=new s,_=new s,p=new s;s.packedLength=4,s.pack=function(e,n,r){r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w},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;a>i;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,f);var u=s.computeAngle(m);r[o]=f.x*u,r[o+1]=f.y*u,r[o+2]=f.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,_),0===u?s.clone(s.IDENTITY,m):s.fromAxisAngle(E,u,m),s.multiply(m,_,o)},s.clone=function(e,t){return n(e)?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):void 0},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,h=o*u+r*l+i*c-a*s,d=o*s-r*c+i*l+a*u,f=o*c+r*s-i*u+a*l,E=o*l-r*u-i*s-a*c;return n.x=h,n.y=d,n.z=f,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 R=new s,T=new s,S=new s;s.slerp=function(e,t,n,r){var i=s.dot(e,t),a=t;if(0>i&&(i=-i,a=R=s.negate(t,R)),1-i<o.EPSILON6)return s.lerp(e,a,n,r);var u=Math.acos(i);return T=s.multiplyByScalar(e,Math.sin((1-n)*u),T),S=s.multiplyByScalar(a,Math.sin(n*u),S),r=s.add(T,S,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 A=new e,N=new e,M=new s,I=new s;s.computeInnerQuadrangle=function(t,n,r,i){var a=s.conjugate(n,M);s.multiply(a,r,I);var o=s.log(I,A);s.multiply(a,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,i)},s.squad=function(e,t,n,r,i,a){var o=s.slerp(e,t,i,M),u=s.slerp(n,r,i,I);return s.slerp(o,u,2*i*(1-i),a)};for(var v=new s,O=1.9011074535173003,g=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;7>P;++P){var U=P+1,D=2*U+1;g[P]=1/(U*D),x[P]=U/D}return g[7]=O/136,x[7]=8*O/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,h=7;h>=0;--h)w[h]=(g[h]*c-x[h])*o,C[h]=(g[h]*l-x[h])*o;var d=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])))))))),f=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,f,v);return s.multiplyByScalar(t,d,r),s.add(E,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,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","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,i,a,o,u,s,c,l,h,d,f,E,m,_,p){"use strict";var y={},R=new n,T=new n,S=new n;y.eastNorthUpToFixedFrame=function(e,t,r){if(f.equalsEpsilon(e.x,0,f.EPSILON14)&&f.equalsEpsilon(e.y,0,f.EPSILON14)){var o=f.sign(e.z);return a(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var u=R,s=T,l=S;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),a(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.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 m(s.x,l.x,u.x,e.x,s.y,l.y,u.y,e.y,s.z,l.z,u.z,e.z,0,0,0,1)};var A=new n,N=new n,M=new n;y.northEastDownToFixedFrame=function(e,t,r){if(f.equalsEpsilon(e.x,0,f.EPSILON14)&&f.equalsEpsilon(e.y,0,f.EPSILON14)){var o=f.sign(e.z);return a(r)?(r[0]=-o,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]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var u=A,s=N,l=M;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),a(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.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 m(l.x,s.x,-u.x,e.x,l.y,s.y,-u.y,e.y,l.z,s.z,-u.z,e.z,0,0,0,1)},y.northUpEastToFixedFrame=function(e,t,r){if(f.equalsEpsilon(e.x,0,f.EPSILON14)&&f.equalsEpsilon(e.y,0,f.EPSILON14)){var o=f.sign(e.z);return a(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=o,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(-o,0,0,e.x,0,0,1,e.y,0,o,0,e.z,0,0,0,1)}var u=R,s=T,l=S;return t=i(t,c.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,l),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 m(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 I=new _,v=new n(1,1,1),O=new m;y.headingPitchRollToFixedFrame=function(e,t,r,i,a,o){var u=_.fromHeadingPitchRoll(t,r,i,I),s=m.fromTranslationQuaternionRotationScale(n.ZERO,u,v,O);return o=y.eastNorthUpToFixedFrame(e,a,o),m.multiply(o,s,o)};var g=new m,x=new E;y.headingPitchRollQuaternion=function(e,t,n,r,i,a){var o=y.headingPitchRollToFixedFrame(e,t,n,r,i,g),u=m.getRotation(o,x);return _.fromRotationMatrix(u,a)};var w=24110.54841,C=8640184.812866,P=.093104,U=-62e-7,D=1.1772758384668e-19,L=72921158553e-15,F=f.TWO_PI/86400,B=new d;y.computeTemeToPseudoFixedMatrix=function(e,t){B=d.addSeconds(e,-d.computeTaiMinusUtc(e),B);var n,r=B.dayNumber,i=B.secondsOfDay,o=r-2451545;n=i>=43200?(o+.5)/p.DAYS_PER_JULIAN_CENTURY:(o-.5)/p.DAYS_PER_JULIAN_CENTURY;var u=w+n*(C+n*(P+n*U)),s=u*F%f.TWO_PI,c=L+D*(r-2451545.5),l=(i+.5*p.SECONDS_PER_DAY)%p.SECONDS_PER_DAY,h=s+c*l,m=Math.cos(h),_=Math.sin(h);return a(t)?(t[0]=m,t[1]=-_,t[2]=0,t[3]=_,t[4]=m,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(m,_,0,-_,m,0,0,0,1)},y.iau2006XysData=new l,y.earthOrientationParameters=u.NONE;var z=32.184,b=2451545;y.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+z,i=t.stop.dayNumber,a=t.stop.secondsOfDay+z,o=y.iau2006XysData.preload(n,r,i,a),u=y.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},y.computeIcrfToFixedMatrix=function(e,t){a(t)||(t=new E);var n=y.computeFixedToIcrfMatrix(e,t);if(a(n))return E.transpose(n,t)};var q=new h(0,0,0),G=new s(0,0,0,0,0,0),W=new E,X=new E;y.computeFixedToIcrfMatrix=function(e,t){a(t)||(t=new E);var n=y.earthOrientationParameters.compute(e,G);if(a(n)){var r=e.dayNumber,i=e.secondsOfDay+z,o=y.iau2006XysData.computeXysRadians(r,i,q);if(a(o)){var u=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=W;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 h=E.fromRotationZ(-o.s,X),m=E.multiply(l,h,W),_=e.dayNumber,R=e.secondsOfDay-d.computeTaiMinusUtc(e)+n.ut1MinusUtc,T=_-2451545,S=R/p.SECONDS_PER_DAY,A=.779057273264+S+.00273781191135448*(T+S);A=A%1*f.TWO_PI;var N=E.fromRotationZ(A,X),M=E.multiply(m,N,W),I=Math.cos(n.xPoleWander),v=Math.cos(n.yPoleWander),O=Math.sin(n.xPoleWander),g=Math.sin(n.yPoleWander),x=r-b+i/p.SECONDS_PER_DAY;x/=36525;var w=-47e-6*x*f.RADIANS_PER_DEGREE/3600,C=Math.cos(w),P=Math.sin(w),U=X;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,E.multiply(M,U,t)}}};var V=new r;y.pointToWindowCoordinates=function(e,t,n,r){return r=y.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},y.pointToGLWindowCoordinates=function(e,n,i,o){a(o)||(o=new t);var u=V;return m.multiplyByVector(e,r.fromElements(i.x,i.y,i.z,1,u),u),r.multiplyByScalar(u,1/u.w,u),m.multiplyByVector(n,u,u),t.fromCartesian4(u,o)};var H=new n,Y=new n,Z=new n;return y.rotationMatrixFromPositionVelocity=function(e,t,r,o){var u=i(r,c.WGS84).geodeticSurfaceNormal(e,H),s=n.cross(t,u,Y);n.equalsEpsilon(s,n.ZERO,f.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var l=n.cross(s,t,Z);return n.cross(t,l,s),n.negate(s,s),a(o)||(o=new E),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=s.x,o[4]=s.y,o[5]=s.z,o[6]=l.x,o[7]=l.y,o[8]=l.z,o},y}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix3","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,i,a,o,u,s,c,l,h,d,f,E){"use strict";function m(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(h.getColumn(r,0,_)),this._yAxis=n.fromCartesian4(h.getColumn(r,1,_));var a=n.fromCartesian4(h.getColumn(r,2,_));this._plane=d.fromPointNormal(e,a)}var _=new r;o(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 p=new e;m.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new m(r.center,n)};var y=new f,R=new n;m.prototype.projectPointOntoPlane=function(e,r){var i=y;i.origin=e,n.normalize(e,i.direction);var o=c.rayPlane(i,this._plane,R);if(a(o)||(n.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,R)),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)}},m.prototype.projectPointsOntoPlane=function(e,t){a(t)||(t=[]);for(var n=0,r=e.length,i=0;r>i;i++){var o=this.projectPointOntoPlane(e[i],t[n]);a(o)&&(t[n]=o,n++)}return t.length=n,t},m.prototype.projectPointToNearestOnPlane=function(e,r){a(r)||(r=new t);var i=y;i.origin=e,n.clone(this._plane.normal,i.direction);var o=c.rayPlane(i,this._plane,R);a(o)||(n.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,R));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},m.prototype.projectPointsToNearestOnPlane=function(e,t){a(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;n>r;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return m.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;r>l;++l){var h=e[l];n.multiplyByScalar(u,h.x,c),a(t[l])||(t[l]=new n);var d=n.add(o,c,t[l]);n.multiplyByScalar(s,h.y,c),n.add(d,c,d),i.scaleToGeocentricSurface(d,d)}return t},m}),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,h,d,f,E){"use strict";function m(e,t){this.center=n.clone(i(e,n.ZERO)),this.halfAxes=d.clone(i(t,d.ZERO))}function _(e,t,r,i,o,u,s,c){a(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 h=M;h.x=(t+r)/2,h.y=(i+o)/2,h.z=(u+s)/2;var f=I;f.x=(r-t)/2,f.y=(o-i)/2,f.z=(s-u)/2;var E=c.center;return h=d.multiplyByVector(l,h,h),n.add(e.origin,h,E),d.multiplyByScale(l,f,l),c}var p=new n,y=new n,R=new n,T=new n,S=new n,A=new d,N={unitary:new d,diagonal:new d};m.fromPoints=function(e,t){if(a(t)||(t=new m),!a(e)||0===e.length)return t.halfAxes=d.ZERO,t.center=n.ZERO,t;var r,i=e.length,o=n.clone(e[0],p);for(r=1;i>r;r++)n.add(o,e[r],o);var u=1/i;n.multiplyByScalar(o,u,o);var s,c=0,l=0,h=0,f=0,E=0,_=0;for(r=0;i>r;r++)s=n.subtract(e[r],o,y),c+=s.x*s.x,l+=s.x*s.y,h+=s.x*s.z,f+=s.y*s.y,E+=s.y*s.z,_+=s.z*s.z;c*=u,l*=u,h*=u,f*=u,E*=u,_*=u;var M=A;M[0]=c,M[1]=l,M[2]=h,M[3]=l,M[4]=f,M[5]=E,M[6]=h,M[7]=E,M[8]=_;var I=d.computeEigenDecomposition(M,N),v=d.transpose(I.unitary,t.halfAxes);s=n.subtract(e[0],o,y);var O=d.multiplyByVector(v,s,R),g=n.clone(O,T),x=n.clone(O,S);for(r=1;i>r;r++)s=n.subtract(e[r],o,s),d.multiplyByVector(v,s,O),n.minimumByComponent(x,O,x),n.maximumByComponent(g,O,g);var w=n.add(x,g,R);n.multiplyByScalar(w,.5,w),d.multiplyByVector(v,w,w),n.add(o,w,t.center);var C=n.subtract(g,x,R);return n.multiplyByScalar(C,.5,C),d.multiplyByScale(t.halfAxes,C,t.halfAxes),t};var M=new n,I=new n,v=new r,O=new n,g=[new r,new r,new r,new r,new r,new r,new r,new r],x=[new n,new n,new n,new n,new n,new n,new n,new n],w=[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),h=l.plane,d=g[0],m=g[1],p=g[2],y=g[3],R=g[4],T=g[5],S=g[6],A=g[7],N=o.longitude,M=e.south<0&&e.north>0?0:o.latitude;S.latitude=T.latitude=R.latitude=e.south,A.latitude=y.latitude=M,d.latitude=m.latitude=p.latitude=e.north,S.longitude=A.longitude=d.longitude=e.west,T.longitude=m.longitude=N,R.longitude=y.longitude=p.longitude=e.east,p.height=m.height=d.height=A.height=S.height=T.height=R.height=y.height=n,r.cartographicArrayToCartesianArray(g,x),l.projectPointsToNearestOnPlane(x,w);var I=Math.min(w[6].x,w[7].x,w[0].x),C=Math.max(w[2].x,w[3].x,w[4].x),P=Math.min(w[4].y,w[5].y,w[6].y),U=Math.max(w[0].y,w[1].y,w[2].y);p.height=d.height=R.height=S.height=t,r.cartographicArrayToCartesianArray(g,x);var D=Math.min(f.getPointDistance(h,x[0]),f.getPointDistance(h,x[2]),f.getPointDistance(h,x[4]),f.getPointDistance(h,x[6])),L=n;return _(l,I,C,P,U,D,L,a)},m.clone=function(e,t){return a(e)?a(t)?(n.clone(e.center,t.center),d.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes):void 0},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[d.COLUMN0ROW0]+u*a[d.COLUMN0ROW1]+s*a[d.COLUMN0ROW2])+Math.abs(o*a[d.COLUMN1ROW0]+u*a[d.COLUMN1ROW1]+s*a[d.COLUMN1ROW2])+Math.abs(o*a[d.COLUMN2ROW0]+u*a[d.COLUMN2ROW1]+s*a[d.COLUMN2ROW2]),h=n.dot(i,r)+t.distance;return-l>=h?c.OUTSIDE:h>=l?c.INSIDE:c.INTERSECTING};var C=new n,P=new n,U=new n,D=new n;m.distanceSquaredTo=function(e,t){var r=n.subtract(t,e.center,M),i=e.halfAxes,a=d.getColumn(i,0,C),o=d.getColumn(i,1,P),u=d.getColumn(i,2,U),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 h=D;h.x=n.dot(r,a),h.y=n.dot(r,o),h.z=n.dot(r,u);var f,E=0;return h.x<-s?(f=h.x+s,E+=f*f):h.x>s&&(f=h.x-s,E+=f*f),h.y<-c?(f=h.y+c,E+=f*f):h.y>c&&(f=h.y-c,E+=f*f),h.z<-l?(f=h.z+l,E+=f*f):h.z>l&&(f=h.z-l,E+=f*f),E};var L=new n,F=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,h=d.getColumn(c,0,C),f=d.getColumn(c,1,P),E=d.getColumn(c,2,U),m=n.add(h,f,L);n.add(m,E,m),n.add(m,s,m);var _=n.subtract(m,t,F),p=n.dot(r,_);return o=Math.min(p,o),u=Math.max(p,u),n.add(s,h,m),n.add(m,f,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,h,m),n.subtract(m,f,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,h,m),n.subtract(m,f,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,h,m),n.add(m,f,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,h,m),n.add(m,f,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,h,m),n.subtract(m,f,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,h,m),n.subtract(m,f,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,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)&&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",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,n,r,i,a){"use strict";if(!i.supportsTypedArrays())return{};var o={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.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.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return n(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,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.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(e,n,i,a){switch(i=t(i,0),a=t(a,(n.byteLength-i)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,i,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,i,a);case o.SHORT:return new Int16Array(n,i,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,i,a);case o.FLOAT:return new Float32Array(n,i,a);case o.DOUBLE:return new Float64Array(n,i,a);default:throw new r("componentDatatype is not a valid value.")}},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","./defined","./Math","./Matrix3","./Matrix4","./TerrainQuantization"],function(e,t,n,r,i,a,o,u,s){"use strict";function c(e,t,r,a,o){var c,d,_,p;if(i(e)&&i(t)&&i(r)&&i(a)){var y=e.minimum,R=e.maximum,T=n.subtract(R,y,h),S=r-t,A=Math.max(n.maximumComponent(T),S);c=m-1>A?s.BITS12:s.NONE,d=e.center,_=u.inverseTransformation(a,new u);var N=n.negate(y,l);u.multiply(u.fromTranslation(N,f),_,_);var M=l;M.x=1/T.x,M.y=1/T.y,M.z=1/T.z,u.multiply(u.fromScale(M,f),_,_),p=u.clone(a),u.setTranslation(p,n.ZERO,p),a=u.clone(a,new u);var I=u.fromTranslation(y,f),v=u.fromScale(T,E),O=u.multiply(I,v,f);u.multiply(a,O,a),u.multiply(p,O,p)}this.quantization=c,this.minimumHeight=t,this.maximumHeight=r,this.center=d,this.toScaledENU=_,this.fromScaledENU=a,this.matrix=p,this.hasVertexNormals=o}var l=new n,h=new n,d=new t,f=new u,E=new u,m=Math.pow(2,12);c.prototype.encode=function(r,i,o,c,h,f){var E=c.x,m=c.y;if(this.quantization===s.BITS12){o=u.multiplyByPoint(this.toScaledENU,o,l),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 _=this.maximumHeight-this.minimumHeight,p=a.clamp((h-this.minimumHeight)/_,0,1);t.fromElements(o.x,o.y,d);var y=e.compressTextureCoordinates(d);t.fromElements(o.z,p,d);var R=e.compressTextureCoordinates(d);t.fromElements(E,m,d);var T=e.compressTextureCoordinates(d);r[i++]=y,r[i++]=R,r[i++]=T}else n.subtract(o,this.center,l),r[i++]=l.x,r[i++]=l.y,r[i++]=l.z,r[i++]=h,r[i++]=E,r[i++]=m;return this.hasVertexNormals&&(r[i++]=e.octPackFloat(f)),i},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 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.hasVertexNormals&&++e,e};var _={position3DAndHeight:0,textureCoordAndEncodedNormals:1},p={compressed:0};return c.prototype.getAttributes=function(e){var t=r.FLOAT;if(this.quantization===s.NONE){var n=r.getSizeInBytes(t),i=4,a=this.hasVertexNormals?3:2,o=(this.hasVertexNormals?7:6)*n;return[{index:_.position3DAndHeight,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:i,offsetInBytes:0,strideInBytes:o},{index:_.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:a,offsetInBytes:i*n,strideInBytes:o}]}var u=3;return u+=this.hasVertexNormals?1:0,[{index:p.compressed,vertexBuffer:e,componentDatatype:t,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},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(c){c instanceof Error?o.error={name:c.name,message:c.message,stack:c.stack}:o.error=c}t(i)||(i=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(a.length=0);try{i(o,a)}catch(c){o.result=void 0,o.error="postMessage failed with error: "+n(c)+"\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,h,d,f){"use strict";function E(e,n){var i=e.isEastChild,a=e.isNorthChild,f=i?R:0,E=i?y:R,_=a?R:0,L=a?y:R,F=I,B=v,z=O,b=x;F.length=0,B.length=0,z.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,Z=d.clone(e.encoding),k=Z.hasVertexNormals,j=0,K=e.vertexCountWithoutSkirts,J=e.minimumHeight,Q=e.maximumHeight,$=new Array(K),ee=new Array(K),te=new Array(K),ne=k?new Array(2*K):void 0,re=20;for(H=0,Y=0;K>H;++H,Y+=2){var ie=Z.decodeTextureCoordinates(W,H,U);if(V=Z.decodeHeight(W,H),$[H]=l.clamp(ie.x*y|0,0,y),ee[H]=l.clamp(ie.y*y|0,0,y),te[H]=l.clamp((V-J)/(Q-J)*y|0,0,y),$[H]<re&&($[H]=0),ee[H]<re&&(ee[H]=0),y-$[H]<re&&($[H]=y),y-ee[H]<re&&(ee[H]=y),k){var ae=Z.getOctEncodedNormal(W,H,D);ne[Y]=ae.x,ne[Y+1]=ae.y}}var oe,ue;for(H=0,Y=0;K>H;++H,Y+=2)oe=$[H],ue=ee[H],(i&&oe>=R||!i&&R>=oe)&&(a&&ue>=R||!a&&R>=ue)&&(G[H]=j,F.push(oe),B.push(ue),z.push(te[H]),k&&(b.push(ne[Y]),b.push(ne[Y+1])),++j);var se=[];se.push(new m),se.push(new m),se.push(new m);var ce=[];ce.push(new m),ce.push(new m),ce.push(new m);var le,he;for(H=0;H<X.length;H+=3){var de=X[H],fe=X[H+1],Ee=X[H+2],me=$[de],_e=$[fe],pe=$[Ee];se[0].initializeIndexed($,ee,te,ne,de),se[1].initializeIndexed($,ee,te,ne,fe),se[2].initializeIndexed($,ee,te,ne,Ee);var ye=c.clipTriangleAtAxisAlignedThreshold(R,i,me,_e,pe,T);le=0,le>=ye.length||(le=ce[0].initializeFromClipResult(ye,le,se),le>=ye.length||(le=ce[1].initializeFromClipResult(ye,le,se),le>=ye.length||(le=ce[2].initializeFromClipResult(ye,le,se),he=c.clipTriangleAtAxisAlignedThreshold(R,a,ce[0].getV(),ce[1].getV(),ce[2].getV(),S),p(F,B,z,b,q,G,he,ce,k),le<ye.length&&(ce[2].clone(ce[1]),ce[2].initializeFromClipResult(ye,le,se),he=c.clipTriangleAtAxisAlignedThreshold(R,a,ce[0].getV(),ce[1].getV(),ce[2].getV(),S),p(F,B,z,b,q,G,he,ce,k)))))}var Re=i?-y:0,Te=a?-y:0,Se=[],Ae=[],Ne=[],Me=[],Ie=Number.MAX_VALUE,ve=-Ie,Oe=A;Oe.length=0;var ge=o.clone(e.ellipsoid),xe=e.childRectangle,we=xe.north,Ce=xe.south,Pe=xe.east,Ue=xe.west;for(Ue>Pe&&(Pe+=l.TWO_PI),H=0;H<F.length;++H)oe=Math.round(F[H]),f>=oe?(Se.push(H),oe=0):oe>=E?(Ne.push(H),oe=y):oe=2*oe+Re,F[H]=oe,ue=Math.round(B[H]),_>=ue?(Ae.push(H),ue=0):ue>=L?(Me.push(H),ue=y):ue=2*ue+Te,B[H]=ue,V=l.lerp(J,Q,z[H]/y),Ie>V&&(Ie=V),V>ve&&(ve=V),z[H]=V,N.longitude=l.lerp(Ue,Pe,oe/y),N.latitude=l.lerp(Ce,we,ue/y),N.height=V,ge.cartographicToCartesian(N,M),Oe.push(M.x),Oe.push(M.y),Oe.push(M.z);var De=t.fromVertices(Oe,r.ZERO,3,C),Le=h.fromRectangle(xe,Ie,ve,ge,P),Fe=new u(ge),Be=Fe.computeHorizonCullingPointFromVertices(De.center,Oe,3,De.center,w),ze=ve-Ie,be=new Uint16Array(F.length+B.length+z.length);for(H=0;H<F.length;++H)be[H]=F[H];var qe=F.length;for(H=0;H<B.length;++H)be[qe+H]=B[H];for(qe+=B.length,H=0;H<z.length;++H)be[qe+H]=y*(z[H]-Ie)/ze;var Ge,We=s.createTypedArray(F.length,q);if(k){var Xe=new Uint8Array(b);n.push(be.buffer,We.buffer,Xe.buffer),Ge=Xe.buffer}else n.push(be.buffer,We.buffer);return{vertices:be.buffer,encodedNormals:Ge,indices:We.buffer,minimumHeight:Ie,maximumHeight:ve,westIndices:Se,southIndices:Ae,eastIndices:Ne,northIndices:Me,boundingSphere:De,orientedBoundingBox:Le,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 _(t,n){++F;var i=B[F],a=z[F];return i=e.octDecode(t.first.getNormalX(),t.first.getNormalY(),i),a=e.octDecode(t.second.getNormalX(),t.second.getNormalY(),a),M=r.lerp(i,a,t.ratio,M),r.normalize(M,M),e.octEncode(M,n),--F,n}function p(e,t,n,r,i,o,u,s,c){if(0!==u.length){for(var l=0,h=0;h<u.length;)h=b[l++].initializeFromClipResult(u,h,s);for(var d=0;l>d;++d){var f=b[d];if(f.isIndexed())f.newIndex=o[f.index],f.uBuffer=e,f.vBuffer=t,f.heightBuffer=n,c&&(f.normalBuffer=r);else{var E=f.getKey();if(a(o[E]))f.newIndex=o[E];else{var m=e.length;e.push(f.getU()),t.push(f.getV()),n.push(f.getH()),c&&(r.push(f.getNormalX()),r.push(f.getNormalY())),f.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,R=y/2|0,T=[],S=[],A=[],N=new i,M=new r,I=[],v=[],O=[],g=[],x=[],w=new r,C=new t,P=new h,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-1!==e[t]?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,B=[new r,new r],z=[new r,new r];m.prototype.getNormalX=function(){return a(this.index)?this.normalBuffer[2*this.index]:(L=_(this,L),L.x)},m.prototype.getNormalY=function(){return a(this.index)?this.normalBuffer[2*this.index+1]:(L=_(this,L),L.y)};var b=[];return b.push(new m),b.push(new m),b.push(new m),b.push(new m),f(E)})}(); \ No newline at end of file